nestedhvm: return the pfec from the pagetable walk.
authorTim Deegan <tim@xen.org>
Thu, 2 Aug 2012 13:44:53 +0000 (14:44 +0100)
committerTim Deegan <tim@xen.org>
Thu, 2 Aug 2012 13:44:53 +0000 (14:44 +0100)
Don't clobber it with the pfec from teh p2m walk behind it; the guest
will not expect (or be able to handle) error codes that come from the
p2m table, which it can't see or control.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m.c

index 3cdc417d7882d89c9579c2fccea4f132956686ac..75926558fd446dc012cf2e9a0122aa1b82a3b7ef 100644 (file)
@@ -1581,6 +1581,7 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
         unsigned long gfn;
         struct p2m_domain *p2m;
         const struct paging_mode *mode;
+        uint32_t pfec_21 = *pfec;
         uint64_t ncr3 = nhvm_vcpu_hostcr3(v);
 
         /* translate l2 guest va into l2 guest gfn */
@@ -1590,7 +1591,7 @@ unsigned long paging_gva_to_gfn(struct vcpu *v,
 
         /* translate l2 guest gfn into l1 guest gfn */
         return hostmode->p2m_ga_to_gfn(v, hostp2m, ncr3,
-                                       gfn << PAGE_SHIFT, pfec, NULL);
+                                       gfn << PAGE_SHIFT, &pfec_21, NULL);
     }
 
     return hostmode->gva_to_gfn(v, hostp2m, va, pfec);