From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: qemu-kvm-x86: fix e820 reservation Date: Mon, 25 Oct 2010 21:10:10 -0200 Message-ID: <20101025231010.GA25262@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44715 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758324Ab0JYXnA (ORCPT ); Mon, 25 Oct 2010 19:43:00 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9PNgxpr018167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Oct 2010 19:43:00 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9PNgxvl028858 for ; Mon, 25 Oct 2010 19:42:59 -0400 Received: from amt.cnet (vpn-11-154.rdu.redhat.com [10.11.11.154]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9PNgwBe021612 for ; Mon, 25 Oct 2010 19:42:58 -0400 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 195BB652036 for ; Mon, 25 Oct 2010 21:10:11 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id o9PNAA2o025325 for kvm@vger.kernel.org; Mon, 25 Oct 2010 21:10:10 -0200 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: e820 reserved range should start at 0xfeffc000, which includes the EPT identity page, not 0xfeffd000. Signed-off-by: Marcelo Tosatti diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index ec7d419..20b7d6d 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -32,13 +32,6 @@ extern unsigned int kvm_shadow_memory; int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr) { int r; - /* - * Tell fw_cfg to notify the BIOS to reserve the range. - */ - if (e820_add_entry(addr, 0x4000, E820_RESERVED) < 0) { - perror("e820_add_entry() table is full"); - exit(1); - } r = kvm_vm_ioctl(kvm_state, KVM_SET_TSS_ADDR, addr); if (r < 0) { @@ -146,6 +139,14 @@ int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes, return r; } + /* + * Tell fw_cfg to notify the BIOS to reserve the range. + */ + if (e820_add_entry(0xfeffc000, 0x4000, E820_RESERVED) < 0) { + perror("e820_add_entry() table is full"); + exit(1); + } + r = kvm_create_pit(kvm); if (r < 0) { return r;