x86/HVM: drop stale check from hvm_load_cpu_msrs()

Up until f61685a669 ("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: It is effectively dead code due to the
checking of the field in the earlier loop.

While dropping the conditional also eliminate the "err" local variable
(using a non-standard name anyway), replaced by suitable new/adjusted
"return" statements.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2022-12-07 12:16:08 +01:00
1 parent b926dbccca
commit 60737ee9c5
1 file changed
+4 -7
+4 -7
View File
@@ -1428,7 +1428,6 @@ static int cf_check hvm_load_cpu_msrs(struct domain *d, hvm_domain_context_t *h)
struct vcpu *v;
const struct hvm_save_descriptor *desc;
struct hvm_msr *ctxt;
int err = 0;
if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
{
@@ -1479,7 +1478,7 @@ static int cf_check hvm_load_cpu_msrs(struct domain *d, hvm_domain_context_t *h)
return -EOPNOTSUPP;
/* Checking finished */
for ( i = 0; !err && i < ctxt->count; ++i )
for ( i = 0; i < ctxt->count; ++i )
{
switch ( ctxt->msr[i].index )
{
@@ -1495,17 +1494,15 @@ 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 )
err = -ENXIO;
return -ENXIO;
break;
default:
if ( !ctxt->msr[i]._rsvd )
err = -ENXIO;
break;
return -ENXIO;
}
}
return err;
return 0;
}
/* We need variable length data chunks for XSAVE area and MSRs, hence
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.