Up until f61685a66903 ("x86: remove defunct init/load/save_msr()
hvm_funcs") the check of the _rsvd field served as an error check for
the earlier hvm_funcs.save_msr() invocation. With that invocation gone
the check makes no sense anymore. While dropping it also merge the two
paths setting "err" to -ENXIO.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
---
We could go further here, removing the local "err" variable altogether,
by using "return -ENXIO". Thoughts.

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1494,13 +1494,12 @@ static int cf_check hvm_load_cpu_msrs(st
         case MSR_AMD64_DR1_ADDRESS_MASK ... MSR_AMD64_DR3_ADDRESS_MASK:
             rc = guest_wrmsr(v, ctxt->msr[i].index, ctxt->msr[i].val);
 
-            if ( rc != X86EMUL_OKAY )
-                err = -ENXIO;
-            break;
+            if ( rc == X86EMUL_OKAY )
+                continue;
 
+            fallthrough;
         default:
-            if ( !ctxt->msr[i]._rsvd )
-                err = -ENXIO;
+            err = -ENXIO;
             break;
         }
     }

Reply via email to