All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/msr: add log messages to MSR state load error paths
@ 2024-10-07 14:03 Roger Pau Monne
  2024-10-07 14:16 ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Pau Monne @ 2024-10-07 14:03 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne, Jan Beulich, Andrew Cooper

Some error paths in the MSR state loading logic don't contain error messages,
which makes debugging them quite hard without adding extra patches to print the
information.

Add two new log messages to the MSR state load path that print information
about the entry that failed to load.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/hvm/hvm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 69a25571db8d..c71087f636c4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1598,10 +1598,19 @@ static int cf_check hvm_load_cpu_msrs(struct domain *d, hvm_domain_context_t *h)
             rc = guest_wrmsr(v, ctxt->msr[i].index, ctxt->msr[i].val);
 
             if ( rc != X86EMUL_OKAY )
+            {
+                printk(XENLOG_G_ERR
+                       "HVM%d.%d load MSR %#x with value %#lx failed: %d\n",
+                       d->domain_id, vcpuid, ctxt->msr[i].index,
+                       ctxt->msr[i].val, rc);
                 return -ENXIO;
+            }
             break;
 
         default:
+            printk(XENLOG_G_ERR
+                   "HVM%d.%d attempted load of unhandled MSR %#x\n",
+                   d->domain_id, vcpuid, ctxt->msr[i].index);
             return -ENXIO;
         }
     }
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-08  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 14:03 [PATCH] x86/msr: add log messages to MSR state load error paths Roger Pau Monne
2024-10-07 14:16 ` Andrew Cooper
2024-10-07 15:32   ` Roger Pau Monné
2024-10-08  6:29     ` Jan Beulich
2024-10-08  7:36       ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.