From patchwork Tue Jun 7 20:32:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 579379 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp5537517max; Tue, 7 Jun 2022 14:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGFSrj5vNfkyt1NkO+UlGesx9xjey5vTcbStj/E4ooGO+INqK1sKyHkAHvzViGlIylkmoX X-Received: by 2002:a0c:b34d:0:b0:467:d752:af33 with SMTP id a13-20020a0cb34d000000b00467d752af33mr20312494qvf.109.1654638322537; Tue, 07 Jun 2022 14:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654638322; cv=none; d=google.com; s=arc-20160816; b=MO6UmLXhyP0NIW2YK4KlK88KZYAudclMVRBqxQVxOagpDmMWjNu2PJbNJXZlk1Jffh I4Z7NkT3vCB/rtJ2rgqAvZiC9sE3cQQHBrik93ORcuB+Oq2+Emt4AaNjwc0YIpGE4L3T VyTRfxYqCm0UwUIX5hO5ZEVuy3dTwLGq3VC0RQ/2JZFGnyJBVntdkwQ++yw4oZbFH3Ma cobv7H8yc1rLYB5kgGFagjopmsZAkWrvtYD6M3JO+qU8Kc1+Cpi2Yh/h175Fu4zn51xs dyi7xuXdyRGGSNUWjS9zfPumQOUbYyR36oIXBDCyz1iu0PCvCBD9dO9gMABhify7VXfA lWBw== 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=h8NNZqBa/oaHcQdJifd9wVEds8arqW1sbQgko9Vs+gQ=; b=0Hz6e16O3Lrq6ohF1G6nRAwVDauiHDpUD+1vpy8Atl11CgdD65jeHnxTvnZ2H5zgfm Y1e1a6LBAdKnE4QuTeL5EXt3WcltIY7nvwsi9pHdQfemV5DB59IpMp+Sc02UAekYa+AX LQy3AVl6qH6jf8E3mBGWitZr6y8SACKsMxi1f20RQGO1o4Rc/r4ATFFzi5/J4s4Ag/yj LyFG3RfnbHaSUqagz5bxtFUUc8lS/Gd/GWr9AJNa0JsUmfJB1X7AeChphTjwie6wXA4Y Lj/wuo8jyKiDHn8++vPyhPmMmut70Xmu+m5CZSQWPbOOAuVq+9zRc/+LE5l8J66qBLj+ AgfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aAdi6OLy; 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 bp8-20020a05620a458800b006a6d5508a3bsi2011553qkb.19.2022.06.07.14.45.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Jun 2022 14:45:22 -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=aAdi6OLy; 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]:50140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyh0s-0003kO-1k for patch@linaro.org; Tue, 07 Jun 2022 17:45:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyfwu-00076E-49 for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:37:12 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:35738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyfwl-0008Jx-NI for qemu-devel@nongnu.org; Tue, 07 Jun 2022 16:37:09 -0400 Received: by mail-pl1-x62b.google.com with SMTP id o6so10727746plg.2 for ; Tue, 07 Jun 2022 13:37:03 -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=h8NNZqBa/oaHcQdJifd9wVEds8arqW1sbQgko9Vs+gQ=; b=aAdi6OLy5ihMNxfNDGO5IJIJCakxrBcB5R4b9BIwohKqVkxTl72/7P/hqgjBBA5RVK hUjbsulSvIggcZpz6qAjncqQSareUG28d/l2Qxe43ePoBoJgI5GFBTlzpWxNFcqYE1Ql uMfjC2lg+CKuHDiOhjHVY/Su2UOJ7Rx2GFVUaC2qK1TaupezCuf0iAuOjX4Z67Th+Nuu NhgzUmtUnlWdsgPDBccN0Kr/fLDA+3vKbZycsejsA9t3rrzKU4az3vub6YMbOMHBmewA US2A0zYsbyOtZnoX0Kj2mKg+6DGbA/YyRYvRUiNsJzI+QH3hptfAtD0tKtpeFDYiqgOj AV3w== 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=h8NNZqBa/oaHcQdJifd9wVEds8arqW1sbQgko9Vs+gQ=; b=h2Xk0E87wjG550kP0+iKr+k2+ZtsRd5nRzkFO1RMiKiMmWQ84QiyHUI93PmMfzLLht WnSTLk6l0LpIA6sveXRnzefcwunJRxkzVRBR0YEdkSc9XMB5dk2NG15LhYEzd+q6UdTJ TlNwMJqY+GcWkglKO4MxCOKfOju5Sik4VYXtqV3mQtiBiSTkdV/h0iCPAtwE2llKCr7/ x4NGlGmUohFLkBBwKpEbaEKMNpPCZZItBLI6rPWuJfq8TveLUBRp7AY3qWxmNBNnW0bB 8om2xVQZNYdFmv+0RkmFxx+/FwnQ41E8nwFjkR2q/+qkaQRWlGPqtSW2S9RARYZ6KzuM ip+g== X-Gm-Message-State: AOAM533/JTNYPCXHpF1lEVpxkFhiF1Mt5LkNoQ6Rw8Cv8PUic2nGEPNh cubNofjg2gGQrppht19kEkzKM27fVePxUQ== X-Received: by 2002:a17:902:eb85:b0:167:987e:2686 with SMTP id q5-20020a170902eb8500b00167987e2686mr3781103plg.33.1654634222450; Tue, 07 Jun 2022 13:37:02 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3cf2:c634:5b19:25f6]) by smtp.gmail.com with ESMTPSA id s18-20020aa78d52000000b0050dc76281fdsm13235645pfe.215.2022.06.07.13.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 13:37:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Subject: [PATCH v2 59/71] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS Date: Tue, 7 Jun 2022 13:32:54 -0700 Message-Id: <20220607203306.657998-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220607203306.657998-1-richard.henderson@linaro.org> References: <20220607203306.657998-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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" 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)