From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32C5814372B; Thu, 29 Feb 2024 20:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709239315; cv=none; b=l0CF5iirkpDdljnZVAsO7lVJF2wyGjjWLZbnsTRLItUQBj9SxY9/BJfpFD64rq7cJve6A1ohdSzg9gasa81AYzCBVcWhDYkUSoi4QfrwY5zE8VihYsIpUy2abcdYIf8xrd1kgrjpglYmmre+5PLf7fjTM5bkkuewOnk5+J4emBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709239315; c=relaxed/simple; bh=F+AdCZ1zPpXuCR3PFJRaPWix4/L1kyIbcRn6BWE6gcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ODj3EdlDaUibNY36TswcoIDD6kLvF84uMs/HA80Bvm0uIkkk/mfNdQAWl98IYAXoQbX9OMwH0cUHAr0LQIDlAdjNzRCPvAeKvgpZntkTafZP4BPXsLT3bLR7BDoKw4JndJcNc/4jqzgbsTpH8dq3TJ867gBZNAgz6K9NoEPjeFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yn4EFSTV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yn4EFSTV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 318D2C43390; Thu, 29 Feb 2024 20:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709239314; bh=F+AdCZ1zPpXuCR3PFJRaPWix4/L1kyIbcRn6BWE6gcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yn4EFSTVWR+yob4YkrwF+Y/zHHLTFKB/ld6FVGT2UdzMg5M3+6Tkr3LZg/jR37VTY M7qQ7bRheH67SJ1IEUjdozUQaY84Arfb1PfhITYoGyWpy31zhIxnQ75fLEsWtGLkl4 4q3wCCaMADIBsJScbf3VdZay4ujXZVzu/7qgO/tT5gZ8EvfEQQSEMOf4bzcwW0EzuR oqp/vbWGUOIeWy2/uW+DZfVSkHbLE4HmVahvOp7lktIJbbtcMgQVnMht43AzlcSa9G goGA2AQ9Oa+qh2NQrIwT/tLqAbyNFqBMWeLGj8PdnvGqF4tgEYaE4n1XA/d46U0N/E vx8zC9ynCN21g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hou Tao , Sohil Mehta , Alexei Starovoitov , Sasha Levin , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, luto@kernel.org, peterz@infradead.org Subject: [PATCH AUTOSEL 5.4 2/6] x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h Date: Thu, 29 Feb 2024 15:41:42 -0500 Message-ID: <20240229204150.2862196-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229204150.2862196-1-sashal@kernel.org> References: <20240229204150.2862196-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.269 Content-Transfer-Encoding: 8bit From: Hou Tao [ Upstream commit ee0e39a63b78849f8abbef268b13e4838569f646 ] Move is_vsyscall_vaddr() into asm/vsyscall.h to make it available for copy_from_kernel_nofault_allowed() in arch/x86/mm/maccess.c. Reviewed-by: Sohil Mehta Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20240202103935.3154011-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- arch/x86/include/asm/vsyscall.h | 10 ++++++++++ arch/x86/mm/fault.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h index ab60a71a8dcb9..472f0263dbc61 100644 --- a/arch/x86/include/asm/vsyscall.h +++ b/arch/x86/include/asm/vsyscall.h @@ -4,6 +4,7 @@ #include #include +#include #ifdef CONFIG_X86_VSYSCALL_EMULATION extern void map_vsyscall(void); @@ -24,4 +25,13 @@ static inline bool emulate_vsyscall(unsigned long error_code, } #endif +/* + * The (legacy) vsyscall page is the long page in the kernel portion + * of the address space that has user-accessible permissions. + */ +static inline bool is_vsyscall_vaddr(unsigned long vaddr) +{ + return unlikely((vaddr & PAGE_MASK) == VSYSCALL_ADDR); +} + #endif /* _ASM_X86_VSYSCALL_H */ diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index c494c8c058241..a8b0c678bb096 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -875,15 +875,6 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code, show_opcodes(regs, loglvl); } -/* - * The (legacy) vsyscall page is the long page in the kernel portion - * of the address space that has user-accessible permissions. - */ -static bool is_vsyscall_vaddr(unsigned long vaddr) -{ - return unlikely((vaddr & PAGE_MASK) == VSYSCALL_ADDR); -} - static void __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, unsigned long address, u32 pkey, int si_code) -- 2.43.0