vbox: enable 1-byte MMIO writes at 4-/8-byte aligned address

Fixes #1318
This commit is contained in:
Christian Prochaska 2014-12-08 14:27:12 +01:00 committed by Christian Helmuth
parent 3367fd27e4
commit b4f41aecad
1 changed files with 20 additions and 2 deletions

View File

@ -116,8 +116,26 @@ VMMDECL(VBOXSTRICTRC) IOMMMIOWrite(PVM pVM, PVMCPU, RTGCPHYS GCPhys,
/*
* Check whether access is unaligned or access width is less than device
* supports. See original IOMMIOWrite & iomMMIODoComplicatedWrite of VBox.
* supports. See original IOMMMIOWrite & iomMMIODoComplicatedWrite of VBox.
*/
if (rc == VERR_IOM_NOT_MMIO_RANGE_OWNER) {
/* implement what we need to - extend by need */
Assert((GCPhys & 3U) == 0);
Assert(cbValue == 1);
uint32_t value;
rc = guest_memory()->mmio_read(GCPhys, &value, sizeof(value));
Assert(rc == VINF_SUCCESS);
value &= 0xffffff00;
value |= (u32Value & 0x000000ff);
rc = guest_memory()->mmio_write(GCPhys, value, sizeof(value));
}
Assert(rc != VERR_IOM_NOT_MMIO_RANGE_OWNER);
IOM_UNLOCK_SHARED(pVM);
@ -136,7 +154,7 @@ VMMDECL(VBOXSTRICTRC) IOMMMIORead(PVM pVM, PVMCPU, RTGCPHYS GCPhys,
/*
* Check whether access is unaligned or access width is less than device
* supports. See original IOMMIORead & iomMMIODoComplicatedRead of VBox.
* supports. See original IOMMMIORead & iomMMIODoComplicatedRead of VBox.
*/
if (rc == VERR_IOM_NOT_MMIO_RANGE_OWNER) {
/* implement what we need to - extend by need */