From patchwork Thu Mar 28 15:33:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 783593 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2788682wrt; Thu, 28 Mar 2024 08:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9uLsknG8Z8/lo1kAEH+J2n9VkExDPwLL9wfVVqzxP40qH7suH/oyTtwo7BHcBbJNF/V8d9jEznJLOTEcX2sf7 X-Google-Smtp-Source: AGHT+IF53K7JA/CiS9jSxIzulXijDDOE8wdVDj0jdlWEQ8IjZZUeGspgN4mTiX9Q7s2rB+H4/AEj X-Received: by 2002:a05:6808:140e:b0:3c3:bf7c:88ff with SMTP id w14-20020a056808140e00b003c3bf7c88ffmr3677548oiv.46.1711640094051; Thu, 28 Mar 2024 08:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711640094; cv=none; d=google.com; s=arc-20160816; b=tk/32wXwzOQSB9JUl7lB8zIpVweMUHS6GVNQL6cjfz7PbwG9AT63f1tZvmL8wazEFh 2JLaYs6qVMXYiiS61tXPafu7uSkOf/W+eqFrl2MLX2JXHzngDT+n5etqcDG8YFef5Lsz x3gKWyNVda+bR9wv2EzOqdKLbbTI7ajjWFheXfR0Ez2gpc6b7FOKfDuHWne/Aa1FIsIH K5SxhDVCe1PUIhCo/rGZOLQ6ls081p23lpCp99TrSPsKCnmjs9vw86buLEiyWKjG/PI8 s491JimqBT0etiLwxBEZvr6hpSeNGzgrChxB+7G9+C2R8B6zdxkxnJ32zBLsWh8a76q4 CEew== 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=HoXcWIswnaiYn+YGfxoqs8bfwHg7SCgsOteFXjUUrDI=; fh=VKyyTrzO0c5VvclaSeYho2UptHzbExKYG4Wdtar0FuM=; b=hbQOsV7xtsaKYhOAnexoEvBtJj2vtY4t8LXe5FrQto69ypiXW/aeXi5/pBGrt/KQ7Q XJTsNRCDUrX1uIc8zzzO7b7MeLp1PD3Xq0p029kCRCf1u+TPyXJKPHRNJDV3o1JPsJRN L+5bNjbtASefiyFNmyFSaXQotvTJ/PQt/B05wu01SRx6j7MBaSD8+LIAGolvVbgFzvGL M0kEQbzI+t+ZVMOpYP7pR43MDMjxVvf2sDnCMyOJ/QbD1g5WZDEtHBf/ODybVlT9M2Tp GeetZpFUHxDckCrofn1rwbQP18Eo6lEK8DrmmKYBCRsa/0KGAfFDMAApVnTNpFHMesyF n25w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lrPq1BXS; 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 v36-20020a05622a18a400b00431757bd5a0si1607901qtc.643.2024.03.28.08.34.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2024 08:34:54 -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=lrPq1BXS; 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 1rprl7-0008Pr-Ll; Thu, 28 Mar 2024 11:33:41 -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 1rprl5-0008Ov-Cl for qemu-devel@nongnu.org; Thu, 28 Mar 2024 11:33:39 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rprl2-0006IU-Rl for qemu-devel@nongnu.org; Thu, 28 Mar 2024 11:33:39 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-34175878e30so767910f8f.3 for ; Thu, 28 Mar 2024 08:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711640015; x=1712244815; 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=HoXcWIswnaiYn+YGfxoqs8bfwHg7SCgsOteFXjUUrDI=; b=lrPq1BXStVueusSFfHC1HToxaenBcx4LtMGLV9TidOCdtHYBLjtDSt3tb29WngSAoC NeLSh7tRkAOSWCCuONOA+gByvIB/WXOkP7yPVcj61ZTLxijaCwaVfCzyjSSlkGgFHM/B hgZEwl1HyEQHibBhwfcQQ9qRHGaR0cGk7JGcnpSXyYB6LjIM7LMAQJ7TlC0j06MNE4hf uVkMNYbx0gu8pV3C+jciXZECTny49b9nY9Tr4L6P5fFXH23hYxNUkoK//zX1OOH4btFb 4zpZZ2Bxu+BXbxkW9+AZWwgE1xyDU/eHyMjitF4Ijs/eg3ZZWolcxKb3/LZY3vKyBknv qrZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711640015; x=1712244815; 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=HoXcWIswnaiYn+YGfxoqs8bfwHg7SCgsOteFXjUUrDI=; b=i0iE6aefeCMxfOAHxKvrgaIIV8cP2ai/AIBxnXuB/nDa/CP+03e2UPcSU7xu2zeFZ4 tkVpz+odQ3nsaH7hte7GJofCBKIKE0eWnUKcdIyalmsUs024ZQZ1Mj43cSBZNeT0IwZG zRj8mQ+zqOxuL3rHi1RNfXVjtLhEr468M1YzemZ1tIc425tf1+uVawuc7NXwhCtTJGWU 5+CSMAScCsa63fjkZ+QTVMMH6lC+u/c8g1mpfCCHIMsN0C2Qbm3USqcaVPOk1nLmQe7g 3sVAhi1ucyrd9iRz7kEt4NCZrSPIKhdkl/WWSdV8lDAGdD2Wgz/cRCjMXSy6CHaT/iik Bl3A== X-Forwarded-Encrypted: i=1; AJvYcCVsrsp5/TtW3W2blFzzVdUargIu2MUNQ7xPhsQA/SHXnOtm7sQYkl6WzlD0pZfQasFJl8UdgDR5luN10S7k7XnpsSyLFTk= X-Gm-Message-State: AOJu0YxOFBQvKI9hkPoxsEYu3zTkV48yVMo6nyFwxjygYBsh9GFgcL19 PGtN0xktQUoWyb/0bNsKW1bQtlFSPrGO9/p0wedjsbCYzbTy7qcyAKUz/nQEMoI= X-Received: by 2002:a5d:6586:0:b0:33e:34aa:d78a with SMTP id q6-20020a5d6586000000b0033e34aad78amr3033455wru.8.1711640014748; Thu, 28 Mar 2024 08:33:34 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id bt30-20020a056000081e00b00341b9e11b11sm2067039wrb.24.2024.03.28.08.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 08:33:34 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org Subject: [PATCH] hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled Date: Thu, 28 Mar 2024 15:33:33 +0000 Message-Id: <20240328153333.2522667-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::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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 If the group of the highest priority pending interrupt is disabled via ICC_IGRPEN*, the ICC_HPPIR* registers should return INTID_SPURIOUS, not the interrupt ID. (See the GIC architecture specification pseudocode functions ICC_HPPIR1_EL1[] and HighestPriorityPendingInterrupt().) Make HPPIR reads honour the group disable, the way we already do when determining whether to preempt in icc_hppi_can_preempt(). Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- Pre-existing bug which I happened to notice while working on review of the FEAT_NMI patches. I don't suppose real world code disables interrupt groups which it's actually using, which is why nobody's noticed it. Still, it's a safe bugfix so might as well go to stable too. --- hw/intc/arm_gicv3_cpuif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index e1a60d8c15b..67d8fd07b7f 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -1067,7 +1067,7 @@ static uint64_t icc_hppir0_value(GICv3CPUState *cs, CPUARMState *env) */ bool irq_is_secure; - if (cs->hppi.prio == 0xff) { + if (icc_no_enabled_hppi(cs)) { return INTID_SPURIOUS; } @@ -1104,7 +1104,7 @@ static uint64_t icc_hppir1_value(GICv3CPUState *cs, CPUARMState *env) */ bool irq_is_secure; - if (cs->hppi.prio == 0xff) { + if (icc_no_enabled_hppi(cs)) { return INTID_SPURIOUS; }