hv: Retain RIP only for fault exception.

We have trapped the #DB for split-lock emulation.
Only fault exception need RIP being retained.

Tracked-On: #5605
Signed-off-by: Jie Deng <jie.deng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jie Deng 2020-11-03 15:31:34 +08:00 committed by wenlingz
parent 977e862192
commit b14c32a110
1 changed files with 4 additions and 2 deletions

View File

@ -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 */
vcpu_retain_rip(vcpu);
/* 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.