Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2574196lqp; Mon, 25 Mar 2024 03:09:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXImeg2QDSWEwFRdFe/Cw/URFuUKiLApnYD44Y6h6SJprcaFBEaDDt8d27KEFZidDwYeuA+8yNgcW26v/M5rn0nkeLcP8XmAHP7icykTg== X-Google-Smtp-Source: AGHT+IEg/H9ZR0OmFfzYSTPp/xLJlfnygNp6Fw60jOz/smlYGMR5/pe4lyJcwQ/BbpdwtGLrpqx3 X-Received: by 2002:a05:6870:a11e:b0:21f:9f09:b0de with SMTP id m30-20020a056870a11e00b0021f9f09b0demr6527565oae.41.1711361398062; Mon, 25 Mar 2024 03:09:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711361398; cv=pass; d=google.com; s=arc-20160816; b=eoVvMTzB895uU3H0ZY/tV97xAmV4tFmHI8Cl5nruaILUAHX06QH3oZzNBgX0hxc1tx Bnb+CyQ0TzldDoBiQWNzN9ci3Fzp+RNxGYPCx12BGdN+/pln2jNzxSBwP6hTOsSKYJm1 s9jBFPgYAI20zlrhXk0l6GVI2zin0gw2R9Y1TDT9AP7iTSmTnOCTZnfOGscg1VLp0KA1 WxhZVG4JrzgzYjDw2GI0bZekjIvyEL4FhqKgThFCq5apQKUE6jZqA/dYU1IveLLvIGck EyFgr4MEQ6Qmr4NNg5DHafdTo1V55ZPfNZoZ9ZQdA4at9vwQ0n3D0IQC0JG2oWHDlh7R YB9w== 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=RutwKImFs1q6XJLE1fqRFh7Kv3/II9wcbZjUBjBWUms=; fh=YNsMpTj6GFuCFxCU4B36SHOcGahCVQTlNhXSeS+/Q9I=; b=o0XSKwF8LTMeUwSnw9ofAYEykWnevW/htw4CsEpaOGH4+P8lLqhyRRheW4W/ar4EW3 vbgMseO1bFp8U1DdHmKE/cQ4F+QSKurKxn6tY4KP2Np0pAALvVVlq9sBV0OM2U/33Ry9 QqSP41+QgFqYdjSQXWSkfh77ZDx7xU6wEvd02hc0RR6T6Tbw1taoIpvWfmJnjmX+1iBP zg+ZNsIF8O99PoDc9qnMuoZBWl9+lAv/BROrnRhOY5a3xY2w0Nmrc1TBLMeC98Sy+YX3 xYaKp86jMiWYZABQ0ucTIr8CXvYy7DWLyiKFxZik/buzHIxpP1z0y6ZXFRHd3JC/rHmd CUIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/9nmAoR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116119-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j18-20020a056a00175200b006e795688a84si4812503pfc.261.2024.03.25.03.09.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116119-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="d/9nmAoR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116119-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116119-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B39CA2C24C3 for ; Mon, 25 Mar 2024 10:09:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFFB33ABE9A; Mon, 25 Mar 2024 03:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d/9nmAoR" 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 E12C2178CD9; Sun, 24 Mar 2024 23:40:42 +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=1711323643; cv=none; b=XQrVe1FrkgOnnpKecKVxe4bc3BsVuAxmA4Fa3jJYpA6fCy0CFrJn2q855KuNORIdM8oVttkuUcGoVVWmm7UkcVNd891LrkCDJzmBY6OKb+UeVuYMTNVWVV9D97bKNuPY8VmYD7Mbu4spZ3rYhO+VOx+q2AU0+Sse2eeloJ1DaVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323643; c=relaxed/simple; bh=HwmkPfGefzMCAlIIte66Zo11gpIVH+oat9lMPqJVMGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f8dINjZ0f4rl6OGFuzF9ofwRkxQPqq+yKgCkehZOkokUd3ebKnykRBQKtPOgIm1oONLG5cQB5WNF/HBSaaZtgDbqCYfGc+T4priileseZmBrR+nlmPwk8J3aVviBYIOrZEeq11fFwu4l7bobl9c/dSk+5/n+y0At7bK+d53iFNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d/9nmAoR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 131E9C433C7; Sun, 24 Mar 2024 23:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323642; bh=HwmkPfGefzMCAlIIte66Zo11gpIVH+oat9lMPqJVMGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/9nmAoRmZZz0xnhLEIoXXe2ZF0YaKZqimfWD0aCfd7tTsdVHrxW5beCQytTKJDbo EkBX3EVNBh8GqPfepUQZnqD6s5CeRyz5Qs69LxrPECWrq4SPCfm/wG2uLENxMMlBQ9 Ub1HeKR6sZYxqp6WEN7urjhgNWE5ZBPQ9uFJMyFEePKzAwNLt3Ty6mR+0HjXd6dCkK q03/AuHhAoWoUgecDw4z6sjeskPGCD556k0g4zLWlb8ewrkgZ7QdoNokidJeQsV01T rRuJ626++4bh6NjYB7iPgddini5vXbW7galFwOspzwihL/VkbRSxtN9E+vKC2i9vcy E43k3mu3W+6kg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hou Tao , Sohil Mehta , Alexei Starovoitov , Sasha Levin Subject: [PATCH 5.10 014/238] x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h Date: Sun, 24 Mar 2024 19:36:42 -0400 Message-ID: <20240324234027.1354210-15-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 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 9c1545c376e9b..cdb337cf92bae 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -781,15 +781,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