* [PATCH 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:11 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback Bernhard Beschow
` (6 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
This is x86-specific code, so there is no advantage in using
pc_madt_cpu_entry() behind an architecture-agnostic interface.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/acpi-common.h | 3 +--
hw/i386/acpi-build.c | 3 +--
hw/i386/acpi-common.c | 5 ++---
hw/i386/acpi-microvm.c | 3 +--
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h
index a68825acf5..b3c56ee014 100644
--- a/hw/i386/acpi-common.h
+++ b/hw/i386/acpi-common.h
@@ -1,7 +1,6 @@
#ifndef HW_I386_ACPI_COMMON_H
#define HW_I386_ACPI_COMMON_H
-#include "hw/acpi/acpi_dev_interface.h"
#include "hw/acpi/bios-linker-loader.h"
#include "hw/i386/x86.h"
@@ -9,7 +8,7 @@
#define ACPI_BUILD_IOAPIC_ID 0x0
void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
- X86MachineState *x86ms, AcpiDeviceIf *adev,
+ X86MachineState *x86ms,
const char *oem_id, const char *oem_table_id);
#endif
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index bb12b0ad43..09586b8d9b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2547,8 +2547,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
acpi_add_table(table_offsets, tables_blob);
acpi_build_madt(tables_blob, tables->linker, x86ms,
- ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
- x86ms->oem_table_id);
+ x86ms->oem_id, x86ms->oem_table_id);
#ifdef CONFIG_ACPI_ERST
{
diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
index 8a0932fe84..43dc23f7e0 100644
--- a/hw/i386/acpi-common.c
+++ b/hw/i386/acpi-common.c
@@ -94,14 +94,13 @@ build_xrupt_override(GArray *entry, uint8_t src, uint32_t gsi, uint16_t flags)
* 5.2.8 Multiple APIC Description Table
*/
void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
- X86MachineState *x86ms, AcpiDeviceIf *adev,
+ X86MachineState *x86ms,
const char *oem_id, const char *oem_table_id)
{
int i;
bool x2apic_mode = false;
MachineClass *mc = MACHINE_GET_CLASS(x86ms);
const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms));
- AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(adev);
AcpiTable table = { .sig = "APIC", .rev = 3, .oem_id = oem_id,
.oem_table_id = oem_table_id };
@@ -111,7 +110,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
build_append_int_noprefix(table_data, 1 /* PCAT_COMPAT */, 4); /* Flags */
for (i = 0; i < apic_ids->len; i++) {
- adevc->madt_cpu(i, apic_ids, table_data, false);
+ pc_madt_cpu_entry(i, apic_ids, table_data, false);
if (apic_ids->cpus[i].arch_id > 254) {
x2apic_mode = true;
}
diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c
index a075360d85..fec22d85c1 100644
--- a/hw/i386/acpi-microvm.c
+++ b/hw/i386/acpi-microvm.c
@@ -214,8 +214,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
acpi_add_table(table_offsets, tables_blob);
acpi_build_madt(tables_blob, tables->linker, X86_MACHINE(machine),
- ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id,
- x86ms->oem_table_id);
+ x86ms->oem_id, x86ms->oem_table_id);
#ifdef CONFIG_ACPI_ERST
{
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly
2023-08-28 7:36 ` [PATCH 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly Bernhard Beschow
@ 2023-08-28 12:11 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:11 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> This is x86-specific code, so there is no advantage in using
> pc_madt_cpu_entry() behind an architecture-agnostic interface.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/i386/acpi-common.h | 3 +--
> hw/i386/acpi-build.c | 3 +--
> hw/i386/acpi-common.c | 5 ++---
> hw/i386/acpi-microvm.c | 3 +--
> 4 files changed, 5 insertions(+), 9 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
2023-08-28 7:36 ` [PATCH 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:02 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method Bernhard Beschow
` (5 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
build_cpus_aml() is architecture independent but needs to create architecture-
specific CPU AML. So far this was achieved by using a virtual method from
TYPE_ACPI_DEVICE_IF. However, build_cpus_aml() would resolve this interface from
global (!) state. This makes it quite incomprehensible where this interface
comes from (TYPE_PIIX4_PM?, TYPE_ICH9_LPC_DEVICE?, TYPE_ACPI_GED_X86?) an can
lead to crashes when the generic code is ported to new architectures.
So far, build_cpus_aml() is only called in architecture-specific code -- and
only in x86. We can therefore simply pass pc_madt_cpu_entry() as callback to
build_cpus_aml(). This is the same callback that would be used through
TYPE_ACPI_DEVICE_IF.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/hw/acpi/cpu.h | 6 +++++-
hw/acpi/cpu.c | 8 ++------
hw/i386/acpi-build.c | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h
index 999caaf510..bc901660fb 100644
--- a/include/hw/acpi/cpu.h
+++ b/include/hw/acpi/cpu.h
@@ -15,6 +15,7 @@
#include "hw/qdev-core.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
+#include "hw/boards.h"
#include "hw/hotplug.h"
typedef struct AcpiCpuStatus {
@@ -55,8 +56,11 @@ typedef struct CPUHotplugFeatures {
const char *smi_path;
} CPUHotplugFeatures;
+typedef void (*build_madt_cpu_fn)(int uid, const CPUArchIdList *apic_ids,
+ GArray *entry, bool force_enabled);
+
void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
- hwaddr io_base,
+ build_madt_cpu_fn build_madt_cpu, hwaddr io_base,
const char *res_root,
const char *event_handler_method);
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 19c154d78f..65a3202d3f 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -338,7 +338,7 @@ const VMStateDescription vmstate_cpu_hotplug = {
#define CPU_FW_EJECT_EVENT "CEJF"
void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
- hwaddr io_base,
+ build_madt_cpu_fn build_madt_cpu, hwaddr io_base,
const char *res_root,
const char *event_handler_method)
{
@@ -353,8 +353,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
MachineClass *mc = MACHINE_GET_CLASS(machine);
const CPUArchIdList *arch_ids = mc->possible_cpu_arch_ids(machine);
char *cphp_res_path = g_strdup_printf("%s." CPUHP_RES_DEVICE, res_root);
- Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL);
- AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(obj);
cpu_ctrl_dev = aml_device("%s", cphp_res_path);
{
@@ -664,9 +662,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
aml_append(dev, method);
/* build _MAT object */
- assert(adevc && adevc->madt_cpu);
- adevc->madt_cpu(i, arch_ids, madt_buf,
- true); /* set enabled flag */
+ build_madt_cpu(i, arch_ids, madt_buf, true); /* set enabled flag */
aml_append(dev, aml_name_decl("_MAT",
aml_buffer(madt_buf->len, (uint8_t *)madt_buf->data)));
g_array_free(madt_buf, true);
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 09586b8d9b..c8ac665d36 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1549,8 +1549,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
.smi_path = pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL,
.fw_unplugs_cpu = pm->smi_on_cpu_unplug,
};
- build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base,
- "\\_SB.PCI0", "\\_GPE._E02");
+ build_cpus_aml(dsdt, machine, opts, pc_madt_cpu_entry,
+ pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02");
}
if (pcms->memhp_io_base && nr_mem) {
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback
2023-08-28 7:36 ` [PATCH 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback Bernhard Beschow
@ 2023-08-28 12:02 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:02 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> build_cpus_aml() is architecture independent but needs to create architecture-
> specific CPU AML. So far this was achieved by using a virtual method from
> TYPE_ACPI_DEVICE_IF. However, build_cpus_aml() would resolve this interface from
> global (!) state. This makes it quite incomprehensible where this interface
> comes from (TYPE_PIIX4_PM?, TYPE_ICH9_LPC_DEVICE?, TYPE_ACPI_GED_X86?) an can
> lead to crashes when the generic code is ported to new architectures.
>
> So far, build_cpus_aml() is only called in architecture-specific code -- and
> only in x86. We can therefore simply pass pc_madt_cpu_entry() as callback to
> build_cpus_aml(). This is the same callback that would be used through
> TYPE_ACPI_DEVICE_IF.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> include/hw/acpi/cpu.h | 6 +++++-
> hw/acpi/cpu.c | 8 ++------
> hw/i386/acpi-build.c | 4 ++--
> 3 files changed, 9 insertions(+), 9 deletions(-)
Nice cleanup.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
2023-08-28 7:36 ` [PATCH 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly Bernhard Beschow
2023-08-28 7:36 ` [PATCH 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:03 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Bernhard Beschow
` (4 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
This virtual method was always set to the x86-specific pc_madt_cpu_entry(),
even in piix4 which is also used in MIPS. The previous changes use
pc_madt_cpu_entry() otherwise, so madt_cpu can be dropped.
Since pc_madt_cpu_entry() is now only used in x86-specific code, the stub
in hw/acpi/acpi-x86-stub can be removed as well.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/hw/acpi/acpi_dev_interface.h | 2 --
hw/acpi/acpi-x86-stub.c | 6 ------
hw/acpi/piix4.c | 2 --
hw/i386/generic_event_device_x86.c | 9 ---------
hw/isa/lpc_ich9.c | 1 -
5 files changed, 20 deletions(-)
diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
index a1648220ff..ca92928124 100644
--- a/include/hw/acpi/acpi_dev_interface.h
+++ b/include/hw/acpi/acpi_dev_interface.h
@@ -52,7 +52,5 @@ struct AcpiDeviceIfClass {
/* <public> */
void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev);
- void (*madt_cpu)(int uid, const CPUArchIdList *apic_ids, GArray *entry,
- bool force_enabled);
};
#endif
diff --git a/hw/acpi/acpi-x86-stub.c b/hw/acpi/acpi-x86-stub.c
index d0d399d26b..9662a594ad 100644
--- a/hw/acpi/acpi-x86-stub.c
+++ b/hw/acpi/acpi-x86-stub.c
@@ -1,12 +1,6 @@
#include "qemu/osdep.h"
-#include "hw/i386/pc.h"
#include "hw/i386/acpi-build.h"
-void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
- GArray *entry, bool force_enabled)
-{
-}
-
Object *acpi_get_i386_pci_host(void)
{
return NULL;
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 63d2113b86..a7892c444c 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -20,7 +20,6 @@
*/
#include "qemu/osdep.h"
-#include "hw/i386/pc.h"
#include "hw/irq.h"
#include "hw/isa/apm.h"
#include "hw/i2c/pm_smbus.h"
@@ -654,7 +653,6 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
hc->is_hotpluggable_bus = piix4_is_hotpluggable_bus;
adevc->ospm_status = piix4_ospm_status;
adevc->send_event = piix4_send_gpe;
- adevc->madt_cpu = pc_madt_cpu_entry;
}
static const TypeInfo piix4_pm_info = {
diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_device_x86.c
index e26fb02a2e..8fc233e1f1 100644
--- a/hw/i386/generic_event_device_x86.c
+++ b/hw/i386/generic_event_device_x86.c
@@ -8,19 +8,10 @@
#include "qemu/osdep.h"
#include "hw/acpi/generic_event_device.h"
-#include "hw/i386/pc.h"
-
-static void acpi_ged_x86_class_init(ObjectClass *class, void *data)
-{
- AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(class);
-
- adevc->madt_cpu = pc_madt_cpu_entry;
-}
static const TypeInfo acpi_ged_x86_info = {
.name = TYPE_ACPI_GED_X86,
.parent = TYPE_ACPI_GED,
- .class_init = acpi_ged_x86_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },
{ TYPE_ACPI_DEVICE_IF },
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 9c47a2f6c7..92527f3c75 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -876,7 +876,6 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
hc->is_hotpluggable_bus = ich9_pm_is_hotpluggable_bus;
adevc->ospm_status = ich9_pm_ospm_status;
adevc->send_event = ich9_send_gpe;
- adevc->madt_cpu = pc_madt_cpu_entry;
amldevc->build_dev_aml = build_ich9_isa_aml;
}
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method
2023-08-28 7:36 ` [PATCH 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method Bernhard Beschow
@ 2023-08-28 12:03 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:03 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> This virtual method was always set to the x86-specific pc_madt_cpu_entry(),
> even in piix4 which is also used in MIPS. The previous changes use
> pc_madt_cpu_entry() otherwise, so madt_cpu can be dropped.
>
> Since pc_madt_cpu_entry() is now only used in x86-specific code, the stub
> in hw/acpi/acpi-x86-stub can be removed as well.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> include/hw/acpi/acpi_dev_interface.h | 2 --
> hw/acpi/acpi-x86-stub.c | 6 ------
> hw/acpi/piix4.c | 2 --
> hw/i386/generic_event_device_x86.c | 9 ---------
> hw/isa/lpc_ich9.c | 1 -
> 5 files changed, 20 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h"
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
` (2 preceding siblings ...)
2023-08-28 7:36 ` [PATCH 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:04 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86 Bernhard Beschow
` (3 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
The "hw/boards.h" is unused since the previous commit. Since its removal
requires include fixes in various unrelated files to keep the code compiling it
has been split in a dedicated commit.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/acpi/hmat.h | 3 ++-
include/hw/acpi/acpi_dev_interface.h | 1 -
hw/acpi/cpu.c | 1 +
hw/acpi/hmat.c | 1 +
hw/acpi/memory_hotplug.c | 1 +
5 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/acpi/hmat.h b/hw/acpi/hmat.h
index b57f0e7e80..fd989cb661 100644
--- a/hw/acpi/hmat.h
+++ b/hw/acpi/hmat.h
@@ -27,7 +27,8 @@
#ifndef HMAT_H
#define HMAT_H
-#include "hw/acpi/aml-build.h"
+#include "hw/acpi/bios-linker-loader.h"
+#include "sysemu/numa.h"
/*
* ACPI 6.3: 5.2.27.3 Memory Proximity Domain Attributes Structure,
diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
index ca92928124..68d9d15f50 100644
--- a/include/hw/acpi/acpi_dev_interface.h
+++ b/include/hw/acpi/acpi_dev_interface.h
@@ -3,7 +3,6 @@
#include "qapi/qapi-types-acpi.h"
#include "qom/object.h"
-#include "hw/boards.h"
#include "hw/qdev-core.h"
/* These values are part of guest ABI, and can not be changed */
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 65a3202d3f..011d2c6c2d 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "migration/vmstate.h"
#include "hw/acpi/cpu.h"
+#include "hw/core/cpu.h"
#include "qapi/error.h"
#include "qapi/qapi-events-acpi.h"
#include "trace.h"
diff --git a/hw/acpi/hmat.c b/hw/acpi/hmat.c
index 3a6d51282a..d9de0daf89 100644
--- a/hw/acpi/hmat.c
+++ b/hw/acpi/hmat.c
@@ -27,6 +27,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "sysemu/numa.h"
+#include "hw/acpi/aml-build.h"
#include "hw/acpi/hmat.h"
/*
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index d926f4f77d..0b883df813 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "hw/acpi/memory_hotplug.h"
#include "hw/mem/pc-dimm.h"
+#include "hw/boards.h"
#include "hw/qdev-core.h"
#include "migration/vmstate.h"
#include "trace.h"
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h"
2023-08-28 7:36 ` [PATCH 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Bernhard Beschow
@ 2023-08-28 12:04 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:04 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> The "hw/boards.h" is unused since the previous commit. Since its removal
> requires include fixes in various unrelated files to keep the code compiling it
> has been split in a dedicated commit.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/acpi/hmat.h | 3 ++-
> include/hw/acpi/acpi_dev_interface.h | 1 -
> hw/acpi/cpu.c | 1 +
> hw/acpi/hmat.c | 1 +
> hw/acpi/memory_hotplug.c | 1 +
> 5 files changed, 5 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
` (3 preceding siblings ...)
2023-08-28 7:36 ` [PATCH 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:05 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 6/8] hw/i386/acpi-build: Determine SMI command port just once Bernhard Beschow
` (2 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
Now that TYPE_ACPI_GED_X86 doesn't assign AcpiDeviceIfClass::madt_cpu any more
it is the same as TYPE_ACPI_GED.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/hw/acpi/generic_event_device.h | 2 --
hw/i386/generic_event_device_x86.c | 27 --------------------------
hw/i386/microvm.c | 2 +-
hw/i386/meson.build | 1 -
4 files changed, 1 insertion(+), 31 deletions(-)
delete mode 100644 hw/i386/generic_event_device_x86.c
diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/generic_event_device.h
index d831bbd889..ba84ce0214 100644
--- a/include/hw/acpi/generic_event_device.h
+++ b/include/hw/acpi/generic_event_device.h
@@ -69,8 +69,6 @@
#define TYPE_ACPI_GED "acpi-ged"
OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED)
-#define TYPE_ACPI_GED_X86 "acpi-ged-x86"
-
#define ACPI_GED_EVT_SEL_OFFSET 0x0
#define ACPI_GED_EVT_SEL_LEN 0x4
diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_device_x86.c
deleted file mode 100644
index 8fc233e1f1..0000000000
--- a/hw/i386/generic_event_device_x86.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * x86 variant of the generic event device for hw reduced acpi
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2 or later, as published by the Free Software Foundation.
- */
-
-#include "qemu/osdep.h"
-#include "hw/acpi/generic_event_device.h"
-
-static const TypeInfo acpi_ged_x86_info = {
- .name = TYPE_ACPI_GED_X86,
- .parent = TYPE_ACPI_GED,
- .interfaces = (InterfaceInfo[]) {
- { TYPE_HOTPLUG_HANDLER },
- { TYPE_ACPI_DEVICE_IF },
- { }
- }
-};
-
-static void acpi_ged_x86_register_types(void)
-{
- type_register_static(&acpi_ged_x86_info);
-}
-
-type_init(acpi_ged_x86_register_types)
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 7227a2156c..d5cde2f075 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -202,7 +202,7 @@ static void microvm_devices_init(MicrovmMachineState *mms)
/* Optional and legacy devices */
if (x86_machine_is_acpi_enabled(x86ms)) {
- DeviceState *dev = qdev_new(TYPE_ACPI_GED_X86);
+ DeviceState *dev = qdev_new(TYPE_ACPI_GED);
qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE);
/* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */
diff --git a/hw/i386/meson.build b/hw/i386/meson.build
index cfdbfdcbcb..ff879069c9 100644
--- a/hw/i386/meson.build
+++ b/hw/i386/meson.build
@@ -20,7 +20,6 @@ i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c','sgx.c'),
if_false: files('sgx-stub.c'))
i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c'))
-i386_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device_x86.c'))
i386_ss.add(when: 'CONFIG_PC', if_true: files(
'pc.c',
'pc_sysfw.c',
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86
2023-08-28 7:36 ` [PATCH 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86 Bernhard Beschow
@ 2023-08-28 12:05 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:05 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> Now that TYPE_ACPI_GED_X86 doesn't assign AcpiDeviceIfClass::madt_cpu any more
> it is the same as TYPE_ACPI_GED.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> include/hw/acpi/generic_event_device.h | 2 --
> hw/i386/generic_event_device_x86.c | 27 --------------------------
> hw/i386/microvm.c | 2 +-
> hw/i386/meson.build | 1 -
> 4 files changed, 1 insertion(+), 31 deletions(-)
> delete mode 100644 hw/i386/generic_event_device_x86.c
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/8] hw/i386/acpi-build: Determine SMI command port just once
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
` (4 preceding siblings ...)
2023-08-28 7:36 ` [PATCH 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86 Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:10 ` Philippe Mathieu-Daudé
2023-08-28 7:36 ` [PATCH 7/8] hw/acpi: Trace GPE access in all device models, not just PIIX4 Bernhard Beschow
2023-08-28 7:36 ` [PATCH 8/8] hw/acpi/core: Trace enable and status registers of GPE separately Bernhard Beschow
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
The SMI command port is currently hardcoded by means of the ACPI_PORT_SMI_CMD
macro. This hardcoding is Intel specific and doesn't match VIA, for example.
There is already the AcpiFadtData::smi_cmd attribute which is used when building
the FADT. Let's also use it when building the DSDT which confines SMI command
port determination to just one place. This allows it to become a property later,
thus resolving the Intel assumption.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/acpi-build.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c8ac665d36..f9e7291150 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1495,14 +1495,14 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(crs,
aml_io(
AML_DECODE16,
- ACPI_PORT_SMI_CMD,
- ACPI_PORT_SMI_CMD,
+ pm->fadt.smi_cmd,
+ pm->fadt.smi_cmd,
1,
2)
);
aml_append(dev, aml_name_decl("_CRS", crs));
aml_append(dev, aml_operation_region("SMIR", AML_SYSTEM_IO,
- aml_int(ACPI_PORT_SMI_CMD), 2));
+ aml_int(pm->fadt.smi_cmd), 2));
field = aml_field("SMIR", AML_BYTE_ACC, AML_NOLOCK,
AML_WRITE_AS_ZEROS);
aml_append(field, aml_named_field("SMIC", 8));
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 6/8] hw/i386/acpi-build: Determine SMI command port just once
2023-08-28 7:36 ` [PATCH 6/8] hw/i386/acpi-build: Determine SMI command port just once Bernhard Beschow
@ 2023-08-28 12:10 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:10 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> The SMI command port is currently hardcoded by means of the ACPI_PORT_SMI_CMD
> macro. This hardcoding is Intel specific and doesn't match VIA, for example.
> There is already the AcpiFadtData::smi_cmd attribute which is used when building
> the FADT. Let's also use it when building the DSDT which confines SMI command
> port determination to just one place. This allows it to become a property later,
> thus resolving the Intel assumption.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
> hw/i386/acpi-build.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 7/8] hw/acpi: Trace GPE access in all device models, not just PIIX4
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
` (5 preceding siblings ...)
2023-08-28 7:36 ` [PATCH 6/8] hw/i386/acpi-build: Determine SMI command port just once Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 7:36 ` [PATCH 8/8] hw/acpi/core: Trace enable and status registers of GPE separately Bernhard Beschow
7 siblings, 0 replies; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/acpi/core.c | 5 +++++
hw/acpi/piix4.c | 3 ---
hw/acpi/trace-events | 8 ++++----
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 00b1e79a30..c561845a4a 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -32,6 +32,7 @@
#include "qemu/module.h"
#include "qemu/option.h"
#include "sysemu/runstate.h"
+#include "trace.h"
struct acpi_table_header {
uint16_t _length; /* our length, not actual part of the hdr */
@@ -686,6 +687,8 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)
{
uint8_t *cur;
+ trace_acpi_gpe_ioport_writeb(addr, val);
+
cur = acpi_gpe_ioport_get_ptr(ar, addr);
if (addr < ar->gpe.len / 2) {
/* GPE_STS */
@@ -709,6 +712,8 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr)
val = *cur;
}
+ trace_acpi_gpe_ioport_readb(addr, val);
+
return val;
}
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index a7892c444c..dd523d2e4c 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -42,7 +42,6 @@
#include "hw/acpi/acpi_dev_interface.h"
#include "migration/vmstate.h"
#include "hw/core/cpu.h"
-#include "trace.h"
#include "qom/object.h"
#define GPE_BASE 0xafe0
@@ -517,7 +516,6 @@ static uint64_t gpe_readb(void *opaque, hwaddr addr, unsigned width)
PIIX4PMState *s = opaque;
uint32_t val = acpi_gpe_ioport_readb(&s->ar, addr);
- trace_piix4_gpe_readb(addr, width, val);
return val;
}
@@ -526,7 +524,6 @@ static void gpe_writeb(void *opaque, hwaddr addr, uint64_t val,
{
PIIX4PMState *s = opaque;
- trace_piix4_gpe_writeb(addr, width, val);
acpi_gpe_ioport_writeb(&s->ar, addr, val);
acpi_update_sci(&s->ar, s->irq);
}
diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
index 78e0a8670e..159937ddb9 100644
--- a/hw/acpi/trace-events
+++ b/hw/acpi/trace-events
@@ -17,6 +17,10 @@ mhp_acpi_clear_remove_evt(uint32_t slot) "slot[0x%"PRIx32"] clear remove event"
mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted"
mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm delete failed"
+# core.c
+acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
+acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
+
# cpu.c
cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32
cpuhp_acpi_read_flags(uint32_t idx, uint8_t flags) "idx[0x%"PRIx32"] flags: 0x%"PRIx8
@@ -48,10 +52,6 @@ acpi_pci_sel_read(uint32_t val) "%" PRIu32
acpi_pci_ej_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <== %" PRIu64
acpi_pci_sel_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <== %" PRIu64
-# piix4.c
-piix4_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64 " width: %d ==> 0x%" PRIx64
-piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64 " width: %d <== 0x%" PRIx64
-
# tco.c
tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)"
tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d"
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 8/8] hw/acpi/core: Trace enable and status registers of GPE separately
2023-08-28 7:36 [PATCH 0/8] ACPI: X86 AML generation and GPE tracing cleanup Bernhard Beschow
` (6 preceding siblings ...)
2023-08-28 7:36 ` [PATCH 7/8] hw/acpi: Trace GPE access in all device models, not just PIIX4 Bernhard Beschow
@ 2023-08-28 7:36 ` Bernhard Beschow
2023-08-28 12:08 ` Philippe Mathieu-Daudé
7 siblings, 1 reply; 16+ messages in thread
From: Bernhard Beschow @ 2023-08-28 7:36 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Eduardo Habkost, Michael S. Tsirkin,
Sergio Lopez, Ani Sinha, Paolo Bonzini, Aurelien Jarno,
Marcel Apfelbaum, Richard Henderson, Igor Mammedov,
Bernhard Beschow
The bit positions of both registers are related. Tracing the registers
independently results in the same offsets across these registers which
eases debugging.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
---
hw/acpi/core.c | 10 +++++++---
hw/acpi/trace-events | 6 ++++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index c561845a4a..ec5e127d17 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -687,13 +687,13 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val)
{
uint8_t *cur;
- trace_acpi_gpe_ioport_writeb(addr, val);
-
cur = acpi_gpe_ioport_get_ptr(ar, addr);
if (addr < ar->gpe.len / 2) {
+ trace_acpi_gpe_sts_ioport_writeb(addr, val);
/* GPE_STS */
*cur = (*cur) & ~val;
} else if (addr < ar->gpe.len) {
+ trace_acpi_gpe_en_ioport_writeb(addr - (ar->gpe.len / 2), val);
/* GPE_EN */
*cur = val;
} else {
@@ -712,7 +712,11 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr)
val = *cur;
}
- trace_acpi_gpe_ioport_readb(addr, val);
+ if (addr < ar->gpe.len / 2) {
+ trace_acpi_gpe_sts_ioport_readb(addr, val);
+ } else {
+ trace_acpi_gpe_en_ioport_readb(addr - (ar->gpe.len / 2), val);
+ }
return val;
}
diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
index 159937ddb9..d387adfb0b 100644
--- a/hw/acpi/trace-events
+++ b/hw/acpi/trace-events
@@ -18,8 +18,10 @@ mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted"
mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm delete failed"
# core.c
-acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
-acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
+acpi_gpe_sts_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
+acpi_gpe_en_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
+acpi_gpe_sts_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
+acpi_gpe_en_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
# cpu.c
cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32
--
2.42.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 8/8] hw/acpi/core: Trace enable and status registers of GPE separately
2023-08-28 7:36 ` [PATCH 8/8] hw/acpi/core: Trace enable and status registers of GPE separately Bernhard Beschow
@ 2023-08-28 12:08 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-28 12:08 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel
Cc: Eduardo Habkost, Michael S. Tsirkin, Sergio Lopez, Ani Sinha,
Paolo Bonzini, Aurelien Jarno, Marcel Apfelbaum,
Richard Henderson, Igor Mammedov
On 28/8/23 09:36, Bernhard Beschow wrote:
> The bit positions of both registers are related. Tracing the registers
> independently results in the same offsets across these registers which
> eases debugging.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> Acked-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/acpi/core.c | 10 +++++++---
> hw/acpi/trace-events | 6 ++++--
> 2 files changed, 11 insertions(+), 5 deletions(-)
> diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
> index 159937ddb9..d387adfb0b 100644
> --- a/hw/acpi/trace-events
> +++ b/hw/acpi/trace-events
> @@ -18,8 +18,10 @@ mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted"
> mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm delete failed"
>
> # core.c
> -acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
> -acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
> +acpi_gpe_sts_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
> +acpi_gpe_en_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " ==> 0x%" PRIx8
> +acpi_gpe_sts_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
> +acpi_gpe_en_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <== 0x%" PRIx8
0x%02 for val? Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 16+ messages in thread