qemu/msix: fix table access issues
commit76f5159d7fc4cdea9574dfbb54307735b280bc66
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 26 Oct 2009 14:22:44 +0000 (26 16:22 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 30 Oct 2009 13:39:34 +0000 (30 08:39 -0500)
tree2e0c300893d375befca70b408fb57f804af202fb
parent79758e95d7f018dabd726bf7eb8cdd087692410c
qemu/msix: fix table access issues

Fixes a couple of issues with msix table access:
- With misbehaving guests, misaligned 4 byte access could overflow
  msix table and cause qemu to segfault. Since PCI spec requires
  host to only issue dword-aligned accesses, as a fix,
  it's enough to mask the address low bits.
- Tables use pci format, not native format, and so
  we must use pci_[sg]et_long on read/write.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/msix.c