Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp153077lqc; Thu, 29 Feb 2024 13:06:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUDnlMGF+9TX/CkiVFOBmG6EDJsKIz2toP1zkZnB4q2dfuak5fkoF5qX9rTcU22GwkNHPv/KZKEGGEHzpRJmY0kZVW4nS9lNaFkGzUF8Q== X-Google-Smtp-Source: AGHT+IGgVneG13LZtm9a6GWloFmFHWNeR4/ABvixvur7o4QTdOpwu90hAKTnXf0ndzpAeOhFntYT X-Received: by 2002:a17:906:3c45:b0:a44:5538:edb8 with SMTP id i5-20020a1709063c4500b00a445538edb8mr81036ejg.13.1709240795426; Thu, 29 Feb 2024 13:06:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709240795; cv=pass; d=google.com; s=arc-20160816; b=f4C+IyFMinisuMSu81e5EeXMNnrJpDxtyZqbT2trnfW8qrEAhu4lSmnqgh5mTIAvnb pA1ai5B9qdFBesRZ07zBoHoh0Joos9LCze7/p7MBaYDLInlh5vd6By2kkIBwu6NWG5wb WNihWZnWGd/Jn5Fg8jT5CK6DE/hJiaO33nBj3GLocVeSodDCoFy+X4l5R+iLx9aBLu1c uZ19yOOF+WiK6vHE1pk1kqxXeZ8Lp+/FXpu/aR24J33fm+Myt4GboLp/DluRfApPN95H 5q6xt0KYUpAk7YWoHTjn1SMlAxCJQNl2rlHOxFxqrJY1+0jrmE765VOeoXXPtAEMzs9O 8J7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+As+BdSTWui4elPIIC8bqg1MrbETyZFfyPddmTUd3dY=; fh=qEKL5E7JD15UcfSIPPvY251ImfHACcHzntSCDjZ9BUc=; b=PzuEuMeE2CwIwzk6ilB3+164o6hlXmdjux9/qNQWwYG+5zctL/IC5+sBm0/cMEFtsr BthtNdgdf3fNHRzqPbMifNTvq0iNSz52ZjjGurkDwYqIQ8UDs2pMIdHoPQ5GKwHaSkeI MMtZ41pY3TIZWxDuWdbgDAUxhiKnET6Mvxj73uYxJ7P3CWyM8XabUiKcuGbYkLgF8eaC DzqBmFVXtheY7g1WGHpk8E1j4jZ6FnEpPidhRSvj1B3t3n/21lFVOiC6hVUbr1vdUNRz 7NmyoPGu1cgahqTYkDXTW/gL0xI9SulmpwdhWmqgTpXUEhwK/0oGT6SffhmK07P77sRj EvNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dw2sa7Ky; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w26-20020a170906385a00b00a4429d64635si913720ejc.750.2024.02.29.13.06.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:06:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dw2sa7Ky; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-87499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A3AFF1F27CDF for ; Thu, 29 Feb 2024 20:57:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A0D315176D; Thu, 29 Feb 2024 20:41:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dw2sa7Ky" 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 13DB116538E; Thu, 29 Feb 2024 20:41:15 +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=1709239275; cv=none; b=PpGcQxJuDAqaivKLRJvh0gomhj6fAowF1FisQfnhOdIYoFEaShecZSfkaVmOd652zinwkN9WSkkHHn2w/IZxvkbXJd8oZsbSz8lOmw/sdu1fpQeHF+7Oi4uUGzLj3Qu2YUYIEGheccNYzG+fXtU85/hl9Mh8JD2WwP+BvEG5NVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709239275; c=relaxed/simple; bh=Ifa5IzyFNPy2F0ERf9CRSKVTAjr0fTtnABmLN3lY9NA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dH6OURDRgO8T2U1ORXzbI4ROK56wwJYgHK00EX2N+F5fHf6LLTNm1yRGYetLCtni6KIoinekb8WaEVi2k9JZkKs1he3IyxM4YEal9nx/dNnGiLX4Zy0yNHFnp4P8PZbaV1ntG3RwR7foHh/4OccqCCeykOSO+yaEqpwF31lAFHE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dw2sa7Ky; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63B2FC433F1; Thu, 29 Feb 2024 20:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709239274; bh=Ifa5IzyFNPy2F0ERf9CRSKVTAjr0fTtnABmLN3lY9NA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dw2sa7KyEiwYZSHA705AdTW8oDt50b4sjTY6BF1iTUYRz/kblUV063ycjG3ywSMtJ dk+BQw/xKUPwihQTvkBfvHlrUodAynliOIj5KGfibe2GTpTgx/45Z3ScE1npnwKv+a DDQ4O47zUf4/cjjzDOWKSKtbRm0I6ZgPG4vVYtXJ1TPqYWZ7IQecymeJW5jzp4rauR I+QNCbxBGLLHnYcYfInDj8VvKXERVUZvFlfvdcS2lg+aYekzULw7aY8zK1JqWbPzO4 J+fDL8BprosQE+a4LCDjp2lGjtiIPjLfAkrf7kog89h9ukaoC6Hbb0xRITLXi0agte UNIbKgNz3jzuA== 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.15 4/9] x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h Date: Thu, 29 Feb 2024 15:41:00 -0500 Message-ID: <20240229204107.2861780-4-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229204107.2861780-1-sashal@kernel.org> References: <20240229204107.2861780-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.15.149 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 4bfed53e210ec..abc6fbc3d5f21 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -787,15 +787,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