All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] acpi: i386 tweaks
@ 2020-03-27 12:11 Gerd Hoffmann
  2020-03-27 12:11 ` [PATCH 1/6] acpi: split hw/i386/acpi-build.c Gerd Hoffmann
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, 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.

Also some small refactorings and simplifications.

take care,
  Gerd

Gerd Hoffmann (6):
  acpi: split hw/i386/acpi-build.c
  acpi: make build_madt() more generic.
  acpi: factor out acpi_dsdt_add_fw_cfg()
  acpi: drop pointless _STA method
  acpi: serial: don't use _STA method
  acpi: parallel: don't use _STA method

 hw/i386/acpi-build-internal.h             |  35 +++
 hw/i386/acpi-build-core.c                 | 191 +++++++++++++
 hw/i386/{acpi-build.c => acpi-build-pc.c} | 315 ++++------------------
 hw/i386/Makefile.objs                     |   3 +-
 4 files changed, 284 insertions(+), 260 deletions(-)
 create mode 100644 hw/i386/acpi-build-internal.h
 create mode 100644 hw/i386/acpi-build-core.c
 rename hw/i386/{acpi-build.c => acpi-build-pc.c} (91%)

-- 
2.18.2



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

* [PATCH 1/6] acpi: split hw/i386/acpi-build.c
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 14:17   ` Igor Mammedov
  2020-03-27 12:11 ` [PATCH 2/6] acpi: make build_madt() more generic Gerd Hoffmann
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, Richard Henderson

Split hw/i386/acpi-build.c into pieces:

acpi-build-internal.h
  Internal header file for acpi-buid-*.c

acpi-build-core.c
  The acpi_setup() function + dependencies.
  The acpi_build() function simply calls acpi_build_pc() for now,
  at some point in the future this will dispatch into machine-type
  specific build functions.

acpi-build-pc.c
  The acpi_build_pc() function + dependencies.
  The bulk of the old acpi-build.c file is here now.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/acpi-build-internal.h             |  35 ++++
 hw/i386/acpi-build-core.c                 | 191 ++++++++++++++++++++++
 hw/i386/{acpi-build.c => acpi-build-pc.c} | 175 +-------------------
 hw/i386/Makefile.objs                     |   3 +-
 4 files changed, 230 insertions(+), 174 deletions(-)
 create mode 100644 hw/i386/acpi-build-internal.h
 create mode 100644 hw/i386/acpi-build-core.c
 rename hw/i386/{acpi-build.c => acpi-build-pc.c} (94%)

diff --git a/hw/i386/acpi-build-internal.h b/hw/i386/acpi-build-internal.h
new file mode 100644
index 000000000000..5e783d85dde6
--- /dev/null
+++ b/hw/i386/acpi-build-internal.h
@@ -0,0 +1,35 @@
+
+#ifndef HW_I386_ACPI_BUILD_INTERNAL_H
+#define HW_I386_ACPI_BUILD_INTERNAL_H
+
+#include "hw/acpi/aml-build.h"
+
+/* #define DEBUG_ACPI_BUILD */
+#ifdef DEBUG_ACPI_BUILD
+#define ACPI_BUILD_DPRINTF(fmt, ...)        \
+    do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
+#else
+#define ACPI_BUILD_DPRINTF(fmt, ...)
+#endif
+
+typedef
+struct AcpiBuildState {
+    /* Copy of table in RAM (for patching). */
+    MemoryRegion *table_mr;
+    /* Is table patched? */
+    uint8_t patched;
+    void *rsdp;
+    MemoryRegion *rsdp_mr;
+    MemoryRegion *linker_mr;
+} AcpiBuildState;
+
+typedef struct FwCfgTPMConfig {
+    uint32_t tpmppi_address;
+    uint8_t tpm_version;
+    uint8_t tpmppi_version;
+} QEMU_PACKED FwCfgTPMConfig;
+
+/* acpi-build-pc.c */
+void acpi_build_pc(AcpiBuildTables *tables, MachineState *machine);
+
+#endif
diff --git a/hw/i386/acpi-build-core.c b/hw/i386/acpi-build-core.c
new file mode 100644
index 000000000000..f0968b4bb594
--- /dev/null
+++ b/hw/i386/acpi-build-core.c
@@ -0,0 +1,191 @@
+/* Support for generating ACPI tables and passing them to Guests
+ *
+ * Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
+ * Copyright (C) 2006 Fabrice Bellard
+ * Copyright (C) 2013 Red Hat Inc
+ *
+ * Author: Michael S. Tsirkin <mst@redhat.com>
+ *
+ * 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 "qapi/error.h"
+
+#include "exec/memory.h"
+#include "hw/acpi/acpi.h"
+#include "hw/acpi/aml-build.h"
+#include "hw/acpi/bios-linker-loader.h"
+#include "hw/acpi/tpm.h"
+#include "hw/acpi/utils.h"
+#include "hw/acpi/vmgenid.h"
+#include "hw/boards.h"
+#include "hw/i386/pc.h"
+#include "migration/vmstate.h"
+#include "sysemu/reset.h"
+#include "sysemu/tpm.h"
+
+#include "acpi-build.h"
+#include "acpi-build-internal.h"
+
+static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
+{
+    acpi_build_pc(tables, machine);
+}
+
+static void acpi_ram_update(MemoryRegion *mr, GArray *data)
+{
+    uint32_t size = acpi_data_len(data);
+
+    /* Make sure RAM size is correct - in case it got changed e.g. by migration */
+    memory_region_ram_resize(mr, size, &error_abort);
+
+    memcpy(memory_region_get_ram_ptr(mr), data->data, size);
+    memory_region_set_dirty(mr, 0, size);
+}
+
+static void acpi_build_update(void *build_opaque)
+{
+    AcpiBuildState *build_state = build_opaque;
+    AcpiBuildTables tables;
+
+    /* No state to update or already patched? Nothing to do. */
+    if (!build_state || build_state->patched) {
+        return;
+    }
+    build_state->patched = 1;
+
+    acpi_build_tables_init(&tables);
+
+    acpi_build(&tables, MACHINE(qdev_get_machine()));
+
+    acpi_ram_update(build_state->table_mr, tables.table_data);
+
+    if (build_state->rsdp) {
+        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
+    } else {
+        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
+    }
+
+    acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
+    acpi_build_tables_cleanup(&tables, true);
+}
+
+static void acpi_build_reset(void *build_opaque)
+{
+    AcpiBuildState *build_state = build_opaque;
+    build_state->patched = 0;
+}
+
+static const VMStateDescription vmstate_acpi_build = {
+    .name = "acpi_build",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT8(patched, AcpiBuildState),
+        VMSTATE_END_OF_LIST()
+    },
+};
+
+void acpi_setup(void)
+{
+    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+    X86MachineState *x86ms = X86_MACHINE(pcms);
+    AcpiBuildTables tables;
+    AcpiBuildState *build_state;
+    Object *vmgenid_dev;
+    TPMIf *tpm;
+    static FwCfgTPMConfig tpm_config;
+
+    if (!x86ms->fw_cfg) {
+        ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
+        return;
+    }
+
+    if (!pcms->acpi_build_enabled) {
+        ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
+        return;
+    }
+
+    if (!acpi_enabled) {
+        ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n");
+        return;
+    }
+
+    build_state = g_malloc0(sizeof *build_state);
+
+    acpi_build_tables_init(&tables);
+    acpi_build(&tables, MACHINE(pcms));
+
+    /* Now expose it all to Guest */
+    build_state->table_mr = acpi_add_rom_blob(acpi_build_update,
+                                              build_state, tables.table_data,
+                                              ACPI_BUILD_TABLE_FILE,
+                                              ACPI_BUILD_TABLE_MAX_SIZE);
+    assert(build_state->table_mr != NULL);
+
+    build_state->linker_mr =
+        acpi_add_rom_blob(acpi_build_update, build_state,
+                          tables.linker->cmd_blob, "etc/table-loader", 0);
+
+    fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
+                    tables.tcpalog->data, acpi_data_len(tables.tcpalog));
+
+    tpm = tpm_find();
+    if (tpm && object_property_get_bool(OBJECT(tpm), "ppi", &error_abort)) {
+        tpm_config = (FwCfgTPMConfig) {
+            .tpmppi_address = cpu_to_le32(TPM_PPI_ADDR_BASE),
+            .tpm_version = tpm_get_version(tpm),
+            .tpmppi_version = TPM_PPI_VERSION_1_30
+        };
+        fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config",
+                        &tpm_config, sizeof tpm_config);
+    }
+
+    vmgenid_dev = find_vmgenid_dev();
+    if (vmgenid_dev) {
+        vmgenid_add_fw_cfg(VMGENID(vmgenid_dev), x86ms->fw_cfg,
+                           tables.vmgenid);
+    }
+
+    if (!pcmc->rsdp_in_ram) {
+        /*
+         * Keep for compatibility with old machine types.
+         * Though RSDP is small, its contents isn't immutable, so
+         * we'll update it along with the rest of tables on guest access.
+         */
+        uint32_t rsdp_size = acpi_data_len(tables.rsdp);
+
+        build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
+        fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE,
+                                 acpi_build_update, NULL, build_state,
+                                 build_state->rsdp, rsdp_size, true);
+        build_state->rsdp_mr = NULL;
+    } else {
+        build_state->rsdp = NULL;
+        build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
+                                                 build_state, tables.rsdp,
+                                                 ACPI_BUILD_RSDP_FILE, 0);
+    }
+
+    qemu_register_reset(acpi_build_reset, build_state);
+    acpi_build_reset(build_state);
+    vmstate_register(NULL, 0, &vmstate_acpi_build, build_state);
+
+    /* Cleanup tables but don't free the memory: we track it
+     * in build_state.
+     */
+    acpi_build_tables_cleanup(&tables, false);
+}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build-pc.c
similarity index 94%
rename from hw/i386/acpi-build.c
rename to hw/i386/acpi-build-pc.c
index 9a19c14e661b..cad44160ff3a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build-pc.c
@@ -24,6 +24,7 @@
 #include "qapi/error.h"
 #include "qapi/qmp/qnum.h"
 #include "acpi-build.h"
+#include "acpi-build-internal.h"
 #include "qemu/bitmap.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
@@ -81,14 +82,6 @@
 
 #define ACPI_BUILD_TABLE_SIZE             0x20000
 
-/* #define DEBUG_ACPI_BUILD */
-#ifdef DEBUG_ACPI_BUILD
-#define ACPI_BUILD_DPRINTF(fmt, ...)        \
-    do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
-#else
-#define ACPI_BUILD_DPRINTF(fmt, ...)
-#endif
-
 /* Default IOAPIC ID */
 #define ACPI_BUILD_IOAPIC_ID 0x0
 
@@ -120,12 +113,6 @@ typedef struct AcpiBuildPciBusHotplugState {
     bool pcihp_bridge_en;
 } AcpiBuildPciBusHotplugState;
 
-typedef struct FwCfgTPMConfig {
-    uint32_t tpmppi_address;
-    uint8_t tpm_version;
-    uint8_t tpmppi_version;
-} QEMU_PACKED FwCfgTPMConfig;
-
 static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg);
 
 static void init_common_fadt_data(MachineState *ms, Object *o,
@@ -2710,17 +2697,6 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linker)
                  "IVRS", table_data->len - iommu_start, 1, NULL, NULL);
 }
 
-typedef
-struct AcpiBuildState {
-    /* Copy of table in RAM (for patching). */
-    MemoryRegion *table_mr;
-    /* Is table patched? */
-    uint8_t patched;
-    void *rsdp;
-    MemoryRegion *rsdp_mr;
-    MemoryRegion *linker_mr;
-} AcpiBuildState;
-
 static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
 {
     Object *pci_host;
@@ -2746,8 +2722,7 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
     return true;
 }
 
-static
-void acpi_build(AcpiBuildTables *tables, MachineState *machine)
+void acpi_build_pc(AcpiBuildTables *tables, MachineState *machine)
 {
     PCMachineState *pcms = PC_MACHINE(machine);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
@@ -2948,149 +2923,3 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
     /* Cleanup memory that's no longer used. */
     g_array_free(table_offsets, true);
 }
-
-static void acpi_ram_update(MemoryRegion *mr, GArray *data)
-{
-    uint32_t size = acpi_data_len(data);
-
-    /* Make sure RAM size is correct - in case it got changed e.g. by migration */
-    memory_region_ram_resize(mr, size, &error_abort);
-
-    memcpy(memory_region_get_ram_ptr(mr), data->data, size);
-    memory_region_set_dirty(mr, 0, size);
-}
-
-static void acpi_build_update(void *build_opaque)
-{
-    AcpiBuildState *build_state = build_opaque;
-    AcpiBuildTables tables;
-
-    /* No state to update or already patched? Nothing to do. */
-    if (!build_state || build_state->patched) {
-        return;
-    }
-    build_state->patched = 1;
-
-    acpi_build_tables_init(&tables);
-
-    acpi_build(&tables, MACHINE(qdev_get_machine()));
-
-    acpi_ram_update(build_state->table_mr, tables.table_data);
-
-    if (build_state->rsdp) {
-        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
-    } else {
-        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
-    }
-
-    acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
-    acpi_build_tables_cleanup(&tables, true);
-}
-
-static void acpi_build_reset(void *build_opaque)
-{
-    AcpiBuildState *build_state = build_opaque;
-    build_state->patched = 0;
-}
-
-static const VMStateDescription vmstate_acpi_build = {
-    .name = "acpi_build",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .fields = (VMStateField[]) {
-        VMSTATE_UINT8(patched, AcpiBuildState),
-        VMSTATE_END_OF_LIST()
-    },
-};
-
-void acpi_setup(void)
-{
-    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
-    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
-    X86MachineState *x86ms = X86_MACHINE(pcms);
-    AcpiBuildTables tables;
-    AcpiBuildState *build_state;
-    Object *vmgenid_dev;
-    TPMIf *tpm;
-    static FwCfgTPMConfig tpm_config;
-
-    if (!x86ms->fw_cfg) {
-        ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
-        return;
-    }
-
-    if (!pcms->acpi_build_enabled) {
-        ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
-        return;
-    }
-
-    if (!acpi_enabled) {
-        ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n");
-        return;
-    }
-
-    build_state = g_malloc0(sizeof *build_state);
-
-    acpi_build_tables_init(&tables);
-    acpi_build(&tables, MACHINE(pcms));
-
-    /* Now expose it all to Guest */
-    build_state->table_mr = acpi_add_rom_blob(acpi_build_update,
-                                              build_state, tables.table_data,
-                                              ACPI_BUILD_TABLE_FILE,
-                                              ACPI_BUILD_TABLE_MAX_SIZE);
-    assert(build_state->table_mr != NULL);
-
-    build_state->linker_mr =
-        acpi_add_rom_blob(acpi_build_update, build_state,
-                          tables.linker->cmd_blob, "etc/table-loader", 0);
-
-    fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
-                    tables.tcpalog->data, acpi_data_len(tables.tcpalog));
-
-    tpm = tpm_find();
-    if (tpm && object_property_get_bool(OBJECT(tpm), "ppi", &error_abort)) {
-        tpm_config = (FwCfgTPMConfig) {
-            .tpmppi_address = cpu_to_le32(TPM_PPI_ADDR_BASE),
-            .tpm_version = tpm_get_version(tpm),
-            .tpmppi_version = TPM_PPI_VERSION_1_30
-        };
-        fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config",
-                        &tpm_config, sizeof tpm_config);
-    }
-
-    vmgenid_dev = find_vmgenid_dev();
-    if (vmgenid_dev) {
-        vmgenid_add_fw_cfg(VMGENID(vmgenid_dev), x86ms->fw_cfg,
-                           tables.vmgenid);
-    }
-
-    if (!pcmc->rsdp_in_ram) {
-        /*
-         * Keep for compatibility with old machine types.
-         * Though RSDP is small, its contents isn't immutable, so
-         * we'll update it along with the rest of tables on guest access.
-         */
-        uint32_t rsdp_size = acpi_data_len(tables.rsdp);
-
-        build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
-        fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE,
-                                 acpi_build_update, NULL, build_state,
-                                 build_state->rsdp, rsdp_size, true);
-        build_state->rsdp_mr = NULL;
-    } else {
-        build_state->rsdp = NULL;
-        build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
-                                                 build_state, tables.rsdp,
-                                                 ACPI_BUILD_RSDP_FILE, 0);
-    }
-
-    qemu_register_reset(acpi_build_reset, build_state);
-    acpi_build_reset(build_state);
-    vmstate_register(NULL, 0, &vmstate_acpi_build, build_state);
-
-    /* Cleanup tables but don't free the memory: we track it
-     * in build_state.
-     */
-    acpi_build_tables_cleanup(&tables, false);
-}
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 8ce1b265335b..e777f1ac9fc3 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -16,4 +16,5 @@ obj-$(CONFIG_VMMOUSE) += vmmouse.o
 obj-$(CONFIG_PC) += port92.o
 
 obj-y += kvmvapic.o
-obj-$(CONFIG_PC) += acpi-build.o
+obj-$(CONFIG_PC) += acpi-build-core.o
+obj-$(CONFIG_PC) += acpi-build-pc.o
-- 
2.18.2



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

* [PATCH 2/6] acpi: make build_madt() more generic.
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
  2020-03-27 12:11 ` [PATCH 1/6] acpi: split hw/i386/acpi-build.c Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 12:11 ` [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg() Gerd Hoffmann
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, Richard Henderson

Remove PCMachineState dependency from build_madt().
Pass AcpiDeviceIf as separate argument instead of
depending on PCMachineState->acpi_dev.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i386/acpi-build-pc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index cad44160ff3a..a9dbf080566b 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -347,14 +347,13 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
 }
 
 static void
-build_madt(GArray *table_data, BIOSLinker *linker, PCMachineState *pcms)
+build_madt(GArray *table_data, BIOSLinker *linker,
+           X86MachineState *x86ms, AcpiDeviceIf *adev)
 {
-    MachineClass *mc = MACHINE_GET_CLASS(pcms);
-    X86MachineState *x86ms = X86_MACHINE(pcms);
-    const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(pcms));
+    MachineClass *mc = MACHINE_GET_CLASS(x86ms);
+    const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms));
     int madt_start = table_data->len;
-    AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(pcms->acpi_dev);
-    AcpiDeviceIf *adev = ACPI_DEVICE_IF(pcms->acpi_dev);
+    AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(adev);
     bool x2apic_mode = false;
 
     AcpiMultipleApicTable *madt;
@@ -2782,7 +2781,8 @@ void acpi_build_pc(AcpiBuildTables *tables, MachineState *machine)
     aml_len += tables_blob->len - fadt;
 
     acpi_add_table(table_offsets, tables_blob);
-    build_madt(tables_blob, tables->linker, pcms);
+    build_madt(tables_blob, tables->linker, x86ms,
+               ACPI_DEVICE_IF(pcms->acpi_dev));
 
     vmgenid_dev = find_vmgenid_dev();
     if (vmgenid_dev) {
-- 
2.18.2



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

* [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg()
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
  2020-03-27 12:11 ` [PATCH 1/6] acpi: split hw/i386/acpi-build.c Gerd Hoffmann
  2020-03-27 12:11 ` [PATCH 2/6] acpi: make build_madt() more generic Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 14:18   ` Igor Mammedov
  2020-03-27 12:11 ` [PATCH 4/6] acpi: drop pointless _STA method Gerd Hoffmann
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, Richard Henderson

Add helper function to add fw_cfg device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/i386/acpi-build-pc.c | 51 ++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index a9dbf080566b..3fdae2984b91 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -1809,6 +1809,33 @@ static void build_smb0(Aml *table, I2CBus *smbus, int devnr, int func)
     aml_append(table, scope);
 }
 
+static void acpi_dsdt_add_fw_cfg(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);
+}
+
 static void
 build_dsdt(GArray *table_data, BIOSLinker *linker,
            AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -2088,30 +2115,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);
+        acpi_dsdt_add_fw_cfg(scope, x86ms->fw_cfg);
         aml_append(dsdt, scope);
     }
 
-- 
2.18.2



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

* [PATCH 4/6] acpi: drop pointless _STA method
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2020-03-27 12:11 ` [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg() Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 14:21   ` Igor Mammedov
  2020-03-27 12:11 ` [PATCH 5/6] acpi: serial: don't use " Gerd Hoffmann
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, 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-pc.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index 3fdae2984b91..18ca2fd46961 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -1137,14 +1137,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));
@@ -1159,14 +1156,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));
@@ -2229,9 +2223,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] 18+ messages in thread

* [PATCH 5/6] acpi: serial: don't use _STA method
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2020-03-27 12:11 ` [PATCH 4/6] acpi: drop pointless _STA method Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 14:33   ` Igor Mammedov
  2020-03-27 12:11 ` [PATCH 6/6] acpi: parallel: " Gerd Hoffmann
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, 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-pc.c | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index 18ca2fd46961..97af5eac3d79 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -1204,50 +1204,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)
@@ -1265,8 +1249,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] 18+ messages in thread

* [PATCH 6/6] acpi: parallel: don't use _STA method
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2020-03-27 12:11 ` [PATCH 5/6] acpi: serial: don't use " Gerd Hoffmann
@ 2020-03-27 12:11 ` Gerd Hoffmann
  2020-03-27 14:35   ` Igor Mammedov
  2020-03-27 12:47 ` [PATCH 0/6] acpi: i386 tweaks no-reply
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-27 12:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Michael S. Tsirkin, Gerd Hoffmann,
	Paolo Bonzini, 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-pc.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
index 97af5eac3d79..8bab105d5e44 100644
--- a/hw/i386/acpi-build-pc.c
+++ b/hw/i386/acpi-build-pc.c
@@ -1169,39 +1169,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)
@@ -1248,7 +1235,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] 18+ messages in thread

* Re: [PATCH 0/6] acpi: i386 tweaks
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (5 preceding siblings ...)
  2020-03-27 12:11 ` [PATCH 6/6] acpi: parallel: " Gerd Hoffmann
