qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] acpi fixups
@ 2013-01-04  8:10 Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 1/4] configure: also symlink *.aml files Gerd Hoffmann
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2013-01-04  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

This patch series carries a bunch of acpi bits:  Some small incremental
fixes for the memory api conversion and dsdt autoloading.  The later
makes q35 JustWork[tm] without explicit -acpitable switch.

please pull,
  Gerd

The following changes since commit 25bbf61e4bacd1e4fa4115ffcf151051b9d6608e:

  pty: unbreak libvirt (2013-01-03 12:53:41 -0600)

are available in the git repository at:
  git://git.kraxel.org/qemu acpi.2

Gerd Hoffmann (4):
      configure: also symlink *.aml files
      acpi: autoload dsdt
      apci: assign memory regions to piix4 acpi device
      apci: assign memory regions to ich9 lpc device

 configure       |    1 +
 hw/acpi_ich9.c  |    6 ++++--
 hw/acpi_ich9.h  |    4 +++-
 hw/acpi_piix4.c |   20 +++++++++++++-------
 hw/lpc_ich9.c   |    2 +-
 hw/pc.c         |   23 +++++++++++++++++++++++
 hw/pc.h         |    1 +
 hw/pc_piix.c    |    1 +
 hw/pc_q35.c     |    1 +
 9 files changed, 48 insertions(+), 11 deletions(-)

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

* [Qemu-devel] [PATCH 1/4] configure: also symlink *.aml files
  2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
@ 2013-01-04  8:10 ` Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 2/4] acpi: autoload dsdt Gerd Hoffmann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2013-01-04  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 9538041..1e9fd86 100755
--- a/configure
+++ b/configure
@@ -4240,6 +4240,7 @@ FILES="$FILES pc-bios/spapr-rtas/Makefile"
 FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
 for bios_file in \
     $source_path/pc-bios/*.bin \
+    $source_path/pc-bios/*.aml \
     $source_path/pc-bios/*.rom \
     $source_path/pc-bios/*.dtb \
     $source_path/pc-bios/openbios-* \
-- 
1.7.1

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

* [Qemu-devel] [PATCH 2/4] acpi: autoload dsdt
  2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 1/4] configure: also symlink *.aml files Gerd Hoffmann
@ 2013-01-04  8:10 ` Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 3/4] apci: assign memory regions to piix4 acpi device Gerd Hoffmann
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2013-01-04  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc.c      |   23 +++++++++++++++++++++++
 hw/pc.h      |    1 +
 hw/pc_piix.c |    1 +
 hw/pc_q35.c  |    1 +
 4 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 71902e2..5ec3bd5 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -886,6 +886,29 @@ void pc_cpus_init(const char *cpu_model)
     }
 }
 
