From patchwork Sat Mar 15 06:17:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 873831 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp1061145wrq; Fri, 14 Mar 2025 23:20:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUiXHBOYTO6FfK1PmHceZDpcjk05gnBZf3a2q2IB0FUkCGapONucbxoKdYw8W+mcmL3u4gLnA==@linaro.org X-Google-Smtp-Source: AGHT+IH8XSi7QhXStQpG8wM/zu4pRQdo7538wTpVVIlFvsm5/L7vVFof3o3Wo5YorJE64zNY59Di X-Received: by 2002:a05:622a:205:b0:476:6db0:338a with SMTP id d75a77b69052e-476c813bc78mr83144911cf.13.1742019658490; Fri, 14 Mar 2025 23:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742019658; cv=none; d=google.com; s=arc-20240605; b=RqCXdTtRgCEGDrSV9mxFUX3iJwORn859ATZx2RO+o+pKbe7mw95tys4nbWvOiB5BDq abUKaMUhTe7Tsl/5kwZDAhZynpzgRapEPuu8x8dTJr0tDs9o6rf7zAq57z6ZaLkhPiui 7oIfwsvHBmyIxBd2R8ErlxUIVdrHzL47NKpVyp/zyil5RE/UIK3Hg7wxdN0zs8Gq/wZ6 CNdKH45sO+jFBbMVI3HVnpdszxX03Cq2m2zkE6IuRKFHWJxd5syA9ICPf3kp1DvGMFwS 3/fycnpa6Li8s76l5NnP87yUnEjCIjov85FfXh2dqACnRFOnAhWcs78tj07uV4zAe1uY 3R5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=qvxCxF1on+6xdJxI8cBVRfua/JxHtft7EM0ZW8Juj0c=; fh=upfN+4mcRAuX+bX9oPqMwq1TP+fTfKlWZBqspF+lG6I=; b=OosqU3i6Qr+1jpPtvHrdEovsbiT3e9V3gm7cV8YdVGBvuOJGp9Vcdj/8ZJtumiwcX6 d4HVd2khMbgsRfcq8Td52yAxKjkzKl/2OJVFpKN1Wz9dlfY0ulk/LeUCO53EgXI+swMX GVLFQ2qiW4cLRuYpq36HDW5p94XcFAE8ubaEgAYDETAeDCm60XM58RLZXhKqNaE1GF2P 8VYgivTCSLb3Euvg+pdv6IoyXYiiGlFSQR9Izh9TZbq1yZJo0aP5ujNzbQ6YDI3kKnwH 74ZWi7RgyIX71X12NaECs+uDFJdgbwTNISnXf7537D0JZxdR8TGgFRNFMYx1AyKuj9BM 3Hmg==; 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 d75a77b69052e-476bb7e18fdsi56217941cf.261.2025.03.14.23.20.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Mar 2025 23:20:58 -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 1ttKrH-0003B6-S3; Sat, 15 Mar 2025 02:18: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 1ttKr9-00033s-DE; Sat, 15 Mar 2025 02:18:47 -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 1ttKr3-0003Dw-UH; Sat, 15 Mar 2025 02:18:47 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7C975FF9D2; Sat, 15 Mar 2025 09:17:07 +0300 (MSK) Received: from gandalf.tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with ESMTP id 5406A1CAC3B; Sat, 15 Mar 2025 09:18:01 +0300 (MSK) Received: by gandalf.tls.msk.ru (Postfix, from userid 1000) id 3951B558BB; Sat, 15 Mar 2025 09:18:01 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Michael Tokarev Subject: [Stable-9.2.3 06/51] hw/intc/arm_gicv3_cpuif: Don't downgrade monitor traps for AArch32 EL3 Date: Sat, 15 Mar 2025 09:17:12 +0300 Message-Id: <20250315061801.622606-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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 In the gicv3_{irq,fiq,irqfiq}_access() functions, there is a check which downgrades a CP_ACCESS_TRAP_EL3 to CP_ACCESS_TRAP if EL3 is not AArch64. This has been there since the GIC was first implemented, but it isn't right: if we are trapping because of SCR.IRQ or SCR.FIQ then we definitely want to be going to EL3 (doing AArch32.TakeMonitorTrapException() in pseudocode terms). We might want to not take a trap at all, but we don't ever want to go to the default target EL, because that would mean, for instance, taking a trap to Hyp mode if the trapped access was made from Hyp mode. (This might have been an attempt to work around our failure to properly implement Monitor Traps.) Remove the bogus check. Cc: qemu-stable@nongnu.org Fixes: 359fbe65e01e ("hw/intc/arm_gicv3: Implement GICv3 CPU interface registers") Signed-off-by: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Message-id: 20250130182309.717346-7-peter.maydell@linaro.org (cherry picked from commit d04c6c3c000ab3e588a2b91641310aeea89408f7) Signed-off-by: Michael Tokarev diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index ea1d1b3455..886a1dd6a0 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -2300,9 +2300,6 @@ static CPAccessResult gicv3_irqfiq_access(CPUARMState *env, } } - if (r == CP_ACCESS_TRAP_EL3 && !arm_el_is_aa64(env, 3)) { - r = CP_ACCESS_TRAP; - } return r; } @@ -2365,9 +2362,6 @@ static CPAccessResult gicv3_fiq_access(CPUARMState *env, } } - if (r == CP_ACCESS_TRAP_EL3 && !arm_el_is_aa64(env, 3)) { - r = CP_ACCESS_TRAP; - } return r; } @@ -2404,9 +2398,6 @@ static CPAccessResult gicv3_irq_access(CPUARMState *env, } } - if (r == CP_ACCESS_TRAP_EL3 && !arm_el_is_aa64(env, 3)) { - r = CP_ACCESS_TRAP; - } return r; }