qemu-e2k/hw/acpi
Igor Mammedov c2d2a81b41 pc: make sure that guest isn't able to unplug the first cpu
The first cpu unplug wasn't ever supported and corresponding
monitor/qmp commands refuse to unplug it. However guest is able
to issue eject request either using following command:
  # echo 1 >/sys/devices/system/cpu/cpu0/firmware_node/eject
or directly writing to cpu hotplug registers, which makes
qemu crash with SIGSEGV following back trace:

   kvm_flush_coalesced_mmio_buffer ()
       while (ring->first != ring->last)
   ...
   qemu_flush_coalesced_mmio_buffer
   prepare_mmio_access
   flatview_read_continue
   flatview_read
   address_space_read_full
   address_space_rw
   kvm_cpu_exec(cpu!0)
   qemu_kvm_cpu_thread_fn

the reason for which is that ring == KVMState::coalesced_mmio_ring
happens to be a part of 1st CPU that was uplugged by guest.

Fix it by forbidding 1st cpu unplug from guest side and in addition
remove CPU0._EJ0 ACPI method to make clear that unplug of the first
CPU is not supported.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-09-07 17:05:18 -04:00
..
acpi_interface.c acpi: extend ACPI interface to provide send_event hook 2016-06-07 15:36:54 +03:00
acpi-stub.c Include qmp-commands.h exactly where needed 2018-02-09 13:52:10 +01:00
aml-build.c acpi: fix a comment about aml_call0() 2018-05-20 08:58:58 +03:00
bios-linker-loader.c vmgenid: replace x-write-pointer-available hack 2017-09-08 16:15:17 +03:00
core.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
cpu_hotplug.c machine: Make possible_cpu_arch_ids() return const pointer 2017-01-23 21:25:37 -02:00
cpu.c pc: make sure that guest isn't able to unplug the first cpu 2018-09-07 17:05:18 -04:00
ich9.c include/exec/poison: Mark CONFIG_KVM as poisoned, too 2017-07-04 14:30:03 +02:00
ipmi-stub.c hw: use "qemu/osdep.h" as first #include in source files 2017-12-18 17:07:02 +03:00
ipmi.c acpi/ipmi: Initialize the fwinfo before fetching it 2016-11-01 19:21:09 +02:00
Makefile.objs ACPI: Add Virtual Machine Generation ID support 2017-03-02 07:14:27 +02:00
memory_hotplug.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
nvdimm.c nvdimm: make persistence option symbolic 2018-06-11 22:19:57 +03:00
pcihp.c hw: Do not include "exec/ioport.h" if it is not necessary 2018-06-01 14:15:10 +02:00
piix4.c i2c: pm_smbus: Add the ability to force block transfer enable 2018-08-23 18:46:25 +02:00
tco.c tco: add trace events 2017-10-16 18:03:52 +02:00
trace-events tco: add trace events 2017-10-16 18:03:52 +02:00
vmgenid.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00