* [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
@ 2024-02-13 12:01 Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 1/7] target/i386/monitor: Remove unused 'hw/i386/pc.h' header Philippe Mathieu-Daudé
` (9 more replies)
0 siblings, 10 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
Trivial patches removing uses of "hw/i386/pc.h".
Philippe Mathieu-Daudé (7):
target/i386/monitor: Remove unused 'hw/i386/pc.h' header
hw/timer: Move HPET_INTCAP definition to "hpet.h"
hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
hw/i386/port92: Add missing 'hw/isa/isa.h' header
hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
hw/i386/acpi-common.h | 3 +++
include/hw/i386/pc.h | 6 ------
include/hw/timer/hpet.h | 2 ++
hw/acpi/cpu_hotplug.c | 4 ++--
hw/i386/acpi-common.c | 1 -
hw/i386/port92.c | 1 +
hw/isa/lpc_ich9.c | 1 -
hw/timer/hpet.c | 1 -
target/i386/monitor.c | 1 -
9 files changed, 8 insertions(+), 12 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/7] target/i386/monitor: Remove unused 'hw/i386/pc.h' header
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 2/7] hw/timer: Move HPET_INTCAP definition to "hpet.h" Philippe Mathieu-Daudé
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/i386/monitor.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 950ff9ccbc..3a281dab02 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -33,7 +33,6 @@
#include "qapi/error.h"
#include "qapi/qapi-commands-misc-target.h"
#include "qapi/qapi-commands-misc.h"
-#include "hw/i386/pc.h"
/* Perform linear address sign extension */
static hwaddr addr_canonical(CPUArchState *env, hwaddr addr)
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/7] hw/timer: Move HPET_INTCAP definition to "hpet.h"
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 1/7] target/i386/monitor: Remove unused 'hw/i386/pc.h' header Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 3/7] hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (7 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
HPET_INTCAP is specific to TYPE_HPET, so define it there.
hpet.c doesn't need to include "hw/i386/pc.h" anymore.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/i386/pc.h | 2 --
include/hw/timer/hpet.h | 2 ++
hw/timer/hpet.c | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index ec0e5efcb2..f9fc42c2be 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -15,8 +15,6 @@
#include "hw/firmware/smbios.h"
#include "hw/cxl/cxl.h"
-#define HPET_INTCAP "hpet-intcap"
-
/**
* PCMachineState:
* @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h
index f04c4d3238..d17a8d4319 100644
--- a/include/hw/timer/hpet.h
+++ b/include/hw/timer/hpet.h
@@ -78,6 +78,8 @@ extern struct hpet_fw_config hpet_cfg;
#define TYPE_HPET "hpet"
+#define HPET_INTCAP "hpet-intcap"
+
static inline bool hpet_find(void)
{
return object_resolve_path_type("", TYPE_HPET, NULL);
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 1672faa4f2..01efe4885d 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -25,7 +25,6 @@
*/
#include "qemu/osdep.h"
-#include "hw/i386/pc.h"
#include "hw/irq.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7] hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 1/7] target/i386/monitor: Remove unused 'hw/i386/pc.h' header Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 2/7] hw/timer: Move HPET_INTCAP definition to "hpet.h" Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h' Philippe Mathieu-Daudé
` (6 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
Commit c461f3e382 ("hw/acpi/acpi_dev_interface: Remove now unused
madt_cpu virtual method") removed the need for "hw/i386/pc.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/isa/lpc_ich9.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 3924eec483..b39d840ccd 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -41,7 +41,6 @@
#include "hw/isa/apm.h"
#include "hw/pci/pci.h"
#include "hw/southbridge/ich9.h"
-#include "hw/i386/pc.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/ich9.h"
#include "hw/pci/pci_bus.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2024-02-13 12:01 ` [PATCH 3/7] hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h' Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 18:57 ` Bernhard Beschow
2024-02-13 12:01 ` [PATCH 5/7] hw/i386/port92: Add missing 'hw/isa/isa.h' header Philippe Mathieu-Daudé
` (5 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
Since pc_madt_cpu_entry() is only used by:
- hw/i386/acpi-build.c // single call
- hw/i386/acpi-common.c // definition
there is no need to expose it outside of hw/i386/.
Declare it in "acpi-common.h".
acpi-build.c doesn't need "hw/i386/pc.h" anymore.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/acpi-common.h | 3 +++
include/hw/i386/pc.h | 4 ----
hw/i386/acpi-common.c | 1 -
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h
index b3c56ee014..e305aaac15 100644
--- a/hw/i386/acpi-common.h
+++ b/hw/i386/acpi-common.h
@@ -1,12 +1,15 @@
#ifndef HW_I386_ACPI_COMMON_H
#define HW_I386_ACPI_COMMON_H
+#include "hw/boards.h"
#include "hw/acpi/bios-linker-loader.h"
#include "hw/i386/x86.h"
/* Default IOAPIC ID */
#define ACPI_BUILD_IOAPIC_ID 0x0
+void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
+ GArray *entry, bool force_enabled);
void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
X86MachineState *x86ms,
const char *oem_id, const char *oem_table_id);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f9fc42c2be..ce442372ac 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -199,10 +199,6 @@ bool pc_system_ovmf_table_find(const char *entry, uint8_t **data,
int *data_len);
void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);
-/* hw/i386/acpi-common.c */
-void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
- GArray *entry, bool force_enabled);
-
/* sgx.c */
void pc_machine_init_sgx_epc(PCMachineState *pcms);
diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
index 43dc23f7e0..f1a11f833a 100644
--- a/hw/i386/acpi-common.c
+++ b/hw/i386/acpi-common.c
@@ -27,7 +27,6 @@
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
#include "hw/acpi/utils.h"
-#include "hw/i386/pc.h"
#include "target/i386/cpu.h"
#include "acpi-build.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7] hw/i386/port92: Add missing 'hw/isa/isa.h' header
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2024-02-13 12:01 ` [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h' Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 6/7] hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h' Philippe Mathieu-Daudé
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
TYPE_PORT92 inherits TYPE_ISA_DEVICE, so need to include
"hw/isa/isa.h" to get its declarations (currently we
indirectly include this header via "hw/i386/pc.h").
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/port92.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/i386/port92.c b/hw/i386/port92.c
index 1070bfbf36..b25157f6e4 100644
--- a/hw/i386/port92.c
+++ b/hw/i386/port92.c
@@ -10,6 +10,7 @@
#include "sysemu/runstate.h"
#include "migration/vmstate.h"
#include "hw/irq.h"
+#include "hw/isa/isa.h"
#include "hw/i386/pc.h"
#include "trace.h"
#include "qom/object.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 6/7] hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2024-02-13 12:01 ` [PATCH 5/7] hw/i386/port92: Add missing 'hw/isa/isa.h' header Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 7/7] hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h' Philippe Mathieu-Daudé
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
cpu_hotplug.c only needs the PCI *device* definitions.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/acpi/cpu_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 6f78db0ccb..f7fe905e0a 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -14,7 +14,7 @@
#include "qapi/error.h"
#include "hw/core/cpu.h"
#include "hw/i386/pc.h"
-#include "hw/pci/pci.h"
+#include "hw/pci/pci_device.h"
#include "qemu/error-report.h"
#define CPU_EJECT_METHOD "CPEJ"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7] hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2024-02-13 12:01 ` [PATCH 6/7] hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h' Philippe Mathieu-Daudé
@ 2024-02-13 12:01 ` Philippe Mathieu-Daudé
2024-02-13 14:27 ` [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Luc Michel
` (2 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 12:01 UTC (permalink / raw)
To: qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial,
Philippe Mathieu-Daudé
X86 CPU hotplug isn't specific to PC machines.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/acpi/cpu_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index f7fe905e0a..83b8bc5deb 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -13,7 +13,7 @@
#include "hw/acpi/cpu_hotplug.h"
#include "qapi/error.h"
#include "hw/core/cpu.h"
-#include "hw/i386/pc.h"
+#include "hw/i386/x86.h"
#include "hw/pci/pci_device.h"
#include "qemu/error-report.h"
--
2.41.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2024-02-13 12:01 ` [PATCH 7/7] hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h' Philippe Mathieu-Daudé
@ 2024-02-13 14:27 ` Luc Michel
2024-02-13 15:55 ` Michael S. Tsirkin
2024-02-14 12:45 ` Michael Tokarev
9 siblings, 0 replies; 15+ messages in thread
From: Luc Michel @ 2024-02-13 14:27 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial
On 13:01 Tue 13 Feb , Philippe Mathieu-Daudé wrote:
> Trivial patches removing uses of "hw/i386/pc.h".
>
> Philippe Mathieu-Daudé (7):
> target/i386/monitor: Remove unused 'hw/i386/pc.h' header
> hw/timer: Move HPET_INTCAP definition to "hpet.h"
> hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
> hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
> hw/i386/port92: Add missing 'hw/isa/isa.h' header
> hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
> hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
>
> hw/i386/acpi-common.h | 3 +++
> include/hw/i386/pc.h | 6 ------
> include/hw/timer/hpet.h | 2 ++
> hw/acpi/cpu_hotplug.c | 4 ++--
> hw/i386/acpi-common.c | 1 -
> hw/i386/port92.c | 1 +
> hw/isa/lpc_ich9.c | 1 -
> hw/timer/hpet.c | 1 -
> target/i386/monitor.c | 1 -
> 9 files changed, 8 insertions(+), 12 deletions(-)
>
> --
> 2.41.0
>
>
For the series:
Reviewed-by: Luc Michel <luc.michel@amd.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2024-02-13 14:27 ` [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Luc Michel
@ 2024-02-13 15:55 ` Michael S. Tsirkin
2024-02-13 16:00 ` Philippe Mathieu-Daudé
2024-02-14 12:45 ` Michael Tokarev
9 siblings, 1 reply; 15+ messages in thread
From: Michael S. Tsirkin @ 2024-02-13 15:55 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Igor Mammedov, Marcel Apfelbaum, Bernhard Beschow, Ani Sinha,
qemu-trivial
On Tue, Feb 13, 2024 at 01:01:45PM +0100, Philippe Mathieu-Daudé wrote:
> Trivial patches removing uses of "hw/i386/pc.h".
How did you test that it's indeed unused?
> Philippe Mathieu-Daudé (7):
> target/i386/monitor: Remove unused 'hw/i386/pc.h' header
> hw/timer: Move HPET_INTCAP definition to "hpet.h"
> hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
> hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
> hw/i386/port92: Add missing 'hw/isa/isa.h' header
> hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
> hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
>
> hw/i386/acpi-common.h | 3 +++
> include/hw/i386/pc.h | 6 ------
> include/hw/timer/hpet.h | 2 ++
> hw/acpi/cpu_hotplug.c | 4 ++--
> hw/i386/acpi-common.c | 1 -
> hw/i386/port92.c | 1 +
> hw/isa/lpc_ich9.c | 1 -
> hw/timer/hpet.c | 1 -
> target/i386/monitor.c | 1 -
> 9 files changed, 8 insertions(+), 12 deletions(-)
>
> --
> 2.41.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
2024-02-13 15:55 ` Michael S. Tsirkin
@ 2024-02-13 16:00 ` Philippe Mathieu-Daudé
2024-02-15 19:33 ` Bernhard Beschow
0 siblings, 1 reply; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-13 16:00 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: qemu-devel, Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Igor Mammedov, Marcel Apfelbaum, Bernhard Beschow, Ani Sinha,
qemu-trivial
On 13/2/24 16:55, Michael S. Tsirkin wrote:
> On Tue, Feb 13, 2024 at 01:01:45PM +0100, Philippe Mathieu-Daudé wrote:
>> Trivial patches removing uses of "hw/i386/pc.h".
>
> How did you test that it's indeed unused?
I put and #error in hw/i386/pc.h and built :)
(I'm trying to remove the PC dependency on generic devices.)
The few generic devices left are not as trivial.
>> Philippe Mathieu-Daudé (7):
>> target/i386/monitor: Remove unused 'hw/i386/pc.h' header
>> hw/timer: Move HPET_INTCAP definition to "hpet.h"
>> hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
>> hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
>> hw/i386/port92: Add missing 'hw/isa/isa.h' header
>> hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
>> hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
>>
>> hw/i386/acpi-common.h | 3 +++
>> include/hw/i386/pc.h | 6 ------
>> include/hw/timer/hpet.h | 2 ++
>> hw/acpi/cpu_hotplug.c | 4 ++--
>> hw/i386/acpi-common.c | 1 -
>> hw/i386/port92.c | 1 +
>> hw/isa/lpc_ich9.c | 1 -
>> hw/timer/hpet.c | 1 -
>> target/i386/monitor.c | 1 -
>> 9 files changed, 8 insertions(+), 12 deletions(-)
>>
>> --
>> 2.41.0
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
2024-02-13 12:01 ` [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h' Philippe Mathieu-Daudé
@ 2024-02-13 18:57 ` Bernhard Beschow
2024-02-14 6:58 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 15+ messages in thread
From: Bernhard Beschow @ 2024-02-13 18:57 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum, Ani Sinha,
qemu-trivial
Am 13. Februar 2024 12:01:49 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>Since pc_madt_cpu_entry() is only used by:
> - hw/i386/acpi-build.c // single call
> - hw/i386/acpi-common.c // definition
>there is no need to expose it outside of hw/i386/.
>Declare it in "acpi-common.h".
>acpi-build.c doesn't need "hw/i386/pc.h" anymore.
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> hw/i386/acpi-common.h | 3 +++
> include/hw/i386/pc.h | 4 ----
> hw/i386/acpi-common.c | 1 -
> 3 files changed, 3 insertions(+), 5 deletions(-)
>
>diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h
>index b3c56ee014..e305aaac15 100644
>--- a/hw/i386/acpi-common.h
>+++ b/hw/i386/acpi-common.h
>@@ -1,12 +1,15 @@
> #ifndef HW_I386_ACPI_COMMON_H
> #define HW_I386_ACPI_COMMON_H
>
>+#include "hw/boards.h"
> #include "hw/acpi/bios-linker-loader.h"
> #include "hw/i386/x86.h"
>
> /* Default IOAPIC ID */
> #define ACPI_BUILD_IOAPIC_ID 0x0
>
>+void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
Since the function is apparently not pc but rather x86-specific: Does it make sense to rename the function as well, e.g. to x86_madt_cpu_entry()?
Best regards,
Bernhard
>+ GArray *entry, bool force_enabled);
> void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
> X86MachineState *x86ms,
> const char *oem_id, const char *oem_table_id);
>diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
>index f9fc42c2be..ce442372ac 100644
>--- a/include/hw/i386/pc.h
>+++ b/include/hw/i386/pc.h
>@@ -199,10 +199,6 @@ bool pc_system_ovmf_table_find(const char *entry, uint8_t **data,
> int *data_len);
> void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);
>
>-/* hw/i386/acpi-common.c */
>-void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
>- GArray *entry, bool force_enabled);
>-
> /* sgx.c */
> void pc_machine_init_sgx_epc(PCMachineState *pcms);
>
>diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
>index 43dc23f7e0..f1a11f833a 100644
>--- a/hw/i386/acpi-common.c
>+++ b/hw/i386/acpi-common.c
>@@ -27,7 +27,6 @@
> #include "hw/acpi/acpi.h"
> #include "hw/acpi/aml-build.h"
> #include "hw/acpi/utils.h"
>-#include "hw/i386/pc.h"
> #include "target/i386/cpu.h"
>
> #include "acpi-build.h"
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
2024-02-13 18:57 ` Bernhard Beschow
@ 2024-02-14 6:58 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-14 6:58 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum, Ani Sinha,
qemu-trivial
On 13/2/24 19:57, Bernhard Beschow wrote:
>
>
> Am 13. Februar 2024 12:01:49 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> Since pc_madt_cpu_entry() is only used by:
>> - hw/i386/acpi-build.c // single call
>> - hw/i386/acpi-common.c // definition
>> there is no need to expose it outside of hw/i386/.
>> Declare it in "acpi-common.h".
>> acpi-build.c doesn't need "hw/i386/pc.h" anymore.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/i386/acpi-common.h | 3 +++
>> include/hw/i386/pc.h | 4 ----
>> hw/i386/acpi-common.c | 1 -
>> 3 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h
>> index b3c56ee014..e305aaac15 100644
>> --- a/hw/i386/acpi-common.h
>> +++ b/hw/i386/acpi-common.h
>> @@ -1,12 +1,15 @@
>> #ifndef HW_I386_ACPI_COMMON_H
>> #define HW_I386_ACPI_COMMON_H
>>
>> +#include "hw/boards.h"
>> #include "hw/acpi/bios-linker-loader.h"
>> #include "hw/i386/x86.h"
>>
>> /* Default IOAPIC ID */
>> #define ACPI_BUILD_IOAPIC_ID 0x0
>>
>> +void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
>
> Since the function is apparently not pc but rather x86-specific: Does it make sense to rename the function as well, e.g. to x86_madt_cpu_entry()?
I don't know much about ACPI tables. Is it?
Ani, can you confirm and do you mind posting a cleanup patch on top? :)
Regards,
Phil.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2024-02-13 15:55 ` Michael S. Tsirkin
@ 2024-02-14 12:45 ` Michael Tokarev
9 siblings, 0 replies; 15+ messages in thread
From: Michael Tokarev @ 2024-02-14 12:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Michael S. Tsirkin, Igor Mammedov, Marcel Apfelbaum,
Bernhard Beschow, Ani Sinha, qemu-trivial
13.02.2024 15:01, Philippe Mathieu-Daudé wrote:
> Trivial patches removing uses of "hw/i386/pc.h".
>
> Philippe Mathieu-Daudé (7):
> target/i386/monitor: Remove unused 'hw/i386/pc.h' header
> hw/timer: Move HPET_INTCAP definition to "hpet.h"
> hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
> hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
> hw/i386/port92: Add missing 'hw/isa/isa.h' header
> hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
> hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
>
> hw/i386/acpi-common.h | 3 +++
> include/hw/i386/pc.h | 6 ------
> include/hw/timer/hpet.h | 2 ++
> hw/acpi/cpu_hotplug.c | 4 ++--
> hw/i386/acpi-common.c | 1 -
> hw/i386/port92.c | 1 +
> hw/isa/lpc_ich9.c | 1 -
> hw/timer/hpet.c | 1 -
> target/i386/monitor.c | 1 -
> 9 files changed, 8 insertions(+), 12 deletions(-)
For the series:
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
and picked up for trivial-patches.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h'
2024-02-13 16:00 ` Philippe Mathieu-Daudé
@ 2024-02-15 19:33 ` Bernhard Beschow
0 siblings, 0 replies; 15+ messages in thread
From: Bernhard Beschow @ 2024-02-15 19:33 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Michael S. Tsirkin
Cc: qemu-devel, Eduardo Habkost, Richard Henderson, Paolo Bonzini,
Igor Mammedov, Marcel Apfelbaum, Ani Sinha, qemu-trivial
Am 13. Februar 2024 16:00:26 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>On 13/2/24 16:55, Michael S. Tsirkin wrote:
>> On Tue, Feb 13, 2024 at 01:01:45PM +0100, Philippe Mathieu-Daudé wrote:
>>> Trivial patches removing uses of "hw/i386/pc.h".
>>
>> How did you test that it's indeed unused?
>
>I put and #error in hw/i386/pc.h and built :)
>(I'm trying to remove the PC dependency on generic devices.)
>
>The few generic devices left are not as trivial.
>
>>> Philippe Mathieu-Daudé (7):
>>> target/i386/monitor: Remove unused 'hw/i386/pc.h' header
>>> hw/timer: Move HPET_INTCAP definition to "hpet.h"
>>> hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h'
>>> hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'
>>> hw/i386/port92: Add missing 'hw/isa/isa.h' header
>>> hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h'
>>> hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h'
>>>
>>> hw/i386/acpi-common.h | 3 +++
>>> include/hw/i386/pc.h | 6 ------
>>> include/hw/timer/hpet.h | 2 ++
>>> hw/acpi/cpu_hotplug.c | 4 ++--
>>> hw/i386/acpi-common.c | 1 -
>>> hw/i386/port92.c | 1 +
I'd take care of port92 and make it part of all our three south bridge families (which models the real hardware more closely).
Best regards,
Bernhard
>>> hw/isa/lpc_ich9.c | 1 -
>>> hw/timer/hpet.c | 1 -
>>> target/i386/monitor.c | 1 -
>>> 9 files changed, 8 insertions(+), 12 deletions(-)
>>>
>>> --
>>> 2.41.0
>>
>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-02-15 20:14 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 12:01 [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 1/7] target/i386/monitor: Remove unused 'hw/i386/pc.h' header Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 2/7] hw/timer: Move HPET_INTCAP definition to "hpet.h" Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 3/7] hw/isa/lpc_ich9: Remove unused 'hw/i386/pc.h' Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h' Philippe Mathieu-Daudé
2024-02-13 18:57 ` Bernhard Beschow
2024-02-14 6:58 ` Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 5/7] hw/i386/port92: Add missing 'hw/isa/isa.h' header Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 6/7] hw/acpi/cpu_hotplug: Include 'pci_device.h' instead of 'pci.h' Philippe Mathieu-Daudé
2024-02-13 12:01 ` [PATCH 7/7] hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h' Philippe Mathieu-Daudé
2024-02-13 14:27 ` [PATCH 0/7] hw/i386: Cleanups around 'hw/i386/pc.h' Luc Michel
2024-02-13 15:55 ` Michael S. Tsirkin
2024-02-13 16:00 ` Philippe Mathieu-Daudé
2024-02-15 19:33 ` Bernhard Beschow
2024-02-14 12:45 ` Michael Tokarev
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).