mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
7fc89f9649
commit
bc24cc6b72
1 file changed
+3
@@ -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 )
|
||||
|
||||