From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBRXn-00087m-GR for qemu-devel@nongnu.org; Tue, 11 Sep 2012 10:34:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBRXj-0005hg-5T for qemu-devel@nongnu.org; Tue, 11 Sep 2012 10:34:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55512 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBRXi-0005hD-Rm for qemu-devel@nongnu.org; Tue, 11 Sep 2012 10:34:23 -0400 Message-ID: <504F4BE7.4090902@suse.de> Date: Tue, 11 Sep 2012 16:34:15 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <504F0131.6090501@redhat.com> <504F037D.7020207@redhat.com> <504F2009.9040900@citrix.com> <504F24F8.5080600@siemens.com> <504F273B.4050602@siemens.com> <504F345D.1020807@redhat.com> <504F4688.2090201@siemens.com> <504F4858.6060106@redhat.com> <504F4A31.1030303@siemens.com> In-Reply-To: <504F4A31.1030303@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] pc: Don't listen on debug ports by default List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka , Anthony Liguori , =?ISO-8859-1?Q?Herv=E9_Poussineau?= Cc: Julien Grall , Stefano Stabellini , "kraxel@redhat.com" , Avi Kivity , "qemu-devel@nongnu.org" Am 11.09.2012 16:26, schrieb Jan Kiszka: > On 2012-09-11 16:19, Avi Kivity wrote: >> On 09/11/2012 05:11 PM, Jan Kiszka wrote: >>> On 2012-09-11 14:53, Avi Kivity wrote: >>>> On 09/11/2012 02:57 PM, Jan Kiszka wrote: >>>> >>>>> Only listen on debug ports when we also handle them. They are bette= r >>>>> handled by debugcon these days which is runtime configurable. >>>>> >>>>> Signed-off-by: Jan Kiszka >>>>> --- >>>>> hw/pc.c | 6 ++++-- >>>>> 1 files changed, 4 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/hw/pc.c b/hw/pc.c >>>>> index 112739a..134d5f7 100644 >>>>> --- a/hw/pc.c >>>>> +++ b/hw/pc.c >>>>> @@ -539,12 +539,12 @@ static void bochs_bios_write(void *opaque, ui= nt32_t addr, uint32_t val) >>>>> case 0x401: >>>>> /* used to be panic, now unused */ >>>>> break; >>>>> +#ifdef DEBUG_BIOS >>>>> case 0x402: >>>>> case 0x403: >>>>> -#ifdef DEBUG_BIOS >>>>> fprintf(stderr, "%c", val); >>>>> -#endif >>>>> break; >>>>> +#endif >>>>> case 0x8900: >>>>> /* same as Bochs power off */ >>>>> if (val =3D=3D shutdown_str[shutdown_index]) { >>>>> @@ -598,8 +598,10 @@ static void *bochs_bios_init(void) >>>>> =20 >>>>> register_ioport_write(0x400, 1, 2, bochs_bios_write, NULL); >>>>> register_ioport_write(0x401, 1, 2, bochs_bios_write, NULL); >>>>> +#ifdef DEBUG_BIOS >>>>> register_ioport_write(0x402, 1, 1, bochs_bios_write, NULL); >>>>> register_ioport_write(0x403, 1, 1, bochs_bios_write, NULL); >>>>> +#endif >>>>> register_ioport_write(0x8900, 1, 1, bochs_bios_write, NULL); >>>>> =20 >>>>> register_ioport_write(0x501, 1, 1, bochs_bios_write, NULL); >>>>> >>>> >>>> >>>> Why not drop DEBUG_BIOS completely? If you want to debug the bios, = use >>>> debugcon. >>> >>> Probably true. There is more practically dead stuff below this that j= ust >>> prints if DEBUG_BIOS is enabled. >> >> Actually it is autotest that is at fault here. It is installing a >> debugcon with non-standard iobase atop a builtin device. >> Pre-memory-API, we did not detect that. >=20 > Well, the cruft in pc.c was disabled in practice, just leaving useless > /dev/null-like ioports behind. I still think we should drop all of them= , > they have no meaning. >=20 >> >> We can subclass isa-debugcon as bochs-debugcon, change the default >> ioport to 0x402, and use that instead of the code in pc.c. How does >> that sound? >> >> Autotest will need to be changed to use the new device type. >> >=20 > That is another story: providing a debugcon that defaults to 0x402, the > port I always forgot when I want to debug the BIOS. We could provide > bochs-debugcon in addition to the existing interface, avoiding autotest > breakage and still making the usage smoother. Herv=E9 and Anthony had discussed that for qemu-test and I thought their conclusion was to use debug-con with the iobase parameter? CC'ing. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg