From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs4Z-0002aV-MR for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qrs4X-0000hu-8g for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:46:51 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:34074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs4X-0000h5-2U for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:46:49 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e35.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7CDRBPL011949 for ; Fri, 12 Aug 2011 07:27:11 -0600 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7CDkbAs114550 for ; Fri, 12 Aug 2011 07:46:42 -0600 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7CDkYdN024907 for ; Fri, 12 Aug 2011 07:46:34 -0600 Message-ID: <4E452EB8.5000207@us.ibm.com> Date: Fri, 12 Aug 2011 08:46:32 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312831898-18702-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1312831898-18702-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] pc: make vgabios exit port more useful List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lucas Meneghel Rodrigues , qemu-devel@nongnu.org, Avi Kivity On 08/08/2011 02:31 PM, Anthony Liguori wrote: > We've always listened on port 501 for vgabios panic messages. In the entire > time I've worked on QEMU, I've never actually seen a vgabios panic message :-) > > If we change the semantics of this port a little bit, it makes it possible to > use it for more interesting use-cases. I chose this approach instead of adding > a new I/O port because it avoids having a guest visible change. > > This change allows single-byte access to port 501 and also uses the value > written to construct an exit code. > > Signed-off-by: Anthony Liguori Applied. Regards, Anthony Liguori > --- > hw/pc.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index 1c9d89a..4b07b35 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -549,8 +549,7 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) > /* LGPL'ed VGA BIOS messages */ > case 0x501: > case 0x502: > - fprintf(stderr, "VGA BIOS panic, line %d\n", val); > - exit(1); > + exit((val<< 1) | 1); > case 0x500: > case 0x503: > #ifdef DEBUG_BIOS > @@ -591,6 +590,7 @@ static void *bochs_bios_init(void) > register_ioport_write(0x403, 1, 1, bochs_bios_write, NULL); > register_ioport_write(0x8900, 1, 1, bochs_bios_write, NULL); > > + register_ioport_write(0x501, 1, 1, bochs_bios_write, NULL); > register_ioport_write(0x501, 1, 2, bochs_bios_write, NULL); > register_ioport_write(0x502, 1, 2, bochs_bios_write, NULL); > register_ioport_write(0x500, 1, 1, bochs_bios_write, NULL);