[PATCH 1/2] KVM: move "emul_to_vcpu"-makro to headerfile

From: Stephan Baerwolf
Date: Sat Jan 07 2012 - 15:20:43 EST


In order to take advantage of "emul_to_vpu" in other
C-files, this makro has been moved to the headerfile.

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@xxxxxxxxxxxxx>
---
arch/x86/kvm/x86.c | 3 ---
arch/x86/kvm/x86.h | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4c938da..ac949ba 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -64,9 +64,6 @@
#define KVM_MAX_MCE_BANKS 32
#define KVM_MCE_CAP_SUPPORTED (MCG_CTL_P | MCG_SER_P)

-#define emul_to_vcpu(ctxt) \
- container_of(ctxt, struct kvm_vcpu, arch.emulate_ctxt)
-
/* EFER defaults:
* - enable syscall per default because its emulated by KVM
* - enable LME and LMA per default on 64 bit KVM
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index d36fe23..644c843 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -4,6 +4,9 @@
#include <linux/kvm_host.h>
#include "kvm_cache_regs.h"

+#define emul_to_vcpu(ctxt) \
+ container_of(ctxt, struct kvm_vcpu, arch.emulate_ctxt)
+
static inline void kvm_clear_exception_queue(struct kvm_vcpu *vcpu)
{
vcpu->arch.exception.pending = false;
--
1.7.3.4


--------------050604050405060605030704
Content-Type: text/x-patch;
name="0002-KVM-fix-missing-illegal-instruction-trap-in-protecte.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0002-KVM-fix-missing-illegal-instruction-trap-in-protecte.pa";
filename*1="tch"