From patchwork Mon Jul 11 13:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 589362 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp3289643mab; Mon, 11 Jul 2022 07:17:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1swu9+SxDD31qroeJ5TnV+gpPbgo4l5Dq5MyVQxv6HFAcOCs7hLqAELq6A8V+GYQvztSe8Q X-Received: by 2002:a05:622a:1a21:b0:2f1:f29e:40a with SMTP id f33-20020a05622a1a2100b002f1f29e040amr14269576qtb.235.1657549063055; Mon, 11 Jul 2022 07:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657549063; cv=none; d=google.com; s=arc-20160816; b=Vf1ySOyVZaui2iPzsXJmHtcCgU70bfPtynnJex1Ph9qEKfaQZO8IKDAJPy9PGcLK48 KVfLQAiJ/JDATKEAwhZoIgSOIttnnjXjouis9aQ0+L2gUk6ofWcp1HMSC8SzyJFdLqfI Yv0kyt+ncBCi5LBOQae57AsFuYywXd2nEJncxwSNgfvN+nGZYtp41HVAUQvBnAOD4B6R t1DUX/dOcgHCLUbU4k2I0ReDaWAKboiBTGA53RMml/baeHnUAXlWjo9O6Df+Y9I+bfB8 u+GiLum4UEUJVhBb9qFU/aTn/NphIU2gZ049tzZxqerQcCOwY8vsfrBUW5wHtRQgXrpb z1Yg== 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:to:from :dkim-signature; bh=korErL6tl7BONUfbCJvMnIcz8S+EeAk7Q1N3xczdPYQ=; b=UU6ZNY0MAoMdeWw2pTWcIXiaCminXJC8bLEe1kEgedtUMQNaJY+xd0RnSEeBQdouUr /sxUIqQFfU+oOoCio9nshhqswBaDYx7X5NiCtfgoj+/1l0ciRSbVTo7DbeXltGWOoKlo 4IewJq8H0MGMhYJN47EsH++PcaUNjLzqQK71NBP5omZUDOgX4l1wZT2E3C/UOFeccPHG PM3w5eUKe5W9QZNvo79x+PIQd5FVKolvYAh3xMTDsuGVPW69+RO4cWmiev4nb2sBV475 uOBbaUuwd/3vQ3SV7xl+0wzdTV+ya+oZidI4g5bd/zxdwihc1GE6aHj964RSU0q/tNYT mCTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNRZw6Cv; 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 bb29-20020a05622a1b1d00b0031eb00172bcsi3344356qtb.333.2022.07.11.07.17.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jul 2022 07:17:43 -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=aNRZw6Cv; 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]:46250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAuEI-0005JV-IW for patch@linaro.org; Mon, 11 Jul 2022 10:17:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAtvj-0006hK-LV for qemu-devel@nongnu.org; Mon, 11 Jul 2022 09:58:31 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:55902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAtvd-0002nJ-6O for qemu-devel@nongnu.org; Mon, 11 Jul 2022 09:58:31 -0400 Received: by mail-wm1-x32e.google.com with SMTP id l42so3021510wms.5 for ; Mon, 11 Jul 2022 06:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=korErL6tl7BONUfbCJvMnIcz8S+EeAk7Q1N3xczdPYQ=; b=aNRZw6Cv3AT25izA7eoSLfHdSL8q/3m51gaXovFYWRCtJC3ywnNbqQPHbED+OWP20T MZFKO4Pg4pDZfZT7wz+/VnkDXfD6pCbMBeM5fM+xlxjIAuregI57lWUqyzyu1Y5tfE/D b9iTDtQETUW99DYvPkzWx+NXbnFatFkh8jjHOpkiKVJuc9Q+G0w1ftBkgFZk9kBpJEs3 SArHKUbRZ9ClsARGJUAA0U6ImxK4kxPK0kznl/KPCLGiHNAWrJO21neYouoINKqV3zJ1 z+9UqbAxNI8RrhEnT3lChQrlylQTu9ipyEVF9wzr7fUmXeE2IPz8cOwIrGpfikJoP/GL URjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=korErL6tl7BONUfbCJvMnIcz8S+EeAk7Q1N3xczdPYQ=; b=h55P6221mNulEFV+2R8j9ZarExWfvkKHyZyds+5+5RsCBwemEBNwUTDlZXquwS4q20 5SOjhPFgH1gyGlz2ZDXBc5BqkB0HnE8Bij/9BM85NH6YQ3A3yly6u3aHmEwWoN+bk32Z mfjXXmBT5fmgjzeySU8Kvj0dPdLluRrYehey8m/GyIJupsLgxGpR76eaZ+upZGPDIlcO CfWYlrTf6w6hNXNJNCbfydJKIt31w3CcUZbNqwfx9zLCYqWxBVJHaO77bud9CuH+QP/z I05CrzsaVQcwpYQKpBC7CTFS48tzwX68PaqRqb192wUr72WzLcKOW0Nvpl0i1GBTn6ZY oPrg== X-Gm-Message-State: AJIora/NiP/Hmg7hZ2EmYPBQRX6bDQ8FQmR8QKtb2OCDLL6A5Iq35e/N bDNCgpY/0XTmC3xmBuZI5TQG+JKFSrXvSQ== X-Received: by 2002:a05:600c:4eca:b0:3a1:9c39:ac20 with SMTP id g10-20020a05600c4eca00b003a19c39ac20mr16217566wmq.61.1657547900178; Mon, 11 Jul 2022 06:58:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q123-20020a1c4381000000b00397402ae674sm7595596wma.11.2022.07.11.06.58.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 06:58:19 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/45] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS Date: Mon, 11 Jul 2022 14:57:38 +0100 Message-Id: <20220711135750.765803-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220711135750.765803-1-peter.maydell@linaro.org> References: <20220711135750.765803-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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" From: Richard Henderson Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220708151540.18136-34-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- 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 97a477bd3e9..f90359faf20 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)