Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1477388lqj; Tue, 4 Jun 2024 02:48:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV50+UzRgaH+2aCIY82R4hA/dtmjQAi2N1xvEpx8nJSe0gOjyv+6Iu46FnuMGgQY7p62EKc2TKDNgAM+M+3C35HIsr3rlk2AEIw2HRE3Q== X-Google-Smtp-Source: AGHT+IFjrsjFrJvN0yclkcMsYSs0QDVtq6628vGwMhI/S3eUdOsJ56WhntYdtNVs/3XDEIC+NSBe X-Received: by 2002:a17:906:3917:b0:a5a:2d30:b8c1 with SMTP id a640c23a62f3a-a681fa6a8dbmr706565366b.14.1717494489655; Tue, 04 Jun 2024 02:48:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717494489; cv=pass; d=google.com; s=arc-20160816; b=xP3K180T2/ut1B+hjfCEqgg2gLkWZMvjyeMw2PSQ7kDeMiRnVKnT/EIiz0RN9Lw1Cl wm+at3UFG6NlpGLff2JPX89x7hw0BXI/HL1Q1unjWdyfNzPKoCyn+1HEttvDiNBqw4Wf oaZAX/Y2mt+FWEsNusImVGDoQ0ul4N3oWWryW/03+iRcSijVygajbIzDMGjQOCgK+1Sl d/hZKpF2CJMpis8lzfvmJhG8sYIx4NQLSCJg6dTLzI0ARfzFP2jA/7cotPVeKJkc+nGe cRypMrHnzHS7mQFT99DImlhua0rKJUkAhrnm4KJV5421pBxVz4Csfo397+pS/q6nd5qZ kQyw== 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=1o8h4WW2rkKyKPUI+a/gz6b5mzKTaMa0Q8zXDVfDCoM=; fh=457Os98TKxBaL6B/bQzglXpzIsqSDSeHi6q3fYd1dSc=; b=TmxPalyr0Gb+HP1+gOQt9Ad8n0e629dm25qCXlD2OhqFIX3kkmlWsiFtiFCfRHzG4b Dh7DoYajueVSv3EOCFthnxVdHHEnJJWTLoKyNTZDyQ8OHukGKC52/CfLKSfXvxP5Z2FG t7tP3FO8isGFJ7ngJmACBNV2bhE1kywFYpp0/aAwqhk06BSMEd1LV/9HNg0ZxcnufVsY GeIlcuCBUyQvJHQqX2YcA0OTabQjxsbZU16SXnxkJ0WY5XrWRVkiuFK5ZXJlJb99KMcA YOWpX/c/vxsnpwJRR3XK0+p3bIoC87WwgLxjxtiOciBjWi5XhlK+W4vACJ8TUNBRCiFQ JRUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=DFpQ9JUh; 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-200323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6919dac4dasi150787466b.811.2024.06.04.02.48.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 02:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=DFpQ9JUh; 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-200323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200323-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 63B581F2481E for ; Tue, 4 Jun 2024 09:11:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D467D145A0F; Tue, 4 Jun 2024 09:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="DFpQ9JUh" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 B645F145348 for ; Tue, 4 Jun 2024 09:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717492165; cv=none; b=ggh4jiE8EI2IAcN//0l88G4+IvKIm6hCufmemQoGYcYFoKMqLxfOJLoIfyBvsVbOwcCJz2VyK8FthFpQnIa7aps1uBSSN8Tp0VWeCWjtTq2hanSMuF/lBEHEGLqpnWBZCDvGuy/UsrPCOoSYsp2a5/gHC8mBTRbZQNft6XLgixE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717492165; c=relaxed/simple; bh=dlTQMSRsIpZjRzOd2Rm/WzLiyJ/xHYiubGPGAJZf/Cs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QaLNFgLdbrHcCuenbhZB/Nm6omWPfdT1WOP40oNhuKXXU5LA8l4VoyvC7DPM5tEV7PUxT0C3UvZeun3iclAWtJ8dThB71IyGLjTlsqrMX/RDVpeNbKvztGXHW2uazJ/OdNOxVpGyrxsXp9CtOzf/7gZdccEWf7wGVCB+Btrx7xQ= 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=DFpQ9JUh; arc=none smtp.client-ip=209.85.218.42 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-f42.google.com with SMTP id a640c23a62f3a-a6267778b3aso466698166b.3 for ; Tue, 04 Jun 2024 02:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1717492162; x=1718096962; 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=1o8h4WW2rkKyKPUI+a/gz6b5mzKTaMa0Q8zXDVfDCoM=; b=DFpQ9JUhBl0RMW0QGCUXj4K+RHRw1bbbX/B4wJiik5W1sFw4RQwnGk/Iw+tr6v5iue Qo3Fju+QTrvlEA4RsLCzuJ4T8XZ905S4sCGdRO4S3lW8iYbWvKhftBtm+voEDRhKjsmh UKY4QOWVqmx3dFmJlVTNHKnl/QVIy72QktpmgVj6nadHPQYlR81vj2q1iaWhm9CTFF8u 8XCwljG/dgtNquOPWVImWybnlyLJlDBpYOoxC2yeh0bEoUOK+wuS+4ONN5uWp2YmVm9y pfGZu/gn2DiFVZB6+U+5K46TfqXmIqqY/i6hNe3/843S0Pn+avShLZWu4Rvnzv3EuyTu vnVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717492162; x=1718096962; 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=1o8h4WW2rkKyKPUI+a/gz6b5mzKTaMa0Q8zXDVfDCoM=; b=VO0aX166hLEQjOHYqvgUfyBhAdy2867kFPZiIybjU77wOi9mcBN2L8GPJNGABs4jde JES7/o/pPa5nFkjvXBzcUVjv3Oh6rqFcFoIzNuosDOGEw+fQ7sN3HcEqhg2PChsyWIaF Lo/XxGFbj7RFTyKTNq2DwDqpahZQgI6lmSkKahrEInBljsjZXoNZ6zjrp8zIyUb+wS3G tMapSJF0+04192irUkoTs7tIrDeBWAHX1iIpcdPUQADEctzOv7kjEq7pXqscNa/xTg6o v8WpSNWKa07Ug4iDC8A07oplRGFwcWqjSUqqAsHMskKpZmT6SIw0DOYLj22+BKjwtqVZ fqDQ== X-Forwarded-Encrypted: i=1; AJvYcCVnoNEpKkdf98lqhB/xv8vThztvIzJnjic8PfsQmbd9ddtXnMYs8J+HCcsuSgAJi7l1iqnAHpCG+cdsKg5AvhaWYf+aPm2YD6RQSfJM X-Gm-Message-State: AOJu0YwE0pPTWpv8Ekon8IdfH6wF5yFBWi3UUEEgnH1ktOngHouw95Wx pZ851KclKAcZyRQP6/tQt3oxsrdWf2aNhNuFtvt3umebHOQcIgz2VYZI4Sj5+G0= X-Received: by 2002:a17:906:40d8:b0:a68:379d:d623 with SMTP id a640c23a62f3a-a68379dd799mr735700466b.36.1717492162204; Tue, 04 Jun 2024 02:09:22 -0700 (PDT) Received: from raven.blarg.de (p200300dc6f4f9200023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f4f:9200:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68fa49e66fsm328376766b.129.2024.06.04.02.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 02:09:21 -0700 (PDT) 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, david@redhat.com, Max Kellermann Subject: [PATCH v6 13/15] linux/mm.h: move is_vmalloc_addr() to mm/vmalloc_addr.h Date: Tue, 4 Jun 2024 11:08:43 +0200 Message-Id: <20240604090845.2182265-14-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240604090845.2182265-1-max.kellermann@ionos.com> References: <20240604090845.2182265-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 e178bda2525d..6c9089adbb4e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -1087,30 +1088,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