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

[PATCH] x86/traps: Make nmi_show_execution_state() more useful


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 12 Aug 2022 18:33:22 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 12 Aug 2022 17:34:25 +0000
  • Ironport-data: A9a23:2fN/m66Ibxz5LbwDh8IVegxRtFHHchMFZxGqfqrLsTDasY5as4F+v jRNUD2EOfneY2uheNBxYNm+pBkH6pPWzNQwGlRpr3hjHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yM6jclkf5KkYMbcICd9WAR4fykojBNnioYRj5VhxNO0GGthg /uryyHkEALjimUc3l48sfrZ8ks/5a6q4lv0g3RlDRx1lA6G/5UqJMp3yZGZdxPQXoRSF+imc OfPpJnRErTxpkpF5nuNy94XQ2VSKlLgFVHmZkl+AsBOtiNqtC0qupvXAdJHAathZ5dlqPgqo DlFncTYpQ7EpcQgksxFO/VTO3kW0aGrZNYriJVw2CCe5xSuTpfi/xlhJEYtOIwSx99bPUcU1 uEScAIRZRukue3jldpXSsE07igiBMziPYdZsXB81zDJS/0hRPgvQY2Tu4Uehm1pwJkTQ7COP KL1ahI2BPjESzRJNk0aF9QVm+Cwi2OkWzZZtEiUtew85G27IAlZj+eya4aNJIfiqcN9n2ak/ Hjj+UHAUi4IJMHC2TG0ry2cmbqa9c/8cN1LT+DpnhJwu3WMwkQDBRtQUkG0ydGboEOjX9NUK 2QP5zEj66M18SSDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJgOtc/R/6pVwH2Zzk AbUwZW5XlSDrYF5V1qa7bKVpw6LFRQzd0wfb3c2UQAOxOfs9dRbYg30cjpzLEKkpoSrR2mqk 27a/XVWa6Y71pBSifjilbzTq3f1/8WSEFZojunCdjj9hj6VcrJJcGBBBbLzyf9bZLiUQVCa1 JTvs5jPtbteZX1hecHkfQnsIF1Kz6zcWNEkqQQzd6TNDhz0k5JZQahe4StlOGBiOdsedDnib Sf74F0PvMYOYib6N/AnOupd7vjGKoC+fekJq9iONoYeCnSPXFbvEN5Sib64gDm2zRlEfVAXM paHa8e8ZUsn5VBc5GPvH481jO50rh3SMEuJGvgXOTz7jufFDJNUIJ9ZWGazghcRtfnV/ViKo okAaqNnCXx3CYXDX8UeyqZLRXhiEJTxLcmtwyCLXoZv+jZbJVw=
  • Ironport-hdrordr: A9a23:TR9V5K2ryysm5eQ/StQVNAqjBLwkLtp133Aq2lEZdPRUGvb4qy nIpoV86faUskd3ZJhOo6HiBEDtexzhHP1OkO0s1NWZLWvbUQKTRekIh+aP/9SJIVyGygc378 ddmsZFZuEYdWIK6PrH3A==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

 * Always emit current.  It's critically important.
 * Do not render (0000000000000000) for the symbol in guest context.  It's
   just line-noise.  Instead, explicitly identify which Xen vs guest context.
 * Try to tabulate the data, because there is often lots of it.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 xen/arch/x86/traps.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index b713ef7e77ce..95ef59c93bcd 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -768,8 +768,14 @@ static int cf_check nmi_show_execution_state(
     if ( opt_show_all )
         show_execution_state(regs);
     else
-        printk(XENLOG_ERR "CPU%d @ %04x:%08lx (%pS)\n", cpu, regs->cs,
-               regs->rip, guest_mode(regs) ? NULL : _p(regs->rip));
+    {
+        if ( guest_mode(regs) )
+            printk(XENLOG_ERR "CPU%d\t%pv\t%04x:%p in guest\n",
+                   cpu, current, regs->cs, _p(regs->rip));
+        else
+            printk(XENLOG_ERR "CPU%d\t%pv\t%04x:%p in Xen: %pS\n",
+                   cpu, current, regs->cs, _p(regs->rip), _p(regs->rip));
+    }
     cpumask_clear_cpu(cpu, &show_state_mask);
 
     return 1;
-- 
2.11.0




 


Rackspace

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