[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04a86494-a032-83d9-b9f2-abd4e0c57f08@redhat.com>
Date: Wed, 15 Feb 2017 10:26:34 +0100
From: David Hildenbrand <david@...hat.com>
To: Dmitry Vyukov <dvyukov@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>
Cc: Radim Krčmář <rkrcmar@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
"x86@...nel.org" <x86@...nel.org>, KVM list <kvm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Steve Rutherford <srutherford@...gle.com>,
syzkaller <syzkaller@...glegroups.com>
Subject: Re: kvm: WARNING In kvm_apic_accept_events
>>> From: David Hildenbrand <david@...hat.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@...gle.com>
>>> Signed-off-by: David Hildenbrand <david@...hat.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
Powered by blists - more mailing lists