[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] kvmvapic: Disable if there is insufficient memo
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 3/4] kvmvapic: Disable if there is insufficient memory |
Date: |
Tue, 14 Aug 2012 20:59:48 -0300 |
From: Jan Kiszka <address@hidden>
We need at least 1M of RAM to map the option ROM. Otherwise, we will
corrupt host memory or even crash:
$ qemu-system-x86_64 -nodefaults --enable-kvm -vnc :0 -m 640k
Segmentation fault (core dumped)
Reported-and-tested-by: Markus Armbruster <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Marcelo Tosatti <address@hidden>
---
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.6.4
- [Qemu-devel] [PATCH 0/4] [PULL] qemu-kvm.git uq/master queue, Marcelo Tosatti, 2012/08/14
- [Qemu-devel] [PATCH 2/4] kvm: i8254: Finish time conversion fix, Marcelo Tosatti, 2012/08/14
- [Qemu-devel] [PATCH 3/4] kvmvapic: Disable if there is insufficient memory,
Marcelo Tosatti <=
- [Qemu-devel] [PATCH 1/4] kvm: i8254: Cache kernel clock offset in KVMPITState, Marcelo Tosatti, 2012/08/14
- [Qemu-devel] [PATCH 4/4] update-linux-headers.sh: Pull in asm-generic/kvm_para.h, Marcelo Tosatti, 2012/08/14
- Re: [Qemu-devel] [PATCH 0/4] [PULL] qemu-kvm.git uq/master queue, Peter Maydell, 2012/08/15
- Re: [Qemu-devel] [PATCH 0/4] [PULL] qemu-kvm.git uq/master queue, Anthony Liguori, 2012/08/15