From patchwork Thu Feb 18 16:13:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 80329 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1IGEMBA022795 for ; Thu, 18 Feb 2010 16:14:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758078Ab0BRQOT (ORCPT ); Thu, 18 Feb 2010 11:14:19 -0500 Received: from david.siemens.de ([192.35.17.14]:18137 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757325Ab0BRQOS (ORCPT ); Thu, 18 Feb 2010 11:14:18 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1IGDVa9032413; Thu, 18 Feb 2010 17:13:31 +0100 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1IGDUCq000746; Thu, 18 Feb 2010 17:13:31 +0100 Message-ID: <4B7D672A.9060502@siemens.com> Date: Thu, 18 Feb 2010 17:13:30 +0100 From: Jan Kiszka 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 To: Avi Kivity , Marcelo Tosatti CC: kvm , Anthony Liguori Subject: [PATCH 2/2] qemu-kvm: extboot: Clean up host-guest interface Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Feb 2010 16:14:22 +0000 (UTC) diff --git a/hw/extboot.c b/hw/extboot.c index b91d54f..8ada21b 100644 --- a/hw/extboot.c +++ b/hw/extboot.c @@ -65,12 +65,6 @@ static void get_translated_chs(BlockDriverState *bs, int *c, int *h, int *s) } } -static uint32_t extboot_read(void *opaque, uint32_t addr) -{ - int *pcmd = opaque; - return *pcmd; -} - static void extboot_write_cmd(void *opaque, uint32_t addr, uint32_t value) { union extboot_cmd cmd; @@ -123,13 +117,7 @@ static void extboot_write_cmd(void *opaque, uint32_t addr, uint32_t value) qemu_free(buf); } -void extboot_init(BlockDriverState *bs, int cmd) +void extboot_init(BlockDriverState *bs) { - int *pcmd; - - pcmd = qemu_mallocz(sizeof(int)); - - *pcmd = cmd; - register_ioport_read(0x404, 1, 1, extboot_read, pcmd); register_ioport_write(0x405, 1, 2, extboot_write_cmd, bs); } diff --git a/hw/pc.c b/hw/pc.c index 97e16ce..8175874 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1057,7 +1057,7 @@ static void pc_init1(ram_addr_t ram_size, bdrv_set_geometry_hint(info->bdrv, cyls, heads, secs); } - extboot_init(info->bdrv, 1); + extboot_init(info->bdrv); } #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT diff --git a/hw/pc.h b/hw/pc.h index b00f311..e9da683 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -165,7 +165,7 @@ void isa_ne2000_init(int base, int irq, NICInfo *nd); /* extboot.c */ -void extboot_init(BlockDriverState *bs, int cmd); +void extboot_init(BlockDriverState *bs); int cpu_is_bsp(CPUState *env); diff --git a/pc-bios/optionrom/extboot.S b/pc-bios/optionrom/extboot.S index 1eeb172..db6c2b6 100644 --- a/pc-bios/optionrom/extboot.S +++ b/pc-bios/optionrom/extboot.S @@ -62,15 +62,6 @@ int19_handler: xor %ax, %ax mov %ax, %ds - movw $0x404, %dx - inb %dx, %al - cmp $1, %al - je 1f - cmp $2, %al - je 2f - jmp 3f - -1: /* hook int13: intb(0x404) == 1 */ /* save old int 13 to int 2c */ mov (0x13*4), %eax mov %eax, (OLD_INT13) @@ -78,21 +69,7 @@ int19_handler: /* install our int 13 handler */ movw $int13_handler, (0x13*4) mov %cs, (0x13*4+2) - jmp 3f -2: /* linux boot: intb(0x404) == 2 */ - cli - cld - mov $0x9000, %ax - mov %ax, %ds - mov %ax, %es - mov %ax, %fs - mov %ax, %gs - mov %ax, %ss - mov $0x8ffe, %sp - ljmp $0x9000 + 0x20, $0 - -3: /* fall through: inb(0x404) == 0 */ /* restore previous int $0x19 handler */ mov (OLD_INT19),%eax mov %eax,(0x19*4)