Exceptions don't deliver an error code in real mode.
MFC after: 1 week
This commit is contained in:
parent
b0dd717602
commit
47b9935d9b
@ -1785,6 +1785,7 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vector, int errcode_valid,
|
|||||||
uint32_t errcode, int restart_instruction)
|
uint32_t errcode, int restart_instruction)
|
||||||
{
|
{
|
||||||
struct vcpu *vcpu;
|
struct vcpu *vcpu;
|
||||||
|
uint64_t regval;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (vcpuid < 0 || vcpuid >= VM_MAXCPU)
|
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);
|
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, ®val);
|
||||||
|
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:
|
* From section 26.6.1 "Interruptibility State" in Intel SDM:
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user