From patchwork Tue Sep 19 10:12:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 724407 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp2143139wro; Tue, 19 Sep 2023 03:14:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnVUttTPdhNoAZmW3lm2HhELrOphx7EfZ97PTAMU3EE+q1nBap3xuXkDLHYDNuutStBdC2 X-Received: by 2002:a0c:e1cf:0:b0:64a:a902:2c1e with SMTP id v15-20020a0ce1cf000000b0064aa9022c1emr10457545qvl.20.1695118440917; Tue, 19 Sep 2023 03:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695118440; cv=none; d=google.com; s=arc-20160816; b=hTHGJwwX70NXmOmEf1+cBOsQsfxY7LiQIUfvUcoOl/tMGWwW/b8EXG4sGzXZea0kko 3ianR5dEL1d+ZN77aTSdoQbqEdG1keDiC2ldIiApxmERR9RMj5GXVlB6dMh5AotY+VJP 30uPlkKgLG6eOXYyGgrVkJl+iEsgjL9t7tnasG5PGhG1P2gAAu/dDCcNhal/GEX/2V9X tr+kmMXOQzvjbfpNgYaeMBulgseXnvPeJ/Ni2J4NzzlKBuEZDYq/YrocotRJZ3NPrpq8 G14/eph4nzipm3CRCkyMjHMls30UjkdywtVHvQ2rYnB5qh0aaHYOpw8LPqvE7mR3rsdy 0YiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=0zbZPsaTAWLU8NhXe0AqmzBHuQOLcBVRNpjcnRGPRoc=; fh=VnLaRVPcN1gpaQWLnE0jAsSHd7/auwbL0WCytLamgZU=; b=a7pB1PmoOg08H1la5D0MDN8sVJasgMZ/InI8aBQtaCLBt2bdxQQVJL/BBV52W1SyQ4 P3KggZY10QUvXcoZPCLaC1Xf2Jucl8+VcdHndQIzN7dH7sLsOpGEqIbp3vlo82FWhbyY YVmvNjWnfZXMdA5LdJRB1KbmWxEHINLa/Noe2M4Qf34EBnEEPg4xp0AtNXyFS7voCkXI 9gVqZO4TVaEwBwgKRe4hZ3ZHkNnbCIUrFk1bs8hSrwwHCHpuPZiiM511EgoynBylqgM2 6JQJH9wfT0ab0bLdso9bYULUkYh4s2N9IYcjFHY1zk6AopIhROqVhgMKDef5acXTug+D RN9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JsxOPD5C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t2-20020a05620a450200b00767b0c9bcf0si7777623qkp.564.2023.09.19.03.14.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Sep 2023 03:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JsxOPD5C; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiXiw-0003I5-Nr; Tue, 19 Sep 2023 06:12:54 -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 1qiXip-0003DN-41 for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:48 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiXin-0005La-0L for qemu-devel@nongnu.org; Tue, 19 Sep 2023 06:12:46 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32155a45957so1724875f8f.0 for ; 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=1695118362; x=1695723162; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0zbZPsaTAWLU8NhXe0AqmzBHuQOLcBVRNpjcnRGPRoc=; b=JsxOPD5Cpt6W+Qigq1/vR1yRMIvIK49iS5n77RNKAV5Dtdd6EAhxqIqAzgj+ZTj+2q gomyVgvmZlV4PweIwylz7My7TrjF1gW5DnQVIVLQg4TQ5KWlxQ5TOo01hyKFa+8hxTGf 3ismyHWYXQauxX/RrwrMubbEuWqb7eWZ+U8kPTSmaP6aliJ+rSA8pxbqPMyTdlA9+oky iMbK1K93ulghAqmBxyiBbjcTxSlNC5+MQOR+0OremI7bXZWNoVfx1wd5cDubDfUpFwsa pnp4L53Z09CaLwqN7mqGnFu7H5YkRPfhOYTDe+v+x767NPRgMSebQ2DUp0TOdSCbnobv rUTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695118362; x=1695723162; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0zbZPsaTAWLU8NhXe0AqmzBHuQOLcBVRNpjcnRGPRoc=; b=sjLvc7DZ2omOS9LTndQVCS/xsSxMy609e9qKMdIvUgu8LlOjQiyUSqsVO4OiKhsYge Wb94EknM4kCjErdh30Ijqrj3ZpyDndMGVLg0b6PQEeDYz71kjmGVnJeW9NT1ZBN60+34 wotN3XFwL4Z82qnvme1NyWDmEcuft7QEonyLHWU37hhMiJLVx3HFUPw+nDsJuKuO+U6M NLYmL4Bf/sPz7rezQbJLvIjWRFt0O2Kcg11UbJksr4WtnrhUkotu2m1lABjAMibrMe1R +tFfklyAdB+4rGRvQ5ikFngA8m/c/LX9kJ8llPd3JM3ikDaglR3g+rD92xLBOnAS853p /LzQ== X-Gm-Message-State: AOJu0YzMTQwwkMsG3HuWelRmBTgKBW3uwA1DGERW5MN5G3aWXcXVQG8o jhdd52zCMIu/W9fPDbb0A/R9Yg== X-Received: by 2002:a05:6000:1e91:b0:321:67f4:8bd7 with SMTP id dd17-20020a0560001e9100b0032167f48bd7mr911936wrb.32.1695118361967; Tue, 19 Sep 2023 03:12:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:12:41 -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 0/3] virt: wire up NS EL2 virtual timer IRQ Date: Tue, 19 Sep 2023 11:12:37 +0100 Message-Id: <20230919101240.2569334-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This patchset is an RFC that wires up the NS EL2 virtual timer IRQ on the virt board, similarly to what https://patchew.org/QEMU/20230913140610.214893-1-marcin.juszkiewicz@linaro.org/ does for the sbsa-ref board. Patches 1 and 3 are the usual dance to keep the ACPI unit tests happy with the change to the ACPI table contents; patch 2 is the meat. This is an RFC for two reasons: (1) I'm not very familiar with ACPI, and patch 2 needs to update the ACPI GTDT table to report the interrupt number. In particular, this means we need the rev 3 of this table (present in ACPI spec 6.3 and later), not the rev 2 we currently report. I'm not sure if it's permitted to rev just this table, or if we would need to upgrade all our ACPI tables to the newer spec first. (2) The change causes EDK2 (UEFI) to assert on startup: ASSERT [ArmTimerDxe] /home/kraxel/projects/qemu/roms/edk2/ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.c(72): PropSize == 36 || PropSize == 48 This is because the EDK2 code that consumes the QEMU generated device tree blob is incorrectly insisting that the architectural-timer interrupts property has only 3 or 4 entries, so it falls over if given a dtb with the 5th entry for the EL2 virtual timer irq. In particular this breaks the avocado test: machine_aarch64_virt.py:Aarch64VirtMachine.test_alpine_virt_tcg_gic_max I'm not entirely sure what to do about this -- we can get EDK2 fixed and update our own test case, but there's a lot of binaries out there in the wild that won't run if we just update the virt board the way this patchset does. We could perhaps make the virt board change be dependent on machine type version, as a way to let users fall back to the old behaviour. I'm putting this patchset out on the list to get opinions and review on those two points. thanks -- PMM Peter Maydell (3): tests/qtest/bios-tables-test: Allow changes to virt GTDT hw/arm/virt: Wire up non-secure EL2 virtual timer IRQ tests/qtest/bios-tables-test: Update virt/GTDT golden reference include/hw/arm/virt.h | 2 ++ hw/arm/virt-acpi-build.c | 16 ++++++++++++---- hw/arm/virt.c | 29 ++++++++++++++++++++++++++++- tests/data/acpi/virt/GTDT | Bin 96 -> 104 bytes 4 files changed, 42 insertions(+), 5 deletions(-)