qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* RE-sending reviewed patches for inclusion in next PR
@ 2021-08-25  3:19 Ani Sinha
  2021-08-25  3:19 ` [PATCH 1/5] hw/pci: remove all references to find_i440fx function Ani Sinha
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, qemu-devel

Michael:

Now that Qemu 6.1.0 has been released, as per your suggestion, I am sending
all my reviewed and queued patches in this patch series for inclusion with
your next pull request.

[PATCH 1/5] hw/pci: remove all references to find_i440fx function
[PATCH 2/5] hw/acpi: use existing references to pci device struct
[PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios
[PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings
[PATCH 5/5] hw/arm/Kconfig: no need to enable

thanks
ani



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

* [PATCH 1/5] hw/pci: remove all references to find_i440fx function
  2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
@ 2021-08-25  3:19 ` Ani Sinha
  2021-08-25  3:19 ` [PATCH 2/5] hw/acpi: use existing references to pci device struct within functions Ani Sinha
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, Peter Maydell, qemu-devel, Philippe Mathieu-Daudé

commit c0e427d6eb5fefc538 ("hw/acpi/ich9: Enable ACPI PCI hot-plug") removed all
uses of find_i440fx() function. This has been replaced by the more generic call
acpi_get_i386_pci_host() which maybe able to find the root bus both for i440fx
machine type as well as for the q35 machine type. There seems to be no more any
need to maintain a i440fx specific version of the api call. Remove it.

Tested by building from a clean tree successfully.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/pci-host/i440fx.c         | 8 --------
 include/hw/pci-host/i440fx.h | 1 -
 stubs/meson.build            | 1 -
 stubs/pci-host-piix.c        | 7 -------
 4 files changed, 17 deletions(-)
 delete mode 100644 stubs/pci-host-piix.c

diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c
index 28c9bae899..e08716142b 100644
--- a/hw/pci-host/i440fx.c
+++ b/hw/pci-host/i440fx.c
@@ -314,14 +314,6 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type,
     return b;
 }
 
-PCIBus *find_i440fx(void)
-{
-    PCIHostState *s = OBJECT_CHECK(PCIHostState,
-                                   object_resolve_path("/machine/i440fx", NULL),
-                                   TYPE_PCI_HOST_BRIDGE);
-    return s ? s->bus : NULL;
-}
-
 static void i440fx_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
diff --git a/include/hw/pci-host/i440fx.h b/include/hw/pci-host/i440fx.h
index 7fcfd9485c..f068aaba8f 100644
--- a/include/hw/pci-host/i440fx.h
+++ b/include/hw/pci-host/i440fx.h
@@ -45,6 +45,5 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type,
                     MemoryRegion *pci_memory,
                     MemoryRegion *ram_memory);
 
-PCIBus *find_i440fx(void);
 
 #endif
diff --git a/stubs/meson.build b/stubs/meson.build
index d3fa8646b3..0faa2a74b7 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -27,7 +27,6 @@ stub_ss.add(files('module-opts.c'))
 stub_ss.add(files('monitor.c'))
 stub_ss.add(files('monitor-core.c'))
 stub_ss.add(files('pci-bus.c'))
-stub_ss.add(files('pci-host-piix.c'))
 stub_ss.add(files('qemu-timer-notify-cb.c'))
 stub_ss.add(files('qmp_memory_device.c'))
 stub_ss.add(files('qmp-command-available.c'))
diff --git a/stubs/pci-host-piix.c b/stubs/pci-host-piix.c
deleted file mode 100644
index 93975adbfe..0000000000
--- a/stubs/pci-host-piix.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "qemu/osdep.h"
-#include "hw/pci-host/i440fx.h"
-
-PCIBus *find_i440fx(void)
-{
-    return NULL;
-}
-- 
2.25.1



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

* [PATCH 2/5] hw/acpi: use existing references to pci device struct within functions
  2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
  2021-08-25  3:19 ` [PATCH 1/5] hw/pci: remove all references to find_i440fx function Ani Sinha
