[PATCH WIP 07/14] xen/hvm: Don't skip MSR_READ trace record

George Dunlap posted 14 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH WIP 07/14] xen/hvm: Don't skip MSR_READ trace record
Posted by George Dunlap 2 months, 3 weeks ago
Commit 37f074a3383 ("x86/msr: introduce guest_rdmsr()") introduced a
function to combine the MSR_READ handling between PV and HVM.
Unfortunately, by returning directly, it skipped the trace generation,
leading to gaps in the trace record, as well as xenalyze errors like
this:

hvm_generic_postprocess: d2v0 Strange, exit 7c(VMEXIT_MSR) missing a handler

Replace the `return` with `goto out`.

Fixes: 37f074a3383 ("x86/msr: introduce guest_rdmsr()")
Signed-off-by: George Dunlap <george.dunlap@cloud.com>
---
 xen/arch/x86/hvm/hvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 7f4b627b1f..0fe2b85b16 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3557,7 +3557,7 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
     fixed_range_base = (uint64_t *)v->arch.hvm.mtrr.fixed_ranges;
 
     if ( (ret = guest_rdmsr(v, msr, msr_content)) != X86EMUL_UNHANDLEABLE )
-        return ret;
+        goto out;
 
     ret = X86EMUL_OKAY;
 
-- 
2.25.1
Re: [PATCH WIP 07/14] xen/hvm: Don't skip MSR_READ trace record
Posted by Jan Beulich 1 month, 2 weeks ago
On 26.06.2024 15:38, George Dunlap wrote:
> Commit 37f074a3383 ("x86/msr: introduce guest_rdmsr()") introduced a
> function to combine the MSR_READ handling between PV and HVM.
> Unfortunately, by returning directly, it skipped the trace generation,
> leading to gaps in the trace record, as well as xenalyze errors like
> this:
> 
> hvm_generic_postprocess: d2v0 Strange, exit 7c(VMEXIT_MSR) missing a handler
> 
> Replace the `return` with `goto out`.
> 
> Fixes: 37f074a3383 ("x86/msr: introduce guest_rdmsr()")
> Signed-off-by: George Dunlap <george.dunlap@cloud.com>

Noticed only now that there's a bug fix hidden in this series.

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan