All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/12] acpi: i386 tweaks
@ 2020-04-03  8:04 Gerd Hoffmann
  2020-04-03  8:04 ` [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h Gerd Hoffmann
                   ` (13 more replies)
  0 siblings, 14 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

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

Sneak preview: full microvm series at
    https://git.kraxel.org/cgit/qemu/log/?h=sirius/microvm

take care,
  Gerd

Gerd Hoffmann (12):
  move 'typedef Aml' to qemu/types.h
  acpi: add aml builder stubs
  acpi: drop pointless _STA method
  acpi: serial: don't use _STA method
  acpi: parallel: don't use _STA method
  acpi: add ISADeviceClass->build_aml()
  acpi: move aml builder code for rtc device
  acpi: move aml builder code for serial device
  acpi: move aml builder code for parallel device
  acpi: move aml builder code for floppy device
  acpi: move aml builder code for i8042 (kbd+mouse) device
  acpi: factor out fw_cfg_add_acpi_dsdt()

 hw/i386/fw_cfg.h            |   1 +
 include/hw/acpi/aml-build.h |   1 -
 include/hw/isa/isa.h        |   2 +
 include/qemu/typedefs.h     |   1 +
 hw/acpi/aml-build-stub.c    |  79 +++++++++++
 hw/block/fdc.c              |  83 ++++++++++++
 hw/char/parallel.c          |  25 ++++
 hw/char/serial-isa.c        |  32 +++++
 hw/i386/acpi-build.c        | 258 +-----------------------------------
 hw/i386/fw_cfg.c            |  28 ++++
 hw/input/pckbd.c            |  31 +++++
 hw/isa/isa-bus.c            |  15 +++
 hw/rtc/mc146818rtc.c        |  20 +++
 stubs/cmos.c                |   7 +
 hw/acpi/Makefile.objs       |   4 +-
 stubs/Makefile.objs         |   1 +
 16 files changed, 330 insertions(+), 258 deletions(-)
 create mode 100644 hw/acpi/aml-build-stub.c
 create mode 100644 stubs/cmos.c

-- 
2.18.2



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

* [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03  9:41   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 02/12] acpi: add aml builder stubs Gerd Hoffmann
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/hw/acpi/aml-build.h | 1 -
 include/qemu/typedefs.h     | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index de4a4065682c..1bfe5844e984 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -32,7 +32,6 @@ struct Aml {
     uint8_t op;
     AmlBlockFlags block_flags;
 };
