Skip to content

Commit eb328d7

Browse files
fyin1wenlingz
authored andcommitted
hv: retain rip if the fault is injected to guest
According to SDM 6.5 exception classification, if the fault happens, the CPU will return to the faulting instruction. So we shouldn't change rip to the next instruction if inject fault to guest. Tracked-On: #1473 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 348e2ba commit eb328d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hypervisor/arch/x86/virq.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ static void vcpu_inject_exception(struct vcpu *vcpu, uint32_t vector)
261261
(exception_type[vector] << 8U) | (vector & 0xFFU));
262262

263263
vcpu->arch_vcpu.exception_info.exception = VECTOR_INVALID;
264+
265+
/* retain rip for exception injection */
266+
vcpu_retain_rip(vcpu);
264267
}
265268

266269
static int vcpu_inject_hi_exception(struct vcpu *vcpu)

0 commit comments

Comments
 (0)