From nobody Sat Nov 15 12:48:51 2025 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=1752084469; cv=none; d=zohomail.com; s=zohoarc; b=AtBDNAic3aKHHLh8r0H56jjLQyfc59d3r6K17QTXy4YBuMZMEguCIoMHrif3ZsUccxCZaGXPfBnupPAWTDf8YY3aXlNgKZNblG+7uZ7GWdyEdhKz95peuWyj0W55ipuD0xZbn/05CV0ttGIDMi2BXZtCm13J4f9LPp1Lqkx7d5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752084469; h=Content-Transfer-Encoding:Cc:Cc: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; bh=hEjr7l7Vs6ji+drc/SRFgbkpYtZx+u1bmbu4VpSnODg=; b=aonfLbLgJQQY6B5BHzBY90SzdWvKQ5Z9COwSdY9mInfmnHKyFtbSzh7oOIdr8t9MjFfH/zibLzTd51TMU8zQLQCXsFtnpwnozfwSqPaFvbwZRB+Hao8D5WZtzvop7UGryubZJJ0w+S+Ic/tZdd30jfAZRDmYLTQvocx1Oi4/jJI= 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 1752084469663913.2650069599388; Wed, 9 Jul 2025 11:07:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uZZBg-0001MX-Jg; Wed, 09 Jul 2025 14:06:32 -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 1uZZBD-00018I-Cn for qemu-devel@nongnu.org; Wed, 09 Jul 2025 14:06:03 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uZZBB-0004AI-Ac for qemu-devel@nongnu.org; Wed, 09 Jul 2025 14:06:03 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2353a2bc210so1981745ad.2 for ; Wed, 09 Jul 2025 11:05:59 -0700 (PDT) Received: from gromero0.. ([189.110.24.38]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23c84599f07sm153380175ad.218.2025.07.09.11.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jul 2025 11:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1752084358; x=1752689158; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hEjr7l7Vs6ji+drc/SRFgbkpYtZx+u1bmbu4VpSnODg=; b=XMVYadiyAGursnXJyCIehcvIBZq4QbBEzY7KKpikeIFhmkxYLNI6ObVAyQ1qs2JKlr bxFfA5jmW/QwA3e6/zPIlRx3HEing5AJGRmbcjWb0cwBmXVVIbXXCnInn5Q5cemhbk4x BcI6MUlElpSAyb7KtFqdys3YNJKa49BjXe6Ur1o7q2uoNsW8PZfb73btGNuYaYgtfc4n RbKosPXP9XWJ5XRiwsnPLhRgXVNY2vc325497fsGsAhZxCIShkkClTkO2WkWtScp/OWs X4Kk9IBhAU/h/f34EGzYJG9k+Juj+lbx8xNGlxzaYC27DfDs/+o8rxaLH5uCgmj5RLgA H69Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752084358; x=1752689158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hEjr7l7Vs6ji+drc/SRFgbkpYtZx+u1bmbu4VpSnODg=; b=S+EU7jXwQYr/7VQSmWueqxnYBEbm4/SJoe4HN3lqwqV1SOVAz4u9bKoTEtusn5w34D D+olQaKRJ2kELTSzxrw2YcTtyFvwonyxmw1lAsdVGz6R57X3RRoNMO1i0aus+rU1oYq1 hwwEkCNNYxL1Z0eLmxtwIA7F1oiwGIew5K2uYd/0TkaPGCQUXgIAWLDC+HetBV4gYHfS r004m59Si1v5VJkpstQ96aRZ4nqK5r1kjdjRrk7VbhyjLN6e3E8E6t1gPEUJNmUoY3RT PhdNKUNcOLOjZBZYMmZGb9nvj7/wx5VrnGVbPyO0oqVwm2oKdhdKdPujehC9tVPeWQzH e3Xg== X-Gm-Message-State: AOJu0Yzi6k8JYwmvCbARpI1YUjS03JOhyo3ANhDsqfbq7SCj4QBYGRV4 UYc9HBjxbjm23mHymvy8jUD1wYzhav/mV4Dqm6YPQyDnmGN+zutyiXLZ7cFy/fu83SM= X-Gm-Gg: ASbGnctRhaK+HPZBq9uuAFjXQRhkWCOBnRR2XxZieaV5GyTewjjNZ1F2UHA31PAqX2X Nwq5CBaRqLxbMk4l3HMIowISMLJFxGb9NsZecfOePoQz1WsEnFKgLTlLorMrH+GEllqDq0zBpMM YUXO4gn0BxKUBXnQKzzvXk7gO0o/t2k9iIGuVcb2IIRcGbIWwAIHfjIZucss5E3Ylg53p6N8F8t 6DsbK6ETqBp2UnizCydTuULB/srgQ6HuyCbUvM+TFA/KGF1C8wfYL+oLTVzB5bLttunMB4Sogo6 YmBU7UJb/3/i+MTZviJQp67f1KKk1WP1+Tt/TTjb9igPPCMKqcnyXb0tloPp05GFiGp4HvUaYb+ gXQ== X-Google-Smtp-Source: AGHT+IG+RVMysxOUJfOgSpCWXAGxsJabgQPJ/CbTIhkqh9lc5crJYKgrDoBeJUjQjtass0GaTBdKbw== X-Received: by 2002:a17:902:ce07:b0:234:8f5d:e3a4 with SMTP id d9443c01a7336-23de2436d01mr14864655ad.2.1752084358111; Wed, 09 Jul 2025 11:05:58 -0700 (PDT) From: Gustavo Romero To: qemu-arm@nongnu.org, richard.henderson@linaro.org, alex.bennee@linaro.org Cc: qemu-devel@nongnu.org, gustavo.romero@linaro.org Subject: [PATCH v4 5/6] target/arm: Implement FEAT_MEC cache instructions Date: Wed, 9 Jul 2025 18:03:25 +0000 Message-Id: <20250709180326.1079826-6-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250709180326.1079826-1-gustavo.romero@linaro.org> References: <20250709180326.1079826-1-gustavo.romero@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=2607:f8b0:4864:20::636; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-x636.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: 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: 1752084471386116600 Content-Type: text/plain; charset="utf-8" This commit implements the two cache maintenance instructions introduced by FEAT_MEC, DC CIPAE and DC CIGDPAE. Because QEMU does not model the cache topology, all cache maintenance instructions are implemented as NOPs, hence these new instructions are implemented as NOPs too. Signed-off-by: Gustavo Romero --- target/arm/helper.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 34e12bde90..36cf2b6415 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4996,6 +4996,34 @@ static void ic_ivau_write(CPUARMState *env, const AR= MCPRegInfo *ri, } #endif =20 +static CPAccessResult cipae_access(CPUARMState *env, const ARMCPRegInfo *r= i, + bool isread) +{ + int el =3D arm_current_el(env); + + if (!cpu_isar_feature(aa64_mec, env_archcpu(env))) { + return CP_ACCESS_UNDEFINED; + } + if (el < 3 && arm_security_space(env) !=3D ARMSS_Realm) { + return CP_ACCESS_UNDEFINED; + } + return CP_ACCESS_OK; +} + +static CPAccessResult cigdpae_access(CPUARMState *env, const ARMCPRegInfo = *ri, + bool isread) +{ + CPAccessResult ret =3D cipae_access(env, ri, isread); + + if (ret !=3D CP_ACCESS_OK) { + return ret; + } + if (!cpu_isar_feature(aa64_mte, env_archcpu(env))) { + return CP_ACCESS_UNDEFINED; + } + return CP_ACCESS_OK; +} + static const ARMCPRegInfo v8_cp_reginfo[] =3D { /* * Minimal set of EL0-visible registers. This will need to be expanded @@ -5094,6 +5122,12 @@ static const ARMCPRegInfo v8_cp_reginfo[] =3D { .opc0 =3D 1, .opc1 =3D 0, .crn =3D 7, .crm =3D 14, .opc2 =3D 2, .fgt =3D FGT_DCCISW, .access =3D PL1_W, .accessfn =3D access_tsw, .type =3D ARM_CP_NOP }, + { .name =3D "DC_CIPAE", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 1, .opc1 =3D 4, .crn =3D 7, .crm =3D 14, .opc2 =3D 0, + .access =3D PL2_W, .accessfn =3D cipae_access, .type =3D ARM_CP_NOP = }, + { .name =3D "DC_CIGDPAE", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 1, .opc1 =3D 4, .crn =3D 7, .crm =3D 14, .opc2 =3D 7, + .access =3D PL2_W, .accessfn =3D cigdpae_access, .type =3D ARM_CP_NO= P }, #ifndef CONFIG_USER_ONLY /* 64 bit address translation operations */ { .name =3D "AT_S1E1R", .state =3D ARM_CP_STATE_AA64, --=20 2.34.1