Skip to contentSkip to conversation

acpi: i386 tweaks

PATCH Superseded Gerd Hoffmann 5 participants 22 messages Jun 17, 2020 – Jun 18, 2020

v9 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v9 cover acpi: i386 tweaks

First batch of microvm patches, some generic acpi stuff. Split the acpi-build.c monster, specifically split the pc and q35 and pci bits into a separate file which we can skip building at some point in the future.

v2 changes: leave acpi-build.c largely as-is, move useful bits to other places to allow them being reused, specifically:

* move isa device generator functions to individual isa devices.
* move fw_cfg generator function to fw_cfg.c

v3 changes: fix rtc, support multiple lpt devices.

v4 changes:
* drop merged patches.
* split rtc crs change to separata patch.
* added two cleanup patches.
* picked up ack & review tags.

v5 changes:
* add comment for rtc crs update.
* add even more cleanup patches.
* picked up ack & review tags.

v6 changes:
* floppy: move cmos_get_fd_drive_type.
* picked up ack & review tags.

v7 changes:
* rebased to mst/pci branch, resolved stubs conflict.
* dropped patches already queued up in mst/pci.
* added missing sign-off.
* picked up ack & review tags.

v8 changes:
* (re-)add patch to allow acpi table changes

v9 changes:
* add asl changes to commit messages.
* update acpi test data.

take care,
Gerd

Gerd Hoffmann (10):
acpi: bios-tables-test: show more context on asl diffs
acpi: move aml builder code for floppy device
floppy: make isa_fdc_get_drive_max_chs static
floppy: move cmos_get_fd_drive_type() from pc
acpi: move aml builder code for i8042 (kbd+mouse) device
acpi: factor out fw_cfg_add_acpi_dsdt()
acpi: simplify build_isa_devices_aml()
acpi: drop serial/parallel enable bits from dsdt
acpi: drop build_piix4_pm()
acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.

 hw/i386/fw_cfg.h                  |   1 +
 include/hw/block/fdc.h            |   3 +-
 include/hw/i386/pc.h              |   1 -
 hw/block/fdc.c                    | 111 +++++++++++++++-
 hw/i386/acpi-build.c              | 210 +-----------------------------
 hw/i386/fw_cfg.c                  |  28 ++++
 hw/i386/pc.c                      |  25 ----
 hw/input/pckbd.c                  |  31 +++++
 stubs/cmos.c                      |   7 +
 tests/qtest/bios-tables-test.c    |   2 +-
 stubs/Makefile.objs               |   1 +
 tests/data/acpi/pc/DSDT           | Bin 5014 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat  | Bin 6338 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge    | Bin 6873 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp      | Bin 5477 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm   | Bin 6667 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs   | Bin 5086 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp     | Bin 6373 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem   | Bin 5020 -> 4940 bytes
 tests/data/acpi/q35/DSDT          | Bin 7752 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7769 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8215 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9405 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7827 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9111 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8882 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7758 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8357 -> 8283 bytes
 29 files changed, 185 insertions(+), 235 deletions(-)
 create mode 100644 stubs/cmos.c
Signature · 1 line
2.18.4
#1 lore raw

PATCH v9 1/10 acpi: bios-tables-test: show more context on asl diffs

Makes it easier to create good commit messages from the logs.

