Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Fix incorrect interruptibility_state before vmx entry. #233

Merged
merged 1 commit into from
Aug 16, 2019
Merged

Fix incorrect interruptibility_state before vmx entry. #233

merged 1 commit into from
Aug 16, 2019

Conversation

coxuintel
Copy link
Contributor

According to SDM 26.3.1.5 Checks on Guest Non-Register State, Bit 0
(blocking by STI) must be 0 if the IF flag (bit 9) is 0 in the RFLAGS
field.
There is an issue during snapshot loading, that IF and
interruptibility_state don't pass the checks, which will result in
VM-entry failure due to invalid guest state.
This WA correct the bit so that vmx entry check could pass. The normal
interruptibility_state update is done when advancing the IP.
In future, proper approach is expected to replace the WA.

Signed-off-by: Colin Xu colin.xu@intel.com

@coxuintel coxuintel requested a review from hyuan3 August 14, 2019 08:05
core/vcpu.c Outdated
if (vmx(vcpu, interruptibility_state).raw &
GUEST_INTRSTAT_STI_BLOCKING) {
vmx(vcpu, interruptibility_state).raw &=
~GUEST_INTRSTAT_STI_BLOCKING;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 8-space indent for long line break, while the 4-space indent is for normal line wrap.


if (!(state->_eflags & EFLAGS_IF))
return 1;

intr_blocking |= GUEST_INTRSTAT_STI_BLOCKING;
intr_blocking |= GUEST_INTRSTAT_SS_BLOCKING;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intr_blocking = GUEST_INTRSTAT_STI_BLOCKING | GUEST_INTRSTAT_SS_BLOCKING;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I code in this way to prevent line exceeding 80 chars. And possibly more bits will be OR-ed.

@HaxmCI HaxmCI added CI:Build Pass CI:Build Pass CI:Mac Test Pass CI:Mac Test Pass labels Aug 16, 2019
According to SDM 26.3.1.5 Checks on Guest Non-Register State, Bit 0
(blocking by STI) must be 0 if the IF flag (bit 9) is 0 in the RFLAGS
field.
There is an issue during snapshot loading, that IF and
interruptibility_state don't pass the checks, which will result in
VM-entry failure due to invalid guest state.
This WA correct the bit so that vmx entry check could pass. The normal
interruptibility_state update is done when advancing the IP.
In future, proper approach is expected to replace the WA.

Signed-off-by: Colin Xu <colin.xu@intel.com>
@wcwang wcwang merged commit 3c85766 into intel:master Aug 16, 2019
@coxuintel coxuintel deleted the intstate_bit branch December 30, 2019 01:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI:Build Pass CI:Build Pass CI:Mac Test Pass CI:Mac Test Pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants