>From 50b1594999ba046c3de73e7fccbee44816c5708c Mon Sep 17 00:00:00 2001 From: Zhang Xiantao <[EMAIL PROTECTED]> Date: Tue, 20 Nov 2007 23:34:14 +0800 Subject: [PATCH] KVM Portability: Splitting kvm structure. Moving the filed apic_access_page to kvm_x86. Signed-off-by: Zhang Xiantao <[EMAIL PROTECTED]> --- drivers/kvm/kvm.h | 1 - drivers/kvm/vmx.c | 8 +++++--- drivers/kvm/x86.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index d8fdd7b..0df84b6 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -224,7 +224,6 @@ struct kvm { struct kvm_io_bus mmio_bus; struct kvm_io_bus pio_bus; int round_robin_prev_vcpu; - struct page *apic_access_page; struct kvm_vm_stat stat; }; diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 02593ad..d5df045 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1470,10 +1470,11 @@ static void seg_setup(int seg) static int alloc_apic_access_page(struct kvm *kvm) { struct kvm_userspace_memory_region kvm_userspace_mem; + struct kvm_x86 *kvm_x86 = to_kvm_x86(kvm); int r = 0; mutex_lock(&kvm->lock); - if (kvm->apic_access_page) + if (kvm_x86->apic_access_page) goto out; kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT; kvm_userspace_mem.flags = 0; @@ -1482,7 +1483,7 @@ static int alloc_apic_access_page(struct kvm *kvm) r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); if (r) goto out; - kvm->apic_access_page = gfn_to_page(kvm, 0xfee00); + kvm_x86->apic_access_page = gfn_to_page(kvm, 0xfee00); out: mutex_unlock(&kvm->lock); return r; @@ -1605,6 +1606,7 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); + struct kvm_x86 *kvm_x86 = to_kvm_x86(vcpu->kvm); u64 msr; int ret; @@ -1697,7 +1699,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) vmcs_write64(APIC_ACCESS_ADDR, - page_to_phys(vmx->vcpu.kvm->apic_access_page)); + page_to_phys(kvm_x86->apic_access_page)); vmx->vcpu.cr0 = 0x60000010; vmx_set_cr0(&vmx->vcpu, vmx->vcpu.cr0); /* enter rmode */ diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h index ebd5ae0..11f7626 100644 --- a/drivers/kvm/x86.h +++ b/drivers/kvm/x86.h @@ -260,6 +260,7 @@ struct kvm_x86 { struct kvm_pic *vpic; struct kvm_ioapic *vioapic; unsigned int tss_addr; + struct page *apic_access_page; }; static inline struct kvm_x86 *to_kvm_x86(struct kvm *kvm) -- 1.5.1.2
0008-KVM-Portability-Splitting-kvm-structure.patch
Description: 0008-KVM-Portability-Splitting-kvm-structure.patch
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel