From nobody Tue Feb 10 20:07:37 2026 Delivered-To: importer@patchew.org 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; 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=1583631088; cv=none; d=zohomail.com; s=zohoarc; b=T/dLkIUltlyRYeeRDUXve25C/bGqsTFCVj5eKgOPp2y4uLacLDnBzVuVkWgWFz3o2iPo/O3+LOmmCfceoDsrxvT/lVV1KBJNZVEd99U+Qd3+DQb66q7FEAYl/P++yxXgxcYvbHNUj7BL7l8JG5q8eSmdoyfDTP933LNqyKUr7BY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583631088; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gv99y10Tw9XL58AqjJTwfCMl/voN1k409rbwq+MWA5w=; b=kc7YKg+phZXIJqwt/e1IoLieezbIIhDYPhcj7CS+Cz0faUjm6zx9Ab3vd6XIcUZSQcm+rOKECMFpy3mgJSvoYeYQje2FG+j35IgIR9u8gkQGN3j8n8wQHa5ypg54cwmKtM7696vHoziIjy9+ksiZEh6bNqN5e7BVsqbSSnc+Aus= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583631088608288.8937037659066; Sat, 7 Mar 2020 17:31:28 -0800 (PST) Received: from localhost ([::1]:54138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAkmt-0008KI-NM for importer@patchew.org; Sat, 07 Mar 2020 20:31:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57998) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jAklQ-0006tE-R2 for qemu-devel@nongnu.org; Sat, 07 Mar 2020 20:29:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jAklP-0003wS-Pz for qemu-devel@nongnu.org; Sat, 07 Mar 2020 20:29:56 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:43945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jAklP-0003vY-L7 for qemu-devel@nongnu.org; Sat, 07 Mar 2020 20:29:55 -0500 Received: by mail-pg1-x541.google.com with SMTP id u12so3002323pgb.10 for ; Sat, 07 Mar 2020 17:29:55 -0800 (PST) Received: from cloudburst.hsd1.or.comcast.net ([2601:1c0:6100:5580:6886:21be:91dd:78be]) by smtp.gmail.com with ESMTPSA id w19sm32636891pgm.27.2020.03.07.17.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2020 17:29:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gv99y10Tw9XL58AqjJTwfCMl/voN1k409rbwq+MWA5w=; b=jTDo5djyrC5CDMffAiqEM6L8KRzo65+Pi1blQ5PfCBPHKLWOSyFOm6HQWQEqawqLAn bR7eqk3COWKbtWxCjWey+hV2NjqMibb+J+3WSwyXYiamlsBdurbWgQPHRRojTTRQqkOB r7SIIYHOP2fAFsQPPyKiW2fFyDPiW64ukmurkzAmlMMEOy/WdFV4OY+6aqBmAcSGRh1Y mB823cD9c/6edxSkiViMVdx/1BkxH5WcI/sfVrjbz/L19psV1eVnXTYikHzGiA9hELTg +p15rFEeCrC6W7kxq5e7F+Y01wLAlAwsFOGs4oWIACKPsFHgmjyhwdy45mIel6sLXJ7Y Hxgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gv99y10Tw9XL58AqjJTwfCMl/voN1k409rbwq+MWA5w=; b=P1mextZdi1S6VReXqMPGgD0VWLgCqCOQhhBei3NdWf7qThJ3MR0/RzZOr8YTheCjL7 DsHYGa1MSDsLyzDFl/eP/+09FPLvxCas5gpt9v1oIYbxOATo5wy1IaFHXsJstknQK155 pOunLs3Yw1pFVdo4icOLzYEtbg/5Ltq9TB+2h1Hkr1R3pRYyQr2cVtXs4fnHE4p7OhVV RPechlnCNva0B57v9ZElehidrbUxtQm3EIow6M8l5lXH9wySNpTV0rXISbnOIKzAKp3G dKJjidP7y4+4CAOy+kqVO5QaSr8z/3hT/I9TNSzOrMYo9j2hPI53GNO3QL3mi8YSJMWh k1jg== X-Gm-Message-State: ANhLgQ3E+Tb+kKzcvF6jbQlDBDliUVdLDZqEntKzkf59AUAk6rqFI7fs 5SAvG9AjzGQa/q+LJ3r1dIPl/kdjhvI= X-Google-Smtp-Source: ADFU+vsWCCdF6tufcI9iZw18JdbcoJImWsz1pmm8DwZDnTmH4FFAcj5YLN+UFyIZ41CuL+1SpQoMVw== X-Received: by 2002:a63:8f17:: with SMTP id n23mr10567818pgd.161.1583630994169; Sat, 07 Mar 2020 17:29:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/2] target/arm: Disable clean_data_tbi for system mode Date: Sat, 7 Mar 2020 17:29:46 -0800 Message-Id: <20200308012946.16303-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200308012946.16303-1-richard.henderson@linaro.org> References: <20200308012946.16303-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" We must include the tag in the FAR_ELx register when raising an addressing exception. Which means that we should not clear out the tag during translation. We cannot at present comply with this for user mode, so we retain the clean_data_tbi function for the moment, though it no longer does what it says on the tin for system mode. This function is to be replaced with MTE, so don't worry about the slight misnaming. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index fefe8af7f5..8fffb52203 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -228,7 +228,18 @@ static void gen_a64_set_pc(DisasContext *s, TCGv_i64 s= rc) static TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr) { TCGv_i64 clean =3D new_tmp_a64(s); + /* + * In order to get the correct value in the FAR_ELx register, + * we must present the memory subsystem with the "dirty" address + * including the TBI. In system mode we can make this work via + * the TLB, dropping the TBI during translation. But for user-only + * mode we don't have that option, and must remove the top byte now. + */ +#ifdef CONFIG_USER_ONLY gen_top_byte_ignore(s, clean, addr, s->tbid); +#else + tcg_gen_mov_i64(clean, addr); +#endif return clean; } =20 --=20 2.20.1