Message ID | 20240305030516.41519-1-alexei.starovoitov@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C7A2C48BF6 for <linux-mm@archiver.kernel.org>; Tue, 5 Mar 2024 03:05:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F2E66B007E; Mon, 4 Mar 2024 22:05:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A3C36B0081; Mon, 4 Mar 2024 22:05:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 043A16B0083; Mon, 4 Mar 2024 22:05:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E84F76B007E for <linux-mm@kvack.org>; Mon, 4 Mar 2024 22:05:22 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BCD9D120479 for <linux-mm@kvack.org>; Tue, 5 Mar 2024 03:05:22 +0000 (UTC) X-FDA: 81861494484.15.BD3F417 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by imf26.hostedemail.com (Postfix) with ESMTP id EFD5E140003 for <linux-mm@kvack.org>; Tue, 5 Mar 2024 03:05:20 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LBiZznMR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709607921; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=GO37OSQRQXlN2VGFyW6LzwjH/NpS/PSzwjkGcO70oKE=; b=EdywZbltTlfd2PG2DqKaoEIuAmWATx/NZgj+zLlvHegXsDGBRVyEitSPqV9TE3aC275T/S hDe7SqZE5WTBU3xkOzNkYpkyMMgwehhLKGaJCLnFSgeePGxc7t9zq5xKUWHpmx8bDBOO6/ m2IuJTc0EWIGstrGPCvMT4c+rl2m+Xw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=LBiZznMR; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of alexei.starovoitov@gmail.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=alexei.starovoitov@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709607921; a=rsa-sha256; cv=none; b=a+3YLNIaylN+O0ZR8QNnaS3tYfnThculSrM/0eNGDira4G1zbdUUdzwe45XQguvZLw55N/ WMli2SnqOu4b23vwY5l+6iklY8MV6NU1J6d5l85gbcwH20yuYIMJLeMLboYIWYno6gLmCt 8/SksW1UMYyTlp1cKQlRvft3X9VARtQ= Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6e4de6fb7f9so1834668a34.0 for <linux-mm@kvack.org>; Mon, 04 Mar 2024 19:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709607920; x=1710212720; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GO37OSQRQXlN2VGFyW6LzwjH/NpS/PSzwjkGcO70oKE=; b=LBiZznMRhgiHQPFrx4Y8RvnvLdFgdesKzJZNawgO9ybtAGJqnw5JBXhkwFE+VtTmQQ qAXg7FOlkG6dwFvvR3cgazztcS3mP/PEUQ1AtPEPXv47S50AGks8PXGaKCLfTYouwiP6 L/2m8NSmOOkX5Oo7XPfWkxX6R7/lfTEX8933TLxM1EvJUxfkyXTNJSMWBj7uD0gJMvFV 0Hj0lO1tfx2b2yXOH4kO4tl76nDQCSKgscPbs5kGuWh+qBwgjRTH/dqPld/dJZ8YHmLk oasFXJDTKJLZWixDWmaGFtywObZMhal3Qkh4mx0x4iv3H1aoU5z6+5dzPJxXZQeiHxBC xsoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709607920; x=1710212720; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GO37OSQRQXlN2VGFyW6LzwjH/NpS/PSzwjkGcO70oKE=; b=Ec7EqGOL5WW0sEz2VSdzriCgR621KzZAp3A2g+51Ot/fVBOlIELkAbw7wdIbYnOjkl mDLcRowXHbEfM6TUavdWia3jX43zM97dkcUioHwlw6X7IJDVLMmqtySlMe2k7pBG/L48 m0UaPVUN86ZNtvpRRWFeIuHfFxRZ7ScscG/nYfPguOElolEw8+adZ+N7XOM6KuSOkC+1 1dleROoVKYa4XWRK4FJoCAi08Gv997K6ALZh8YADcsZd6C20W9vuxQBU/C2S0EFVjfcT ztsqV/5una7HsHoGJl49biV6FgTJa5ZY/QSk/RyN5eV622m+obJ2ITaANsuFVCDt+Hx4 521w== X-Forwarded-Encrypted: i=1; AJvYcCVsBCaf860pUWgsbrK+KKzczDhOZeXp/b6R2/enZnj4H8n8gA14o26rjDNfoEk2ym2Agi2Z6XHoutpb1sRYvkVsvjE= X-Gm-Message-State: AOJu0YzcklU8rc5jQA1/FJgrin+XWMt4VX0Z9t84AqKGS45g9gPXdDPc lclXcUyaJA7vv9p+QoX7aylXJrwx6AUXG+RwmCvxqMI6Ik59/6Uj X-Google-Smtp-Source: AGHT+IF4DC0r95WIbRC/5og05/9WKTnTnsPpk3e37OmDlc5CQCogzBPB5agJQ7Ifv5VhRu3af2p6Pw== X-Received: by 2002:a05:6870:898f:b0:220:99bf:c26d with SMTP id f15-20020a056870898f00b0022099bfc26dmr589777oaq.9.1709607919882; Mon, 04 Mar 2024 19:05:19 -0800 (PST) Received: from localhost.localdomain ([2620:10d:c090:400::5:9426]) by smtp.gmail.com with ESMTPSA id y15-20020aa7854f000000b006e5a99942c6sm6822695pfn.88.2024.03.04.19.05.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Mar 2024 19:05:19 -0800 (PST) From: Alexei Starovoitov <alexei.starovoitov@gmail.com> To: bpf@vger.kernel.org Cc: daniel@iogearbox.net, andrii@kernel.org, torvalds@linux-foundation.org, brho@google.com, hannes@cmpxchg.org, lstoakes@gmail.com, akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org, rppt@kernel.org, boris.ostrovsky@oracle.com, sstabellini@kernel.org, jgross@suse.com, linux-mm@kvack.org, xen-devel@lists.xenproject.org, kernel-team@fb.com Subject: [PATCH v4 bpf-next 0/2] mm: Enforce ioremap address space and introduce sparse vm_area Date: Mon, 4 Mar 2024 19:05:14 -0800 Message-Id: <20240305030516.41519-1-alexei.starovoitov@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EFD5E140003 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ngd15iy84sjjnkt4cwbqi8y64ezf5was X-HE-Tag: 1709607920-230325 X-HE-Meta: U2FsdGVkX19giWHfvS/41syxLyMsrjoW7EwQoMEeYAb9TMpfbOrgMW6MNcv2g4+vorGD6KxCy20SWuweMop7NLVJPm3v9n8ogaHMcBYQl0eCTV66altf/SmwS6G8LclVFNXxWOPvSU1WpppATDsuOjtVRvyRXOXAtypzus5+Imbs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MsZy2FT8HiTKL2ptDdfSQHN4oae++rwASlHcxXAOOI1T8xOErPZUNyB0JLZyGY+zBnHb40qC/FlihRGH1+87iSMCRZ7/gFyVO55+kjA09AeZrcaUUhlotoDJ1tsCe+vZfhkOY9reDljKGlOTvvO4LS8XdSdn+Q6M5a2lVBqRbF4a/qrGMBV8A9hHdn7eG42Vbm1pHqbYMdWRWe1aH3xYT3ZNEgBQSYq+03lAK5BWqAoDVFRI/ixeVVeRSkwrkwIgZd/ByThnf5BLSZGW9Ff5AE6GUTRn1UQiFnlnvb0vykw2d0pNVq3d/jPuD5W9VOPaO4cuShKLcO3iRy2sO4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: Enforce ioremap address space and introduce sparse vm_area
|
expand
|
Hello: This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <andrii@kernel.org>: On Mon, 4 Mar 2024 19:05:14 -0800 you wrote: > From: Alexei Starovoitov <ast@kernel.org> > > v3 -> v4 > - dropped VM_XEN patch for now. It will be in the follow up. > - fixed constant as pointed out by Mike > > v2 -> v3 > - added Christoph's reviewed-by to patch 1 > - cap commit log lines to 75 chars > - factored out common checks in patch 3 into helper > - made vm_area_unmap_pages() return void > > [...] Here is the summary with links: - [v4,bpf-next,1/2] mm: Enforce VM_IOREMAP flag and range in ioremap_page_range. https://git.kernel.org/bpf/bpf-next/c/3e49a866c9dc - [v4,bpf-next,2/2] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages(). https://git.kernel.org/bpf/bpf-next/c/6b66b3a4ed5e You are awesome, thank you!
From: Alexei Starovoitov <ast@kernel.org> v3 -> v4 - dropped VM_XEN patch for now. It will be in the follow up. - fixed constant as pointed out by Mike v2 -> v3 - added Christoph's reviewed-by to patch 1 - cap commit log lines to 75 chars - factored out common checks in patch 3 into helper - made vm_area_unmap_pages() return void There are various users of kernel virtual address space: vmalloc, vmap, ioremap, xen. - vmalloc use case dominates the usage. Such vm areas have VM_ALLOC flag and these areas are treated differently by KASAN. - the areas created by vmap() function should be tagged with VM_MAP (as majority of the users do). - ioremap areas are tagged with VM_IOREMAP and vm area start is aligned to size of the area unlike vmalloc/vmap. - there is also xen usage that is marked as VM_IOREMAP, but it doesn't call ioremap_page_range() unlike all other VM_IOREMAP users. To clean this up a bit, enforce that ioremap_page_range() checks the range and VM_IOREMAP flag. In addition BPF would like to reserve regions of kernel virtual address space and populate it lazily, similar to xen use cases. For that reason, introduce VM_SPARSE flag and vm_area_[un]map_pages() helpers to populate this sparse area. In the end the /proc/vmallocinfo will show "vmalloc" "vmap" "ioremap" "sparse" categories for different kinds of address regions. ioremap, sparse will return zero when dumped through /proc/kcore Alexei Starovoitov (2): mm: Enforce VM_IOREMAP flag and range in ioremap_page_range. mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages(). include/linux/vmalloc.h | 5 +++ mm/vmalloc.c | 72 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 2 deletions(-)