hv: Retain RIP only for fault exception.
We have trapped the #DB for split-lock emulation.
Only fault exception need RIP being retained.
Acked-by: Eddie Dong
@@ -251,8 +251,10 @@ static bool vcpu_inject_exception(struct acrn_vcpu *vcpu)
vcpu->arch.exception_info.exception = VECTOR_INVALID;
- /* retain rip for exception injection */
+ /* If this is a fault, we should retain the RIP */
+ if (get_exception_type(vector) == EXCEPTION_FAULT) {
vcpu_retain_rip(vcpu);
+ }
/* SDM 17.3.1.1 For any fault-class exception except a debug exception generated in response to an
* instruction breakpoint, the value pushed for RF is 1.
