qemu-e2k/hw
Christoffer Dall 8d999995e4 arm_gic: Fix GIC pending behavior
The existing implementation of the pending behavior in gic_set_irq,
gic_complete_irq, and the distributor pending set/clear registers does
not follow the semantics of the GICv2.0 specs, but may implement the
11MPCore support.  Therefore, maintain the existing semantics for
11MPCore and v7M NVIC and change the behavior to be in accordance with
the GICv2.0 specs for "generic implementations" (s->revision == 1 ||
s->revision == 2).

Generic implementations distinguish between setting a level-triggered
interrupt pending through writes to the GICD_ISPENDR and when hardware
raises the interrupt line.  Writing to the GICD_ICPENDR will not cause
the interrupt to become non-pending if the line is still active, and
conversely, if the line is deactivated but the interrupt is marked as
pending through a write to GICD_ISPENDR, the interrupt remains pending.
Handle this situation in the GIC_TEST_PENDING (which now becomes a
static inline named gic_test_pending) and let the 'pending' field
correspond only to the latched state of the D-flip flop in the GICv2.0
specs Figure 4-10.

The following changes are added:

gic_test_pending:
Make this a static inline and split out the 11MPCore from the generic
behavior.  For the generic behavior, consider interrupts pending if:
    ((s->irq_state[irq].pending & (cm) != 0) ||
       (!GIC_TEST_EDGE_TRIGGER(irq) && GIC_TEST_LEVEL(irq, cm))

gic_set_irq:
Split out the 11MPCore from the generic behavior.  For the generic
behavior, always GIC_SET_LEVEL() on positive level, but only
GIC_SET_PENDING for edge-triggered interrupts and always simply
GIC_CLEAR_LEVEL() on negative level.

gic_complete_irq:
Only resample the line for line-triggered interrupts on an 11MPCore.
Generic implementations will sample the line directly in
gic_test_pending().

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-02-08 14:47:28 +00:00
..
9pfs virtio-9p: Convert to QOM realize 2013-12-09 21:46:49 +01:00
acpi pc: ACPI: unify source of CPU hotplug IO base/len 2014-01-26 13:11:44 +02:00
alpha sysbus: Set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:22 +01:00
arm vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type 2014-02-04 15:51:45 +01:00
audio hda-codec: disable streams on reset 2014-01-20 12:17:20 +01:00
block dataplane: Comment fix 2014-01-31 22:05:03 +01:00
bt
char Merge remote-tracking branch 'mjt/trivial-patches' into staging 2014-01-09 11:24:12 -08:00
core Merge remote branch 'luiz/queue/qmp' into qmpq 2014-01-14 12:10:08 +10:00
cpu icc_bus: QOM'ify ICC 2013-12-24 18:02:18 +01:00
cris cris: Remove the CRIS PIC glue 2014-02-03 14:04:00 +00:00
display hw/display/qxl: fix signed to unsigned comparison 2014-02-03 11:05:15 +01:00
dma Merge remote branch 'luiz/queue/qmp' into qmpq 2014-01-14 12:10:08 +10:00
gpio hw: cannot_instantiate_with_device_add_yet due to pointer props 2013-12-24 17:27:17 +01:00
i2c hw: cannot_instantiate_with_device_add_yet due to pointer props 2013-12-24 17:27:17 +01:00
i386 i386: Add missing include file for QEMU_PACKED 2014-02-01 13:43:52 +04:00
ide trivial-patches for 2014-01-16 2014-01-30 13:56:00 +00:00
input QOM infrastructure fixes and device conversions 2014-01-09 11:24:48 -08:00
intc arm_gic: Fix GIC pending behavior 2014-02-08 14:47:28 +00:00
isa vt82c686: Clean up use of cannot_instantiate_with_device_add_yet 2013-12-23 00:27:23 +01:00
lm32
m68k
microblaze Microblaze: Convert Microblaze-pic handling to GPIOs 2014-01-14 11:08:36 +10:00
mips pci-host: Consistently set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:23 +01:00
misc vfio-pci updates include: 2014-02-01 21:08:06 +00:00
moxie
net acpi,pci,pc,virtio fixes and enhancements 2014-01-31 00:23:27 +00:00
nvram sysbus: Set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:22 +01:00
openrisc openrisc-timer: Reduce overhead, Separate clock update functions 2013-11-20 21:46:45 +08:00
pci hw/pci: fix error flow in pci multifunction init 2014-01-26 13:11:45 +02:00
pci-bridge pci-host: Consistently set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:23 +01:00
pci-host acpi,pci,pc,fedora,virtio fixes and enhancements 2014-01-10 11:04:48 -08:00
pcmcia
ppc hw/ppc: Remove unused defines 2014-02-01 13:47:35 +04:00
s390x s390-sclp: SCLP Event integration 2014-01-21 16:48:39 +01:00
scsi Merge remote-tracking branch 'bonzini/scsi-next' into staging 2014-01-24 15:50:14 -08:00
sd sysbus: Set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:22 +01:00
sh4 pci-host: Consistently set cannot_instantiate_with_device_add_yet 2013-12-23 00:27:23 +01:00
sparc sun4m: Add FCode ROM for TCX framebuffer 2013-11-21 17:38:52 +01:00
sparc64
ssi
timer isa: Clean up use of cannot_instantiate_with_device_add_yet 2013-12-23 00:27:23 +01:00
tpm
unicore32
usb usb-hid: add microsoft os descriptor support 2014-01-16 12:59:59 +01:00
virtio Merge remote-tracking branch 'qmp-unstable/queue/qmp' into staging 2014-02-01 23:32:31 +00:00
watchdog qemu-option: Remove qemu_opts_create_nofail 2014-01-06 15:02:30 -05:00
xen xen_pt: Fix passthrough of device with ROM. 2014-01-17 15:29:33 +00:00
xtensa
Makefile.objs