From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754352AbcBHPW0 (ORCPT ); Mon, 8 Feb 2016 10:22:26 -0500 Received: from mout.web.de ([212.227.17.11]:63235 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbcBHPWY (ORCPT ); Mon, 8 Feb 2016 10:22:24 -0500 Subject: Re: [PATCH 2/2] KVM: x86: allow BSP to handle INIT IPIs like APs do To: Paolo Bonzini , Bruce Rogers , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1454539876-8310-1-git-send-email-brogers@suse.com> <1454539876-8310-2-git-send-email-brogers@suse.com> <56B8B057.5050900@redhat.com> Cc: namit@cs.technion.ac.il From: Jan Kiszka Message-ID: <56B8B29C.8060600@web.de> Date: Mon, 8 Feb 2016 16:22:04 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <56B8B057.5050900@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nPneV61DiA6Blc6s9TmosIBq1KhNiNn8s" X-Provags-ID: V03:K0:y6FSrnHCC7y5yFOwvtCFnYPOyW9G6aXE0rUoeJIEJX039M/ITzd CRgHoYDkQ1qhnhXVL+a6I4vbvolnx3Tyj73y2edGDuJQm15AUPgSm7DwHn5VofL6OAjeTTs eDL2VEEhKMzCmCm1CDydMkLVD3T65xHpN1rWNzqKTnZ8Ar9PoH49Oy6AeKzX17qlVtopZqt TLcW9w1VkoYfK60h2rjYQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ueew8N5KWWo=:LHDpS0xRO9WVppmW1hTYSs S0t1IOeDUw5WRouTHyWco/NwypPj5QokeziTD6aOdvBdAN/DNr73Y11moqv351TJ9+EAGbShf UdqLW4ADwdv7iwhWRuPNUU5xQkim4JzIFzS0PsZW8sCkjZjsl8jS1nCkItxWpP8et0Nj5Z83q 906ezSymgfHq/rNr0qsYlWjfFkc8Wd6HL3mIl4grtNnrzICttJzoQhTBsDZcWLvi6JWGFUSqO HVciSqcgQPsGryFHUGjXZDbQ+/zmrqJ4q7MoqSgFGjKPoM7fNvWCQEqGmlcYQMKZ2DRGF6FAI DlWQMtcR/gNHAK7OwBlXdvZJ7zK2ae3A+yv3499c2w1jEFr+Nhvl0Xm17a+tjGpnBmxGnvS1/ CyBIp0GoAWwnb3rbcsSpqbOb8680kPP/LhJ8FOnPd0T60OIxr+hdkrJW9o5bFGY/yVRqeuXWp Lty5U2ex5IKLHMuqL/OoJakMqi7zSGv2uUvjureJVH7+xbI6azcl6DUAWf8Pi1L8e551NNIhv NAe/X6D1QTVFOQAtbptequHcHlNn26ma3+9K4zA/JWXh1QrufDO87fHNYJ9YxDayw88AcFf2F gaS4rPgIvAAy9WCw7nr7oJ8QE0Is1u7ay3bTsOTcb7BTFC0NKZD+wwD9adUR17PS6nUkdaKpN qaskr5czYHTAKFYI7K5WPmj6+LIeajxjm47dfY/GmkVVUYP+gYtxJ0dBCKeFcFW7xZLpNAdxa AGV3z5htw0ZaVdqhgUWqnMD1SE9p5Lw6BcNpyX2o5VzCFT+JxfYZeQARy/w= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nPneV61DiA6Blc6s9TmosIBq1KhNiNn8s Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-02-08 16:12, Paolo Bonzini wrote: >=20 >=20 > On 03/02/2016 23:51, Bruce Rogers wrote: >> The INIT IPI event handler special cases the boot-strap processor >> (BSP) handling, avoiding the same mp state handling which is done for >> the other (AP) processors. Debugging a linux guest usage scenario of >> avoiding a reboot through the bios for a crash on any processor via eg= : >> kexec -p /boot/vmlinuz --initrd=3D/boot/initrd --append=3D"$(cat /proc= /cmdline)\ >> maxcpus=3D1" led to identifying this change as the needed fix. >> >> With this change, an AP can now startup the BSP without error. >> >> Signed-off-by: Bruce Rogers >> --- >> arch/x86/kvm/lapic.c | 5 +---- >> 1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c >> index 36591fa..eda6bfb 100644 >> --- a/arch/x86/kvm/lapic.c >> +++ b/arch/x86/kvm/lapic.c >> @@ -2170,10 +2170,7 @@ void kvm_apic_accept_events(struct kvm_vcpu *vc= pu) >> if (test_bit(KVM_APIC_INIT, &pe)) { >> kvm_lapic_reset(vcpu, true); >> kvm_vcpu_reset(vcpu, true); >> - if (kvm_vcpu_is_bsp(apic->vcpu)) >> - vcpu->arch.mp_state =3D KVM_MP_STATE_RUNNABLE; >> - else >> - vcpu->arch.mp_state =3D KVM_MP_STATE_INIT_RECEIVED; >> + vcpu->arch.mp_state =3D KVM_MP_STATE_INIT_RECEIVED; >> } >> if (test_bit(KVM_APIC_SIPI, &pe) && >> vcpu->arch.mp_state =3D=3D KVM_MP_STATE_INIT_RECEIVED) { >> >=20 > KVM_MP_STATE_INIT_RECEIVED is what Intel calls the "wait for SIPI" > state. The BSP never gets a SIPI, it goes straight to 0xFFFFFFF0 > instead. Can you explain the problem more in detail? I suspect this is about sending INIT-SIPI from another CPU, directed to the BSP, isn't it? We may have to differentiate between CPU (including system) reset and that IPI case. Jan --nPneV61DiA6Blc6s9TmosIBq1KhNiNn8s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAla4spwACgkQitSsb3rl5xQEAgCfbV0ObR+iWTjIlUon2ehvRL83 iBIAoOOjTHnj+99obJ7kkT98a59g3vop =0xlz -----END PGP SIGNATURE----- --nPneV61DiA6Blc6s9TmosIBq1KhNiNn8s--