x86/hvm: add defensive statements in unreachable program points

As a defensive measure, make sure to signal an error to the caller
if an unreachable program point is reached.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Federico Serafini authored and Jan Beulich committed 2024-07-31 13:09:58 +02:00
1 parent 4cf7e13116
commit 643c2b6bc7
3 files changed
+7

No files matched your search

+1
View File
@@ -2673,6 +2673,7 @@ static int _hvm_emulate_one(struct hvm_emulate_ctxt *hvmemul_ctxt,
default:
ASSERT_UNREACHABLE();
return X86EMUL_UNHANDLEABLE;
}
if ( hvmemul_ctxt->ctxt.retire.singlestep )
+4
View File
@@ -4919,6 +4919,8 @@ static int do_altp2m_op(
default:
ASSERT_UNREACHABLE();
rc = -EOPNOTSUPP;
break;
}
out:
@@ -5020,6 +5022,8 @@ static int compat_altp2m_op(
default:
ASSERT_UNREACHABLE();
rc = -EOPNOTSUPP;
break;
}
return rc;
+2
View File
@@ -1446,6 +1446,7 @@ struct vmx_msr_entry *vmx_find_msr(const struct vcpu *v, uint32_t msr,
default:
ASSERT_UNREACHABLE();
break;
}
if ( !start )
@@ -1598,6 +1599,7 @@ int vmx_del_msr(struct vcpu *v, uint32_t msr, enum vmx_msr_list_type type)
default:
ASSERT_UNREACHABLE();
return -EINVAL;
}
if ( !start )
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.