-typedef struct Aml Aml;
 
 typedef enum {
     AML_COMPATIBILITY = 0,
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 375770a80f06..ecf3cde26c3c 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -24,6 +24,7 @@
 typedef struct AdapterInfo AdapterInfo;
 typedef struct AddressSpace AddressSpace;
 typedef struct AioContext AioContext;
+typedef struct Aml Aml;
 typedef struct AnnounceTimer AnnounceTimer;
 typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
 typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;
-- 
2.18.2



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

* [PATCH v2 02/12] acpi: add aml builder stubs
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
  2020-04-03  8:04 ` [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03  9:43   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 03/12] acpi: drop pointless _STA method Gerd Hoffmann
                   ` (11 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Needed when moving aml builder code to devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi/aml-build-stub.c | 79 ++++++++++++++++++++++++++++++++++++++++
 hw/acpi/Makefile.objs    |  4 +-
 2 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 hw/acpi/aml-build-stub.c

diff --git a/hw/acpi/aml-build-stub.c b/hw/acpi/aml-build-stub.c
new file mode 100644
index 000000000000..58b2e162277f
--- /dev/null
+++ b/hw/acpi/aml-build-stub.c
@@ -0,0 +1,79 @@
+/*
+ * ACPI aml builder stubs for platforms that don't support ACPI.
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ * Copyright (c) 2016 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/acpi/acpi.h"
+#include "hw/acpi/aml-build.h"
+
+void aml_append(Aml *parent_ctx, Aml *child)
+{
+}
+
+Aml *aml_resource_template(void)
+{
+    return NULL;
+}
+
+Aml *aml_device(const char *name_format, ...)
+{
+    return NULL;
+}
+
+Aml *aml_eisaid(const char *str)
+{
+    return NULL;
+}
+
+Aml *aml_name_decl(const char *name, Aml *val)
+{
+    return NULL;
+}
+
+Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
+            uint8_t aln, uint8_t len)
+{
+    return NULL;
+}
+
+Aml *aml_irq_no_flags(uint8_t irq)
+{
+    return NULL;
+}
+
+Aml *aml_int(const uint64_t val)
+{
+    return NULL;
+}
+
+Aml *aml_package(uint8_t num_elements)
+{
+    return NULL;
+}
+
+Aml *aml_dma(AmlDmaType typ, AmlDmaBusMaster bm, AmlTransferSize sz,
+             uint8_t channel)
+{
+    return NULL;
+}
+
+Aml *aml_buffer(int buffer_size, uint8_t *byte_list)
+{
+    return NULL;
+}
diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
index 777da07f4d70..cab9bcd457dc 100644
--- a/hw/acpi/Makefile.objs
+++ b/hw/acpi/Makefile.objs
@@ -20,6 +20,6 @@ common-obj-$(CONFIG_TPM) += tpm.o
 common-obj-$(CONFIG_IPMI) += ipmi.o
 common-obj-$(call lnot,$(CONFIG_IPMI)) += ipmi-stub.o
 else
-common-obj-y += acpi-stub.o
+common-obj-y += acpi-stub.o aml-build-stub.o
 endif
-common-obj-$(CONFIG_ALL) += acpi-stub.o acpi-x86-stub.o ipmi-stub.o
+common-obj-$(CONFIG_ALL) += acpi-stub.o aml-build-stub.o acpi-x86-stub.o ipmi-stub.o
-- 
2.18.2



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

* [PATCH v2 03/12] acpi: drop pointless _STA method
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
  2020-04-03  8:04 ` [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h Gerd Hoffmann
  2020-04-03  8:04 ` [PATCH v2 02/12] acpi: add aml builder stubs Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03  9:45   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 04/12] acpi: serial: don't use " Gerd Hoffmann
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

When returning a constant there is no point in having a method
in the first place, _STA can be a simple integer instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 9a19c14e661b..214b98671bf2 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1151,14 +1151,11 @@ static Aml *build_kbd_device_aml(void)
 {
     Aml *dev;
     Aml *crs;
-    Aml *method;
 
     dev = aml_device("KBD");
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303")));
 
-    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_return(aml_int(0x0f)));
-    aml_append(dev, method);
+    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));
@@ -1173,14 +1170,11 @@ static Aml *build_mouse_device_aml(void)
 {
     Aml *dev;
     Aml *crs;
-    Aml *method;
 
     dev = aml_device("MOU");
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
 
-    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_return(aml_int(0x0f)));
-    aml_append(dev, method);
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 
     crs = aml_resource_template();
     aml_append(crs, aml_irq_no_flags(12));
@@ -2238,9 +2232,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
                                            TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
         aml_append(dev, aml_name_decl("_CRS", crs));
 
-        method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-        aml_append(method, aml_return(aml_int(0x0f)));
-        aml_append(dev, method);
+        aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 
         tpm_build_ppi_acpi(tpm, dev);
 
-- 
2.18.2



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

* [PATCH v2 04/12] acpi: serial: don't use _STA method
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 03/12] acpi: drop pointless _STA method Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:00   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 05/12] acpi: parallel: " Gerd Hoffmann
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

The _STA method dates back to the days where we had a static DSDT.  The
device is listed in the DSDT table unconditionally and the _STA method
checks a bit in the isa bridge pci config space to figure whenever a
given is isa device is present or not, then evaluates to 0x0f (present)
or 0x00 (absent).

These days the DSDT is generated by qemu anyway, so if a device is not
present we can simply drop it from the DSDT instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build.c | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 214b98671bf2..08433a06039f 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1218,50 +1218,34 @@ static Aml *build_lpt_device_aml(void)
     return dev;
 }
 
-static Aml *build_com_device_aml(uint8_t uid)
+static void build_com_device_aml(Aml *scope, uint8_t uid)
 {
     Aml *dev;
     Aml *crs;
-    Aml *method;
-    Aml *if_ctx;
-    Aml *else_ctx;
-    Aml *zero = aml_int(0);
-    Aml *is_present = aml_local(0);
-    const char *enabled_field = "CAEN";
     uint8_t irq = 4;
     uint16_t io_port = 0x03F8;
 
     assert(uid == 1 || uid == 2);
     if (uid == 2) {
-        enabled_field = "CBEN";
         irq = 3;
         io_port = 0x02F8;
     }
+    if (!memory_region_present(get_system_io(), io_port)) {
+        return;
+    }
 
     dev = aml_device("COM%d", uid);
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
     aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
 
-    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_store(aml_name("%s", enabled_field), is_present));
-    if_ctx = aml_if(aml_equal(is_present, zero));
-    {
-        aml_append(if_ctx, aml_return(aml_int(0x00)));
-    }
-    aml_append(method, if_ctx);
-    else_ctx = aml_else();
-    {
-        aml_append(else_ctx, aml_return(aml_int(0x0f)));
-    }
-    aml_append(method, else_ctx);
-    aml_append(dev, method);
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 
     crs = aml_resource_template();
     aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08));
     aml_append(crs, aml_irq_no_flags(irq));
     aml_append(dev, aml_name_decl("_CRS", crs));
 
-    return dev;
+    aml_append(scope, dev);
 }
 
 static void build_isa_devices_aml(Aml *table)
@@ -1279,8 +1263,8 @@ static void build_isa_devices_aml(Aml *table)
         aml_append(scope, build_fdc_device_aml(fdc));
     }
     aml_append(scope, build_lpt_device_aml());
-    aml_append(scope, build_com_device_aml(1));
-    aml_append(scope, build_com_device_aml(2));
+    build_com_device_aml(scope, 1);
+    build_com_device_aml(scope, 2);
 
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
-- 
2.18.2



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

* [PATCH v2 05/12] acpi: parallel: don't use _STA method
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 04/12] acpi: serial: don't use " Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:01   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml() Gerd Hoffmann
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

The _STA method dates back to the days where we had a static DSDT.  The
device is listed in the DSDT table unconditionally and the _STA method
checks a bit in the isa bridge pci config space to figure whenever a
given is isa device is present or not, then evaluates to 0x0f (present)
or 0x00 (absent).

These days the DSDT is generated by qemu anyway, so if a device is not
present we can simply drop it from the DSDT instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 08433a06039f..5d2b9b099684 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1183,39 +1183,26 @@ static Aml *build_mouse_device_aml(void)
     return dev;
 }
 
-static Aml *build_lpt_device_aml(void)
+static void build_lpt_device_aml(Aml *scope)
 {
     Aml *dev;
     Aml *crs;
-    Aml *method;
-    Aml *if_ctx;
-    Aml *else_ctx;
-    Aml *zero = aml_int(0);
-    Aml *is_present = aml_local(0);
+
+    if (!memory_region_present(get_system_io(), 0x0378)) {
+        return;
+    }
 
     dev = aml_device("LPT");
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
 
-    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
-    aml_append(method, aml_store(aml_name("LPEN"), is_present));
-    if_ctx = aml_if(aml_equal(is_present, zero));
-    {
-        aml_append(if_ctx, aml_return(aml_int(0x00)));
-    }
-    aml_append(method, if_ctx);
-    else_ctx = aml_else();
-    {
-        aml_append(else_ctx, aml_return(aml_int(0x0f)));
-    }
-    aml_append(method, else_ctx);
-    aml_append(dev, method);
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
 
     crs = aml_resource_template();
     aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
     aml_append(crs, aml_irq_no_flags(7));
     aml_append(dev, aml_name_decl("_CRS", crs));
 
-    return dev;
+    aml_append(scope, dev);
 }
 
 static void build_com_device_aml(Aml *scope, uint8_t uid)
@@ -1262,7 +1249,7 @@ static void build_isa_devices_aml(Aml *table)
     if (fdc) {
         aml_append(scope, build_fdc_device_aml(fdc));
     }
-    aml_append(scope, build_lpt_device_aml());
+    build_lpt_device_aml(scope);
     build_com_device_aml(scope, 1);
     build_com_device_aml(scope, 2);
 
-- 
2.18.2



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

* [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml()
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 05/12] acpi: parallel: " Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:05   ` Igor Mammedov
  2020-04-06 10:22   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 07/12] acpi: move aml builder code for rtc device Gerd Hoffmann
                   ` (7 subsequent siblings)
  13 siblings, 2 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Also add isa_aml_build() function which walks all isa devices.
This allows to move aml builder code to isa devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/hw/isa/isa.h |  2 ++
 hw/i386/acpi-build.c |  1 +
 hw/isa/isa-bus.c     | 15 +++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index e9ac1f1205a4..1534f8826453 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -70,6 +70,7 @@ typedef struct IsaDmaClass {
 
 typedef struct ISADeviceClass {
     DeviceClass parent_class;
+    void (*build_aml)(ISADevice *dev, Aml *scope);
 } ISADeviceClass;
 
 struct ISABus {
@@ -108,6 +109,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *name);
 ISADevice *isa_create_simple(ISABus *bus, const char *name);
 
 ISADevice *isa_vga_init(ISABus *bus);
+void isa_build_aml(ISABus *bus, Aml *scope);
 
 /**
  * isa_register_ioport: Install an I/O port region on the ISA bus.
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5d2b9b099684..77fc9df74735 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1259,6 +1259,7 @@ static void build_isa_devices_aml(Aml *table)
         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);
     }
 
     aml_append(table, scope);
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 798dd9194e8f..1f2189f4d5db 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -207,6 +207,21 @@ ISADevice *isa_vga_init(ISABus *bus)
     }
 }
 
+void isa_build_aml(ISABus *bus, Aml *scope)
+{
+    BusChild *kid;
+    ISADevice *dev;
+    ISADeviceClass *dc;
+
+    QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) {
+        dev = ISA_DEVICE(kid->child);
+        dc = ISA_DEVICE_GET_CLASS(dev);
+        if (dc->build_aml) {
+            dc->build_aml(dev, scope);
+        }
+    }
+}
+
 static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
 {
     ISADevice *d = ISA_DEVICE(dev);
-- 
2.18.2



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

* [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml() Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:09   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 08/12] acpi: move aml builder code for serial device Gerd Hoffmann
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build.c | 17 -----------------
 hw/rtc/mc146818rtc.c | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 77fc9df74735..a5bc7764e611 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1131,22 +1131,6 @@ static Aml *build_fdc_device_aml(ISADevice *fdc)
     return dev;
 }
 
-static Aml *build_rtc_device_aml(void)
-{
-    Aml *dev;
-    Aml *crs;
-
-    dev = aml_device("RTC");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00")));
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
-    aml_append(crs, aml_irq_no_flags(8));
-    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    return dev;
-}
-
 static Aml *build_kbd_device_aml(void)
 {
     Aml *dev;
@@ -1243,7 +1227,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_rtc_device_aml());
     aml_append(scope, build_kbd_device_aml());
     aml_append(scope, build_mouse_device_aml());
     if (fdc) {
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index dc4269cc55cb..814263c01a90 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -27,6 +27,7 @@
 #include "qemu/cutils.h"
 #include "qemu/module.h"
 #include "qemu/bcd.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
 #include "qemu/timer.h"
@@ -1008,13 +1009,32 @@ static void rtc_resetdev(DeviceState *d)
     }
 }
 
+static void rtc_build_aml(ISADevice *isadev, Aml *scope)
+{
+    Aml *dev;
+    Aml *crs;
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
+    aml_append(crs, aml_irq_no_flags(8));
+    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));
+
+    dev = aml_device("RTC");
+    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00")));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+
+    aml_append(scope, dev);
+}
+
 static void rtc_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = rtc_realizefn;
     dc->reset = rtc_resetdev;
     dc->vmsd = &vmstate_rtc;
+    isa->build_aml = rtc_build_aml;
     device_class_set_props(dc, mc146818rtc_properties);
 }
 
-- 
2.18.2



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

* [PATCH v2 08/12] acpi: move aml builder code for serial device
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 07/12] acpi: move aml builder code for rtc device Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:10   ` Igor Mammedov
  2020-04-03  8:04 ` [PATCH v2 09/12] acpi: move aml builder code for parallel device Gerd Hoffmann
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

The code uses the isa_serial_io array to figure what the device uid is.
Side effect is that acpi antries are not limited to port 1+2 any more,
we'll also get entries for ports 3+4.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/char/serial-isa.c | 32 ++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c | 32 --------------------------------
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index f9b6eed7833d..f7c19a398ced 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -27,6 +27,7 @@
 #include "qapi/error.h"
 #include "qemu/module.h"
 #include "sysemu/sysemu.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
@@ -81,6 +82,35 @@ static void serial_isa_realizefn(DeviceState *dev, Error **errp)
     isa_register_ioport(isadev, &s->io, isa->iobase);
 }
 
+static void serial_isa_build_aml(ISADevice *isadev, Aml *scope)
+{
+    ISASerialState *isa = ISA_SERIAL(isadev);
+    int i, uid = 0;
+    Aml *dev;
+    Aml *crs;
+
+    for (i = 0; i < ARRAY_SIZE(isa_serial_io); i++) {
+        if (isa->iobase == isa_serial_io[i]) {
+            uid = i + 1;
+        }
+    }
+    if (!uid) {
+        return;
+    }
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, isa->iobase, isa->iobase, 0x00, 0x08));
+    aml_append(crs, aml_irq_no_flags(isa->isairq));
+
+    dev = aml_device("COM%d", uid);
+    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
+    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+
+    aml_append(scope, dev);
+}
+
 static const VMStateDescription vmstate_isa_serial = {
     .name = "serial",
     .version_id = 3,
@@ -103,9 +133,11 @@ static Property serial_isa_properties[] = {
 static void serial_isa_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = serial_isa_realizefn;
     dc->vmsd = &vmstate_isa_serial;
+    isa->build_aml = serial_isa_build_aml;
     device_class_set_props(dc, serial_isa_properties);
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a5bc7764e611..81805bf85f8d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1189,36 +1189,6 @@ static void build_lpt_device_aml(Aml *scope)
     aml_append(scope, dev);
 }
 
-static void build_com_device_aml(Aml *scope, uint8_t uid)
-{
-    Aml *dev;
-    Aml *crs;
-    uint8_t irq = 4;
-    uint16_t io_port = 0x03F8;
-
-    assert(uid == 1 || uid == 2);
-    if (uid == 2) {
-        irq = 3;
-        io_port = 0x02F8;
-    }
-    if (!memory_region_present(get_system_io(), io_port)) {
-        return;
-    }
-
-    dev = aml_device("COM%d", uid);
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
-    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08));
-    aml_append(crs, aml_irq_no_flags(irq));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    aml_append(scope, dev);
-}
-
 static void build_isa_devices_aml(Aml *table)
 {
     ISADevice *fdc = pc_find_fdc0();
@@ -1233,8 +1203,6 @@ static void build_isa_devices_aml(Aml *table)
         aml_append(scope, build_fdc_device_aml(fdc));
     }
     build_lpt_device_aml(scope);
-    build_com_device_aml(scope, 1);
-    build_com_device_aml(scope, 2);
 
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
-- 
2.18.2



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

* [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 08/12] acpi: move aml builder code for serial device Gerd Hoffmann
@ 2020-04-03  8:04 ` Gerd Hoffmann
  2020-04-03 10:12   ` Igor Mammedov
  2020-04-03  8:05 ` [PATCH v2 10/12] acpi: move aml builder code for floppy device Gerd Hoffmann
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/char/parallel.c   | 25 +++++++++++++++++++++++++
 hw/i386/acpi-build.c | 23 -----------------------
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 8dd67d13759b..2bff1f17fda7 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -28,6 +28,7 @@
 #include "qemu/module.h"
 #include "chardev/char-parallel.h"
 #include "chardev/char-fe.h"
+#include "hw/acpi/aml-build.h"
 #include "hw/irq.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
@@ -568,6 +569,28 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
                              s, "parallel");
 }
 
+static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
+{
+    ISAParallelState *isa = ISA_PARALLEL(isadev);
+    Aml *dev;
+    Aml *crs;
+
+    if (isa->iobase != 0x0378) {
+        return;
+    }
+
+    crs = aml_resource_template();
+    aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
+    aml_append(crs, aml_irq_no_flags(7));
+
+    dev = aml_device("LPT");
+    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
+    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+
+    aml_append(scope, dev);
+}
+
 /* Memory mapped interface */
 static uint64_t parallel_mm_readfn(void *opaque, hwaddr addr, unsigned size)
 {
@@ -624,9 +647,11 @@ static Property parallel_isa_properties[] = {
 static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
 
     dc->realize = parallel_isa_realizefn;
     dc->vmsd = &vmstate_parallel_isa;
+    isa->build_aml = parallel_isa_build_aml;
     device_class_set_props(dc, parallel_isa_properties);
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 81805bf85f8d..0539620ddff5 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1167,28 +1167,6 @@ static Aml *build_mouse_device_aml(void)
     return dev;
 }
 
-static void build_lpt_device_aml(Aml *scope)
-{
-    Aml *dev;
-    Aml *crs;
-
-    if (!memory_region_present(get_system_io(), 0x0378)) {
-        return;
-    }
-
-    dev = aml_device("LPT");
-    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
-
-    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
-
-    crs = aml_resource_template();
-    aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
-    aml_append(crs, aml_irq_no_flags(7));
-    aml_append(dev, aml_name_decl("_CRS", crs));
-
-    aml_append(scope, dev);
-}
-
 static void build_isa_devices_aml(Aml *table)
 {
     ISADevice *fdc = pc_find_fdc0();
@@ -1202,7 +1180,6 @@ static void build_isa_devices_aml(Aml *table)
     if (fdc) {
         aml_append(scope, build_fdc_device_aml(fdc));
     }
-    build_lpt_device_aml(scope);
 
     if (ambiguous) {
         error_report("Multiple ISA busses, unable to define IPMI ACPI data");
-- 
2.18.2



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

* [PATCH v2 10/12] acpi: move aml builder code for floppy device
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (8 preceding siblings ...)
  2020-04-03  8:04 ` [PATCH v2 09/12] acpi: move aml builder code for parallel device Gerd Hoffmann
@ 2020-04-03  8:05 ` Gerd Hoffmann
  2020-04-03  8:05 ` [PATCH v2 11/12] acpi: move aml builder code for i8042 (kbd+mouse) device Gerd Hoffmann
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/block/fdc.c       | 83 ++++++++++++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c | 83 --------------------------------------------
 stubs/cmos.c         |  7 ++++
 stubs/Makefile.objs  |  1 +
 4 files changed, 91 insertions(+), 83 deletions(-)
 create mode 100644 stubs/cmos.c

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 22e954e0dc2d..ebfc1d5ac400 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -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"
@@ -2789,6 +2791,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,
@@ -2822,11 +2903,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);
 }
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 0539620ddff5..be29422ede14 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1052,85 +1052,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;
@@ -1169,7 +1090,6 @@ static Aml *build_mouse_device_aml(void)
 
 static void build_isa_devices_aml(Aml *table)
 {
-    ISADevice *fdc = pc_find_fdc0();
     bool ambiguous;
 
     Aml *scope = aml_scope("_SB.PCI0.ISA");
@@ -1177,9 +1097,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");
diff --git a/stubs/cmos.c b/stubs/cmos.c
new file mode 100644
index 000000000000..416cbe4055ff
--- /dev/null
+++ b/stubs/cmos.c
@@ -0,0 +1,7 @@
+#include "qemu/osdep.h"
+#include "hw/i386/pc.h"
+
+int cmos_get_fd_drive_type(FloppyDriveType fd0)
+{
+    return 0;
+}
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 45be5dc0ed78..3cbe472d1c6c 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -3,6 +3,7 @@ stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
 stub-obj-y += blockdev-close-all-bdrv-states.o
 stub-obj-y += clock-warp.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
-- 
2.18.2



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

* [PATCH v2 11/12] acpi: move aml builder code for i8042 (kbd+mouse) device
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (9 preceding siblings ...)
  2020-04-03  8:05 ` [PATCH v2 10/12] acpi: move aml builder code for floppy device Gerd Hoffmann
@ 2020-04-03  8:05 ` Gerd Hoffmann
  2020-04-03  8:05 ` [PATCH v2 12/12] acpi: factor out fw_cfg_add_acpi_dsdt() Gerd Hoffmann
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build.c | 39 ---------------------------------------
 hw/input/pckbd.c     | 31 +++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 39 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index be29422ede14..23817d9005cc 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1052,42 +1052,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 void build_isa_devices_aml(Aml *table)
 {
     bool ambiguous;
@@ -1095,9 +1059,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) {
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 60a41303203a..29d633ca9478 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -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);
 }
 
-- 
2.18.2



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

* [PATCH v2 12/12] acpi: factor out fw_cfg_add_acpi_dsdt()
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (10 preceding siblings ...)
  2020-04-03  8:05 ` [PATCH v2 11/12] acpi: move aml builder code for i8042 (kbd+mouse) device Gerd Hoffmann
@ 2020-04-03  8:05 ` Gerd Hoffmann
  2020-04-03  8:50 ` [PATCH v2 00/12] acpi: i386 tweaks no-reply
  2020-04-03  9:09 ` no-reply
  13 siblings, 0 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-03  8:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	Max Reitz, Paolo Bonzini, Gerd Hoffmann, Marc-André Lureau,
	Igor Mammedov, John Snow, Richard Henderson

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

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 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(-)

diff --git a/hw/i386/fw_cfg.h b/hw/i386/fw_cfg.h
index 9e742787792b..275f15c1c5e8 100644
--- a/hw/i386/fw_cfg.h
+++ b/hw/i386/fw_cfg.h
@@ -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
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 23817d9005cc..55ece91655cf 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1874,30 +1874,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);
     }
 
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index da60ada59462..c55abfb01abb 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -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);
+}
-- 
2.18.2



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

* Re: [PATCH v2 00/12] acpi: i386 tweaks
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (11 preceding siblings ...)
  2020-04-03  8:05 ` [PATCH v2 12/12] acpi: factor out fw_cfg_add_acpi_dsdt() Gerd Hoffmann
@ 2020-04-03  8:50 ` no-reply
  2020-04-03  9:09 ` no-reply
  13 siblings, 0 replies; 37+ messages in thread
From: no-reply @ 2020-04-03  8:50 UTC (permalink / raw)
  To: kraxel
  Cc: kwolf, ehabkost, qemu-block, mst, qemu-devel, mreitz, imammedo,
	kraxel, marcandre.lureau, pbonzini, jsnow, rth

Patchew URL: https://patchew.org/QEMU/20200403080502.8154-1-kraxel@redhat.com/



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 ===

PASS 1 fdc-test /x86_64/fdc/cmos
PASS 2 fdc-test /x86_64/fdc/no_media_on_start
PASS 3 fdc-test /x86_64/fdc/read_without_media
==11652==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 fdc-test /x86_64/fdc/media_change
PASS 5 fdc-test /x86_64/fdc/sense_interrupt
PASS 1 test-qmp-cmds /qmp/dispatch_cmd
---
PASS 32 test-opts-visitor /visitor/opts/range/beyond
PASS 33 test-opts-visitor /visitor/opts/dict/unvisited
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-coroutine -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-coroutine" 
==11687==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==11687==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffc3f2e000; bottom 0x7fdd32f20000; size: 0x00229100e000 (148461641728)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-coroutine /basic/no-dangling-access
---
PASS 12 test-aio /aio/event/flush
PASS 13 test-aio /aio/event/wait/no-flush-cb
PASS 11 fdc-test /x86_64/fdc/read_no_dma_18
==11702==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-aio /aio/timer/schedule
PASS 15 test-aio /aio/coroutine/queue-chaining
PASS 16 test-aio /aio-gsource/flush
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-aio-multithread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-aio-multithread" 
PASS 13 fdc-test /x86_64/fdc/fuzz-registers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/ide-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ide-test" 
==11707==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-aio-multithread /aio/multi/lifecycle
==11724==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ide-test /x86_64/ide/identify
PASS 2 test-aio-multithread /aio/multi/schedule
==11730==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ide-test /x86_64/ide/flush
PASS 3 test-aio-multithread /aio/multi/mutex/contended
==11741==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 ide-test /x86_64/ide/bmdma/simple_rw
==11752==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 ide-test /x86_64/ide/bmdma/trim
==11758==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 test-aio-multithread /aio/multi/mutex/handoff
PASS 5 test-aio-multithread /aio/multi/mutex/mcs
PASS 6 test-aio-multithread /aio/multi/mutex/pthread
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-throttle -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-throttle" 
==11775==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-throttle /throttle/leak_bucket
PASS 2 test-throttle /throttle/compute_wait
PASS 3 test-throttle /throttle/init
---
PASS 14 test-throttle /throttle/config/max
PASS 15 test-throttle /throttle/config/iops_size
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-thread-pool -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-thread-pool" 
==11779==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-thread-pool /thread-pool/submit
PASS 2 test-thread-pool /thread-pool/submit-aio
PASS 3 test-thread-pool /thread-pool/submit-co
PASS 4 test-thread-pool /thread-pool/submit-many
==11846==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 test-thread-pool /thread-pool/cancel
PASS 6 test-thread-pool /thread-pool/cancel-async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-hbitmap -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-hbitmap" 
---
PASS 15 test-hbitmap /hbitmap/set/overlap
PASS 16 test-hbitmap /hbitmap/reset/empty
PASS 17 test-hbitmap /hbitmap/reset/general
==11856==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 18 test-hbitmap /hbitmap/reset/all
PASS 19 test-hbitmap /hbitmap/truncate/nop
PASS 20 test-hbitmap /hbitmap/truncate/grow/negligible
---
PASS 39 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_4
PASS 40 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_after_truncate
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-drain -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-drain" 
==11863==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-drain /bdrv-drain/nested
PASS 2 test-bdrv-drain /bdrv-drain/multiparent
PASS 3 test-bdrv-drain /bdrv-drain/set_aio_context
---
PASS 41 test-bdrv-drain /bdrv-drain/bdrv_drop_intermediate/poll
PASS 42 test-bdrv-drain /bdrv-drain/replace_child/mid-drain
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-graph-mod -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-graph-mod" 
==11902==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-graph-mod /bdrv-graph-mod/update-perm-tree
PASS 2 test-bdrv-graph-mod /bdrv-graph-mod/should-update-child
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob" 
==11906==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob /blockjob/ids
PASS 2 test-blockjob /blockjob/cancel/created
PASS 3 test-blockjob /blockjob/cancel/running
---
PASS 7 test-blockjob /blockjob/cancel/pending
PASS 8 test-blockjob /blockjob/cancel/concluded
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob-txn -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob-txn" 
==11910==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob-txn /single/success
PASS 2 test-blockjob-txn /single/failure
PASS 3 test-blockjob-txn /single/cancel
---
PASS 6 test-blockjob-txn /pair/cancel
PASS 7 test-blockjob-txn /pair/fail-cancel-race
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-backend -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-backend" 
==11914==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-backend /block-backend/drain_aio_error
PASS 2 test-block-backend /block-backend/drain_all_aio_error
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-iothread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-iothread" 
==11918==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-iothread /sync-op/pread
PASS 2 test-block-iothread /sync-op/pwrite
PASS 3 test-block-iothread /sync-op/load_vmstate
---
PASS 15 test-block-iothread /propagate/diamond
PASS 16 test-block-iothread /propagate/mirror
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-image-locking -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-image-locking" 
==11940==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-image-locking /image-locking/basic
PASS 2 test-image-locking /image-locking/set-perm-abort
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-x86-cpuid -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-x86-cpuid" 
==11920==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-x86-cpuid /cpuid/topology/basic
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-xbzrle -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-xbzrle" 
PASS 1 test-xbzrle /xbzrle/uleb
---
PASS 2 rcutorture /rcu/torture/10readers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-list -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-list" 
PASS 1 test-rcu-list /rcu/qlist/single-threaded
==12002==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-rcu-list /rcu/qlist/short-few
PASS 3 test-rcu-list /rcu/qlist/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-simpleq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-simpleq" 
PASS 1 test-rcu-simpleq /rcu/qsimpleq/single-threaded
PASS 2 test-rcu-simpleq /rcu/qsimpleq/short-few
==12068==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-rcu-simpleq /rcu/qsimpleq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-tailq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-tailq" 
PASS 1 test-rcu-tailq /rcu/qtailq/single-threaded
---
PASS 3 test-rcu-tailq /rcu/qtailq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-slist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-slist" 
PASS 1 test-rcu-slist /rcu/qslist/single-threaded
==12113==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-rcu-slist /rcu/qslist/short-few
PASS 3 test-rcu-slist /rcu/qslist/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qdist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qdist" 
---
PASS 7 test-qdist /qdist/binning/expand
PASS 8 test-qdist /qdist/binning/shrink
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht" 
==12153==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12159==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 ide-test /x86_64/ide/bmdma/various_prdts
==12165==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12165==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffff1a9d000; bottom 0x7f968ad56000; size: 0x006966d47000 (452696764416)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 6 ide-test /x86_64/ide/bmdma/no_busmaster
---
PASS 2 test-qht /qht/mode/resize
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht-par -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht-par" 
PASS 7 ide-test /x86_64/ide/flush/nodev
==12179==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 ide-test /x86_64/ide/flush/empty_drive
PASS 1 test-qht-par /qht/parallel/2threads-0%updates-1s
==12190==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 ide-test /x86_64/ide/flush/retry_pci
PASS 2 test-qht-par /qht/parallel/2threads-20%updates-1s
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bitops -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bitops" 
==12202==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bitops /bitops/sextract32
PASS 2 test-bitops /bitops/sextract64
PASS 3 test-bitops /bitops/half_shuffle32
---
PASS 1 check-qom-interface /qom/interface/direct_impl
PASS 2 check-qom-interface /qom/interface/intermediate_impl
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/check-qom-proplist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="check-qom-proplist" 
==12214==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 check-qom-proplist /qom/proplist/createlist
PASS 2 check-qom-proplist /qom/proplist/createv
PASS 3 check-qom-proplist /qom/proplist/createcmdline
---
PASS 4 test-write-threshold /write-threshold/not-trigger
PASS 5 test-write-threshold /write-threshold/trigger
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-hash -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-hash" 
==12245==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-hash /crypto/hash/iov
PASS 2 test-crypto-hash /crypto/hash/alloc
PASS 3 test-crypto-hash /crypto/hash/prealloc
---
PASS 16 test-crypto-secret /crypto/secret/crypt/badiv
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlscredsx509 -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlscredsx509" 
PASS 12 ide-test /x86_64/ide/cdrom/pio_large
==12280==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 ide-test /x86_64/ide/cdrom/dma
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/ahci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ahci-test" 
PASS 1 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectserver
PASS 2 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectclient
PASS 3 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca1
==12294==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ahci-test /x86_64/ahci/sanity
PASS 4 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca2
PASS 5 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca3
PASS 6 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca1
PASS 7 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca2
PASS 8 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca3
==12300==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver1
PASS 2 ahci-test /x86_64/ahci/pci_spec
==12306==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver2
PASS 3 ahci-test /x86_64/ahci/pci_enable
PASS 11 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver3
==12312==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver4
PASS 4 ahci-test /x86_64/ahci/hba_spec
==12318==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver5
PASS 14 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver6
PASS 5 ahci-test /x86_64/ahci/hba_enable
==12324==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver7
PASS 16 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badserver1
PASS 17 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badserver2
---
PASS 33 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive2
PASS 34 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive3
PASS 6 ahci-test /x86_64/ahci/identify
==12330==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 35 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain1
PASS 36 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain2
PASS 37 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingca
---
PASS 39 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingclient
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlssession -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlssession" 
PASS 7 ahci-test /x86_64/ahci/max
==12339==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-tlssession /qcrypto/tlssession/psk
PASS 8 ahci-test /x86_64/ahci/reset
==12346==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-crypto-tlssession /qcrypto/tlssession/basicca
==12346==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd30c71000; bottom 0x7f000a7fe000; size: 0x00fd26473000 (1087268925440)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 3 test-crypto-tlssession /qcrypto/tlssession/differentca
PASS 9 ahci-test /x86_64/ahci/io/pio/lba28/simple/zero
==12352==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12352==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffdf4801000; bottom 0x7fc8ba3fe000; size: 0x00353a403000 (228610551808)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 10 ahci-test /x86_64/ahci/io/pio/lba28/simple/low
==12358==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 test-crypto-tlssession /qcrypto/tlssession/altname1
==12358==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff6d716000; bottom 0x7f418c9fe000; size: 0x00bde0d18000 (815520645120)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 11 ahci-test /x86_64/ahci/io/pio/lba28/simple/high
PASS 5 test-crypto-tlssession /qcrypto/tlssession/altname2
PASS 6 test-crypto-tlssession /qcrypto/tlssession/altname3
==12364==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12364==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff87650000; bottom 0x7fe900ffe000; size: 0x001686652000 (96744054784)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 12 ahci-test /x86_64/ahci/io/pio/lba28/double/zero
PASS 7 test-crypto-tlssession /qcrypto/tlssession/altname4
==12370==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12370==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd2229e000; bottom 0x7f9b8b7fe000; size: 0x006196aa0000 (419139551232)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 13 ahci-test /x86_64/ahci/io/pio/lba28/double/low
PASS 8 test-crypto-tlssession /qcrypto/tlssession/altname5
PASS 9 test-crypto-tlssession /qcrypto/tlssession/altname6
PASS 10 test-crypto-tlssession /qcrypto/tlssession/wildcard1
==12376==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12376==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffebb442000; bottom 0x7fa5e81fe000; size: 0x0058d3244000 (381499490304)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 14 ahci-test /x86_64/ahci/io/pio/lba28/double/high
PASS 11 test-crypto-tlssession /qcrypto/tlssession/wildcard2
==12382==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12382==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff14c11000; bottom 0x7eff51f7c000; size: 0x00ffc2c95000 (1098484633600)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 15 ahci-test /x86_64/ahci/io/pio/lba28/long/zero
PASS 12 test-crypto-tlssession /qcrypto/tlssession/wildcard3
PASS 13 test-crypto-tlssession /qcrypto/tlssession/wildcard4
PASS 14 test-crypto-tlssession /qcrypto/tlssession/wildcard5
==12388==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 test-crypto-tlssession /qcrypto/tlssession/wildcard6
==12388==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc7bbec000; bottom 0x7f486cf7c000; size: 0x00b40ec70000 (773342035968)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 16 ahci-test /x86_64/ahci/io/pio/lba28/long/low
PASS 16 test-crypto-tlssession /qcrypto/tlssession/cachain
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qga -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qga" 
==12394==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12394==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff706a3000; bottom 0x7fd7b977c000; size: 0x0027b6f27000 (170573066240)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 17 ahci-test /x86_64/ahci/io/pio/lba28/long/high
---
PASS 15 test-qga /qga/invalid-cmd
PASS 16 test-qga /qga/invalid-args
PASS 17 test-qga /qga/fsfreeze-status
==12408==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 18 ahci-test /x86_64/ahci/io/pio/lba28/short/zero
PASS 18 test-qga /qga/blacklist
==12417==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 19 test-qga /qga/config
PASS 20 test-qga /qga/guest-exec
PASS 21 test-qga /qga/guest-exec-invalid
PASS 19 ahci-test /x86_64/ahci/io/pio/lba28/short/low
==12435==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 22 test-qga /qga/guest-get-osinfo
PASS 23 test-qga /qga/guest-get-host-name
PASS 24 test-qga /qga/guest-get-timezone
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-util-filemonitor -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-util-filemonitor" 
PASS 1 test-util-filemonitor /util/filemonitor
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-util-sockets -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-util-sockets" 
==12445==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12445==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd5429c000; bottom 0x7fbd1cffe000; size: 0x00403729e000 (275803398144)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-util-sockets /util/socket/is-socket/bad
---
PASS 5 test-authz-list /auth/list/explicit/deny
PASS 6 test-authz-list /auth/list/explicit/allow
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-authz-listfile -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-authz-listfile" 
==12465==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-authz-listfile /auth/list/complex
PASS 2 test-authz-listfile /auth/list/default/deny
PASS 3 test-authz-listfile /auth/list/default/allow
PASS 4 test-authz-listfile /auth/list/explicit/deny
PASS 5 test-authz-listfile /auth/list/explicit/allow
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-task -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-task" 
==12465==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff80eb6000; bottom 0x7f52235fe000; size: 0x00ad5d8b8000 (744598765568)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 22 ahci-test /x86_64/ahci/io/pio/lba48/simple/low
---
PASS 8 test-io-channel-socket /io/channel/socket/unix-fd-pass
PASS 9 test-io-channel-socket /io/channel/socket/unix-listen-cleanup
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-file -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-file" 
==12485==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-file /io/channel/file
PASS 2 test-io-channel-file /io/channel/file/rdwr
PASS 3 test-io-channel-file /io/channel/file/fd
PASS 4 test-io-channel-file /io/channel/pipe/sync
PASS 5 test-io-channel-file /io/channel/pipe/async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-tls -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-tls" 
==12485==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff18a41000; bottom 0x7f8636dfe000; size: 0x0078e1c43000 (519183806464)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 23 ahci-test /x86_64/ahci/io/pio/lba48/simple/high
---
PASS 3 test-io-channel-command /io/channel/command/echo/sync
PASS 4 test-io-channel-command /io/channel/command/echo/async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-buffer -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-buffer" 
==12543==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-buffer /io/channel/buf
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-base64 -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-base64" 
==12543==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff685f0000; bottom 0x7f88099fe000; size: 0x00775ebf2000 (512690692096)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 24 ahci-test /x86_64/ahci/io/pio/lba48/double/zero
---
PASS 8 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c
PASS 9 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c5b6a7988
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-afsplit -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-afsplit" 
==12564==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-afsplit /crypto/afsplit/sha256/5
PASS 2 test-crypto-afsplit /crypto/afsplit/sha256/5000
PASS 3 test-crypto-afsplit /crypto/afsplit/sha256/big
PASS 4 test-crypto-afsplit /crypto/afsplit/sha1/1000
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-xts -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-xts" 
==12564==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffdd60fe000; bottom 0x7f78ad7fe000; size: 0x008528900000 (571911176192)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 25 ahci-test /x86_64/ahci/io/pio/lba48/double/low
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-block -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-block" 
PASS 1 test-crypto-block /crypto/block/qcow
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-logging -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-logging" 
==12586==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-logging /logging/parse_range
PASS 2 test-logging /logging/parse_path
PASS 3 test-logging /logging/logfile_write_path
PASS 4 test-logging /logging/logfile_lock_path
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-replication -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-replication" 
==12586==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff13972000; bottom 0x7fec627fe000; size: 0x0012b1174000 (80280502272)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 26 ahci-test /x86_64/ahci/io/pio/lba48/double/high
==12601==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12603==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-replication /replication/primary/read
==12603==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc151bf000; bottom 0x7f843a3fe000; size: 0x0077dadc1000 (514772963328)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 2 test-replication /replication/primary/write
---
PASS 5 test-replication /replication/primary/do_checkpoint
PASS 6 test-replication /replication/primary/get_error_all
PASS 7 test-replication /replication/secondary/read
==12611==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12611==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffef31c0000; bottom 0x7f9c4ddfe000; size: 0x0062a53c2000 (423678976000)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 8 test-replication /replication/secondary/write
PASS 28 ahci-test /x86_64/ahci/io/pio/lba48/long/low
==12617==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12617==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffdaec31000; bottom 0x7efbfd924000; size: 0x0101b130d000 (1106779361280)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 29 ahci-test /x86_64/ahci/io/pio/lba48/long/high
==12624==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12601==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffde028000; bottom 0x7f48fc523000; size: 0x00b6e1b05000 (785470476288)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 30 ahci-test /x86_64/ahci/io/pio/lba48/short/zero
PASS 9 test-replication /replication/secondary/start
==12651==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 31 ahci-test /x86_64/ahci/io/pio/lba48/short/low
==12657==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 32 ahci-test /x86_64/ahci/io/pio/lba48/short/high
==12663==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-replication /replication/secondary/stop
PASS 33 ahci-test /x86_64/ahci/io/dma/lba28/fragmented
==12669==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 34 ahci-test /x86_64/ahci/io/dma/lba28/retry
==12675==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 35 ahci-test /x86_64/ahci/io/dma/lba28/simple/zero
==12681==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 test-replication /replication/secondary/continuous_replication
PASS 36 ahci-test /x86_64/ahci/io/dma/lba28/simple/low
==12687==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 37 ahci-test /x86_64/ahci/io/dma/lba28/simple/high
==12693==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 38 ahci-test /x86_64/ahci/io/dma/lba28/double/zero
==12699==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 test-replication /replication/secondary/do_checkpoint
PASS 39 ahci-test /x86_64/ahci/io/dma/lba28/double/low
==12705==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 test-replication /replication/secondary/get_error_all
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bufferiszero -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bufferiszero" 
PASS 40 ahci-test /x86_64/ahci/io/dma/lba28/double/high
==12714==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12714==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc17b2d000; bottom 0x7f0cdcdfd000; size: 0x00ef3ad30000 (1027484090368)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 41 ahci-test /x86_64/ahci/io/dma/lba28/long/zero
==12721==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12721==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffdc8b0b000; bottom 0x7f1df8dfd000; size: 0x00dfcfd0e000 (961264279552)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 42 ahci-test /x86_64/ahci/io/dma/lba28/long/low
==12728==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12728==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe2e962000; bottom 0x7f61bfb23000; size: 0x009c6ee3f000 (671875330048)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 43 ahci-test /x86_64/ahci/io/dma/lba28/long/high
==12735==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 44 ahci-test /x86_64/ahci/io/dma/lba28/short/zero
==12741==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 45 ahci-test /x86_64/ahci/io/dma/lba28/short/low
==12747==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 46 ahci-test /x86_64/ahci/io/dma/lba28/short/high
==12753==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 47 ahci-test /x86_64/ahci/io/dma/lba48/simple/zero
==12759==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 48 ahci-test /x86_64/ahci/io/dma/lba48/simple/low
==12765==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 49 ahci-test /x86_64/ahci/io/dma/lba48/simple/high
==12771==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 50 ahci-test /x86_64/ahci/io/dma/lba48/double/zero
==12777==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 51 ahci-test /x86_64/ahci/io/dma/lba48/double/low
==12783==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 52 ahci-test /x86_64/ahci/io/dma/lba48/double/high
==12789==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12789==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff96ba0000; bottom 0x7f9d547fd000; size: 0x0062423a3000 (422017904640)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 53 ahci-test /x86_64/ahci/io/dma/lba48/long/zero
==12796==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12796==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff4e69a000; bottom 0x7fcfd29fd000; size: 0x002f7bc9d000 (203940286464)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 54 ahci-test /x86_64/ahci/io/dma/lba48/long/low
==12803==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12803==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffc4988000; bottom 0x7ff168bfd000; size: 0x000e5bd8b000 (61670469632)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 55 ahci-test /x86_64/ahci/io/dma/lba48/long/high
==12810==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 56 ahci-test /x86_64/ahci/io/dma/lba48/short/zero
==12816==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 57 ahci-test /x86_64/ahci/io/dma/lba48/short/low
==12822==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 58 ahci-test /x86_64/ahci/io/dma/lba48/short/high
==12828==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 59 ahci-test /x86_64/ahci/io/ncq/simple
==12834==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 60 ahci-test /x86_64/ahci/io/ncq/retry
==12840==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 61 ahci-test /x86_64/ahci/flush/simple
==12846==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 62 ahci-test /x86_64/ahci/flush/retry
==12852==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12858==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 63 ahci-test /x86_64/ahci/flush/migrate
==12866==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12872==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 64 ahci-test /x86_64/ahci/migrate/sanity
==12880==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bufferiszero /cutils/bufferiszero
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-uuid -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-uuid" 
==12886==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-uuid /uuid/is_null
PASS 2 test-uuid /uuid/generate
PASS 3 test-uuid /uuid/parse
---
PASS 22 test-qgraph /qgraph/test_test_in_path
PASS 23 test-qgraph /qgraph/test_double_edge
PASS 65 ahci-test /x86_64/ahci/migrate/dma/simple
==12907==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12913==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 66 ahci-test /x86_64/ahci/migrate/dma/halted
==12921==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12927==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 67 ahci-test /x86_64/ahci/migrate/ncq/simple
==12935==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12941==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 68 ahci-test /x86_64/ahci/migrate/ncq/halted
==12949==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 69 ahci-test /x86_64/ahci/cdrom/eject
==12954==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 70 ahci-test /x86_64/ahci/cdrom/dma/single
==12960==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 71 ahci-test /x86_64/ahci/cdrom/dma/multi
==12966==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 72 ahci-test /x86_64/ahci/cdrom/pio/single
==12972==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==12972==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe66af8000; bottom 0x7f7bd8dfe000; size: 0x00828dcfa000 (560724942848)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 73 ahci-test /x86_64/ahci/cdrom/pio/multi
==12978==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 74 ahci-test /x86_64/ahci/cdrom/pio/bcl
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/hd-geo-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="hd-geo-test" 
PASS 1 hd-geo-test /x86_64/hd-geo/ide/none
==12992==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 hd-geo-test /x86_64/hd-geo/ide/drive/cd_0
==12998==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/blank
==13004==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/lba
==13010==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/chs
==13016==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 hd-geo-test /x86_64/hd-geo/ide/device/mbr/blank
==13022==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 hd-geo-test /x86_64/hd-geo/ide/device/mbr/lba
==13028==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 hd-geo-test /x86_64/hd-geo/ide/device/mbr/chs
==13034==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 hd-geo-test /x86_64/hd-geo/ide/device/user/chs
==13039==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 hd-geo-test /x86_64/hd-geo/ide/device/user/chst
==13045==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13049==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13053==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13057==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13061==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13065==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13069==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13073==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13076==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 hd-geo-test /x86_64/hd-geo/override/ide
==13083==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13087==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13091==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13095==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13099==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13103==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13107==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13111==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13114==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 hd-geo-test /x86_64/hd-geo/override/scsi
==13121==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13125==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13129==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13133==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13137==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13141==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13145==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13149==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13152==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 hd-geo-test /x86_64/hd-geo/override/scsi_2_controllers
==13159==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13163==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13167==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13171==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13174==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 hd-geo-test /x86_64/hd-geo/override/virtio_blk
==13181==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13185==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13188==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 hd-geo-test /x86_64/hd-geo/override/zero_chs
==13195==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13199==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13203==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13207==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13210==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 16 hd-geo-test /x86_64/hd-geo/override/scsi_hot_unplug
==13217==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13221==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13225==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13229==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==13232==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 17 hd-geo-test /x86_64/hd-geo/override/virtio_hot_unplug
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/boot-order-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="boot-order-test" 
PASS 1 boot-order-test /x86_64/boot-order/pc
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==13301==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP'
Using expected file 'tests/data/acpi/pc/FACP'
---
acpi-test: Warning! DSDT binary file mismatch. Actual [aml:/tmp/aml-7WMII0], Expected [aml:tests/data/acpi/pc/DSDT].
See source file tests/qtest/bios-tables-test.c for instructions on how to update expected files.
to see ASL diff between mismatched files install IASL, rebuild QEMU from scratch and re-run tests with V=1 environment variable set**
ERROR:/tmp/qemu-test/src/tests/qtest/bios-tables-test.c:491:test_acpi_asl: assertion failed: (all_tables_match)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/bios-tables-test.c:491:test_acpi_asl: assertion failed: (all_tables_match)
make: *** [/tmp/qemu-test/src/tests/Makefile.include:636: check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=036e898023984560812eb9af35205960', '-u', '1003', '--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/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-7ubue34x/src/docker-src.2020-04-03-04.18.55.20375:/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=036e898023984560812eb9af35205960
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-7ubue34x/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    31m53.775s
user    0m8.355s


The full log is available at
http://patchew.org/logs/20200403080502.8154-1-kraxel@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 00/12] acpi: i386 tweaks
  2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
                   ` (12 preceding siblings ...)
  2020-04-03  8:50 ` [PATCH v2 00/12] acpi: i386 tweaks no-reply
@ 2020-04-03  9:09 ` no-reply
  13 siblings, 0 replies; 37+ messages in thread
From: no-reply @ 2020-04-03  9:09 UTC (permalink / raw)
  To: kraxel
  Cc: kwolf, ehabkost, qemu-block, mst, qemu-devel, mreitz, imammedo,
	kraxel, marcandre.lureau, pbonzini, jsnow, rth

Patchew URL: https://patchew.org/QEMU/20200403080502.8154-1-kraxel@redhat.com/



Hi,

This series failed the docker-quick@centos7 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
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

acpi-test: Warning! DSDT binary file mismatch. Actual [aml:/tmp/aml-7EHOI0], Expected [aml:tests/data/acpi/pc/DSDT].
See source file tests/qtest/bios-tables-test.c for instructions on how to update expected files.
to see ASL diff between mismatched files install IASL, rebuild QEMU from scratch and re-run tests with V=1 environment variable set**
ERROR:/tmp/qemu-test/src/tests/qtest/bios-tables-test.c:491:test_acpi_asl: assertion failed: (all_tables_match)
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/bios-tables-test.c:491:test_acpi_asl: assertion failed: (all_tables_match)
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
  TEST    check-unit: tests/test-hbitmap
  TEST    check-unit: tests/test-bdrv-drain
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=7ad1463a86c84fb38c3d0568f5c3e7b2', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-42gd2goo/src/docker-src.2020-04-03-04.53.13.5125:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=7ad1463a86c84fb38c3d0568f5c3e7b2
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-42gd2goo/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    16m29.214s
user    0m8.846s


