From patchwork Wed Jul 6 08:23:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 587748 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1ec:0:0:0:0 with SMTP id 12csp2583278map; Wed, 6 Jul 2022 02:46:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sHUK78qiGqDaoHmTzbR2hqEwmaUZkICYdhBUwxaYtc2znRdTFQzymOUeoAUakHDKbiH2gj X-Received: by 2002:a05:6214:762:b0:472:d7cf:15af with SMTP id f2-20020a056214076200b00472d7cf15afmr18939381qvz.11.1657100775369; Wed, 06 Jul 2022 02:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657100775; cv=none; d=google.com; s=arc-20160816; b=YzztauBLWPFmq9hX2eTVZjidEIxAk/Ru+OozXYcSFgYbn3rDHFy44i2+Xe4EQu/hwm gE1h+Q7Cqwh1+1IRxLnzXWs+Qir0xXIuIs7agEKKv1b/SgVuvKIuSBIjSxbjtrlQlUF/ jnE72a0PvfX+SpIayQoOX11cPL25I6r7togGH/qEZsPW7rq1AbZCKs2QVI96Tg1faDyT 3g/77rszGv5iF2/XnQD0yxdrOdJ47BtefeGH/nM7egJszD7wi5LvGA/zW1c2eE5vv1kz +Lw54dBUTPjC6zF2C2v8i6bUOBYpN3UAjvOkR5cut8gnTNebSO9brsG2CvqngO/UGDTZ S5fg== 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=5PME71S11cSPKZ4C3ISqAJ4KA5QkjnbMhk+jE1tP2f8=; b=MFWHrZEGy8K4VNVez9lnrsC3XBOeVAXK4ksTTKjmOLhFYOV5EpbeXCIDx+FQDZSrhI rBkQ8YyBBMKjhNrkbgbWLBAecmEjH/ihUMoAEFSYP0VHGJOqeSNnSPJKFyhIrPyg1Hve QbzhaGMACDRaIEzvjCQHB5LPemjtx6lcea3Z3TdUybLPoBWP5xze/9BHfEdfbC1ICgl7 i4qB/vgHv4XF3Z4l2DdfzwkEtL4C+RvQw/TbaCu4NxsyFlXkzU+Q+ph/bQVFoA8BmJZM sdvQT/rUTmNbHMDV9w2bSsjlW1Clx01eUBncFNzOkuh9Qusu2bRviAotHMYVayzQ5cFW rS8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2hNMV3t; 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 f19-20020ac80153000000b0031d295405c1si13859875qtg.620.2022.07.06.02.46.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Jul 2022 02:46:15 -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=n2hNMV3t; 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]:50030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o91bq-0001aZ-0o for patch@linaro.org; Wed, 06 Jul 2022 05:46:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o90M2-0006lA-Ug for qemu-devel@nongnu.org; Wed, 06 Jul 2022 04:25:51 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:36515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o90M1-0000mw-Cq for qemu-devel@nongnu.org; Wed, 06 Jul 2022 04:25:50 -0400 Received: by mail-pf1-x42d.google.com with SMTP id 3so3606658pfx.3 for ; Wed, 06 Jul 2022 01:25:48 -0700 (PDT) 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=5PME71S11cSPKZ4C3ISqAJ4KA5QkjnbMhk+jE1tP2f8=; b=n2hNMV3ts2wFxtT24y+x4xXHsfW308Op6TfP7lT4JO/GiK5FErs+ji73c80l6fHUyv Mdk/U+oobIb3pIbkZvTb52ybSO7aWGaE3IWjkhCvxOxBfw55pzU+vOB8HuZivaeyM3TY kyczvzj1yDEn4q+NCaDqfPkkv5lvE4tj9cXP/IuLDA0Y80HEjjrgG0AXLAE3MUi2JMLt Vc+Sx/HjhBBH0SjHrPUdsV9Cu+laH1skrHGDO8/WEcDU1EaFkBGFJQ5emb5YD95XrTCJ 9bHJXh+9pMVdaMmddDwFHdfw+PvkPEf0GJ3jVsjy4bKeqQr+xYkkNbZ+MRzWLrfdw8x5 ptVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5PME71S11cSPKZ4C3ISqAJ4KA5QkjnbMhk+jE1tP2f8=; b=dj6NZvlhuPAy9b1dPCjSirzM6jp0Q4bx8wG7Aatn6ubUFEaK2SnsI4uB0aWX+B1ztm WjyrAdSB6lZvSPL9ZVVkk2mZmnUVrx4x6on11Wh8DsV327AMA6t4QL8Lhi98qCruDmjz pNa9GCPyOcZ/LCERlW3GeEvsKDSnFnFGiEXhdgGtgKrpa4bE3smbvYZd6sPk9/Um6zW/ AhvN+NHJy465pKY1By0fMKKdJFOMrE5uWSNDNvIidUFytyyCDB7vtDX2M+COoHO4IFlK dUOZ4MDo/fvN/1nhU5rtKKXLxrGW6069ucOkzDbThLCHpC4xOWgP5WXKVd+wxSGFFfqZ XHFQ== X-Gm-Message-State: AJIora+BBndSv3Ua9lHHieXzrB9u1jAUFQaoJAxZp4t80eXVf9PvLqcC wES3BypIfCbF9QDt/suHecTxxvAkPpOJisxs X-Received: by 2002:a63:4b17:0:b0:412:83cf:ecaf with SMTP id y23-20020a634b17000000b0041283cfecafmr4827391pga.105.1657095947553; Wed, 06 Jul 2022 01:25:47 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id t17-20020a170902e85100b00162529828aesm25199256plg.109.2022.07.06.01.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 01:25:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v5 33/45] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS Date: Wed, 6 Jul 2022 13:53:59 +0530 Message-Id: <20220706082411.1664825-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706082411.1664825-1-richard.henderson@linaro.org> References: <20220706082411.1664825-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-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" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_cpu.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h index 97a477bd3e..f90359faf2 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -34,10 +34,13 @@ static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags) static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { - /* Note that AArch64 Linux keeps the TLS pointer in TPIDR; this is + /* + * Note that AArch64 Linux keeps the TLS pointer in TPIDR; this is * different from AArch32 Linux, which uses TPIDRRO. */ env->cp15.tpidr_el[0] = newtls; + /* TPIDR2_EL0 is cleared with CLONE_SETTLS. */ + env->cp15.tpidr2_el0 = 0; } static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)