]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
KVM: VMX: Move private memory slot position
authorSheng Yang <sheng@linux.intel.com>
Thu, 16 Oct 2008 09:30:58 +0000 (17:30 +0800)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:51:46 +0000 (16:51 +0200)
PCI device assignment would map guest MMIO spaces as separate slot, so it is
possible that the device has more than 2 MMIO spaces and overwrite current
private memslot.

The patch move private memory slot to the top of userspace visible memory slots.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/vmx.h

index dae134fa09e7edeb79eeec34202fc521ad194fe5..7623eb7b68d5bba835cff3e28a2f05845d20f6fd 100644 (file)
@@ -2513,7 +2513,7 @@ static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
 {
        int ret;
        struct kvm_userspace_memory_region tss_mem = {
-               .slot = 8,
+               .slot = TSS_PRIVATE_MEMSLOT,
                .guest_phys_addr = addr,
                .memory_size = PAGE_SIZE * 3,
                .flags = 0,
index 18598afe52eb3af7e492b30e07c9e3f8d871b28f..3db236c26fa42c9e5be0e046d45e3ebc99998ee3 100644 (file)
@@ -338,8 +338,9 @@ enum vmcs_field {
 
 #define AR_RESERVD_MASK 0xfffe0f00
 
-#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT       9
-#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT     10
+#define TSS_PRIVATE_MEMSLOT                    (KVM_MEMORY_SLOTS + 0)
+#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT       (KVM_MEMORY_SLOTS + 1)
+#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT     (KVM_MEMORY_SLOTS + 2)
 
 #define VMX_NR_VPIDS                           (1 << 16)
 #define VMX_VPID_EXTENT_SINGLE_CONTEXT         1