From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8E80606A322 for ; Fri, 4 Dec 2026 06:18:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OmpNxr6l Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZMc0-0006rR-MK; Fri, 04 Dec 2026 01:17:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZMby-0006qU-JV for qemu-devel@nongnu.org; Fri, 04 Dec 2026 01:17:38 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xZMbw-0001Q0-Qk for qemu-devel@nongnu.org; Fri, 04 Dec 2026 01:17:38 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4b467581b98so3720155e9.0 for ; Thu, 03 Dec 2026 22:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796365055; x=1796969855; darn=nongnu.org; h=content-type:content-transfer-encoding:mime-version:message-id :in-reply-to:references:user-agent:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to:content-type; bh=857RCFKci8fFD6DL/dRyqKTLAIi4LjcZi0WIxqBN3xA=; b=OmpNxr6l6sJoH16n7Jj1ixfAN6lPHb0lSJ+tIZsqFtb7kyPDME93hmXOkSoI00kzky aVpngpagKQwrhs8blC8f2tbMOnkO86iiuQ2cBxLw10/E7k2MaoPbZV3dWfB2PP6wowMy LvkIL4ZLPkjdxA0Wi5i2WWgpIi9NraAWZbePvAgfkOYFSoFpm9zgoBShDnk8h8Uj+P6O +ZCd50tpa+t6kLHHSDNh84DMshkHV9905cWE3vAMW9fy2lP9UOaVdDgozq9vCPk5Km+F HqvZehdPKFjcf0inThAe1yaWbJdDF8cVXH4qTI7k/bXwVrMxvZ0O9HYOZHcdjus7RiDH d9xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796365055; x=1796969855; h=content-type:content-transfer-encoding:mime-version:message-id :in-reply-to:references:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=857RCFKci8fFD6DL/dRyqKTLAIi4LjcZi0WIxqBN3xA=; b=Gw/JmWLqzkSgSoYTk07SEUpZP5xcLIDsSf8Y0CRYNKoC47c/zrUEywtHcsrw/uMOP4 W53EMfLpKo1t3FKwJc2YEQ7qqxRiZEgntkfCo+yfWxdevt0GOytwbmtBgtPMynFuEVsK 7BmWx1U5XFTC490gtxUceWKGC9cpL9Uu6IBZ1jp/lk6AmIvYgOVxceFBqUeygA8d16fd w28gPHQTtrZUK3z14d5t9TY+BWn7IGUsoS7bO8pixAV8na89cDsKQR+WPqNSSxrlBxSA 9v0i35I8LNfScxKSXzQ3gu3vd3cryl1qjJjWqUAm+I+xcuf3tEJ+brOH6hPjaTaHSgRA Uqkg== X-Forwarded-Encrypted: i=1; AL+hErFfWGB2bxVpW1pykYI6wm6mwg+kffAqmwnEplr/3fvssvsL3MsZDOyhJczgxMJXvTxiN3SmcjqM+/Un@nongnu.org X-Gm-Message-State: APuU4Z+GgZ542K2L/1OgSngsxj4WsciQpPd0YSX+d7/R3fIRchnF8BWm eI7akyXAENPi7zyHrYOE2UIEl95hUwfYLq2tlBA+SyZTwOwZKItW/EnaJl4m1zTh5uE= X-Gm-Gg: AZFdTZebxEKy1qYWG4MpfoZn3yXcNaxZkP4kDM9tlG15PnfyIGZVNCYx2aQDji0QKjY PoJeb6JQ2JJNwLTQiXIVn/IYJ/vsVCOcwLECRimrsgVfekB9NEAcesy4doyKqIQAWyPMdqM+B+t rykpFBhsT3WoX9B5NwCJ7Mh8wWYXnZVfgtsmmk7lNS7im+7XGIKOUcOyjfXZuGETqlU9n9n7flN Jj8aYT5S+Xs2Dj8ZhowtpoDQ1G2vPGeMpMHpw1798yDY0e8Cq+I235z+/Eqfs9NIX5IV7E528dT tB8j9MShegGIYviYZ8S6KgrKZEsz5duJ1dlLFpEkTDdlslnatIjI81LFXyAD4BnQOpJ439bP+lB WDlrFNxCkGus7XZLkBS8Jh1br5nKNAM2sHjnbze5g7Bw9iSRm/ysXRLsenBPUq6OleXGbE8hfzZ /Id9gj3gNxB8oDWU267ELRkWcOgnuXexBBahPlTy2AL1ynImqNIUZWwovh37H69kFnv2AQZ3Pia gMP60P3bkZsxkQ3cLwLAvRw2N/q1gI2l83DDoheapl4rfe4clQhLlaqTEETxHzGF+JGfu8vw/7s 2MEm/XSfZekBi0JE26S31kBYlH4VAmZTpxu2htdF1JggUnd4ufEynug1QRtA4Noou7nCtOf26Jn iMp3ibA7Zs6gnf9n2lu0FWKoD7Ckq99Fg7s59DWVTS5K+i9z/fumdjo84+azjFkaaBubElqhj7S jQfwetMtglHlUVtWASiUUw4vEiMzSWa4iEhtFxFQFU2tBWpBCDIJZDPC9IdXSDrBHL+FY1+l8Xn hSOgZ058vJF1bEXgg== X-Received: by 2002:a05:600c:6287:b0:4bb:ac7a:23f7 with SMTP id 5b1f17b1804b1-4bbeb8f8a20mr13891515e9.26.1796365054754; Thu, 03 Dec 2026 22:17:34 -0800 (PST) Received: from meli-email.org (athedsl-4431069.home.otenet.gr. [79.129.140.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea0b5e3csm28945565e9.0.2026.12.03.22.17.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2026 22:17:34 -0800 (PST) Date: Fri, 04 Dec 2026 08:10:23 +0200 From: Manos Pitsidianakis To: Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Philippe Mathieu-Daud=?UTF-8?B?w6k=?= , Manos Pitsidianakis Subject: Re: [PATCH v2 12/77] target/arm: GICv5 cpuif: Implement ICC_SRE_ELx User-Agent: meli/0.9.0 References: <20261203111118.1380524-1-peter.maydell@linaro.org> <20261203111118.1380524-13-peter.maydell@linaro.org> In-Reply-To: <20261203111118.1380524-13-peter.maydell@linaro.org> Message-ID: X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8"; format=flowed Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wm1-x32a.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=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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, 03 Dec 2026 13:10, Peter Maydell wrote: >When FEAT_GCIE and FEAT_EL2 are implemented, the GICv5 specification >requires that the old GICv3 ICC_SRE_EL1 and ICC_SRE_EL2 registers are >present, with RAO/WI bits, even if FEAT_GCIE_LEGACY is not >implemented or enabled. ICC_SRE_EL3 is not present, but the CPU >behaves as if its Enable and SRE bits are always set. (See R_SLVXV, >R_MCTMX, R_HQBBN.) > >Implement the ICC_SRE_EL1 and ICC_SRE_EL2 registers. For QEMU, this >"all bits RAO" is identical to how we implemented it for GICv3, >because we didn't implement the memory-map register interface, we >didn't support IRQ or FIQ bypass and we took advantage of the IMPDEF >option to make the ENABLE bit RAO so we didn't need to trap lower-EL >accesses to ICC_SRE_ELx. The RAO behaviours correspond to "do >nothing" -- don't trap system register accesses, no IRQ/FIQ bypass >handling -- so we don't need any special handling in any part of the >CPU implementation, just as we didn't for GICv3. > >Because ICC_SRE_EL1 is EL1-visible but only present when FEAT_EL2 >is implemented, we need to put it in a cpreg array that we only >register when ARM_FEATURE_EL2 is set, rather than being able to >list it in the main gicv5_cpuif_reginfo array and relying on the >access field as we do for other FEAT_EL2 GICv5 registers. > >Signed-off-by: Peter Maydell >--- Reviewed-by: Manos Pitsidianakis > target/arm/tcg/gicv5-cpuif.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/target/arm/tcg/gicv5-cpuif.c b/target/arm/tcg/gicv5-cpuif.c >index 76c7e9f86e8..89b50cf1165 100644 >--- a/target/arm/tcg/gicv5-cpuif.c >+++ b/target/arm/tcg/gicv5-cpuif.c >@@ -1017,6 +1017,11 @@ static const ARMCPRegInfo gicv5_cpuif_reginfo[] = { > .fieldoffset = offsetof(CPUARMState, cp15.fgt_read[FGTREG_ICH_HFGRTR]), > .resetvalue = ICH_HFGRTR_EL2_RES1_MASK, > }, >+ { .name = "ICC_SRE_EL2", .state = ARM_CP_STATE_AA64, >+ .opc0 = 3, .opc1 = 4, .crn = 12, .crm = 9, .opc2 = 5, >+ .access = PL2_RW, .type = ARM_CP_NO_RAW | ARM_CP_CONST, >+ .resetvalue = 0xf, >+ }, > { .name = "ICH_HFGWTR_EL2", .state = ARM_CP_STATE_AA64, > .opc0 = 3, .opc1 = 4, .crn = 12, .crm = 9, .opc2 = 6, > .access = PL2_RW, .type = ARM_CP_NO_RAW, >@@ -1116,6 +1121,14 @@ static const ARMCPRegInfo gicv5_cpuif_reginfo[] = { > }, > }; > >+static const ARMCPRegInfo gicv5_cpuif_el2_reginfo[] = { >+ { .name = "ICC_SRE_EL1", .state = ARM_CP_STATE_AA64, >+ .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 12, .opc2 = 5, >+ .access = PL1_RW, .type = ARM_CP_NO_RAW | ARM_CP_CONST, >+ .resetvalue = 0x7, >+ }, >+}; >+ > void define_gicv5_cpuif_regs(ARMCPU *cpu) > { > if (cpu_isar_feature(aa64_gcie, cpu)) { >@@ -1153,5 +1166,9 @@ void define_gicv5_cpuif_regs(ARMCPU *cpu) > }; > define_one_arm_cp_reg(cpu, &ppi_prio); > } >+ >+ if (arm_feature(&cpu->env, ARM_FEATURE_EL2)) { >+ define_arm_cp_regs(cpu, gicv5_cpuif_el2_reginfo); >+ } > } > } >-- >2.43.0 >