+void pc_acpi_init(const char *default_dsdt)
+{
+    char *filename = NULL, *arg = NULL;
+
+    if (acpi_tables != NULL) {
+        /* manually set via -acpitable, leave it alone */
+        return;
+    }
+
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, default_dsdt);
+    if (filename == NULL) {
+        fprintf(stderr, "WARNING: failed to find %s\n", default_dsdt);
+        return;
+    }
+
+    arg = g_strdup_printf("file=%s", filename);
+    if (acpi_table_add(arg) != 0) {
+        fprintf(stderr, "WARNING: failed to load %s\n", filename);
+    }
+    g_free(arg);
+    g_free(filename);
+}
+
 void *pc_memory_init(MemoryRegion *system_memory,
                     const char *kernel_filename,
                     const char *kernel_cmdline,
diff --git a/hw/pc.h b/hw/pc.h
index a73e3e7..4134aa9 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -79,6 +79,7 @@ void pc_register_ferr_irq(qemu_irq irq);
 void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
 
 void pc_cpus_init(const char *cpu_model);
+void pc_acpi_init(const char *default_dsdt);
 void *pc_memory_init(MemoryRegion *system_memory,
                     const char *kernel_filename,
                     const char *kernel_cmdline,
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 99747a7..2b3d58b 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -87,6 +87,7 @@ static void pc_init1(MemoryRegion *system_memory,
     void *fw_cfg = NULL;
 
     pc_cpus_init(cpu_model);
+    pc_acpi_init("acpi-dsdt.aml");
 
     if (kvmclock_enabled) {
         kvmclock_create();
diff --git a/hw/pc_q35.c b/hw/pc_q35.c
index c7262d6..ef540b6 100644
--- a/hw/pc_q35.c
+++ b/hw/pc_q35.c
@@ -87,6 +87,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     qemu_irq *cmos_s3;
 
     pc_cpus_init(cpu_model);
+    pc_acpi_init("q35-acpi-dsdt.aml");
 
     kvmclock_create();
 
-- 
1.7.1

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

* [Qemu-devel] [PATCH 3/4] apci: assign memory regions to piix4 acpi device
  2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 1/4] configure: also symlink *.aml files Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 2/4] acpi: autoload dsdt Gerd Hoffmann
@ 2013-01-04  8:10 ` Gerd Hoffmann
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 4/4] apci: assign memory regions to ich9 lpc device Gerd Hoffmann
  2013-01-04 20:21 ` [Qemu-devel] [PULL 0/4] acpi fixups Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2013-01-04  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Get rid of get_system_io() usage.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi_piix4.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index f53b969..06a8aca 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -57,6 +57,7 @@ struct pci_status {
 
 typedef struct PIIX4PMState {
     PCIDevice dev;
+
     MemoryRegion io;
     MemoryRegion io_gpe;
     MemoryRegion io_pci;
@@ -83,7 +84,8 @@ typedef struct PIIX4PMState {
     uint8_t s4_val;
 } PIIX4PMState;
 
-static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s);
+static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
+                                           PCIBus *bus, PIIX4PMState *s);
 
 #define ACPI_ENABLE 0xf1
 #define ACPI_DISABLE 0xf0
@@ -406,11 +408,13 @@ static int piix4_pm_initfn(PCIDevice *dev)
     pci_conf[0xd2] = 0x09;
     pm_smbus_init(&s->dev.qdev, &s->smb);
     memory_region_set_enabled(&s->smb.io, pci_conf[0xd2] & 1);
-    memory_region_add_subregion(get_system_io(), s->smb_io_base, &s->smb.io);
+    memory_region_add_subregion(pci_address_space_io(dev),
+                                s->smb_io_base, &s->smb.io);
 
     memory_region_init(&s->io, "piix4-pm", 64);
     memory_region_set_enabled(&s->io, false);
-    memory_region_add_subregion(get_system_io(), 0, &s->io);
+    memory_region_add_subregion(pci_address_space_io(dev),
+                                0, &s->io);
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
@@ -423,7 +427,8 @@ static int piix4_pm_initfn(PCIDevice *dev)
     s->machine_ready.notify = piix4_pm_machine_ready;
     qemu_add_machine_init_done_notifier(&s->machine_ready);
     qemu_register_reset(piix4_reset, s);
-    piix4_acpi_system_hot_add_init(dev->bus, s);
+
+    piix4_acpi_system_hot_add_init(pci_address_space_io(dev), dev->bus, s);
 
     return 0;
 }
@@ -593,15 +598,16 @@ static const MemoryRegionOps piix4_pci_ops = {
 static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
                                 PCIHotplugState state);
 
-static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s)
+static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
+                                           PCIBus *bus, PIIX4PMState *s)
 {
     memory_region_init_io(&s->io_gpe, &piix4_gpe_ops, s, "apci-gpe0",
                           GPE_LEN);
-    memory_region_add_subregion(get_system_io(), GPE_BASE, &s->io_gpe);
+    memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe);
 
     memory_region_init_io(&s->io_pci, &piix4_pci_ops, s, "apci-pci-hotplug",
                           PCI_HOTPLUG_SIZE);
-    memory_region_add_subregion(get_system_io(), PCI_HOTPLUG_ADDR,
+    memory_region_add_subregion(parent, PCI_HOTPLUG_ADDR,
                                 &s->io_pci);
     pci_bus_hotplug(bus, piix4_device_hotplug, &s->dev.qdev);
 }
-- 
1.7.1

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

* [Qemu-devel] [PATCH 4/4] apci: assign memory regions to ich9 lpc device
  2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 3/4] apci: assign memory regions to piix4 acpi device Gerd Hoffmann
@ 2013-01-04  8:10 ` Gerd Hoffmann
  2013-01-04 20:21 ` [Qemu-devel] [PULL 0/4] acpi fixups Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Gerd Hoffmann @ 2013-01-04  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Get rid of get_system_io() usage.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi_ich9.c |    6 ++++--
 hw/acpi_ich9.h |    4 +++-
 hw/lpc_ich9.c  |    2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
index 37a50e6..d2f9808 100644
--- a/hw/acpi_ich9.c
+++ b/hw/acpi_ich9.c
@@ -202,11 +202,13 @@ static void pm_powerdown_req(Notifier *n, void *opaque)
     acpi_pm1_evt_power_down(&pm->acpi_regs);
 }
 
-void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
+void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
+                  qemu_irq sci_irq, qemu_irq cmos_s3)
 {
     memory_region_init(&pm->io, "ich9-pm", ICH9_PMIO_SIZE);
     memory_region_set_enabled(&pm->io, false);
-    memory_region_add_subregion(get_system_io(), 0, &pm->io);
+    memory_region_add_subregion(pci_address_space_io(lpc_pci),
+                                0, &pm->io);
 
     acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
diff --git a/hw/acpi_ich9.h b/hw/acpi_ich9.h
index bc221d3..ecb82ab 100644
--- a/hw/acpi_ich9.h
+++ b/hw/acpi_ich9.h
@@ -30,9 +30,11 @@ typedef struct ICH9LPCPMRegs {
      * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
      */
     ACPIREGS acpi_regs;
+
     MemoryRegion io;
     MemoryRegion io_gpe;
     MemoryRegion io_smi;
+
     uint32_t smi_en;
     uint32_t smi_sts;
 
@@ -42,7 +44,7 @@ typedef struct ICH9LPCPMRegs {
     Notifier powerdown_notifier;
 } ICH9LPCPMRegs;
 
-void ich9_pm_init(ICH9LPCPMRegs *pm,
+void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
                   qemu_irq sci_irq, qemu_irq cmos_s3_resume);
 void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
 extern const VMStateDescription vmstate_ich9_pm;
diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
index a068715..16843d7 100644
--- a/hw/lpc_ich9.c
+++ b/hw/lpc_ich9.c
@@ -336,7 +336,7 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
     qemu_irq *sci_irq;
 
     sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
-    ich9_pm_init(&lpc->pm, sci_irq[0], cmos_s3);
+    ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0], cmos_s3);
 
     ich9_lpc_reset(&lpc->d.qdev);
 }
-- 
1.7.1

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

* Re: [Qemu-devel] [PULL 0/4] acpi fixups
  2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2013-01-04  8:10 ` [Qemu-devel] [PATCH 4/4] apci: assign memory regions to ich9 lpc device Gerd Hoffmann
@ 2013-01-04 20:21 ` Anthony Liguori
  4 siblings, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2013-01-04 20:21 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel

Pulled, thanks.

N.B.  This note may be extraneous because the pull request was sent by a
version of git older than 1.7.9 making the pull request ambigious.  Please
consider upgrading to a newer version of git.

Regards,

Anthony Liguori

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

end of thread, other threads:[~2013-01-04 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04  8:10 [Qemu-devel] [PULL 0/4] acpi fixups Gerd Hoffmann
2013-01-04  8:10 ` [Qemu-devel] [PATCH 1/4] configure: also symlink *.aml files Gerd Hoffmann
2013-01-04  8:10 ` [Qemu-devel] [PATCH 2/4] acpi: autoload dsdt Gerd Hoffmann
2013-01-04  8:10 ` [Qemu-devel] [PATCH 3/4] apci: assign memory regions to piix4 acpi device Gerd Hoffmann
2013-01-04  8:10 ` [Qemu-devel] [PATCH 4/4] apci: assign memory regions to ich9 lpc device Gerd Hoffmann
2013-01-04 20:21 ` [Qemu-devel] [PULL 0/4] acpi fixups Anthony Liguori

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).