kvmvapic: Disable if there is insufficient memory
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 14 Aug 2012 11:43:12 +0000 (13:43 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 14 Aug 2012 22:23:17 +0000 (19:23 -0300)
commita9605e0317c7a6d5e68f3a3b6708c8ef1096f4bc
tree604f2b364d360c639eadb0bbc0528db418d66f0f
parent050a46065de8e3d4ee5a04f5598d666f63d34800
kvmvapic: Disable if there is insufficient memory

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 <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
hw/apic_common.c