Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1312181pxb; Wed, 2 Feb 2022 01:53:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGUQouO5cXcdk7eA9jt8umQ+iUIx+6e7LjgTe3PDHeH3tqhreHCF2Y3blurT8BgtusGoAM X-Received: by 2002:a05:6a00:b42:: with SMTP id p2mr28980075pfo.50.1643795605924; Wed, 02 Feb 2022 01:53:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643795605; cv=none; d=google.com; s=arc-20160816; b=MwTU0orw9PtCTOKIZZt7VibYKa6+W5Qk9eoceQMn50zfrZmWOWilk1Vxz7KDGT9mog KuKfojeU3MagAKT4gHtifJm3YCxcvQzZuo4M56IvyZ6lMP9rv4JjxIX39Ary/IlqaV0E R9RfJE1J3O1xgfH8mdks9GKhUpxz2OUSpYsDilDLM2NkHxtpZUBIcwfkuZahWE8XJrxZ vWM9kRllfGApaNn/SHitsLzCfGBLi7+jz8sng5qdo5R+gifdLSQBEOviKjhx8ntWAizB NLRvRzrfWtPWDRydVEbPZQFVHUh/DagbAZuZkrUCnhahj1fC0YsjSAHMJPnIk9eQVAJD c7BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ScFMNr5TVZoeLTg3bPMGfirLQ+F0V+f2CUw9bpDf9Pg=; b=wRF4XcyLWmAITA4eSLDbxDOslsUDcTA1x8eRd00C+nPqXCdDcv1pdkNHy0l0K/BwdP wD9VlZJm42nCMmdRV3o4Atw865WUrIW++D2BbH7QCpvSg8TWuLvsCZnKj0Tflmw6Lw00 u2VrHXw7sD3/GkFq40To0zy1MH2bUmZfnbeYfwJmu4cZ+6UP77AgfUcjWNR21rmUve86 f/cQX/oqtWorlMklItBgJfQ7HojNPtXULdsX1qkxoGoPTXSpCyauKUrfWV/BtouY93jU GD5rOFV45c8SXdCbai1bGtgHAGXqdec7XnfZ+WoY/K8ugThtbl+bu+i/QxPAu3eFYWzN nt8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XijAuT9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12si20102663pfj.260.2022.02.02.01.53.14; Wed, 02 Feb 2022 01:53:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XijAuT9b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240037AbiBAPH2 (ORCPT + 99 others); Tue, 1 Feb 2022 10:07:28 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:34350 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239968AbiBAPHU (ORCPT ); Tue, 1 Feb 2022 10:07:20 -0500 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 7C4AC61646; Tue, 1 Feb 2022 15:07:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDDA7C340F2; Tue, 1 Feb 2022 15:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643728039; bh=yfEc7zgR3yCBk8Yfn7aWFLEsFQj0j+xfa9v6cbpF6Vc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XijAuT9bnUGuYuCUmoALNBnEHlhZtDhCRON0RFO4F+1ePEy+7up2ymK2Ee3ugl35d Yaj4xeZMW1Asnh8eo46/EAvXu1I0vZizvuVgx83fqUzo8RsmbK6A0q/tKOhnA0InKi 07WJFqfZsdSh5B1iKRzKqYFRDDFUKI41b/wd93Vpr0zWE29Vemj8+KymSC4bYkkMlK JB4JE4rW7JwmWjGG1DiEeSWyBj2hf6gCDG2iHi5SRLLhWJ8QP9q8kXMniqKjs6zzoA 8r9gJx1Nsox9ck34CBiPhkdvtWJWJEwJ5CP7vktOGRnnlpclGdvMSGvdk6RShWn2ie QD1vkrdlU+wZQ== From: guoren@kernel.org To: guoren@kernel.org, palmer@dabbelt.com, arnd@arndb.de, anup@brainfault.org, gregkh@linuxfoundation.org, liush@allwinnertech.com, wefu@redhat.com, drew@beagleboard.org, wangjunqiang@iscas.ac.cn, 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, Guo Ren Subject: [PATCH V5 13/21] riscv: compat: process: Add UXL_32 support in start_thread Date: Tue, 1 Feb 2022 23:05:37 +0800 Message-Id: <20220201150545.1512822-14-guoren@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220201150545.1512822-1-guoren@kernel.org> References: <20220201150545.1512822-1-guoren@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren If the current task is in COMPAT mode, set SR_UXL_32 in status for returning userspace. We need CONFIG _COMPAT to prevent compiling errors with rv32 defconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann Cc: Palmer Dabbelt --- arch/riscv/kernel/process.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 03ac3aa611f5..1a666ad299b4 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -97,6 +97,11 @@ void start_thread(struct pt_regs *regs, unsigned long pc, } regs->epc = pc; regs->sp = sp; + +#ifdef CONFIG_COMPAT + if (is_compat_task()) + regs->status |= SR_UXL_32; +#endif } void flush_thread(void) -- 2.25.1