]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
vmx: Do not allow emulated accesses to the vlapic mmap'ed 'magic
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Dec 2007 22:57:41 +0000 (22:57 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Dec 2007 22:57:41 +0000 (22:57 +0000)
page'.

This is the equivalent of:
xen-unstable changeset:   16663:d5f0afb58589
xen-unstable date:        Thu Dec 27 12:03:02 2007 +0000

xen/arch/x86/hvm/hvm.c
xen/arch/x86/mm/shadow/multi.c

index 7daf5e0a765b544bd601a906b8358790eb084e15..52a19aed455be993bafcbcc903a7f8ad60b7f066 100644 (file)
@@ -222,6 +222,8 @@ int hvm_domain_initialise(struct domain *d)
         return -EINVAL;
     }
 
+    d->arch.hvm_domain.vmx_apic_access_mfn = INVALID_MFN;
+
     spin_lock_init(&d->arch.hvm_domain.pbuf_lock);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
 
@@ -591,7 +593,8 @@ static enum hvm_copy_result __hvm_copy(
 
         mfn = get_mfn_from_gpfn(gfn);
 
-        if ( mfn == INVALID_MFN )
+        if ( (mfn == current->domain->arch.hvm_domain.vmx_apic_access_mfn) ||
+             (mfn == INVALID_MFN) )
         {
             rc = HVMCOPY_bad_gfn_to_mfn;
             goto out;
index 6930ef6edf2d16eddd722d94511eaf1f9f41186b..127946d4719ec46c4df3fcf63770b91c7b8cd295 100644 (file)
@@ -4015,7 +4015,8 @@ static inline void *emulate_map_dest(struct vcpu *v,
     if ( !(flags & _PAGE_RW) ) 
         goto page_fault;
 
-    if ( mfn_valid(mfn) )
+    if ( mfn_valid(mfn) &&
+         (mfn_x(mfn) != v->domain->arch.hvm_domain.vmx_apic_access_mfn) )
     {
         *mfnp = mfn;
         v->arch.paging.last_write_was_pt = !!sh_mfn_is_a_page_table(mfn);