From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C352D4FDA76; Thu, 17 Sep 2026 18:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668699; cv=none; b=KjtWrV9mBr4xHbafHx9D27PnGo4GSxIcRNwbjdlNxvr6Dy1zXab8D0SqJSLw5+j6B3HKVq+KcNuBj+4nH5RLQlZUbLgRg4UB0QALSqLavZkzAY2V7vBz8Oiy/cR2oVrrdaFIVx+hCmtFZxfGVh8b6O2hi6j/opfpsLx6DAkWnN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789668699; c=relaxed/simple; bh=TMD2k65kuIFXRf0q/E0tlyDyciozaJKv/LfOROsWlhU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oUvexjaZ9OJ/uzqW7BEMJJT5C3GjdtQaHiShw4MYFVPARLZcYV4NI0HxvkkzVG853cQt/zG9TMYIVLujz2NjW7Hq+/bFoi8yGWMfliBzCQwpCz3qUtzVb9ctQ6X4X0Us0sUMYMkE79VKC1Ac2/vcOYiZqM7Xkur3WuPa1cbdI/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=oz67M4YS; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="oz67M4YS" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D27B1476; Thu, 17 Sep 2026 11:11:32 -0700 (PDT) Received: from [10.57.7.135] (unknown [10.57.7.135]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07D443F86F; Thu, 17 Sep 2026 11:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1789668695; bh=TMD2k65kuIFXRf0q/E0tlyDyciozaJKv/LfOROsWlhU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oz67M4YS9vKX95bPOvJjG/6IahhL31r2yGk7O81dt+sjjN414ZuuZ1xCMa2au/gHH rXUcqtwGrQvFQ85FYRDPTsgIv5sPS9YSZzFPZz/TWW1k7YQuQdJ0UPTrn4SrhDiV3s CGukra9E2ILOT0R0PDF2smG+O2IyEGDjkvUSbT20= Message-ID: Date: Thu, 17 Sep 2026 20:11:22 +0200 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/6] set_memory: add number of pages parameter to set_direct_map APIs To: "Mike Rapoport (Microsoft)" , Andrew Morton Cc: =?UTF-8?Q?Adrian_Barna=C5=9B?= , Albert Ou , Alexander Gordeev , Alexandre Ghiti , Andy Lutomirski , Borislav Petkov , Brendan Jackman , Catalin Marinas , Christian Borntraeger , Dave Hansen , David Hildenbrand , Gerald Schaefer , Heiko Carstens , Huacai Chen , Ingo Molnar , Len Brown , Palmer Dabbelt , Paul Walmsley , Pavel Machek , Peter Zijlstra , "H. Peter Anvin" , "Rafael J. Wysocki" , Ryan Roberts , Sven Schnelle , Thomas Gleixner , Uladzislau Rezki , Vasily Gorbik , WANG Xuerui , Will Deacon , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, loongarch@lists.linux.dev References: <20260903-execmem-set-vm-perms-v0-2-v3-0-949b64a9f755@kernel.org> <20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org> From: Kevin Brodsky Content-Language: en-GB In-Reply-To: <20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03/09/2026 11:28, Mike Rapoport (Microsoft) wrote: > When set_direct_map APIs were introduced by the commit d253ca0c3865 > ("x86/mm/cpa: Add set_direct_map_*() functions") the single page > parameter made sense because the initial callers (vmalloc and > hibernation) had sets of unsorted struct pages that required changes of > their mappings in the direct map. > > Since there is an increasing demand for direct map manipulation and it > is also desirable to be able to update larger physically contiguous > mappings, for example an entire large folio, extend set_direct_map APIs > to receive number of pages parameter. > > As there is still only a handful of callers, change the existing > functions directly and update all the call sites rather than adding > wrappers for single page case. > > Signed-off-by: Mike Rapoport (Microsoft) > --- > arch/arm64/include/asm/set_memory.h | 4 ++-- > arch/arm64/mm/pageattr.c | 8 ++++---- > arch/loongarch/include/asm/set_memory.h | 4 ++-- > arch/loongarch/mm/pageattr.c | 8 ++++---- > arch/riscv/include/asm/set_memory.h | 4 ++-- > arch/riscv/mm/pageattr.c | 8 ++++---- > arch/s390/include/asm/set_memory.h | 4 ++-- > arch/s390/mm/pageattr.c | 8 ++++---- > arch/x86/include/asm/set_memory.h | 4 ++-- > arch/x86/mm/pat/set_memory.c | 8 ++++---- > include/linux/set_memory.h | 6 ++++-- > kernel/power/snapshot.c | 4 ++-- > mm/secretmem.c | 6 +++--- > mm/vmalloc.c | 5 +++-- > 14 files changed, 42 insertions(+), 39 deletions(-) > > diff --git a/arch/arm64/include/asm/set_memory.h b/arch/arm64/include/asm/set_memory.h > index 90f61b17275e1..b07fd4e026eac 100644 > --- a/arch/arm64/include/asm/set_memory.h > +++ b/arch/arm64/include/asm/set_memory.h > @@ -11,8 +11,8 @@ bool can_set_direct_map(void); > > int set_memory_valid(unsigned long addr, int numpages, int enable); > > -int set_direct_map_invalid_noflush(struct page *page); > -int set_direct_map_default_noflush(struct page *page); > +int set_direct_map_invalid_noflush(struct page *page, unsigned int numpages); > +int set_direct_map_default_noflush(struct page *page, unsigned int numpages); I don't have a strong opinion on whether to call the argument nr or numpages, but we might as well be consistent across archs :) Aside from that: Reviewed-by: Kevin Brodsky 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32D2FC982D2 for ; Thu, 17 Sep 2026 18:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BR/2+2I1EPqAMd436TDI/heFSThbQGhDpHW6SAZIikc=; b=P+qOLz0ASID/DM OJdAtR2AlJJTgX8Ph7dQrciP+LVvOZVlDM+McIA6mzs0pyym2/JjrfCBjqRNYiwAjiRYVGA5T6/ki Kg7RElmMrab2XLLBToqG/T28YiLD/LtbVcZhY884YCEH+F6R2l+zfEQ6u+lANx7Hgve3nVUFfrAbP HVc5h4VlD8eC6HDo346wgHA6BZudl/eo28nxXSutUhFCvl+Hz386KDfUgGaVMYw+T63toZZteFb3s AT22eA/MdhsuLHvgFzwKQ+mAdNnLUX4HgJ5Jqc4vp+wr5F+6yRJZHfTclW9IHKry2+Z2AI5FFMRlu 599du2X7seGxDNQWM8eA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x7GaD-0000000CBMY-1bJO; Thu, 17 Sep 2026 18:11:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x7GaA-0000000CBL5-3OHs; Thu, 17 Sep 2026 18:11:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D27B1476; Thu, 17 Sep 2026 11:11:32 -0700 (PDT) Received: from [10.57.7.135] (unknown [10.57.7.135]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07D443F86F; Thu, 17 Sep 2026 11:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1789668695; bh=TMD2k65kuIFXRf0q/E0tlyDyciozaJKv/LfOROsWlhU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oz67M4YS9vKX95bPOvJjG/6IahhL31r2yGk7O81dt+sjjN414ZuuZ1xCMa2au/gHH rXUcqtwGrQvFQ85FYRDPTsgIv5sPS9YSZzFPZz/TWW1k7YQuQdJ0UPTrn4SrhDiV3s CGukra9E2ILOT0R0PDF2smG+O2IyEGDjkvUSbT20= Message-ID: Date: Thu, 17 Sep 2026 20:11:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/6] set_memory: add number of pages parameter to set_direct_map APIs To: "Mike Rapoport (Microsoft)" , Andrew Morton Cc: =?UTF-8?Q?Adrian_Barna=C5=9B?= , Albert Ou , Alexander Gordeev , Alexandre Ghiti , Andy Lutomirski , Borislav Petkov , Brendan Jackman , Catalin Marinas , Christian Borntraeger , Dave Hansen , David Hildenbrand , Gerald Schaefer , Heiko Carstens , Huacai Chen , Ingo Molnar , Len Brown , Palmer Dabbelt , Paul Walmsley , Pavel Machek , Peter Zijlstra , "H. Peter Anvin" , "Rafael J. Wysocki" , Ryan Roberts , Sven Schnelle , Thomas Gleixner , Uladzislau Rezki , Vasily Gorbik , WANG Xuerui , Will Deacon , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, loongarch@lists.linux.dev References: <20260903-execmem-set-vm-perms-v0-2-v3-0-949b64a9f755@kernel.org> <20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org> From: Kevin Brodsky Content-Language: en-GB In-Reply-To: <20260903-execmem-set-vm-perms-v0-2-v3-1-949b64a9f755@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260917_111138_930599_A917B954 X-CRM114-Status: GOOD ( 17.47 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 03/09/2026 11:28, Mike Rapoport (Microsoft) wrote: > When set_direct_map APIs were introduced by the commit d253ca0c3865 > ("x86/mm/cpa: Add set_direct_map_*() functions") the single page > parameter made sense because the initial callers (vmalloc and > hibernation) had sets of unsorted struct pages that required changes of > their mappings in the direct map. > > Since there is an increasing demand for direct map manipulation and it > is also desirable to be able to update larger physically contiguous > mappings, for example an entire large folio, extend set_direct_map APIs > to receive number of pages parameter. > > As there is still only a handful of callers, change the existing > functions directly and update all the call sites rather than adding > wrappers for single page case. > > Signed-off-by: Mike Rapoport (Microsoft) > --- > arch/arm64/include/asm/set_memory.h | 4 ++-- > arch/arm64/mm/pageattr.c | 8 ++++---- > arch/loongarch/include/asm/set_memory.h | 4 ++-- > arch/loongarch/mm/pageattr.c | 8 ++++---- > arch/riscv/include/asm/set_memory.h | 4 ++-- > arch/riscv/mm/pageattr.c | 8 ++++---- > arch/s390/include/asm/set_memory.h | 4 ++-- > arch/s390/mm/pageattr.c | 8 ++++---- > arch/x86/include/asm/set_memory.h | 4 ++-- > arch/x86/mm/pat/set_memory.c | 8 ++++---- > include/linux/set_memory.h | 6 ++++-- > kernel/power/snapshot.c | 4 ++-- > mm/secretmem.c | 6 +++--- > mm/vmalloc.c | 5 +++-- > 14 files changed, 42 insertions(+), 39 deletions(-) > > diff --git a/arch/arm64/include/asm/set_memory.h b/arch/arm64/include/asm/set_memory.h > index 90f61b17275e1..b07fd4e026eac 100644 > --- a/arch/arm64/include/asm/set_memory.h > +++ b/arch/arm64/include/asm/set_memory.h > @@ -11,8 +11,8 @@ bool can_set_direct_map(void); > > int set_memory_valid(unsigned long addr, int numpages, int enable); > > -int set_direct_map_invalid_noflush(struct page *page); > -int set_direct_map_default_noflush(struct page *page); > +int set_direct_map_invalid_noflush(struct page *page, unsigned int numpages); > +int set_direct_map_default_noflush(struct page *page, unsigned int numpages); I don't have a strong opinion on whether to call the argument nr or numpages, but we might as well be consistent across archs :) Aside from that: Reviewed-by: Kevin Brodsky _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv