Patchwork [v3,08/16] ioapic: Reject non-dword accesses to IOWIN register

login
register
mail settings
Submitter Jan Kiszka
Date Dec. 6, 2011, 12:58 p.m.
Message ID <9cf717ed048091326ec84dfa387566a9b720de6d.1323176291.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/129683/
State New
Headers show

Comments

Jan Kiszka - Dec. 6, 2011, 12:58 p.m.
Aligns the model with the spec.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/ioapic.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/ioapic.c b/hw/ioapic.c
index 56b1612..eb75766 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -208,6 +208,9 @@  ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size)
         val = s->ioregsel;
         break;
     case IOAPIC_IOWIN:
+        if (size != 4) {
+            break;
+        }
         switch (s->ioregsel) {
         case IOAPIC_REG_ID:
             val = s->id << IOAPIC_ID_SHIFT;
@@ -247,6 +250,9 @@  ioapic_mem_write(void *opaque, target_phys_addr_t addr, uint64_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: