From: David Hildenbrand <david@redhat.com>
To: Dmitry Vyukov <dvyukov@google.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"KVM list" <kvm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Steve Rutherford" <srutherford@google.com>,
syzkaller <syzkaller@googlegroups.com>
Subject: Re: kvm: WARNING In kvm_apic_accept_events
Date: Wed, 15 Feb 2017 10:26:34 +0100 [thread overview]
Message-ID: <04a86494-a032-83d9-b9f2-abd4e0c57f08@redhat.com> (raw)
In-Reply-To: <CACT4Y+Z1wWiQQik3P13LQZ6_3DC4Do-W50pLK1WDJe5bsr5S2w@mail.gmail.com>
>>> From: David Hildenbrand <david@redhat.com>
>>> Date: Mon, 23 Jan 2017 16:42:23 +0100
>>> Subject: [PATCH] KVM: x86: fix illegal MP_STATE when in/entering SMM
>>>
>>> If we already entered/are about to enter SMM, don't allow
>>> switching to INIT/SIPI_RECEIVED, otherwise the next call to
>>> kvm_apic_accept_events() will report a warning.
>>>
>>> Fixes: cd7764fe9f73 ("KVM: x86: latch INITs while in system management mode")
>>> Reported-by: Dmitry Vyukov <dvyukov@google.com>
>>> Signed-off-by: David Hildenbrand <david@redhat.com>
>>> ---
>>> arch/x86/kvm/x86.c | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 57d8a85..06ffc91 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -7247,6 +7247,12 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
>>> mp_state->mp_state != KVM_MP_STATE_RUNNABLE)
>>> return -EINVAL;
>>>
>>> + /* INITs are latched while in SMM */
>>> + if ((is_smm(vcpu) || vcpu->arch.smi_pending) &&
>>> + (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED ||
>>> + mp_state->mp_state == KVM_MP_STATE_INIT_RECEIVED))
>>> + return -EINVAL;
>>> +
>>> if (mp_state->mp_state == KVM_MP_STATE_SIPI_RECEIVED) {
>>> vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
>>> set_bit(KVM_APIC_SIPI, &vcpu->arch.apic->pending_events);
>>>
>>
>> Looks good, thanks for analyzing it. I'll try making a minimal testcase...
>
>
> Any progress with this? Should we commit this as is?
>
Paolo, should I resend as a proper notcopieddiff mail?
--
Thanks,
David
next prev parent reply other threads:[~2017-02-15 9:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-12 1:56 kvm: WARNING In kvm_apic_accept_events Dmitry Vyukov
2017-01-22 8:52 ` Dmitry Vyukov
2017-01-23 16:03 ` David Hildenbrand
2017-01-23 16:29 ` Paolo Bonzini
2017-02-14 20:31 ` Dmitry Vyukov
2017-02-15 9:26 ` David Hildenbrand [this message]
2017-02-15 10:10 ` Paolo Bonzini
2017-03-22 15:34 ` Dmitry Vyukov
2017-03-22 15:35 ` David Hildenbrand
-- strict thread matches above, loose matches on Subject: below --
2016-01-08 17:16 kvm: WARNING in kvm_apic_accept_events Dmitry Vyukov
2016-01-15 17:13 ` Dmitry Vyukov
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=04a86494-a032-83d9-b9f2-abd4e0c57f08@redhat.com \
--to=david@redhat.com \
--cc=dvyukov@google.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=srutherford@google.com \
--cc=syzkaller@googlegroups.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox