From nobody Sat Sep 21 06:37:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1704971362; cv=none; d=zohomail.com; s=zohoarc; b=O7fWBw79CVB/bZCNfDoTN+kirU44KU51/mSZS8goEKusml0qYQwGs+GXLeucTIOnX6H+KsItFxD65AVIMtn2OQ0zuf+Lbu6vlGdgeM/bcVFz4Bv5BL/H2yCXECakzORTUzN4JZ8bLDMkfLru3QH71I3PEQr64lXoJucEMvpfZwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704971362; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=fWlADWMhxcWSj2fBgtd1Encmql0Bt3u3mAlUopxgc3A=; b=ZsymKIubJOsiX6NE1aT41eD4KjnNjamBAecH+0b920qjcSzk1I3+viWCgJnAcF5PaJgZOcCtp3XjR+PJ2v1ggGhzX4xiTaGNc7pcZZrbG28JlfI8CGjrLwHJge5RZEeTqMPTcT46FRQXngWO4OMjzpGS/MXb1sO2m6xBcaqhXyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1704971362199694.0830116402856; Thu, 11 Jan 2024 03:09:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNssk-0001h3-30; Thu, 11 Jan 2024 06:05:54 -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 1rNssL-0001PK-1S for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:31 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNssF-0004We-Kj for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:27 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-336746c7b6dso4417176f8f.0 for ; Thu, 11 Jan 2024 03:05:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v30-20020adf8b5e000000b0033690139ea5sm951323wra.44.2024.01.11.03.05.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:05:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704971122; x=1705575922; 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=fWlADWMhxcWSj2fBgtd1Encmql0Bt3u3mAlUopxgc3A=; b=Y/uDy4jSr9p1NXgu8wUCZVu2lXxMWjnFMpR3t8iZdkQSh5e5fqREpWxUQRWyueaSvA cX0DFZ0TYF9eRDl1F6axRldM8MxiFkZ3rE7EyCTMuCkHMiDBp8vRjPIsIUNjlOYVe/a9 mdQHyzo7vOKj3oopt4r05MoVFbT6tLr4z0QCP4gifJr0bRHORmwf9d+z5XQIC4n3dhMR I+0WMM/eUTFwRgmfRvtD8UNc/YsBSfBmHiseL0hVDKzj1RXzdsacqcrg0jDQEsINv7lI 5JsR/qo69fBgR3Nn5d/GFXYsFw0PPTUJBMIP+tdOz0P4arE90EUVjSpRHgQhZFgNv8K5 hyMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971122; x=1705575922; 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=fWlADWMhxcWSj2fBgtd1Encmql0Bt3u3mAlUopxgc3A=; b=e9wVFyv/2dn+YmI4mRM213dgeBbeNkzjkg59qh4ECvEWHuvluyTpCG6IfEXtlI13+t d9hGtmus57SEGhJdzaVjuO5zRUOpU6APB+yTT6s7nSk3dJvAVTipAwWwej0N5ZxpBTHR WzbSe//oT+Xmx8YdWE0zWUJBm5l+ZIU1T775arDtSybYRVcHQ7GEVkmFqv/eWx7vsjAn OlTqJBZgxGlbrKIB1EgGbdKfQOwoYxifSggvw8c8hHlHDHAbtgQsPjDgzYTNdsOZ9rXF yFSbLgf96mjcubG8iUUFbdl2ci3lV9ruj/nv1JOBT1BzYkIsaKAJuQdy32j6MhXzQb69 gSSQ== X-Gm-Message-State: AOJu0YyxyDNuOSeq3uq1m3RI2w77rQFyyx8fEJFxrxR7mc7Z6GcoUftm K04zUaYori3XIk7XT9RqTVcR5r4A0v4Ntl5X7EpDhB3S3Cg= X-Google-Smtp-Source: AGHT+IG268QGShFuZwW49gssS0NTDNqlYZO0RnnyBI+nNXIAHm07iIVi8DtDZtV/7z+Xczafwdt0jQ== X-Received: by 2002:adf:ee41:0:b0:336:6dd3:bfcf with SMTP id w1-20020adfee41000000b003366dd3bfcfmr520267wro.121.1704971122007; Thu, 11 Jan 2024 03:05:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/41] target/arm: Mark up VNCR offsets (offsets 0x0..0xff) Date: Thu, 11 Jan 2024 11:04:58 +0000 Message-Id: <20240111110505.1563291-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240111110505.1563291-1-peter.maydell@linaro.org> References: <20240111110505.1563291-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1704971363072100007 Content-Type: text/plain; charset="utf-8" Mark up the cpreginfo structs to indicate offsets for system registers from VNCR_EL2, as defined in table D8-66 in rule R_CSRPQ in the Arm ARM. This commit covers offsets below 0x100; all of these registers are redirected to memory regardless of the value of HCR_EL2.NV1. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Tested-by: Miguel Luis --- target/arm/helper.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 93991c07b78..bc5a0810421 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6059,6 +6059,7 @@ static const ARMCPRegInfo hcrx_el2_reginfo =3D { .name =3D "HCRX_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 2, .opc2 =3D 2, .access =3D PL2_RW, .writefn =3D hcrx_write, .accessfn =3D access_hxen, + .nv2_redirect_offset =3D 0xa0, .fieldoffset =3D offsetof(CPUARMState, cp15.hcrx_el2), }; =20 @@ -6125,6 +6126,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { .type =3D ARM_CP_IO, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 =3D 0, .access =3D PL2_RW, .fieldoffset =3D offsetof(CPUARMState, cp15.hcr_= el2), + .nv2_redirect_offset =3D 0x78, .writefn =3D hcr_write, .raw_writefn =3D raw_write }, { .name =3D "HCR", .state =3D ARM_CP_STATE_AA32, .type =3D ARM_CP_ALIAS | ARM_CP_IO, @@ -6209,6 +6211,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { { .name =3D "VTCR_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 1, .opc2 =3D 2, .access =3D PL2_RW, + .nv2_redirect_offset =3D 0x40, /* no .writefn needed as this can't cause an ASID change */ .fieldoffset =3D offsetof(CPUARMState, cp15.vtcr_el2) }, { .name =3D "VTTBR", .state =3D ARM_CP_STATE_AA32, @@ -6220,6 +6223,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { { .name =3D "VTTBR_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 1, .opc2 =3D 0, .access =3D PL2_RW, .writefn =3D vttbr_write, .raw_writefn =3D raw_w= rite, + .nv2_redirect_offset =3D 0x20, .fieldoffset =3D offsetof(CPUARMState, cp15.vttbr_el2) }, { .name =3D "SCTLR_EL2", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 0, .opc2 =3D 0, @@ -6228,6 +6232,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { { .name =3D "TPIDR_EL2", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 13, .crm =3D 0, .opc2 =3D 2, .access =3D PL2_RW, .resetvalue =3D 0, + .nv2_redirect_offset =3D 0x90, .fieldoffset =3D offsetof(CPUARMState, cp15.tpidr_el[2]) }, { .name =3D "TTBR0_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 0, .opc2 =3D 0, @@ -6323,6 +6328,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 0, .opc2 =3D 3, .access =3D PL2_RW, .type =3D ARM_CP_IO, .resetvalue =3D 0, .writefn =3D gt_cntvoff_write, + .nv2_redirect_offset =3D 0x60, .fieldoffset =3D offsetof(CPUARMState, cp15.cntvoff_el2) }, { .name =3D "CNTVOFF", .cp =3D 15, .opc1 =3D 4, .crm =3D 14, .access =3D PL2_RW, .type =3D ARM_CP_64BIT | ARM_CP_ALIAS | ARM_CP_I= O, @@ -6361,6 +6367,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] =3D { { .name =3D "HSTR_EL2", .state =3D ARM_CP_STATE_BOTH, .cp =3D 15, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 1, .crm =3D 1, .opc2 = =3D 3, .access =3D PL2_RW, + .nv2_redirect_offset =3D 0x80, .fieldoffset =3D offsetof(CPUARMState, cp15.hstr_el2) }, }; =20 @@ -6386,10 +6393,12 @@ static const ARMCPRegInfo el2_sec_cp_reginfo[] =3D { { .name =3D "VSTTBR_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 6, .opc2 =3D 0, .access =3D PL2_RW, .accessfn =3D sel2_access, + .nv2_redirect_offset =3D 0x30, .fieldoffset =3D offsetof(CPUARMState, cp15.vsttbr_el2) }, { .name =3D "VSTCR_EL2", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 6, .opc2 =3D 2, .access =3D PL2_RW, .accessfn =3D sel2_access, + .nv2_redirect_offset =3D 0x48, .fieldoffset =3D offsetof(CPUARMState, cp15.vstcr_el2) }, }; =20 @@ -8155,6 +8164,7 @@ static const ARMCPRegInfo nv2_reginfo[] =3D { .opc0 =3D 3, .opc1 =3D 4, .crn =3D 2, .crm =3D 2, .opc2 =3D 0, .access =3D PL2_RW, .writefn =3D vncr_write, + .nv2_redirect_offset =3D 0xb0, .fieldoffset =3D offsetof(CPUARMState, cp15.vncr_el2) }, }; =20 @@ -8986,6 +8996,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 =3D 3, .opc1 =3D 4, .crn =3D 0, .crm =3D 0, .opc2 =3D = 0, .access =3D PL2_RW, .resetvalue =3D cpu->midr, .type =3D ARM_CP_EL3_NO_EL2_C_NZ, + .nv2_redirect_offset =3D 0x88, .fieldoffset =3D offsetof(CPUARMState, cp15.vpidr_el2) }, { .name =3D "VMPIDR", .state =3D ARM_CP_STATE_AA32, .cp =3D 15, .opc1 =3D 4, .crn =3D 0, .crm =3D 0, .opc2 =3D 5, @@ -8997,6 +9008,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 =3D 3, .opc1 =3D 4, .crn =3D 0, .crm =3D 0, .opc2 =3D = 5, .access =3D PL2_RW, .resetvalue =3D vmpidr_def, .type =3D ARM_CP_EL3_NO_EL2_C_NZ, + .nv2_redirect_offset =3D 0x50, .fieldoffset =3D offsetof(CPUARMState, cp15.vmpidr_el2) }, }; /* --=20 2.34.1