Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1794330pxb; Thu, 4 Mar 2021 23:00:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaQZ9EjrkfNsfUOIKRke9vg1pCVNXqw8RTME31A1xo+duXpOPVHIy1OQMINcixsMEK1XZG X-Received: by 2002:a92:3652:: with SMTP id d18mr3683757ilf.100.1614927635761; Thu, 04 Mar 2021 23:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614927635; cv=none; d=google.com; s=arc-20160816; b=WwnSr3bJz9J9SZGznKMzNPa44XkQgEA+BLRZxrEFI+WNId1Eov4XZE61v+Js0Yj3YM ZKXSPMpOb5Gc97pPSjIo/5xwRQ9iaA2F7zCKNp7hDFtIhOdFOfxH67xkNH2EmvEMtxLP FDUdKn3WaMgIfjdwIWM7ZE6JLjyo6P4QhlrvdMN4i1jTxAM7IXl5kAMXzOscymWmB8G1 zuV2+9fgQMAySPYVIGg/8Ops7Bgv2GVUD1ydmITCBzu+VggPJax8Elfp8abos8OPotmb eCYs1+FroFEThSF/7ZW1Z7oCZGS6hL7+ObUaXBbgxv9CNCgxTA/oCQ0eZYDLfzcjAw3B qTpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature:dkim-signature; bh=faHJ/HZCgMSrhWbdGfXwMkj6STWLsowbnJ92MMdABQw=; b=HJ0fBdsDMw11T1URciyMZzdkI/6R8XOOBijcfVscpWUSdojI60wpk4udzR3jAcv7+D UpoTLhijLO0HsM0LT6pQm2m1iAXivcf/l8OIqwe3VxBATKpTB/kzVpf9lO9JUCNnAiW2 Q+DbiSldpsEw9lf8lxfMnIRMEkYS3GpJ3wM+P0lEgR3dL5cMRvqcyTpSEF39oHIEgzSr jmUg9D2n1rW+dEGFZVDXZOjftNpEgdujN8p++tpVbi9RoJSSjKUe/ZVjYbTO6wiIc6eq nSh8tt+gcy16BhmttWaqzBD0wOglrqU0p8Pe5NcH+W+ro+SKAOj0BMVonqAoQCPxUvfF q1Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="R1t/W4DO"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FefBIcnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si1625729iol.20.2021.03.04.23.00.22; Thu, 04 Mar 2021 23:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b="R1t/W4DO"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FefBIcnw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229489AbhCEG76 (ORCPT + 99 others); Fri, 5 Mar 2021 01:59:58 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:38047 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhCEG76 (ORCPT ); Fri, 5 Mar 2021 01:59:58 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4A57A278D; Fri, 5 Mar 2021 01:59:57 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 05 Mar 2021 01:59:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=f aHJ/HZCgMSrhWbdGfXwMkj6STWLsowbnJ92MMdABQw=; b=R1t/W4DONx0KTPzJs Lx6KhALUg6awjFWfFc0IPagupj88KE2laVqlgKkSH3RI6A/F6LLuGtLVW7KSjbXh Q6j/YMEQ3e6hzTY3y9kCoOJApn8KHbPkilzMmizmGY6M9yGY8TDqzST7XRTBQYLf 0WcLkwboSR2u7jP4YtG/oIWW15JqzOUbTTlnPYp5hxoh6V+Vuk2/ouURSSQCVWVH Nq4htlE9Ttj3sKkYCMRpAirPLrDBH362UBUFd82y1wvVnJkAQO9cXiqcy1b0b2Vo rThv06KTDomLQc3RE4+bMoBqlWPqhm32Q6Lt6re9/023/Q50sjiYTIT3u1AoLEfz JvlUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=faHJ/HZCgMSrhWbdGfXwMkj6STWLsowbnJ92MMdAB Qw=; b=FefBIcnwNaHiDWcWbY79Mqr3tBnImYBnMN08N/yr0NII2d7x2fkJGjpQw DXCwN4mgh5qUqbJyzJDS75Hqw2BtdH82CW7Rnh9q/MRu5yP4xmgU17WO7DIx4z9H LDYyNwKuAnrDprvDZ6Nu9TnihlHTe41GkAwEdFWfaAY2zkEYFT11y5mq76uAIYZQ i3bkydHHKTzW45Mwn3aeSSOvGfJEwnCt/lRR4CKTqzwZmZqbYz76PEICXzgdDUZT Fn/wb/2J8B5FbZyatbXtpw7RdiBA7M0ljEjoDuHtn5ao99e4WOF4xtq4L14D0W2E ahIJJ9JOcnT1XnbJ3+GV1Rit4gPqg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddthedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeftnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnheptdehgfeukeeiffevfe eiheekfeelfefgvdffieffveffgfduieeigfehvddvteefnecuffhomhgrihhnpehgvghn vgigrdhssgenucfkphepudduhedrvddvjedrudeihedrudehvdenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhm X-ME-Proxy: Received: from [192.168.1.205] (unknown [115.227.165.152]) by mail.messagingengine.com (Postfix) with ESMTPA id 82FC91080054; Fri, 5 Mar 2021 01:59:37 -0500 (EST) Subject: Re: [PATCH] MIPS: Support large stack. To: HongJieDeng , tsbogend@alpha.franken.de Cc: paulburton@kernel.org, chenhc@lemote.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, liulichao@loongson.cn, denghongjie@h3c.com References: <20210305031257.14936-1-deng.hongjie@h3c.com> From: Jiaxun Yang Message-ID: <54185bbe-907e-2e0b-8498-8214128d7847@flygoat.com> Date: Fri, 5 Mar 2021 14:59:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210305031257.14936-1-deng.hongjie@h3c.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2021/3/5 11:12, HongJieDeng ะด??: > From: Hongjie Deng > > We need more stack space, xori/ori no longer apply when > _THREAD_MASK exceeds 16 bits > > Signed-off-by: Hongjie Deng > --- > arch/mips/include/asm/stackframe.h | 8 ++++++++ > arch/mips/kernel/genex.S | 6 ++++++ > 2 files changed, 14 insertions(+) > > diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h > index aa430a6..6ebc39f 100644 > --- a/arch/mips/include/asm/stackframe.h > +++ b/arch/mips/include/asm/stackframe.h > @@ -278,8 +278,16 @@ > sll k0, 3 /* extract cu0 bit */ > bltz k0, 9f > > +#if _THREAD_MASK < (1 << 16 - 1) > ori $28, sp, _THREAD_MASK > xori $28, _THREAD_MASK > +#else > + li $28, _THREAD_MASK > + or $28, sp, $28 > + li $24, _THREAD_MASK > + xor $28, $28, $24 Hi Hongjie, li breaks MIPS64, please try PTR_LI instead. Also loading immediate cost a lot on MIPS, you may save a unnecessary li by: + PTR_LI v1, _THREAD_MASK + or gp, sp, v1 + xor gp, gp, v1 Also clobber v0/v1 seems much more reasonable than $24 here.... > +#endif > + > #ifdef CONFIG_CPU_CAVIUM_OCTEON > .set mips64 > pref 0, 0($28) /* Prefetch the current pointer */ > diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S > index bcce32a..5ea4fe4 100644 > --- a/arch/mips/kernel/genex.S > +++ b/arch/mips/kernel/genex.S > @@ -662,8 +662,14 @@ isrdhwr: > #endif > MTC0 k0, CP0_EPC > /* I hope three instructions between MTC0 and ERET are enough... */ > +#if _THREAD_MASK < (1 << 16 - 1) > ori k1, _THREAD_MASK > xori k1, _THREAD_MASK > +#else > + li $24 ,_THREAD_MASK > + or k1, k1, $24 > + xor k1, k1, $24 > +#endif Ditto. Actually another possible solution could be `.set at=v1` around it and let aeembler to decide if it needs a extra register. Thanks. - Jiaxun > LONG_L v1, TI_TP_VALUE(k1) > .set push > .set arch=r4000