From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F0038D15D8C for ; Mon, 21 Oct 2024 13:28:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AD966B007B; Mon, 21 Oct 2024 09:28:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 236366B0082; Mon, 21 Oct 2024 09:28:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0885D6B0083; Mon, 21 Oct 2024 09:28:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D845C6B007B for ; Mon, 21 Oct 2024 09:28:00 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A6914A1A41 for ; Mon, 21 Oct 2024 13:27:32 +0000 (UTC) X-FDA: 82697687058.26.7B5C57D Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf04.hostedemail.com (Postfix) with ESMTP id 1BBA440008 for ; Mon, 21 Oct 2024 13:27:38 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=OKvvnKP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qnEnoj8r; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=OKvvnKP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qnEnoj8r; spf=pass (imf04.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729517127; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=G7gAfTqe8Y6GkQHJQt0MI1Q6FEh0/QLzoAxcXHddb+A=; b=EeeEUS0fFJM/U++ilkd+2JXJDqz7dsndTmQbGh+X12REtrjifVOs3jXdoEYgxfdxKAv/B6 0MptFijURxXcTCuiktwyj/Vw94ovg1CEq7f2eqhuG5a8xEFPEoG2YbzWnqlFldoR7H4M3S gwXyjgA/c0vqhs1SmsFgT/gjNEhqqXk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729517127; a=rsa-sha256; cv=none; b=c04/XpCBc9qZMwb4IAUEZ5s/SsGM26/vhEQcy2rFdZY+T9WHdluQ6O82Yvutnm7cxa0bPN yZILH5enBIo6H/TPVP+r3t1cGQ7RmvemqoldbXI3XZ0I4fkrf6sQAjDKb+U2TtJbkYXs6S NJU8qW0oj69R5jHc7b2HeCN4zrcYaOE= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=OKvvnKP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qnEnoj8r; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=OKvvnKP0; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=qnEnoj8r; spf=pass (imf04.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.130 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2F27121C5E; Mon, 21 Oct 2024 13:27:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1729517276; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=G7gAfTqe8Y6GkQHJQt0MI1Q6FEh0/QLzoAxcXHddb+A=; b=OKvvnKP0sW12DzMi+RdBLuzZl/Is5e0RSf7dEWkp82OR03vobm/3RnnF23M+8TY7fvxSWq a+ImbwmEI76AyNI+jhum5qZ6oazLmWVwjpPDlWb+ApfXulM2Quyaa27H1IR87ogIfeCQnh 7kZ1iUJtBImedS2DwsRWm3RASnhIOHo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1729517276; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=G7gAfTqe8Y6GkQHJQt0MI1Q6FEh0/QLzoAxcXHddb+A=; b=qnEnoj8rj4o/C1l+47nBYHehDfdOTo3sRt8FfZrFalIAuCMhnA9+SbI0RbZ1u6zyHNG+aX 31ex0uimjoVrJlBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1729517276; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=G7gAfTqe8Y6GkQHJQt0MI1Q6FEh0/QLzoAxcXHddb+A=; b=OKvvnKP0sW12DzMi+RdBLuzZl/Is5e0RSf7dEWkp82OR03vobm/3RnnF23M+8TY7fvxSWq a+ImbwmEI76AyNI+jhum5qZ6oazLmWVwjpPDlWb+ApfXulM2Quyaa27H1IR87ogIfeCQnh 7kZ1iUJtBImedS2DwsRWm3RASnhIOHo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1729517276; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=G7gAfTqe8Y6GkQHJQt0MI1Q6FEh0/QLzoAxcXHddb+A=; b=qnEnoj8rj4o/C1l+47nBYHehDfdOTo3sRt8FfZrFalIAuCMhnA9+SbI0RbZ1u6zyHNG+aX 31ex0uimjoVrJlBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C0265136DC; Mon, 21 Oct 2024 13:27:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id VmYXLttWFmfLQQAAD6G6ig (envelope-from ); Mon, 21 Oct 2024 13:27:55 +0000 Message-ID: Date: Mon, 21 Oct 2024 15:27:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] mm: pagewalk: add the ability to install PTEs Content-Language: en-US To: Lorenzo Stoakes , Andrew Morton Cc: Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , "Paul E . McKenney" , Jann Horn , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E . J . Bottomley" , Helge Deller , Chris Zankel , Max Filippov , Arnd Bergmann , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-arch@vger.kernel.org, Shuah Khan , Christian Brauner , linux-kselftest@vger.kernel.org, Sidhartha Kumar , Jeff Xu , Christoph Hellwig , linux-api@vger.kernel.org, John Hubbard References: From: Vlastimil Babka Autocrypt: addr=vbabka@suse.cz; keydata= xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+ 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSBWbGFzdGltaWwg QmFia2EgPHZiYWJrYUBzdXNlLmN6PsLBlAQTAQoAPgIbAwULCQgHAwUVCgkICwUWAgMBAAIe AQIXgBYhBKlA1DSZLC6OmRA9UCJPp+fMgqZkBQJkBREIBQkRadznAAoJECJPp+fMgqZkNxIQ ALZRqwdUGzqL2aeSavbum/VF/+td+nZfuH0xeWiO2w8mG0+nPd5j9ujYeHcUP1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go9wJXsbWhGWYO7mD 8R8mUyJHqbvaz+yTLnvRwfe/VwafFfDMx5GYVYzMY9TWpA8psFTKTUIIQmx2scYsRBUwm5VI EurRWKqENcDRjyo+ol59j0FViYysjQQeobXBDDE31t5SBg++veI6tXfpco/UiKEsDswL1WAr tEAZaruo7254TyH+gydURl2wJuzo/aZ7Y7PpqaODbYv727Dvm5eX64HCyyAH0s6sOCyGF5/p eIhrOn24oBf67KtdAN3H9JoFNUVTYJc1VJU3R1JtVdgwEdr+NEciEfYl0O19VpLE/PZxP4wX PWnhf5WjdoNI1Xec+RcJ5p/pSel0jnvBX8L2cmniYnmI883NhtGZsEWj++wyKiS4NranDFlA HdDM3b4lUth1pTtABKQ1YuTvehj7EfoWD3bv9kuGZGPrAeFNiHPdOT7DaXKeHpW9homgtBxj 8aX/UkSvEGJKUEbFL9cVa5tzyialGkSiZJNkWgeHe+jEcfRT6pJZOJidSCdzvJpbdJmm+eED w9XOLH1IIWh7RURU7G1iOfEfmImFeC3cbbS73LQEFGe1urxvIH5K/7vX+FkNcr9ujwWuPE9b 1C2o4i/yZPLXIVy387EjA6GZMqvQUFuSTs/GeBcv0NjIQi8867H3uLjz+mQy63fAitsDwLmR EP+ylKVEKb0Q2A== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Stat-Signature: 68c4q6n3d5spuqm57r8xhejb3ux9n95x X-Rspamd-Queue-Id: 1BBA440008 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1729517258-987613 X-HE-Meta: U2FsdGVkX1+m9G1GWSJYQA9XhYshQ3IXYhXYUyeDR6IV+8R5B5kqfpUvygCTjeD0PqOke/KRBgu2ar4nlDfo2YUQuCFyW+1YfbBYuwZ2a06qD3vlmG2XvIytk35RbxplkZVwlVSretJqN2bIbMMbSvm3YsP9inyGpAwiKMc/8kXMH9VBZHOJDqnwhONhfs0p1lmyuNn+MXCkzxXL/MNU0BVrKfdhJB9KHA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1JwdKSucKRIJhHd9cMjiwW8fXrvH3UcA== 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: List-Subscribe: List-Unsubscribe: On 10/20/24 18:20, Lorenzo Stoakes wrote: > The existing generic pagewalk logic permits the walking of page tables, > invoking callbacks at individual page table levels via user-provided > mm_walk_ops callbacks. > > This is useful for traversing existing page table entries, but precludes > the ability to establish new ones. > > Existing mechanism for performing a walk which also installs page table > entries if necessary are heavily duplicated throughout the kernel, each > with semantic differences from one another and largely unavailable for use > elsewhere. > > Rather than add yet another implementation, we extend the generic pagewalk > logic to enable the installation of page table entries by adding a new > install_pte() callback in mm_walk_ops. If this is specified, then upon > encountering a missing page table entry, we allocate and install a new one > and continue the traversal. > > If a THP huge page is encountered, we make use of existing logic to split > it. Then once we reach the PTE level, we invoke the install_pte() callback > which provides a PTE entry to install. We do not support hugetlb at this > stage. > > If this function returns an error, or an allocation fails during the > operation, we abort the operation altogether. It is up to the caller to > deal appropriately with partially populated page table ranges. > > If install_pte() is defined, the semantics of pte_entry() change - this > callback is then only invoked if the entry already exists. This is a useful > property, as it allows a caller to handle existing PTEs while installing > new ones where necessary in the specified range. > > If install_pte() is not defined, then there is no functional difference to > this patch, so all existing logic will work precisely as it did before. > > As we only permit the installation of PTEs where a mapping does not already > exist there is no need for TLB management, however we do invoke > update_mmu_cache() for architectures which require manual maintenance of > mappings for other CPUs. > > We explicitly do not allow the existing page walk API to expose this > feature as it is dangerous and intended for internal mm use only. Therefore > we provide a new walk_page_range_mm() function exposed only to > mm/internal.h. > > Reviewed-by: Jann Horn > Signed-off-by: Lorenzo Stoakes > /* > * We want to know the real level where a entry is located ignoring any > * folding of levels which may be happening. For example if p4d is folded then > @@ -29,9 +34,23 @@ static int walk_pte_range_inner(pte_t *pte, unsigned long addr, > int err = 0; > > for (;;) { > - err = ops->pte_entry(pte, addr, addr + PAGE_SIZE, walk); > - if (err) > - break; > + if (ops->install_pte && pte_none(ptep_get(pte))) { > + pte_t new_pte; > + > + err = ops->install_pte(addr, addr + PAGE_SIZE, &new_pte, > + walk); > + if (err) > + break; > + > + set_pte_at(walk->mm, addr, pte, new_pte); While the guard pages install ptes unconditionally, maybe some install_pte handler implementation would sometimes want to skip, should ve define an error code that means its skipped and just continue instead of set_pte_at()? Or leave it until such handler appears. > + /* Non-present before, so for arches that need it. */ > + if (!WARN_ON_ONCE(walk->no_vma)) > + update_mmu_cache(walk->vma, addr, pte); > + } else { > + err = ops->pte_entry(pte, addr, addr + PAGE_SIZE, walk); > + if (err) > + break; > + } > if (addr >= end - PAGE_SIZE) > break; > addr += PAGE_SIZE; > @@ -89,11 +108,14 @@ static int walk_pmd_range(pud_t *pud, unsigned long addr, unsigned long end, > again: > next = pmd_addr_end(addr, end); > if (pmd_none(*pmd)) { > - if (ops->pte_hole) > + if (ops->install_pte) > + err = __pte_alloc(walk->mm, pmd); > + else if (ops->pte_hole) > err = ops->pte_hole(addr, next, depth, walk); > if (err) > break; > - continue; > + if (!ops->install_pte) > + continue; > } > > walk->action = ACTION_SUBTREE; > @@ -116,7 +138,7 @@ static int walk_pmd_range(pud_t *pud, unsigned long addr, unsigned long end, > */ > if ((!walk->vma && (pmd_leaf(*pmd) || !pmd_present(*pmd))) || > walk->action == ACTION_CONTINUE || > - !(ops->pte_entry)) > + !(ops->pte_entry || ops->install_pte)) > continue; BTW, I find it hard to read this condition even before your patch, oh well. But if I read it correctly, does it mean we're going to split a pmd-mapped THP if we have a install_pte handler? But is that really necessary if the pmd splitting results in all ptes populated, and thus the install_pte handler can't do anything with any pte anyway? > if (walk->vma) > @@ -148,11 +170,14 @@ static int walk_pud_range(p4d_t *p4d, unsigned long addr, unsigned long end, > again: > next = pud_addr_end(addr, end); > if (pud_none(*pud)) { > - if (ops->pte_hole) > + if (ops->install_pte) > + err = __pmd_alloc(walk->mm, pud, addr); > + else if (ops->pte_hole) > err = ops->pte_hole(addr, next, depth, walk); > if (err) > break; > - continue; > + if (!ops->install_pte) > + continue; > } > > walk->action = ACTION_SUBTREE; > @@ -167,7 +192,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned long addr, unsigned long end, > > if ((!walk->vma && (pud_leaf(*pud) || !pud_present(*pud))) || > walk->action == ACTION_CONTINUE || > - !(ops->pmd_entry || ops->pte_entry)) > + !(ops->pmd_entry || ops->pte_entry || ops->install_pte)) > continue; Ditto?