Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp266054lqs; Tue, 5 Mar 2024 01:02:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqxd8WjDdKgHF/wJxR8qs+FgDex935bPduyQdLJd4SrdauX8NKk3JUTLQJLZ7eOr9gAtKMJlDYWU4Jo/PfjesuGSsED7JMfy2tY0lpIw== X-Google-Smtp-Source: AGHT+IG3aXkOZ3N4Z+JPmmaGBVQfXn9xyzeYU4URrwL9kOQ86d89wMlwyntB5v7hfOk60uJ9wvGc X-Received: by 2002:a05:6214:84d:b0:68f:6f52:e7cb with SMTP id dg13-20020a056214084d00b0068f6f52e7cbmr1504952qvb.55.1709629368166; Tue, 05 Mar 2024 01:02:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709629368; cv=pass; d=google.com; s=arc-20160816; b=IbzNBdoIqPtGnWK4BYOPFWbC+lNOYT7LklAqfkgcw+wHItIv/1rDeE5RurFgaDhklv BAScw/bwZBo9yrFRr/hkPE2zEqjNBroNh1NDo+Mhs2UJeLoxa/nLlsg/BrfJ9aVvl2/g YOGM9BOnG1Kv496OC9Tv/d8mJrmZbz/y2Zr5wm8uNJN7HLhNwYkH1Z0tHvhb0EB76qB7 x9TIUvVnqT7IswOXS5mGF6Li6/5LQ8zdMw+b8ll7anzsZ/Lz4wwsWJQflS2XLpKqpsx6 CHnnbeaWrHJYwQqAjyvVE4zDTlZusDs4FIUJ9SkLYYRHwl8TkPSUbDFEbynH4VyMOqye 0MQA== 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=ATfCxZ0IifVoQF3dNCoyZLQIGDsbM/UfOW1XioKp6uI=; fh=r+U3AlPcobxlwjK8WlEWD3xt8A4fV7N3e9/EdI6a3yE=; b=Bhqw0TpQkFGljaPNCPm1PYAXpvIkdSgzFJpqq26pIKir0NDg1286Nc17UDBswZ+ZeD S8yRAd4p4HeFLu670rn7EXrDuLoWdIW32p+vCmKwJqEi7AwpRv/NHQdtF/+c9xdNiJ6l VqdPOiqS+cY17//LkRASUvvvTmho6ynQGIMOoFcYm9BwDfiGc1iknGMicrsK9qmVJCQQ F9ts4Fc0oQ6OIlWYxder/51q/UU2M0aO91wy+9pI2Bx5cdpEDN5H3IKqzvOHB0qaUHgr tHy17nK55xh/hxdOEf9w00kjfYiUGvoT28riXSw0IyCsxYBQ/NtF/ngJ2stsPjgOCpjI NVKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=aqs8qV37; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-91944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 4-20020a05621420c400b0069077431257si4183280qve.209.2024.03.05.01.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 01:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=aqs8qV37; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-91944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D0E341C20A67 for ; Tue, 5 Mar 2024 09:02:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11FC057867; Tue, 5 Mar 2024 08:59:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="aqs8qV37" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3796356460 for ; Tue, 5 Mar 2024 08:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709629192; cv=none; b=Ruk+fTGnDPsGaKZojg1r5x3MEJEpCmtWSZ9vy9K9Wt+bLlBTl9+dEwRACEKIWE/c81CnIPkUr4txWiDTu0wKMZhRs9Ndszq0EtWTqpqD+f9SnogEIoxp7qsmZDXhz4DF5ltyPNhIm33m7l0zlX+20fCmTNTL4HvfYw++dZuV1SI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709629192; c=relaxed/simple; bh=1xnF40lCeTl2Fq3HZQkpBaNZnb2sADMKOS6Vo+/oJd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TzI5VE+6V/LwXMLcNTnzotTR3ywe9AEZrgsfHuyD/zZfxtmZPlKq4AAYKQLH7EGJKnYhYs/A/SRL6GFzPvBisRhZ0L8oSUbTKtrypfCvFo3VcvfKYbQyax5APfGHarOWTRDQIZj7NeUoGYnZ2iEfQ3rYhlPnvMBR2U51rxpK9U4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=aqs8qV37; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a4515f8e13cso257818266b.3 for ; Tue, 05 Mar 2024 00:59:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1709629188; x=1710233988; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ATfCxZ0IifVoQF3dNCoyZLQIGDsbM/UfOW1XioKp6uI=; b=aqs8qV37FpCFMqI/Pldi5QH437/ldcX2Komg1hjfA3+ZQscJ9XQ1sxFEqlPVPR2WDh cXEqJbnlWT9gTuXPeiMVtx97lqk/G8XxA3R/SSr8k0zZa84RCByLDoOfNKXfabLtL08y j3KamnTueYRx7xvWT0I29Kf7Y2RFxBr50djrkMtDU1AteUDFD3TTNj0Ea2g/vnKq3q4B j4rzZKsQb6gfK7iBRqt0pcVMDdq77irrlWcwqNu1wyRsCQ5HxVoN/VXdeirdWmSzarqT HbNOrdse409ai15OsqNll40J2b1EdjQo8T1cj5N9pTmQu5AQxw0l7XLV0qi1gmX1HxTf 90Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709629188; x=1710233988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ATfCxZ0IifVoQF3dNCoyZLQIGDsbM/UfOW1XioKp6uI=; b=nd/pdMWBgjiemT1+GmpbbNFs1rnvByCY1UiBNrhr0UcDbsfkwMmWdoPBCThfRiGloH NVtUrYql0X4tcTBZQZ3FAkgcpkxqzlqBpgGhuV6PzLqd0TanxB8U+UBcF0YI/4CpOhSU paIaRTbs8lPLlqmX316nMzpDG03uRRM7RsugR/qTsf/sjyZxt3YNxy7hOOHPNavcGNOp KEGbxmJEQ+Lfe+YncZPJFnUvokV4D/1r59sp6Jnh56z3KiuArzwEjWBM6xRMcGRi4X+3 Ef7FwXbpfo0IhAVnYTr+I2mTUm87KqV/D14AkL3P/k77n3nXaLBGUXNIcmViAHzTkmdP q1gA== X-Forwarded-Encrypted: i=1; AJvYcCXNEj2BQPyhTmex4NDQnThi907nvGgnlEnHlNX3YohuXMBSzfqhtX6wmtTt5vD4uZRl42p2z5O849let6owaeAgSWiOWNtURq9jSJ+A X-Gm-Message-State: AOJu0YyS26vTqvH+4lOem2B7WDphYYGwtQKH84hYaFIBpfgqbnCdfVG0 oWJXs57sFxupND9UuUU6COfa+IqBvVb88S9aX+zyZ7+2L+UTsLtzuxlBglwM2rs= X-Received: by 2002:a17:907:20d9:b0:a44:1b98:1829 with SMTP id qq25-20020a17090720d900b00a441b981829mr8277971ejb.57.1709629188722; Tue, 05 Mar 2024 00:59:48 -0800 (PST) Received: from raven.blarg.de (p200300dc6f010900023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f01:900:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id gs4-20020a170906f18400b00a449d12cdc5sm4453005ejb.119.2024.03.05.00.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 00:59:47 -0800 (PST) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, sfr@canb.auug.org.au, Max Kellermann Subject: [PATCH v3 12/14] linux/mm.h: move is_vmalloc_addr() to mm/vmalloc_addr.h Date: Tue, 5 Mar 2024 09:59:17 +0100 Message-Id: <20240305085919.1601395-13-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305085919.1601395-1-max.kellermann@ionos.com> References: <20240305085919.1601395-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is needed to eliminate linux/dma-mapping.h's dependency on linux/mm.h. Signed-off-by: Max Kellermann --- include/linux/mm.h | 25 +------------------------ include/linux/mm/vmalloc_addr.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 include/linux/mm/vmalloc_addr.h diff --git a/include/linux/mm.h b/include/linux/mm.h index 07262ae43c5d..80fc7df2856a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -1086,30 +1087,6 @@ enum { int region_intersects(resource_size_t offset, size_t size, unsigned long flags, unsigned long desc); -/* Support for virtually mapped pages */ -struct page *vmalloc_to_page(const void *addr); -unsigned long vmalloc_to_pfn(const void *addr); - -/* - * Determine if an address is within the vmalloc range - * - * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there - * is no special casing required. - */ -#ifdef CONFIG_MMU -extern bool is_vmalloc_addr(const void *x); -extern int is_vmalloc_or_module_addr(const void *x); -#else -static inline bool is_vmalloc_addr(const void *x) -{ - return false; -} -static inline int is_vmalloc_or_module_addr(const void *x) -{ - return 0; -} -#endif - /* * How many times the entire folio is mapped as a single unit (eg by a * PMD or PUD entry). This is probably not what you want, except for diff --git a/include/linux/mm/vmalloc_addr.h b/include/linux/mm/vmalloc_addr.h new file mode 100644 index 000000000000..86ad2dc94960 --- /dev/null +++ b/include/linux/mm/vmalloc_addr.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_MM_VMALLOC_ADDR_H +#define _LINUX_MM_VMALLOC_ADDR_H + +#include // for bool + +struct page; + +/* Support for virtually mapped pages */ +struct page *vmalloc_to_page(const void *addr); +unsigned long vmalloc_to_pfn(const void *addr); + +/* + * Determine if an address is within the vmalloc range + * + * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there + * is no special casing required. + */ +#ifdef CONFIG_MMU +extern bool is_vmalloc_addr(const void *x); +extern int is_vmalloc_or_module_addr(const void *x); +#else +static inline bool is_vmalloc_addr(const void *x) +{ + return false; +} +static inline int is_vmalloc_or_module_addr(const void *x) +{ + return 0; +} +#endif + +#endif /* _LINUX_MM_VMALLOC_ADDR_H */ -- 2.39.2