mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
4cf7e13116
commit
643c2b6bc7
3 files changed
+7
No files matched your search
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
|
||||