Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1200737

[PATCH 1/5] KVM: add kvm_has_request wrapper

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 1/5] KVM: add kvm_has_request wrapper
Date 2015-08-05 15:30 +0200
Message-ID <pU6VC-2zD-41@gated-at.bofh.it> (permalink)
References <pU6VA-2zD-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We want to have requests abstracted from bit operations.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 arch/x86/kvm/vmx.c       | 2 +-
 include/linux/kvm_host.h | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 217f66343dc8..17514fe7d2cb 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5879,7 +5879,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
 		if (intr_window_requested && vmx_interrupt_allowed(vcpu))
 			return handle_interrupt_window(&vmx->vcpu);
 
-		if (test_bit(KVM_REQ_EVENT, &vcpu->requests))
+		if (kvm_has_request(KVM_REQ_EVENT, vcpu))
 			return 1;
 
 		err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 27ccdf91a465..52e388367a26 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1089,9 +1089,14 @@ static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu)
 	set_bit(req, &vcpu->requests);
 }
 
+static inline bool kvm_has_request(int req, struct kvm_vcpu *vcpu)
+{
+	return test_bit(req, &vcpu->requests);
+}
+
 static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
 {
-	if (test_bit(req, &vcpu->requests)) {
+	if (kvm_has_request(req, vcpu)) {
 		clear_bit(req, &vcpu->requests);
 		return true;
 	} else {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] KVM: optimize userspace exits with a new ioctl Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:30 +0200
  [PATCH 4/5] KVM: optimize common cases in KVM_USER_EXIT Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:30 +0200
  [PATCH 1/5] KVM: add kvm_has_request wrapper Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:30 +0200
  [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:30 +0200
    Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:40 +0200
      Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-05 15:40 +0200
        Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:50 +0200
    Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Paolo Bonzini <pbonzini@redhat.com> - 2015-08-05 15:40 +0200
  [PATCH 5/5] KVM: x86: add request_exits debug counter Radim Krčmář <rkrcmar@redhat.com> - 2015-08-05 15:30 +0200

csiph-web