@ 2020-03-27 12:47 ` no-reply
  2020-03-27 12:49 ` no-reply
  2020-03-29 12:46 ` Michael S. Tsirkin
  8 siblings, 0 replies; 18+ messages in thread
From: no-reply @ 2020-03-27 12:47 UTC (permalink / raw)
  To: kraxel; +Cc: ehabkost, mst, qemu-devel, kraxel, pbonzini, rth

Patchew URL: https://patchew.org/QEMU/20200327121111.1530-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
==6166==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 6 fdc-test /x86_64/fdc/relative_seek
---
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" 
==6214==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6214==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffee1ef6000; bottom 0x7f7703bca000; size: 0x0087de32c000 (583548452864)
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 11 test-aio /aio/event/wait
PASS 12 test-aio /aio/event/flush
PASS 13 test-aio /aio/event/wait/no-flush-cb
==6229==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
---
PASS 12 fdc-test /x86_64/fdc/read_no_dma_19
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" 
==6237==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 28 test-aio /aio-gsource/timer/schedule
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" 
==6246==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
==6243==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
==6263==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-aio-multithread /aio/multi/schedule
PASS 3 ide-test /x86_64/ide/bmdma/simple_rw
==6274==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
PASS 3 test-aio-multithread /aio/multi/mutex/contended
==6280==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" 
==6302==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" 
==6308==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
==6305==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 14 test-hbitmap /hbitmap/set/twice
PASS 15 test-hbitmap /hbitmap/set/overlap
PASS 16 test-hbitmap /hbitmap/reset/empty
==6383==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 17 test-hbitmap /hbitmap/reset/general
PASS 18 test-hbitmap /hbitmap/reset/all
PASS 19 test-hbitmap /hbitmap/truncate/nop
---
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" 
==6390==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" 
==6429==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" 
==6433==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" 
==6437==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" 
==6441==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" 
==6445==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" 
==6465==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" 
---
PASS 3 test-xbzrle /xbzrle/encode_decode_unchanged
PASS 4 test-xbzrle /xbzrle/encode_decode_1_byte
PASS 5 test-xbzrle /xbzrle/encode_decode_overflow
==6471==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 test-xbzrle /xbzrle/encode_decode
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-vmstate -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-vmstate" 
PASS 1 test-vmstate /vmstate/tmp_struct
---
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
PASS 2 test-rcu-list /rcu/qlist/short-few
==6535==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
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
==6595==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 2 test-rcu-tailq /rcu/qtailq/short-few
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" 
==6640==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-rcu-slist /rcu/qslist/single-threaded
PASS 2 test-rcu-slist /rcu/qslist/short-few
PASS 3 test-rcu-slist /rcu/qslist/long-many
---
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" 
==6680==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6686==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
==6692==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6692==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd96b1b000; bottom 0x7ff59f9fe000; size: 0x0007f711d000 (34209910784)
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
==6712==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
==6717==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
==6729==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
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" 
PASS 10 ide-test /x86_64/ide/flush/retry_isa
---
PASS 3 test-qdev-global-props /qdev/properties/dynamic/global
PASS 4 test-qdev-global-props /qdev/properties/global/subclass
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/check-qom-interface -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="check-qom-interface" 
==6738==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
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" 
---
PASS 9 test-keyval /keyval/visit/alternate
PASS 10 test-keyval /keyval/visit/any
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-write-threshold -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-write-threshold" 
==6769==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-write-threshold /write-threshold/not-set-on-init
PASS 2 test-write-threshold /write-threshold/set-get
PASS 3 test-write-threshold /write-threshold/multi-set-get
---
PASS 1 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectserver
PASS 2 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectclient
PASS 3 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca1
==6807==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" 
==6821==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca2
PASS 1 ahci-test /x86_64/ahci/sanity
==6827==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ahci-test /x86_64/ahci/pci_spec
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
==6833==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 3 ahci-test /x86_64/ahci/pci_enable
PASS 10 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver2
PASS 11 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver3
==6839==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 ahci-test /x86_64/ahci/hba_spec
==6845==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 5 ahci-test /x86_64/ahci/hba_enable
PASS 13 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver5
PASS 14 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver6
==6851==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 ahci-test /x86_64/ahci/identify
PASS 15 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver7
PASS 16 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badserver1
---
PASS 32 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive1
PASS 33 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive2
PASS 34 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive3
==6857==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 ahci-test /x86_64/ahci/max
PASS 35 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain1
PASS 36 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain2
---
PASS 38 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingserver
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" 
==6863==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 ahci-test /x86_64/ahci/reset
PASS 1 test-crypto-tlssession /qcrypto/tlssession/psk
PASS 2 test-crypto-tlssession /qcrypto/tlssession/basicca
==6873==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6873==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffa12b6000; bottom 0x7fa363bfe000; size: 0x005c3d6b8000 (396167446528)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 9 ahci-test /x86_64/ahci/io/pio/lba28/simple/zero
==6879==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6879==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffbbe69000; bottom 0x7fd9e83fe000; size: 0x0025d3a6b000 (162464706560)
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
==6885==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-crypto-tlssession /qcrypto/tlssession/differentca
==6885==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffff3b5c000; bottom 0x7f32f15fe000; size: 0x00cd0255e000 (880507478016)
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
==6891==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6891==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffefab57000; bottom 0x7f4ff75fe000; size: 0x00af03559000 (751675215872)
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 4 test-crypto-tlssession /qcrypto/tlssession/altname1
==6897==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6897==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe3f7d7000; bottom 0x7f358bffe000; size: 0x00c8b37d9000 (862004809728)
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 5 test-crypto-tlssession /qcrypto/tlssession/altname2
==6903==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6903==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc15cde000; bottom 0x7ff961ffe000; size: 0x0002b3ce0000 (11606556672)
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 6 test-crypto-tlssession /qcrypto/tlssession/altname3
==6909==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 test-crypto-tlssession /qcrypto/tlssession/altname4
PASS 8 test-crypto-tlssession /qcrypto/tlssession/altname5
==6909==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff9aa4e000; bottom 0x7f5ada97c000; size: 0x00a4c00d2000 (707596722176)
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 9 test-crypto-tlssession /qcrypto/tlssession/altname6
==6915==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-crypto-tlssession /qcrypto/tlssession/wildcard1
==6915==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc0d3ea000; bottom 0x7f605b324000; size: 0x009bb20c6000 (668707086336)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 11 test-crypto-tlssession /qcrypto/tlssession/wildcard2
PASS 12 test-crypto-tlssession /qcrypto/tlssession/wildcard3
PASS 16 ahci-test /x86_64/ahci/io/pio/lba28/long/low
PASS 13 test-crypto-tlssession /qcrypto/tlssession/wildcard4
==6921==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-crypto-tlssession /qcrypto/tlssession/wildcard5
==6921==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd9efa2000; bottom 0x7f0865324000; size: 0x00f539c7e000 (1053236387840)
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-crypto-tlssession /qcrypto/tlssession/wildcard6
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" 
==6927==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
==6941==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qga /qga/sync-delimited
PASS 2 test-qga /qga/sync
PASS 3 test-qga /qga/ping
---
PASS 16 test-qga /qga/invalid-args
PASS 17 test-qga /qga/fsfreeze-status
PASS 19 ahci-test /x86_64/ahci/io/pio/lba28/short/low
==6950==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 20 ahci-test /x86_64/ahci/io/pio/lba28/short/high
PASS 18 test-qga /qga/blacklist
PASS 19 test-qga /qga/config
PASS 20 test-qga /qga/guest-exec
PASS 21 test-qga /qga/guest-exec-invalid
==6956==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6956==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffed4203000; bottom 0x7f59b5dfe000; size: 0x00a51e405000 (709177135104)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 21 ahci-test /x86_64/ahci/io/pio/lba48/simple/zero
==6974==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==6974==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffda37c0000; bottom 0x7f999cffe000; size: 0x0064067c2000 (429605527552)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 22 test-qga /qga/guest-get-osinfo
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-timed-average -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-timed-average" 
PASS 1 test-timed-average /timed-average/average
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" 
==6981==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
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" 
==6981==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc99c07000; bottom 0x7faacb1fe000; size: 0x0051cea09000 (351358980096)
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" 
==7004==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" 
==7004==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffbb06e000; bottom 0x7f359d9fe000; size: 0x00ca1d670000 (868076683264)
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 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" 
==7024==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7024==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffda0150000; bottom 0x7fed821fe000; size: 0x00101df52000 (69222080512)
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
PASS 1 test-io-channel-tls /qio/channel/tls/basic
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-command -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-command" 
==7084==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-command /io/channel/command/fifo/sync
PASS 2 test-io-channel-command /io/channel/command/fifo/async
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" 
==7084==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd5c27f000; bottom 0x7f691a1fe000; size: 0x009442081000 (636762984448)
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
---
PASS 3 test-base64 /util/base64/not-nul-terminated
PASS 4 test-base64 /util/base64/invalid-chars
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-pbkdf -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-pbkdf" 
==7100==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-pbkdf /crypto/pbkdf/rfc3962/sha1/iter1
PASS 2 test-crypto-pbkdf /crypto/pbkdf/rfc3962/sha1/iter2
PASS 3 test-crypto-pbkdf /crypto/pbkdf/rfc3962/sha1/iter1200a
---
PASS 17 test-crypto-pbkdf /crypto/pbkdf/nonrfc/sha384/iter1200
PASS 18 test-crypto-pbkdf /crypto/pbkdf/nonrfc/ripemd160/iter1200
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-ivgen -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-ivgen" 
==7100==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd14d74000; bottom 0x7ff42fffe000; size: 0x0008e4d76000 (38199058432)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-crypto-ivgen /crypto/ivgen/plain/1
---
PASS 17 test-crypto-xts /crypto/xts/t-21-key-32-ptx-31/basic
PASS 18 test-crypto-xts /crypto/xts/t-21-key-32-ptx-31/unaligned
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" 
==7121==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
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" 
==7121==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe5d37b000; bottom 0x7fc249f7c000; size: 0x003c133ff000 (258020995072)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-logging /logging/parse_range
---
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" 
==7140==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 28 ahci-test /x86_64/ahci/io/pio/lba48/long/low
PASS 1 test-replication /replication/primary/read
PASS 2 test-replication /replication/primary/write
==7144==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7144==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffeae121000; bottom 0x7fa3fbd24000; size: 0x005ab23fd000 (389537583104)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 3 test-replication /replication/primary/start
---
PASS 5 test-replication /replication/primary/do_checkpoint
PASS 6 test-replication /replication/primary/get_error_all
PASS 29 ahci-test /x86_64/ahci/io/pio/lba48/long/high
==7150==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 30 ahci-test /x86_64/ahci/io/pio/lba48/short/zero
PASS 7 test-replication /replication/secondary/read
==7156==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 test-replication /replication/secondary/write
PASS 31 ahci-test /x86_64/ahci/io/pio/lba48/short/low
==7162==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
==7168==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 33 ahci-test /x86_64/ahci/io/dma/lba28/fragmented
==7140==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe2351d000; bottom 0x7fc1be634000; size: 0x003c64ee9000 (259391393792)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
==7175==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 test-replication /replication/secondary/start
PASS 34 ahci-test /x86_64/ahci/io/dma/lba28/retry
==7197==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
==7203==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 36 ahci-test /x86_64/ahci/io/dma/lba28/simple/low
==7209==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
PASS 10 test-replication /replication/secondary/stop
==7215==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
==7221==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 39 ahci-test /x86_64/ahci/io/dma/lba28/double/low
==7227==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 40 ahci-test /x86_64/ahci/io/dma/lba28/double/high
==7233==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7233==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffdf4d2000; bottom 0x7f35365fd000; size: 0x00caa8ed5000 (870417518592)
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
==7240==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7240==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffeab912000; bottom 0x7f769e9fd000; size: 0x00880cf15000 (584332693504)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 12 test-replication /replication/secondary/do_checkpoint
PASS 42 ahci-test /x86_64/ahci/io/dma/lba28/long/low
==7247==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7247==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd2abe1000; bottom 0x7f02f3ffd000; size: 0x00fa36be4000 (1074660261888)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 13 test-replication /replication/secondary/get_error_all
PASS 43 ahci-test /x86_64/ahci/io/dma/lba28/long/high
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" 
==7254==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
==7263==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
==7269==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
==7275==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
==7281==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
==7287==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
==7293==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
==7299==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
==7305==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
==7311==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7311==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffceecb8000; bottom 0x7f75af1fd000; size: 0x00873fabb000 (580888801280)
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
==7318==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7318==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc8b1ba000; bottom 0x7f2cd8d23000; size: 0x00cfb2497000 (892049387520)
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
==7325==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7325==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe7de21000; bottom 0x7f347effd000; size: 0x00c9fee24000 (867564666880)
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
==7332==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
==7338==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
==7344==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
==7350==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
==7356==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
==7362==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
==7368==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
==7374==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7380==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
==7388==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7394==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
==7402==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7408==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 65 ahci-test /x86_64/ahci/migrate/dma/simple
==7416==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7422==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
==7430==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7436==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
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" 
---
PASS 4 test-uuid /uuid/unparse
PASS 5 test-uuid /uuid/unparse_strdup
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/ptimer-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ptimer-test" 
==7444==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ptimer-test /ptimer/set_count policy=default
PASS 2 ptimer-test /ptimer/set_limit policy=default
PASS 3 ptimer-test /ptimer/oneshot policy=default
---
PASS 21 test-qgraph /qgraph/test_two_test_same_interface
PASS 22 test-qgraph /qgraph/test_test_in_path
PASS 23 test-qgraph /qgraph/test_double_edge
==7463==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
==7471==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
==7476==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
==7482==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
==7488==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
==7494==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7494==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffeeedb2000; bottom 0x7fe9fb7fe000; size: 0x0014f35b4000 (89982189568)
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
==7500==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
==7514==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
==7520==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
==7526==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
==7532==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
==7538==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
==7544==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
==7550==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
==7556==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
==7561==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
==7567==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7571==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7575==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7579==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7583==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7587==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7591==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7595==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7598==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
==7605==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7609==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7613==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7617==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7621==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7625==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7629==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7633==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7636==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
==7643==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7647==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7651==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7655==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7659==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7663==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7667==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7671==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7674==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
==7681==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7685==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7689==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7693==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7696==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
==7703==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7707==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7710==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
==7717==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7721==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7725==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7729==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7732==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
==7739==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7743==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7747==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7751==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7754==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
==7823==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-J32XH0], 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=615d4669a3fb4ca0a44ad1e5b03456b4', '-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-ol_hp4ie/src/docker-src.2020-03-27-08.20.19.4073:/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=615d4669a3fb4ca0a44ad1e5b03456b4
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-ol_hp4ie/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    27m28.842s
user    0m8.539s


The full log is available at
http://patchew.org/logs/20200327121111.1530-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] 18+ messages in thread

* Re: [PATCH 0/6] acpi: i386 tweaks
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (6 preceding siblings ...)
  2020-03-27 12:47 ` [PATCH 0/6] acpi: i386 tweaks no-reply
