Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-05-26 Thread Borislav Petkov
On Sun, May 26, 2024 at 10:24:41AM +0530, Balasubrmanian, Vignesh wrote: > If we can add a new enum only when we extend, then as Thomas suggested can > we use other kernel variables as in the first version of the patch until we > extend for other/new features? I assume by "other kernel variables"

[RFC PATCH v3 09/16] powerpc/8xx: Simplify struct mmu_psize_def

2024-05-26 Thread Christophe Leroy
On 8xx, only the shift field is used in struct mmu_psize_def Remove other fields and related macros. Signed-off-by: Christophe Leroy Reviewed-by: Oscar Salvador --- arch/powerpc/include/asm/nohash/32/mmu-8xx.h | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/po

[RFC PATCH v3 05/16] powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries

2024-05-26 Thread Christophe Leroy
Building on 32 bits with pmd_leaf() not returning always false leads to the following error: CC arch/powerpc/mm/pgtable.o arch/powerpc/mm/pgtable.c: In function '__find_linux_pte': arch/powerpc/mm/pgtable.c:506:1: error: function may return address of local variable [-Werror=return-local-a

[RFC PATCH v3 07/16] powerpc/8xx: Fix size given to set_huge_pte_at()

2024-05-26 Thread Christophe Leroy
set_huge_pte_at() expects the size of the hugepage as an int, not the psize which is the index of the page definition in table mmu_psize_defs[] Fixes: 935d4f0c6dc8 ("mm: hugetlb: add huge page size param to set_huge_pte_at()") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/nohash/8xx.c | 3

[RFC PATCH v3 04/16] powerpc/mm: Remove _PAGE_PSIZE

2024-05-26 Thread Christophe Leroy
_PAGE_PSIZE macro is never used outside the place it is defined and is used only on 8xx and e500. Remove indirection, remove it and use its content directly. Signed-off-by: Christophe Leroy Reviewed-by: Oscar Salvador --- arch/powerpc/include/asm/nohash/32/pte-40x.h | 3 --- arch/powerpc/incl

[RFC PATCH v3 08/16] powerpc/8xx: Rework support for 8M pages using contiguous PTE entries

2024-05-26 Thread Christophe Leroy
In order to fit better with standard Linux page tables layout, add support for 8M pages using contiguous PTE entries in a standard page table. Page tables will then be populated with 1024 similar entries and two PMD entries will point to that page table. The PMD entries also get a flag to tell it

[RFC PATCH v3 06/16] powerpc/mm: Allow hugepages without hugepd

2024-05-26 Thread Christophe Leroy
In preparation of implementing huge pages on powerpc 8xx without hugepd, enclose hugepd related code inside an ifdef CONFIG_ARCH_HAS_HUGEPD This also allows removing some stubs. Signed-off-by: Christophe Leroy --- v3: - Prepare huge_pte_alloc() for full standard topology, not only for 2-level -

[RFC PATCH v3 03/16] mm: Provide mm_struct and address to huge_ptep_get()

2024-05-26 Thread Christophe Leroy
On powerpc 8xx huge_ptep_get() will need to know whether the given ptep is a PTE entry or a PMD entry. This cannot be known with the PMD entry itself because there is no easy way to know it from the content of the entry. So huge_ptep_get() will need to know either the size of the page or get the p

[RFC PATCH v3 00/16] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64)

2024-05-26 Thread Christophe Leroy
This is the continuation of the RFC v1 series "Reimplement huge pages without hugepd on powerpc 8xx". It now get rid of hugepd completely after handling also e500 and book3s/64 Also see https://github.com/linuxppc/issues/issues/483 Unlike most architectures, powerpc 8xx HW requires a two-level pa

[RFC PATCH v3 01/16] powerpc/64e: Remove unused IBM HTW code [SQUASHED]

