From patchwork Mon Nov 13 17:46:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 743472 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1753232wrw; Mon, 13 Nov 2023 09:47:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8HimfmLKiILIexcnxWTKAM6WUuKIlaRLDdZCBg7iqpYrgBBLMhfDe3UhRte6Zxc99xl6t X-Received: by 2002:a0c:c202:0:b0:66d:d6b:f24f with SMTP id l2-20020a0cc202000000b0066d0d6bf24fmr5561303qvh.50.1699897628685; Mon, 13 Nov 2023 09:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699897628; cv=none; d=google.com; s=arc-20160816; b=F/fen2loiFEKyPuLn1PZ8fhl2bbqJJe279tG6YUwB1soA7HIoWIraGXijYB9YT9F1X /1TPjpuA1PpHcr6RCJTHZpqEncsNZoVL49+aP3FknlZQMYqwBHuTh8AkleHX8bBu9Ils DNpKheqZnI1MOrLvJ6ENE5MHHY6bOo14ErEoITb2hp0f5wm8CLg5xLLhSWojZSW1K495 Fk21vKTdlhmHckEcXWNRS78rGX++pH22bGiIM2h56teqgyocPnOYVaxV474KSFEGFhI1 FEHy7j41/wVOddyiIH0Pwy5Va3A+KxeiJLeU0NAeDTbvYWUd7y5M+j5hwxLUI9kWEY4F 0x2Q== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9eeFUonyZperk3WbTyB0C+tM8FT/EhmPijOJJIm8Ls0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kJ9A3SwNxU0LUiun5a4sCKAUhXjPQBzxf2toGzJzDSGZXOapZy3PgOSA9NVx6YemDm u61Ojzo7VINLQANhQUnLEr5/KBooMCctXKeVKViYBEPcdDZP7qJ7lCjEhT0VYWzPYjFM xWs80x12UIJ08fC5LucveOlmrOUYr8j95eYV7v7OuJuxJfo+sLNrr8Jvd+Sww4QPYNGx Sv6thmdXzIDCrIFTVr6ZzOuWQhMFQ0b0OjIZPPTy84NP44mQxGxvdqk82Wlj4O2rPy14 ZGf4Z8nQGiTUmuMuCTZPDXGRcZHGK+6WxU/eI7JCfj9UV6YrcKNsT0u4e/50f6LED3dD pfXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ufa/7YhD"; 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 e10-20020a056214162a00b0065b14c19db6si4752284qvw.288.2023.11.13.09.47.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 09:47:08 -0800 (PST) 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="Ufa/7YhD"; 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 1r2b1O-0006yZ-3b; Mon, 13 Nov 2023 12:46:50 -0500 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 1r2b1F-0006wa-Vt for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:42 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2b1E-0003Jl-9y for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:41 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c5b7764016so57170711fa.1 for ; Mon, 13 Nov 2023 09:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699897598; x=1700502398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9eeFUonyZperk3WbTyB0C+tM8FT/EhmPijOJJIm8Ls0=; b=Ufa/7YhDWAIfz6Nt4QYenlB1xbSrIKIeeuIQVp4Sb6wVsHBX6NdRJsBVAXiqv249sL anqB/XcdovFY3pVTf02ByUb/CDuq8pI8nJ3k+Dt+KYYwmwhpYfLBRWuRJQrUprPfT+n8 5w0gBo7cpwweiEeDDQelLyfKkiZaqvVJHR9FpoXnuPyig+lI3ZnlX+l6sI9Ce7Qmwmx9 66pDRGmsoYrAf0i5P9jrV3WU3hC1WOod4LkzSQezkCBRZsGERFynws0lXKzK7qsN57AI 4pRIy5xHuqi97KpAfEM97DNykzuklMrsjiOB/3Ou8D6pjSXeCd0wZMrWq1IeL4tHPWZJ F47Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699897598; x=1700502398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9eeFUonyZperk3WbTyB0C+tM8FT/EhmPijOJJIm8Ls0=; b=C1Z7vU8MNJ/xZ5+OAIUqNibbKTun0P6S0alQ6kMqbbxNpgaOg1CpGUuC9rbcipBYNk 2mHOzheP+CaNGQ/lZbQn78Amdh7SnTEr4EvhQFfaT3TPY0BHE/HSY9PuLGNW+L6cQ1wh xQrJuiCRNYD5vBUqUjXPjsLLoz5Pkl9d5xkQJJvOqSQ+ud1oHrU6tvOb5TMfD61mYgPz K2boP0ZflrJ91hiB74EmvAXfKVmjwkQRW9Le0zkiozg41wklkgCsJkKR20BiR9JN+/Q+ XPhNoVwvh9nauKnaU/7GQRSerbQKvni4P13nIpy4Ckp2QhM70oC77Ks4gTGOLQioJtyV EbTQ== X-Gm-Message-State: AOJu0YxqQWYrqngSUK2k2BuVqQRQ0Gk0y//cAwp//h8se9izz8aiUrNk +sf7i14l0Al1rDTNtiAOmP0dopN0Dchb42RHDyU= X-Received: by 2002:a2e:2e0f:0:b0:2bc:e2bc:81ff with SMTP id u15-20020a2e2e0f000000b002bce2bc81ffmr5033411lju.51.1699897597676; Mon, 13 Nov 2023 09:46:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c22c800b0040303a9965asm14391110wmg.40.2023.11.13.09.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:46:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/4] hw/arm/virt: fix GIC maintenance IRQ registration Date: Mon, 13 Nov 2023 17:46:32 +0000 Message-Id: <20231113174635.2540484-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113174635.2540484-1-peter.maydell@linaro.org> References: <20231113174635.2540484-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::230; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x230.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jean-Philippe Brucker Since commit 9036e917f8 ("{include/}hw/arm: refactor virt PPI logic"), GIC maintenance IRQ registration fails on arm64: [ 0.979743] kvm [1]: Cannot register interrupt 9 That commit re-defined VIRTUAL_PMU_IRQ to be a INTID but missed a case where the maintenance IRQ is actually referred by its PPI index. Just like commit fa68ecb330db ("hw/arm/virt: fix PMU IRQ registration"), use INITID_TO_PPI(). A search of "GIC_FDT_IRQ_TYPE_PPI" indicates that there shouldn't be more similar issues. Fixes: 9036e917f8 ("{include/}hw/arm: refactor virt PPI logic") Signed-off-by: Jean-Philippe Brucker Message-id: 20231110090557.3219206-2-jean-philippe@linaro.org Signed-off-by: Peter Maydell --- hw/arm/virt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 85e3c5ba9d2..be2856c018a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -576,7 +576,8 @@ static void fdt_add_gic_node(VirtMachineState *vms) if (vms->virt) { qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", - GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, + GIC_FDT_IRQ_TYPE_PPI, + INTID_TO_PPI(ARCH_GIC_MAINT_IRQ), GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } else { @@ -600,7 +601,8 @@ static void fdt_add_gic_node(VirtMachineState *vms) 2, vms->memmap[VIRT_GIC_VCPU].base, 2, vms->memmap[VIRT_GIC_VCPU].size); qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", - GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, + GIC_FDT_IRQ_TYPE_PPI, + INTID_TO_PPI(ARCH_GIC_MAINT_IRQ), GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } From patchwork Mon Nov 13 17:46:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 743476 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1753646wrw; Mon, 13 Nov 2023 09:47:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGP32pHSgxVWx5AG2b7x/40JJsBwO18lMqxBWv+x+txkZb3uOEzxGVqDpz6rTBiNbBhO40F X-Received: by 2002:a0c:eb4c:0:b0:66d:2915:4682 with SMTP id c12-20020a0ceb4c000000b0066d29154682mr8076054qvq.9.1699897673022; Mon, 13 Nov 2023 09:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699897673; cv=none; d=google.com; s=arc-20160816; b=NqaKE0c8tfqIWzGROeXw0wZh4MHf4yA8ZpQH399bnnk2kyU9FKUPlCec6z7vhiRNso Aa5J3gdxovBBbIX6ZgJc3xdM1bPhgZmFW4eqxVyMmzqBVusAwZyQzOuKY0opgR+K0M9F LRpazZs5G0GmfHelQtj/7+FmcK/MwEmvSSTImJPmzpHwaBHxzCj5g7jLDpRF3aa7v5eL r5BeVskVFmhHleAeEaXgub+0F/YrroV6ClhpEyFRNitd28iRqrEGQWluBQOiK54GEcsD TmoC/Ba1/KvdifL0ImffhGUHynHBOCJQbc2HRnyqMP+9Lhkby0LwIy6SgRTDAUV11UmE P4gA== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KnY4HIPw6PCJOFctLWZTvnAUbilKXxg/CSm+3MzKwSQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Euhv2zjF+M3ZXPFtrN/n048CHMTxvBKlnhhpvIrXSAfFF3uqSaxK/cJEFbvQgxMnGi o3IWrw52tFSWHb+aZIWcuZ0OcY2uy+Ani4Y655BdXUccSTxOlR3JFY29uY8lZvwrnyfZ Pj+hatOMylbqHTQzd9GPvzDBnxU+jFnriZ7xnDRAZS8Z3fhH6WjNlJJvPvhb3ayQQNML ClOrY7/hk0vM7d1KeJpnFQvdp7sxNGFnWWu7fcojwKvRF9mwOIrs3atutTcr5RE5rW8e 8KrAsGzsjoOBJIFmBEEv0Sx84BwJfUFbU7zI5ey0h13gN17zdHEz5g7pEYIM++KD7Azc DYjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P0aYTjqc; 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 pm13-20020ad446cd000000b006716c269316si5099682qvb.467.2023.11.13.09.47.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 09:47:53 -0800 (PST) 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=P0aYTjqc; 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 1r2b1V-0007HZ-IE; Mon, 13 Nov 2023 12:46:57 -0500 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 1r2b1K-0006y0-8l for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:47 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2b1E-0003Jv-S7 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:46 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-408382da7f0so39268245e9.0 for ; Mon, 13 Nov 2023 09:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699897598; x=1700502398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KnY4HIPw6PCJOFctLWZTvnAUbilKXxg/CSm+3MzKwSQ=; b=P0aYTjqciBSA2H4dAZOpdzmoOiT+RAqufN/qFV/hteM9okyFufE1JUiYumYWdszYYJ 4kOiqI5AWD18gBSMYwHk+3tBvCEKtOYBdLbKP3D4Das1Hqi+kfYn+9rI2bcB7fHawcDm Klnr+KCegzpQZ/zoUEgNHSym5RvTtKHLE9eIyOEgyTUpcjriP0hFQ1mUdcrX9H7uHDqv w7i7mrqSulhszqALLpNOTZfWquop7nch1UP8fxnfBVFJ30QwAZ7sWkwjj/HN0977vlD6 3DrfPMg+72Vm7UZmIrGtkWiCRe2T20Fp7HKIBvBI3fREbzFud8Bi37c8r6UT/IhiER/W WgaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699897598; x=1700502398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KnY4HIPw6PCJOFctLWZTvnAUbilKXxg/CSm+3MzKwSQ=; b=l9iFlG5ea+fol2q3n27NTuuokiYWru4hy4P5rLf0+GdHpSVxQ+OJuBXw1565JRsJen uxIKZqikk/vegfpWTlWbh4RM80+Jge4XlzJmjR787MPQ4fTf5kCNvOs4RiFJf017fwwr JCG8zMfkN4IixK7oLVLzh+z5Y0X1Qvj3YlE7k4tVOU3FM/IAcVLwvVFeQfAhXUZC75jJ /u/S9OOObKKIEyMUNlBmmEF9fPa6zfDptzRHY5LUkAnfxTwUskp8Q+Eju8RvzbUswx0g rtpBiaBLs9IVYSKRfDynPAb+1PpROrc3cKUKCDUW79lBzpAq/RsozYNLs+tk7Uq6twHY udwA== X-Gm-Message-State: AOJu0Yye46nPnMwQDsDA/RJK4efyaLiIJwz0vGmKv+Z4ZJm4SLEWk2v0 2E6MMtl73J0MlAOMHqPWbDzsl+igw3ghcOeMYBg= X-Received: by 2002:a05:600c:4f47:b0:405:34e4:14e3 with SMTP id m7-20020a05600c4f4700b0040534e414e3mr5517848wmq.3.1699897598163; Mon, 13 Nov 2023 09:46:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c22c800b0040303a9965asm14391110wmg.40.2023.11.13.09.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:46:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 2/4] target/arm: HVC at EL3 should go to EL3, not EL2 Date: Mon, 13 Nov 2023 17:46:33 +0000 Message-Id: <20231113174635.2540484-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113174635.2540484-1-peter.maydell@linaro.org> References: <20231113174635.2540484-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org AArch64 permits code at EL3 to use the HVC instruction; however the exception we take should go to EL3, not down to EL2 (see the pseudocode AArch64.CallHypervisor()). Fix the target EL. Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Message-id: 20231109151917.1925107-1-peter.maydell@linaro.org --- target/arm/tcg/translate-a64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 41484d8ae54..a2e49c39f9f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -2351,6 +2351,8 @@ static bool trans_SVC(DisasContext *s, arg_i *a) static bool trans_HVC(DisasContext *s, arg_i *a) { + int target_el = s->current_el == 3 ? 3 : 2; + if (s->current_el == 0) { unallocated_encoding(s); return true; @@ -2363,7 +2365,7 @@ static bool trans_HVC(DisasContext *s, arg_i *a) gen_helper_pre_hvc(tcg_env); /* Architecture requires ss advance before we do the actual work */ gen_ss_advance(s); - gen_exception_insn_el(s, 4, EXCP_HVC, syn_aa64_hvc(a->imm), 2); + gen_exception_insn_el(s, 4, EXCP_HVC, syn_aa64_hvc(a->imm), target_el); return true; } From patchwork Mon Nov 13 17:46:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 743475 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1753520wrw; Mon, 13 Nov 2023 09:47:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7g/637cztlD/iSJWcGGusD4QRcOIluKmy6QrtLbjvYiW79v/Pr5xUqjCEepUslNdy44FV X-Received: by 2002:a0d:d4d7:0:b0:59b:fb69:1639 with SMTP id w206-20020a0dd4d7000000b0059bfb691639mr7897840ywd.32.1699897661394; Mon, 13 Nov 2023 09:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699897661; cv=none; d=google.com; s=arc-20160816; b=JPIkC4Zu11RDU6SOEOtH8IuHPky2vcifNO5ateb86LfVJhiv4X1WbU2KRQBdEOsE9A FUFcyKjSXi9BumJZ+xPlgV3XVTMPYwagZ1Yg4KIyBX9rM7/kHvGFlfJ3vZPhUd1kKW0U d76hh51Qj19hjFvTTodEL52NTbr2pAdW6Hd8+PojP7XsG7cTbe1+WBl2+gKEHn4cjMac jg4GTQknnfqdqXJRfzst/DllnLI1oOPxVQWG5aSGNyQL9tTam6x8nYvF/VF959Y8SMSO vHa3IrHpqP6OAibOuyPp76yzpOyj9IVPuk7fLeTEgHOdNPGe2fAGOWz6YMy+Y518Otsp 5NjQ== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=05kJ8El/iylLN0nD6QWUxl+Z5sjkndWtmUtzuzIy7ck=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=EJKI4EbMyRA/lqFt1gGVWRhtZTZTXB8BfS1Z+zNseOKhzt/JOpYeRnh3O2H/m6yoe2 VWDkJEGO9RzDqFYGoma5IA46eS+RmPUJrZlRmfAcxmbj+mwQ2BO9MQcMgHGZ40nfJdWQ 9JVD2G/WSle3o1eUnwiCliJBY9OyEzYucuN0dVn7TWVdCkCeg2esUl/UzMA3KhvAr1Ia w+MTZTYPCTTTCNgVGiLiyaVvgmRIlNigg+qkc2szVHw9kKSOIO+A0xV0NC9IovswtJBk /f7PDz35RIbt6gYAcmuRa0XWRdmaQI2AgorJ5iTcrnPgX6P+AeQHCTnw2z5/kEmpj1Wr Nzyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SDyObbPc; 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 l15-20020ad44d0f000000b0066d212f6b65si4872501qvl.525.2023.11.13.09.47.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 09:47:41 -0800 (PST) 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=SDyObbPc; 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 1r2b1W-0007Mv-QQ; Mon, 13 Nov 2023 12:46:58 -0500 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 1r2b1I-0006xi-Dq for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:47 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2b1E-0003Jn-Eo for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:44 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4094301d505so37227505e9.2 for ; Mon, 13 Nov 2023 09:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699897598; x=1700502398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=05kJ8El/iylLN0nD6QWUxl+Z5sjkndWtmUtzuzIy7ck=; b=SDyObbPclYkWcw8py3tEW2TmFuIPWKx6ShtPF+87AmBEMAlnZqtcakHOYz9m/TBd6h tdRgUy0iQTgnX0uGqWYtl0depFmrJoowLC89ol4E7G69dqfoKzzGPQ/qMG8hobe/H2s2 Mb2gfqZXywhYKm+4IttX/sQ0Zq/DP8XGZ0KkLuppM8u2IX3oReJ829rH2XKbjLMj8BFG Y352NsvBf8dyMCHqzwT88j1DWvAMvffxc7dFaFrSl+4DtPUjg3OL3RJTBcQZAC6/I4ad PwEgMJc8NR4a20v+uVCek9lhGOInMJQ48xoKhcw6c29zwfetjyMqlCvbNNAa0+LbUUNq JM1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699897598; x=1700502398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=05kJ8El/iylLN0nD6QWUxl+Z5sjkndWtmUtzuzIy7ck=; b=GSw+xMIK0OuzZFri78kDMKm9pRhPMlbHL8niqFgItmWTw80l3Mwf5P6nWbZ8s3xvHN /vlwO/rNZxeoVxpvEfXtgOxIAX81P+hXznsJ5UYpW/GSHBVbdMT7PKkLrdfTG71z7xP8 eS4iM+kwnEQzstbPLGywQUu7hzahE74qgdK+pRvBG3OMvlqyg97wRIxvM8LNeApfEcbw 6rSuN0tqAsE9HAwefxlDEYiizRto2XSS0+JTPPn+fyrjC7TVdHy0PT/J5BuUa8u6vixp 3cCsUVRl/gAtAdZKJtbR/7j4zEQ/lzGMNSfWpRyUjpDx3w6uRKRgNwWF/3dMpaiyvTQp V9wg== X-Gm-Message-State: AOJu0YwB8bKnFK2kcPjHs8ZboUQRPiDYqBLweqNlFqJqiyHRQL0Vzh92 8yQEL7eHW0LWzNo7351yFDB83h8jgea0GZtVRgA= X-Received: by 2002:a05:600c:1ca7:b0:3fe:f667:4e4c with SMTP id k39-20020a05600c1ca700b003fef6674e4cmr6143701wms.12.1699897598581; Mon, 13 Nov 2023 09:46:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c22c800b0040303a9965asm14391110wmg.40.2023.11.13.09.46.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:46:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/4] target/arm: Correct MTE tag checking for reverse-copy MOPS Date: Mon, 13 Nov 2023 17:46:34 +0000 Message-Id: <20231113174635.2540484-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113174635.2540484-1-peter.maydell@linaro.org> References: <20231113174635.2540484-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When we are doing a FEAT_MOPS copy that must be performed backwards, we call mte_mops_probe_rev(), passing it the address of the last byte in the region we are probing. However, allocation_tag_mem_probe() wants the address of the first byte to get the tag memory for. Because we passed it (ptr, size) we could incorrectly trip the allocation_tag_mem_probe() check for "does this access run across to the following page", and if that following page happened not to be valid then we would assert. We know we will always be only dealing with a single page because the code that calls mte_mops_probe_rev() ensures that. We could make mte_mops_probe_rev() pass 'ptr - (size - 1)' to allocation_tag_mem_probe(), but then we would have to adjust the returned 'mem' pointer to get back to the tag RAM for the last byte of the region. It's simpler to just pass in a size of 1 byte, because we know that allocation_tag_mem_probe() in pure-probe single-page mode doesn't care about the size. Fixes: 69c51dc3723b ("target/arm: Implement MTE tag-checking functions for FEAT_MOPS copies") Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-id: 20231110162546.2192512-1-peter.maydell@linaro.org --- target/arm/tcg/mte_helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c index 70ac876105f..ffb8ea1c349 100644 --- a/target/arm/tcg/mte_helper.c +++ b/target/arm/tcg/mte_helper.c @@ -1101,10 +1101,18 @@ uint64_t mte_mops_probe_rev(CPUARMState *env, uint64_t ptr, uint64_t size, uint32_t n; mmu_idx = FIELD_EX32(desc, MTEDESC, MIDX); - /* True probe; this will never fault */ + /* + * True probe; this will never fault. Note that our caller passes + * us a pointer to the end of the region, but allocation_tag_mem_probe() + * wants a pointer to the start. Because we know we don't span a page + * boundary and that allocation_tag_mem_probe() doesn't otherwise care + * about the size, pass in a size of 1 byte. This is simpler than + * adjusting the ptr to point to the start of the region and then having + * to adjust the returned 'mem' to get the end of the tag memory. + */ mem = allocation_tag_mem_probe(env, mmu_idx, ptr, w ? MMU_DATA_STORE : MMU_DATA_LOAD, - size, MMU_DATA_LOAD, true, 0); + 1, MMU_DATA_LOAD, true, 0); if (!mem) { return size; } From patchwork Mon Nov 13 17:46:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 743473 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1753351wrw; Mon, 13 Nov 2023 09:47:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfZH4BbSKWo5bCKAuoK2kXCtQzVgofASXXVBsbJxxsbuyuVhogaOGRiKWuarlDSvI4UzM+ X-Received: by 2002:a05:6358:9486:b0:16b:bbf6:b9da with SMTP id i6-20020a056358948600b0016bbbf6b9damr3455055rwb.14.1699897641637; Mon, 13 Nov 2023 09:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699897641; cv=none; d=google.com; s=arc-20160816; b=vzFiI+E2Zlh0XNHKlHRcP3wngq8mwoerxfBHMHhrrbU7/7HyVzZYGI1XXvGYi2ysEI AOFCMKaocCUS09fYnhIGz++ATrfTXsYe6Iz5p9Hi/ntOiH9CuRyjHRXUtoUvFPuBluN1 xdYsSQ7bU1MGs5NjGG8O7yAVfLlcgq3EcdgYZf2+U1sdyLO0GjSfK+I7eTl9ekFMlNB+ mPdY/c4/p+fvxyyKfQEW79mCdoANp2d0TerQ1zcetG5YFX0erGDBv7VXYrLDL/DAywan iVaY/pjBDxIcsmZDmK2s4zoBZIVJNrpf2dKUZbAVLyigLGqoga0LDatQX2wvM0OfJd+Z bf7g== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=V5Ainl8mAVCq+cDQ3NH1GIuR546ttmnhxNDBTCTMOEM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=cXqRTJzu7Hgf/a0JYc5jwxzCe4SwTd8L1zKqr7IeJVcjBgfDet672QMNl6wfiikBtE pmErpk32d6qlES/NLxGn/fGj3Sg541lzt6WBrpU+nxgm0m4EA9KBwByGo2hhZiMZRLin qV9aVUWW3/RuQj4JqV+zX3WVJZBjc7XbWg/eK1Au67lNUVCV8oaNxlT/L/Q7TKFMJDJA T4tYqTgcWCTXMGtTPZXik3NWaCWtVnynBa8YjHsDaxB+8xffkI/+9g0247DxDVrYAp+W Us0PwBl2BgGzGj+O/KRn66EztdSGsLm6aqykFHFr2cRSGPvVXG2CwQH2rb1gBTD6wfdz macA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ej9zHNws; 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 y7-20020a05622a004700b00417b2074a0esi4800801qtw.457.2023.11.13.09.47.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 09:47:21 -0800 (PST) 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=Ej9zHNws; 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 1r2b1V-0007JO-Bq; Mon, 13 Nov 2023 12:46:57 -0500 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 1r2b1H-0006wy-DP for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:44 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2b1E-0003Jr-F2 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 12:46:43 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40a4d04af5cso16397165e9.0 for ; Mon, 13 Nov 2023 09:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699897599; x=1700502399; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=V5Ainl8mAVCq+cDQ3NH1GIuR546ttmnhxNDBTCTMOEM=; b=Ej9zHNwsJgisf5FBJzYJeopsT42Y1I9zdNf+aXfAnQqq49WEkB21zuvb8M0nuNnGKG TOaR6FhqHW0Z7ntulKAlxraYPvGCu0MyoIiMAndBsKWkKcJUO6dOQ0Arms2iS7m5jb3V l7flw1mwDsDjod4df/33HqL+SDmn9cb/Qqvv2WSZoG/Of4ZSO+fUYRtkS3bXiziw3Xo0 x0YqpeDVJJRkFjmYo0cbw+HgRR4Yy4ZJJYU5qa11tKT4Ln/mvBIl+DzV9VmfjpJzNepH m4pickk7gbP82PzVnvTJC+6Rjh/eXSQovi+FmXBgEid/2IJ9KOlZsTXsIPlocFzUru7l lUZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699897599; x=1700502399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V5Ainl8mAVCq+cDQ3NH1GIuR546ttmnhxNDBTCTMOEM=; b=MfkbSTUog4j0g8dGMtyHb9uOFTu878O4v/fSZoiiqlk1vQBymndlMqTZ3NqdmqdiJN 6l4K7vb37GWz50KXP2UOrhWyrDViYaLZyJLwHaaSSl+GYu3CYrnrOb6sv8PMINX2jgwm hNWeT1Ph9oGaQ8SmDbovSxMyrxQG0qoOAx9h0NzVTc36N+zSULhhDBXn5gsuXZdwR+9W FgIoKsHU+ZeNEtBmuPq8gC1LAbQwCjsKfdrIw8qZum9YrvAxZsHmYkpuGCqsfdgS9FnK ZxGbikPlLn4prSkBU1xHG1aqq4R2Ai2H2dO7SR87/LlF0oZzIlaTWgjDsSO17mV6ExlS B01A== X-Gm-Message-State: AOJu0YyexVQmOOf8roy+CSyzyebvnpQqp2R0UDeMFxMsIZ1v3GmUMG3q wGMK5m04vTrbiEftPD05ZnT+/GIbwhO8nw0GYYQ= X-Received: by 2002:a05:600c:450a:b0:409:375:5a44 with SMTP id t10-20020a05600c450a00b0040903755a44mr6112747wmo.24.1699897598975; Mon, 13 Nov 2023 09:46:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c22c800b0040303a9965asm14391110wmg.40.2023.11.13.09.46.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:46:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 4/4] target/arm/tcg: enable PMU feature for Cortex-A8 and A9 Date: Mon, 13 Nov 2023 17:46:35 +0000 Message-Id: <20231113174635.2540484-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113174635.2540484-1-peter.maydell@linaro.org> References: <20231113174635.2540484-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Nikita Ostrenkov According to the technical reference manual, the Cortex-A9 has a Perfomance Unit Monitor (PMU): https://developer.arm.com/documentation/100511/0401/performance-monitoring-unit/about-the-performance-monitoring-unit The Cortex-A8 does also. We already already define the PMU registers when emulating the Cortex-A8 and Cortex-A9, because we put them in v7_cp_reginfo[] rather than guarding them behind ARM_FEATURE_PMU. So the only thing that setting the feature bit changes is that the registers actually do something. Enable ARM_FEATURE_PMU for Cortex-A8 and Cortex-A9, to avoid this anomaly. (The A8 and A9 PMU predates the standardisation of ID_DFR0.PerfMon, so the field there is 0, but the PMU is still present.) Signed-off-by: Nikita Ostrenkov Message-id: 20231112165658.2335-1-n.ostrenkov@gmail.com Reviewed-by: Peter Maydell [PMM: tweaked commit message; also enable PMU for A8] Signed-off-by: Peter Maydell --- target/arm/tcg/cpu32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c index 0d5d8e307dd..d9e0e2a4ddf 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -351,6 +351,7 @@ static void cortex_a8_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_EL3); + set_feature(&cpu->env, ARM_FEATURE_PMU); cpu->midr = 0x410fc080; cpu->reset_fpsid = 0x410330c0; cpu->isar.mvfr0 = 0x11110222; @@ -418,6 +419,7 @@ static void cortex_a9_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_EL3); + set_feature(&cpu->env, ARM_FEATURE_PMU); /* * Note that A9 supports the MP extensions even for * A9UP and single-core A9MP (which are both different