@ 2020-03-27 12:49 ` no-reply
  2020-03-29 12:46 ` Michael S. Tsirkin
  8 siblings, 0 replies; 18+ messages in thread
From: no-reply @ 2020-03-27 12:49 UTC (permalink / raw)
  To: kraxel; +Cc: ehabkost, mst, qemu-devel, kraxel, pbonzini, rth

Patchew URL: https://patchew.org/QEMU/20200327121111.1530-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-I746H0], 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    iotest-qcow2: 030
  TEST    iotest-qcow2: 031
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=d4c06e1dcd6f44b4bcf9221f29a5310f', '-u', '1001', '--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/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-3czf47ym/src/docker-src.2020-03-27-08.35.00.15705:/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=d4c06e1dcd6f44b4bcf9221f29a5310f
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-3czf47ym/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    14m3.408s
user    0m8.775s


The full log is available at
http://patchew.org/logs/20200327121111.1530-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] 18+ messages in thread

* Re: [PATCH 1/6] acpi: split hw/i386/acpi-build.c
  2020-03-27 12:11 ` [PATCH 1/6] acpi: split hw/i386/acpi-build.c Gerd Hoffmann
@ 2020-03-27 14:17   ` Igor Mammedov
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Mammedov @ 2020-03-27 14:17 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Fri, 27 Mar 2020 13:11:06 +0100
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Split hw/i386/acpi-build.c into pieces:
I just suggested slightly different split/generalization on 'microvm: add acpi support' thread

