[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 65/81] hw/i386/acpi-build: Resolve redundant attribute
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 65/81] hw/i386/acpi-build: Resolve redundant attribute |
Date: |
Sat, 5 Nov 2022 13:18:36 -0400 |
From: Bernhard Beschow <shentey@gmail.com>
The is_piix4 attribute is set once in one location and read once in
another. Doing both in one location allows for removing the attribute
altogether.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221026133110.91828-3-shentey@gmail.com>
Message-Id: <20221028103419.93398-3-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-build.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1ebf14b899..73d8a59737 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -112,7 +112,6 @@ typedef struct AcpiPmInfo {
} AcpiPmInfo;
typedef struct AcpiMiscInfo {
- bool is_piix4;
bool has_hpet;
#ifdef CONFIG_TPM
TPMVersion tpm_version;
@@ -281,17 +280,6 @@ static void acpi_get_pm_info(MachineState *machine,
AcpiPmInfo *pm)
static void acpi_get_misc_info(AcpiMiscInfo *info)
{
- Object *piix = object_resolve_type_unambiguous(TYPE_PIIX4_PM);
- Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE);
- assert(!!piix != !!lpc);
-
- if (piix) {
- info->is_piix4 = true;
- }
- if (lpc) {
- info->is_piix4 = false;
- }
-
info->has_hpet = hpet_find();
#ifdef CONFIG_TPM
info->tpm_version = tpm_get_version(tpm_find());
@@ -1334,6 +1322,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
AcpiPmInfo *pm, AcpiMiscInfo *misc,
Range *pci_hole, Range *pci_hole64, MachineState *machine)
{
+ Object *piix = object_resolve_type_unambiguous(TYPE_PIIX4_PM);
+ Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE);
CrsRangeEntry *entry;
Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs;
CrsRangeSet crs_range_set;
@@ -1354,11 +1344,13 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
AcpiTable table = { .sig = "DSDT", .rev = 1, .oem_id = x86ms->oem_id,
.oem_table_id = x86ms->oem_table_id };
+ assert(!!piix != !!lpc);
+
acpi_table_begin(&table, table_data);
dsdt = init_aml_allocator();
build_dbg_aml(dsdt);
- if (misc->is_piix4) {
+ if (piix) {
sb_scope = aml_scope("_SB");
dev = aml_device("PCI0");
aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
@@ -1371,7 +1363,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
}
build_piix4_pci0_int(dsdt);
- } else {
+ } else if (lpc) {
sb_scope = aml_scope("_SB");
dev = aml_device("PCI0");
aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08")));
--
MST
- [PULL v3 36/81] virtio-pci: support queue reset, (continued)
- [PULL v3 36/81] virtio-pci: support queue reset, Michael S. Tsirkin, 2022/11/05
- [PULL v3 43/81] virtio-net: support queue reset, Michael S. Tsirkin, 2022/11/05
- [PULL v3 47/81] virtio-rng-pci: Allow setting nvectors, so we can use MSI-X, Michael S. Tsirkin, 2022/11/05
- [PULL v3 48/81] vhost-user: Fix out of order vring host notification handling, Michael S. Tsirkin, 2022/11/05
- [PULL v3 68/81] tests: acpi: add and whitelist *.hmat-noinitiator expected blobs, Michael S. Tsirkin, 2022/11/05
- [PULL v3 44/81] virtio-net: support queue_enable, Michael S. Tsirkin, 2022/11/05
- [PULL v3 53/81] tests: acpi: whitelist DSDT before generating ICH9_SMB AML automatically, Michael S. Tsirkin, 2022/11/05
- [PULL v3 61/81] MAINTAINERS: Add qapi/virtio.json to section "virtio", Michael S. Tsirkin, 2022/11/05
- [PULL v3 64/81] hw/i386/acpi-build: Remove unused struct, Michael S. Tsirkin, 2022/11/05
- [PULL v3 60/81] hw/acpi/erst.c: Fix memory handling issues, Michael S. Tsirkin, 2022/11/05
- [PULL v3 65/81] hw/i386/acpi-build: Resolve redundant attribute,
Michael S. Tsirkin <=
- [PULL v3 39/81] vhost: expose vhost_virtqueue_stop(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 35/81] virtio: core: vq reset feature negotation support, Michael S. Tsirkin, 2022/11/05
- [PULL v3 37/81] virtio-pci: support queue enable, Michael S. Tsirkin, 2022/11/05
- [PULL v3 40/81] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset(), Michael S. Tsirkin, 2022/11/05
- [PULL v3 46/81] virtio-net: enable vq reset feature, Michael S. Tsirkin, 2022/11/05
- [PULL v3 45/81] vhost: vhost-kernel: enable vq reset feature, Michael S. Tsirkin, 2022/11/05
- [PULL v3 54/81] acpi: add get_dev_aml_func() helper, Michael S. Tsirkin, 2022/11/05
- [PULL v3 52/81] tests: acpi: update expected DSDT after ISA bridge is moved directly under PCI host bridge, Michael S. Tsirkin, 2022/11/05
- [PULL v3 63/81] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios, Michael S. Tsirkin, 2022/11/05
- [PULL v3 66/81] hw/i386/acpi-build: Resolve north rather than south bridges, Michael S. Tsirkin, 2022/11/05