---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -1
index b482f76c03d4..c315156858f4 100644
@@ -469,7 +469,7 @@ static void test_acpi_asl(test_data *data)
                 fflush(stderr);
                 if (getenv("V")) {
                     const char *diff_env = getenv("DIFF");
-                    const char *diff_cmd = diff_env ? diff_env : "diff -u";
+                    const char *diff_cmd = diff_env ? diff_env : "diff -U 16";
                     char *diff = g_strdup_printf("%s %s %s", diff_cmd,
                                                  exp_sdt->asl_file, sdt->asl_file);
                     int out = dup(STDOUT_FILENO);
Signature · 1 line
2.18.4
Reviewed-by on v9 1/10
#2 lore raw

Re: [PATCH v9 01/10] acpi: bios-tables-test: show more context on asl diffs

Quoted 13 lines · Gerd Hoffmann

Makes it easier to create good commit messages from the logs.

---
 tests/qtest/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +0 -0
index b482f76c03d4..c315156858f4 100644

tests/qtest/bios-tables-test.c static void test_acpi_asl(test_data *data) · line 475

Quoted 8 lines
tests/qtest/bios-tables-test.c +1 -1
@@ -469,7 +469,7 @@ static void test_acpi_asl(test_data *data)
                 fflush(stderr);
                 if (getenv("V")) {
                     const char *diff_env = getenv("DIFF");
-                    const char *diff_cmd = diff_env ? diff_env : "diff -u";
+                    const char *diff_cmd = diff_env ? diff_env : "diff -U 16";
                     char *diff = g_strdup_printf("%s %s %s", diff_cmd,
                                                  exp_sdt->asl_file, sdt->asl_file);
                     int out = dup(STDOUT_FILENO);
#3 lore raw

PATCH v9 2/10 acpi: move aml builder code for floppy device

In reply to Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

---
 hw/block/fdc.c                  |  83 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c            |  83 --------------------------------
 stubs/cmos.c                    |   7 +++
 stubs/Makefile.objs             |   1 +
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 5 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c
hw/block/fdc.c +83 -0
index 8528b9a3c722..c92436772292 100644
@@ -32,6 +32,8 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
+#include "hw/i386/pc.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
@@ -2765,6 +2767,85 @@ void isa_fdc_get_drive_max_chs(FloppyDriveType type,
     (*maxc)--;
 }
 
+static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
+{
+    Aml *dev, *fdi;
+    uint8_t maxc, maxh, maxs;
+
+    isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs);
+
+    dev = aml_device("FLP%c", 'A' + idx);
+
+    aml_append(dev, aml_name_decl("_ADR", aml_int(idx)));
+
+    fdi = aml_package(16);
+    aml_append(fdi, aml_int(idx));  /* Drive Number */
+    aml_append(fdi,
+        aml_int(cmos_get_fd_drive_type(type)));  /* Device Type */
+    /*
+     * the values below are the limits of the drive, and are thus independent
+     * of the inserted media
+     */
+    aml_append(fdi, aml_int(maxc));  /* Maximum Cylinder Number */
+    aml_append(fdi, aml_int(maxs));  /* Maximum Sector Number */
+    aml_append(fdi, aml_int(maxh));  /* Maximum Head Number */
+    /*
+     * SeaBIOS returns the below values for int 0x13 func 0x08 regardless of
+     * the drive type, so shall we
+     */
+    aml_append(fdi, aml_int(0xAF));  /* disk_specify_1 */
+    aml_append(fdi, aml_int(0x02));  /* disk_specify_2 */
+    aml_append(fdi, aml_int(0x25));  /* disk_motor_wait */
+    aml_append(fdi, aml_int(0x02));  /* disk_sector_siz */
+    aml_append(fdi, aml_int(0x12));  /* disk_eot */
+    aml_append(fdi, aml_int(0x1B));  /* disk_rw_gap */
+    aml_append(fdi, aml_int(0xFF));  /* disk_dtl */
+    aml_append(fdi, aml_int(0x6C));  /* disk_formt_gap */
+    aml_append(fdi, aml_int(0xF6));  /* disk_fill */
+    aml_append(fdi, aml_int(0x0F));  /* disk_head_sttl */
+    aml_append(fdi, aml_int(0x08));  /* disk_motor_strt */
+
+    aml_append(dev, aml_name_decl("_FDI", fdi));
+    return dev;
+}
+
+static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
+{
+    Aml *dev;
+    Aml *crs;
+    int i;
+
+#define ACPI_FDE_MAX_FD 4
+    uint32_t fde_buf[5] = {
+        0, 0, 0, 0,     /* presence of floppy drives #0 - #3 */
+        cpu_to_le32(2)  /* tape presence (2 == never present) */
+    };
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
+    aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
+    aml_append(crs, aml_irq_no_flags(6));
+    aml_append(crs,
+        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
+
+    dev = aml_device("FDC0");
+    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+
+    for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) {
+        FloppyDriveType type = isa_fdc_get_drive_type(isadev, i);
+
+        if (type < FLOPPY_DRIVE_TYPE_NONE) {
+            fde_buf[i] = cpu_to_le32(1);  /* drive present */
+            aml_append(dev, build_fdinfo_aml(i, type));
+        }
+    }
+    aml_append(dev, aml_name_decl("_FDE",
+               aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf)));
+
+    aml_append(scope, dev);
+}
+
 static const VMStateDescription vmstate_isa_fdc ={
     .name = "fdc",
     .version_id = 2,
@@ -2798,11 +2879,13 @@ static Property isa_fdc_properties[] = {
 static void isabus_fdc_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = isabus_fdc_realize;
     dc->fw_name = "fdc";
     dc->reset = fdctrl_external_reset_isa;
     dc->vmsd = &vmstate_isa_fdc;
+    isa->build_aml = fdc_isa_build_aml;
     device_class_set_props(dc, isa_fdc_properties);
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
hw/i386/acpi-build.c +0 -83

101 lines not on this page · raw message

stubs/cmos.c new file +7 -0
new file mode 100644
index 000000000000..416cbe4055ff
@@ -0,0 +1,7 @@
+#include "qemu/osdep.h"
+#include "hw/i386/pc.h"
+
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+    return 0;
+}
stubs/Makefile.objs +1 -0
index 28e48171d1f3..f32b9e47a3d8 100644
@@ -1,4 +1,5 @@
 stub-obj-y += blk-commit-all.o
+stub-obj-y += cmos.o
 stub-obj-y += cpu-get-clock.o
 stub-obj-y += cpu-get-icount.o
 stub-obj-y += dump.o
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 57b78358744a5bb13639ccddb887be2721240807..c285651131dc2ab8b0f32de750d7ac02a8b09936 100644
GIT binary patch
Signature · 1 line
2.18.4
#4 lore raw

Re: [PATCH v9 02/10] acpi: move aml builder code for floppy device

Quoted 4 lines · Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

Quoted 8 lines
---
 hw/block/fdc.c                  |  83 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c            |  83 --------------------------------
 stubs/cmos.c                    |   7 +++
 stubs/Makefile.objs             |   1 +
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 5 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c

Hmm, not all targets that use CONFIG_FDC also have ACPI ... would it be possible to move the ACPI-related code into a new file, say fdc-acpi.c, instead and only compile that if both, CONFIG_FDC and CONFIG_ACPI are enabled?

Thomas

#5 lore raw

Re: [PATCH v9 02/10] acpi: move aml builder code for floppy device

Quoted 14 lines · Thomas Huth
Quoted 4 lines · Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

Quoted 8 lines
---
 hw/block/fdc.c                  |  83 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c            |  83 --------------------------------
 stubs/cmos.c                    |   7 +++
 stubs/Makefile.objs             |   1 +
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 5 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c
Quoted 4 lines

Hmm, not all targets that use CONFIG_FDC also have ACPI ... would it be possible to move the ACPI-related code into a new file, say fdc-acpi.c, instead and only compile that if both, CONFIG_FDC and CONFIG_ACPI are enabled?

Possible sure, but is that really worth it? It isn't that much (possibly dead) code, and we have stubs for the aml_*() functions so it builds just fine with CONFIG_ACPI=n ...

cheers,
Gerd

#6 lore raw

Re: [PATCH v9 02/10] acpi: move aml builder code for floppy device

Quoted 15 lines · Gerd Hoffmann
Quoted 14 lines · Thomas Huth
Quoted 12 lines · Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

---
 hw/block/fdc.c                  |  83 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c            |  83 --------------------------------
 stubs/cmos.c                    |   7 +++
 stubs/Makefile.objs             |   1 +
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 5 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c
Quoted 8 lines
Quoted 4 lines

Hmm, not all targets that use CONFIG_FDC also have ACPI ... would it be possible to move the ACPI-related code into a new file, say fdc-acpi.c, instead and only compile that if both, CONFIG_FDC and CONFIG_ACPI are enabled?

Possible sure, but is that really worth it? It isn't that much (possibly dead) code, and we have stubs for the aml_*() functions so it builds just fine with CONFIG_ACPI=n ...

Ok, fine for me, too. It's really not that much code, indeed.

Thomas

#7 lore raw

Re: [PATCH v9 02/10] acpi: move aml builder code for floppy device

In reply to Gerd Hoffmann
Quoted 5 lines · Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

---

Pls follow process outlined at the top of tests/qtest/bios-tables-test.c Don't change expected files with source.
Thanks!

Quoted 263 lines
 hw/block/fdc.c                  |  83 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c            |  83 --------------------------------
 stubs/cmos.c                    |   7 +++
 stubs/Makefile.objs             |   1 +
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 5 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c
hw/block/fdc.c +83 -0
index 8528b9a3c722..c92436772292 100644
@@ -32,6 +32,8 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
+#include "hw/i386/pc.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
@@ -2765,6 +2767,85 @@ void isa_fdc_get_drive_max_chs(FloppyDriveType type,
     (*maxc)--;
 }
 
+static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
+{
+    Aml *dev, *fdi;
+    uint8_t maxc, maxh, maxs;
+
+    isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs);
+
+    dev = aml_device("FLP%c", 'A' + idx);
+
+    aml_append(dev, aml_name_decl("_ADR", aml_int(idx)));
+
+    fdi = aml_package(16);
+    aml_append(fdi, aml_int(idx));  /* Drive Number */
+    aml_append(fdi,
+        aml_int(cmos_get_fd_drive_type(type)));  /* Device Type */
+    /*
+     * the values below are the limits of the drive, and are thus independent
+     * of the inserted media
+     */
+    aml_append(fdi, aml_int(maxc));  /* Maximum Cylinder Number */
+    aml_append(fdi, aml_int(maxs));  /* Maximum Sector Number */
+    aml_append(fdi, aml_int(maxh));  /* Maximum Head Number */
+    /*
+     * SeaBIOS returns the below values for int 0x13 func 0x08 regardless of
+     * the drive type, so shall we
+     */
+    aml_append(fdi, aml_int(0xAF));  /* disk_specify_1 */
+    aml_append(fdi, aml_int(0x02));  /* disk_specify_2 */
+    aml_append(fdi, aml_int(0x25));  /* disk_motor_wait */
+    aml_append(fdi, aml_int(0x02));  /* disk_sector_siz */
+    aml_append(fdi, aml_int(0x12));  /* disk_eot */
+    aml_append(fdi, aml_int(0x1B));  /* disk_rw_gap */
+    aml_append(fdi, aml_int(0xFF));  /* disk_dtl */
+    aml_append(fdi, aml_int(0x6C));  /* disk_formt_gap */
+    aml_append(fdi, aml_int(0xF6));  /* disk_fill */
+    aml_append(fdi, aml_int(0x0F));  /* disk_head_sttl */
+    aml_append(fdi, aml_int(0x08));  /* disk_motor_strt */
+
+    aml_append(dev, aml_name_decl("_FDI", fdi));
+    return dev;
+}
+
+static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
+{
+    Aml *dev;
+    Aml *crs;
+    int i;
+
+#define ACPI_FDE_MAX_FD 4
+    uint32_t fde_buf[5] = {
+        0, 0, 0, 0,     /* presence of floppy drives #0 - #3 */
+        cpu_to_le32(2)  /* tape presence (2 == never present) */
+    };
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
+    aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
+    aml_append(crs, aml_irq_no_flags(6));
+    aml_append(crs,
+        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
+
+    dev = aml_device("FDC0");
+    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+
+    for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) {
+        FloppyDriveType type = isa_fdc_get_drive_type(isadev, i);
+
+        if (type < FLOPPY_DRIVE_TYPE_NONE) {
+            fde_buf[i] = cpu_to_le32(1);  /* drive present */
+            aml_append(dev, build_fdinfo_aml(i, type));
+        }
+    }
+    aml_append(dev, aml_name_decl("_FDE",
+               aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf)));
+
+    aml_append(scope, dev);
+}
+
 static const VMStateDescription vmstate_isa_fdc ={
     .name = "fdc",
     .version_id = 2,
@@ -2798,11 +2879,13 @@ static Property isa_fdc_properties[] = {
 static void isabus_fdc_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = isabus_fdc_realize;
     dc->fw_name = "fdc";
     dc->reset = fdctrl_external_reset_isa;
     dc->vmsd = &vmstate_isa_fdc;
+    isa->build_aml = fdc_isa_build_aml;
     device_class_set_props(dc, isa_fdc_properties);
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
hw/i386/acpi-build.c +0 -83
index 900f786d08de..45297d9a90e7 100644
@@ -938,85 +938,6 @@ static void build_hpet_aml(Aml *table)
     aml_append(table, scope);
 }
 
-static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
-{
-    Aml *dev, *fdi;
-    uint8_t maxc, maxh, maxs;
-
-    isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs);
-
-    dev = aml_device("FLP%c", 'A' + idx);
-
-    aml_append(dev, aml_name_decl("_ADR", aml_int(idx)));
-
-    fdi = aml_package(16);
-    aml_append(fdi, aml_int(idx));  /* Drive Number */
-    aml_append(fdi,
-        aml_int(cmos_get_fd_drive_type(type)));  /* Device Type */
-    /*
-     * the values below are the limits of the drive, and are thus independent
-     * of the inserted media
-     */
-    aml_append(fdi, aml_int(maxc));  /* Maximum Cylinder Number */
-    aml_append(fdi, aml_int(maxs));  /* Maximum Sector Number */
-    aml_append(fdi, aml_int(maxh));  /* Maximum Head Number */
-    /*
-     * SeaBIOS returns the below values for int 0x13 func 0x08 regardless of
-     * the drive type, so shall we
-     */
-    aml_append(fdi, aml_int(0xAF));  /* disk_specify_1 */
-    aml_append(fdi, aml_int(0x02));  /* disk_specify_2 */
-    aml_append(fdi, aml_int(0x25));  /* disk_motor_wait */
-    aml_append(fdi, aml_int(0x02));  /* disk_sector_siz */
-    aml_append(fdi, aml_int(0x12));  /* disk_eot */
-    aml_append(fdi, aml_int(0x1B));  /* disk_rw_gap */
-    aml_append(fdi, aml_int(0xFF));  /* disk_dtl */
-    aml_append(fdi, aml_int(0x6C));  /* disk_formt_gap */
-    aml_append(fdi, aml_int(0xF6));  /* disk_fill */
-    aml_append(fdi, aml_int(0x0F));  /* disk_head_sttl */
-    aml_append(fdi, aml_int(0x08));  /* disk_motor_strt */
-
-    aml_append(dev, aml_name_decl("_FDI", fdi));
-    return dev;
-}
-
-static Aml *build_fdc_device_aml(ISADevice *fdc)
-{
-    int i;
-    Aml *dev;
-    Aml *crs;
-
-#define ACPI_FDE_MAX_FD 4
-    uint32_t fde_buf[5] = {
-        0, 0, 0, 0,     /* presence of floppy drives #0 - #3 */
-        cpu_to_le32(2)  /* tape presence (2 == never present) */
-    };
-
-    dev = aml_device("FDC0");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700")));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
-    aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
-    aml_append(crs, aml_irq_no_flags(6));
-    aml_append(crs,
-        aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) {
-        FloppyDriveType type = isa_fdc_get_drive_type(fdc, i);
-
-        if (type < FLOPPY_DRIVE_TYPE_NONE) {
-            fde_buf[i] = cpu_to_le32(1);  /* drive present */
-            aml_append(dev, build_fdinfo_aml(i, type));
-        }
-    }
-    aml_append(dev, aml_name_decl("_FDE",
-               aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf)));
-
-    return dev;
-}
-
 static Aml *build_kbd_device_aml(void)
 {
     Aml *dev;
@@ -1092,7 +1013,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 
 static void build_isa_devices_aml(Aml *table)
 {
-    ISADevice *fdc = pc_find_fdc0();
     VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
 
@@ -1101,9 +1021,6 @@ static void build_isa_devices_aml(Aml *table)
 
     aml_append(scope, build_kbd_device_aml());
     aml_append(scope, build_mouse_device_aml());
-    if (fdc) {
-        aml_append(scope, build_fdc_device_aml(fdc));
-    }
 
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
stubs/cmos.c new file +7 -0
new file mode 100644
index 000000000000..416cbe4055ff
@@ -0,0 +1,7 @@
+#include "qemu/osdep.h"
+#include "hw/i386/pc.h"
+
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+    return 0;
+}
stubs/Makefile.objs +1 -0
index 28e48171d1f3..f32b9e47a3d8 100644
@@ -1,4 +1,5 @@
 stub-obj-y += blk-commit-all.o
+stub-obj-y += cmos.o
 stub-obj-y += cpu-get-clock.o
 stub-obj-y += cpu-get-icount.o
 stub-obj-y += dump.o
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 57b78358744a5bb13639ccddb887be2721240807..c285651131dc2ab8b0f32de750d7ac02a8b09936 100644
GIT binary patch
Signature · 2 lines
-- 
2.18.4
#8 lore raw

PATCH v9 3/10 floppy: make isa_fdc_get_drive_max_chs static

In reply to Gerd Hoffmann

acpi aml generator needs this, but it is in floppy code now so we can make the function static.

---
 include/hw/block/fdc.h | 2 --
 hw/block/fdc.c         | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/block/fdc.h +0 -2
index c15ff4c62315..5d71cf972268 100644
@@ -16,7 +16,5 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base,
                        DriveInfo **fds, qemu_irq *fdc_tc);
 
 FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i);
