1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-19 15:33:56 +00:00

Exceptions don't deliver an error code in real mode.

MFC after:	1 week
This commit is contained in:
Neel Natu 2015-05-23 01:17:50 +00:00
parent b0dd717602
commit 47b9935d9b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283308

View File

@ -1785,6 +1785,7 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vector, int errcode_valid,
uint32_t errcode, int restart_instruction)
{
struct vcpu *vcpu;
uint64_t regval;
int error;
if (vcpuid < 0 || vcpuid >= VM_MAXCPU)
@ -1809,6 +1810,16 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vector, int errcode_valid,
return (EBUSY);
}
if (errcode_valid) {
/*
* Exceptions don't deliver an error code in real mode.
*/
error = vm_get_register(vm, vcpuid, VM_REG_GUEST_CR0, &regval);
KASSERT(!error, ("%s: error %d getting CR0", __func__, error));
if (!(regval & CR0_PE))
errcode_valid = 0;
}
/*
* From section 26.6.1 "Interruptibility State" in Intel SDM:
*