basic idea is to move common arm/pc pieces to hw/acpi/

leave alone acpi_setup() in acpi-build.c as it has too much of legacy/non necessary features
and generalize ARM's acpi_setup() to make it reusable with microvm
(put it somewhere in hw/acpi/)


> 
> acpi-build-internal.h
>   Internal header file for acpi-buid-*.c
> 
> acpi-build-core.c
>   The acpi_setup() function + dependencies.
>   The acpi_build() function simply calls acpi_build_pc() for now,
>   at some point in the future this will dispatch into machine-type
>   specific build functions.
> 
> acpi-build-pc.c
>   The acpi_build_pc() function + dependencies.
>   The bulk of the old acpi-build.c file is here now.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/i386/acpi-build-internal.h             |  35 ++++
>  hw/i386/acpi-build-core.c                 | 191 ++++++++++++++++++++++
>  hw/i386/{acpi-build.c => acpi-build-pc.c} | 175 +-------------------
>  hw/i386/Makefile.objs                     |   3 +-
>  4 files changed, 230 insertions(+), 174 deletions(-)
>  create mode 100644 hw/i386/acpi-build-internal.h
>  create mode 100644 hw/i386/acpi-build-core.c
>  rename hw/i386/{acpi-build.c => acpi-build-pc.c} (94%)
> 
> diff --git a/hw/i386/acpi-build-internal.h b/hw/i386/acpi-build-internal.h
> new file mode 100644
> index 000000000000..5e783d85dde6
> --- /dev/null
> +++ b/hw/i386/acpi-build-internal.h
> @@ -0,0 +1,35 @@
> +
> +#ifndef HW_I386_ACPI_BUILD_INTERNAL_H
> +#define HW_I386_ACPI_BUILD_INTERNAL_H
> +
> +#include "hw/acpi/aml-build.h"
> +
> +/* #define DEBUG_ACPI_BUILD */
> +#ifdef DEBUG_ACPI_BUILD
> +#define ACPI_BUILD_DPRINTF(fmt, ...)        \
> +    do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
> +#else
> +#define ACPI_BUILD_DPRINTF(fmt, ...)
> +#endif
> +
> +typedef
> +struct AcpiBuildState {
> +    /* Copy of table in RAM (for patching). */
> +    MemoryRegion *table_mr;
> +    /* Is table patched? */
> +    uint8_t patched;
> +    void *rsdp;
> +    MemoryRegion *rsdp_mr;
> +    MemoryRegion *linker_mr;
> +} AcpiBuildState;
> +
> +typedef struct FwCfgTPMConfig {
> +    uint32_t tpmppi_address;
> +    uint8_t tpm_version;
> +    uint8_t tpmppi_version;
> +} QEMU_PACKED FwCfgTPMConfig;

Is it going to be used by microvm?
(at that rate of migrating features we are going to make full PC out of it :) )