-void isa_fdc_get_drive_max_chs(FloppyDriveType type,
-                               uint8_t *maxc, uint8_t *maxh, uint8_t *maxs);
 
 #endif
hw/block/fdc.c +2 -2
index c92436772292..5a634ab46302 100644
@@ -2744,8 +2744,8 @@ FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i)
     return isa->state.drives[i].drive;
 }
 
-void isa_fdc_get_drive_max_chs(FloppyDriveType type,
-                               uint8_t *maxc, uint8_t *maxh, uint8_t *maxs)
+static void isa_fdc_get_drive_max_chs(FloppyDriveType type, uint8_t *maxc,
+                                      uint8_t *maxh, uint8_t *maxs)
 {
     const FDFormat *fdf;
 
Signature · 1 line
2.18.4
#9 lore raw

PATCH v9 4/10 floppy: move cmos_get_fd_drive_type() from pc

In reply to Gerd Hoffmann
---
 include/hw/block/fdc.h |  1 +
 include/hw/i386/pc.h   |  1 -
 hw/block/fdc.c         | 26 +++++++++++++++++++++++++-
 hw/i386/pc.c           | 25 -------------------------
 4 files changed, 26 insertions(+), 27 deletions(-)
include/hw/block/fdc.h +1 -0
index 5d71cf972268..479cebc0a330 100644
@@ -16,5 +16,6 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base,
                        DriveInfo **fds, qemu_irq *fdc_tc);
 
 FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i);
+int cmos_get_fd_drive_type(FloppyDriveType fd0);
 
 #endif
include/hw/i386/pc.h +0 -1
index 8d764f965cd3..5e3b19ab78fc 100644
@@ -176,7 +176,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg);
 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs);
 
 ISADevice *pc_find_fdc0(void);
-int cmos_get_fd_drive_type(FloppyDriveType fd0);
 
 /* port92.c */
 #define PORT92_A20_LINE "a20"
hw/block/fdc.c +25 -1
index 5a634ab46302..ffe650b17cd5 100644
@@ -32,7 +32,6 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
-#include "hw/i386/pc.h"
 #include "hw/acpi/aml-build.h"
 #include "hw/irq.h"
 #include "hw/isa/isa.h"
@@ -2809,6 +2808,31 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)
     return dev;
 }
 
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+    int val;
+
+    switch (fd0) {
+    case FLOPPY_DRIVE_TYPE_144:
+        /* 1.44 Mb 3"5 drive */
+        val = 4;
+        break;
+    case FLOPPY_DRIVE_TYPE_288:
+        /* 2.88 Mb 3"5 drive */
+        val = 5;
+        break;
+    case FLOPPY_DRIVE_TYPE_120:
+        /* 1.2 Mb 5"5 drive */
+        val = 2;
+        break;
+    case FLOPPY_DRIVE_TYPE_NONE:
+    default:
+        val = 0;
+        break;
+    }
+    return val;
+}
+
 static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope)
 {
     Aml *dev;
hw/i386/pc.c +0 -25
index ec39741c87ac..7e0ed987b164 100644
@@ -386,31 +386,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)
 
 #define REG_EQUIPMENT_BYTE          0x14
 
-int cmos_get_fd_drive_type(FloppyDriveType fd0)
-{
-    int val;
-
-    switch (fd0) {
-    case FLOPPY_DRIVE_TYPE_144:
-        /* 1.44 Mb 3"5 drive */
-        val = 4;
-        break;
-    case FLOPPY_DRIVE_TYPE_288:
-        /* 2.88 Mb 3"5 drive */
-        val = 5;
-        break;
-    case FLOPPY_DRIVE_TYPE_120:
-        /* 1.2 Mb 5"5 drive */
-        val = 2;
-        break;
-    case FLOPPY_DRIVE_TYPE_NONE:
-    default:
-        val = 0;
-        break;
-    }
-    return val;
-}
-
 static void cmos_init_hd(ISADevice *s, int type_ofs, int info_ofs,
                          int16_t cylinders, int8_t heads, int8_t sectors)
 {
Signature · 1 line
2.18.4
#10 lore raw

PATCH v9 5/10 acpi: move aml builder code for i8042 (kbd+mouse) device

In reply to Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

---
 hw/i386/acpi-build.c            |  39 --------------------------------
 hw/input/pckbd.c                |  31 +++++++++++++++++++++++++
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 tests/data/acpi/q35/DSDT.ipmibt | Bin 7827 -> 7827 bytes
 4 files changed, 31 insertions(+), 39 deletions(-)
hw/i386/acpi-build.c +0 -39
index 45297d9a90e7..13113e83dfe2 100644
@@ -938,42 +938,6 @@ static void build_hpet_aml(Aml *table)
     aml_append(table, scope);
 }
 
-static Aml *build_kbd_device_aml(void)
-{
-    Aml *dev;
-    Aml *crs;
-
-    dev = aml_device("KBD");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303")));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01));
-    aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01));
-    aml_append(crs, aml_irq_no_flags(1));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    return dev;
-}
-
-static Aml *build_mouse_device_aml(void)
-{
-    Aml *dev;
-    Aml *crs;
-
-    dev = aml_device("MOU");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_irq_no_flags(12));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    return dev;
-}
-
 static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 {
     Aml *dev;
@@ -1019,9 +983,6 @@ static void build_isa_devices_aml(Aml *table)
     Aml *scope = aml_scope("_SB.PCI0.ISA");
     Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous);
 
-    aml_append(scope, build_kbd_device_aml());
-    aml_append(scope, build_mouse_device_aml());
-
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
     } else if (!obj) {
hw/input/pckbd.c +31 -0
index 60a41303203a..29d633ca9478 100644
@@ -26,6 +26,7 @@
 #include "qemu/log.h"
 #include "hw/isa/isa.h"
 #include "migration/vmstate.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/input/ps2.h"
 #include "hw/irq.h"
 #include "hw/input/i8042.h"
@@ -561,12 +562,42 @@ static void i8042_realizefn(DeviceState *dev, Error **errp)
     qemu_register_reset(kbd_reset, s);
 }
 
