From patchwork Fri Jan 4 08:16:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 209375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3A6B2C007B for ; Fri, 4 Jan 2013 19:16:32 +1100 (EST) Received: from localhost ([::1]:38514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr2S6-0000cA-Ql for incoming@patchwork.ozlabs.org; Fri, 04 Jan 2013 03:16:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr2Rm-0000UK-D8 for qemu-devel@nongnu.org; Fri, 04 Jan 2013 03:16:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tr2Rj-0005JF-OW for qemu-devel@nongnu.org; Fri, 04 Jan 2013 03:16:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tr2Rj-0005IX-Fw for qemu-devel@nongnu.org; Fri, 04 Jan 2013 03:16:07 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r048G6W6032573 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Jan 2013 03:16:06 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r048G5x3013386; Fri, 4 Jan 2013 03:16:06 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 00F6B40A16; Fri, 4 Jan 2013 09:16:04 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 4 Jan 2013 09:16:04 +0100 Message-Id: <1357287364-24921-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1357287364-24921-1-git-send-email-kraxel@redhat.com> References: <1357287364-24921-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/4] pc: remove bochs bios debug ports X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Prehistoric leftover, zap it. We poweroff via acpi these days. And having a port (0x501,0x502) where any random guest write will make qemu exit -- with no way to turn it off -- is a bad joke anyway. Signed-off-by: Gerd Hoffmann --- hw/pc.c | 41 ----------------------------------------- 1 files changed, 0 insertions(+), 41 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 71902e2..4879e4f 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -524,34 +524,6 @@ static void handle_a20_line_change(void *opaque, int irq, int level) cpu_x86_set_a20(cpu, level); } -/***********************************************************/ -/* Bochs BIOS debug ports */ - -static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) -{ - static const char shutdown_str[8] = "Shutdown"; - static int shutdown_index = 0; - - switch(addr) { - case 0x8900: - /* same as Bochs power off */ - if (val == shutdown_str[shutdown_index]) { - shutdown_index++; - if (shutdown_index == 8) { - shutdown_index = 0; - qemu_system_shutdown_request(); - } - } else { - shutdown_index = 0; - } - break; - - case 0x501: - case 0x502: - exit((val << 1) | 1); - } -} - int e820_add_entry(uint64_t address, uint64_t length, uint32_t type) { int index = le32_to_cpu(e820_table.count); @@ -569,14 +541,6 @@ int e820_add_entry(uint64_t address, uint64_t length, uint32_t type) return index; } -static const MemoryRegionPortio bochs_bios_portio_list[] = { - { 0x500, 1, 1, .write = bochs_bios_write, }, /* 0x500 */ - { 0x501, 1, 1, .write = bochs_bios_write, }, /* 0x501 */ - { 0x501, 2, 2, .write = bochs_bios_write, }, /* 0x501 */ - { 0x8900, 1, 1, .write = bochs_bios_write, }, /* 0x8900 */ - PORTIO_END_OF_LIST(), -}; - static void *bochs_bios_init(void) { void *fw_cfg; @@ -584,11 +548,6 @@ static void *bochs_bios_init(void) size_t smbios_len; uint64_t *numa_fw_cfg; int i, j; - PortioList *bochs_bios_port_list = g_new(PortioList, 1); - - portio_list_init(bochs_bios_port_list, bochs_bios_portio_list, - NULL, "bochs-bios"); - portio_list_add(bochs_bios_port_list, get_system_io(), 0x0); fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);