From patchwork Thu Jan 11 11:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 761829 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp2338136wrz; Thu, 11 Jan 2024 03:12:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFjOjE3QXTSiVLQVpd/dabuejoRt4vSCEXAnIZ4Hof8gve3gd+IxIqckUxMrQQ89XJ3qyw X-Received: by 2002:a05:6808:1314:b0:3bd:3c87:574b with SMTP id y20-20020a056808131400b003bd3c87574bmr1501010oiv.76.1704971531244; Thu, 11 Jan 2024 03:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704971531; cv=none; d=google.com; s=arc-20160816; b=rYsmDu79HwiSkEXXGD+wNuukKAYC4O9QoH3c0ltaa7Ypmp5EpurkBwQmsy3HFYXRsD b6x55X3BJT5tmYYtVQujbDFKp8dLR+3q6p7NQjiQGr4Dcb9L4vL+98+t+AJWJmSj+MYZ 87EJ7tcOcbFiwZJUCXsbbbk6c4S433ejAoWAddSBjZ5iz71NBm1I0r8qvba3d4+zlDr7 O6B64mi1YEUKmEGG7uPN94pBbtus3T0wWaVCYz/ItuQoPPg9c0nDiQQ5HfGhrjaDaUWe Df7XYbiHVnrRHhkQ10q0Xf12CutZkC03gP5VVt0yYgYo8S6d7NLEymUM8uVPcEHhA7JZ uilw== 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:to:from :dkim-signature; bh=yscuAN2+W6F+E5GdpmQyLDg77dRJm7PXwcNzo7tUEdc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=df9XL0sEJTLUDstWR4tf8YqJG9BRhFDz3m4im3eDRh7a3MN3e2D88h3GATKcNzN1Oy aNvo7X7m+pK+RSy0vZrVr963RyyiLtgOUFsRto8I9kt5vb774Q5CS28rltF/qcwtefLL Q4JPFfaqvnilbcnP9df7Ufnr14WRrcWhY8uSNMJn1Mj01TZMbnqcPOsLt6jBqdP0dNiQ U9ZvcPPndiXHjm5Y7ngOgb1aRAwrxNcmtyfUm2zZkcVtYxZQdhWipUjbHq71pSfE1ydO vuE9SgpcDlaePwb9/blPwhV7DybK+dJ+tQDu4n0/VqwAeEhAsU2Kp7gcC4siyiYb8Rcp uYoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PGa+d2EN; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y16-20020a0cf150000000b0067f870851ffsi582695qvl.25.2024.01.11.03.12.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2024 03:12:11 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=PGa+d2EN; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNssj-0001fx-3I; Thu, 11 Jan 2024 06:05:53 -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 1rNss6-0001Ku-V1 for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:15 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNss4-0004P0-IE for qemu-devel@nongnu.org; Thu, 11 Jan 2024 06:05:14 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3376555b756so3010278f8f.0 for ; Thu, 11 Jan 2024 03:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704971110; x=1705575910; 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=yscuAN2+W6F+E5GdpmQyLDg77dRJm7PXwcNzo7tUEdc=; b=PGa+d2ENAu+hfpA/yLS4+K6lpMvx491mlQ0r22T64WeQdY8apOzbrGKDg3nImZpWru h24mbNXspVkRflkTLRala0NUGV0N49CDhT/KBUw67tbxolu2iQVRjwU2IHkhOgfawUgy iFDH0CPAqY732B5Azvom9/0+DECcvHBI82aSZYbpx8IUkc8Xv2y6HlAg4ysO8Mz24+M2 wnERQAZVo3nf5qNKKfY2tpa0j9oMNmBSqBwzapjou/G0Ik2xv44XmfW/Xbdm3aCcLlBz BbglE7/Qmln5KnnHkbs3jn4E5V171R9AVYvZCIWXpNdzgLl3bXT4M4PRNlBR9JAr3iXb ruRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971110; x=1705575910; 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=yscuAN2+W6F+E5GdpmQyLDg77dRJm7PXwcNzo7tUEdc=; b=JSm7lbed8mnwABULrgcbLI2VsEwonrnQqhTi8gLzgQhzqfEjcI31iYYuP03PzYOQqj dDq15UP0KCQhKbHtwBvMiDUUixXI4kN4PkZ705Uvjic4Uk1MPgV+RKzwhXpxDAjXOjIO Dz2Fl8GiSFB4uqd+3U3hCiDjfoT/+sI5VO2KK93D2bGK/gZ8UgcjkwP+vfnMMvQvoWwb EDWX4Rr+nmHSN6tE5ibApMfYjbA9peuUOSGf1XZXr3MAoNtW9LTmu/jEZ1Rsdrz7E2bH LNvxKCRoKpIYGOMynqP6tQNl3N7qpnBjk4u1p+hgVXnyjSsILiV5LEJCxveItnAKWPUy dKhg== X-Gm-Message-State: AOJu0YwMGigxt94wHBPkCXLVz26yT5fqmnDWcixl1ew6kJfrMb76atDU ThXzntlsTIhB2acba1W4TB/z9cBVstAb8pF97ccLKvxF5mU= X-Received: by 2002:adf:a183:0:b0:336:7608:d0f4 with SMTP id u3-20020adfa183000000b003367608d0f4mr421626wru.17.1704971110593; Thu, 11 Jan 2024 03:05:10 -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.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:05:10 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/41] target/arm: Set CTR_EL0.{IDC,DIC} for the 'max' CPU Date: Thu, 11 Jan 2024 11:04:32 +0000 Message-Id: <20240111110505.1563291-9-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 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The CTR_EL0 register has some bits which allow the implementation to tell the guest that it does not need to do cache maintenance for data-to-instruction coherence and instruction-to-data coherence. QEMU doesn't emulate caches and so our cache maintenance insns are all NOPs. We already have some models of specific CPUs where we set these bits (e.g. the Neoverse V1), but the 'max' CPU still uses the settings it inherits from Cortex-A57. Set the bits for 'max' as well, so the guest doesn't need to do unnecessary work. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Tested-by: Miguel Luis --- target/arm/tcg/cpu64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index fcda99e1583..40e7a45166f 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1105,6 +1105,16 @@ void aarch64_max_tcg_initfn(Object *obj) u = FIELD_DP32(u, CLIDR_EL1, LOUU, 0); cpu->clidr = u; + /* + * Set CTR_EL0.DIC and IDC to tell the guest it doesnt' need to + * do any cache maintenance for data-to-instruction or + * instruction-to-guest coherence. (Our cache ops are nops.) + */ + t = cpu->ctr; + t = FIELD_DP64(t, CTR_EL0, IDC, 1); + t = FIELD_DP64(t, CTR_EL0, DIC, 1); + cpu->ctr = t; + t = cpu->isar.id_aa64isar0; t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* FEAT_PMULL */ t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); /* FEAT_SHA1 */