> +
> +/* acpi-build-pc.c */
> +void acpi_build_pc(AcpiBuildTables *tables, MachineState *machine);
> +
> +#endif
> diff --git a/hw/i386/acpi-build-core.c b/hw/i386/acpi-build-core.c
> new file mode 100644
> index 000000000000..f0968b4bb594
> --- /dev/null
> +++ b/hw/i386/acpi-build-core.c
> @@ -0,0 +1,191 @@
> +/* Support for generating ACPI tables and passing them to Guests
> + *
> + * Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
> + * Copyright (C) 2006 Fabrice Bellard
> + * Copyright (C) 2013 Red Hat Inc
> + *
> + * Author: Michael S. Tsirkin <mst@redhat.com>
> + *
> + * 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 "qapi/error.h"
> +
> +#include "exec/memory.h"
> +#include "hw/acpi/acpi.h"
> +#include "hw/acpi/aml-build.h"
> +#include "hw/acpi/bios-linker-loader.h"
> +#include "hw/acpi/tpm.h"
> +#include "hw/acpi/utils.h"
> +#include "hw/acpi/vmgenid.h"
> +#include "hw/boards.h"
> +#include "hw/i386/pc.h"
> +#include "migration/vmstate.h"
> +#include "sysemu/reset.h"
> +#include "sysemu/tpm.h"
> +
> +#include "acpi-build.h"
> +#include "acpi-build-internal.h"
> +
> +static void acpi_build(AcpiBuildTables *tables, MachineState *machine)
> +{
> +    acpi_build_pc(tables, machine);
> +}
> +
> +static void acpi_ram_update(MemoryRegion *mr, GArray *data)
> +{
> +    uint32_t size = acpi_data_len(data);
> +
> +    /* Make sure RAM size is correct - in case it got changed e.g. by migration */
> +    memory_region_ram_resize(mr, size, &error_abort);
> +
> +    memcpy(memory_region_get_ram_ptr(mr), data->data, size);
> +    memory_region_set_dirty(mr, 0, size);
> +}
> +
> +static void acpi_build_update(void *build_opaque)
> +{
> +    AcpiBuildState *build_state = build_opaque;
> +    AcpiBuildTables tables;
> +
> +    /* No state to update or already patched? Nothing to do. */
> +    if (!build_state || build_state->patched) {
> +        return;
> +    }
> +    build_state->patched = 1;
> +
> +    acpi_build_tables_init(&tables);
> +
> +    acpi_build(&tables, MACHINE(qdev_get_machine()));
> +
> +    acpi_ram_update(build_state->table_mr, tables.table_data);
> +
> +    if (build_state->rsdp) {
> +        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
> +    } else {
> +        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
> +    }
> +
> +    acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
> +    acpi_build_tables_cleanup(&tables, true);
> +}
> +
> +static void acpi_build_reset(void *build_opaque)
> +{
> +    AcpiBuildState *build_state = build_opaque;
> +    build_state->patched = 0;
> +}
> +
> +static const VMStateDescription vmstate_acpi_build = {
> +    .name = "acpi_build",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .fields = (VMStateField[]) {
> +        VMSTATE_UINT8(patched, AcpiBuildState),
> +        VMSTATE_END_OF_LIST()
> +    },
> +};
> +
> +void acpi_setup(void)
> +{
> +    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
> +    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
> +    X86MachineState *x86ms = X86_MACHINE(pcms);
> +    AcpiBuildTables tables;
> +    AcpiBuildState *build_state;
> +    Object *vmgenid_dev;
> +    TPMIf *tpm;
> +    static FwCfgTPMConfig tpm_config;
> +
> +    if (!x86ms->fw_cfg) {
> +        ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
> +        return;
> +    }
> +
> +    if (!pcms->acpi_build_enabled) {
> +        ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
> +        return;
> +    }
> +
> +    if (!acpi_enabled) {
> +        ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n");
> +        return;
> +    }
> +
> +    build_state = g_malloc0(sizeof *build_state);
> +
> +    acpi_build_tables_init(&tables);
> +    acpi_build(&tables, MACHINE(pcms));
> +
> +    /* Now expose it all to Guest */
> +    build_state->table_mr = acpi_add_rom_blob(acpi_build_update,
> +                                              build_state, tables.table_data,
> +                                              ACPI_BUILD_TABLE_FILE,
> +                                              ACPI_BUILD_TABLE_MAX_SIZE);
> +    assert(build_state->table_mr != NULL);
> +
> +    build_state->linker_mr =
> +        acpi_add_rom_blob(acpi_build_update, build_state,
> +                          tables.linker->cmd_blob, "etc/table-loader", 0);
> +
> +    fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
> +                    tables.tcpalog->data, acpi_data_len(tables.tcpalog));
> +
> +    tpm = tpm_find();
> +    if (tpm && object_property_get_bool(OBJECT(tpm), "ppi", &error_abort)) {
> +        tpm_config = (FwCfgTPMConfig) {
> +            .tpmppi_address = cpu_to_le32(TPM_PPI_ADDR_BASE),
> +            .tpm_version = tpm_get_version(tpm),
> +            .tpmppi_version = TPM_PPI_VERSION_1_30
> +        };
> +        fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config",
> +                        &tpm_config, sizeof tpm_config);
> +    }
> +
> +    vmgenid_dev = find_vmgenid_dev();
> +    if (vmgenid_dev) {
> +        vmgenid_add_fw_cfg(VMGENID(vmgenid_dev), x86ms->fw_cfg,
> +                           tables.vmgenid);
> +    }
> +
> +    if (!pcmc->rsdp_in_ram) {
> +        /*
> +         * Keep for compatibility with old machine types.
> +         * Though RSDP is small, its contents isn't immutable, so
> +         * we'll update it along with the rest of tables on guest access.
> +         */
> +        uint32_t rsdp_size = acpi_data_len(tables.rsdp);
> +
> +        build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
> +        fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE,
> +                                 acpi_build_update, NULL, build_state,
> +                                 build_state->rsdp, rsdp_size, true);
> +        build_state->rsdp_mr = NULL;
> +    } else {
> +        build_state->rsdp = NULL;
> +        build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
> +                                                 build_state, tables.rsdp,
> +                                                 ACPI_BUILD_RSDP_FILE, 0);
> +    }
> +
> +    qemu_register_reset(acpi_build_reset, build_state);
> +    acpi_build_reset(build_state);
> +    vmstate_register(NULL, 0, &vmstate_acpi_build, build_state);
> +
> +    /* Cleanup tables but don't free the memory: we track it
> +     * in build_state.
> +     */
> +    acpi_build_tables_cleanup(&tables, false);
> +}
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build-pc.c
> similarity index 94%
> rename from hw/i386/acpi-build.c
> rename to hw/i386/acpi-build-pc.c
> index 9a19c14e661b..cad44160ff3a 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -24,6 +24,7 @@
>  #include "qapi/error.h"
>  #include "qapi/qmp/qnum.h"
>  #include "acpi-build.h"
> +#include "acpi-build-internal.h"
>  #include "qemu/bitmap.h"
>  #include "qemu/error-report.h"
>  #include "hw/pci/pci.h"
> @@ -81,14 +82,6 @@
>  
>  #define ACPI_BUILD_TABLE_SIZE             0x20000
>  
> -/* #define DEBUG_ACPI_BUILD */
> -#ifdef DEBUG_ACPI_BUILD
> -#define ACPI_BUILD_DPRINTF(fmt, ...)        \
> -    do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
> -#else
> -#define ACPI_BUILD_DPRINTF(fmt, ...)
> -#endif
> -
>  /* Default IOAPIC ID */
>  #define ACPI_BUILD_IOAPIC_ID 0x0
>  
> @@ -120,12 +113,6 @@ typedef struct AcpiBuildPciBusHotplugState {
>      bool pcihp_bridge_en;
>  } AcpiBuildPciBusHotplugState;
>  
> -typedef struct FwCfgTPMConfig {
> -    uint32_t tpmppi_address;
> -    uint8_t tpm_version;
> -    uint8_t tpmppi_version;
> -} QEMU_PACKED FwCfgTPMConfig;
> -
>  static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg);
>  
>  static void init_common_fadt_data(MachineState *ms, Object *o,
> @@ -2710,17 +2697,6 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linker)
>                   "IVRS", table_data->len - iommu_start, 1, NULL, NULL);
>  }
>  
> -typedef
> -struct AcpiBuildState {
> -    /* Copy of table in RAM (for patching). */
> -    MemoryRegion *table_mr;
> -    /* Is table patched? */
> -    uint8_t patched;
> -    void *rsdp;
> -    MemoryRegion *rsdp_mr;
> -    MemoryRegion *linker_mr;
> -} AcpiBuildState;
> -
>  static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
>  {
>      Object *pci_host;
> @@ -2746,8 +2722,7 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
>      return true;
>  }
>  
> -static
> -void acpi_build(AcpiBuildTables *tables, MachineState *machine)
> +void acpi_build_pc(AcpiBuildTables *tables, MachineState *machine)
>  {
>      PCMachineState *pcms = PC_MACHINE(machine);
>      PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
> @@ -2948,149 +2923,3 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
>      /* Cleanup memory that's no longer used. */
>      g_array_free(table_offsets, true);
>  }
> -
> -static void acpi_ram_update(MemoryRegion *mr, GArray *data)
> -{
> -    uint32_t size = acpi_data_len(data);
> -
> -    /* Make sure RAM size is correct - in case it got changed e.g. by migration */
> -    memory_region_ram_resize(mr, size, &error_abort);
> -
> -    memcpy(memory_region_get_ram_ptr(mr), data->data, size);
> -    memory_region_set_dirty(mr, 0, size);
> -}
> -
> -static void acpi_build_update(void *build_opaque)
> -{
> -    AcpiBuildState *build_state = build_opaque;
> -    AcpiBuildTables tables;
> -
> -    /* No state to update or already patched? Nothing to do. */
> -    if (!build_state || build_state->patched) {
> -        return;
> -    }
> -    build_state->patched = 1;
> -
> -    acpi_build_tables_init(&tables);
> -
> -    acpi_build(&tables, MACHINE(qdev_get_machine()));
> -
> -    acpi_ram_update(build_state->table_mr, tables.table_data);
> -
> -    if (build_state->rsdp) {
> -        memcpy(build_state->rsdp, tables.rsdp->data, acpi_data_len(tables.rsdp));
> -    } else {
> -        acpi_ram_update(build_state->rsdp_mr, tables.rsdp);
> -    }
> -
> -    acpi_ram_update(build_state->linker_mr, tables.linker->cmd_blob);
> -    acpi_build_tables_cleanup(&tables, true);
> -}
> -
> -static void acpi_build_reset(void *build_opaque)
> -{
> -    AcpiBuildState *build_state = build_opaque;
> -    build_state->patched = 0;
> -}
> -
> -static const VMStateDescription vmstate_acpi_build = {
> -    .name = "acpi_build",
> -    .version_id = 1,
> -    .minimum_version_id = 1,
> -    .fields = (VMStateField[]) {
> -        VMSTATE_UINT8(patched, AcpiBuildState),
> -        VMSTATE_END_OF_LIST()
> -    },
> -};
> -
> -void acpi_setup(void)
> -{
> -    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
> -    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
> -    X86MachineState *x86ms = X86_MACHINE(pcms);
> -    AcpiBuildTables tables;
> -    AcpiBuildState *build_state;
> -    Object *vmgenid_dev;
> -    TPMIf *tpm;
> -    static FwCfgTPMConfig tpm_config;
> -
> -    if (!x86ms->fw_cfg) {
> -        ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
> -        return;
> -    }
> -
> -    if (!pcms->acpi_build_enabled) {
> -        ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
> -        return;
> -    }
> -
> -    if (!acpi_enabled) {
> -        ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n");
> -        return;
> -    }
> -
> -    build_state = g_malloc0(sizeof *build_state);
> -
> -    acpi_build_tables_init(&tables);
> -    acpi_build(&tables, MACHINE(pcms));
> -
> -    /* Now expose it all to Guest */
> -    build_state->table_mr = acpi_add_rom_blob(acpi_build_update,
> -                                              build_state, tables.table_data,
> -                                              ACPI_BUILD_TABLE_FILE,
> -                                              ACPI_BUILD_TABLE_MAX_SIZE);
> -    assert(build_state->table_mr != NULL);
> -
> -    build_state->linker_mr =
> -        acpi_add_rom_blob(acpi_build_update, build_state,
> -                          tables.linker->cmd_blob, "etc/table-loader", 0);
> -
> -    fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
> -                    tables.tcpalog->data, acpi_data_len(tables.tcpalog));
> -
> -    tpm = tpm_find();
> -    if (tpm && object_property_get_bool(OBJECT(tpm), "ppi", &error_abort)) {
> -        tpm_config = (FwCfgTPMConfig) {
> -            .tpmppi_address = cpu_to_le32(TPM_PPI_ADDR_BASE),
> -            .tpm_version = tpm_get_version(tpm),
> -            .tpmppi_version = TPM_PPI_VERSION_1_30
> -        };
> -        fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config",
> -                        &tpm_config, sizeof tpm_config);
> -    }
> -
> -    vmgenid_dev = find_vmgenid_dev();
> -    if (vmgenid_dev) {
> -        vmgenid_add_fw_cfg(VMGENID(vmgenid_dev), x86ms->fw_cfg,
> -                           tables.vmgenid);
> -    }
> -
> -    if (!pcmc->rsdp_in_ram) {
> -        /*
> -         * Keep for compatibility with old machine types.
> -         * Though RSDP is small, its contents isn't immutable, so
> -         * we'll update it along with the rest of tables on guest access.
> -         */
> -        uint32_t rsdp_size = acpi_data_len(tables.rsdp);
> -
> -        build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
> -        fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE,
> -                                 acpi_build_update, NULL, build_state,
> -                                 build_state->rsdp, rsdp_size, true);
> -        build_state->rsdp_mr = NULL;
> -    } else {
> -        build_state->rsdp = NULL;
> -        build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update,
> -                                                 build_state, tables.rsdp,
> -                                                 ACPI_BUILD_RSDP_FILE, 0);
> -    }
> -
> -    qemu_register_reset(acpi_build_reset, build_state);
> -    acpi_build_reset(build_state);
> -    vmstate_register(NULL, 0, &vmstate_acpi_build, build_state);
> -
> -    /* Cleanup tables but don't free the memory: we track it
> -     * in build_state.
> -     */
> -    acpi_build_tables_cleanup(&tables, false);
> -}
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index 8ce1b265335b..e777f1ac9fc3 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -16,4 +16,5 @@ obj-$(CONFIG_VMMOUSE) += vmmouse.o
>  obj-$(CONFIG_PC) += port92.o
>  
>  obj-y += kvmvapic.o
> -obj-$(CONFIG_PC) += acpi-build.o
> +obj-$(CONFIG_PC) += acpi-build-core.o
> +obj-$(CONFIG_PC) += acpi-build-pc.o



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

