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