+static void i8042_build_aml(ISADevice *isadev, Aml *scope)
+{
+    Aml *kbd;
+    Aml *mou;
+    Aml *crs;
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01));
+    aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01));
+    aml_append(crs, aml_irq_no_flags(1));
+
+    kbd = aml_device("KBD");
+    aml_append(kbd, aml_name_decl("_HID", aml_eisaid("PNP0303")));
+    aml_append(kbd, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(kbd, aml_name_decl("_CRS", crs));
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_irq_no_flags(12));
+
+    mou = aml_device("MOU");
+    aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
+    aml_append(mou, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(mou, aml_name_decl("_CRS", crs));
+
+    aml_append(scope, kbd);
+    aml_append(scope, mou);
+}
+
 static void i8042_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = i8042_realizefn;
     dc->vmsd = &vmstate_kbd_isa;
+    isa->build_aml = i8042_build_aml;
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
 
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index c285651131dc2ab8b0f32de750d7ac02a8b09936..1c19e2f354d022279d7e1343fa7212396d8c25a0 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index 38723daef80421ea528b2ad2d411e7357df43956..0173c3668a6cdef80127de7880a19cb5c5ea7dc0 100644
GIT binary patch
Signature · 1 line
2.18.4
#11 lore raw

Re: [PATCH v9 05/10] acpi: move aml builder code for i8042 (kbd+mouse) device

Quoted 11 lines · Gerd Hoffmann

DSDT change: isa device order changes in case MI1 (ipmi) is present.

---
 hw/i386/acpi-build.c            |  39 --------------------------------
 hw/input/pckbd.c                |  31 +++++++++++++++++++++++++
 tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5086 bytes
 tests/data/acpi/q35/DSDT.ipmibt | Bin 7827 -> 7827 bytes
 4 files changed, 31 insertions(+), 39 deletions(-)

Please don't add binary file diffs together with source changes. Pls follow the process outlined in tests/qtest/bios-tables-test.c.

Quoted 132 lines
hw/i386/acpi-build.c +0 -39
index 45297d9a90e7..13113e83dfe2 100644
@@ -938,42 +938,6 @@ static void build_hpet_aml(Aml *table)
     aml_append(table, scope);
 }
 
-static Aml *build_kbd_device_aml(void)
-{
-    Aml *dev;
-    Aml *crs;
-
-    dev = aml_device("KBD");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303")));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01));
-    aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01));
-    aml_append(crs, aml_irq_no_flags(1));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    return dev;
-}
-
-static Aml *build_mouse_device_aml(void)
-{
-    Aml *dev;
-    Aml *crs;
-
-    dev = aml_device("MOU");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_irq_no_flags(12));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    return dev;
-}
-
 static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 {
     Aml *dev;
@@ -1019,9 +983,6 @@ static void build_isa_devices_aml(Aml *table)
     Aml *scope = aml_scope("_SB.PCI0.ISA");
     Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous);
 
-    aml_append(scope, build_kbd_device_aml());
-    aml_append(scope, build_mouse_device_aml());
-
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
     } else if (!obj) {
hw/input/pckbd.c +31 -0
index 60a41303203a..29d633ca9478 100644
@@ -26,6 +26,7 @@
 #include "qemu/log.h"
 #include "hw/isa/isa.h"
 #include "migration/vmstate.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/input/ps2.h"
 #include "hw/irq.h"
 #include "hw/input/i8042.h"
@@ -561,12 +562,42 @@ static void i8042_realizefn(DeviceState *dev, Error **errp)
     qemu_register_reset(kbd_reset, s);
 }
 
+static void i8042_build_aml(ISADevice *isadev, Aml *scope)
+{
+    Aml *kbd;
+    Aml *mou;
+    Aml *crs;
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01));
+    aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01));
+    aml_append(crs, aml_irq_no_flags(1));
+
+    kbd = aml_device("KBD");
+    aml_append(kbd, aml_name_decl("_HID", aml_eisaid("PNP0303")));
+    aml_append(kbd, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(kbd, aml_name_decl("_CRS", crs));
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_irq_no_flags(12));
+
+    mou = aml_device("MOU");
+    aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
+    aml_append(mou, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(mou, aml_name_decl("_CRS", crs));
+
+    aml_append(scope, kbd);
+    aml_append(scope, mou);
+}
+
 static void i8042_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = i8042_realizefn;
     dc->vmsd = &vmstate_kbd_isa;
+    isa->build_aml = i8042_build_aml;
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
 
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index c285651131dc2ab8b0f32de750d7ac02a8b09936..1c19e2f354d022279d7e1343fa7212396d8c25a0 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index 38723daef80421ea528b2ad2d411e7357df43956..0173c3668a6cdef80127de7880a19cb5c5ea7dc0 100644
GIT binary patch
Signature · 2 lines
-- 
2.18.4
#12 lore raw

PATCH v9 6/10 acpi: factor out fw_cfg_add_acpi_dsdt()

In reply to Gerd Hoffmann

Add helper function to add fw_cfg device,
also move code to hw/i386/fw_cfg.c.

---
 hw/i386/fw_cfg.h     |  1 +
 hw/i386/acpi-build.c | 24 +-----------------------
 hw/i386/fw_cfg.c     | 28 ++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 23 deletions(-)
hw/i386/fw_cfg.h +1 -0
index 9e742787792b..275f15c1c5e8 100644
@@ -25,5 +25,6 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,
                                uint16_t apic_id_limit);
 void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg);
 void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg);
+void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg);
 
 #endif
hw/i386/acpi-build.c +1 -23
index 13113e83dfe2..19e9c298dc8f 100644
@@ -1802,30 +1802,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
 
     /* create fw_cfg node, unconditionally */
     {
-        /* when using port i/o, the 8-bit data register *always* overlaps
-         * with half of the 16-bit control register. Hence, the total size
-         * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
-         * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 */
-        uint8_t io_size = object_property_get_bool(OBJECT(x86ms->fw_cfg),
-                                                   "dma_enabled", NULL) ?
-                          ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
-                          FW_CFG_CTL_SIZE;
-
         scope = aml_scope("\\_SB.PCI0");
-        dev = aml_device("FWCF");
-
-        aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002")));
-
-        /* device present, functioning, decoding, not shown in UI */
-        aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
-
-        crs = aml_resource_template();
-        aml_append(crs,
-            aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size)
-        );
-        aml_append(dev, aml_name_decl("_CRS", crs));
-
-        aml_append(scope, dev);
+        fw_cfg_add_acpi_dsdt(scope, x86ms->fw_cfg);
         aml_append(dsdt, scope);
     }
 
hw/i386/fw_cfg.c +28 -0
index da60ada59462..c55abfb01abb 100644
@@ -15,6 +15,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/numa.h"
 #include "hw/acpi/acpi.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/firmware/smbios.h"
 #include "hw/i386/fw_cfg.h"
 #include "hw/timer/hpet.h"
@@ -179,3 +180,30 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg)
     *val = cpu_to_le64(feature_control_bits | FEATURE_CONTROL_LOCKED);
     fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val));
 }
+
+void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg)
+{
+    /*
+     * when using port i/o, the 8-bit data register *always* overlaps
+     * with half of the 16-bit control register. Hence, the total size
+     * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
+     * DMA control register is located at FW_CFG_DMA_IO_BASE + 4
+     */
+    Object *obj = OBJECT(fw_cfg);
+    uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ?
+        ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) :
+        FW_CFG_CTL_SIZE;
+    Aml *dev = aml_device("FWCF");
+    Aml *crs = aml_resource_template();
+
+    aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002")));
+
+    /* device present, functioning, decoding, not shown in UI */
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
+
+    aml_append(crs,
+        aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size));
+
+    aml_append(dev, aml_name_decl("_CRS", crs));
+    aml_append(scope, dev);
+}
Signature · 1 line
2.18.4
#13 lore raw

PATCH v9 7/10 acpi: simplify build_isa_devices_aml()

In reply to Gerd Hoffmann

x86 machines can have a single ISA bus only.

---
 hw/i386/acpi-build.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
hw/i386/acpi-build.c +6 -10
index 19e9c298dc8f..d27cecc877c4 100644
@@ -979,18 +979,14 @@ static void build_isa_devices_aml(Aml *table)
 {
     VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
-
-    Aml *scope = aml_scope("_SB.PCI0.ISA");
     Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous);
+    Aml *scope;
 