* Re: [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg()
  2020-03-27 12:11 ` [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg() Gerd Hoffmann
@ 2020-03-27 14:18   ` Igor Mammedov
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Mammedov @ 2020-03-27 14:18 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Fri, 27 Mar 2020 13:11:08 +0100
Gerd Hoffmann <kraxel@redhat.com> wrote:

> Add helper function to add fw_cfg device.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

> ---
>  hw/i386/acpi-build-pc.c | 51 ++++++++++++++++++++++-------------------
>  1 file changed, 28 insertions(+), 23 deletions(-)
> 
> diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
> index a9dbf080566b..3fdae2984b91 100644
> --- a/hw/i386/acpi-build-pc.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -1809,6 +1809,33 @@ static void build_smb0(Aml *table, I2CBus *smbus, int devnr, int func)
>      aml_append(table, scope);
>  }
>  
> +static void acpi_dsdt_add_fw_cfg(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);
> +}
> +
>  static void
>  build_dsdt(GArray *table_data, BIOSLinker *linker,
>             AcpiPmInfo *pm, AcpiMiscInfo *misc,
> @@ -2088,30 +2115,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);
> +        acpi_dsdt_add_fw_cfg(scope, x86ms->fw_cfg);
>          aml_append(dsdt, scope);
>      }
>  



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

* Re: [PATCH 4/6] acpi: drop pointless _STA method
  2020-03-27 12:11 ` [PATCH 4/6] acpi: drop pointless _STA method Gerd Hoffmann
@ 2020-03-27 14:21   ` Igor Mammedov
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Mammedov @ 2020-03-27 14:21 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Fri, 27 Mar 2020 13:11:09 +0100
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>

nice,

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

ps:

maybe somewhere in earlier patches s/acpi-build-pc.c/pc-acpi.c/

> ---
>  hw/i386/acpi-build-pc.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
> index 3fdae2984b91..18ca2fd46961 100644
> --- a/hw/i386/acpi-build-pc.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -1137,14 +1137,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));
> @@ -1159,14 +1156,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));
> @@ -2229,9 +2223,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] 18+ messages in thread

* Re: [PATCH 5/6] acpi: serial: don't use _STA method
  2020-03-27 12:11 ` [PATCH 5/6] acpi: serial: don't use " Gerd Hoffmann
@ 2020-03-27 14:33   ` Igor Mammedov
  2020-03-31 15:23     ` Gerd Hoffmann
  0 siblings, 1 reply; 18+ messages in thread
From: Igor Mammedov @ 2020-03-27 14:33 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Fri, 27 Mar 2020 13:11:10 +0100
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>
> ---
>  hw/i386/acpi-build-pc.c | 32 ++++++++------------------------
>  1 file changed, 8 insertions(+), 24 deletions(-)
> 
> diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
> index 18ca2fd46961..97af5eac3d79 100644
> --- a/hw/i386/acpi-build-pc.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -1204,50 +1204,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)) {
                                  ^^^^^^
even though acpi_setup() is a part of board code, usually it's not recommended to 
use get_system_foo() outside of machine_init()

how about fishing out present serial ports from isa device in a helper
like acpi_get_misc_info(), and then generalize AML like
   build_com_device_aml(Aml *scope, uint8_t uid, io_port, irq)
   

> +        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)
> @@ -1265,8 +1249,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] 18+ messages in thread

* Re: [PATCH 6/6] acpi: parallel: don't use _STA method
  2020-03-27 12:11 ` [PATCH 6/6] acpi: parallel: " Gerd Hoffmann
