From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162660; cv=none; d=zohomail.com; s=zohoarc; b=Q2DPNQD3519buZ1EMTwtpdAvkn5z2uQJ7Ce5OF333qlZ75uHdwPhUe64S16ocAR7wYDpxzVmPAnU+FTkduIjw5+acCumkEyp66MZXyR5ptO5krHyOCkUc0DefImxYu/n4NlZNvzfSbgepehNZjKKkXL4/EUPU+H+KhliYfS/C5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wI4+BqMSbzHC8yyv0Ubo5u82RwK3QnkP912SIXWOALs=; b=EIgm8lARYf1LC/YKw3mQA7r6KAUELtCU8LIzG1YQ0WZuK8rnbWZq0pZHvQt2Xe6/g56ZGa43H1oAEty7K545/iVWXr+IBjllTS3xnTP8lfo9AkUsFGU0ZZO67G9MrZQrs5XXjfMVt+dHIKUdTzxO+Rh9FzCtiJXVZaJBk1vM3pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162660703558.0273159383199; Fri, 8 Sep 2023 01:44:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4y-0003LD-90; Fri, 08 Sep 2023 04:43:04 -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 1qeX4t-000366-Sc for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:59 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4f-0004iT-7J for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:59 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-400a087b0bfso19097815e9.2 for ; Fri, 08 Sep 2023 01:42:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162563; x=1694767363; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wI4+BqMSbzHC8yyv0Ubo5u82RwK3QnkP912SIXWOALs=; b=JT4GvbVVPUtyUru+mxvKeaZtL5rg0AKIXHbfEJZwnXOGYsUHF1KqvHTrxoCOfcSPqy IFUJ2+xUy7R+x7MkkuK66jIal9GbY+EC98PbSuDYCKCajXJEJW6GLAzMaBCupjdcauCk zZtMtKxM+eYCMixbKwrRAhc4pvlBVlHgce90lk9X1igromdtz8++x2MBKJ6A+QGxPoca RdmBQjXV9UAXaDPPx6s85eX0cCHgwJ60QrPYy5OzBSsUbjPbFrA18/v1kYFaGNeJ1kj1 kZNiCWM6ocj7W3YU5PxpZ3PiFq0q9wcThkB07d9YYRnbDX6EMjxiXZsto3q5OGNh2AHl S5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162563; x=1694767363; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wI4+BqMSbzHC8yyv0Ubo5u82RwK3QnkP912SIXWOALs=; b=XPgKyyz2922IDl4qp/Nfd71tFrRHXWbza53xsyFr/hvEfPQjMS0yx4VTnp3oZ5s3jT jICsQCalaJKxwW3i05FOgy5tjy6dIGTVs7Jrl7UfsL9NZzeMTSh+o9akmPkBGWajww51 D+3sK8p5FBhSGmOsedEpuL63aqI530N7RTR1Lew65QkfaCY4QA9Das/rbgghD40pwy33 d2YFEErlK7qN/G04Q7ZSIN4t02y15GW9L46gPNIwaRYfedbmqPCaFJ7bV7+yyApBsatK pXph+r6lHQ+G6/n3yRQvqeJrbSqM5f5JOkaKDHP55Z/ymK2c6WC298D5itiMpOwzrjrk 2hOQ== X-Gm-Message-State: AOJu0YyNHwk7nZpFtlUJ1iBbLWubxfef45tuyQcWCsIirKrOOQCnkxRS M7Gpn9y7JC79xW0nj7Ap03NukYph+a8= X-Google-Smtp-Source: AGHT+IEUXBksrd4StwoY1G65OKbw/qBDbfNoVfOTyYn7bfG9KwvuLoANR1MnDziYrcOeOlEHThSEew== X-Received: by 2002:a05:600c:204c:b0:401:23fc:1f92 with SMTP id p12-20020a05600c204c00b0040123fc1f92mr1544523wmg.25.1694162563249; Fri, 08 Sep 2023 01:42:43 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 1/8] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly Date: Fri, 8 Sep 2023 10:42:27 +0200 Message-ID: <20230908084234.17642-2-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=shentey@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162661099100003 This is x86-specific code, so there is no advantage in using pc_madt_cpu_entry() behind an architecture-agnostic interface. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-common.h | 3 +-- hw/i386/acpi-build.c | 3 +-- hw/i386/acpi-common.c | 5 ++--- hw/i386/acpi-microvm.c | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h index a68825acf5..b3c56ee014 100644 --- a/hw/i386/acpi-common.h +++ b/hw/i386/acpi-common.h @@ -1,7 +1,6 @@ #ifndef HW_I386_ACPI_COMMON_H #define HW_I386_ACPI_COMMON_H =20 -#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/i386/x86.h" =20 @@ -9,7 +8,7 @@ #define ACPI_BUILD_IOAPIC_ID 0x0 =20 void acpi_build_madt(GArray *table_data, BIOSLinker *linker, - X86MachineState *x86ms, AcpiDeviceIf *adev, + X86MachineState *x86ms, const char *oem_id, const char *oem_table_id); =20 #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index bb12b0ad43..09586b8d9b 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2547,8 +2547,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) =20 acpi_add_table(table_offsets, tables_blob); acpi_build_madt(tables_blob, tables->linker, x86ms, - ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, - x86ms->oem_table_id); + x86ms->oem_id, x86ms->oem_table_id); =20 #ifdef CONFIG_ACPI_ERST { diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 8a0932fe84..43dc23f7e0 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -94,14 +94,13 @@ build_xrupt_override(GArray *entry, uint8_t src, uint32= _t gsi, uint16_t flags) * 5.2.8 Multiple APIC Description Table */ void acpi_build_madt(GArray *table_data, BIOSLinker *linker, - X86MachineState *x86ms, AcpiDeviceIf *adev, + X86MachineState *x86ms, const char *oem_id, const char *oem_table_id) { int i; bool x2apic_mode =3D false; MachineClass *mc =3D MACHINE_GET_CLASS(x86ms); const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(MACHINE(x8= 6ms)); - AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_GET_CLASS(adev); AcpiTable table =3D { .sig =3D "APIC", .rev =3D 3, .oem_id =3D oem_id, .oem_table_id =3D oem_table_id }; =20 @@ -111,7 +110,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *li= nker, build_append_int_noprefix(table_data, 1 /* PCAT_COMPAT */, 4); /* Flag= s */ =20 for (i =3D 0; i < apic_ids->len; i++) { - adevc->madt_cpu(i, apic_ids, table_data, false); + pc_madt_cpu_entry(i, apic_ids, table_data, false); if (apic_ids->cpus[i].arch_id > 254) { x2apic_mode =3D true; } diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index a075360d85..fec22d85c1 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -214,8 +214,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables, =20 acpi_add_table(table_offsets, tables_blob); acpi_build_madt(tables_blob, tables->linker, X86_MACHINE(machine), - ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, - x86ms->oem_table_id); + x86ms->oem_id, x86ms->oem_table_id); =20 #ifdef CONFIG_ACPI_ERST { --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162636; cv=none; d=zohomail.com; s=zohoarc; b=jaYPQ09QGYZQa0CGMcU1YiukYkvHuBRJvT/tZxWCs+Hrs/qtH4Pf0rmkeGVRSPNs6RzfjatfmrrfumWl+LZQcCi55g/4LzfWuaRgOEWsdT4jjpG2rlPkTNFA1x0mc5cNxV9KjLzMzqe3rsX6NYEja4G/nJfx388fI8HSi2MFhQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162636; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2M1a6xWHtcznkl3KHecraUUuAOpcAOWpgKcMmqLgxMw=; b=LRkYJrBxFmU9rShyqQDyLThDv5cSHbaMI27QmFG0G5geo+vdWPTnip2+v+dQFJveeok3k2V52HICzI9rAlE4C9T+dCbfvIH0IEonmh6htHDHX0CkxuqUAmuMF0JezJ/bdO5ZkZnPEx4Z9pUqzSoVF1JbU12k158SpkeH7gqAygQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162636067114.06264745825501; Fri, 8 Sep 2023 01:43:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4r-0002xt-8b; Fri, 08 Sep 2023 04:42:57 -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 1qeX4k-0002dX-8d for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:50 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4h-0004nq-Kt for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:50 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-402cc6b8bedso20649765e9.1 for ; Fri, 08 Sep 2023 01:42:46 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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=1694162565; x=1694767365; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2M1a6xWHtcznkl3KHecraUUuAOpcAOWpgKcMmqLgxMw=; b=M2f3yN1Y0fIAOwAOHgydgKHA5MWh/49ysQKb/5bEAFzn+taKfGkNK14W66UP+k14VS 99xxwjd1xR8btd/L19pq/PdOSYv7w/1o4UIcGFfYw92FPwh7RLGQo0kZydlxJqKW+pO3 MO5fM0TNCV4P1nTeHzvyGadCqm3I6b2dREE0aaKPH52U5fbfkzcpS/vzbn9u2bSmcSHR HRWsCX+tXlUK4i66JlDRxzTPtQEOtyuoxslflAGNHL10RiXjcKNMgwXW83h7hzZwu49Z PuQ/swgR6POChAgvxFWHUjLtKdLexu4TpXJ1lWY9UX2WEE0uzyDDbhOlRXtlBzUBJeam AxMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162565; x=1694767365; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2M1a6xWHtcznkl3KHecraUUuAOpcAOWpgKcMmqLgxMw=; b=QrahczS3DAtvVCitBxtigcGajmo0b9ed+31hTOg9QuWxgOntE2e2+v0eg6MplU1AL4 veGD0G9ceX3Gh/frSJN91BMppCoGFu1Pth/ZG5q+8oBKTfD7CtOd9O3/JU1tVOUTf9VH EOYVV1uh0jJx9NbJS+V4u+8qVqUIlCcaiekcsgi6b9nIeXWpAU3iOMPAww+QUsP3Suaz nWHem1sAPKp3EttiMPnTHLX2mirDMyteKhBUR6GSW6Sov4ilRX3nIlK9EWZ42qghaGgO qKWJc4gu+X8iNZGwbsKeBPm5cKoUpG3UGpXiOacXMqWIIAFJ5PfKyTuSVdCBFrflyCui rv+g== X-Gm-Message-State: AOJu0YwWZuZv9ChSVczegcJCVyS8qzhMEkDbX9X27uEcipxpErRFaM1g HLoTevmn74/SYefPemegf/4NrE04Lb8= X-Google-Smtp-Source: AGHT+IE9hp86a1ppdHAhZWI7X/khI1AxdgIQdsKxSzwJoEMNmBSKgVYV9P+5dV+oGFbH4YIHZpk+Cg== X-Received: by 2002:a05:600c:364c:b0:3fe:16f4:d865 with SMTP id y12-20020a05600c364c00b003fe16f4d865mr1542874wmq.23.1694162564664; Fri, 08 Sep 2023 01:42:44 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 2/8] hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback Date: Fri, 8 Sep 2023 10:42:28 +0200 Message-ID: <20230908084234.17642-3-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=shentey@gmail.com; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162636357100002 build_cpus_aml() is architecture independent but needs to create architectu= re- specific CPU AML. So far this was achieved by using a virtual method from TYPE_ACPI_DEVICE_IF. However, build_cpus_aml() would resolve this interface= from global (!) state. This makes it quite incomprehensible where this interface comes from (TYPE_PIIX4_PM?, TYPE_ICH9_LPC_DEVICE?, TYPE_ACPI_GED_X86?) an c= an lead to crashes when the generic code is ported to new architectures. So far, build_cpus_aml() is only called in architecture-specific code -- and only in x86. We can therefore simply pass pc_madt_cpu_entry() as callback to build_cpus_aml(). This is the same callback that would be used through TYPE_ACPI_DEVICE_IF. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/cpu.h | 6 +++++- hw/acpi/cpu.c | 8 ++------ hw/i386/acpi-build.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 999caaf510..bc901660fb 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -15,6 +15,7 @@ #include "hw/qdev-core.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" +#include "hw/boards.h" #include "hw/hotplug.h" =20 typedef struct AcpiCpuStatus { @@ -55,8 +56,11 @@ typedef struct CPUHotplugFeatures { const char *smi_path; } CPUHotplugFeatures; =20 +typedef void (*build_madt_cpu_fn)(int uid, const CPUArchIdList *apic_ids, + GArray *entry, bool force_enabled); + void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures = opts, - hwaddr io_base, + build_madt_cpu_fn build_madt_cpu, hwaddr io_base, const char *res_root, const char *event_handler_method); =20 diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 19c154d78f..65a3202d3f 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -338,7 +338,7 @@ const VMStateDescription vmstate_cpu_hotplug =3D { #define CPU_FW_EJECT_EVENT "CEJF" =20 void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures = opts, - hwaddr io_base, + build_madt_cpu_fn build_madt_cpu, hwaddr io_base, const char *res_root, const char *event_handler_method) { @@ -353,8 +353,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, MachineClass *mc =3D MACHINE_GET_CLASS(machine); const CPUArchIdList *arch_ids =3D mc->possible_cpu_arch_ids(machine); char *cphp_res_path =3D g_strdup_printf("%s." CPUHP_RES_DEVICE, res_ro= ot); - Object *obj =3D object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL= ); - AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_GET_CLASS(obj); =20 cpu_ctrl_dev =3D aml_device("%s", cphp_res_path); { @@ -664,9 +662,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, aml_append(dev, method); =20 /* build _MAT object */ - assert(adevc && adevc->madt_cpu); - adevc->madt_cpu(i, arch_ids, madt_buf, - true); /* set enabled flag */ + build_madt_cpu(i, arch_ids, madt_buf, true); /* set enabled fl= ag */ aml_append(dev, aml_name_decl("_MAT", aml_buffer(madt_buf->len, (uint8_t *)madt_buf->data))); g_array_free(madt_buf, true); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 09586b8d9b..c8ac665d36 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1549,8 +1549,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, .smi_path =3D pm->smi_on_cpuhp ? "\\_SB.PCI0.SMI0.SMIC" : NULL, .fw_unplugs_cpu =3D pm->smi_on_cpu_unplug, }; - build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, - "\\_SB.PCI0", "\\_GPE._E02"); + build_cpus_aml(dsdt, machine, opts, pc_madt_cpu_entry, + pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02"); } =20 if (pcms->memhp_io_base && nr_mem) { --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162680; cv=none; d=zohomail.com; s=zohoarc; b=AYw9re/2XOEqCuGUK5i/0KRbq2YckMHj1asAEV9XczitQAv7Qr7geCIzPStK2pO9g0tgra/nyBo7vGzo6gNw4GTDUfiPQUUu72FUpR2mNJrCEzON+m+ZdSHwkklaOedGCDLlq75Tzr+Yj61BToy1hPEt7kmXUVv7jQ5jHDt1/PY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162680; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4HQ5ULawMjaIF8Xnn9+G22V/3KGkbJGhmbMiWHNVPOw=; b=GzrhTz9TXCtS/PAywBFTPUNcWzTWmmJz0L3uwloOpmHyD3R9uWRF764MOE3txm5twJejLm3/6ybg7/ZRBIU4VCAkITQzeMFNnyva4X7ZJ3egBQrXyQk7jACPCE3FXD6hU19f1m/BJAF+8/WHIdfmWED4uPKSW3lznD4XF5dhG0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162680111759.1799758363719; Fri, 8 Sep 2023 01:44:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4r-0002t6-1y; Fri, 08 Sep 2023 04:42:57 -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 1qeX4o-0002g6-19 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:54 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4h-0004nz-ON for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:53 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-31ad9155414so1592333f8f.3 for ; Fri, 08 Sep 2023 01:42:47 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162566; x=1694767366; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4HQ5ULawMjaIF8Xnn9+G22V/3KGkbJGhmbMiWHNVPOw=; b=UCkSgTiJpUQrXvxHa6qi/fjvy6FxDPXcoSXn/pTh/i2Z2cp0wHuv60QXXDCZQ1YHbA M2f9bY6A7wTtUM/Vd4K+vpE7iF7Dje7tDG+PZfAJw17pCaHylfmZyATXqRr0OmkHg3Ty nmT8qFKfON+QLoIYH5g7+M2SbikNzcb3ItHPboCkXwbD85Lh3hJUlpoY4qGKfHUOd0DV GQarBxmvRvTc6IR8KAQ4lazxBXBW2JyzlLLTM06+kZgszeBp9xLV7V2QC6x/pfoTzacJ 11DlNOQ8vBC0YXVUpugYxixyJ4K79cWr6xmxVequNs6dzC3WoLTQTBHMXnR3rmwu0rCa HeBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162566; x=1694767366; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4HQ5ULawMjaIF8Xnn9+G22V/3KGkbJGhmbMiWHNVPOw=; b=JIgCgWa5bECBVUKvHtjnKd8JT/WBX4zvJTWKPExcwRYc9PbYKlPu5tViDpptxu6lrh TSYHCHUHMi8eM8C+0f8WEtN/vkS8ToBMl0ooEQ04nOba2x83MCcS4oPfK8HjjifoCSi+ I9cesgKIYeTvUK9nW/cSRLQxIUYbuUwPnaDTzWFQzImkDaDR6+bVt2UPMldzTUTNZJTJ MF3+lUsInQgY4otW8nmMgpzeqzfF+jmCDmTVhYMawKzxLgU4F3srRKa6Hu6D5b+TohBY 6UUFMrKma6H3X/KfCGRkdCm19cVEUCk3TWQFwN7w0BhxY8JJQf4KOJGSHICRAznplBcY kHaA== X-Gm-Message-State: AOJu0YzSxaPv2rDncli6hdUsDv7N05cXr96dXLA4AXDT2QXQlUMxUfrL WwYVfBPwI/vEw6R0GggwdENxvZtHKUw= X-Google-Smtp-Source: AGHT+IFyLVQ6D+PWiFxp/gK02JahdU3ycTKPUw/MBY7pDwvpgYejOfrLQ5h2HMnr2pEIUx6bYm+cJw== X-Received: by 2002:a5d:4b4c:0:b0:317:3deb:a899 with SMTP id w12-20020a5d4b4c000000b003173deba899mr1402901wrs.1.1694162566001; Fri, 08 Sep 2023 01:42:46 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 3/8] hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method Date: Fri, 8 Sep 2023 10:42:29 +0200 Message-ID: <20230908084234.17642-4-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=shentey@gmail.com; helo=mail-wr1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162681565100007 This virtual method was always set to the x86-specific pc_madt_cpu_entry(), even in piix4 which is also used in MIPS. The previous changes use pc_madt_cpu_entry() otherwise, so madt_cpu can be dropped. Since pc_madt_cpu_entry() is now only used in x86-specific code, the stub in hw/acpi/acpi-x86-stub can be removed as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/acpi_dev_interface.h | 2 -- hw/acpi/acpi-x86-stub.c | 6 ------ hw/acpi/piix4.c | 2 -- hw/i386/generic_event_device_x86.c | 9 --------- hw/isa/lpc_ich9.c | 1 - 5 files changed, 20 deletions(-) diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index a1648220ff..ca92928124 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -52,7 +52,5 @@ struct AcpiDeviceIfClass { /* */ void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); - void (*madt_cpu)(int uid, const CPUArchIdList *apic_ids, GArray *entry, - bool force_enabled); }; #endif diff --git a/hw/acpi/acpi-x86-stub.c b/hw/acpi/acpi-x86-stub.c index d0d399d26b..9662a594ad 100644 --- a/hw/acpi/acpi-x86-stub.c +++ b/hw/acpi/acpi-x86-stub.c @@ -1,12 +1,6 @@ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/i386/acpi-build.h" =20 -void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids, - GArray *entry, bool force_enabled) -{ -} - Object *acpi_get_i386_pci_host(void) { return NULL; diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 63d2113b86..a7892c444c 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -20,7 +20,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/i2c/pm_smbus.h" @@ -654,7 +653,6 @@ static void piix4_pm_class_init(ObjectClass *klass, voi= d *data) hc->is_hotpluggable_bus =3D piix4_is_hotpluggable_bus; adevc->ospm_status =3D piix4_ospm_status; adevc->send_event =3D piix4_send_gpe; - adevc->madt_cpu =3D pc_madt_cpu_entry; } =20 static const TypeInfo piix4_pm_info =3D { diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_dev= ice_x86.c index e26fb02a2e..8fc233e1f1 100644 --- a/hw/i386/generic_event_device_x86.c +++ b/hw/i386/generic_event_device_x86.c @@ -8,19 +8,10 @@ =20 #include "qemu/osdep.h" #include "hw/acpi/generic_event_device.h" -#include "hw/i386/pc.h" - -static void acpi_ged_x86_class_init(ObjectClass *class, void *data) -{ - AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_CLASS(class); - - adevc->madt_cpu =3D pc_madt_cpu_entry; -} =20 static const TypeInfo acpi_ged_x86_info =3D { .name =3D TYPE_ACPI_GED_X86, .parent =3D TYPE_ACPI_GED, - .class_init =3D acpi_ged_x86_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 9c47a2f6c7..92527f3c75 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -876,7 +876,6 @@ static void ich9_lpc_class_init(ObjectClass *klass, voi= d *data) hc->is_hotpluggable_bus =3D ich9_pm_is_hotpluggable_bus; adevc->ospm_status =3D ich9_pm_ospm_status; adevc->send_event =3D ich9_send_gpe; - adevc->madt_cpu =3D pc_madt_cpu_entry; amldevc->build_dev_aml =3D build_ich9_isa_aml; } =20 --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162584; cv=none; d=zohomail.com; s=zohoarc; b=mxthNePEAsYRJ9/R5tkQ37Rz1lw4So+YGevnNU43ouXXPPVWbKZ0HfX5A0E/CLV6Vjcw0d3uxjypYFwmc6C9cNBAvu/eabLjG4rcUYn9bO/2+1tRWxn28zGUfWXj8MaKTcmZ6A01Gs8LUZxqFBQFxROEBq1fGSs7PHkvxFJkiS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162584; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=40TYdQRGURs2OSPqGazrXlVNFjzIURb9yqVRn70WK7g=; b=MJ6II94PjJyuA4U8nGf+i8Kj9NT3TLIYWlTnGczovvg6QWNcPzDTtLyTcmojHvFiNXLWv623rByzefZfe1luvpTk7pn2l4X+rxFgYCH/xf6YQa6QSUe9wEoOu8Sk95rieBVSKSUawZfpFMoV/uyGHGXmkgxKl9fh7qkBxXruzmE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169416258402771.5747505926447; Fri, 8 Sep 2023 01:43:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4t-00034s-4g; Fri, 08 Sep 2023 04:42:59 -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 1qeX4m-0002fm-9k for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:52 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4k-0004oZ-05 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:51 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-401da71b7c5so20566445e9.2 for ; Fri, 08 Sep 2023 01:42:49 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162567; x=1694767367; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=40TYdQRGURs2OSPqGazrXlVNFjzIURb9yqVRn70WK7g=; b=FZ0enFe6godYx9YWVYQjplJegaJ1+Ojo3StKDahpYhGm20sSjfNQTXM+4rtaVe4KvE Rjk8fX+w78OpehqLrAuOmaIlxMfKQvNsLYfWA7VUWOVxzyYG6aSjVYRLI2ItJLPerDQg sV3rkc9SDddhyZSx807BOLr5GjCUxhJdGJcBSdYC476Yrzypb8MfMkBbrWLnwYfHbkjI BIjRjeftfHsueDzHdxLxB5/hZmwpN85SqycMJsrPSHvkD8eOnFFKjIZg3yFDf7xloGBl g+BBRjLWFAgtCiUQbnpR1XLUNrEcKyBWS9gYL89U8c1JCZneVoaw6XgX+1Z1reoQlWsZ 6NAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162568; x=1694767368; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=40TYdQRGURs2OSPqGazrXlVNFjzIURb9yqVRn70WK7g=; b=Vi2D1P6CLDvGWP3NqtEfbw/JKDX3b4jlPLP1KtZw4M6j0GNYMQpTxMIqNT6HW45Jcp 82v3ehyKNCsesOaYBANu7iQqjOEyKnFPN3TapXG3CVOxtoanhGKcv9zqnN1x5hLBobaU x9oRtu9JvOJS23nfUoI14ON7pWgREnxnSbmYmrSP5ht/uQ25ikodoOFC9zjnOYxZx8Q0 UhqFJFEJ77GCWMSjAifCiar0DyZkiAFi1GHtCZ0KqqWUdYiZEne6zpjaMDamVnpzwAf+ 7SbqmZK8SFRc8TvYHC307cbVBvlk4XkcGH4mUlQx4i3fhLHmNbEjFp7Jn/UVYr2o4hIV L+EA== X-Gm-Message-State: AOJu0Yxjts6SWeavEg4USyhpSJ4vZvnXvWVNq5+L2igl4tOJPZH8wUuD kZMyHiYLHzxDKLEm1kPCv9somoRz7LY= X-Google-Smtp-Source: AGHT+IGKWDl9UfHdoXNSFmLTHaT5rI8Ckoif9RKyxoU/7i7iyiJrPOzCNhVldO0VFJ9Ld0OiXIdtBQ== X-Received: by 2002:a7b:cbd1:0:b0:3fc:a49:4c05 with SMTP id n17-20020a7bcbd1000000b003fc0a494c05mr1519404wmi.40.1694162567439; Fri, 08 Sep 2023 01:42:47 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 4/8] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Date: Fri, 8 Sep 2023 10:42:30 +0200 Message-ID: <20230908084234.17642-5-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=shentey@gmail.com; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162585946100006 The "hw/boards.h" is unused since the previous commit. Since its removal requires include fixes in various unrelated files to keep the code compilin= g it has been split in a dedicated commit. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/hmat.h | 3 ++- include/hw/acpi/acpi_dev_interface.h | 1 - hw/acpi/cpu.c | 1 + hw/acpi/hmat.c | 1 + hw/acpi/memory_hotplug.c | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/acpi/hmat.h b/hw/acpi/hmat.h index b57f0e7e80..fd989cb661 100644 --- a/hw/acpi/hmat.h +++ b/hw/acpi/hmat.h @@ -27,7 +27,8 @@ #ifndef HMAT_H #define HMAT_H =20 -#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "sysemu/numa.h" =20 /* * ACPI 6.3: 5.2.27.3 Memory Proximity Domain Attributes Structure, diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index ca92928124..68d9d15f50 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -3,7 +3,6 @@ =20 #include "qapi/qapi-types-acpi.h" #include "qom/object.h" -#include "hw/boards.h" #include "hw/qdev-core.h" =20 /* These values are part of guest ABI, and can not be changed */ diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 65a3202d3f..011d2c6c2d 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "migration/vmstate.h" #include "hw/acpi/cpu.h" +#include "hw/core/cpu.h" #include "qapi/error.h" #include "qapi/qapi-events-acpi.h" #include "trace.h" diff --git a/hw/acpi/hmat.c b/hw/acpi/hmat.c index 3a6d51282a..d9de0daf89 100644 --- a/hw/acpi/hmat.c +++ b/hw/acpi/hmat.c @@ -27,6 +27,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "sysemu/numa.h" +#include "hw/acpi/aml-build.h" #include "hw/acpi/hmat.h" =20 /* diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index d926f4f77d..0b883df813 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "hw/acpi/memory_hotplug.h" #include "hw/mem/pc-dimm.h" +#include "hw/boards.h" #include "hw/qdev-core.h" #include "migration/vmstate.h" #include "trace.h" --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162700; cv=none; d=zohomail.com; s=zohoarc; b=U0znh+dgpy6lZjM2CLLQq2qtQydEh9Ek4llG2qae6fZFGhb5OYGeZ3d+ZxsO4wk2CuLiAs4rdGPFSWjcGBSE0LMVhONuMPrjhqpIWAVU6Reec7tSzQBYpYnu2mLyKuiaD4HoIhxz7MgnKZ3DxirbyT8RHaR/u1suXLHQJBm/9Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162700; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CVPi+XLqooUcPliHkqB9JAmi5SFQguHf0Z0djyuv1cg=; b=Xvq6Zp5wBuS8U9gjLnE1VYcmNmatEkQQSGGR8szOKxPIwMZ18nyIMBmN86ynTff0ralFavuIJQGTVEIQFtAVe1EaUOybkF0fGN89JMptgB1BeDbOlnyApNX0dDH889Nni0lFcUr/kxK7PVm6SWhEUmqkH7FwCp+1Kh3VawpCKtc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162700911824.0329176315349; Fri, 8 Sep 2023 01:45:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4r-00030R-Na; Fri, 08 Sep 2023 04:42:57 -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 1qeX4o-0002g9-El for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:54 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4l-0004qJ-0O for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:54 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-317c3ac7339so1644577f8f.0 for ; Fri, 08 Sep 2023 01:42:50 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162569; x=1694767369; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CVPi+XLqooUcPliHkqB9JAmi5SFQguHf0Z0djyuv1cg=; b=SzyKRLFbONsFdyiAnNYS4zzNjtNaXDTdaxuBi3qxMt0GlaJXw8ZiJhOe6TottbPujJ agO6PE/YXhspeL7EAc5onU14y7KbPdXOTdqZu7IzLvh14Qemb9uFo2Q/EUyf0f4eqPVy PIIqmD4byVDl6UnG6dj/L5/43bKVXCyDioJJ/5FraqAqpqalopE+EGygLCrNOAcjPTWW TRIvfKr3s7RxyEdx46rhUzuskD0ELPiKjIOIRDt1GsVODlyT5KSz36G0WQ56ZYWRQDow zfHPCL2NxIbOECrEMXbdGGt00Db9Fbme8O6/0EhP453SWQNdLYyi6azyGasf2zi0TIMr Ba8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162569; x=1694767369; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CVPi+XLqooUcPliHkqB9JAmi5SFQguHf0Z0djyuv1cg=; b=AuuG3h/DBRF7H8fQ6AA1iFSPHbO7SDU463a5Q86DTxGSpmp4HNX1/cBFhYPGxvQgZx ZCqMKZvAUV9C6CP9lgExKPvsgAZmEPV0PMB5yXuAaIHMIVv/elZwo5HyLAhCpF03ndqx MHpSOK419pIS0zDFLZi+gsk1aLWHfgHd6WvRupIUro4EjVAh6Iw1fVFlE86T4mEEnt+t NBc5NXO6XGr1WhykcqFotppr6oNlYNWz4G4s3oJElSg2UELfB0M09Z/+vGqGwrwWdulT zjjME0G7iZiRlucalu4OWtorJ0zAvTRAJsyKAWk5JI/saEK35o6uWj/XLPqdJSbXgYP8 DloA== X-Gm-Message-State: AOJu0YxVvdevYD8CEcvsRPVf9UmUo90IOkNM1ooOvR3Imh7U829vtapA 2ICIclELum7T12bzype/5hlDSrT05a0= X-Google-Smtp-Source: AGHT+IHM/rmZxr/5Iq4Bh2uczoHfQM/wmyNXyKw3s3C/Wx/8Jj3+FklxVXHJA7U8Fmnd9kXSxXsYjw== X-Received: by 2002:adf:f044:0:b0:319:8bb3:ab83 with SMTP id t4-20020adff044000000b003198bb3ab83mr1338622wro.66.1694162568693; Fri, 08 Sep 2023 01:42:48 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 5/8] hw/i386: Remove now redundant TYPE_ACPI_GED_X86 Date: Fri, 8 Sep 2023 10:42:31 +0200 Message-ID: <20230908084234.17642-6-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=shentey@gmail.com; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162702038100003 Now that TYPE_ACPI_GED_X86 doesn't assign AcpiDeviceIfClass::madt_cpu any m= ore it is the same as TYPE_ACPI_GED. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/generic_event_device.h | 2 -- hw/i386/generic_event_device_x86.c | 27 -------------------------- hw/i386/microvm.c | 2 +- hw/i386/meson.build | 1 - 4 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 hw/i386/generic_event_device_x86.c diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index d831bbd889..ba84ce0214 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -69,8 +69,6 @@ #define TYPE_ACPI_GED "acpi-ged" OBJECT_DECLARE_SIMPLE_TYPE(AcpiGedState, ACPI_GED) =20 -#define TYPE_ACPI_GED_X86 "acpi-ged-x86" - #define ACPI_GED_EVT_SEL_OFFSET 0x0 #define ACPI_GED_EVT_SEL_LEN 0x4 =20 diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_dev= ice_x86.c deleted file mode 100644 index 8fc233e1f1..0000000000 --- a/hw/i386/generic_event_device_x86.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * x86 variant of the generic event device for hw reduced acpi - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2 or later, as published by the Free Software Foundation. - */ - -#include "qemu/osdep.h" -#include "hw/acpi/generic_event_device.h" - -static const TypeInfo acpi_ged_x86_info =3D { - .name =3D TYPE_ACPI_GED_X86, - .parent =3D TYPE_ACPI_GED, - .interfaces =3D (InterfaceInfo[]) { - { TYPE_HOTPLUG_HANDLER }, - { TYPE_ACPI_DEVICE_IF }, - { } - } -}; - -static void acpi_ged_x86_register_types(void) -{ - type_register_static(&acpi_ged_x86_info); -} - -type_init(acpi_ged_x86_register_types) diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 8deeb62774..b9c93039e2 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -204,7 +204,7 @@ static void microvm_devices_init(MicrovmMachineState *m= ms) =20 /* Optional and legacy devices */ if (x86_machine_is_acpi_enabled(x86ms)) { - DeviceState *dev =3D qdev_new(TYPE_ACPI_GED_X86); + DeviceState *dev =3D qdev_new(TYPE_ACPI_GED); qdev_prop_set_uint32(dev, "ged-event", ACPI_GED_PWR_DOWN_EVT); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, GED_MMIO_BASE); /* sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, GED_MMIO_BASE_MEMHP); */ diff --git a/hw/i386/meson.build b/hw/i386/meson.build index cfdbfdcbcb..ff879069c9 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -20,7 +20,6 @@ i386_ss.add(when: 'CONFIG_SGX', if_true: files('sgx-epc.c= ','sgx.c'), if_false: files('sgx-stub.c')) =20 i386_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-common.c')) -i386_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_= device_x86.c')) i386_ss.add(when: 'CONFIG_PC', if_true: files( 'pc.c', 'pc_sysfw.c', --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162615; cv=none; d=zohomail.com; s=zohoarc; b=SaSME6x8sdrB9GqUTy/+V/Q3anpunrWQfTNpJJ1LOdOtEBX7EteU/0ocdp7S+A1/cX1BGu3F4sFe6OP0iZVXn9RPG3rzplM9Bnfv25O2Ol/c+5ng1SO0Q/F2hlfrt+6upoNPSl7dqiKiaUlYWHm99nMmWiZ/qU1nscnEfRMenc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162615; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Tbo8vlqXzQh6DL5q3M0q0pvcX2YdZFHIEcN9g5UFi/8=; b=XzToXxcJMShePrZesXYLfsKTVWTci4gYku25hq/LwgWOrzRc11LrPF7DzqdlrSgiv39EzplZvCHtjXx0nyXrIpOcfVUXvX6MUgwZML7x1bDmCR79zhteFg9MtF5QNNiJuOB0gjELv1L/K9Ez9IVQWepK/J61H5xyuIKKwWQ7LzM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162615256683.8975446495956; Fri, 8 Sep 2023 01:43:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4s-000323-1T; Fri, 08 Sep 2023 04:42:58 -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 1qeX4p-0002nr-UP for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:55 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4n-0004qg-9r for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31f2f43d5a0so1788867f8f.1 for ; Fri, 08 Sep 2023 01:42:52 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162570; x=1694767370; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tbo8vlqXzQh6DL5q3M0q0pvcX2YdZFHIEcN9g5UFi/8=; b=OV84S8LH4K8SNs8ZBMPaSnDfN5ZQv5eTBc0Ivh07HBEBicgfBYr04te8Y8N3YnMgZw +BcFZmNYdQU78YQkwWDDm7UV6HHnDBwjiHlj7fSins2JHv+m7JfJs9f8K7P8+nidcz/g Tao51oB4Q9qaEXt02uKXVmXABn2zzLLdPfOB33JMcJk73Ikeyg4h2zwFj1WFyluCr7vp AnZNGqoNoZOLv07nI4BcWa48HOXmVnnvm0wJB8nJjhbMCeMlWbMvu7sqru8Xo3eREgIW j9wqhpN3iucUGaH2939uOiK9JOTtnzxVi4Jt05POCp6s5rrrF9kd2FVGJyfkCCcEkQ8H Sy/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162570; x=1694767370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tbo8vlqXzQh6DL5q3M0q0pvcX2YdZFHIEcN9g5UFi/8=; b=pu/JlCCDlobbJtiXvLdlJdoJv9NqGKbQ3FmEf2lJ/U2qfoKITXKf5nsibF2omOe3xD jmPcJPZuEKSXObeypAZmvkXiWGVlJ5ZLIFFWTgUqi+gC8v1n+6prsokrnD3PITS3mp1f 3DTfQG8YkvdTqW3cZrvPjz7XrZZqZ+PUMZcP+0wbBzlnCemgOMbohbiV/EL72KG+CawE nwHwgBNh2LrIcxR3k5okGbqF7fS5wV4M31kr9kp2We46gEJY9WDm2yS+6AHtrKOJOLBb sR6Z6VHXaxSSNAbk8oxQJQp75J3LLKUVRYR9GYCJfkFp1quLf43qjYjrtvEUYL2l8LKO 5IqQ== X-Gm-Message-State: AOJu0Yxd1r/BBRqWcGfNSH+V61k/9CYtGYqs4n5ByoCGl+1nav3DZn4D iDLw/0bMJCSPyFywPi8BS/+EEi8jGUI= X-Google-Smtp-Source: AGHT+IGoyr58EqTxKgDMbw/o6X9ktImvWss76zJSuRHy3tcnQNyiXNRxY+dla6vl78TITz/nC0cJNw== X-Received: by 2002:adf:ed8b:0:b0:31d:db92:31ae with SMTP id c11-20020adfed8b000000b0031ddb9231aemr1357764wro.44.1694162570377; Fri, 08 Sep 2023 01:42:50 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 6/8] hw/i386/acpi-build: Determine SMI command port just once Date: Fri, 8 Sep 2023 10:42:32 +0200 Message-ID: <20230908084234.17642-7-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=shentey@gmail.com; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162616178100002 The SMI command port is currently hardcoded by means of the ACPI_PORT_SMI_C= MD macro. This hardcoding is Intel specific and doesn't match VIA, for example. There is already the AcpiFadtData::smi_cmd attribute which is used when bui= lding the FADT. Let's also use it when building the DSDT which confines SMI comma= nd port determination to just one place. This allows it to become a property l= ater, thus resolving the Intel assumption. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/acpi-build.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c8ac665d36..f9e7291150 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1495,14 +1495,14 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(crs, aml_io( AML_DECODE16, - ACPI_PORT_SMI_CMD, - ACPI_PORT_SMI_CMD, + pm->fadt.smi_cmd, + pm->fadt.smi_cmd, 1, 2) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(dev, aml_operation_region("SMIR", AML_SYSTEM_IO, - aml_int(ACPI_PORT_SMI_CMD), 2)); + aml_int(pm->fadt.smi_cmd), 2)); field =3D aml_field("SMIR", AML_BYTE_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS); aml_append(field, aml_named_field("SMIC", 8)); --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162680; cv=none; d=zohomail.com; s=zohoarc; b=KP6Y/valxSHDDViN/JMALCDzeDpHvScn2AgZ2wnq7kh8SAv4q4JgueOzr/H2Fhz6ABgy2GD8H6DbAnGTU/OxLZM/WDWs7YYGjAoHWl1oDZ8Zej8NLW14KRqI3OBb48e5qX7PTrhMgc4gsWOzRew9mv0e/ZkfXtzRz0FjzRbE6Hs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162680; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HwdJ/CG9aYGX/GjFQP7CsHIbxXH0gsEEQc7AQMYTlTo=; b=hNGWETXaivzRSjuGAVd/jKEgXAcuNws43tqL+//z953xH/9dXGZw9ePr5fyoI6p9jbfd/tMhvQ1XMWoxphFh3oomVVVxpXoLaJLSsnNtWS709SPY9TUniVdNtDB0pPn50c+znh0r6inie1bBjOIePtLQHnTanO1zdEFKcPwMm3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694162680135865.9462680439406; Fri, 8 Sep 2023 01:44:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4u-00036L-C4; Fri, 08 Sep 2023 04:43:00 -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 1qeX4q-0002oF-0Y for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:56 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4n-0004s5-BY for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:55 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-307d20548adso1730216f8f.0 for ; Fri, 08 Sep 2023 01:42:52 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162571; x=1694767371; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HwdJ/CG9aYGX/GjFQP7CsHIbxXH0gsEEQc7AQMYTlTo=; b=JM423RDzwolM3JHL47xaHWGh+CRN3KzV5+rghFbfywQEvUvbKvyWFzEMZbZxHIk2Ld qzX7C+se6xPiBLLPl5e5NrxEgPMD/4nJC/cJKYxiF9L/ItkORGfIgZDvdcLxlyL03lUu vQlZ4PA3L9yh7gdIe2gMEAJDBw4bmdNy28ZaHME0rY65ESZiefIKp4uqzutqH+RtxED3 rbCdw/fUMBsKEGJ2u54cM1pnntwLlYcyhECzGHFlMAJPeaWalrnYEXMOMbox7wFn9fEt Ygae0LGntqAeLAmoXT12Hg7b3mYetqzrryzFle4r3B7icn0OcYKk0IQQqa+gxuw7wMkD nHYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162571; x=1694767371; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HwdJ/CG9aYGX/GjFQP7CsHIbxXH0gsEEQc7AQMYTlTo=; b=A7T2NSsSYo3jdCOkayNh4zFrXGyzgJn3Gdf+9FxklrvfsOO2AJg7amI1WVSKk1WUY+ P2XiTdWfowGsNlo6C4jdPxq2LY/L6RH0l5hbxPTj0/9TI0XN4LHHBKuzyq7zP8OHGFNh YMFMQIkZRdkH5lmHfzQQ1h/2FkfGOq8COckrH+EjG2HhHdAyzY0rgtCto4UmCAK3tVhb VygK9UnScf/WeuhO85g7rDg6AKXar91vUdOe2IDGIjZgupCk9LOaq6qHfH8SluKHiiDl UhcUFeeYGRojD0cyfngpTtlYtC9b/HtiMX8G9mY+aLS5gW4KDGRNeuRUFLxuBwNX4S31 tdyg== X-Gm-Message-State: AOJu0Yy2+tBKVY7oOwtudJqUNSNp9DMosn7M31veIKqhJYRbwhDjBy0r NWPupgyI9TzojTezym18DAs5/lQhOb4= X-Google-Smtp-Source: AGHT+IEYzG7PFC9PUxqQPffFxzF/Xq18TF/XUGGhD3Cj14rWYlX2OI1+0Wq+JmRsSrIwF6//RBIo+w== X-Received: by 2002:adf:de0f:0:b0:317:43de:4c0a with SMTP id b15-20020adfde0f000000b0031743de4c0amr1255506wrm.20.1694162571548; Fri, 08 Sep 2023 01:42:51 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 7/8] hw/acpi: Trace GPE access in all device models, not just PIIX4 Date: Fri, 8 Sep 2023 10:42:33 +0200 Message-ID: <20230908084234.17642-8-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=shentey@gmail.com; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162681497100005 Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/core.c | 5 +++++ hw/acpi/piix4.c | 3 --- hw/acpi/trace-events | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 00b1e79a30..c561845a4a 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -32,6 +32,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "sysemu/runstate.h" +#include "trace.h" =20 struct acpi_table_header { uint16_t _length; /* our length, not actual part of the hdr */ @@ -686,6 +687,8 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr= , uint32_t val) { uint8_t *cur; =20 + trace_acpi_gpe_ioport_writeb(addr, val); + cur =3D acpi_gpe_ioport_get_ptr(ar, addr); if (addr < ar->gpe.len / 2) { /* GPE_STS */ @@ -709,6 +712,8 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t a= ddr) val =3D *cur; } =20 + trace_acpi_gpe_ioport_readb(addr, val); + return val; } =20 diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index a7892c444c..dd523d2e4c 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -42,7 +42,6 @@ #include "hw/acpi/acpi_dev_interface.h" #include "migration/vmstate.h" #include "hw/core/cpu.h" -#include "trace.h" #include "qom/object.h" =20 #define GPE_BASE 0xafe0 @@ -517,7 +516,6 @@ static uint64_t gpe_readb(void *opaque, hwaddr addr, un= signed width) PIIX4PMState *s =3D opaque; uint32_t val =3D acpi_gpe_ioport_readb(&s->ar, addr); =20 - trace_piix4_gpe_readb(addr, width, val); return val; } =20 @@ -526,7 +524,6 @@ static void gpe_writeb(void *opaque, hwaddr addr, uint6= 4_t val, { PIIX4PMState *s =3D opaque; =20 - trace_piix4_gpe_writeb(addr, width, val); acpi_gpe_ioport_writeb(&s->ar, addr, val); acpi_update_sci(&s->ar, s->irq); } diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 78e0a8670e..159937ddb9 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -17,6 +17,10 @@ mhp_acpi_clear_remove_evt(uint32_t slot) "slot[0x%"PRIx3= 2"] clear remove event" mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted" mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm d= elete failed" =20 +# core.c +acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " =3D= =3D> 0x%" PRIx8 +acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <= =3D=3D 0x%" PRIx8 + # cpu.c cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32 cpuhp_acpi_read_flags(uint32_t idx, uint8_t flags) "idx[0x%"PRIx32"] flags= : 0x%"PRIx8 @@ -48,10 +52,6 @@ acpi_pci_sel_read(uint32_t val) "%" PRIu32 acpi_pci_ej_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %" = PRIu64 acpi_pci_sel_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %"= PRIu64 =20 -# piix4.c -piix4_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" P= RIx64 " width: %d =3D=3D> 0x%" PRIx64 -piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" = PRIx64 " width: %d <=3D=3D 0x%" PRIx64 - # tco.c tco_timer_reload(int ticks, int msec) "ticks=3D%d (%d ms)" tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_n= o=3D%d no_reboot=3D%d/%d" --=20 2.42.0 From nobody Wed Jun 26 12:42:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694162660; cv=none; d=zohomail.com; s=zohoarc; b=Mm4D2PD04kN6dLwhlfD0QeuRgfCNIzPOkxH2Pvn26RGRVEsMH97SEsNvDk8DBfc/pRlSz7qeH7QhVFiLX7c/+3pO6xS0Pd9q0E6NEPhs5FpooxS97DlK2gZv4tMXxrGK58JsaiquWT86W1Z34Kuxb87f81NkxpbcWEHndhFn0Fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694162660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WC5kdXoVXf7OSQC2004JIGL0JZd5FaBQWvQofN2yKyw=; b=aaWEIw9BMrHAC3TiVG6eJX989AbQEMiyqXG3jGdGHHHYR/Hfx3Z4rAydBLZe5A8Gs3ndiEQs78a5kV+Vt5bue838Cm6UMGs/h3e5vlQ0NBuGDCPoQCP9V5uZGMzEs7kMKbYLZ0GqbEjrs4IjXMmxbuEhKM0Hef1Yp31qNLS8X1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169416266013937.6507566300196; Fri, 8 Sep 2023 01:44:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeX4y-0003Le-Et; Fri, 08 Sep 2023 04:43:04 -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 1qeX4t-000353-2q for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:59 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeX4p-0004wa-MF for qemu-devel@nongnu.org; Fri, 08 Sep 2023 04:42:58 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-31f4a286ae1so1622074f8f.3 for ; Fri, 08 Sep 2023 01:42:54 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 01:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694162573; x=1694767373; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WC5kdXoVXf7OSQC2004JIGL0JZd5FaBQWvQofN2yKyw=; b=pxHe083QqzCq9MPjusPOAzFYCgFpB+v9LiS6kt/+3FVpDO/uQc3u8yCGAm6BgAwodt ECSwBOEn9bQtq+mnH8TAuZR2ot/00owOpMuKTmu6ZzgImZ9TjSk2o6hwE4/snkGYpjlF 2qIlJ+8ZkhCzom/HKSfUT2nTEIqxMjDT55YG5fUgt/92OgQv8V5EwU8BFkILWZ2bHThP 1cTSDAUjWJvEWZEKdedEK//ljhisxN+qplVUJ/AJKrIg8rkcL2/dn7DKZv8wRMEIKWLl hdV7fcaznhFYRPxqYOzccMxhr2zeC8h5aOi+gf6OljJWKMGXIrz8Ft0bUSerMn8YJw2z dkXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694162573; x=1694767373; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WC5kdXoVXf7OSQC2004JIGL0JZd5FaBQWvQofN2yKyw=; b=Qg9D88jCVdoCwNUGqpXr9ygB/7zsrpOFj3DDLStc3DVTNYjA8JI0Ac4i1C7SxBNmDc +Pyc+Yj0kSKdatxHsCHmqm6NxuVlhIiSal7tGunxomNVCMA9urfPq+v8Y5T0pwq/wnU9 dAz1DgGXKEwhchzK1VAHrOxkEYJ2rg4kIMhfaL4jpFbw9/xuLCi1LVxIst5DjxO7KoPP ttaj8UktLNCI7hatnsnK/WxZu7vIt27XJ4ljj3lYUYNjnfNR1AN/iz/iynf2x8aFhZUr NRYqLMmZTKTzUZUf/U47DfErsihpxeLMWlQJkz2WDDDqG3f8edLKer0SLoMaB6azTyGy cvGw== X-Gm-Message-State: AOJu0YxHAjZ9Mx595qE4u4KDdS5GYQ2dZx1TOjtLEUPGcbckaeMcC6TA 0MlkGohthDh6ifdAY13fsTpZ9BOQEm0= X-Google-Smtp-Source: AGHT+IGQ4nZpYZZw3lw7eJboDRLTVvvCXPU+D/mcwQy+9BN56zgV9+C31VfNBni04zaakrlaxnWQJg== X-Received: by 2002:adf:e987:0:b0:31d:cd2f:4a4b with SMTP id h7-20020adfe987000000b0031dcd2f4a4bmr1455516wrm.50.1694162573027; Fri, 08 Sep 2023 01:42:53 -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=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v2 8/8] hw/acpi/core: Trace enable and status registers of GPE separately Date: Fri, 8 Sep 2023 10:42:34 +0200 Message-ID: <20230908084234.17642-9-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230908084234.17642-1-shentey@gmail.com> References: <20230908084234.17642-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=shentey@gmail.com; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1694162661845100005 The bit positions of both registers are related. Tracing the registers independently results in the same offsets across these registers which eases debugging. Signed-off-by: Bernhard Beschow Acked-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/core.c | 10 +++++++--- hw/acpi/trace-events | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index c561845a4a..ec5e127d17 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -687,13 +687,13 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t ad= dr, uint32_t val) { uint8_t *cur; =20 - trace_acpi_gpe_ioport_writeb(addr, val); - cur =3D acpi_gpe_ioport_get_ptr(ar, addr); if (addr < ar->gpe.len / 2) { + trace_acpi_gpe_sts_ioport_writeb(addr, val); /* GPE_STS */ *cur =3D (*cur) & ~val; } else if (addr < ar->gpe.len) { + trace_acpi_gpe_en_ioport_writeb(addr - (ar->gpe.len / 2), val); /* GPE_EN */ *cur =3D val; } else { @@ -712,7 +712,11 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t = addr) val =3D *cur; } =20 - trace_acpi_gpe_ioport_readb(addr, val); + if (addr < ar->gpe.len / 2) { + trace_acpi_gpe_sts_ioport_readb(addr, val); + } else { + trace_acpi_gpe_en_ioport_readb(addr - (ar->gpe.len / 2), val); + } =20 return val; } diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 159937ddb9..edc93e703c 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -18,8 +18,10 @@ mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32= "] pc-dimm deleted" mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm d= elete failed" =20 # core.c -acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " =3D= =3D> 0x%" PRIx8 -acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <= =3D=3D 0x%" PRIx8 +acpi_gpe_en_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " = =3D=3D> 0x%02" PRIx8 +acpi_gpe_en_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 "= <=3D=3D 0x%02" PRIx8 +acpi_gpe_sts_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 "= =3D=3D> 0x%02" PRIx8 +acpi_gpe_sts_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 = " <=3D=3D 0x%02" PRIx8 =20 # cpu.c cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32 --=20 2.42.0