From nobody Sat May 18 20:37:03 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695118463; cv=none; d=zohomail.com; s=zohoarc; b=C8K8oJg1ZvT+sub6I1lD9/uXsAcVMD+KDq+5NN4imw2LBRoyMqMYBTZSoE7wSa8DJVAH5za9vztyKxCloocFVEeIVyPGcmYlQ1GPO1bG7yc18A4vvDRgtwdxiJDo9KkCM/aDtQ/NaW1PbtpO/+JP1uf6xHeJv3+OKl8BZOWHYIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695118463; h=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=Qr6Clrpkq6ESZV/UlTcHGYlZcIctctlsSFi4SWetSSw=; b=RuFP0VvUDPfASkOtRiEZKS5C21HSzXizCDQxxOdd9l5wL6eXNxR53XhF607RBuwO7OBb+uGByj3EO9XjptOdWhFWL3+zWwsB81RcuzyuuSjoNuwDM1W0bZSLOhVqDLZS2DZNOhZdGcWyunCMmtvptFjgAA2WDWx19icH1qu0uLA= 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 1695118463453584.4819095355709; Tue, 19 Sep 2023 03:14:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiXix-0003IQ-0H; Tue, 19 Sep 2023 06:12: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 1qiXiq-0003Ej-Vb for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:50 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiXin-0005Lp-Kq for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:47 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3216ba1b01eso217008f8f.2 for ; Tue, 19 Sep 2023 03:12:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ba13-20020a0560001c0d00b0031ddf6cc89csm12290136wrb.98.2023.09.19.03.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695118363; x=1695723163; 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=Qr6Clrpkq6ESZV/UlTcHGYlZcIctctlsSFi4SWetSSw=; b=v0xR1bP749p2pcUKZwyFb3EWhFGtTSoMvTqLj34LgjbjOc3w8MkCdGKnrcrci0nSke H1VD68xYLe50Wxwi9U/7jjyTmd8mU+BHpXFsfs0qtVpxXd2yF17UCokCI0Uwtr/0LRXa 2kl6i0cm8qtfNFWNLjnAeYMkDftO6UEWwKZfIWZViqRk0Q4Dx4xw/Fob6KAVBv1Q8DMj BTWeIqfm3Ymftz5fRwNi4q/tAiVvghhnBf0jyqGAGavbIMUKl6WfcHgId9r3WHKr+wB4 XZnqUvwZ3JRnokBEKTHXrhzFdHcroiTkwchIH/tDxj1W7isqLNLhk0VK0gSte791qLTk PHiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695118363; x=1695723163; 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=Qr6Clrpkq6ESZV/UlTcHGYlZcIctctlsSFi4SWetSSw=; b=pKjNgSA1TN+b9WLyyBcKdrNabUwuVspz+vac/3UnzJHQmV+/iOLy04B7v/bT+JtWGx 3anfPI8xOmCfZL/P9GHR6rl2f/nRgJs1WByZTQLdcn/9MZV7QTmFs998RgiiPAK5um8W lklkRGY5ABWbjsNZmt3+KT88WknoGvmG2eDuNM4anWF7fAwtaObM0Dsi6YALob2jUdEy CNoskSZxaQOeocHrAvgywj1ifeFjti84KB5sCz79ZWu/8z3unRXMD8g1SI44LzajON7O n7E3pNUlg4XmoyrXSCrDXNScLnpZQRXKRPbIiFIT9m5Vjd0Dxfv1MIer2b5b24sTuvyf g0tA== X-Gm-Message-State: AOJu0Yw3DIxj9v1MpACnSwQXXtFbJMyBReD9YDySfO6ev9Of/50fEJw4 En34M+pkFFABnDNXRKe+dwslVA== X-Google-Smtp-Source: AGHT+IEiWYHow24aeTj0o97A2Mz7GJID0yEo8nrdjwu0F5OFhaop+9GNxFu8yHVbd1Q4ofNdm3HqIw== X-Received: by 2002:a5d:6851:0:b0:31f:e5b8:4693 with SMTP id o17-20020a5d6851000000b0031fe5b84693mr9285336wrw.25.1695118363207; Tue, 19 Sep 2023 03:12:43 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Leif Lindholm , Marcin Juszkiewicz , Ard Biesheuvel , Shannon Zhao , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [RFC 1/3] tests/qtest/bios-tables-test: Allow changes to virt GTDT Date: Tue, 19 Sep 2023 11:12:38 +0100 Message-Id: <20230919101240.2569334-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230919101240.2569334-1-peter.maydell@linaro.org> References: <20230919101240.2569334-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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, 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 @linaro.org) X-ZM-MESSAGEID: 1695118464696100001 Content-Type: text/plain; charset="utf-8" Allow changes to the virt GTDT -- we are going to add the IRQ entry for a new timer to it. Signed-off-by: Peter Maydell --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index dfb8523c8bf..bcf131fc160 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/GTDT", --=20 2.34.1 From nobody Sat May 18 20:37:03 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695118440; cv=none; d=zohomail.com; s=zohoarc; b=Ljs767QTFbRmJ9a4V0mGvBz+6oxIHRL8o7Ehoaz2uYHdbxeOXXkeCAnYgQSaOISaOjOfMnhqvH8BmPHDBH0rlMGAq8fD/xsxW6WftfkSROUtk/vNTz2yQu1kEyCMW5QgkZv3railCd4MfmeGhPMI/cWteqtXci5uKPd6fnegtos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695118440; h=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=j8JmbSqEXt6UMOnruJcxa+Gd6UTGS29A+j/7/Q5TP94=; b=g46FnHYl9wihcr04rHB1+V6+lkw/B8179T0/YjL3u6KhzQS+ALRfuGRvYDypq+LTtwymvg26Jswv/OK6qgMbgZUI/xAjJ00TVJ/482JBWeu9YWUpdYHcwN5sbHGFapKuA5VswgmWHfa8XxggZTvl6cVzxTGCQOQkpCOMqBO3IZM= 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 1695118440383452.7060076564643; Tue, 19 Sep 2023 03:14:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiXiy-0003Jh-M9; Tue, 19 Sep 2023 06:12:56 -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 1qiXis-0003Fb-CI for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:50 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiXio-0005M0-Qu for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:50 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31f737b8b69so5269959f8f.3 for ; Tue, 19 Sep 2023 03:12:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ba13-20020a0560001c0d00b0031ddf6cc89csm12290136wrb.98.2023.09.19.03.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695118364; x=1695723164; 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=j8JmbSqEXt6UMOnruJcxa+Gd6UTGS29A+j/7/Q5TP94=; b=eDS4TC21ogB5QqxpQOBUftpGZl/vWPQM5H15xyAj7O8KKOl+bG3PAVMvGyEG8BWA+b Rf3gjZbLuKXzoqQqKC8QnWq9a0HOb4sn7DJo6fJ5UIdBWpocM/UpEEW3DQEhD8Q6R7Nm KLZaRP/3D2e30asarpJCZ6ndSMqoM5f6JYxrWQXugJH91HVkePVqrWAtfm94qww67yP0 6vBmFzOmarcBzw4cv2mkgnb6riSkiG4nRU2EQp7hk0vsKiPP2awZwIdm5OWSqDtiCQPc +r5aE+saLpSt1K5eXRXcrEirwdncBnzKkZ29eb/qd+l9fDJPCxXKfoq6xY+L4ydL4tra 6EKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695118364; x=1695723164; 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=j8JmbSqEXt6UMOnruJcxa+Gd6UTGS29A+j/7/Q5TP94=; b=WDsezjG4p4/h5Z2Nd/ASdHg7q0Ybfako1pVg4PmlWJ1ggzSKUAu2n/X0wgHPGyyUbe mfM1WLVs6XzqG3kt4iV4xqwlwX5NpGEYIV780A2gkkrZhjYZfy32I9B1was6CnL5xGVw G1bZwYVe9IfrVfyjOIVhZumjMWN78uS8RSuB1O5l95AlYWDbBEwqqr4l5OXIvr8ZtQ/T q/3BVYPiA5rB23mjd1WTf3Ud3UpxNfH/8DaNRE7ys2aDbs9U5H8oDC1G8Eky2J9g1mx4 E+VPEA4aAMBPvxMkE1dc14eAjnnS3cEwQ79PUnQoHwK0IoeCNnfhGU2gz2VX+lhCoA0H 4SxA== X-Gm-Message-State: AOJu0YyWVn6Xgj91B3BJ05Hj9A8boFZQkfn3Y3Tvk+JsY8E49J73ecRC ImJMPYqBh4vAvidcPMkU4B2zbQ== X-Google-Smtp-Source: AGHT+IFYmpSsuq3jsmdel8xZkJKf5F7zoRW8vGP+ZIaYrFATPkfXsRLYrUOL9Oq55kZNt2jmGpsvtA== X-Received: by 2002:a5d:66c7:0:b0:316:f24b:597a with SMTP id k7-20020a5d66c7000000b00316f24b597amr10388719wrw.46.1695118363947; Tue, 19 Sep 2023 03:12:43 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Leif Lindholm , Marcin Juszkiewicz , Ard Biesheuvel , Shannon Zhao , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [RFC 2/3] hw/arm/virt: Wire up non-secure EL2 virtual timer IRQ Date: Tue, 19 Sep 2023 11:12:39 +0100 Message-Id: <20230919101240.2569334-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230919101240.2569334-1-peter.maydell@linaro.org> References: <20230919101240.2569334-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @linaro.org) X-ZM-MESSAGEID: 1695118442021100003 Content-Type: text/plain; charset="utf-8" Armv8.1+ CPUs have the Virtual Host Extension (VHE) which adds a non-secure EL2 virtual timer. We implemented the timer itself in the CPU model, but never wired up its IRQ line to the GIC. Wire up the IRQ line (this is always safe whether the CPU has the interrupt or not, since it always creates the outbound IRQ line). Report it to the guest via dtb and ACPI if the CPU has the feature. The DTB binding is documented in the kernel's Documentation/devicetree/bindings/timer/arm\,arch_timer.yaml and the ACPI table entries are documented in the ACPI specification version 6.3 or later. Signed-off-by: Peter Maydell Reviewed-by: Ard Biesheuvel --- include/hw/arm/virt.h | 2 ++ hw/arm/virt-acpi-build.c | 16 ++++++++++++---- hw/arm/virt.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index e1ddbea96be..79b1f9b737d 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -49,6 +49,7 @@ #define ARCH_TIMER_S_EL1_IRQ 13 #define ARCH_TIMER_NS_EL1_IRQ 14 #define ARCH_TIMER_NS_EL2_IRQ 10 +#define ARCH_TIMER_NS_EL2_VIRT_IRQ 12 =20 #define VIRTUAL_PMU_IRQ 7 =20 @@ -183,6 +184,7 @@ struct VirtMachineState { PCIBus *bus; char *oem_id; char *oem_table_id; + bool ns_el2_virt_timer_present; }; =20 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 6b674231c27..7bc120a0f13 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -573,8 +573,8 @@ build_srat(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) } =20 /* - * ACPI spec, Revision 5.1 - * 5.2.24 Generic Timer Description Table (GTDT) + * ACPI spec, Revision 6.5 + * 5.2.25 Generic Timer Description Table (GTDT) */ static void build_gtdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) @@ -588,7 +588,7 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) uint32_t irqflags =3D vmc->claim_edge_triggered_timers ? 1 : /* Interrupt is Edge triggered */ 0; /* Interrupt is Level triggered */ - AcpiTable table =3D { .sig =3D "GTDT", .rev =3D 2, .oem_id =3D vms->oe= m_id, + AcpiTable table =3D { .sig =3D "GTDT", .rev =3D 3, .oem_id =3D vms->oe= m_id, .oem_table_id =3D vms->oem_table_id }; =20 acpi_table_begin(&table, table_data); @@ -624,7 +624,15 @@ build_gtdt(GArray *table_data, BIOSLinker *linker, Vir= tMachineState *vms) build_append_int_noprefix(table_data, 0, 4); /* Platform Timer Offset */ build_append_int_noprefix(table_data, 0, 4); - + if (vms->ns_el2_virt_timer_present) { + /* Virtual EL2 Timer GSIV */ + build_append_int_noprefix(table_data, ARCH_TIMER_NS_EL2_VIRT_IRQ += 16, 4); + /* Virtual EL2 Timer Flags */ + build_append_int_noprefix(table_data, irqflags, 4); + } else { + build_append_int_noprefix(table_data, 0, 4); + build_append_int_noprefix(table_data, 0, 4); + } acpi_table_end(linker, &table); } =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8ad78b23c24..4df7cd0a366 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -248,6 +248,19 @@ static void create_randomness(MachineState *ms, const = char *node) qemu_fdt_setprop(ms->fdt, node, "rng-seed", seed.rng, sizeof(seed.rng)= ); } =20 +/* + * The CPU object always exposes the NS EL2 virt timer IRQ line, + * but we don't want to advertise it to the guest in the dtb or ACPI + * table unless it's really going to do something. + */ +static bool ns_el2_virt_timer_present(void) +{ + ARMCPU *cpu =3D ARM_CPU(qemu_get_cpu(0)); + CPUARMState *env =3D &cpu->env; + + return arm_feature(env, ARM_FEATURE_EL2) && cpu_isar_feature(aa64_vh, = cpu); +} + static void create_fdt(VirtMachineState *vms) { MachineState *ms =3D MACHINE(vms); @@ -365,11 +378,20 @@ static void fdt_add_timer_nodes(const VirtMachineStat= e *vms) "arm,armv7-timer"); } qemu_fdt_setprop(ms->fdt, "/timer", "always-on", NULL, 0); - qemu_fdt_setprop_cells(ms->fdt, "/timer", "interrupts", + if (vms->ns_el2_virt_timer_present) { + qemu_fdt_setprop_cells(ms->fdt, "/timer", "interrupts", + GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_S_EL1_IRQ, irqflag= s, + GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL1_IRQ, irqfla= gs, + GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_VIRT_IRQ, irqflags, + GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL2_IRQ, irqfla= gs, + GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL2_VIRT_IRQ, i= rqflags); + } else { + qemu_fdt_setprop_cells(ms->fdt, "/timer", "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_S_EL1_IRQ, irqflag= s, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL1_IRQ, irqfla= gs, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_VIRT_IRQ, irqflags, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL2_IRQ, irqfla= gs); + } } =20 static void fdt_add_cpu_nodes(const VirtMachineState *vms) @@ -810,6 +832,7 @@ static void create_gic(VirtMachineState *vms, MemoryReg= ion *mem) [GTIMER_VIRT] =3D ARCH_TIMER_VIRT_IRQ, [GTIMER_HYP] =3D ARCH_TIMER_NS_EL2_IRQ, [GTIMER_SEC] =3D ARCH_TIMER_S_EL1_IRQ, + [GTIMER_HYPVIRT] =3D ARCH_TIMER_NS_EL2_VIRT_IRQ, }; =20 for (irq =3D 0; irq < ARRAY_SIZE(timer_irq); irq++) { @@ -2249,6 +2272,10 @@ static void machvirt_init(MachineState *machine) qdev_realize(DEVICE(cpuobj), NULL, &error_fatal); object_unref(cpuobj); } + + /* Now we've created the CPUs we can see if they have the hypvirt time= r */ + vms->ns_el2_virt_timer_present =3D ns_el2_virt_timer_present(); + fdt_add_timer_nodes(vms); fdt_add_cpu_nodes(vms); =20 --=20 2.34.1 From nobody Sat May 18 20:37:03 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1695118440; cv=none; d=zohomail.com; s=zohoarc; b=flds39arw1RFP8SoLdFFXVmJuMR/MMfhmYB5DRqb1OjznxXkfHWMPdXPkEDJ+gXk4oY4BE7JSQ+IHhuFs3jVbqIu7aLGNznMQ2tXIQkf3s/mEWeaVhT+wpYiABICpKMLU4e8r8hyeTqriiZ4RoAk3o9hJZ8o1f/TFt+4CTczcGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695118440; h=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=fkfSZkeHjzHFpYeTpLpvbhlV8kGEAEr7KKI6rYw3cRY=; b=ge3agED+9i2FPeHt3hCoaG6EJ+LPxvrnouiPfUpsP5gdS6nF8+PjObs1tgDGmJPzkZaRERF2Fq+Nj+xTg656yRElhVQcC/sowT7kK2v0JKbQ58nvObuHkJPnx28JFvF2jnOuOz0OvhwzO5OsLP8ARrEZAZywlr1S2OgymBCLyas= 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 1695118440543638.5848397075051; Tue, 19 Sep 2023 03:14:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiXiz-0003Jy-9K; Tue, 19 Sep 2023 06:12: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 1qiXit-0003GN-5S for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:52 -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 1qiXiq-0005M6-NX for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:50 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so1970443f8f.1 for ; Tue, 19 Sep 2023 03:12:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ba13-20020a0560001c0d00b0031ddf6cc89csm12290136wrb.98.2023.09.19.03.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695118364; x=1695723164; 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=fkfSZkeHjzHFpYeTpLpvbhlV8kGEAEr7KKI6rYw3cRY=; b=MxGlLQbOF2OjfYJOxLQY8v7xYP7d5ZUsEd6RqGyuN2JTyYy33NqeDtiVqRpyPJRbBa A0Xr22/+tgaagCQHb0gngkxPVud7zRxcTu6aZ9tyo52kdgZYISIdbRkjejxR5TVisC4h 6wkB/WjfBWoaxaFNqca0AEmszNpUPCh4wGMJOb4uxvRp/MhHmA7w2479+zilHgSHaHRf UITqkWl3troby2Jc1XXiEAf2WLlSsB7jpy8e93RH/bG9Bae6YLECflRWuxUpeh6cEoyO FBTV6QEmQoA1JQaPHrT+eKwjkI4N5+WnjC5hp8/GoWBVI2FbMfKeHW0/l2uLVMP7/YTV 9UGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695118364; x=1695723164; 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=fkfSZkeHjzHFpYeTpLpvbhlV8kGEAEr7KKI6rYw3cRY=; b=iF9C3c+skIHNAnE8tYGbwnCcy0bw/UoVIe3/nQ3aKrJNSDf+aAn9FeFueYJG+Vuq/A U7OnBoKIkA4e1Tj19CIdIGvqnjUvSdwAPwSyBgw+2hgmd5ZyB6Xlm4jjq1MrZlAoGzbX KeRyKCMG9Ni52wIIrG/F3qkPjdwHcFe3GabS01Z8yGzMT50YtM7HtgxhDZT57KRVUEnJ n5R2Ah5VjKGODVsklz7BqmZTUymL9Wu2JnrBKZGkWv5go14V22GoOA/+Po8JLeqfo0DL Wg5x4f+tGp4Z2f8jEPs0nTZD0bSzM5k0qq0cK1hoR817XtYYE7Hgf4OhunpPeD12q3E3 kb3Q== X-Gm-Message-State: AOJu0YzklXRONY2V5KgyIYQt79WYdaExxGNh6GQ31/f88XUMUO6uXlFj hjSQVS56fcT18a5g6wmK6I48Kg== X-Google-Smtp-Source: AGHT+IH2C2UvbsWsZ8tdUymftDf8FrKio3bG6D++R4SLxry3ezvD/epg3egXiDPhfp7xD/YSCPxFVA== X-Received: by 2002:adf:f9c2:0:b0:319:82c9:8e7d with SMTP id w2-20020adff9c2000000b0031982c98e7dmr8745698wrr.31.1695118364518; Tue, 19 Sep 2023 03:12:44 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Leif Lindholm , Marcin Juszkiewicz , Ard Biesheuvel , Shannon Zhao , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [RFC 3/3] tests/qtest/bios-tables-test: Update virt/GTDT golden reference Date: Tue, 19 Sep 2023 11:12:40 +0100 Message-Id: <20230919101240.2569334-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230919101240.2569334-1-peter.maydell@linaro.org> References: <20230919101240.2569334-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@linaro.org; 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @linaro.org) X-ZM-MESSAGEID: 1695118442098100005 Content-Type: text/plain; charset="utf-8" Update the virt/GTDT golden reference file to be a revision 3 table with space for the virtual EL2 timer. Diffs from iasl: @@ -1,32 +1,32 @@ /* * Intel ACPI Component Architecture * AML/ASL+ Disassembler version 20200925 (64-bit version) * Copyright (c) 2000 - 2020 Intel Corporation * - * Disassembly of tests/data/acpi/virt/GTDT, Mon Sep 18 16:19:17 2023 + * Disassembly of /tmp/aml-PXK8A2, Mon Sep 18 16:19:17 2023 * * ACPI Data Table [GTDT] * * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */ [000h 0000 4] Signature : "GTDT" [Generic Timer De= scription Table] -[004h 0004 4] Table Length : 00000060 -[008h 0008 1] Revision : 02 -[009h 0009 1] Checksum : 9C +[004h 0004 4] Table Length : 00000068 +[008h 0008 1] Revision : 03 +[009h 0009 1] Checksum : 93 [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001 [024h 0036 8] Counter Block Address : FFFFFFFFFFFFFFFF [02Ch 0044 4] Reserved : 00000000 [030h 0048 4] Secure EL1 Interrupt : 0000001D [034h 0052 4] EL1 Flags (decoded below) : 00000000 Trigger Mode : 0 Polarity : 0 Always On : 0 [038h 0056 4] Non-Secure EL1 Interrupt : 0000001E @@ -37,25 +37,28 @@ [040h 0064 4] Virtual Timer Interrupt : 0000001B [044h 0068 4] VT Flags (decoded below) : 00000000 Trigger Mode : 0 Polarity : 0 Always On : 0 [048h 0072 4] Non-Secure EL2 Interrupt : 0000001A [04Ch 0076 4] NEL2 Flags (decoded below) : 00000000 Trigger Mode : 0 Polarity : 0 Always On : 0 [050h 0080 8] Counter Read Block Address : FFFFFFFFFFFFFFFF [058h 0088 4] Platform Timer Count : 00000000 [05Ch 0092 4] Platform Timer Offset : 00000000 +[060h 0096 4] Virtual EL2 Timer GSIV : 00000000 +[064h 0100 4] Virtual EL2 Timer Flags : 00000000 -Raw Table Data: Length 96 (0x60) +Raw Table Data: Length 104 (0x68) - 0000: 47 54 44 54 60 00 00 00 02 9C 42 4F 43 48 53 20 // GTDT`.....BO= CHS + 0000: 47 54 44 54 68 00 00 00 03 93 42 4F 43 48 53 20 // GTDTh.....BO= CHS 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....= BXPC 0020: 01 00 00 00 FF FF FF FF FF FF FF FF 00 00 00 00 // ............= .... 0030: 1D 00 00 00 00 00 00 00 1E 00 00 00 04 00 00 00 // ............= .... 0040: 1B 00 00 00 00 00 00 00 1A 00 00 00 00 00 00 00 // ............= .... 0050: FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 // ............= .... + 0060: 00 00 00 00 00 00 00 00 // ........ Signed-off-by: Peter Maydell --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/virt/GTDT | Bin 96 -> 104 bytes 2 files changed, 1 deletion(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index bcf131fc160..dfb8523c8bf 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/GTDT", diff --git a/tests/data/acpi/virt/GTDT b/tests/data/acpi/virt/GTDT index 6f8cb9b8f30b55f4c93fe515982621e3db50feb2..7f330e04d144f9cc22eef06127e= cc19abf9e8009 100644 GIT binary patch delta 25 bcmYeu;BpUf3CUn!U|^m+kt>V?$N&QXMtB4L delta 16 Xcmc~u;BpUf2}xjJU|^avkt+-UB60)u --=20 2.34.1