The full log is available at
http://patchew.org/logs/20200403080502.8154-1-kraxel@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h
  2020-04-03  8:04 ` [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h Gerd Hoffmann
@ 2020-04-03  9:41   ` Igor Mammedov
  0 siblings, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03  9:41 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:51 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  include/hw/acpi/aml-build.h | 1 -
>  include/qemu/typedefs.h     | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index de4a4065682c..1bfe5844e984 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -32,7 +32,6 @@ struct Aml {
>      uint8_t op;
>      AmlBlockFlags block_flags;
>  };
> -typedef struct Aml Aml;
>  
>  typedef enum {
>      AML_COMPATIBILITY = 0,
> diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
> index 375770a80f06..ecf3cde26c3c 100644
> --- a/include/qemu/typedefs.h
> +++ b/include/qemu/typedefs.h
> @@ -24,6 +24,7 @@
>  typedef struct AdapterInfo AdapterInfo;
>  typedef struct AddressSpace AddressSpace;
>  typedef struct AioContext AioContext;
> +typedef struct Aml Aml;
>  typedef struct AnnounceTimer AnnounceTimer;
>  typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
>  typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter;



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

* Re: [PATCH v2 02/12] acpi: add aml builder stubs
  2020-04-03  8:04 ` [PATCH v2 02/12] acpi: add aml builder stubs Gerd Hoffmann
@ 2020-04-03  9:43   ` Igor Mammedov
  0 siblings, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03  9:43 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:52 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Needed when moving aml builder code to devices.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/aml-build-stub.c | 79 ++++++++++++++++++++++++++++++++++++++++
>  hw/acpi/Makefile.objs    |  4 +-
>  2 files changed, 81 insertions(+), 2 deletions(-)
>  create mode 100644 hw/acpi/aml-build-stub.c
> 
> diff --git a/hw/acpi/aml-build-stub.c b/hw/acpi/aml-build-stub.c
> new file mode 100644
> index 000000000000..58b2e162277f
> --- /dev/null
> +++ b/hw/acpi/aml-build-stub.c
> @@ -0,0 +1,79 @@
> +/*
> + * ACPI aml builder stubs for platforms that don't support ACPI.
> + *
> + * Copyright (c) 2006 Fabrice Bellard
> + * Copyright (c) 2016 Red Hat, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include "qemu/osdep.h"
> +#include "hw/acpi/acpi.h"
> +#include "hw/acpi/aml-build.h"
> +
> +void aml_append(Aml *parent_ctx, Aml *child)
> +{
> +}
> +
> +Aml *aml_resource_template(void)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_device(const char *name_format, ...)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_eisaid(const char *str)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_name_decl(const char *name, Aml *val)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
> +            uint8_t aln, uint8_t len)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_irq_no_flags(uint8_t irq)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_int(const uint64_t val)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_package(uint8_t num_elements)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_dma(AmlDmaType typ, AmlDmaBusMaster bm, AmlTransferSize sz,
> +             uint8_t channel)
> +{
> +    return NULL;
> +}
> +
> +Aml *aml_buffer(int buffer_size, uint8_t *byte_list)
> +{
> +    return NULL;
> +}
> diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
> index 777da07f4d70..cab9bcd457dc 100644
> --- a/hw/acpi/Makefile.objs
> +++ b/hw/acpi/Makefile.objs
> @@ -20,6 +20,6 @@ common-obj-$(CONFIG_TPM) += tpm.o
>  common-obj-$(CONFIG_IPMI) += ipmi.o
>  common-obj-$(call lnot,$(CONFIG_IPMI)) += ipmi-stub.o
>  else
> -common-obj-y += acpi-stub.o
> +common-obj-y += acpi-stub.o aml-build-stub.o
>  endif
> -common-obj-$(CONFIG_ALL) += acpi-stub.o acpi-x86-stub.o ipmi-stub.o
> +common-obj-$(CONFIG_ALL) += acpi-stub.o aml-build-stub.o acpi-x86-stub.o ipmi-stub.o



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

* Re: [PATCH v2 03/12] acpi: drop pointless _STA method
  2020-04-03  8:04 ` [PATCH v2 03/12] acpi: drop pointless _STA method Gerd Hoffmann
@ 2020-04-03  9:45   ` Igor Mammedov
  0 siblings, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03  9:45 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:53 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> When returning a constant there is no point in having a method
> in the first place, _STA can be a simple integer instead.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/i386/acpi-build.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 9a19c14e661b..214b98671bf2 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1151,14 +1151,11 @@ static Aml *build_kbd_device_aml(void)
>  {
>      Aml *dev;
>      Aml *crs;
> -    Aml *method;
>  
>      dev = aml_device("KBD");
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303")));
>  
> -    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> -    aml_append(method, aml_return(aml_int(0x0f)));
> -    aml_append(dev, method);
> +    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));
> @@ -1173,14 +1170,11 @@ static Aml *build_mouse_device_aml(void)
>  {
>      Aml *dev;
>      Aml *crs;
> -    Aml *method;
>  
>      dev = aml_device("MOU");
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
>  
> -    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> -    aml_append(method, aml_return(aml_int(0x0f)));
> -    aml_append(dev, method);
> +    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>  
>      crs = aml_resource_template();
>      aml_append(crs, aml_irq_no_flags(12));
> @@ -2238,9 +2232,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>                                             TPM_CRB_ADDR_SIZE, AML_READ_WRITE));
>          aml_append(dev, aml_name_decl("_CRS", crs));
>  
> -        method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> -        aml_append(method, aml_return(aml_int(0x0f)));
> -        aml_append(dev, method);
> +        aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>  
>          tpm_build_ppi_acpi(tpm, dev);
>  



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

* Re: [PATCH v2 04/12] acpi: serial: don't use _STA method
  2020-04-03  8:04 ` [PATCH v2 04/12] acpi: serial: don't use " Gerd Hoffmann
@ 2020-04-03 10:00   ` Igor Mammedov
  2020-04-06 10:20     ` Gerd Hoffmann
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:00 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:54 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> The _STA method dates back to the days where we had a static DSDT.  The
> device is listed in the DSDT table unconditionally and the _STA method
> checks a bit in the isa bridge pci config space to figure whenever a
> given is isa device is present or not, then evaluates to 0x0f (present)
> or 0x00 (absent).
> 
> These days the DSDT is generated by qemu anyway, so if a device is not
> present we can simply drop it from the DSDT instead.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
I'd drop this patch and squash commit message into 8/12,
but I don't insist since get_system_io() added here is removed by 8/12,
so either way 

Reviewed-by: Igor Mammedov <imammedo@redhat.com>


also for patches that modify DSDT, see comment at the start of tests/qtest/bios-tables-test.c
to make 'make check' happy and don't break tests during bisection 

> ---
>  hw/i386/acpi-build.c | 32 ++++++++------------------------
>  1 file changed, 8 insertions(+), 24 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 214b98671bf2..08433a06039f 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1218,50 +1218,34 @@ static Aml *build_lpt_device_aml(void)
>      return dev;
>  }
>  
> -static Aml *build_com_device_aml(uint8_t uid)
> +static void build_com_device_aml(Aml *scope, uint8_t uid)
>  {
>      Aml *dev;
>      Aml *crs;
> -    Aml *method;
> -    Aml *if_ctx;
> -    Aml *else_ctx;
> -    Aml *zero = aml_int(0);
> -    Aml *is_present = aml_local(0);
> -    const char *enabled_field = "CAEN";
>      uint8_t irq = 4;
>      uint16_t io_port = 0x03F8;
>  
>      assert(uid == 1 || uid == 2);
>      if (uid == 2) {
> -        enabled_field = "CBEN";
>          irq = 3;
>          io_port = 0x02F8;
>      }
> +    if (!memory_region_present(get_system_io(), io_port)) {
> +        return;
> +    }
>  
>      dev = aml_device("COM%d", uid);
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
>      aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
>  
> -    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> -    aml_append(method, aml_store(aml_name("%s", enabled_field), is_present));
> -    if_ctx = aml_if(aml_equal(is_present, zero));
> -    {
> -        aml_append(if_ctx, aml_return(aml_int(0x00)));
> -    }
> -    aml_append(method, if_ctx);
> -    else_ctx = aml_else();
> -    {
> -        aml_append(else_ctx, aml_return(aml_int(0x0f)));
> -    }
> -    aml_append(method, else_ctx);
> -    aml_append(dev, method);
> +    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>  
>      crs = aml_resource_template();
>      aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08));
>      aml_append(crs, aml_irq_no_flags(irq));
>      aml_append(dev, aml_name_decl("_CRS", crs));
>  
> -    return dev;
> +    aml_append(scope, dev);
>  }
>  
>  static void build_isa_devices_aml(Aml *table)
> @@ -1279,8 +1263,8 @@ static void build_isa_devices_aml(Aml *table)
>          aml_append(scope, build_fdc_device_aml(fdc));
>      }
>      aml_append(scope, build_lpt_device_aml());
> -    aml_append(scope, build_com_device_aml(1));
> -    aml_append(scope, build_com_device_aml(2));
> +    build_com_device_aml(scope, 1);
> +    build_com_device_aml(scope, 2);
>  
>      if (ambiguous) {
>          error_report("Multiple ISA busses, unable to define IPMI ACPI data");



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

* Re: [PATCH v2 05/12] acpi: parallel: don't use _STA method
  2020-04-03  8:04 ` [PATCH v2 05/12] acpi: parallel: " Gerd Hoffmann
@ 2020-04-03 10:01   ` Igor Mammedov
  0 siblings, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:01 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:55 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> The _STA method dates back to the days where we had a static DSDT.  The
> device is listed in the DSDT table unconditionally and the _STA method
> checks a bit in the isa bridge pci config space to figure whenever a
> given is isa device is present or not, then evaluates to 0x0f (present)
> or 0x00 (absent).
> 
> These days the DSDT is generated by qemu anyway, so if a device is not
> present we can simply drop it from the DSDT instead.
same as 4/12 applies

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/i386/acpi-build.c | 29 ++++++++---------------------
>  1 file changed, 8 insertions(+), 21 deletions(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 08433a06039f..5d2b9b099684 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1183,39 +1183,26 @@ static Aml *build_mouse_device_aml(void)
>      return dev;
>  }
>  
> -static Aml *build_lpt_device_aml(void)
> +static void build_lpt_device_aml(Aml *scope)
>  {
>      Aml *dev;
>      Aml *crs;
> -    Aml *method;
> -    Aml *if_ctx;
> -    Aml *else_ctx;
> -    Aml *zero = aml_int(0);
> -    Aml *is_present = aml_local(0);
> +
> +    if (!memory_region_present(get_system_io(), 0x0378)) {
> +        return;
> +    }
>  
>      dev = aml_device("LPT");
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
>  
> -    method = aml_method("_STA", 0, AML_NOTSERIALIZED);
> -    aml_append(method, aml_store(aml_name("LPEN"), is_present));
> -    if_ctx = aml_if(aml_equal(is_present, zero));
> -    {
> -        aml_append(if_ctx, aml_return(aml_int(0x00)));
> -    }
> -    aml_append(method, if_ctx);
> -    else_ctx = aml_else();
> -    {
> -        aml_append(else_ctx, aml_return(aml_int(0x0f)));
> -    }
> -    aml_append(method, else_ctx);
> -    aml_append(dev, method);
> +    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>  
>      crs = aml_resource_template();
>      aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
>      aml_append(crs, aml_irq_no_flags(7));
>      aml_append(dev, aml_name_decl("_CRS", crs));
>  
> -    return dev;
> +    aml_append(scope, dev);
>  }
>  
>  static void build_com_device_aml(Aml *scope, uint8_t uid)
> @@ -1262,7 +1249,7 @@ static void build_isa_devices_aml(Aml *table)
>      if (fdc) {
>          aml_append(scope, build_fdc_device_aml(fdc));
>      }
> -    aml_append(scope, build_lpt_device_aml());
> +    build_lpt_device_aml(scope);
>      build_com_device_aml(scope, 1);
>      build_com_device_aml(scope, 2);
>  



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

* Re: [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml()
  2020-04-03  8:04 ` [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml() Gerd Hoffmann
@ 2020-04-03 10:05   ` Igor Mammedov
  2020-04-06 10:22   ` Igor Mammedov
  1 sibling, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:05 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:56 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Also add isa_aml_build() function which walks all isa devices.
> This allows to move aml builder code to isa devices.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  include/hw/isa/isa.h |  2 ++
>  hw/i386/acpi-build.c |  1 +
>  hw/isa/isa-bus.c     | 15 +++++++++++++++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> index e9ac1f1205a4..1534f8826453 100644
> --- a/include/hw/isa/isa.h
> +++ b/include/hw/isa/isa.h
> @@ -70,6 +70,7 @@ typedef struct IsaDmaClass {
>  
>  typedef struct ISADeviceClass {
>      DeviceClass parent_class;
> +    void (*build_aml)(ISADevice *dev, Aml *scope);
>  } ISADeviceClass;
>  
>  struct ISABus {
> @@ -108,6 +109,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *name);
>  ISADevice *isa_create_simple(ISABus *bus, const char *name);
>  
>  ISADevice *isa_vga_init(ISABus *bus);
> +void isa_build_aml(ISABus *bus, Aml *scope);
>  
>  /**
>   * isa_register_ioport: Install an I/O port region on the ISA bus.
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 5d2b9b099684..77fc9df74735 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1259,6 +1259,7 @@ static void build_isa_devices_aml(Aml *table)
>          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);
>      }
>  
>      aml_append(table, scope);
> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
> index 798dd9194e8f..1f2189f4d5db 100644
> --- a/hw/isa/isa-bus.c
> +++ b/hw/isa/isa-bus.c
> @@ -207,6 +207,21 @@ ISADevice *isa_vga_init(ISABus *bus)
>      }
>  }
>  
> +void isa_build_aml(ISABus *bus, Aml *scope)
> +{
> +    BusChild *kid;
> +    ISADevice *dev;
> +    ISADeviceClass *dc;
> +
> +    QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) {
> +        dev = ISA_DEVICE(kid->child);
> +        dc = ISA_DEVICE_GET_CLASS(dev);
> +        if (dc->build_aml) {
> +            dc->build_aml(dev, scope);
> +        }
> +    }
> +}
> +
>  static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
>  {
>      ISADevice *d = ISA_DEVICE(dev);



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-03  8:04 ` [PATCH v2 07/12] acpi: move aml builder code for rtc device Gerd Hoffmann
@ 2020-04-03 10:09   ` Igor Mammedov
  2020-04-06  8:25     ` Gerd Hoffmann
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:09 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:57 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
[...]
> +static void rtc_build_aml(ISADevice *isadev, Aml *scope)
> +{
> +    Aml *dev;
> +    Aml *crs;
> +
> +    crs = aml_resource_template();
> +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
> +    aml_append(crs, aml_irq_no_flags(8));
> +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));

since this is made a part of device, can we fetch io port values from
device instead of hard-codding values here?

> +
> +    dev = aml_device("RTC");
> +    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0B00")));
> +    aml_append(dev, aml_name_decl("_CRS", crs));
> +
> +    aml_append(scope, dev);
> +}
> +
>  static void rtc_class_initfn(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> +    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
>  
>      dc->realize = rtc_realizefn;
>      dc->reset = rtc_resetdev;
>      dc->vmsd = &vmstate_rtc;
> +    isa->build_aml = rtc_build_aml;
>      device_class_set_props(dc, mc146818rtc_properties);
>  }
>  



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

* Re: [PATCH v2 08/12] acpi: move aml builder code for serial device
  2020-04-03  8:04 ` [PATCH v2 08/12] acpi: move aml builder code for serial device Gerd Hoffmann
@ 2020-04-03 10:10   ` Igor Mammedov
  0 siblings, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:10 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:58 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> The code uses the isa_serial_io array to figure what the device uid is.
> Side effect is that acpi antries are not limited to port 1+2 any more,
> we'll also get entries for ports 3+4.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/char/serial-isa.c | 32 ++++++++++++++++++++++++++++++++
>  hw/i386/acpi-build.c | 32 --------------------------------
>  2 files changed, 32 insertions(+), 32 deletions(-)
> 
> diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
> index f9b6eed7833d..f7c19a398ced 100644
> --- a/hw/char/serial-isa.c
> +++ b/hw/char/serial-isa.c
> @@ -27,6 +27,7 @@
>  #include "qapi/error.h"
>  #include "qemu/module.h"
>  #include "sysemu/sysemu.h"
> +#include "hw/acpi/aml-build.h"
>  #include "hw/char/serial.h"
>  #include "hw/isa/isa.h"
>  #include "hw/qdev-properties.h"
> @@ -81,6 +82,35 @@ static void serial_isa_realizefn(DeviceState *dev, Error **errp)
>      isa_register_ioport(isadev, &s->io, isa->iobase);
>  }
>  
> +static void serial_isa_build_aml(ISADevice *isadev, Aml *scope)
> +{
> +    ISASerialState *isa = ISA_SERIAL(isadev);
> +    int i, uid = 0;
> +    Aml *dev;
> +    Aml *crs;
> +
> +    for (i = 0; i < ARRAY_SIZE(isa_serial_io); i++) {
> +        if (isa->iobase == isa_serial_io[i]) {
> +            uid = i + 1;
> +        }
> +    }
> +    if (!uid) {
> +        return;
> +    }
> +
> +    crs = aml_resource_template();
> +    aml_append(crs, aml_io(AML_DECODE16, isa->iobase, isa->iobase, 0x00, 0x08));
> +    aml_append(crs, aml_irq_no_flags(isa->isairq));
> +
> +    dev = aml_device("COM%d", uid);
> +    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
> +    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
> +    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
> +    aml_append(dev, aml_name_decl("_CRS", crs));
> +
> +    aml_append(scope, dev);
> +}
> +
>  static const VMStateDescription vmstate_isa_serial = {
>      .name = "serial",
>      .version_id = 3,
> @@ -103,9 +133,11 @@ static Property serial_isa_properties[] = {
>  static void serial_isa_class_initfn(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> +    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
>  
>      dc->realize = serial_isa_realizefn;
>      dc->vmsd = &vmstate_isa_serial;
> +    isa->build_aml = serial_isa_build_aml;
>      device_class_set_props(dc, serial_isa_properties);
>      set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>  }
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a5bc7764e611..81805bf85f8d 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1189,36 +1189,6 @@ static void build_lpt_device_aml(Aml *scope)
>      aml_append(scope, dev);
>  }
>  
> -static void build_com_device_aml(Aml *scope, uint8_t uid)
> -{
> -    Aml *dev;
> -    Aml *crs;
> -    uint8_t irq = 4;
> -    uint16_t io_port = 0x03F8;
> -
> -    assert(uid == 1 || uid == 2);
> -    if (uid == 2) {
> -        irq = 3;
> -        io_port = 0x02F8;
> -    }
> -    if (!memory_region_present(get_system_io(), io_port)) {
> -        return;
> -    }
> -
> -    dev = aml_device("COM%d", uid);
> -    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0501")));
> -    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
> -
> -    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
> -
> -    crs = aml_resource_template();
> -    aml_append(crs, aml_io(AML_DECODE16, io_port, io_port, 0x00, 0x08));
> -    aml_append(crs, aml_irq_no_flags(irq));
> -    aml_append(dev, aml_name_decl("_CRS", crs));
> -
> -    aml_append(scope, dev);
> -}
> -
>  static void build_isa_devices_aml(Aml *table)
>  {
>      ISADevice *fdc = pc_find_fdc0();
> @@ -1233,8 +1203,6 @@ static void build_isa_devices_aml(Aml *table)
>          aml_append(scope, build_fdc_device_aml(fdc));
>      }
>      build_lpt_device_aml(scope);
> -    build_com_device_aml(scope, 1);
> -    build_com_device_aml(scope, 2);
>  
>      if (ambiguous) {
>          error_report("Multiple ISA busses, unable to define IPMI ACPI data");



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

* Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-03  8:04 ` [PATCH v2 09/12] acpi: move aml builder code for parallel device Gerd Hoffmann
@ 2020-04-03 10:12   ` Igor Mammedov
  2020-04-03 10:16     ` Igor Mammedov
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:12 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:59 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/char/parallel.c   | 25 +++++++++++++++++++++++++
>  hw/i386/acpi-build.c | 23 -----------------------
>  2 files changed, 25 insertions(+), 23 deletions(-)
> 
> diff --git a/hw/char/parallel.c b/hw/char/parallel.c
> index 8dd67d13759b..2bff1f17fda7 100644
> --- a/hw/char/parallel.c
> +++ b/hw/char/parallel.c
> @@ -28,6 +28,7 @@
>  #include "qemu/module.h"
>  #include "chardev/char-parallel.h"
>  #include "chardev/char-fe.h"
> +#include "hw/acpi/aml-build.h"
>  #include "hw/irq.h"
>  #include "hw/isa/isa.h"
>  #include "hw/qdev-properties.h"
> @@ -568,6 +569,28 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
>                               s, "parallel");
>  }
>  
> +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
> +{
> +    ISAParallelState *isa = ISA_PARALLEL(isadev);
> +    Aml *dev;
> +    Aml *crs;
> +
> +    if (isa->iobase != 0x0378) {
> +        return;
> +    }
> +
> +    crs = aml_resource_template();
> +    aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
> +    aml_append(crs, aml_irq_no_flags(7));
> +
> +    dev = aml_device("LPT");
> +    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
> +    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
> +    aml_append(dev, aml_name_decl("_CRS", crs));
> +
> +    aml_append(scope, dev);
> +}
> +
>  /* Memory mapped interface */
>  static uint64_t parallel_mm_readfn(void *opaque, hwaddr addr, unsigned size)
>  {
> @@ -624,9 +647,11 @@ static Property parallel_isa_properties[] = {
>  static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> +    ISADeviceClass *isa = ISA_DEVICE_CLASS(klass);
>  
>      dc->realize = parallel_isa_realizefn;
>      dc->vmsd = &vmstate_parallel_isa;
> +    isa->build_aml = parallel_isa_build_aml;
>      device_class_set_props(dc, parallel_isa_properties);
>      set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
>  }
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 81805bf85f8d..0539620ddff5 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1167,28 +1167,6 @@ static Aml *build_mouse_device_aml(void)
>      return dev;
>  }
>  
> -static void build_lpt_device_aml(Aml *scope)
> -{
> -    Aml *dev;
> -    Aml *crs;
> -
> -    if (!memory_region_present(get_system_io(), 0x0378)) {
> -        return;
> -    }
> -
> -    dev = aml_device("LPT");
> -    aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
> -
> -    aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
> -
> -    crs = aml_resource_template();
> -    aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
> -    aml_append(crs, aml_irq_no_flags(7));
perhaps fetch values from device instead of hard-coding them

> -    aml_append(dev, aml_name_decl("_CRS", crs));
> -
> -    aml_append(scope, dev);
> -}
> -
>  static void build_isa_devices_aml(Aml *table)
>  {
>      ISADevice *fdc = pc_find_fdc0();
> @@ -1202,7 +1180,6 @@ static void build_isa_devices_aml(Aml *table)
>      if (fdc) {
>          aml_append(scope, build_fdc_device_aml(fdc));
>      }
> -    build_lpt_device_aml(scope);
>  
>      if (ambiguous) {
>          error_report("Multiple ISA busses, unable to define IPMI ACPI data");



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

* Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-03 10:12   ` Igor Mammedov
@ 2020-04-03 10:16     ` Igor Mammedov
  2020-04-06 10:26       ` Gerd Hoffmann
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-03 10:16 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Marc-André Lureau, Paolo Bonzini,
	John Snow, Richard Henderson

On Fri, 3 Apr 2020 12:12:10 +0200
Igor Mammedov <imammedo@redhat.com> wrote:

> On Fri,  3 Apr 2020 10:04:59 +0200
> Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
[...]
> > +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
> > +{
> > +    ISAParallelState *isa = ISA_PARALLEL(isadev);
> > +    Aml *dev;
> > +    Aml *crs;
> > +
> > +    if (isa->iobase != 0x0378) {
> > +        return;
> > +    }
if device is present why should we skip adding it to DSDT?

[..]



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-03 10:09   ` Igor Mammedov
@ 2020-04-06  8:25     ` Gerd Hoffmann
  2020-04-06 12:17       ` Igor Mammedov
  0 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-06  8:25 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote:
> On Fri,  3 Apr 2020 10:04:57 +0200
> Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> [...]
> > +static void rtc_build_aml(ISADevice *isadev, Aml *scope)
> > +{
> > +    Aml *dev;
> > +    Aml *crs;
> > +
> > +    crs = aml_resource_template();
> > +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
> > +    aml_append(crs, aml_irq_no_flags(8));
> > +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));
> 
> since this is made a part of device, can we fetch io port values from
> device instead of hard-codding values here?

No, the rtc device hasn't a configurable io port address.

cheers,
  Gerd



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

* Re: [PATCH v2 04/12] acpi: serial: don't use _STA method
  2020-04-03 10:00   ` Igor Mammedov
@ 2020-04-06 10:20     ` Gerd Hoffmann
  0 siblings, 0 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-06 10:20 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> I'd drop this patch and squash commit message into 8/12,
> but I don't insist since get_system_io() added here is removed by 8/12,
> so either way 

They are logically separate changes (even though the first enables the
second), so I'd prefer to keep them separate.

Reordering the series so they are grouped makes sense though I think.

take care,
  Gerd



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

* Re: [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml()
  2020-04-03  8:04 ` [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml() Gerd Hoffmann
  2020-04-03 10:05   ` Igor Mammedov
@ 2020-04-06 10:22   ` Igor Mammedov
  2020-04-07 10:18     ` Gerd Hoffmann
  1 sibling, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-06 10:22 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Marc-André Lureau, Paolo Bonzini,
	John Snow, Richard Henderson

On Fri,  3 Apr 2020 10:04:56 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Also add isa_aml_build() function which walks all isa devices.
> This allows to move aml builder code to isa devices.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  include/hw/isa/isa.h |  2 ++
>  hw/i386/acpi-build.c |  1 +
>  hw/isa/isa-bus.c     | 15 +++++++++++++++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> index e9ac1f1205a4..1534f8826453 100644
> --- a/include/hw/isa/isa.h
> +++ b/include/hw/isa/isa.h
> @@ -70,6 +70,7 @@ typedef struct IsaDmaClass {
>  
>  typedef struct ISADeviceClass {
>      DeviceClass parent_class;
> +    void (*build_aml)(ISADevice *dev, Aml *scope);
>  } ISADeviceClass;
>  
>  struct ISABus {
> @@ -108,6 +109,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *name);
>  ISADevice *isa_create_simple(ISABus *bus, const char *name);
>  
>  ISADevice *isa_vga_init(ISABus *bus);
> +void isa_build_aml(ISABus *bus, Aml *scope);
>  
>  /**
>   * isa_register_ioport: Install an I/O port region on the ISA bus.
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 5d2b9b099684..77fc9df74735 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1259,6 +1259,7 @@ static void build_isa_devices_aml(Aml *table)
>          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);

is it possible to have more than 1 ISA bus on pc/q35 machine?

I'm asking because there is following clause
  if (ambiguous) {
just above this context while devices you are moving here all defined
unconditionally before that

>      }
>  
>      aml_append(table, scope);
> diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
> index 798dd9194e8f..1f2189f4d5db 100644
> --- a/hw/isa/isa-bus.c
> +++ b/hw/isa/isa-bus.c
> @@ -207,6 +207,21 @@ ISADevice *isa_vga_init(ISABus *bus)
>      }
>  }
>  
> +void isa_build_aml(ISABus *bus, Aml *scope)
> +{
> +    BusChild *kid;
> +    ISADevice *dev;
> +    ISADeviceClass *dc;
> +
> +    QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) {
> +        dev = ISA_DEVICE(kid->child);
> +        dc = ISA_DEVICE_GET_CLASS(dev);
> +        if (dc->build_aml) {
> +            dc->build_aml(dev, scope);
> +        }
> +    }
> +}
> +
>  static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
>  {
>      ISADevice *d = ISA_DEVICE(dev);



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

* Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-03 10:16     ` Igor Mammedov
@ 2020-04-06 10:26       ` Gerd Hoffmann
  2020-04-06 11:39         ` Paolo Bonzini
  2020-04-06 12:14         ` Igor Mammedov
  0 siblings, 2 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-06 10:26 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Marc-André Lureau, Paolo Bonzini,
	John Snow, Richard Henderson

On Fri, Apr 03, 2020 at 12:16:01PM +0200, Igor Mammedov wrote:
> On Fri, 3 Apr 2020 12:12:10 +0200
> Igor Mammedov <imammedo@redhat.com> wrote:
> 
> > On Fri,  3 Apr 2020 10:04:59 +0200
> > Gerd Hoffmann <kraxel@redhat.com> wrote:
> > 
> [...]
> > > +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
> > > +{
> > > +    ISAParallelState *isa = ISA_PARALLEL(isadev);
> > > +    Aml *dev;
> > > +    Aml *crs;
> > > +
> > > +    if (isa->iobase != 0x0378) {
> > > +        return;
> > > +    }
> if device is present why should we skip adding it to DSDT?

Well, that is the current state of affairs, only the first parallel
ports shows up in the dsdt.  And given how rare parallel ports are these
days I didn't bother changing that ...

We can handle this simliar to serial lines though, incremental below.
Do you prefer that?

take care,
  Gerd

=================================== cut here =======================
From 617797cf42e56e18d5d62cb171af00c28589caba Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 6 Apr 2020 12:17:59 +0200
Subject: [PATCH] [fixup] parallel

---
 hw/char/parallel.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 2bff1f17fda7..7157d6816b77 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -572,10 +572,16 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
 static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
 {
     ISAParallelState *isa = ISA_PARALLEL(isadev);
+    int i, uid = 0;
     Aml *dev;
     Aml *crs;
 
-    if (isa->iobase != 0x0378) {
+    for (i = 0; i < ARRAY_SIZE(isa_parallel_io); i++) {
+        if (isa->iobase == isa_parallel_io[i]) {
+            uid = i + 1;
+        }
+    }
+    if (!uid) {
         return;
     }
 
@@ -583,8 +589,9 @@ static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
     aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
     aml_append(crs, aml_irq_no_flags(7));
 
-    dev = aml_device("LPT");
+    dev = aml_device("LPT%d", uid);
     aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
+    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
     aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
     aml_append(dev, aml_name_decl("_CRS", crs));
 
-- 
2.18.2



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

* Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-06 10:26       ` Gerd Hoffmann
@ 2020-04-06 11:39         ` Paolo Bonzini
  2020-04-06 12:14         ` Igor Mammedov
  1 sibling, 0 replies; 37+ messages in thread
From: Paolo Bonzini @ 2020-04-06 11:39 UTC (permalink / raw)
  To: Gerd Hoffmann, Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Marc-André Lureau, John Snow,
	Richard Henderson

On 06/04/20 12:26, Gerd Hoffmann wrote:
> -    if (isa->iobase != 0x0378) {
> +    for (i = 0; i < ARRAY_SIZE(isa_parallel_io); i++) {
> +        if (isa->iobase == isa_parallel_io[i]) {
> +            uid = i + 1;
> +        }
> +    }
> +    if (!uid) {
>          return;
>      }
>  
> @@ -583,8 +589,9 @@ static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
>      aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));

FWIW this should be replaced with iso->iobase if you want to support
multiple parallel ports (we probably should since the patch has been
written already :)).

Paolo

>      aml_append(crs, aml_irq_no_flags(7));
>  
> -    dev = aml_device("LPT");
> +    dev = aml_device("LPT%d", uid);
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
> +    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
>      aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>      aml_append(dev, aml_name_decl("_CRS", crs));
>  



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

* Re: [PATCH v2 09/12] acpi: move aml builder code for parallel device
  2020-04-06 10:26       ` Gerd Hoffmann
  2020-04-06 11:39         ` Paolo Bonzini
@ 2020-04-06 12:14         ` Igor Mammedov
  1 sibling, 0 replies; 37+ messages in thread
From: Igor Mammedov @ 2020-04-06 12:14 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Mon, 6 Apr 2020 12:26:52 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Fri, Apr 03, 2020 at 12:16:01PM +0200, Igor Mammedov wrote:
> > On Fri, 3 Apr 2020 12:12:10 +0200
> > Igor Mammedov <imammedo@redhat.com> wrote:
> >   
> > > On Fri,  3 Apr 2020 10:04:59 +0200
> > > Gerd Hoffmann <kraxel@redhat.com> wrote:
> > >   
> > [...]  
> > > > +static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
> > > > +{
> > > > +    ISAParallelState *isa = ISA_PARALLEL(isadev);
> > > > +    Aml *dev;
> > > > +    Aml *crs;
> > > > +
> > > > +    if (isa->iobase != 0x0378) {
> > > > +        return;
> > > > +    }  
> > if device is present why should we skip adding it to DSDT?  
> 
> Well, that is the current state of affairs, only the first parallel
> ports shows up in the dsdt.  And given how rare parallel ports are these
> days I didn't bother changing that ...
> 
> We can handle this simliar to serial lines though, incremental below.
> Do you prefer that?

yep (with Paolo's comment addressed)

> 
> take care,
>   Gerd
> 
> =================================== cut here =======================
> From 617797cf42e56e18d5d62cb171af00c28589caba Mon Sep 17 00:00:00 2001
> From: Gerd Hoffmann <kraxel@redhat.com>
> Date: Mon, 6 Apr 2020 12:17:59 +0200
> Subject: [PATCH] [fixup] parallel
> 
> ---
>  hw/char/parallel.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/char/parallel.c b/hw/char/parallel.c
> index 2bff1f17fda7..7157d6816b77 100644
> --- a/hw/char/parallel.c
> +++ b/hw/char/parallel.c
> @@ -572,10 +572,16 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
>  static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
>  {
>      ISAParallelState *isa = ISA_PARALLEL(isadev);
> +    int i, uid = 0;
>      Aml *dev;
>      Aml *crs;
>  
> -    if (isa->iobase != 0x0378) {
> +    for (i = 0; i < ARRAY_SIZE(isa_parallel_io); i++) {
> +        if (isa->iobase == isa_parallel_io[i]) {
> +            uid = i + 1;
> +        }
> +    }
> +    if (!uid) {
>          return;
>      }
>  
> @@ -583,8 +589,9 @@ static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope)
>      aml_append(crs, aml_io(AML_DECODE16, 0x0378, 0x0378, 0x08, 0x08));
>      aml_append(crs, aml_irq_no_flags(7));
>  
> -    dev = aml_device("LPT");
> +    dev = aml_device("LPT%d", uid);
>      aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0400")));
> +    aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
>      aml_append(dev, aml_name_decl("_STA", aml_int(0xf)));
>      aml_append(dev, aml_name_decl("_CRS", crs));
>  



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-06  8:25     ` Gerd Hoffmann
@ 2020-04-06 12:17       ` Igor Mammedov
  2020-04-07 10:26         ` Gerd Hoffmann
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-06 12:17 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Mon, 6 Apr 2020 10:25:17 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote:
> > On Fri,  3 Apr 2020 10:04:57 +0200
> > Gerd Hoffmann <kraxel@redhat.com> wrote:
> >   
> > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > > ---  
> > [...]  
> > > +static void rtc_build_aml(ISADevice *isadev, Aml *scope)
> > > +{
> > > +    Aml *dev;
> > > +    Aml *crs;
> > > +
> > > +    crs = aml_resource_template();
> > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
> > > +    aml_append(crs, aml_irq_no_flags(8));
> > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));  
> > 
> > since this is made a part of device, can we fetch io port values from
> > device instead of hard-codding values here?  
> 
> No, the rtc device hasn't a configurable io port address.
what I'm after is consistent code, so if we switch to taking
io_base/irq from ISA device, then do it everywhere.
So we don't have a zoo of devices doing the same thing in multiple
ways.

> 
> cheers,
>   Gerd
> 



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

* Re: [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml()
  2020-04-06 10:22   ` Igor Mammedov
@ 2020-04-07 10:18     ` Gerd Hoffmann
  0 siblings, 0 replies; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-07 10:18 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Marc-André Lureau, Paolo Bonzini,
	John Snow, Richard Henderson

On Mon, Apr 06, 2020 at 12:22:31PM +0200, Igor Mammedov wrote:
> On Fri,  3 Apr 2020 10:04:56 +0200
> Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
> > Also add isa_aml_build() function which walks all isa devices.
> > This allows to move aml builder code to isa devices.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  include/hw/isa/isa.h |  2 ++
> >  hw/i386/acpi-build.c |  1 +
> >  hw/isa/isa-bus.c     | 15 +++++++++++++++
> >  3 files changed, 18 insertions(+)
> > 
> > diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
> > index e9ac1f1205a4..1534f8826453 100644
> > --- a/include/hw/isa/isa.h
> > +++ b/include/hw/isa/isa.h
> > @@ -70,6 +70,7 @@ typedef struct IsaDmaClass {
> >  
> >  typedef struct ISADeviceClass {
> >      DeviceClass parent_class;
> > +    void (*build_aml)(ISADevice *dev, Aml *scope);
> >  } ISADeviceClass;
> >  
> >  struct ISABus {
> > @@ -108,6 +109,7 @@ ISADevice *isa_try_create(ISABus *bus, const char *name);
> >  ISADevice *isa_create_simple(ISABus *bus, const char *name);
> >  
> >  ISADevice *isa_vga_init(ISABus *bus);
> > +void isa_build_aml(ISABus *bus, Aml *scope);
> >  
> >  /**
> >   * isa_register_ioport: Install an I/O port region on the ISA bus.
> > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > index 5d2b9b099684..77fc9df74735 100644
> > --- a/hw/i386/acpi-build.c
> > +++ b/hw/i386/acpi-build.c
> > @@ -1259,6 +1259,7 @@ static void build_isa_devices_aml(Aml *table)
> >          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);
> 
> is it possible to have more than 1 ISA bus on pc/q35 machine?

I don't think this is possible on the x86 architecture due to the way
io ports are addressed.  I think you can have multiple isa busses on
architectures where the isa io address space is just a mmio window on
the isa bridge.  Dunno whenever such machines actually exist in
practice.

I think we can safely compress the whole thing into "assert(obj &&
!ambiguous)".

take care,
  Gerd



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-06 12:17       ` Igor Mammedov
@ 2020-04-07 10:26         ` Gerd Hoffmann
  2020-04-08 11:27           ` Igor Mammedov
  0 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-07 10:26 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Mon, Apr 06, 2020 at 02:17:05PM +0200, Igor Mammedov wrote:
> On Mon, 6 Apr 2020 10:25:17 +0200
> Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
> > On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote:
> > > On Fri,  3 Apr 2020 10:04:57 +0200
> > > Gerd Hoffmann <kraxel@redhat.com> wrote:
> > >   
> > > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > > > ---  
> > > [...]  
> > > > +static void rtc_build_aml(ISADevice *isadev, Aml *scope)
> > > > +{
> > > > +    Aml *dev;
> > > > +    Aml *crs;
> > > > +
> > > > +    crs = aml_resource_template();
> > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
> > > > +    aml_append(crs, aml_irq_no_flags(8));
> > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));  
> > > 
> > > since this is made a part of device, can we fetch io port values from
> > > device instead of hard-codding values here?  
> > 
> > No, the rtc device hasn't a configurable io port address.
> what I'm after is consistent code, so if we switch to taking
> io_base/irq from ISA device, then do it everywhere.

The patch series does it consistently where it makes sense.
That IMHO isn't the case for the rtc.  It has a fixed address.
You can't have multiple instances if it.  And because of that
there isn't a variable in the device state struct where I could
read the iobase from ...

> So we don't have a zoo of devices doing the same thing in multiple
> ways.

It's two ways: hardcoded for devices which can't move and
read-from-device for devices which can move.

cheers,
  Gerd



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-07 10:26         ` Gerd Hoffmann
@ 2020-04-08 11:27           ` Igor Mammedov
  2020-04-08 12:59             ` Gerd Hoffmann
  0 siblings, 1 reply; 37+ messages in thread
From: Igor Mammedov @ 2020-04-08 11:27 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

On Tue, 7 Apr 2020 12:26:58 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> On Mon, Apr 06, 2020 at 02:17:05PM +0200, Igor Mammedov wrote:
> > On Mon, 6 Apr 2020 10:25:17 +0200
> > Gerd Hoffmann <kraxel@redhat.com> wrote:
> >   
> > > On Fri, Apr 03, 2020 at 12:09:21PM +0200, Igor Mammedov wrote:  
> > > > On Fri,  3 Apr 2020 10:04:57 +0200
> > > > Gerd Hoffmann <kraxel@redhat.com> wrote:
> > > >     
> > > > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > > > > ---    
> > > > [...]    
> > > > > +static void rtc_build_aml(ISADevice *isadev, Aml *scope)
> > > > > +{
> > > > > +    Aml *dev;
> > > > > +    Aml *crs;
> > > > > +
> > > > > +    crs = aml_resource_template();
> > > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
maybe replace magic 0x0070 with macro
  RTC_BASE_ADDR

and do the same in realize

diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index dc4269cc55..a1f27f4883 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -908,7 +908,6 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
 {
     ISADevice *isadev = ISA_DEVICE(dev);
     RTCState *s = MC146818_RTC(dev);
-    int base = 0x70;
 
     s->cmos_data[RTC_REG_A] = 0x26;
     s->cmos_data[RTC_REG_B] = 0x02;
@@ -951,7 +950,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     qemu_register_suspend_notifier(&s->suspend_notifier);
 
     memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2);
-    isa_register_ioport(isadev, &s->io, base);
+    isa_register_ioport(isadev, &s->io, RTC_BASE_ADDR);
 
     /* register rtc 0x70 port for coalesced_pio */
     memory_region_set_flush_coalesced(&s->io);
@@ -960,7 +959,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
     memory_region_add_subregion(&s->io, 0, &s->coalesced_io);
     memory_region_add_coalescing(&s->coalesced_io, 0, 1);
 
-    qdev_set_legacy_instance_id(dev, base, 3);
+    qdev_set_legacy_instance_id(dev, RTC_BASE_ADDR, 3);
     qemu_register_reset(rtc_reset, s);
 
     object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL);


> > > > > +    aml_append(crs, aml_irq_no_flags(8));
> > > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));

one more comment, is this last io record correct?
(looking at realize it maps only 2 bytes at 0x70)
    
> > > > 
> > > > since this is made a part of device, can we fetch io port values from
> > > > device instead of hard-codding values here?    
> > > 
> > > No, the rtc device hasn't a configurable io port address.  
> > what I'm after is consistent code, so if we switch to taking
> > io_base/irq from ISA device, then do it everywhere.  
> 
> The patch series does it consistently where it makes sense.
> That IMHO isn't the case for the rtc.  It has a fixed address.
> You can't have multiple instances if it.  And because of that
> there isn't a variable in the device state struct where I could
> read the iobase from ...

ok

> 
> > So we don't have a zoo of devices doing the same thing in multiple
> > ways.  
> 
> It's two ways: hardcoded for devices which can't move and
> read-from-device for devices which can move.
> 
> cheers,
>   Gerd
> 



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-08 11:27           ` Igor Mammedov
@ 2020-04-08 12:59             ` Gerd Hoffmann
  2020-04-08 20:28               ` Cameron Esfahani via
  0 siblings, 1 reply; 37+ messages in thread
From: Gerd Hoffmann @ 2020-04-08 12:59 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Michael S. Tsirkin,
	qemu-devel, Max Reitz, Paolo Bonzini, Marc-André Lureau,
	John Snow, Richard Henderson

  Hi,

> > > > > > +    crs = aml_resource_template();
> > > > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
> maybe replace magic 0x0070 with macro
>   RTC_BASE_ADDR

Yes, that sounds better.

> > > > > > +    aml_append(crs, aml_irq_no_flags(8));
> > > > > > +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));
> 
> one more comment, is this last io record correct?
> (looking at realize it maps only 2 bytes at 0x70)

No idea, I've just moved around the code.

Good question though.  Also why this splitted in two ranges the first
place.  Looking at physical hardware (my workstation) I see this:

        Device (RTC)
        {
            Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */)  // _HID: Hardware ID
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                IO (Decode16,
                    0x0070,             // Range Minimum
                    0x0070,             // Range Maximum
                    0x01,               // Alignment
                    0x08,               // Length
                    )
                IRQNoFlags ()
                    {8}
            })
        }

Clues anyone?

thanks,
  Gerd



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

* Re: [PATCH v2 07/12] acpi: move aml builder code for rtc device
  2020-04-08 12:59             ` Gerd Hoffmann
@ 2020-04-08 20:28               ` Cameron Esfahani via
  0 siblings, 0 replies; 37+ messages in thread
From: Cameron Esfahani via @ 2020-04-08 20:28 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Igor Mammedov, Kevin Wolf, Eduardo Habkost, qemu-block,
	Michael S. Tsirkin, qemu-devel, Max Reitz, Paolo Bonzini,
	Marc-André Lureau, John Snow, Richard Henderson

I'm curious why there's two ranges as well.

In our branch of QEMU, I've had to modify this RTC creation code to have only one range instead of two ranges.

Traditionally Macs have had one range for RTC and we have incompatibility with a two ranges.

If you could change it to one range without losing any compatibility, you'd get my thumbs up.

Cameron Esfahani
dirty@apple.com

"The cake is a lie."

Common wisdom



> On Apr 8, 2020, at 5:59 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
>  Hi,
> 
>>>>>>> +    crs = aml_resource_template();
>>>>>>> +    aml_append(crs, aml_io(AML_DECODE16, 0x0070, 0x0070, 0x10, 0x02));
>> maybe replace magic 0x0070 with macro
>>  RTC_BASE_ADDR
> 
> Yes, that sounds better.
> 
>>>>>>> +    aml_append(crs, aml_irq_no_flags(8));
>>>>>>> +    aml_append(crs, aml_io(AML_DECODE16, 0x0072, 0x0072, 0x02, 0x06));
>> 
>> one more comment, is this last io record correct?
>> (looking at realize it maps only 2 bytes at 0x70)
> 
> No idea, I've just moved around the code.
> 
> Good question though.  Also why this splitted in two ranges the first
> place.  Looking at physical hardware (my workstation) I see this:
> 
>        Device (RTC)
>        {
>            Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */)  // _HID: Hardware ID
>            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
>            {
>                IO (Decode16,
>                    0x0070,             // Range Minimum
>                    0x0070,             // Range Maximum
>                    0x01,               // Alignment
>                    0x08,               // Length
>                    )
>                IRQNoFlags ()
>                    {8}
>            })
>        }
> 
> Clues anyone?
> 
> thanks,
>  Gerd
> 
> 



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

end of thread, other threads:[~2020-04-08 20:29 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03  8:04 [PATCH v2 00/12] acpi: i386 tweaks Gerd Hoffmann
2020-04-03  8:04 ` [PATCH v2 01/12] move 'typedef Aml' to qemu/types.h Gerd Hoffmann
2020-04-03  9:41   ` Igor Mammedov
2020-04-03  8:04 ` [PATCH v2 02/12] acpi: add aml builder stubs Gerd Hoffmann
2020-04-03  9:43   ` Igor Mammedov
2020-04-03  8:04 ` [PATCH v2 03/12] acpi: drop pointless _STA method Gerd Hoffmann
2020-04-03  9:45   ` Igor Mammedov
2020-04-03  8:04 ` [PATCH v2 04/12] acpi: serial: don't use " Gerd Hoffmann
2020-04-03 10:00   ` Igor Mammedov
2020-04-06 10:20     ` Gerd Hoffmann
2020-04-03  8:04 ` [PATCH v2 05/12] acpi: parallel: " Gerd Hoffmann
2020-04-03 10:01   ` Igor Mammedov
2020-04-03  8:04 ` [PATCH v2 06/12] acpi: add ISADeviceClass->build_aml() Gerd Hoffmann
2020-04-03 10:05   ` Igor Mammedov
2020-04-06 10:22   ` Igor Mammedov
2020-04-07 10:18     ` Gerd Hoffmann
2020-04-03  8:04 ` [PATCH v2 07/12] acpi: move aml builder code for rtc device Gerd Hoffmann
2020-04-03 10:09   ` Igor Mammedov
2020-04-06  8:25     ` Gerd Hoffmann
2020-04-06 12:17       ` Igor Mammedov
2020-04-07 10:26         ` Gerd Hoffmann
2020-04-08 11:27           ` Igor Mammedov
2020-04-08 12:59             ` Gerd Hoffmann
2020-04-08 20:28               ` Cameron Esfahani via
2020-04-03  8:04 ` [PATCH v2 08/12] acpi: move aml builder code for serial device Gerd Hoffmann
2020-04-03 10:10   ` Igor Mammedov
2020-04-03  8:04 ` [PATCH v2 09/12] acpi: move aml builder code for parallel device Gerd Hoffmann
2020-04-03 10:12   ` Igor Mammedov
2020-04-03 10:16     ` Igor Mammedov
2020-04-06 10:26       ` Gerd Hoffmann
2020-04-06 11:39         ` Paolo Bonzini
2020-04-06 12:14         ` Igor Mammedov
2020-04-03  8:05 ` [PATCH v2 10/12] acpi: move aml builder code for floppy device Gerd Hoffmann
2020-04-03  8:05 ` [PATCH v2 11/12] acpi: move aml builder code for i8042 (kbd+mouse) device Gerd Hoffmann
2020-04-03  8:05 ` [PATCH v2 12/12] acpi: factor out fw_cfg_add_acpi_dsdt() Gerd Hoffmann
2020-04-03  8:50 ` [PATCH v2 00/12] acpi: i386 tweaks no-reply
2020-04-03  9:09 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.