@ 2020-03-27 14:35   ` Igor Mammedov
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Mammedov @ 2020-03-27 14:35 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Fri, 27 Mar 2020 13:11:11 +0100
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>
> ---
>  hw/i386/acpi-build-pc.c | 29 ++++++++---------------------
>  1 file changed, 8 insertions(+), 21 deletions(-)
> 
> diff --git a/hw/i386/acpi-build-pc.c b/hw/i386/acpi-build-pc.c
> index 97af5eac3d79..8bab105d5e44 100644
> --- a/hw/i386/acpi-build-pc.c
> +++ b/hw/i386/acpi-build-pc.c
> @@ -1169,39 +1169,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)) {
same comment as in 5/6 applies here

> +        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)
> @@ -1248,7 +1235,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] 18+ messages in thread

* Re: [PATCH 0/6] acpi: i386 tweaks
  2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
                   ` (7 preceding siblings ...)
  2020-03-27 12:49 ` no-reply
@ 2020-03-29 12:46 ` Michael S. Tsirkin
  8 siblings, 0 replies; 18+ messages in thread
From: Michael S. Tsirkin @ 2020-03-29 12:46 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Eduardo Habkost



On Fri, Mar 27, 2020 at 01:11:05PM +0100, Gerd Hoffmann wrote:
> 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.
> 
> Also some small refactorings and simplifications.
> 
> take care,
>   Gerd


I'd like to queue it for merge after the release. If possible
please ping me after the release to help make sure it didn't get
dropped.

Thanks!

-- 
MST



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

* Re: [PATCH 5/6] acpi: serial: don't use _STA method
  2020-03-27 14:33   ` Igor Mammedov
@ 2020-03-31 15:23     ` Gerd Hoffmann
  2020-03-31 19:53       ` Igor Mammedov
  0 siblings, 1 reply; 18+ messages in thread
From: Gerd Hoffmann @ 2020-03-31 15:23 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

> > -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)) {
>                                   ^^^^^^
> even though acpi_setup() is a part of board code, usually it's not recommended to 
> use get_system_foo() outside of machine_init()
> 
> how about fishing out present serial ports from isa device in a helper
> like acpi_get_misc_info(), and then generalize AML like
>    build_com_device_aml(Aml *scope, uint8_t uid, io_port, irq)

Hmm, I'm wondering whenever it would be useful to have ...

   ISADeviceClass->build_aml(Aml *scope, ISADevice *dev);

... then just walk all isa devices and call the handler
(if present).  Maybe the same for sysbus.

cheers,
  Gerd



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

* Re: [PATCH 5/6] acpi: serial: don't use _STA method
  2020-03-31 15:23     ` Gerd Hoffmann
@ 2020-03-31 19:53       ` Igor Mammedov
  2020-04-01  5:51         ` Gerd Hoffmann
  0 siblings, 1 reply; 18+ messages in thread
From: Igor Mammedov @ 2020-03-31 19:53 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

On Tue, 31 Mar 2020 17:23:42 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> > > -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)) {  
> >                                   ^^^^^^
> > even though acpi_setup() is a part of board code, usually it's not recommended to 
> > use get_system_foo() outside of machine_init()
> > 
> > how about fishing out present serial ports from isa device in a helper
> > like acpi_get_misc_info(), and then generalize AML like
> >    build_com_device_aml(Aml *scope, uint8_t uid, io_port, irq)  
> 
> Hmm, I'm wondering whenever it would be useful to have ...
> 
>    ISADeviceClass->build_aml(Aml *scope, ISADevice *dev);

in relation to iqr, you said earlier that device doesn't know to which irq it's mapped.
that might be a problem in this case, likewise for (MM)IO

> ... then just walk all isa devices and call the handler
> (if present).  Maybe the same for sysbus.

There was already such idea (Paolo or Michael), i.e. to move AML code
generation related to specific devices inside of device model (not
only ISA or sysbus), so one would just have to enumerate present
devices in generic way and ask them to provide AML descriptors and be
done with building DSDT.

Not sure if it's doable in generic way though, especially when it comes to
orchestrating _CRS between various devices.
(while linux might still boot with resource conflicts, Windows 
BSODs occasionally instead). Maybe there are other complications
I don't recall.

So it might take awhile to come up with approach which would work nice.

Simplest way to get job done in case of microvm is to make board
fill in assigned resources in some helper data structure and pass that
to acpi code. (another approach - arm/virt uses static 'registry' to distribute
address space/irq and then acpi code just fetches values from there if
device is present + a bunch of shared PCI code to make up dynamic PCI
description)

> cheers,
>   Gerd
> 



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

* Re: [PATCH 5/6] acpi: serial: don't use _STA method
  2020-03-31 19:53       ` Igor Mammedov
@ 2020-04-01  5:51         ` Gerd Hoffmann
  0 siblings, 0 replies; 18+ messages in thread
From: Gerd Hoffmann @ 2020-04-01  5:51 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Paolo Bonzini, Richard Henderson, Michael S. Tsirkin, qemu-devel,
	Eduardo Habkost

  Hi,

> > Hmm, I'm wondering whenever it would be useful to have ...
> > 
> >    ISADeviceClass->build_aml(Aml *scope, ISADevice *dev);
> 
> in relation to iqr, you said earlier that device doesn't know to which irq it's mapped.
> that might be a problem in this case, likewise for (MM)IO

Right, this is a problem for sysbus, isa seems to not have this problem
though.

> > ... then just walk all isa devices and call the handler
> > (if present).  Maybe the same for sysbus.
> 
> There was already such idea (Paolo or Michael), i.e. to move AML code
> generation related to specific devices inside of device model (not
> only ISA or sysbus), so one would just have to enumerate present
> devices in generic way and ask them to provide AML descriptors and be
> done with building DSDT.
> 
> Not sure if it's doable in generic way though, especially when it comes to
> orchestrating _CRS between various devices.

I suspect fully generic is tricky, also because you have to get the
hierarchy right.  For isa I think it is doable without too much trouble
because all isa devices are within the same scope.

sysbus is more tricky I suspect.

> So it might take awhile to come up with approach which would work nice.
> 
> Simplest way to get job done in case of microvm is to make board
> fill in assigned resources in some helper data structure and pass that
> to acpi code.

Well, I'd try to avoid the helper data structure indirection ...

> (another approach - arm/virt uses static 'registry' to distribute
> address space/irq and then acpi code just fetches values from there if
> device is present + a bunch of shared PCI code to make up dynamic PCI
> description)

I suspect the reason for the registry on arm is that you can generate
both acpi and device tree from it.  But maybe that makes sense for
sysbus devices (fw_cfg + virtio-mmio for microvm).

cheers,
  Gerd



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

end of thread, other threads:[~2020-04-01  5:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 12:11 [PATCH 0/6] acpi: i386 tweaks Gerd Hoffmann
2020-03-27 12:11 ` [PATCH 1/6] acpi: split hw/i386/acpi-build.c Gerd Hoffmann
2020-03-27 14:17   ` Igor Mammedov
2020-03-27 12:11 ` [PATCH 2/6] acpi: make build_madt() more generic Gerd Hoffmann
2020-03-27 12:11 ` [PATCH 3/6] acpi: factor out acpi_dsdt_add_fw_cfg() Gerd Hoffmann
2020-03-27 14:18   ` Igor Mammedov
2020-03-27 12:11 ` [PATCH 4/6] acpi: drop pointless _STA method Gerd Hoffmann
2020-03-27 14:21   ` Igor Mammedov
2020-03-27 12:11 ` [PATCH 5/6] acpi: serial: don't use " Gerd Hoffmann
2020-03-27 14:33   ` Igor Mammedov
2020-03-31 15:23     ` Gerd Hoffmann
2020-03-31 19:53       ` Igor Mammedov
2020-04-01  5:51         ` Gerd Hoffmann
2020-03-27 12:11 ` [PATCH 6/6] acpi: parallel: " Gerd Hoffmann
2020-03-27 14:35   ` Igor Mammedov
2020-03-27 12:47 ` [PATCH 0/6] acpi: i386 tweaks no-reply
2020-03-27 12:49 ` no-reply
2020-03-29 12:46 ` Michael S. Tsirkin

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.