From patchwork Wed Apr 12 11:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 672633 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:184:0:0:0:0 with SMTP id p4csp290647wrx; Wed, 12 Apr 2023 04:53:14 -0700 (PDT) X-Google-Smtp-Source: AKy350at8SGJmvFKcz4jcs3XIHC7YtSxAdmvr4g7mElqEP4g6f61/YfcU3ZRBOkU8DDD2ca1uasO X-Received: by 2002:a05:622a:1181:b0:3e8:b1da:7f14 with SMTP id m1-20020a05622a118100b003e8b1da7f14mr1452474qtk.19.1681300394304; Wed, 12 Apr 2023 04:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681300394; cv=none; d=google.com; s=arc-20160816; b=EoWqdIQu3tyWWruGSxleRUhrAZrfFMkt/IcybTDbyZ2DW2nm4EIFKGiBSWcAg7/pkq A6kf+3F4ria7EnZu7BJhCWKyJdzk3T5AbBrgIrBgzzqHtQ0QqHIEDBMxRjJ9IubiNeRi W1QQ8I77GmTs2eCzLPmwOX3HrliXe7ggwJDC4/vk1NUB7IppbcYaa6f3i4+m6zhRWwdf HXQBktK1Pce83iSX1ulfogRC+sakepHPlc4q45rIam8ST5CYdNuqI6/wqyJqBqyaxB1U r6XDXAvJ507V52wt6e6wW7b5yxmzo8iuGurFbWLMNPFL5hH3CfmXtcOmwNsUztJlT5xE F3oA== 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:cc:to :from:dkim-signature; bh=YAXm4ASIFttpyWJKyvCjhM0MOstGOXoJQiE+ToyL5+M=; b=p6DNs5OEfGW0NWDssZCdYBp092cKdoqtskHiXfDmHz84qSUn+u9sDObrUs+0raKDSb 7L441qpu/hFQmbIkrprjAR2F1Xfg+O5K/X0p6HJvDz2OZV7Nt2FdPpkMM/UDorZ9sS47 WfNNeap5/5KxTeDpyZrBIlCLHqfQXNA9FU3GaJZMCfrs0qwlldMXD+9i7YQNmdb+1Mp5 A8XKEGFnRIxQiEdjS3TSfSVvMEZEJXreDnVaA76Q3I7hXV7wrY1uwXeUPEyTdKGmgdUx 00ucPbrar3OgmuGLVS3F114RCD6gW7czwM1E6Codiu1hq/73uvtUgKkHm+on03Jnh/D/ 4tuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JQEcA83I; 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 k16-20020a05622a03d000b003e6368b4ba6si10396090qtx.102.2023.04.12.04.53.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Apr 2023 04:53:14 -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=JQEcA83I; 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 1pmYtl-0006bV-0Q; Wed, 12 Apr 2023 07:44:25 -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 1pmYtJ-0004xb-9U for qemu-devel@nongnu.org; Wed, 12 Apr 2023 07:43:57 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmYtH-0002Nb-0g for qemu-devel@nongnu.org; Wed, 12 Apr 2023 07:43:57 -0400 Received: by mail-wr1-x432.google.com with SMTP id i3so1257587wrc.4 for ; Wed, 12 Apr 2023 04:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681299834; x=1683891834; 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=YAXm4ASIFttpyWJKyvCjhM0MOstGOXoJQiE+ToyL5+M=; b=JQEcA83IUV8RsbqU9Jt1Ab2eJb90z0Dew09aJl+CBYZxLWseO/BOfWLdsJRDAZIifJ Y2gqzORdm82xcIfN3QvNmWNnfhUNVnSqVq5FCDqDxZr4dm5sntl4uH7QlI4Cypo7OuIl ftNBdg4dm1/FRBRkETXEWeAf6X2gKfr0mMaoHBtPahd9zu34B34uuikcBDMwZHZ/z4Ad eyfbFcLurDAdOJba8aKW9XEoSPcUzoLy2I2x4Xwcz3kTZnxDPvt+U/Gb1AjyCzQHONEh QejIVWnUoF1/w14eUNAvcS/wv6nNtiM1VUq+bSyocHDPUDg8nsQuC7fB9RSCxkOcS7sE EHGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681299834; x=1683891834; 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=YAXm4ASIFttpyWJKyvCjhM0MOstGOXoJQiE+ToyL5+M=; b=Cte3Jhwq+k11P+ZFDVzD/6PDkVIm5j0qtG+P5aa9iQqmCFhs7P90bfsBt96bwaSBjC XuMvzbo7agdIQjjUO5Gpx9CRxQnEzm+HbWn/bvC8EDtCNawwotFp0R4uhfBnuGImAB1u 3CLRKXuXOi5Jk18Vg2GgXAvB7rE4/kctpeZIsBTtL0aKjeBdnHYmFGnFMJ5TSidMJtaO z+1P7xOt2P0XrDdPQxvOWKYwSfAIP1GyFgsdxt/0dH+x/5OJDMLoPF2uStqGSgAESRDv O7p7n7fET2KQvYLwXhTy6W3staRr/d43nV2a//o/EeuG/iQD0ug7KTwHZNLYTIQWbnWm m6Mg== X-Gm-Message-State: AAQBX9d0dTmrTPFzNJ1twBrUBzTvP6B2krkgdlmaa9NPugIkD9j2R+PD eJGOKUfsFulONEWZ8G2RVSOtzacd9pDhvim5G8TPlxaK X-Received: by 2002:a5d:6dd0:0:b0:2cf:9889:8428 with SMTP id d16-20020a5d6dd0000000b002cf98898428mr4319572wrz.35.1681299834123; Wed, 12 Apr 2023 04:43:54 -0700 (PDT) Received: from stoup.hotel.gast (ip-037-024-010-236.um08.pools.vodafone-ip.de. [37.24.10.236]) by smtp.gmail.com with ESMTPSA id k9-20020a5d4289000000b002d21379bcabsm16980826wrq.110.2023.04.12.04.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Apr 2023 04:43:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, qemu-riscv@nongnu.org, Alistair Francis , Weiwei Li , Daniel Henrique Barboza Subject: [PATCH v7 21/25] target/riscv: Suppress pte update with is_debug Date: Wed, 12 Apr 2023 13:43:29 +0200 Message-Id: <20230412114333.118895-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412114333.118895-1-richard.henderson@linaro.org> References: <20230412114333.118895-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x432.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 The debugger should not modify PTE_A or PTE_D. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Weiwei Li Tested-by: Daniel Henrique Barboza Message-Id: <20230325105429.1142530-22-richard.henderson@linaro.org> --- target/riscv/cpu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index c2d083f029..6dc3fdf594 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1001,7 +1001,7 @@ restart: (access_type == MMU_DATA_STORE ? PTE_D : 0); /* Page table updates need to be atomic with MTTCG enabled */ - if (updated_pte != pte) { + if (updated_pte != pte && !is_debug) { if (!hade) { return TRANSLATE_FAIL; }