x86/HVM: address Misra 2.1 rule violations

In hvm_set_cr3() the "bad_cr3" label is reachable only with
SHADOW_PAGING=y; the code being there is therefore a Misra rule 2.1
(unreachable code) violation when SHADOW_PAGING=n.

Similarly code past the initial switch() in hvm_debug_op() is reachable
only when CONFIG_INTEL_VMX=y.

No functional change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger@xenproject.org>
This commit is contained in:
Jan Beulich committed 2026-09-11 08:53:58 +02:00
1 parent 7fc89f9649
commit bc24cc6b72
1 file changed
+3
+3
View File
@@ -2455,6 +2455,7 @@ int hvm_set_cr3(unsigned long value, bool noflush, bool may_defer)
return X86EMUL_OKAY;
bad_cr3:
BUILD_ERROR_IF_NOT(CONFIG_SHADOW_PAGING);
gdprintk(XENLOG_ERR, "Invalid CR3\n");
domain_crash(currd);
return X86EMUL_UNHANDLEABLE;
@@ -5201,6 +5202,8 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
return -ENOSYS;
}
BUILD_ERROR_IF_NOT(CONFIG_INTEL_VMX);
vcpu_pause(v);
switch ( op )
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.