[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 6/8] hw/pci-host/bonito.c: Add PCI mem region mapp
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL v2 6/8] hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address |
Date: |
Thu, 21 Feb 2019 19:53:38 +0100 |
From: BALATON Zoltan <address@hidden>
Stop using system memory as PCI memory otherwise devices such as VGA
that have regions mapped to PCI memory clash with RAM. Use a separate
memory region for PCI memory and map it to the correct address in
system memory which allows PCI mem regions to show at the correct
address where clients expect them.
Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/pci-host/bonito.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 9f33582..dde4437 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -217,6 +217,7 @@ struct BonitoState {
PCIHostState parent_obj;
qemu_irq *pic;
PCIBonitoState *pci_dev;
+ MemoryRegion pci_mem;
};
#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost"
@@ -598,11 +599,15 @@ static const VMStateDescription vmstate_bonito = {
static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
{
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
+ BonitoState *bs = BONITO_PCI_HOST_BRIDGE(dev);
+ memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem",
BONITO_PCILO_SIZE);
phb->bus = pci_register_root_bus(DEVICE(dev), "pci",
pci_bonito_set_irq, pci_bonito_map_irq,
- dev, get_system_memory(), get_system_io(),
+ dev, &bs->pci_mem, get_system_io(),
0x28, 32, TYPE_PCI_BUS);
+ memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE,
+ &bs->pci_mem);
}
static void bonito_realize(PCIDevice *dev, Error **errp)
--
2.7.4
- [Qemu-devel] [PULL v2 0/8] MIPS queue for February 21st, 2019, v2, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 3/8] tests/tcg: target/mips: Change directory name 'bit-counting' to 'bit-count', Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 6/8] hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address,
Aleksandar Markovic <=
- [Qemu-devel] [PULL v2 1/8] hw/misc: mips_itu: Fix 32/64 bit issue in a line involving shift operator, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 4/8] tests/tcg: target/mips: Add wrappers for MSA integer compare instructions, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 2/8] tests/tcg: target/mips: Correct path to headers in some test source files, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 8/8] target/mips: fulong2e: Dynamically generate SPD EEPROM data, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 7/8] target/mips: fulong2e: Fix bios flash size, Aleksandar Markovic, 2019/02/21
- [Qemu-devel] [PULL v2 5/8] target/mips: implement QMP query-cpu-definitions command, Aleksandar Markovic, 2019/02/21
- Re: [Qemu-devel] [PULL v2 0/8] MIPS queue for February 21st, 2019, v2, Peter Maydell, 2019/02/22