Message ID | 20220405071314.3225832-14-guoren@kernel.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <linux-parisc-owner@kernel.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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24896C43219 for <linux-parisc@archiver.kernel.org>; Tue, 5 Apr 2022 07:15:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231524AbiDEHRI (ORCPT <rfc822;linux-parisc@archiver.kernel.org>); Tue, 5 Apr 2022 03:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbiDEHQo (ORCPT <rfc822;linux-parisc@vger.kernel.org>); Tue, 5 Apr 2022 03:16:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A39E101B; Tue, 5 Apr 2022 00:14:47 -0700 (PDT) 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 CBF64615FB; Tue, 5 Apr 2022 07:14:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65104C34115; Tue, 5 Apr 2022 07:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649142886; bh=czcF1B6lamA2QE0/pzTN2aNL2pufxwZMl+tVG9rkf3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RJWOm7M3XXGmDosd3qRUX35iFS117oeOyg0m88AcYGHci3soFwkrSnRJkYjLyvBZl BtVhGrOs08GluxiCoLUt3DNWb2a6bdJNfZnZSUmKiTlJKpQJuHNyZtd3UqS80e90Ls aqHLZ0DaYiuEN3aqiOI6n1kQqV/eMeXkopBndYHDnS7tWb8i8xDf0+xh/5jHPpv1UE GjeZk5QASjUzv5VcVqM8QUJfjNTJGaSU4JYxZvjL1dqRqgn6z1MAnjDUyrm898lRdr QZliXcoWVqmMrdJ3VWEErBTHQc7sADJpMGtJVqrDwPQqmu0emi8jBrf9FovTGheWjw /N8GgOqJw9MDQ== From: guoren@kernel.org To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de, gregkh@linuxfoundation.org, hch@lst.de, nathan@kernel.org, naresh.kamboju@linaro.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.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 V12 13/20] riscv: compat: process: Add UXL_32 support in start_thread Date: Tue, 5 Apr 2022 15:13:07 +0800 Message-Id: <20220405071314.3225832-14-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220405071314.3225832-1-guoren@kernel.org> References: <20220405071314.3225832-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-parisc.vger.kernel.org> X-Mailing-List: linux-parisc@vger.kernel.org |
Series |
riscv: Add COMPAT mode support for 64BIT
|
expand
|
diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 504b496787aa..b4421c16198c 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -98,6 +98,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)