From: "Herongguang (Stephen)" <herongguang.he@huawei.com>
To: qemu-devel@nongnu.org, pbonzini@redhat.com, quintela@redhat.com,
amit.shah@redhat.com, rth@twiddle.net, ehabkost@redhat.com,
mtosatti@redhat.com
Cc: arei.gonglei@huawei.com, "Huangweidong (C)" <weidong.huang@huawei.com>
Subject: [Qemu-devel] [RFC/PATCH 3] kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0
Date: Thu, 22 Sep 2016 15:56:28 +0800 [thread overview]
Message-ID: <57E38EAC.3020108@huawei.com> (raw)
In-Reply-To: <57D90289.6020003@huawei.com>
Fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0.
Signed-off-by: He Rongguang <herongguang.he@huawei.com>
---
Note without patch 2, this would result in kvm-kmod crash, as described in patch 2
---
target-i386/kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index d1a25c5..7db33d2 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -2456,6 +2456,7 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level)
events.sipi_vector = env->sipi_vector;
+ events.flags = 0;
if (has_msr_smbase) {
events.smi.smm = !!(env->hflags & HF_SMM_MASK);
events.smi.smm_inside_nmi = !!(env->hflags2 & HF2_SMM_INSIDE_NMI_MASK);
@@ -2474,7 +2475,6 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level)
events.flags |= KVM_VCPUEVENT_VALID_SMM;
}
- events.flags = 0;
if (level >= KVM_PUT_RESET_STATE) {
events.flags |=
KVM_VCPUEVENT_VALID_NMI_PENDING | KVM_VCPUEVENT_VALID_SIPI_VECTOR;
--
1.8.3.4
prev parent reply other threads:[~2016-09-22 7:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 7:55 [Qemu-devel] [RFC/PATCH] migration: SMRAM dirty bitmap not fetched from kvm-kmod and not send to destination Herongguang (Stephen)
2016-09-14 9:05 ` Paolo Bonzini
2016-09-22 13:16 ` Herongguang (Stephen)
2016-09-23 1:11 ` Herongguang (Stephen)
2016-09-23 7:17 ` Paolo Bonzini
2016-09-23 8:51 ` Herongguang (Stephen)
2016-09-23 8:59 ` Paolo Bonzini
2016-09-23 9:14 ` Herongguang (Stephen)
2016-09-25 11:33 ` Herongguang (Stephen)
2016-09-26 7:15 ` Paolo Bonzini
2016-09-22 7:51 ` [RFC/PATCH 2] kvm: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly Herongguang (Stephen)
2016-09-22 7:51 ` [Qemu-devel] " Herongguang (Stephen)
2016-09-22 9:29 ` Paolo Bonzini
2016-09-22 9:29 ` [Qemu-devel] " Paolo Bonzini
2016-09-22 13:19 ` Herongguang (Stephen)
2016-09-22 13:19 ` [Qemu-devel] " Herongguang (Stephen)
2016-09-22 7:56 ` Herongguang (Stephen) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57E38EAC.3020108@huawei.com \
--to=herongguang.he@huawei.com \
--cc=amit.shah@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=ehabkost@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rth@twiddle.net \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.