-    if (ambiguous) {
-        error_report("Multiple ISA busses, unable to define IPMI ACPI data");
-    } else if (!obj) {
-        error_report("No ISA bus, unable to define IPMI ACPI data");
-    } else {
-        build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
-        isa_build_aml(ISA_BUS(obj), scope);
-    }
+    assert(obj && !ambiguous);
+
+    scope = aml_scope("_SB.PCI0.ISA");
+    build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
+    isa_build_aml(ISA_BUS(obj), scope);
 
     if (vmbus_bridge) {
         aml_append(scope, build_vmbus_device_aml(vmbus_bridge));
Signature · 1 line
2.18.4
#14 lore raw

PATCH v9 8/10 acpi: drop serial/parallel enable bits from dsdt

In reply to Gerd Hoffmann

The _STA methods for COM+LPT used to reference them, but that isn't the case any more.

piix4 DSDT changes:

     Scope (_SB.PCI0)
     {
         Device (ISA)
         {
             Name (_ADR, 0x00010000)  // _ADR: Address
             OperationRegion (P40C, PCI_Config, 0x60, 0x04)

- Field (^PX13.P13C, AnyAcc, NoLock, Preserve)
- {
- Offset (0x5F),
- , 7,
- LPEN, 1,
- Offset (0x67),

-                    ,   3,
-                CAEN,   1,
-                    ,   3,
-                CBEN,   1
-            }
         }
     }

ich9 DSDT changes:

     Scope (_SB.PCI0)
     {
         Device (ISA)
         {
             Name (_ADR, 0x001F0000)  // _ADR: Address
             OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
             OperationRegion (LPCD, PCI_Config, 0x80, 0x02)
             Field (LPCD, AnyAcc, NoLock, Preserve)
             {
                 COMA,   3,
                     ,   1,
                 COMB,   3,
                 Offset (0x01),
                 LPTD,   2
             }
-
-            OperationRegion (LPCE, PCI_Config, 0x82, 0x02)
-            Field (LPCE, AnyAcc, NoLock, Preserve)
-            {
-                CAEN,   1,
-                CBEN,   1,
-                LPEN,   1
-            }
         }
     }
---
 hw/i386/acpi-build.c              |  23 -----------------------
 tests/data/acpi/pc/DSDT           | Bin 5014 -> 4972 bytes
 tests/data/acpi/pc/DSDT.acpihmat  | Bin 6338 -> 6296 bytes
 tests/data/acpi/pc/DSDT.bridge    | Bin 6873 -> 6831 bytes
 tests/data/acpi/pc/DSDT.cphp      | Bin 5477 -> 5435 bytes
 tests/data/acpi/pc/DSDT.dimmpxm   | Bin 6667 -> 6625 bytes
 tests/data/acpi/pc/DSDT.ipmikcs   | Bin 5086 -> 5044 bytes
 tests/data/acpi/pc/DSDT.memhp     | Bin 6373 -> 6331 bytes
 tests/data/acpi/pc/DSDT.numamem   | Bin 5020 -> 4978 bytes
 tests/data/acpi/q35/DSDT          | Bin 7752 -> 7718 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9042 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7769 -> 7735 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8215 -> 8181 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9405 -> 9371 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7827 -> 7793 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9111 -> 9077 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8882 -> 8848 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7758 -> 7724 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8357 -> 8323 bytes
 19 files changed, 23 deletions(-)
hw/i386/acpi-build.c +0 -23
index d27cecc877c4..ffbdbee51aa8 100644
@@ -1360,15 +1360,6 @@ static void build_q35_isa_bridge(Aml *table)
     aml_append(field, aml_named_field("LPTD", 2));
     aml_append(dev, field);
 
-    aml_append(dev, aml_operation_region("LPCE", AML_PCI_CONFIG,
-                                         aml_int(0x82), 0x02));
-    /* enable bits */
-    field = aml_field("LPCE", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE);
-    aml_append(field, aml_named_field("CAEN", 1));
-    aml_append(field, aml_named_field("CBEN", 1));
-    aml_append(field, aml_named_field("LPEN", 1));
-    aml_append(dev, field);
-
     aml_append(scope, dev);
     aml_append(table, scope);
 }
@@ -1392,7 +1383,6 @@ static void build_piix4_isa_bridge(Aml *table)
 {
     Aml *dev;
     Aml *scope;
-    Aml *field;
 
     scope =  aml_scope("_SB.PCI0");
     dev = aml_device("ISA");
@@ -1401,19 +1391,6 @@ static void build_piix4_isa_bridge(Aml *table)
     /* PIIX PCI to ISA irq remapping */
     aml_append(dev, aml_operation_region("P40C", AML_PCI_CONFIG,
                                          aml_int(0x60), 0x04));
-    /* enable bits */
-    field = aml_field("^PX13.P13C", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE);
-    /* Offset(0x5f),, 7, */
-    aml_append(field, aml_reserved_field(0x2f8));
-    aml_append(field, aml_reserved_field(7));
-    aml_append(field, aml_named_field("LPEN", 1));
-    /* Offset(0x67),, 3, */
-    aml_append(field, aml_reserved_field(0x38));
-    aml_append(field, aml_reserved_field(3));
-    aml_append(field, aml_named_field("CAEN", 1));
-    aml_append(field, aml_reserved_field(3));
-    aml_append(field, aml_named_field("CBEN", 1));
-    aml_append(dev, field);
 
     aml_append(scope, dev);
     aml_append(table, scope);
tests/data/acpi/pc/DSDT binary +0 -0
index 384a82dbb3cb0e9f47db6f4d08945631c2b72b56..d9074ac8df7ff21f214a5f4a135e3d1ac2c86227 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 47ddfdb027b06dc2daa46be711c3f4640ce68320..8d76c7c01d49087cc5efb9843a2e1d0865145017 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index d1e2fa9fb8c75160fc1fa46deed6a6a9cb515559..6ffae63dd8fcc4f617b9d9d57d79bd46a7253064 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 54f481faf1e336c0bbf5e774cd67220fe06e951b..b25bbf7dc5bbabea277d3402b90d376beb038043 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 5d98016ae571cde04ff96d58212e0faf9aaf50e6..7dffca09865f1c5d4f94e67dfe308bf22a45664a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 1c19e2f354d022279d7e1343fa7212396d8c25a0..5a039ac93c42d4b123e21d51c5799ddb42bf12a0 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index 8cb90ef14e13be85995c6fe3d3f6d12f4d939504..a5b60b0e9c7d77fdc770687e28502b7dc6246dcd 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index f194bc639482eb839a875d493857526f85f1a9e0..b82e13cd12017c7197cc236d9cc161e28dcfc8b1 100644
GIT binary patch
tests/data/acpi/q35/DSDT binary +0 -0
index 6a5e4dd85a7d9a95f7ad0fb95e6a4fa7a8d91adb..dada9bf69fc23ea9c0931029445257657fde90ce 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index c1dd7773f3386a946fcb4a9a3bf9ad3a33ddbbe9..134fcffc3036c250877a50847426b2fe6d4229d7 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 2ef1e894a35b9e85fe07e2678bd2456f5ec40dc6..6be4ccde643b3bba57f827c65490fa3a328ca77e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index 74e86176e5fec46e660c567acf8fbcf08a14bdfb..d076236552c60b275bd91e59ab03ea8d96ccc9ea 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index 4bf8e9d64b04f9f805047d6850c2dd0086970445..eeef0a4c15828b3a621aab88eafb3631ff85a960 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index 0173c3668a6cdef80127de7880a19cb5c5ea7dc0..5d89b41a1878bb0c77abda0807bcc833c7538581 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index 98328d1c4197ab19a71de7f3f18e2985f4910f45..ad0608ef4d22de894e0a72596c2b15dead384903 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index 5916c0e9ce0a9607c6230f9dfebe2c1be70b2495..b6c6946ed9812685dd71b51784900480963b54bd 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index cf3fde3449bc8e9bbe683b936cf9866590b0ef82..9b5c962434471d63d65f027c84dfc3e6ac20e10b 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis binary +0 -0
index 56b6fb0c3298517d080e38fea05a748b9f1dba54..7cb8d8b154f3de295669a741c9ec3ec8c67e2b2f 100644
GIT binary patch
Signature · 1 line
2.18.4
#15 lore raw

Re: [PATCH v9 08/10] acpi: drop serial/parallel enable bits from dsdt

Quoted 53 lines · Gerd Hoffmann

The _STA methods for COM+LPT used to reference them, but that isn't the case any more.

piix4 DSDT changes:

     Scope (_SB.PCI0)
     {
         Device (ISA)
         {
             Name (_ADR, 0x00010000)  // _ADR: Address
             OperationRegion (P40C, PCI_Config, 0x60, 0x04)
(quoted diff) +0 -11
-            Field (^PX13.P13C, AnyAcc, NoLock, Preserve)
-            {
-                Offset (0x5F),
-                    ,   7,
-                LPEN,   1,
-                Offset (0x67),
-                    ,   3,
-                CAEN,   1,
-                    ,   3,
-                CBEN,   1
-            }
         }
     }

ich9 DSDT changes:

     Scope (_SB.PCI0)
     {
         Device (ISA)
         {
             Name (_ADR, 0x001F0000)  // _ADR: Address
             OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
             OperationRegion (LPCD, PCI_Config, 0x80, 0x02)
             Field (LPCD, AnyAcc, NoLock, Preserve)
             {
                 COMA,   3,
                     ,   1,
                 COMB,   3,
                 Offset (0x01),
                 LPTD,   2
             }
(quoted diff) +0 -8
-
-            OperationRegion (LPCE, PCI_Config, 0x82, 0x02)
-            Field (LPCE, AnyAcc, NoLock, Preserve)
-            {
-                CAEN,   1,
-                CBEN,   1,
-                LPEN,   1
-            }
         }
     }
Quoted 2 lines

Don't make binary file changes with source changes. Pls follow process at top of tests/qtest/bios-tables-test.c

Quoted 278 lines
---
 hw/i386/acpi-build.c              |  23 -----------------------
 tests/data/acpi/pc/DSDT           | Bin 5014 -> 4972 bytes
 tests/data/acpi/pc/DSDT.acpihmat  | Bin 6338 -> 6296 bytes
 tests/data/acpi/pc/DSDT.bridge    | Bin 6873 -> 6831 bytes
 tests/data/acpi/pc/DSDT.cphp      | Bin 5477 -> 5435 bytes
 tests/data/acpi/pc/DSDT.dimmpxm   | Bin 6667 -> 6625 bytes
 tests/data/acpi/pc/DSDT.ipmikcs   | Bin 5086 -> 5044 bytes
 tests/data/acpi/pc/DSDT.memhp     | Bin 6373 -> 6331 bytes
 tests/data/acpi/pc/DSDT.numamem   | Bin 5020 -> 4978 bytes
 tests/data/acpi/q35/DSDT          | Bin 7752 -> 7718 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9042 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7769 -> 7735 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8215 -> 8181 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9405 -> 9371 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7827 -> 7793 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9111 -> 9077 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8882 -> 8848 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7758 -> 7724 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8357 -> 8323 bytes
 19 files changed, 23 deletions(-)
hw/i386/acpi-build.c +0 -23
index d27cecc877c4..ffbdbee51aa8 100644
@@ -1360,15 +1360,6 @@ static void build_q35_isa_bridge(Aml *table)
     aml_append(field, aml_named_field("LPTD", 2));
     aml_append(dev, field);
 
-    aml_append(dev, aml_operation_region("LPCE", AML_PCI_CONFIG,
-                                         aml_int(0x82), 0x02));
-    /* enable bits */
-    field = aml_field("LPCE", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE);
-    aml_append(field, aml_named_field("CAEN", 1));
-    aml_append(field, aml_named_field("CBEN", 1));
-    aml_append(field, aml_named_field("LPEN", 1));
-    aml_append(dev, field);
-
     aml_append(scope, dev);
     aml_append(table, scope);
 }
