mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-for-5.1-pull-request' into staging
x86 bug fix for -rc2 A fix from Vitaly Kuznetsov for a CPU reset bug reported by Jan Kiszka. # gpg: Signature made Thu 23 Jul 2020 20:10:40 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/x86-next-for-5.1-pull-request: KVM: fix CPU reset wrt HF2_GIF_MASK Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+11
-5
@@ -3877,7 +3877,9 @@ static int kvm_put_nested_state(X86CPU *cpu)
|
||||
} else {
|
||||
env->nested_state->flags &= ~KVM_STATE_NESTED_GUEST_MODE;
|
||||
}
|
||||
if (env->hflags2 & HF2_GIF_MASK) {
|
||||
|
||||
/* Don't set KVM_STATE_NESTED_GIF_SET on VMX as it is illegal */
|
||||
if (cpu_has_svm(env) && (env->hflags2 & HF2_GIF_MASK)) {
|
||||
env->nested_state->flags |= KVM_STATE_NESTED_GIF_SET;
|
||||
} else {
|
||||
env->nested_state->flags &= ~KVM_STATE_NESTED_GIF_SET;
|
||||
@@ -3919,10 +3921,14 @@ static int kvm_get_nested_state(X86CPU *cpu)
|
||||
} else {
|
||||
env->hflags &= ~HF_GUEST_MASK;
|
||||
}
|
||||
if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
|
||||
env->hflags2 |= HF2_GIF_MASK;
|
||||
} else {
|
||||
env->hflags2 &= ~HF2_GIF_MASK;
|
||||
|
||||
/* Keep HF2_GIF_MASK set on !SVM as x86_cpu_pending_interrupt() needs it */
|
||||
if (cpu_has_svm(env)) {
|
||||
if (env->nested_state->flags & KVM_STATE_NESTED_GIF_SET) {
|
||||
env->hflags2 |= HF2_GIF_MASK;
|
||||
} else {
|
||||
env->hflags2 &= ~HF2_GIF_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user