From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME9JN-0007uI-NJ for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:56:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME9JK-0007oK-28 for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:56:53 -0400 Received: from [199.232.76.173] (port=60836 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME9JJ-0007nx-BP for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:56:49 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:46522) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ME9JI-0007oo-Lq for qemu-devel@nongnu.org; Tue, 09 Jun 2009 17:56:49 -0400 Message-ID: <4A2EDA99.8000207@web.de> Date: Tue, 09 Jun 2009 23:56:41 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1244538657-7878-1-git-send-email-gleb@redhat.com> <1244538657-7878-2-git-send-email-gleb@redhat.com> <4A2E3795.6020404@siemens.com> <20090609104133.GW27210@redhat.com> In-Reply-To: <20090609104133.GW27210@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig71B27FE344F2A5273D0A82BA" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 2/2] Don't register cpu reset handler for cpu with APIC. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig71B27FE344F2A5273D0A82BA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Gleb Natapov wrote: > On Tue, Jun 09, 2009 at 12:21:09PM +0200, Jan Kiszka wrote: >> Gleb Natapov wrote: >>> APIC reset handler already resets cpu. Also register cpu_reset handle= r >>> directly to make it impossible to add additional code to main_cpu_res= et() >>> by mistake. >>> >>> Signed-off-by: Gleb Natapov >>> --- >>> hw/pc.c | 10 +++------- >>> 1 files changed, 3 insertions(+), 7 deletions(-) >>> >>> diff --git a/hw/pc.c b/hw/pc.c >>> index d5b4112..5e7b115 100644 >>> --- a/hw/pc.c >>> +++ b/hw/pc.c >>> @@ -751,12 +751,6 @@ static void load_linux(target_phys_addr_t option= _rom, >>> generate_bootsect(option_rom, gpr, seg, 0); >>> } >>> =20 >>> -static void main_cpu_reset(void *opaque) >>> -{ >>> - CPUState *env =3D opaque; >>> - cpu_reset(env); >>> -} >>> - >>> static const int ide_iobase[2] =3D { 0x1f0, 0x170 }; >>> static const int ide_iobase2[2] =3D { 0x3f6, 0x376 }; >>> static const int ide_irq[2] =3D { 14, 15 }; >>> @@ -878,9 +872,11 @@ static void pc_init1(ram_addr_t ram_size, >>> } >>> if (i !=3D 0) >>> env->halted =3D 1; >>> - qemu_register_reset(main_cpu_reset, 0, env); >>> if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { >>> apic_init(env); >>> + } else { >>> + /* APIC reset callback resets cpu */ >> That comment should rather go into the previous block (and please remo= ve >> the tab). >> >>> + qemu_register_reset((QEMUResetHandler*)cpu_reset, 0, env= ); >>> } >>> } >>> =20 >> Looks fine to me otherwise. Will give these patches a try later today.= >> > Let me know when you tested it and if no additional fixes needed I'll r= esend > fixed version. No regressions found with both patches applied. I was not able to convince a 586 Linux kernel to boot more than one CPU in the absence of LAPICs. But that was independent of the patches and is likely a BIOS issue ("BIOS bug, local APIC #0 not detected!..."). Jan --------------enig71B27FE344F2A5273D0A82BA 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.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkou2p4ACgkQniDOoMHTA+mtggCfVqqbOxufSo8qtFwKh0LbYLUa HyoAmQGXhJ//gLD1wwTeihDrkHIMqyar =Av1h -----END PGP SIGNATURE----- --------------enig71B27FE344F2A5273D0A82BA--