]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
pam: partly fix write-only mode
authorHervé Poussineau <hpoussin@reactos.org>
Tue, 11 Feb 2014 22:46:02 +0000 (23:46 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 9 Mar 2014 19:09:38 +0000 (21:09 +0200)
In write-only mode, writes are forwarded to RAM, while reads should not be
handled (ie should return 0xff).
Assume that in this mode, no read access is ever done, as they shouldn't
give any sensible result.

So, in write-only mode, alias PAM region to RAM, instead of PCI memory
(which can even be mapped to some device!)

This fixes Award BIOS, which use this mode to shadow system BIOS and video BIOS.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci-host/pam.c

index ec6be4676cf27d2c4f3dcb55ec457a0e6c8f4227..e1e95aabcd7967c228bdefc3eab6d4c880112fd9 100644 (file)
@@ -68,7 +68,7 @@ void init_pam(DeviceState *dev, MemoryRegion *ram_memory,
     /* XXX: should distinguish read/write cases */
     memory_region_init_alias(&mem->alias[0], OBJECT(dev), "pam-pci", pci_address_space,
                              start, size);
-    memory_region_init_alias(&mem->alias[2], OBJECT(dev), "pam-pci", pci_address_space,
+    memory_region_init_alias(&mem->alias[2], OBJECT(dev), "pam-pci", ram_memory,
                              start, size);
 
     for (i = 0; i < 4; ++i) {