From: Glauber Costa Subject: [PATCH] remove kernel memory code from hw/pc.c Date: Mon, 8 Sep 2008 16:30:20 -0300 Message-ID: <1220902221-7536-12-git-send-email-gcosta@redhat.com> References: <1220902221-7536-1-git-send-email-gcosta@redhat.com> <1220902221-7536-2-git-send-email-gcosta@redhat.com> <1220902221-7536-3-git-send-email-gcosta@redhat.com> <1220902221-7536-4-git-send-email-gcosta@redhat.com> <1220902221-7536-5-git-send-email-gcosta@redhat.com> <1220902221-7536-6-git-send-email-gcosta@redhat.com> <1220902221-7536-7-git-send-email-gcosta@redhat.com> <1220902221-7536-8-git-send-email-gcosta@redhat.com> <1220902221-7536-9-git-send-email-gcosta@redhat.com> <1220902221-7536-10-git-send-email-gcosta@redhat.com> <1220902221-7536-11-git-send-email-gcosta@redhat.com> Cc: avi@qumranet.com, aliguori@us.ibm.com, Glauber Costa To: kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60210 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbYIHTnE (ORCPT ); Mon, 8 Sep 2008 15:43:04 -0400 In-Reply-To: <1220902221-7536-11-git-send-email-gcosta@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Glauber Costa Signed-off-by: Glauber Costa --- qemu/hw/pc.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-) diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index 026e96d..8a50096 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -842,8 +842,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, vmport_init(); /* allocate RAM */ -#ifdef KVM_CAP_USER_MEMORY - if (kvm_enabled() && kvm_qemu_check_extension(KVM_CAP_USER_MEMORY)) { + if (kvm_enabled()) { ram_addr = qemu_ram_alloc(0xa0000); cpu_register_physical_memory(0, 0xa0000, ram_addr); kvm_cpu_register_physical_memory(0, 0xa0000, ram_addr); @@ -876,7 +875,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, ram_addr); } } else -#endif { ram_addr = qemu_ram_alloc(ram_size); cpu_register_physical_memory(0, below_4g_mem_size, ram_addr); @@ -965,21 +963,8 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, cpu_register_physical_memory((uint32_t)(-bios_size), bios_size, bios_offset | IO_MEM_ROM); if (kvm_enabled()) { - int r; -#ifdef KVM_CAP_USER_MEMORY - r = kvm_qemu_check_extension(KVM_CAP_USER_MEMORY); - if (r) - kvm_cpu_register_physical_memory((uint32_t)(-bios_size), + kvm_cpu_register_physical_memory((uint32_t)(-bios_size), bios_size, bios_offset | IO_MEM_ROM); - else -#endif - { - bios_mem = kvm_cpu_create_phys_mem((uint32_t)(-bios_size), - bios_size, 0, 1); - if (!bios_mem) - exit(1); - memcpy(bios_mem, phys_ram_base + bios_offset, bios_size); - } } bochs_bios_init(); -- 1.5.5.1