]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()
authorJan Beulich <jbeulich@suse.com>
Wed, 20 Feb 2019 16:07:17 +0000 (17:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Feb 2019 16:07:17 +0000 (17:07 +0100)
64-bit PV guest user mode runs on a different L4 table. Make sure
- the accessed bit gets set in the correct table (and in log-dirty
  mode the correct page gets marked dirty) during guest walks,
- the correct table gets audited by sh_audit_gw(),
- correct info gets logged by print_gw().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/mm/shadow/multi.c

index 7e9cbc69be97e505a869d723ddc4944cb8fc1837..8fa0326a918e2c3dd37f3ddd13003229c71b3367 100644 (file)
@@ -180,7 +180,10 @@ sh_walk_guest_tables(struct vcpu *v, unsigned long va, walk_t *gw,
                              INVALID_MFN,
                              v->arch.paging.shadow.gl3e
 #else /* 32 or 64 */
-                             pagetable_get_mfn(v->arch.guest_table),
+                             (((v->arch.flags & TF_kernel_mode) ||
+                               is_pv_32bit_vcpu(v))
+                              ? pagetable_get_mfn(v->arch.guest_table)
+                              : pagetable_get_mfn(v->arch.guest_table_user)),
                              v->arch.paging.shadow.guest_vtable
 #endif
                              );