@ 2021-08-25  3:19 ` Ani Sinha
  2021-08-25  3:19 ` [PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem Ani Sinha
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, Philippe Mathieu-Daudé, qemu-devel

There is no need to use fresh typecasts to get references to pci device structs
when there is an existing reference to pci device struct. Use existing reference.
Minor cleanup.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/acpi/pcihp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index f4d706e47d..f610a25d2e 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -283,7 +283,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev,
 
     /* Only hotplugged devices need the hotplug capability. */
     if (dev->hotplugged &&
-        acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))) < 0) {
+        acpi_pcihp_get_bsel(pci_get_bus(pdev)) < 0) {
         error_setg(errp, "Unsupported bus. Bus doesn't have property '"
                    ACPI_PCIHP_PROP_BSEL "' set");
         return;
@@ -363,8 +363,8 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
 {
     PCIDevice *pdev = PCI_DEVICE(dev);
 
-    trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn),
-                          acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))));
+    trace_acpi_pci_unplug(PCI_SLOT(pdev->devfn),
+                          acpi_pcihp_get_bsel(pci_get_bus(pdev)));
 
     /*
      * clean up acpi-index so it could reused by another device
-- 
2.25.1



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

* [PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem
  2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
  2021-08-25  3:19 ` [PATCH 1/5] hw/pci: remove all references to find_i440fx function Ani Sinha
  2021-08-25  3:19 ` [PATCH 2/5] hw/acpi: use existing references to pci device struct within functions Ani Sinha
@ 2021-08-25  3:19 ` Ani Sinha
  2021-08-25  3:19 ` [PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place Ani Sinha
  2021-08-25  3:19 ` [PATCH 5/5] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly Ani Sinha
  4 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, Igor Mammedov, Philippe Mathieu-Daudé, qemu-devel

I have developed an interest in this space and hopefully can lend some
helping hand to Igor and Michael in reviewing simpler patches.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6b3697962c..79b3e19931 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1739,6 +1739,7 @@ F: docs/specs/*pci*
 ACPI/SMBIOS
 M: Michael S. Tsirkin <mst@redhat.com>
 M: Igor Mammedov <imammedo@redhat.com>
+R: Ani Sinha <ani@anisinha.ca>
 S: Supported
 F: include/hw/acpi/*
 F: include/hw/firmware/smbios.h
-- 
2.25.1



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

* [PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place
  2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
                   ` (2 preceding siblings ...)
  2021-08-25  3:19 ` [PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem Ani Sinha
@ 2021-08-25  3:19 ` Ani Sinha
  2021-08-25  3:19 ` [PATCH 5/5] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly Ani Sinha
  4 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, Philippe Mathieu-Daudé, qemu-devel

Now that we have "acpi-pci-hotplug-with-bridge-support" PIIX4 PM property being
used for both q35 and i440fx machine types, it is better that we defined this
property string at a single place within a header file like other PIIX4
properties. We can then use this single definition at all the places that needs
it instead of duplicating the string everywhere. While at it, this change also
adds a definition for "acpi-root-pci-hotplug" PIIX4 PM property and uses
this definition at all places that were formally using the string value.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/acpi/ich9.c         | 2 +-
 hw/acpi/piix4.c        | 4 ++--
 hw/i386/acpi-build.c   | 4 ++--
 hw/i386/pc.c           | 4 ++--
 hw/i386/pc_q35.c       | 2 +-
 include/hw/acpi/acpi.h | 2 ++
 6 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 778e27b659..1ee2ba2c50 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -451,7 +451,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
     object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED,
                              ich9_pm_get_enable_tco,
                              ich9_pm_set_enable_tco);
-    object_property_add_bool(obj, "acpi-pci-hotplug-with-bridge-support",
+    object_property_add_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                              ich9_pm_get_acpi_pci_hotplug,
                              ich9_pm_set_acpi_pci_hotplug);
 }
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 48f7a1edbc..f0b5fac44a 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -647,9 +647,9 @@ static Property piix4_pm_properties[] = {
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
-    DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState,
+    DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, PIIX4PMState,
                      use_acpi_hotplug_bridge, true),
-    DEFINE_PROP_BOOL("acpi-root-pci-hotplug", PIIX4PMState,
+    DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCI_ROOTHP, PIIX4PMState,
                      use_acpi_root_pci_hotplug, true),
     DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
                      acpi_memory_hotplug.is_enabled, true),
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a33ac8b91e..6c27e12e2a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -267,10 +267,10 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
     qobject_unref(o);
 
     pm->pcihp_bridge_en =
-        object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support",
+        object_property_get_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                                  NULL);
     pm->pcihp_root_en =
-        object_property_get_bool(obj, "acpi-root-pci-hotplug",
+        object_property_get_bool(obj, ACPI_PM_PROP_ACPI_PCI_ROOTHP,
                                  NULL);
 }
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c2b9d62a35..25ae3881e9 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -99,7 +99,7 @@ GlobalProperty pc_compat_6_0[] = {
     { "qemu64" "-" TYPE_X86_CPU, "model", "6" },
     { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" },
     { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" },
-    { "ICH9-LPC", "acpi-pci-hotplug-with-bridge-support", "off" },
+    { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" },
 };
 const size_t pc_compat_6_0_len = G_N_ELEMENTS(pc_compat_6_0);
 
@@ -311,7 +311,7 @@ const size_t pc_compat_2_0_len = G_N_ELEMENTS(pc_compat_2_0);
 GlobalProperty pc_compat_1_7[] = {
     PC_CPU_MODEL_IDS("1.7.0")
     { TYPE_USB_DEVICE, "msos-desc", "no" },
-    { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" },
+    { "PIIX4_PM", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" },
     { "hpet", HPET_INTCAP, "4" },
 };
 const size_t pc_compat_1_7_len = G_N_ELEMENTS(pc_compat_1_7);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 04b4a4788d..5327ad5abc 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -239,7 +239,7 @@ static void pc_q35_init(MachineState *machine)
                              OBJECT(lpc), &error_abort);
 
     acpi_pcihp = object_property_get_bool(OBJECT(lpc),
-                                          "acpi-pci-hotplug-with-bridge-support",
+                                          ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
                                           NULL);
 
     if (acpi_pcihp) {
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 9e8a76f2e2..cc0d370745 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -47,6 +47,8 @@
 #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
 #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
 #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
+#define ACPI_PM_PROP_ACPI_PCIHP_BRIDGE "acpi-pci-hotplug-with-bridge-support"
+#define ACPI_PM_PROP_ACPI_PCI_ROOTHP "acpi-root-pci-hotplug"
 
 /* PM Timer ticks per second (HZ) */
 #define PM_TIMER_FREQUENCY  3579545