@@ -1392,7 +1383,6 @@ static void build_piix4_isa_bridge(Aml *table)
 {
     Aml *dev;
     Aml *scope;
-    Aml *field;
 
     scope =  aml_scope("_SB.PCI0");
     dev = aml_device("ISA");
@@ -1401,19 +1391,6 @@ static void build_piix4_isa_bridge(Aml *table)
     /* PIIX PCI to ISA irq remapping */
     aml_append(dev, aml_operation_region("P40C", AML_PCI_CONFIG,
                                          aml_int(0x60), 0x04));
-    /* enable bits */
-    field = aml_field("^PX13.P13C", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE);
-    /* Offset(0x5f),, 7, */
-    aml_append(field, aml_reserved_field(0x2f8));
-    aml_append(field, aml_reserved_field(7));
-    aml_append(field, aml_named_field("LPEN", 1));
-    /* Offset(0x67),, 3, */
-    aml_append(field, aml_reserved_field(0x38));
-    aml_append(field, aml_reserved_field(3));
-    aml_append(field, aml_named_field("CAEN", 1));
-    aml_append(field, aml_reserved_field(3));
-    aml_append(field, aml_named_field("CBEN", 1));
-    aml_append(dev, field);
 
     aml_append(scope, dev);
     aml_append(table, scope);
tests/data/acpi/pc/DSDT binary +0 -0
index 384a82dbb3cb0e9f47db6f4d08945631c2b72b56..d9074ac8df7ff21f214a5f4a135e3d1ac2c86227 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 47ddfdb027b06dc2daa46be711c3f4640ce68320..8d76c7c01d49087cc5efb9843a2e1d0865145017 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index d1e2fa9fb8c75160fc1fa46deed6a6a9cb515559..6ffae63dd8fcc4f617b9d9d57d79bd46a7253064 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index 54f481faf1e336c0bbf5e774cd67220fe06e951b..b25bbf7dc5bbabea277d3402b90d376beb038043 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 5d98016ae571cde04ff96d58212e0faf9aaf50e6..7dffca09865f1c5d4f94e67dfe308bf22a45664a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 1c19e2f354d022279d7e1343fa7212396d8c25a0..5a039ac93c42d4b123e21d51c5799ddb42bf12a0 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index 8cb90ef14e13be85995c6fe3d3f6d12f4d939504..a5b60b0e9c7d77fdc770687e28502b7dc6246dcd 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index f194bc639482eb839a875d493857526f85f1a9e0..b82e13cd12017c7197cc236d9cc161e28dcfc8b1 100644
GIT binary patch
tests/data/acpi/q35/DSDT binary +0 -0
index 6a5e4dd85a7d9a95f7ad0fb95e6a4fa7a8d91adb..dada9bf69fc23ea9c0931029445257657fde90ce 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index c1dd7773f3386a946fcb4a9a3bf9ad3a33ddbbe9..134fcffc3036c250877a50847426b2fe6d4229d7 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 2ef1e894a35b9e85fe07e2678bd2456f5ec40dc6..6be4ccde643b3bba57f827c65490fa3a328ca77e 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index 74e86176e5fec46e660c567acf8fbcf08a14bdfb..d076236552c60b275bd91e59ab03ea8d96ccc9ea 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index 4bf8e9d64b04f9f805047d6850c2dd0086970445..eeef0a4c15828b3a621aab88eafb3631ff85a960 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index 0173c3668a6cdef80127de7880a19cb5c5ea7dc0..5d89b41a1878bb0c77abda0807bcc833c7538581 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index 98328d1c4197ab19a71de7f3f18e2985f4910f45..ad0608ef4d22de894e0a72596c2b15dead384903 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index 5916c0e9ce0a9607c6230f9dfebe2c1be70b2495..b6c6946ed9812685dd71b51784900480963b54bd 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index cf3fde3449bc8e9bbe683b936cf9866590b0ef82..9b5c962434471d63d65f027c84dfc3e6ac20e10b 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis binary +0 -0
index 56b6fb0c3298517d080e38fea05a748b9f1dba54..7cb8d8b154f3de295669a741c9ec3ec8c67e2b2f 100644
GIT binary patch
Signature · 2 lines
-- 
2.18.4
#16 lore raw

PATCH v9 9/10 acpi: drop build_piix4_pm()

In reply to Gerd Hoffmann

The _SB.PCI0.PX13.P13C opregion (holds isa device enable bits) is not used any more, remove it from DSDT.

piix4 DSDT changes:

     Scope (_SB.PCI0)
     {

- Device (PX13)
- {
- Name (_ADR, 0x00010003) // _ADR: Address
- OperationRegion (P13C, PCI_Config, Zero, 0xFF)
- }
- }
-
- Scope (_SB.PCI0)

-    {
         Device (ISA)
         {
             Name (_ADR, 0x00010000)  // _ADR: Address
             OperationRegion (P40C, PCI_Config, 0x60, 0x04)
         }
     }
---
 hw/i386/acpi-build.c             |  16 ----------------
 tests/data/acpi/pc/DSDT          | Bin 4972 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat | Bin 6296 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge   | Bin 6831 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp     | Bin 5435 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm  | Bin 6625 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs  | Bin 5044 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp    | Bin 6331 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem  | Bin 4978 -> 4940 bytes
 9 files changed, 16 deletions(-)
hw/i386/acpi-build.c +0 -16
index ffbdbee51aa8..59f1b4d89000 100644
@@ -1364,21 +1364,6 @@ static void build_q35_isa_bridge(Aml *table)
     aml_append(table, scope);
 }
 
-static void build_piix4_pm(Aml *table)
-{
-    Aml *dev;
-    Aml *scope;
-
-    scope =  aml_scope("_SB.PCI0");
-    dev = aml_device("PX13");
-    aml_append(dev, aml_name_decl("_ADR", aml_int(0x00010003)));
-
-    aml_append(dev, aml_operation_region("P13C", AML_PCI_CONFIG,
-                                         aml_int(0x00), 0xff));
-    aml_append(scope, dev);
-    aml_append(table, scope);
-}
-
 static void build_piix4_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -1530,7 +1515,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         aml_append(dsdt, sb_scope);
 
         build_hpet_aml(dsdt);
-        build_piix4_pm(dsdt);
         build_piix4_isa_bridge(dsdt);
         build_isa_devices_aml(dsdt);
         build_piix4_pci_hotplug(dsdt);
