From patchwork Wed Apr 10 07:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 787486 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp571585wrs; Wed, 10 Apr 2024 00:43:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1Tptt/9tkAevpDNFRgFuVNipaF3Z1s7j7WVJxtNa91zPRsJsHkhYTSqJU1e6NJ4NpYBMnkQTkDU6gGAXN3Cgw X-Google-Smtp-Source: AGHT+IEa7cCCYITNgweemPX6NI9kYTFZ7KWN7z+B2jyK0KYz5CBS0UVbF3v31k58U/KP2zM9pVbT X-Received: by 2002:a05:622a:11d3:b0:434:e30b:2cf8 with SMTP id n19-20020a05622a11d300b00434e30b2cf8mr1954667qtk.30.1712734995537; Wed, 10 Apr 2024 00:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712734995; cv=none; d=google.com; s=arc-20160816; b=UJC6DEVgPY6mGQPlAlqRa+WWn7z6W9b4OWJDILjQ2BArVhe48Cau3+XobsOWPr8Wi/ lmeQQyk7GPVPMSAx+5bUwOm5/xrACLDjrAQFPY9KeY37MAKXKupBfO6FcJGRMNQebBT4 hF+BiyEf4d68bPMDV1dcmx13+EIRh8S6BSHnRqzW4cp+i9DHuAVeTPVJatwYkEuVxfpA u90mRdiNR9jcqjl5Yz7xe5QV1ESKC9MHSlm1VIeMeSwBbYWz//gEFOvzN8STl0emTI+X vU187NILWt/Y9kezox3Hq6gVRK5MhmOiI0rIxyfkfuxATQOG5qPUPqN5Oz7ahqlxVb9H Rkvw== 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:cc:to :from; bh=NEyzqnL1srbnZU95s9tfMinTyWn9xDPViewoW5k1wRQ=; fh=xJ1URYKcMN3TM0/XAv5v+aCN+5tIbzAdcfBx5UNgoLw=; b=WC/GyA8kbsHmHfBhf4T4Y8GSOpCqLNRi0Htr29J+E+HaxEktLOlcls7YN44cffUrsL ldOWMnxd+EaEwf3gq0BAbfrK+s/jtyJNn+Yb/kH7ULWGM18Gdce6LBG5iXHG91whxV68 sGqv+bOvULJSk3oAHjdKz4EEksSGq+OA+1LitXHiuN4WGPaRm1Rnyt9raKe/gBIottQG 28upyeDSjGqRDSBvRLYCtGsZkt0ZcwA1wmYREVHaPYDu5LSRq1sfo95qA+NMKUl9SMbt mUfX4sfKhLIJiJdy0ePgNYW/QDx2mVsF0+GPdxRvbbQTPo+CmVUOVYs5LcVlQO3hPJX9 GuJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020a05622a024500b00434ebb49e2asi2308958qtx.138.2024.04.10.00.43.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2024 00:43:15 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruSPr-0003MI-Rz; Wed, 10 Apr 2024 03:30:44 -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 1ruSPg-00033w-H3; Wed, 10 Apr 2024 03:30:34 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruSPe-0005NP-AL; Wed, 10 Apr 2024 03:30:31 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2B27C5D6BE; Wed, 10 Apr 2024 10:25:08 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id C505CB02FE; Wed, 10 Apr 2024 10:23:09 +0300 (MSK) Received: (nullmailer pid 4191885 invoked by uid 1000); Wed, 10 Apr 2024 07:23:04 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , Richard Henderson , Michael Tokarev Subject: [Stable-8.2.3 78/87] hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled Date: Wed, 10 Apr 2024 10:22:51 +0300 Message-Id: <20240410072303.4191455-78-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell 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 Message-id: 20240328153333.2522667-1-peter.maydell@linaro.org (cherry picked from commit 44e25fbc1900c99c91a44e532c5bd680bc403459) Signed-off-by: Michael Tokarev diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 258dee1b80..3364f6b706 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; }