2024-05-26 Thread Christophe Leroy
From: Michael Ellerman This is a squash of series from Michael https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20240524073141.1637736-1-...@ellerman.id.au/ The nohash HTW_IBM (Hardware Table Walk) code is unused since support for A2 was removed in commit fb5a515704d7 ("powerpc: Remove p

[RFC PATCH v3 02/16] mm: Define __pte_leaf_size() to also take a PMD entry

2024-05-26 Thread Christophe Leroy
On powerpc 8xx, when a page is 8M size, the information is in the PMD entry. So allow architectures to provide __pte_leaf_size() instead of pte_leaf_size() and provide the PMD entry to that function. When __pte_leaf_size() is not defined, define it as a pte_leaf_size() so that architectures not in

[RFC PATCH v3 12/16] powerpc/e500: Encode hugepage size in PTE bits

2024-05-26 Thread Christophe Leroy
Use U0-U3 bits to encode hugepage size, more exactly page shift. As we start using hugepages at shift 21 (2Mbytes), substract 20 so that it fits into 4 bits. That may change in the future if we want to use smaller hugepages. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/hu

[RFC PATCH v3 10/16] powerpc/e500: Remove enc and ind fields from struct mmu_psize_def

2024-05-26 Thread Christophe Leroy
enc field is hidden behind BOOK3E_PAGESZ_XX macros, and when you look closer you realise that this field is nothing else than the value of shift minus ten. So remove enc field and calculate tsize from shift field. Also remove inc field which is unused. Signed-off-by: Christophe Leroy Reviewed-b

[RFC PATCH v3 11/16] powerpc/e500: Switch to 64 bits PGD on 85xx (32 bits)

2024-05-26 Thread Christophe Leroy
At the time being when CONFIG_PTE_64BIT is selected, PTE entries are 64 bits but PGD entries are still 32 bits. In order to allow leaf PMD entries, switch the PGD to 64 bits entries. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pgtable-types.h | 4 arch/powerpc/kernel/head

[RFC PATCH v3 14/16] powerpc/64s: Use contiguous PMD/PUD instead of HUGEPD

2024-05-26 Thread Christophe Leroy
On book3s/64, the only user of hugepd is hash in 4k mode. All other setups (hash-64, radix-4, radix-64) use leaf PMD/PUD. Rework hash-4k to use contiguous PMD and PUD instead. In that setup there are only two huge page sizes: 16M and 16G. 16M sits at PMD level and 16G at PUD level. pte_update

Re: [RFC PATCH 1/8] mm: Provide pagesize to pmd_populate()

2024-05-26 Thread Christophe Leroy
Le 25/03/2024 à 17:19, Jason Gunthorpe a écrit : > On Mon, Mar 25, 2024 at 03:55:54PM +0100, Christophe Leroy wrote: >> Unlike many architectures, powerpc 8xx hardware tablewalk requires >> a two level process for all page sizes, allthough second level only >> has one entry when pagesize is 8M. >

[RFC PATCH v3 13/16] powerpc/e500: Use contiguous PMD instead of hugepd

2024-05-26 Thread Christophe Leroy
e500 supports many page sizes among which the following size are implemented in the kernel at the time being: 4M, 16M, 64M, 256M, 1G. On e500, TLB miss for hugepages is exclusively handled by SW even on e6500 which has HW assistance for 4k pages, so there are no constraints like on the 8xx. On e5

[RFC PATCH v3 16/16] mm: Remove CONFIG_ARCH_HAS_HUGEPD

2024-05-26 Thread Christophe Leroy
powerpc was the only user of CONFIG_ARCH_HAS_HUGEPD and doesn't use it anymore, so remove all related code. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 1 - include/linux/hugetlb.h | 6 -- mm/Kconfig| 10 mm/gup.c |

[RFC PATCH v3 15/16] powerpc/mm: Remove hugepd leftovers

2024-05-26 Thread Christophe Leroy
All targets have now opted out of CONFIG_ARCH_HAS_HUGEPD so remove left over code. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 7 - arch/powerpc/include/asm/page.h | 6 - arch/powerpc/include/asm/pgtable-be-types.h | 10 - arch/powerpc/inclu

Re: [RFC PATCH 4/8] mm: Provide mm_struct and address to huge_ptep_get()

2024-05-26 Thread Christophe Leroy
Le 25/03/2024 à 17:35, Jason Gunthorpe a écrit : > On Mon, Mar 25, 2024 at 03:55:57PM +0100, Christophe Leroy wrote: > >> arch/arm64/include/asm/hugetlb.h | 2 +- >> fs/hugetlbfs/inode.c | 2 +- >> fs/proc/task_mmu.c | 8 +++--- >> fs/userfaultfd.c

Re: [PATCH 0/6] ipmi: Convert to platform remove callback returning void

2024-05-26 Thread Uwe Kleine-König
Hello Corey, On Sat, May 25, 2024 at 09:39:36AM -0500, Corey Minyard wrote: > On Sat, May 25, 2024 at 12:10:38PM +0200, Uwe Kleine-König wrote: > > These changes are in next since a while but didn't land in Linus tree > > for v6.10-rc1. I intend to send a PR to Greg early next week changing > > pl

Re: [RFC PATCH v3 00/16] Reimplement huge pages without hugepd on powerpc (8xx, e500, book3s/64)

2024-05-26 Thread Oscar Salvador
On Sun, May 26, 2024 at 11:22:20AM +0200, Christophe Leroy wrote: > This is the continuation of the RFC v1 series "Reimplement huge pages > without hugepd on powerpc 8xx". It now get rid of hugepd completely > after handling also e500 and book3s/64 > > Also see https://github.com/linuxppc/issues/i

Re: [RFC PATCH v3 02/16] mm: Define __pte_leaf_size() to also take a PMD entry

2024-05-26 Thread Oscar Salvador
On Sun, May 26, 2024 at 11:22:22AM +0200, Christophe Leroy wrote: > On powerpc 8xx, when a page is 8M size, the information is in the PMD > entry. So allow architectures to provide __pte_leaf_size() instead of > pte_leaf_size() and provide the PMD entry to that function. > > When __pte_leaf_size()

Re: [RFC PATCH v3 05/16] powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries

2024-05-26 Thread Oscar Salvador
On Sun, May 26, 2024 at 11:22:25AM +0200, Christophe Leroy wrote: > Building on 32 bits with pmd_leaf() not returning always false leads > to the following error: > > CC arch/powerpc/mm/pgtable.o > arch/powerpc/mm/pgtable.c: In function '__find_linux_pte': > arch/powerpc/mm/pgtable.c:506:1:

Re: [RFC PATCH v3 07/16] powerpc/8xx: Fix size given to set_huge_pte_at()

2024-05-26 Thread Oscar Salvador
On Sun, May 26, 2024 at 11:22:27AM +0200, Christophe Leroy wrote: > set_huge_pte_at() expects the size of the hugepage as an int, not the > psize which is the index of the page definition in table mmu_psize_defs[] > > Fixes: 935d4f0c6dc8 ("mm: hugetlb: add huge page size param to > set_huge_pte_a

Re: [RFC PATCH v3 05/16] powerpc/mm: Fix __find_linux_pte() on 32 bits with PMD leaf entries

2024-05-26 Thread Christophe Leroy
Le 27/05/2024 à 06:55, Oscar Salvador a écrit : > On Sun, May 26, 2024 at 11:22:25AM +0200, Christophe Leroy wrote: >> Building on 32 bits with pmd_leaf() not returning always false leads >> to the following error: >> >>CC arch/powerpc/mm/pgtable.o >> arch/powerpc/mm/pgtable.c: In functi

Re: [PATCH v2 12/14] mm/treewide: Remove pXd_huge()

2024-05-26 Thread Christophe Leroy
Le 18/03/2024 à 21:04, pet...@redhat.com a écrit : > From: Peter Xu > > This API is not used anymore, drop it for the whole tree. Some documentation remain in v6.10-rc1: $ git grep -w p.d_huge Documentation/mm/arch_pgtable_helpers.rst:| pmd_huge | Tests a HugeTLB mapped PMD