tests/data/acpi/pc/DSDT binary +0 -0
index d9074ac8df7ff21f214a5f4a135e3d1ac2c86227..6d0aaf729ac7d64cf966621adf276534de5cc555 100644
GIT binary patch
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
index 8d76c7c01d49087cc5efb9843a2e1d0865145017..2e5e02400b1bd2842989d395c573fc593f45503b 100644
GIT binary patch
tests/data/acpi/pc/DSDT.bridge binary +0 -0
index 6ffae63dd8fcc4f617b9d9d57d79bd46a7253064..623c4c03585c47d4d28adc611823b7cce8f4a5c7 100644
GIT binary patch
tests/data/acpi/pc/DSDT.cphp binary +0 -0
index b25bbf7dc5bbabea277d3402b90d376beb038043..e0a43ccdadae150c0f39599c85e4e21ed8fff2a4 100644
GIT binary patch
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
index 7dffca09865f1c5d4f94e67dfe308bf22a45664a..21eb065a0ee3bd96f1a2e7601aa83fefa833349a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
index 5a039ac93c42d4b123e21d51c5799ddb42bf12a0..b8f08f266b5735fe6967d4e105ee6b3662dad7e6 100644
GIT binary patch
tests/data/acpi/pc/DSDT.memhp binary +0 -0
index a5b60b0e9c7d77fdc770687e28502b7dc6246dcd..9a9418f4bde5fb18883c244ea956122e371ff01a 100644
GIT binary patch
tests/data/acpi/pc/DSDT.numamem binary +0 -0
index b82e13cd12017c7197cc236d9cc161e28dcfc8b1..6eec385c2ec00544c6eaa7e19d32b2ccd5a51915 100644
GIT binary patch
Signature · 1 line
2.18.4
#17 lore raw

PATCH v9 10/10 acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.

In reply to Gerd Hoffmann

Seems to be unused.

ich9 DSDT changes:

     Scope (_SB.PCI0)
     {
         Device (ISA)
         {
             Name (_ADR, 0x001F0000)  // _ADR: Address
             OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
-            OperationRegion (LPCD, PCI_Config, 0x80, 0x02)
-            Field (LPCD, AnyAcc, NoLock, Preserve)
-            {
-                COMA,   3,
-                    ,   1,
-                COMB,   3,
-                Offset (0x01),
-                LPTD,   2
-            }
         }
     }
---
 hw/i386/acpi-build.c              |  11 -----------
 tests/data/acpi/q35/DSDT          | Bin 7718 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9042 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7735 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8181 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9371 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7793 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9077 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8848 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7724 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8323 -> 8283 bytes
 11 files changed, 11 deletions(-)
hw/i386/acpi-build.c +0 -11
index 59f1b4d89000..378515df66c5 100644
@@ -1340,7 +1340,6 @@ static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
     Aml *scope;
-    Aml *field;
 
     scope =  aml_scope("_SB.PCI0");
     dev = aml_device("ISA");
@@ -1350,16 +1349,6 @@ static void build_q35_isa_bridge(Aml *table)
     aml_append(dev, aml_operation_region("PIRQ", AML_PCI_CONFIG,
                                          aml_int(0x60), 0x0C));
 
-    aml_append(dev, aml_operation_region("LPCD", AML_PCI_CONFIG,
-                                         aml_int(0x80), 0x02));
-    field = aml_field("LPCD", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE);
-    aml_append(field, aml_named_field("COMA", 3));
-    aml_append(field, aml_reserved_field(1));
-    aml_append(field, aml_named_field("COMB", 3));
-    aml_append(field, aml_reserved_field(1));
-    aml_append(field, aml_named_field("LPTD", 2));
-    aml_append(dev, field);
-
     aml_append(scope, dev);
     aml_append(table, scope);
 }
tests/data/acpi/q35/DSDT binary +0 -0
index dada9bf69fc23ea9c0931029445257657fde90ce..e63676d7a63afec714debeb465ee478ea4714337 100644
GIT binary patch
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
index 134fcffc3036c250877a50847426b2fe6d4229d7..cd97b819824e4140d087e465d179b71775d6a494 100644
GIT binary patch
tests/data/acpi/q35/DSDT.bridge binary +0 -0
index 6be4ccde643b3bba57f827c65490fa3a328ca77e..8b0fb497dbbaeba18e9d0e1503de4396f1c230b0 100644
GIT binary patch
tests/data/acpi/q35/DSDT.cphp binary +0 -0
index d076236552c60b275bd91e59ab03ea8d96ccc9ea..d9bb414e9bf15d9b9149f38c9bb5d8b993f88650 100644
GIT binary patch
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
index eeef0a4c15828b3a621aab88eafb3631ff85a960..29f19b22a38f9d8e7dc9870f0c1aa3d4470643ff 100644
GIT binary patch
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
index 5d89b41a1878bb0c77abda0807bcc833c7538581..e8dea1ea42af765babcb747af998b0d912abdcbd 100644
GIT binary patch
tests/data/acpi/q35/DSDT.memhp binary +0 -0
index ad0608ef4d22de894e0a72596c2b15dead384903..dca76db15b943122efd5c200cb54ce3dbc97a55f 100644
GIT binary patch
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
index b6c6946ed9812685dd71b51784900480963b54bd..6d8facd9e179140682ad5d4302f3dad14dbec342 100644
GIT binary patch
tests/data/acpi/q35/DSDT.numamem binary +0 -0
index 9b5c962434471d63d65f027c84dfc3e6ac20e10b..737325dc3082fdf06283857811f6f5174e0ff2a9 100644
GIT binary patch
tests/data/acpi/q35/DSDT.tis binary +0 -0
index 7cb8d8b154f3de295669a741c9ec3ec8c67e2b2f..27ee927fc5ac05b89724c154197304c39e653269 100644
GIT binary patch
Signature · 1 line
2.18.4
#18 lore raw
In reply to Gerd Hoffmann
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [PATCH v9 00/10] acpi: i386 tweaks
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
95563cf acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. f9a1499 acpi: drop build_piix4_pm()
2f9982f acpi: drop serial/parallel enable bits from dsdt 76f8de5 acpi: simplify build_isa_devices_aml()
9f96ea9 acpi: factor out fw_cfg_add_acpi_dsdt() 5dfc8bd acpi: move aml builder code for i8042 (kbd+mouse) device 23a13c5 floppy: move cmos_get_fd_drive_type() from pc 3b35189 floppy: make isa_fdc_get_drive_max_chs static cd046a4 acpi: move aml builder code for floppy device fc9cc42 acpi: bios-tables-test: show more context on asl diffs

