From patchwork Sun Apr 25 15:57:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 427276 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2999810jao; Sun, 25 Apr 2021 09:04:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSSNAJ4UjLoVT6hW//Zw6YPRzxEChgQSYicdXfSkIAt7xtOuWV4gIJmHgbCAfcVPWLpJNo X-Received: by 2002:a05:6402:c1b:: with SMTP id co27mr16429780edb.61.1619366674134; Sun, 25 Apr 2021 09:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619366674; cv=none; d=google.com; s=arc-20160816; b=T5o2YLZgdfV3Z9ap5BEUuBJYe855xc/QX0Azdd9G2/0A7v18XoNHUjKJXenBUcQa8f u9z6xUD11PFAHTA9aTen6KK7IeBzZ42bykVO7HHLsgAXsdo3FQIXZ+mwldXMMcYXTF+0 Q2t/4b6Gc60t6Mjr5dpl6TwvDvw3JQR1jwLUmcI5J1Mlvd7Ssk4XH9Q/nil6CS3ScHAD wXzvLqHggGxtQUTJPSspotfbVh9QoeU3+eulFngc20+uhYvbKg+lUdxRgyBbAXbsw2ek uFUI4meRkf+heVTbRK8hgMjo9mVdnSnTvqTnb3bTz1o0P5cy5UsM1RcDCXv+UeU1tnb7 s1vQ== 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=u30xwcxCy80ZK6dyM8pP2MsdoEwOxGc5lWNn0kKyZ7Y=; b=p5lThcjgnrZ1eQ9ImCXE3ouhV2PL98BDBE8TtWISYh/dMjHTU0HdVXn4o4KDiyRLFN qRYlqefRA9JMwJJ7bFDR63Rn+w/YpIdCCgB0AVA2MvnVrdjojaL5oL+A5tqoNP41MgJc luyTXSJ+0uveVk3NjPeV3I8sn1Pv+o9aQJfyi5pLcWxMEIz+bOWp6U0vnqMiQE0U8Qlu oMkr3CfQ5OCV5r2TJfnFL6Tt1nmee5gL07G5Bz8tfWNxwe2DGAo6pVk9NE27RFCBtYbv vMNb7/NQhhf+yDiNA4dKJWdAkebn4GFGTI+Xb8LWUMKWzsTGeS6kW/wXb1uKHwA0G2eE FlHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m9CQoiLD; 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 k9si13318244eje.366.2021.04.25.09.04.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Apr 2021 09:04:34 -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=m9CQoiLD; 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]:60938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lahFJ-0006Du-4y for patch@linaro.org; Sun, 25 Apr 2021 12:04:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lah8x-0007tY-Vw for qemu-devel@nongnu.org; Sun, 25 Apr 2021 11:58:00 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:54824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lah8u-0003CD-6L for qemu-devel@nongnu.org; Sun, 25 Apr 2021 11:57:59 -0400 Received: by mail-pj1-x1031.google.com with SMTP id t13so1533769pji.4 for ; Sun, 25 Apr 2021 08:57:55 -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=u30xwcxCy80ZK6dyM8pP2MsdoEwOxGc5lWNn0kKyZ7Y=; b=m9CQoiLD4uDA4FJghKpyCBIm7sBX73p8hx43Wu56hgU2Joz607/5W8YwUC6uP2tYTU cnMKTGjZjdvWctkFta1b6e39DzqFwhyQxcBSVjNtUPWPx7dVh0+o7Yhr2JZcgEYez5+L ICcSYCT8fy/EukgcdqzcYbIRPT6ij8ukbmL6NV40qvbt2eJmrmvDRL7E9besB3FBjXzp tSZEUl+9hsZTDF8xZAdP3eKPgagcobGzW2f0rgZYJSvTKcaSuVRGgtEUuIozT6VbEsRD FPY8Hjc5M3bC/q72B3UU4Gw17atKS36Ef+ipfXrtJ8mlSg9P/zZ2MCI0msec6uosE6iZ lMvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u30xwcxCy80ZK6dyM8pP2MsdoEwOxGc5lWNn0kKyZ7Y=; b=o/uTzf/VnCDzOQk1cOGBJZEv+7PlYAniexlB5nBmnHXwL12gTkIc0PNZGpj3oyWoRK JDXqIjlkooXz4ZfKNlWYFuzluD9lITzrR+LCGAf+iF4wv/t0gL5Yeak5EoOJT4A1rt0h uKvry2uKgVTiKa4sXmEfCT9h6lSe7tnnP0A4BRgCegZubwhoF4p7wKJT1+JOz4c9wyZ7 0w3cfjghmwLGOTlNJFsvgQ9F7drgdWi3sDRROo+mexQEPWpGxthG26aPylqgWY+V/o4Y VRaDIAOsg54Zs0WYbE719WkRwi5DoFYE8Hz/vrPBEfGso9TZ1VVqcsFLmJIh5ktph0ud Awhg== X-Gm-Message-State: AOAM532CMn5b8uWRppXl6EvnpUa3Svqo8ZEQHGm8uFcZvRxBVkIUx1I6 nJtWLn2+t1fcp4kg9a5fCtymRGrEXnAH8g== X-Received: by 2002:a17:90a:a389:: with SMTP id x9mr17135362pjp.232.1619366274954; Sun, 25 Apr 2021 08:57:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id u21sm8594717pfm.89.2021.04.25.08.57.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Apr 2021 08:57:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/8] linux-user/sparc64: Include TARGET_STACK_BIAS in get_sp_from_cpustate Date: Sun, 25 Apr 2021 08:57:48 -0700 Message-Id: <20210425155749.896330-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210425155749.896330-1-richard.henderson@linaro.org> References: <20210425155749.896330-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Generic code cares about the logical stack pointer, not the physical one that has a bias applied for sparc64. Signed-off-by: Richard Henderson --- linux-user/sparc/target_cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 37f6a1d62b..1f4bed50f4 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -46,6 +46,7 @@ static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong newsp, #endif /* ??? The kernel appears to copy one stack frame to the new stack. */ /* ??? The kernel force aligns the new stack. */ + /* Userspace provides a biased stack pointer value. */ env->regwptr[WREG_SP] = newsp; } @@ -83,7 +84,7 @@ static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) { - return state->regwptr[WREG_SP]; + return state->regwptr[WREG_SP] + TARGET_STACK_BIAS; } #endif