From patchwork Mon Mar 2 17:58:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184099 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2683854ile; Mon, 2 Mar 2020 10:02:14 -0800 (PST) X-Google-Smtp-Source: ADFU+vsck54x7rdAMrk3Xnq+aLB73Icc7noEDDTgfp0XkDGVYvRc3FbOZ9geKtxX9IQZ3oNFUAXU X-Received: by 2002:ac8:6bc9:: with SMTP id b9mr890933qtt.108.1583172133967; Mon, 02 Mar 2020 10:02:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583172133; cv=none; d=google.com; s=arc-20160816; b=pIxidZjYwg3qp9wcFocy5DGImMj3fR5SG4V5BU2JlG443oe8VmccZEkwLcdasZRAfY VN1RPtKpUw0jC/mzBdt2l4nrheFskLulhXKH8kQ/qAedqeLLDUPNofg/cFQIfJ/hoyUI 2/pSNgrT3KIJAcCjEU/4XVKHC1k49LUG+7ulle3Em5r1YE0eznDegLvTgZt4QRcXYHTi T6cmcCCRrWAgsGw5p4P3qGWTDyl0BqbxaG73/sly0aTJDl2D5ZEkaiKKOhpjAVhHRwkL uuow4TwWiFo3KDqQrWvj6NCTOk1oDa1LIU8dGXHdeu4VLhsBmWQKOCOFYkBZZy+WkFdG zrHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=gv99y10Tw9XL58AqjJTwfCMl/voN1k409rbwq+MWA5w=; b=RP0Jai9B25aqT/a/xC08F9UzZp7XPpIxmxLRAD5vfUQoYYkltstKBpZFkJA2cfAOVQ 1+OWklU+s1b7RmpF4vDYKuqGyK7ewb7nsFrNrlFm+qqRCIYELeFA4J5GV9M56l9+6OGM rBrFWHgSXt1QyKAcvQni1VQ5l6RIaNnPxf6+QLTsGzS6k3PLJQd+ZjKHbe44UhtRP14k eKVqP0vzCtuuO8q8UwkcvzzjJwjpzrQ5s6rL4qHvWUMvRNI9OpW4Afv/lvrEkVD4JbCl vTwcRHoPoL/xkWWN9MqiFShbgFm+T8zwWT+Ck6fuRuj7ssPC+BsUlTrOrSJ4O0WHtnKa z+1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vPXh7Anc; 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 7si6305135qkg.270.2020.03.02.10.02.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Mar 2020 10:02:13 -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=vPXh7Anc; 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]:36420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8pOP-00050U-HD for patch@linaro.org; Mon, 02 Mar 2020 13:02:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39222) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8pL3-0006oq-Ly for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8pL1-0007cq-La for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:44 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:40401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j8pL1-0007cU-Ga for qemu-devel@nongnu.org; Mon, 02 Mar 2020 12:58:43 -0500 Received: by mail-pf1-x441.google.com with SMTP id l184so80819pfl.7 for ; Mon, 02 Mar 2020 09:58:43 -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=vPXh7AncUP+qc6FKFOOg3QTRlXQp5E8M6BNaOrA4SyMqan7IpVsh983mYcn0jU5e0B wjaqjkgSO6EuIE6o3U9h3Pn2yiIByI4Zi+2dwTL4w7I0vJtvJJ4+NNhysmJBOJ4jwuU3 7vgw+1BfT0iN2b0iu2ZVGtuGAv2B4jKJfP3RsyDOZFBUjcLPvMPapKjbG3w18uhsGsNB ZVHGGnPGqlHfhZx3ORTqwMyxc5x3HKTXtmv8ZscPkGzL2TfEl9NHfNZEuavC/3UO4F68 52A4wOGEXa9mLjRSsqDlQKiopwcBr8C4xcOFifgy0+4olCzVb3B1tBrzOUhcwRsXq6R4 Q9lg== 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=UW9eL2Esb8cfZkJIBn3sUlXggQ3FgNlVrKtZt3MrnevsUUaR0/q2rni6/AwLo3HPxe S6Cin4IB+Aaa0Q+DTljCo03/pjo4URc6tss9pFcz7fALkPKm+51rj8+NKX+HiZCqO291 PUav/yWUPSARrr/MTC7sLgN8jgDwN7Q4fVWYRcFj3VRmtQuMuSVmMAmgmrXcX40ph6XT 7PLOGmef2tTgCpQojfPei39PDbXPVIfGlAWuclaFeTwNQ8bx+nb7B/Y7a9dfdBuFzADz 0p30Tc0CxcNzXJ1xHiaimGs+4RIKlO9CVPBxZtq5l4YTrNr1pp1x8bk0o2jXKw0NjbYC Dc+Q== X-Gm-Message-State: ANhLgQ0jrfgwOzs88nckA3a3CjJOhl4NI7PuQlDQAAq/9ss51L0rWrix p1zs5PPWp3q/wkjzYtYczcXBj5fqMFU= X-Received: by 2002:a63:385e:: with SMTP id h30mr109747pgn.230.1583171922325; Mon, 02 Mar 2020 09:58:42 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id s18sm99510pjp.24.2020.03.02.09.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 09:58:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 9/9] target/arm: Disable clean_data_tbi for system mode Date: Mon, 2 Mar 2020 09:58:29 -0800 Message-Id: <20200302175829.2183-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200302175829.2183-1-richard.henderson@linaro.org> References: <20200302175829.2183-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.20.1 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 src) static TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr) { TCGv_i64 clean = 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; }