=== OUTPUT BEGIN ===
1/10 Checking commit fc9cc42f4d41 (acpi: bios-tables-test: show more context on asl diffs) 2/10 Checking commit cd046a45c7eb (acpi: move aml builder code for floppy device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #245:
new file mode 100644

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and stubs/cmos.c found

total: 1 errors, 1 warnings, 219 lines checked

Patch 2/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

3/10 Checking commit 3b3518992288 (floppy: make isa_fdc_get_drive_max_chs static)
4/10 Checking commit 23a13c5df0d0 (floppy: move cmos_get_fd_drive_type() from pc)
5/10 Checking commit 5dfc8bd9ac77 (acpi: move aml builder code for i8042 (kbd+mouse) device)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/input/pckbd.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/input/pckbd.c found

total: 2 errors, 0 warnings, 100 lines checked

Patch 5/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

6/10 Checking commit 9f96ea9f1582 (acpi: factor out fw_cfg_add_acpi_dsdt())
7/10 Checking commit 76f8de5f47c1 (acpi: simplify build_isa_devices_aml())
8/10 Checking commit 2f9982f86b2a (acpi: drop serial/parallel enable bits from dsdt)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.mmio64 and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.tis and hw/i386/acpi-build.c found

total: 18 errors, 0 warnings, 41 lines checked

Patch 8/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

9/10 Checking commit f9a14999e629 (acpi: drop build_piix4_pm())
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.numamem and hw/i386/acpi-build.c found

total: 8 errors, 0 warnings, 28 lines checked

Patch 9/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

10/10 Checking commit 95563cf96f9c (acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.mmio64 and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.tis and hw/i386/acpi-build.c found

total: 10 errors, 0 warnings, 23 lines checked

Patch 10/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#19 lore raw
In reply to Gerd Hoffmann
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [PATCH v9 00/10] acpi: i386 tweaks
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
ecc6ddb acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. 32c806e acpi: drop build_piix4_pm()
df8a357 acpi: drop serial/parallel enable bits from dsdt 3f214a1 acpi: simplify build_isa_devices_aml()
c9c4581 acpi: factor out fw_cfg_add_acpi_dsdt() a387b2c acpi: move aml builder code for i8042 (kbd+mouse) device 2e9418c floppy: move cmos_get_fd_drive_type() from pc d6c3640 floppy: make isa_fdc_get_drive_max_chs static a179ece acpi: move aml builder code for floppy device 5255f1d acpi: bios-tables-test: show more context on asl diffs

=== OUTPUT BEGIN ===
1/10 Checking commit 5255f1df2516 (acpi: bios-tables-test: show more context on asl diffs) 2/10 Checking commit a179ece64189 (acpi: move aml builder code for floppy device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #245:
new file mode 100644

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and stubs/cmos.c found

total: 1 errors, 1 warnings, 219 lines checked

Patch 2/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

3/10 Checking commit d6c3640cd45c (floppy: make isa_fdc_get_drive_max_chs static)
4/10 Checking commit 2e9418c3a0e1 (floppy: move cmos_get_fd_drive_type() from pc)
5/10 Checking commit a387b2c65765 (acpi: move aml builder code for i8042 (kbd+mouse) device)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/input/pckbd.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/input/pckbd.c found

total: 2 errors, 0 warnings, 100 lines checked

Patch 5/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

6/10 Checking commit c9c458106c8b (acpi: factor out fw_cfg_add_acpi_dsdt())
7/10 Checking commit 3f214a1787aa (acpi: simplify build_isa_devices_aml())
8/10 Checking commit df8a357a5fb2 (acpi: drop serial/parallel enable bits from dsdt)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.mmio64 and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.tis and hw/i386/acpi-build.c found

total: 18 errors, 0 warnings, 41 lines checked

Patch 8/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

9/10 Checking commit 32c806e5bfbb (acpi: drop build_piix4_pm())
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.ipmikcs and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/pc/DSDT.numamem and hw/i386/acpi-build.c found

total: 8 errors, 0 warnings, 28 lines checked

Patch 9/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

10/10 Checking commit ecc6ddb0c5d9 (acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.)
ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.acpihmat and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.bridge and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.cphp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.dimmpxm and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.ipmibt and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.memhp and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.mmio64 and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.numamem and hw/i386/acpi-build.c found

ERROR: Do not add expected files together with tests, follow instructions in tests/qtest/bios-tables-test.c: both tests/data/acpi/q35/DSDT.tis and hw/i386/acpi-build.c found

total: 10 errors, 0 warnings, 23 lines checked

Patch 10/10 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#20 lore raw
In reply to Gerd Hoffmann
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1 === TEST SCRIPT END ===

  CC      qga/commands-posix.o
  CC      qga/channel-posix.o
  CC      qga/qapi-generated/qga-qapi-types.o
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  CC      qga/qapi-generated/qga-qapi-visit.o
  CC      qga/qapi-generated/qga-qapi-commands.o
  CC      qga/qapi-generated/qga-qapi-init-commands.o
  CC      qemu-img.o
  LINK    elf2dmp
  AR      libqemuutil.a
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  AR      libvhost-user.a
  GEN     docs/interop/qemu-ga-ref.html
  GEN     docs/interop/qemu-ga-ref.txt
  GEN     docs/interop/qemu-ga-ref.7
  LINK    qemu-ga
  LINK    qemu-keymap

/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o) /usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK ivshmem-client
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK ivshmem-server
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)

  LINK    qemu-nbd
  AS      pc-bios/optionrom/multiboot.o
  AS      pc-bios/optionrom/linuxboot.o
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-storage-daemon
  CC      pc-bios/optionrom/linuxboot_dma.o
  AS      pc-bios/optionrom/kvmvapic.o
  AS      pc-bios/optionrom/pvh.o
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  CC      pc-bios/optionrom/pvh_main.o
  LINK    qemu-img
  BUILD   pc-bios/optionrom/multiboot.img
---
  SIGN    pc-bios/optionrom/kvmvapic.bin
  SIGN    pc-bios/optionrom/pvh.bin
  SIGN    pc-bios/optionrom/linuxboot.bin

/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK qemu-edid
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK fsdev/virtfs-proxy-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o) /usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK scsi/qemu-pr-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK qemu-bridge-helper
LINK virtiofsd
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
LINK vhost-user-input
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o) /usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)

  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-devices.h
---
  CC      x86_64-softmmu/hw/display/vhost-user-gpu-pci.o
  CC      x86_64-softmmu/hw/display/virtio-vga.o
  CC      x86_64-softmmu/hw/display/vhost-user-vga.o
/tmp/qemu-test/src/fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !
/tmp/qemu-test/src/fpu/softfloat.c:3483:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        absZ0 &= ~(((uint64_t)(absZ1<<1) == 0) & roundNearestEven);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !
/tmp/qemu-test/src/fpu/softfloat.c:3606:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3760:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3987:21: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
                    ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    !
/tmp/qemu-test/src/fpu/softfloat.c:4003:22: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
            zSig0 &= ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     !
/tmp/qemu-test/src/fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !

8 errors generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: fpu/softfloat.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/migration/ram.c:919:45: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]

            xbzrle_counters.encoding_rate = UINT64_MAX;
                                          ~ ^~~~~~~~~~

/usr/include/stdint.h:130:23: note: expanded from macro 'UINT64_MAX'
---
18446744073709551615UL
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: migration/ram.o] Error 1
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
File "./tests/docker/docker.py", line 669, in <module>
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=e4e911bce95940cd802cc1d2fb1d64bb', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-jxvltcji/src/docker-src.2020-06-17-03.43.09.4177:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=e4e911bce95940cd802cc1d2fb1d64bb
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-jxvltcji/src'
make: *** [docker-run-test-debug@fedora] Error 2

real 4m14.849s
user 0m8.297s

The full log is available at
http://patchew.org/logs/[email protected]/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#21 lore raw
In reply to Gerd Hoffmann
Quoted 4 lines · Gerd Hoffmann

First batch of microvm patches, some generic acpi stuff. Split the acpi-build.c monster, specifically split the pc and q35 and pci bits into a separate file which we can skip building at some point in the future.

Thanks for the patches!
Pls take a look at tests/qtest/bios-tables-test.c, the comment at top of this file outlines the process to use for changing expected test files.
As it is, the patches won't be easily rebaseable or backportable.

Quoted 85 lines

v2 changes: leave acpi-build.c largely as-is, move useful bits to other places to allow them being reused, specifically:

* move isa device generator functions to individual isa devices.
* move fw_cfg generator function to fw_cfg.c

v3 changes: fix rtc, support multiple lpt devices.

v4 changes:
* drop merged patches.
* split rtc crs change to separata patch.
* added two cleanup patches.
* picked up ack & review tags.

v5 changes:
* add comment for rtc crs update.
* add even more cleanup patches.
* picked up ack & review tags.

v6 changes:
* floppy: move cmos_get_fd_drive_type.
* picked up ack & review tags.

v7 changes:
* rebased to mst/pci branch, resolved stubs conflict.
* dropped patches already queued up in mst/pci.
* added missing sign-off.
* picked up ack & review tags.

v8 changes:
* (re-)add patch to allow acpi table changes

v9 changes:
* add asl changes to commit messages.
* update acpi test data.

take care,
Gerd

Gerd Hoffmann (10):
acpi: bios-tables-test: show more context on asl diffs
acpi: move aml builder code for floppy device
floppy: make isa_fdc_get_drive_max_chs static
floppy: move cmos_get_fd_drive_type() from pc
acpi: move aml builder code for i8042 (kbd+mouse) device
acpi: factor out fw_cfg_add_acpi_dsdt()
acpi: simplify build_isa_devices_aml()
acpi: drop serial/parallel enable bits from dsdt
acpi: drop build_piix4_pm()
acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.

 hw/i386/fw_cfg.h                  |   1 +
 include/hw/block/fdc.h            |   3 +-
 include/hw/i386/pc.h              |   1 -
 hw/block/fdc.c                    | 111 +++++++++++++++-
 hw/i386/acpi-build.c              | 210 +-----------------------------
 hw/i386/fw_cfg.c                  |  28 ++++
 hw/i386/pc.c                      |  25 ----
 hw/input/pckbd.c                  |  31 +++++
 stubs/cmos.c                      |   7 +
 tests/qtest/bios-tables-test.c    |   2 +-
 stubs/Makefile.objs               |   1 +
 tests/data/acpi/pc/DSDT           | Bin 5014 -> 4934 bytes
 tests/data/acpi/pc/DSDT.acpihmat  | Bin 6338 -> 6258 bytes
 tests/data/acpi/pc/DSDT.bridge    | Bin 6873 -> 6793 bytes
 tests/data/acpi/pc/DSDT.cphp      | Bin 5477 -> 5397 bytes
 tests/data/acpi/pc/DSDT.dimmpxm   | Bin 6667 -> 6587 bytes
 tests/data/acpi/pc/DSDT.ipmikcs   | Bin 5086 -> 5006 bytes
 tests/data/acpi/pc/DSDT.memhp     | Bin 6373 -> 6293 bytes
 tests/data/acpi/pc/DSDT.numamem   | Bin 5020 -> 4940 bytes
 tests/data/acpi/q35/DSDT          | Bin 7752 -> 7678 bytes
 tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9002 bytes
 tests/data/acpi/q35/DSDT.bridge   | Bin 7769 -> 7695 bytes
 tests/data/acpi/q35/DSDT.cphp     | Bin 8215 -> 8141 bytes
 tests/data/acpi/q35/DSDT.dimmpxm  | Bin 9405 -> 9331 bytes
 tests/data/acpi/q35/DSDT.ipmibt   | Bin 7827 -> 7753 bytes
 tests/data/acpi/q35/DSDT.memhp    | Bin 9111 -> 9037 bytes
 tests/data/acpi/q35/DSDT.mmio64   | Bin 8882 -> 8808 bytes
 tests/data/acpi/q35/DSDT.numamem  | Bin 7758 -> 7684 bytes
 tests/data/acpi/q35/DSDT.tis      | Bin 8357 -> 8283 bytes
 29 files changed, 185 insertions(+), 235 deletions(-)
 create mode 100644 stubs/cmos.c
Signature · 1 line
2.18.4