[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()

commit db2af23d15077605f286d8ef86c8f5d9c1b8302a
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Feb 20 17:07:17 2019 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 20 17:07:17 2019 +0100

    x86/shadow: don't pass wrong L4 MFN to guest_walk_tables()
    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
 xen/arch/x86/mm/shadow/multi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 7e9cbc69be..8fa0326a91 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -180,7 +180,10 @@ sh_walk_guest_tables(struct vcpu *v, unsigned long va, 
walk_t *gw,
 #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)),
generated by git-patchbot for /home/xen/git/xen.git#master

Xen-changelog mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.