ioapic: Reject non-dword accesses to IOWIN register
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 17 Oct 2011 11:11:29 +0000 (13:11 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 24 Nov 2011 16:31:56 +0000 (18:31 +0200)
Aligns the model with the spec.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/ioapic.c

index 61991d7..347536e 100644 (file)
@@ -206,6 +206,9 @@ static uint32_t ioapic_mem_readl(void *opaque, target_phys_addr_t addr)
         val = s->ioregsel;
         break;
     case IOAPIC_IOWIN:
+        if (size != 4) {
+            break;
+        }
         switch (s->ioregsel) {
         case IOAPIC_REG_ID:
             val = s->id << IOAPIC_ID_SHIFT;
@@ -244,6 +247,9 @@ ioapic_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
         s->ioregsel = val;
         break;
     case IOAPIC_IOWIN:
+        if (size != 4) {
+            break;
+        }
         DPRINTF("write: %08x = %08x\n", s->ioregsel, val);
         switch (s->ioregsel) {
         case IOAPIC_REG_ID: