Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2534011lqp; Mon, 25 Mar 2024 01:29:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGsYkfgQwn7ak0EG/PJqriFXIgEhoG7XHpk23JxOSYm258YHSnpmKMFlxupkcmEfhlc6wdt46VttHxfHWza+99nCQmNshnDUdpWZlF3g== X-Google-Smtp-Source: AGHT+IEiaLbJkGXXcevhsEBBw4568H0j9C0vJuOGrYievzGx6JNXBGFdsKoD+KZwV4MLEAXEIKH4 X-Received: by 2002:a17:90a:5209:b0:29b:9f14:e18e with SMTP id v9-20020a17090a520900b0029b9f14e18emr4169130pjh.40.1711355365383; Mon, 25 Mar 2024 01:29:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711355365; cv=pass; d=google.com; s=arc-20160816; b=k8DkEV3TKYlVCcEN7F0SCJnRAsdazslNYOs+93toK5y1wcAQPifBFE3M3ypaC35FTN lbhFDXuFEL6HR6Btcm2YJ9CKGtL34IcQSxFdlaY4apkj9o9fXkc1OzE5Q+NO4YIQgRGy M1FUp2UoI9c0LRrmYMyrAeMwLheWI+ZIj/pK2v7t9f0Rf8CHm7bD3qCYdE+UrQIOXRGR pQKHO7lGFV8vGLgvHf6P+kPZ/hslU/JNgoIf+7kGf0KmF+bZ588met4+2uTHYG9nfW3n Jm2ZxXaisX8vAVGKfvRCjT1MKh2pbaRK7ip3lZMsH812BfH6tMVu4dJIE9Knoq4KiunT FwMA== 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=XFDDF1Gc/BgffkMm2SKx4iv0cg9nIgjpsC2SmeaRReE=; fh=YNsMpTj6GFuCFxCU4B36SHOcGahCVQTlNhXSeS+/Q9I=; b=jjcO4oGaUUHbnNyxxDaJpDADnqwuEIzNWjri7h0m2wIqCVtH+Qfo8yHb4oVaHU3YfI B5RahctxJxjtGC4kvezQB8NHvZ+AB1RD0+lXBbuOtWl7C6LBqBx5eAkz+BcV0dGijYiS 9qXpdAivKwtb2kpDDnDWmABSs+ZElQXQVKDE20V8BVYI04YrI8jflriGc6+AqRNzJvxF xKdFSU/uxWZtuC0F0y4TF5ME/1dKqShsr3Oqyh/fdLNeHiAC/eY0dkeRjw/d546JPle7 NNmmCpMfe5XkdAqFUSRMrzWLR7ztNlE0DVghKvGqdjNUWjfAm5syMYIoO5sbvSZi/2rc JKww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lOVPCnNS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ci19-20020a17090afc9300b002a029fe52b0si7938000pjb.134.2024.03.25.01.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lOVPCnNS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115767-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C9061B28F0B for ; Mon, 25 Mar 2024 08:04:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B36BB2618EE; Mon, 25 Mar 2024 03:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lOVPCnNS" 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 5A8E61448F2; Sun, 24 Mar 2024 23:12:41 +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=1711321962; cv=none; b=Ad2FkTcdSvv+7/e4l63Z37/YyOm1p4DbaYi2DTrr5UpNhCyFZzOaxuYm69WkmzjyKrvtVuUQ1qG0KaxmgDpi35CpWjQbsMY9IMWJMIJks21m8CujWL+2UEgMjxMUoamX3ms6o890So9lF1F8K1wJCtkil9QNCW6oBD1hoqfYtko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321962; c=relaxed/simple; bh=kEhPTZIPEr2oYN3WqCLLgUWERIFeS4Dajodq0P0U8eA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nwl3eAjd25JJF1zIUpPChQWZ5Cuv/YU7zH7rRcFZk+NCiCcfwMKVBJ7RH9d5SMenSYcIi8+bWZR/x+6lJAuVBFmODicvrNJWY2r8QGCijsVMcX04keiOhwmGt37+n6oiYQGtVs0UHd+XbpBuEf56b5NB/QNf1PNaV5Ge1Jvn7gE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lOVPCnNS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A24EC433F1; Sun, 24 Mar 2024 23:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321961; bh=kEhPTZIPEr2oYN3WqCLLgUWERIFeS4Dajodq0P0U8eA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lOVPCnNSq/8l+jNPerqLvzkU5wk/0qlYkDexxehqG2dzUKoUSA5V111DAM3uXaMkn I4tm5/T1rGDZbpJdrL8kbuw2D+4SyybID5+sRKTCROMfKzl/jJk+hExz5oFW6AzYWk deKygd0YS2vffZWGKZdp1guXz08vLXahCJ2eteYy/UjuYD9EVeNKbKAVUkYN7y8/l3 9xE0omwE/KJaqz9dx6O2+rpN4zENYofW30z+I3RBazqGPAXhHxb1mwSQcwNdEBfTE5 oa17NqkgJ9kvsvFHlIaE35F5KY9gw1aL1bb1P4/3VLDk9GNfLSyz7k2mM51vOvz4iY C8rQKiMUyoAuQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hou Tao , Sohil Mehta , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.1 033/451] x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h Date: Sun, 24 Mar 2024 19:05:09 -0400 Message-ID: <20240324231207.1351418-34-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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 1dbbad73192a1..f20636510eb1e 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -818,15 +818,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