From patchwork Thu Apr 18 15:20:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 789782 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp622875wrm; Thu, 18 Apr 2024 08:21:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXvcWJXRhUJ7vjfZrU5fjSecVjax5+GrXFbJeasxN87b/OSmXN1HU+WM6WFu6o/NmKXc9qYqWSFCZVOkRBzHYrK X-Google-Smtp-Source: AGHT+IHMjBU5K/HlCbCEG9ghMZNSdF7dpqnJ6JQp2FqOkdUKJKeTLqK7XwPd6Scs5Nsv+bgs7roL X-Received: by 2002:a05:6214:4a44:b0:69b:551b:ef88 with SMTP id ph4-20020a0562144a4400b0069b551bef88mr2836739qvb.50.1713453694889; Thu, 18 Apr 2024 08:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713453694; cv=none; d=google.com; s=arc-20160816; b=y3X0kWLBOfpOZniixCe8vowCTdnNJbV909SB8DKQyo3VvsGex1hKv1n1KBCx8tD9Cp XUwQhQefO3ZE5jqXC2HZBJTAYZIggUCWtlA6LtHtQn0D4Z3gyRdCOikjFblgQv75s6Ib euRoF+KV0eb1FHcW4Q0CXYG54DZeHrPvUWYQbO3Zx2owOd595JZgn6XeR31zAUfR7w2g A4xPU4t+wGQ37Ew9ijqRfcHGoCReaFZ0Und6xRKyYvayC8aLGwAuujzZ2hbd6uKBP9b6 PIkYEb4pDYyWMpZ1TRVKKcY6cSxU6WtnIepeSH9Vp5Wb4vnXWZSOvQfgTBRdNwC1vj4h iU8Q== 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=n5QqC5TWO216H4QGIIquQv5JWDc3hZs2/K7GnFUQidw=; fh=37Q4AChYHp1OoMckvXDybHAkumcg9/JX+jDrrWJ03x8=; b=bGeC0TQgFcuEhDkj3wj7Osl1H/Kr+GhnLkG1Sss7dajPtOBMJ2+13OyHDEXQjAMplD bjzsmPbGHGqC+2oJcbvqmq839utEfbukLLi1QPA1wWFI1wYDjAa01QFa7jL1+6gIRkUX Bp8iJdnUNLfr0xUxha2I9Pvu3ISI8RQ669PcIJvyMM2NiNuXt/AZSaM2C3H3cvK4o4Dn l7n67fQBo6U6IAL91NXggGvlbbv0FTu6BuAoswL8ondInY5EblBeWllp/VoFiq+fKYXT 0+9o5k+V99m3WjydvQUxNIzErSwdYWuCFNGeqmmlwDR2sJCkr7SmuFZiavq0dvudx6a7 buWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tJbHDLDz; 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 r5-20020a056214212500b0069b59bffb14si1719193qvc.270.2024.04.18.08.21.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Apr 2024 08:21:34 -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; dkim=pass header.i=@linaro.org header.s=google header.b=tJbHDLDz; 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 1rxTYo-0003HQ-M2; Thu, 18 Apr 2024 11:20:28 -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 1rxTYk-0003Fq-UO for qemu-devel@nongnu.org; Thu, 18 Apr 2024 11:20:23 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxTYg-0004WG-79 for qemu-devel@nongnu.org; Thu, 18 Apr 2024 11:20:21 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-418c0d83d18so7472605e9.0 for ; Thu, 18 Apr 2024 08:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713453607; x=1714058407; 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=n5QqC5TWO216H4QGIIquQv5JWDc3hZs2/K7GnFUQidw=; b=tJbHDLDzekKvLlrsVrfslFFmTYSs9///PV69aSjxXU93sJcqKOF0p7NU+UMydnMJgN NpoCbUDIDKhee9eJ/8LX7Ym4hZ5JjhvfZOLb7a/k+jfLZZTbQdKRHZMTht7amcbsgyzJ IHmYeZ6FeUajjWKZBZAmu3uc9xpoa48SP/a3CLo56z0OEAXsYQfX+TQJvFJkM8gHVVTt JoIGNs6bWagbCROrPg4j0TKTGfJ2agIAsMLfnMC/2q6Kb4I4/t0UspfLxOBbjCCeaguQ swOEUT+xq+tvaaEd+rMhKeRM+r6c8g3ewqYqlpgC6obaDUBWpWRObsdPVbqO6KGoUHRr oRYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713453607; x=1714058407; 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=n5QqC5TWO216H4QGIIquQv5JWDc3hZs2/K7GnFUQidw=; b=JIAzEIJck9f9s+9+QmfY98tL3eKofFzyvmqesVx0DeQKf/os4c7QqZmrZg0mZ4Ip+Y iALrQrSPSiBObJnNacoOvTKrNHWzpN+MjrlpjpLl7EfukbuGeUPXSaLNi6vguy8Lv/5i m9sb87Af18mwXvE9IK7EIbulgRbyUXWGdkjWHzjKElyscbJsAM58Hvs7B0vrxEPs2hWv i2ghi67xaW9xO4eEV3KdKoNl+YYlbiRVk84ph8M5MTWu+LCYWHnisgUiHOMFW7SQA5jO OWQ0ZmI8JrAQu08H7aAhYQsVk70IIExXE433/O1FDCViHPQmoeFitVTQp671EF7yImYR VT3Q== X-Forwarded-Encrypted: i=1; AJvYcCWt+j/PrneFPhdtRcBHv+g0WV9GnXqkGg1jyk7FmjIvipR6JNZF2besd4wll2ziGdiSAFVTvlxvUQQuKk+fiaS+rHwmF9M= X-Gm-Message-State: AOJu0Yw/9Uj8Xsyj1rCK2QZObgv7LVh7GviMldAOxOM1x4MgiUGdn2SX N1XplCcqXi1RJ0XxP4pKXQR/w+wjXBZKboks7JpEUosRtHdelawRI1tKL4Y2U58= X-Received: by 2002:a05:600c:1906:b0:417:c5cc:77a7 with SMTP id j6-20020a05600c190600b00417c5cc77a7mr2216901wmq.13.1713453607195; Thu, 18 Apr 2024 08:20:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id w17-20020a05600c475100b004162d06768bsm6886839wmo.21.2024.04.18.08.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 08:20:06 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/5] target/arm: Enable FEAT_ETS2 for -cpu max Date: Thu, 18 Apr 2024 16:20:02 +0100 Message-Id: <20240418152004.2106516-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418152004.2106516-1-peter.maydell@linaro.org> References: <20240418152004.2106516-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org FEAT_ETS2 is a tighter set of guarantees about memory ordering involving translation table walks than the old FEAT_ETS; FEAT_ETS has been retired from the Arm ARM and the old ID_AA64MMFR1.ETS == 1 now gives no greater guarantees than ETS == 0. FEAT_ETS2 requires: * the virtual address of a load or store that appears in program order after a DSB cannot be translated until after the DSB completes (section B2.10.9) * TLB maintenance operations that only affect translations without execute permission are guaranteed complete after a DSB (R_BLDZX) * if a memory access RW2 is ordered-before memory access RW2, then RW1 is also ordered-before any translation table walk generated by RW2 that generates a Translation, Address size or Access flag fault (R_NNFPF, I_CLGHP) As with FEAT_ETS, QEMU is already compliant, because we do not reorder translation table walk memory accesses relative to other memory accesses, and we always guarantee to have finished TLB maintenance as soon as the TLB op is done. Update the documentation to list FEAT_ETS2 instead of the no-longer-existent FEAT_ETS, and update the 'max' CPU ID registers. Signed-off-by: Peter Maydell --- docs/system/arm/emulation.rst | 2 +- target/arm/tcg/cpu32.c | 2 +- target/arm/tcg/cpu64.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 958c69f3799..de39110692b 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -49,7 +49,7 @@ the following architecture extensions: - FEAT_EL2 (Support for execution at EL2) - FEAT_EL3 (Support for execution at EL3) - FEAT_EPAC (Enhanced pointer authentication) -- FEAT_ETS (Enhanced Translation Synchronization) +- FEAT_ETS2 (Enhanced Translation Synchronization) - FEAT_EVT (Enhanced Virtualization Traps) - FEAT_F32MM (Single-precision Matrix Multiplication) - FEAT_F64MM (Double-precision Matrix Multiplication) diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c index de8f2be9416..b5a60682fa6 100644 --- a/target/arm/tcg/cpu32.c +++ b/target/arm/tcg/cpu32.c @@ -67,7 +67,7 @@ void aa32_max_features(ARMCPU *cpu) cpu->isar.id_mmfr4 = t; t = cpu->isar.id_mmfr5; - t = FIELD_DP32(t, ID_MMFR5, ETS, 1); /* FEAT_ETS */ + t = FIELD_DP32(t, ID_MMFR5, ETS, 2); /* FEAT_ETS2 */ cpu->isar.id_mmfr5 = t; t = cpu->isar.id_pfr0; diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index 4445c5a212b..da15182595b 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1195,7 +1195,7 @@ void aarch64_max_tcg_initfn(Object *obj) t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1); /* FEAT_LOR */ t = FIELD_DP64(t, ID_AA64MMFR1, PAN, 3); /* FEAT_PAN3 */ t = FIELD_DP64(t, ID_AA64MMFR1, XNX, 1); /* FEAT_XNX */ - t = FIELD_DP64(t, ID_AA64MMFR1, ETS, 1); /* FEAT_ETS */ + t = FIELD_DP64(t, ID_AA64MMFR1, ETS, 2); /* FEAT_ETS2 */ t = FIELD_DP64(t, ID_AA64MMFR1, HCX, 1); /* FEAT_HCX */ t = FIELD_DP64(t, ID_AA64MMFR1, TIDCP1, 1); /* FEAT_TIDCP1 */ cpu->isar.id_aa64mmfr1 = t;