qemu/hw
Radim Krčmář fb506e701e intel_iommu: reject broken EIM
Cluster x2APIC cannot work without KVM's x2apic API when the maximal
APIC ID is greater than 8 and only KVM's LAPIC can support x2APIC, so we
forbid other APICs and also the old KVM case with less than 9, to
simplify the code.

There is no point in enabling EIM in forbidden APICs, so we keep it
enabled only for the KVM APIC;  unconditionally, because making the
option depend on KVM version would be a maintanance burden.

Old QEMUs would enable eim whenever intremap was on, which would trick
guests into thinking that they can enable cluster x2APIC even if any
interrupt destination would get clamped to 8 bits.
Depending on your configuration, QEMU could notice that the destination
LAPIC is not present and report it with a very non-obvious:

  KVM: injection failed, MSI lost (Operation not permitted)

Or the guest could say something about unexpected interrupts, because
clamping leads to aliasing so interrupts were being delivered to
incorrect VCPUs.

KVM_X2APIC_API is the feature that allows us to enable EIM for KVM.

QEMU 2.7 allowed EIM whenever interrupt remapping was enabled.  In order
to keep backward compatibility, we again allow guests to misbehave in
non-obvious ways, and make it the default for old machine types.

A user can enable the buggy mode it with "x-buggy-eim=on".

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2016-10-17 15:44:49 -02:00
..
9pfs 9pfs: fix memory leak in v9fs_write 2016-10-17 14:13:58 +02:00
acpi acpi: provide _PXM method for CPU devices if QEMU is started numa enabled 2016-10-10 01:16:57 +03:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
arm virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
audio pcspk: adding vmstate for save/restore 2016-09-15 15:10:06 +02:00
block virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
bt bt-hci-csr: drop unused argument 2016-10-08 09:02:19 +03:00
char virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
core generic-loader: Add a generic loader 2016-10-04 13:28:09 +01:00
cpu cpu: Abstract CPU core type 2016-06-17 16:33:48 +10:00
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
dma hw/dma: vmstateify rc4030 2016-09-29 12:07:51 +01:00
gpio hw/gpio: QOM'ify zaurus.c 2016-06-14 15:59:13 +01:00
i2c i2c: fix migration regression introduced by broadcast support 2016-08-03 18:44:56 +02:00
i386 intel_iommu: reject broken EIM 2016-10-17 15:44:49 -02:00
ide Block layer patches 2016-10-04 14:25:08 +01:00
input virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
intc apic: add send_msi() to APICCommonClass 2016-10-17 15:44:49 -02:00
ipack ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
ipmi vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
isa portio: keep references on portio 2016-09-08 18:05:21 +04:00
lm32 Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
m68k m68k: change default system clock for m5208evb 2016-10-08 11:25:29 +03:00
mem trace: move hw/mem/pc-dimm.c trace points into correct file 2016-09-28 19:17:54 +01:00
microblaze Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
mips error: Strip trailing '\n' from error string arguments (again) 2016-08-08 09:00:44 +02:00
misc hw/misc/edu: support MSI interrupt 2016-10-04 10:00:25 +02:00
moxie hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
net virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
nvram vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
openrisc hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
pci trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
pci-bridge hw/pci-bridge: Convert pxb initialization functions to Error 2016-07-29 00:07:09 +03:00
pci-host apb: convert init to realize 2016-07-29 00:07:09 +03:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc spapr: Improved placement of PCI host bridges in guest memory map 2016-10-16 12:04:15 +11:00
s390x s390x/css: {c,h,t,r,x}sch: require enable AND device number valid 2016-09-28 13:24:51 +02:00
scsi virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
sd vmstateify ssi-sd 2016-09-22 18:13:08 +01:00
sh4 sh4: fix broken link to documentation 2016-09-15 15:32:22 +03:00
smbios smbios: fix uuid copy 2016-09-29 11:43:22 +08:00
sparc intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface 2016-10-04 10:00:25 +02:00
sparc64 util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
ssi STM32F2xx: Add the SPI device 2016-10-04 13:28:07 +01:00
timer * Thread Sanitizer fixes (Alex) 2016-10-10 10:39:29 +01:00
tpm Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
tricore tricore: remove useless cast 2016-09-15 15:32:22 +03:00
unicore32 hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
usb usb-redir: allocate buffers before waking up the host adapter 2016-10-12 14:37:24 +02:00
vfio memory: introduce IOMMUNotifier and its caps 2016-09-27 08:59:16 +02:00
virtio virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
watchdog nmi: remove x86 specific nmi handling 2016-05-23 16:53:46 +02:00
xen Xen: fix converity warning of xen_pt_config_init() 2016-08-12 16:38:18 -07:00
xenpv xenpv: Fix qemu_uuid compiling error 2016-09-29 11:43:17 +08:00
xtensa target-xtensa: xtfpga: fix FLASH interface width 2016-07-14 13:59:44 +03:00
Makefile.objs STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00