From patchwork Fri Sep 8 08:42:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1831380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=Ey8OEtHz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RhqPg0ZJKz1yh5 for ; Fri, 8 Sep 2023 18:43:03 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4p-0002nF-Si; Fri, 08 Sep 2023 04:42:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeX4j-0002dU-5s for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:50 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4e-0004ho-EA for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:47 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-317c3ac7339so1644480f8f.0 for ; Fri, 08 Sep 2023 01:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162562; x=1694767362; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MXMqVduWvHSXm5TTmj5h8lrqE4Ukk43eDBxbpE5yU18=; b=Ey8OEtHziSINvyyz/qtKBb5MrGOvLvy7O3tK30tbPfzDPhus6jBy+s/KatZR/omcAK e/io/xdZeEZHmKx8M9O2rRUsnBPz2PL/4e1szqYQFICZDiQYDviEX6TcqUy0Gn+/hbUE lEw48rlxcaa4ZbDv5wf09tIC4bU4rrkWJsz34z3YozOrJqoiEaWX4ZvheUm75nNOMv4Z lFnE4ksDdyza3Xbc7WvstOA7o8azS4oMyIv8hrTXQOae14sA2IUnpcBCFWqLAWUH9fT/ AtTC3MG9/YrPpjOcusV+mYO2Rew3B46G7AtQw/xGwrlAFZMKm/qRx2kAlAyG+Q5XJloX 5Ypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162562; x=1694767362; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MXMqVduWvHSXm5TTmj5h8lrqE4Ukk43eDBxbpE5yU18=; b=vZuMr26aoHTa0nOBL94+CJyPRlVrFXc8IiwpVa0zal81D3Qvfo4BI4KojbjcLHDD7X 3e3L0bkGnKr4v06KDYrP8Pt9Jy1x+ObL//PwaCwXc8Q9JL0CfUOOuS5c+exs1Visae7d LbDtXzZa0w0ovkRz8R/m4H1+3BjjTjTanSBy/qEyyOtj7JtIth23EelwyhwW3cJSN/Bj sGDq9Hpif2qJ6FmlosGRLq9MG3X5DUsHPXVsdb6VZXpe9Fta0DIg1cLCYXrMs3jZP2v3 hfjmvJzG887ir4+JpPCQB7JfwmohvQtLlDG8da/I8UTQVdb8BKoJsOqxqks4OPUh3zTx AIyQ== X-Gm-Message-State: AOJu0YyfSrqaD/6dTT22AX6nurqUdgZMiL3oyt4NL4CwxTs5cewQ4tIS rAL3iB3AimZ1ZsfuzM56Q26LiAvZ9TA= X-Google-Smtp-Source: AGHT+IGCTD5Rad9XxnW7EHpWmWJ6v1MLgHb4esBP7eB0ZINM+6WO/LHbD4NTZ/JP4GDVTx4eGPxiGQ== X-Received: by 2002:a05:6000:1190:b0:31a:d2b2:f28f with SMTP id g16-20020a056000119000b0031ad2b2f28fmr1263262wrx.51.1694162561997; Fri, 08 Sep 2023 01:42:41 -0700 (PDT) Received: from Provence.localdomain (dynamic-078-054-093-170.78.54.pool.telefonica.de. [78.54.93.170]) by smtp.gmail.com with ESMTPSA id h17-20020a056000001100b003197c2316ecsm1462139wrx.112.2023.09.08.01.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:41 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Eduardo Habkost , Aurelien Jarno , Paolo Bonzini , Marcel Apfelbaum , Sergio Lopez , Richard Henderson , Igor Mammedov , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 0/8] ACPI: X86 AML generation and GPE tracing cleanup Date: Fri, 8 Sep 2023 10:42:26 +0200 Message-ID: <20230908084234.17642-1-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=shentey@gmail.com; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This series contains changes from my effort to bring the VIA south bridges to the PC machine [1]. The first part of the series resolves the AcpiCpuAmlIfClass::madt_cpu virtual method which frees ACPI controllers from worrying about CPU AML generation. The second part minimizes an Intel-specific assumption in AML generation to just one place. The third part contains two ACPI tracing patches which have been reviewed a long time ago but weren't merged yet. The removal of AcpiCpuAmlIfClass::madt_cpu is essentially a respin of [2] with a different approach. Igor wasn't generally against it but wasn't convinced either [3]. The new approach causes much less churn and instead allows to remove code. So I think it's worth to be reconsidered. The motivation for removing this virtual method didn't change: It frees the ACPI controllers in general and PIIX4 PM in particular from generating X86 CPU AML. The latter is also used in MPIS context where X86 CPU AML generation is stubbed out. This indicates a design issue where a problem was solved at the wrong place. Moreover, it turned out that TYPE_ACPI_GED_X86 could be removed as well, further supporting this claim. The second part of this series limits SMI command port determination during AML generation to just one place. Currently the ACPI_PORT_SMI_CMD constant is used multiple times which has an Intel-specific value. In order to make the code a microscopic bit more compatible with our VIA south bridge models its usage gets limited to one place, allowing the constant to be turned into a device model property in the future. The third part improves the tracing experience for ACPI general purpose events. It originates from an old series: [4]. Testing done: * `make check` * `make check-avocado` v2: * Trace ACPI GPE values with "0x%02" (Phil) [1] https://github.com/shentok/qemu/tree/pc-via [2] https://lore.kernel.org/qemu-devel/20230121151941.24120-1-shentey@gmail.com/ [3] https://lore.kernel.org/qemu-devel/20230125174842.395fda5d@imammedo.users.ipa.redhat.com/ [4] https://patchew.org/QEMU/20230122170724.21868-1-shentey@gmail.com/ Bernhard Beschow (8): hw/i386/acpi-build: Use pc_madt_cpu_entry() directly hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" hw/i386: Remove now redundant TYPE_ACPI_GED_X86 hw/i386/acpi-build: Determine SMI command port just once hw/acpi: Trace GPE access in all device models, not just PIIX4 hw/acpi/core: Trace enable and status registers of GPE separately hw/acpi/hmat.h | 3 ++- hw/i386/acpi-common.h | 3 +-- include/hw/acpi/acpi_dev_interface.h | 3 --- include/hw/acpi/cpu.h | 6 ++++- include/hw/acpi/generic_event_device.h | 2 -- hw/acpi/acpi-x86-stub.c | 6 ----- hw/acpi/core.c | 9 +++++++ hw/acpi/cpu.c | 9 +++---- hw/acpi/hmat.c | 1 + hw/acpi/memory_hotplug.c | 1 + hw/acpi/piix4.c | 5 ---- hw/i386/acpi-build.c | 13 +++++----- hw/i386/acpi-common.c | 5 ++-- hw/i386/acpi-microvm.c | 3 +-- hw/i386/generic_event_device_x86.c | 36 -------------------------- hw/i386/microvm.c | 2 +- hw/isa/lpc_ich9.c | 1 - hw/acpi/trace-events | 10 ++++--- hw/i386/meson.build | 1 - 19 files changed, 38 insertions(+), 81 deletions(-) delete mode 100644 hw/i386/generic_event_device_x86.c