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

[Xen-changelog] [xen staging] x86/shadow: Drop incorrect diagnostic when shadowing TSS.RSP0



commit 668be77f36ace4d8109e1e3e0a46756b011a5a95
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu May 26 17:37:30 2016 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon May 13 10:35:37 2019 +0100

    x86/shadow: Drop incorrect diagnostic when shadowing TSS.RSP0
    
    During development of the XTF pagewalk tests, I reliably encountered this
    message exactly once per run.  It occurs when the first action to touch
    TSS.RSP0 is an interrupt/exception taken in userspace, and the processor 
tries
    to push the IRET frame.
    
    Subsequently, OSSTest has demonstrated that it triggers frequently for a
    KPTI-enabled kernel.
    
      (XEN) multi.c:3324:d1v1 write to pagetable during event injection: 
cr2=0xffffad2646687f38, mfn=0x2415a1
      [ 1411.949155] systemd-logind[2683]: New session 73 of user root.
      (XEN) multi.c:3324:d1v1 write to pagetable during event injection: 
cr2=0xffffad264671ff38, mfn=0x240a41
      (XEN) multi.c:3324:d1v1 write to pagetable during event injection: 
cr2=0xffffad2646837f38, mfn=0x2415c5
      (XEN) multi.c:3324:d1v1 write to pagetable during event injection: 
cr2=0xffffad26468a7f38, mfn=0x2414e7
      [ 1442.207473] systemd-logind[2683]: New session 74 of user root.
      [ 1471.452206] systemd-logind[2683]: New session 75 of user root.
      (XEN) multi.c:3324:d1v1 write to pagetable during event injection: 
cr2=0xffffad2646d17f08, mfn=0x2417c5
      [ 1501.698971] systemd-logind[2683]: New session 76 of user root.
    
    The actions performed by the shadow code are correct, and the guest 
continues
    without error, but the emitted error is misleading.  Tweak the comment to 
more
    clearly identify why the condition exists, but drop the message.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Tim Deegan <tim@xxxxxxx>
---
 xen/arch/x86/mm/shadow/multi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 1d282c928f..5f8a745de2 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3305,10 +3305,12 @@ static int sh_page_fault(struct vcpu *v,
     {
         /*
          * If we are in the middle of injecting an exception or interrupt then
-         * we should not emulate: it is not the instruction at %eip that caused
-         * the fault. Furthermore it is almost certainly the case the handler
-         * stack is currently considered to be a page table, so we should
-         * unshadow the faulting page before exiting.
+         * we should not emulate: the fault is a side effect of the processor
+         * trying to deliver the exception (e.g. IDT/GDT accesses, pushing the
+         * exception frame onto the stack).  Furthermore it is almost
+         * certainly the case the handler stack is currently considered to be
+         * a page table, so we should unshadow the faulting page before
+         * exiting.
          */
         if ( unlikely(hvm_event_pending(v)) )
         {
@@ -3319,9 +3321,6 @@ static int sh_page_fault(struct vcpu *v,
                 v->arch.paging.last_write_emul_ok = 0;
             }
 #endif
-            gdprintk(XENLOG_DEBUG, "write to pagetable during event "
-                     "injection: cr2=%#lx, mfn=%#lx\n",
-                     va, mfn_x(gmfn));
             sh_remove_shadows(d, gmfn, 0 /* thorough */, 1 /* must succeed */);
             trace_shadow_emulate_other(TRC_SHADOW_EMULATE_UNSHADOW_EVTINJ,
                                        va, gfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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