Message ID | 20220322144003.2357128-14-guoren@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0217C433EF for <linux-arm-kernel@archiver.kernel.org>; Tue, 22 Mar 2022 14:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/RzyCl2viPmex3Axkj1+A35cOyxLIekgzlWZ5yWTzIw=; b=ANtUHqGwLwngAR Nh79w2Qx7eUlDt+Xm5qJtusCFK8q3RGwNV5Fdt9etl2zmRI/PHlTlyy6yuYCgdfDvYVUuL+DybVmn 1cyB93SjYdzUSoYfYMxqucAoOrbyAhWzO+NeHrR9BZutd326sgnbGr/oOlys6Z21mg9iWa0h3LYg0 Dy+R9iX6zrxBNM1ogXMUkpL5THjnYfLkdOLqS/0ySxdOmxOEIm2rCtXZ0nW8KbYzLW5rgw2xEqva6 YWbwwjfl33/igvnHAC/q350pGs4CEVwn9BeSw/w4VJOm2YUmGmOf0RWYYi+1AqTBgOfbBOAV0rrh6 tVZfpwTL9vzQ0Zdo/M+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWfpD-00BLtE-Rq; Tue, 22 Mar 2022 14:49:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWfhc-00BHUb-Aa; Tue, 22 Mar 2022 14:41:41 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DC56F61419; Tue, 22 Mar 2022 14:41:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC11C340F5; Tue, 22 Mar 2022 14:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647960099; bh=a1P2DNQDu+Nr0wIsMe45GFTAoBbxFKExa639SNMT8Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WSUKIo4uz8F6v3kwDldgpdzakw9QYzSDpCf1vKY8kHyGGW12dHTbHWHRNo+muqiog oZl8cMAldYFIPgQjoBfSXYrnRM2Izb2leRb9j9KDZb9TTv9LTPFMf9VU6GXHMCwmel kwq/0a2qRV1PFG4XleTzMGDve7A081QNGbvoI7E4Um2JGZW+/nbmTmvB+ZOVmif8VI 83zhr4yZvBiGZa8VpkltGgjdHdvAYRiXU35fYY+My0OdW8V56NTwa9YQmpGi+l2fQ1 8UgtwBXOa0Ps/8dBEPn73WU1ztxWffutVlciz1jujJxf6ncVbqGsgjsopmkVYst8WV M1I959eBGkygQ== From: guoren@kernel.org To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de, gregkh@linuxfoundation.org, hch@lst.de Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, heiko@sntech.de, Guo Ren <guoren@linux.alibaba.com> Subject: [PATCH V9 13/20] riscv: compat: process: Add UXL_32 support in start_thread Date: Tue, 22 Mar 2022 22:39:56 +0800 Message-Id: <20220322144003.2357128-14-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220322144003.2357128-1-guoren@kernel.org> References: <20220322144003.2357128-1-guoren@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220322_074140_437534_11ABF0F3 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
riscv: compat: Add COMPAT Kbuild skeletal support
|
expand
|
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 03ac3aa611f5..8c7665481a9f 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -97,6 +97,15 @@ void start_thread(struct pt_regs *regs, unsigned long pc, } regs->epc = pc; regs->sp = sp; + +#ifdef CONFIG_64BIT + regs->status &= ~SR_UXL; + + if (is_compat_task()) + regs->status |= SR_UXL_32; + else + regs->status |= SR_UXL_64; +#endif } void flush_thread(void)