qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] apb_pci: convert PCI space to memory API
@ 2011-09-03 21:18 Blue Swirl
  2011-09-04  8:10 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2011-09-03 21:18 UTC (permalink / raw)
  To: Avi Kivity, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]

Add a new memory space for PCI instead of using system memory.

This also fixes a bug where VGA region vga.chain4 is
accidentally mapped to 0xa0000 instead of 0x1ff000a0000.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/apb_pci.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index 6ee2068..c232946 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -71,6 +71,7 @@ typedef struct APBState {
     PCIBus      *bus;
     MemoryRegion apb_config;
     MemoryRegion pci_config;
+    MemoryRegion pci_mmio;
     MemoryRegion pci_ioport;
     uint32_t iommu[4];
     uint32_t pci_control[16];
@@ -336,12 +337,14 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
     sysbus_mmio_map(s, 2, special_base + 0x2000000ULL);
     d = FROM_SYSBUS(APBState, s);

+    memory_region_init(&d->pci_mmio, "pci-mmio", 0x100000000ULL);
+    memory_region_add_subregion(get_system_memory(), mem_base, &d->pci_mmio);
+
     d->bus = pci_register_bus(&d->busdev.qdev, "pci",
-                                         pci_apb_set_irq, pci_pbm_map_irq, d,
-                                         get_system_memory(),
-                                         get_system_io(),
-                                         0, 32);
-    pci_bus_set_mem_base(d->bus, mem_base);
+                              pci_apb_set_irq, pci_pbm_map_irq, d,
+                              &d->pci_mmio,
+                              get_system_io(),
+                              0, 32);

     for (i = 0; i < 32; i++) {
         sysbus_connect_irq(s, i, pic[i]);
-- 
1.6.2.4

[-- Attachment #2: 0001-apb_pci-convert-PCI-space-to-memory-API.patch --]
[-- Type: text/x-diff, Size: 1924 bytes --]

From 88d72b5a06081d44c03a30c3495bbc49e5ba8d9d Mon Sep 17 00:00:00 2001
Message-Id: <88d72b5a06081d44c03a30c3495bbc49e5ba8d9d.1315084536.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 3 Sep 2011 16:38:02 +0000
Subject: [PATCH 1/2] apb_pci: convert PCI space to memory API

Add a new memory space for PCI instead of using system memory.

This also fixes a bug where VGA region vga.chain4 is
accidentally mapped to 0xa0000 instead of 0x1ff000a0000.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/apb_pci.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index 6ee2068..c232946 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -71,6 +71,7 @@ typedef struct APBState {
     PCIBus      *bus;
     MemoryRegion apb_config;
     MemoryRegion pci_config;
+    MemoryRegion pci_mmio;
     MemoryRegion pci_ioport;
     uint32_t iommu[4];
     uint32_t pci_control[16];
@@ -336,12 +337,14 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
     sysbus_mmio_map(s, 2, special_base + 0x2000000ULL);
     d = FROM_SYSBUS(APBState, s);
 
+    memory_region_init(&d->pci_mmio, "pci-mmio", 0x100000000ULL);
+    memory_region_add_subregion(get_system_memory(), mem_base, &d->pci_mmio);
+
     d->bus = pci_register_bus(&d->busdev.qdev, "pci",
-                                         pci_apb_set_irq, pci_pbm_map_irq, d,
-                                         get_system_memory(),
-                                         get_system_io(),
-                                         0, 32);
-    pci_bus_set_mem_base(d->bus, mem_base);
+                              pci_apb_set_irq, pci_pbm_map_irq, d,
+                              &d->pci_mmio,
+                              get_system_io(),
+                              0, 32);
 
     for (i = 0; i < 32; i++) {
         sysbus_connect_irq(s, i, pic[i]);
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] apb_pci: convert PCI space to memory API
  2011-09-03 21:18 [Qemu-devel] [PATCH 1/2] apb_pci: convert PCI space to memory API Blue Swirl
@ 2011-09-04  8:10 ` Avi Kivity
  2011-09-04  9:29   ` Blue Swirl
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2011-09-04  8:10 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

On 09/04/2011 12:18 AM, Blue Swirl wrote:
> Add a new memory space for PCI instead of using system memory.
>
> This also fixes a bug where VGA region vga.chain4 is
> accidentally mapped to 0xa0000 instead of 0x1ff000a0000.
>
>

Looks good.  I assume you'll commit this directly, since it fixes a 
regression?

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] apb_pci: convert PCI space to memory API
  2011-09-04  8:10 ` Avi Kivity
@ 2011-09-04  9:29   ` Blue Swirl
  0 siblings, 0 replies; 3+ messages in thread
From: Blue Swirl @ 2011-09-04  9:29 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel

On Sun, Sep 4, 2011 at 8:10 AM, Avi Kivity <avi@redhat.com> wrote:
> On 09/04/2011 12:18 AM, Blue Swirl wrote:
>>
>> Add a new memory space for PCI instead of using system memory.
>>
>> This also fixes a bug where VGA region vga.chain4 is
>> accidentally mapped to 0xa0000 instead of 0x1ff000a0000.
>>
>>
>
> Looks good.  I assume you'll commit this directly, since it fixes a
> regression?

OK, pushed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-04  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-03 21:18 [Qemu-devel] [PATCH 1/2] apb_pci: convert PCI space to memory API Blue Swirl
2011-09-04  8:10 ` Avi Kivity
2011-09-04  9:29   ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).