From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1F3Y-0001JH-6g for qemu-devel@nongnu.org; Tue, 14 Aug 2012 07:13:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1F3W-0006UR-OT for qemu-devel@nongnu.org; Tue, 14 Aug 2012 07:13:04 -0400 Received: from goliath.siemens.de ([192.35.17.28]:17029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1F3W-0006U2-Eb for qemu-devel@nongnu.org; Tue, 14 Aug 2012 07:13:02 -0400 Message-ID: <502A32BB.2000607@siemens.com> Date: Tue, 14 Aug 2012 13:12:59 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH uq/master] kvmvapic: Disable if there is insufficient memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity , Marcelo Tosatti Cc: qemu-devel , kvm , Markus Armbruster We need at least 1M of RAM to map the option ROM. Otherwise, we will corrupt host memory or even crash. Reported-by: Markus Armbruster Signed-off-by: Jan Kiszka --- hw/apic_common.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/apic_common.c b/hw/apic_common.c index 58e63b0..371f95d 100644 --- a/hw/apic_common.c +++ b/hw/apic_common.c @@ -299,7 +299,9 @@ static int apic_init_common(SysBusDevice *dev) sysbus_init_mmio(dev, &s->io_memory); - if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK) { + /* Note: We need at least 1M to map the VAPIC option ROM */ + if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK && + ram_size >= 1024 * 1024) { vapic = sysbus_create_simple("kvmvapic", -1, NULL); } s->vapic = vapic; -- 1.7.3.4