-- 
2.25.1



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

* [PATCH 5/5] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly
  2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
                   ` (3 preceding siblings ...)
  2021-08-25  3:19 ` [PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place Ani Sinha
@ 2021-08-25  3:19 ` Ani Sinha
  4 siblings, 0 replies; 6+ messages in thread
From: Ani Sinha @ 2021-08-25  3:19 UTC (permalink / raw)
  To: mst; +Cc: ani, Philippe Mathieu-Daudé, qemu-devel

Since commit
36b79e3219d ("hw/acpi/Kconfig: Add missing Kconfig dependencies (build error)"),
ACPI_MEMORY_HOTPLUG and ACPI_NVDIMM is implicitly turned on when
ACPI_HW_REDUCED is selected. ACPI_HW_REDUCED is already enabled. No need to
turn on ACPI_MEMORY_HOTPLUG or ACPI_NVDIMM explicitly. This is a minor cleanup.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/Kconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 4ba0aca067..dc050b5c37 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -25,9 +25,7 @@ config ARM_VIRT
     select ACPI_PCI
     select MEM_DEVICE
     select DIMM
-    select ACPI_MEMORY_HOTPLUG
     select ACPI_HW_REDUCED
-    select ACPI_NVDIMM
     select ACPI_APEI
 
 config CHEETAH
-- 
2.25.1



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

end of thread, other threads:[~2021-08-25  3:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  3:19 RE-sending reviewed patches for inclusion in next PR Ani Sinha
2021-08-25  3:19 ` [PATCH 1/5] hw/pci: remove all references to find_i440fx function Ani Sinha
2021-08-25  3:19 ` [PATCH 2/5] hw/acpi: use existing references to pci device struct within functions Ani Sinha
2021-08-25  3:19 ` [PATCH 3/5] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem Ani Sinha
2021-08-25  3:19 ` [PATCH 4/5] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place Ani Sinha
2021-08-25  3:19 ` [PATCH 5/5] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly Ani Sinha

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