linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 00/16] Add support for DAX vmemmap optimization for ppc64
       [not found] <20230606045608.55127-1-aneesh.kumar@linux.ibm.com>
@ 2023-06-14  4:11 ` Aneesh Kumar K.V
       [not found] ` <20230606045608.55127-15-aneesh.kumar@linux.ibm.com>
       [not found] ` <20230606045608.55127-3-aneesh.kumar@linux.ibm.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2023-06-14  4:11 UTC (permalink / raw)
  To: linux-mm, akpm, npiggin, christophe.leroy
  Cc: mpe, linuxppc-dev, Oscar Salvador, Mike Kravetz, Dan Williams,
	Joao Martins, Catalin Marinas, Muchun Song, Will Deacon

"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:

> This patch series implements changes required to support DAX vmemmap
> optimization for ppc64. The vmemmap optimization is only enabled with radix MMU
> translation and 1GB PUD mapping with 64K page size. The patch series also split
> hugetlb vmemmap optimization as a separate Kconfig variable so that
> architectures can enable DAX vmemmap optimization without enabling hugetlb
> vmemmap optimization. This should enable architectures like arm64 to enable DAX
> vmemmap optimization while they can't enable hugetlb vmemmap optimization. More
> details of the same are in patch "mm/vmemmap optimization: Split hugetlb and
> d
>
> Aneesh Kumar K.V (16):
>   powerpc/mm/book3s64: Use pmdp_ptep helper instead of typecasting.
>   powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix
>   powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo
>   powerpc/book3s64/mm: Use PAGE_KERNEL instead of opencoding
>   powerpc/mm/dax: Fix the condition when checking if altmap vmemap can
>     cross-boundary
>   mm/hugepage pud: Allow arch-specific helper function to check huge
>     page pud support
>   mm: Change pudp_huge_get_and_clear_full take vm_area_struct as arg
>   mm/vmemmap: Improve vmemmap_can_optimize and allow architectures to
>     override
>   mm/vmemmap: Allow architectures to override how vmemmap optimization
>     works
>   mm: Add __HAVE_ARCH_PUD_SAME similar to __HAVE_ARCH_P4D_SAME
>   mm/huge pud: Use transparent huge pud helpers only with
>     CONFIG_TRANSPARENT_HUGEPAGE
>   mm/vmemmap optimization: Split hugetlb and devdax vmemmap optimization
>   powerpc/book3s64/mm: Enable transparent pud hugepage
>   powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap
>     handling function
>   powerpc/book3s64/radix: Add support for vmemmap optimization for radix
>   powerpc/book3s64/radix: Remove mmu_vmemmap_psize

   Gentle ping. Any objections for this series? 

   -aneesh


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 14/16] powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap handling function
       [not found] ` <20230606045608.55127-15-aneesh.kumar@linux.ibm.com>
@ 2023-06-14 10:50   ` Sachin Sant
  2023-06-15  2:23     ` Aneesh Kumar K.V
  0 siblings, 1 reply; 5+ messages in thread
From: Sachin Sant @ 2023-06-14 10:50 UTC (permalink / raw)
  To: Aneesh Kumar K.V
  Cc: linux-mm, Andrew Morton, Nicholas Piggin, Christophe Leroy,
	Will Deacon, Muchun Song, Catalin Marinas, Dan Williams,
	Oscar Salvador, linuxppc-dev, Joao Martins, Mike Kravetz


> 1. First try to map things using PMD (2M)
> 2. With altmap if altmap cross-boundary check returns true, fall back to PAGE_SIZE
> 3. IF we can't allocate PMD_SIZE backing memory for vmemmap, fallback to PAGE_SIZE
> 
> On removing vmemmap mapping, check if every subsection that is using the vmemmap
> area is invalid. If found to be invalid, that implies we can safely free the
> vmemmap area. We don't use the PAGE_UNUSED pattern used by x86 because with 64K
> page size, we need to do the above check even at the PAGE_SIZE granularity.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---

With this patch series applied I see the following warning

[  OK  ] Started Monitoring of LVM2 mirrors,…sing dmeventd or progress polling.
[    3.283884] papr_scm ibm,persistent-memory:ibm,pmemory@44104001: nvdimm pmu didn't register rc=-2
[    3.284212] papr_scm ibm,persistent-memory:ibm,pmemory@44104002: nvdimm pmu didn't register rc=-2
[    3.563890] radix-mmu: Mapped 0x0000040010000000-0x0000040c90000000 with 64.0 KiB pages
[    3.703227] ------------[ cut here ]------------
[    3.703236] failed to free all reserved pages
[    3.703244] WARNING: CPU: 41 PID: 923 at mm/memremap.c:152 memunmap_pages+0x37c/0x3a0
[    3.703252] Modules linked in: device_dax(+) nd_pmem nd_btt dax_pmem papr_scm libnvdimm pseries_rng vmx_crypto aes_gcm_p10_crypto ext4 mbcache jbd2 sd_mod t10_pi crc64_rocksoft crc64 sg ibmvscsi scsi_transport_srp ibmveth fuse
[    3.703272] CPU: 41 PID: 923 Comm: systemd-udevd Not tainted 6.4.0-rc6-00037-gb6dad5178cea-dirty #1
[    3.703276] Hardware name: IBM,9080-HEX POWER10 (raw) 0x800200 0xf000006 of:IBM,FW1030.20 (NH1030_058) hv:phyp pSeries
[    3.703280] NIP:  c00000000057a18c LR: c00000000057a188 CTR: 00000000005ca81c
[    3.703283] REGS: c000000032a170d0 TRAP: 0700   Not tainted  (6.4.0-rc6-00037-gb6dad5178cea-dirty)
[    3.703286] MSR:  800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 48248824  XER: 00000002
[    3.703296] CFAR: c00000000015f0c0 IRQMASK: 0  [    3.703296] GPR00: c00000000057a188 c000000032a17370 c000000001421500 0000000000000021  [    3.703296] GPR04: 00000000ffff7fff c000000032a17140 c000000032a17138 0000000000000027  [    3.703296] GPR08: c0000015c91a7c10 0000000000000001 0000000000000027 c000000002a18a20  [    3.703296] GPR12: 0000000048248824 c0000015cb9f4300 c000000032a17d68 c000000001262b20  [    3.703296] GPR16: c008000001310000 000000000000ff20 000000000000fff2 c0080000012d7418  [    3.703296] GPR20: c000000032a17c30 0000000000000004 ffffffffffffc005 0000000001000200  [    3.703296] GPR24: c000000002f11570 c00000000e376870 0000000000000001 0000000000000001  [    3.703296] GPR28: c00000000e376840 c00000000e3768c8 0000000000000000 c00000000e376840  [    3.703333] NIP [c00000000057a18c] memunmap_pages+0x37c/0x3a0
[    3.703338] LR [c00000000057a188] memunmap_pages+0x378/0x3a0
[    3.703342] Call Trace:
[    3.703344] [c000000032a17370] [c00000000057a188] memunmap_pages+0x378/0x3a0 (unreliable)
[    3.703349] [c000000032a17420] [c00000000057a928] memremap_pages+0x4a8/0x890
[    3.703355] [c000000032a17500] [c00000000057ad4c] devm_memremap_pages+0x3c/0xd0
[    3.703359] [c000000032a17540] [c0080000011c084c] dev_dax_probe+0x134/0x3a0 [device_dax]
[    3.703366] [c000000032a175e0] [c0000000009f7e8c] dax_bus_probe+0xac/0x140
[    3.703371] [c000000032a17610] [c0000000009b5828] really_probe+0x108/0x530
[    3.703375] [c000000032a176a0] [c0000000009b5d04] __driver_probe_device+0xb4/0x200
[    3.703379] [c000000032a17720] [c0000000009b5ea8] driver_probe_device+0x58/0x120
[    3.703383] [c000000032a17760] [c0000000009b6298] __driver_attach+0x148/0x250
[    3.703387] [c000000032a177e0] [c0000000009b1a58] bus_for_each_dev+0xa8/0x130
[    3.703392] [c000000032a17840] [c0000000009b4b34] driver_attach+0x34/0x50
[    3.703396] [c000000032a17860] [c0000000009b3b98] bus_add_driver+0x258/0x300
[    3.703400] [c000000032a178f0] [c0000000009b78d4] driver_register+0xa4/0x1b0
[    3.703404] [c000000032a17960] [c0000000009f9530] __dax_driver_register+0x50/0x70
[    3.703409] [c000000032a17980] [c0080000011c1374] dax_init+0x3c/0x58 [device_dax]
[    3.703414] [c000000032a179a0] [c000000000013260] do_one_initcall+0x60/0x2f0
[    3.703418] [c000000032a17a70] [c000000000248af8] do_init_module+0x78/0x310
[    3.703424] [c000000032a17af0] [c00000000024bcac] load_module+0x2a7c/0x2f30
[    3.703429] [c000000032a17d00] [c00000000024c4f0] __do_sys_finit_module+0xe0/0x180
[    3.703434] [c000000032a17e10] [c0000000000374c0] system_call_exception+0x140/0x350
[    3.703439] [c000000032a17e50] [c00000000000d6a0] system_call_common+0x160/0x2e4
[    3.703444] --- interrupt: c00 at 0x7fff9af2fb34
[    3.703447] NIP:  00007fff9af2fb34 LR: 00007fff9b6dea9c CTR: 0000000000000000
[    3.703450] REGS: c000000032a17e80 TRAP: 0c00   Not tainted  (6.4.0-rc6-00037-gb6dad5178cea-dirty)
[    3.703453] MSR:  800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28222204  XER: 00000000
[    3.703462] IRQMASK: 0  [    3.703462] GPR00: 0000000000000161 00007fffed351350 00007fff9b007300 000000000000000f  [    3.703462] GPR04: 00007fff9b6ead30 0000000000000000 000000000000000f 0000000000000000  [    3.703462] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000  [    3.703462] GPR12: 0000000000000000 00007fff9b7c6610 0000000000020000 000000011057db18  [    3.703462] GPR16: 00000001105c0108 0000000110585f48 0000000000000000 0000000000000000  [    3.703462] GPR20: 0000000000000000 0000000110585f80 0000000147985200 00007fffed351570  [    3.703462] GPR24: 00000001105c0128 0000000000020000 0000000000000000 0000000147981010  [    3.703462] GPR28: 00007fff9b6ead30 0000000000020000 0000000000000000 0000000147985200  [    3.703497] NIP [00007fff9af2fb34] 0x7fff9af2fb34
[    3.703499] LR [00007fff9b6dea9c] 0x7fff9b6dea9c
[    3.703502] --- interrupt: c00
[    3.703504] Code: 60000000 3d220170 8929b2b7 2f890000 409eff28 3c62ffe7 39200001 3d420170 3863c518 992ab2b7 4bbe4e55 60000000 <0fe00000> fac10060 fae10068 fb010070  [    3.703516] ---[ end trace 0000000000000000 ]---
[    3.703520] device_dax: probe of dax0.0 failed with error -12
[  OK  ] Created slice system-daxdev\x2dreconfigure.slice.
[  OK  ] Started udev Wait for Complete Device Initialization.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.

The warning appears after applying this patch. 

- Sachin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 14/16] powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap handling function
  2023-06-14 10:50   ` [PATCH 14/16] powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap handling function Sachin Sant
@ 2023-06-15  2:23     ` Aneesh Kumar K.V
  0 siblings, 0 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2023-06-15  2:23 UTC (permalink / raw)
  To: Sachin Sant
  Cc: linux-mm, Andrew Morton, Nicholas Piggin, Christophe Leroy,
	Will Deacon, Muchun Song, Catalin Marinas, Dan Williams,
	Oscar Salvador, linuxppc-dev, Joao Martins, Mike Kravetz

Sachin Sant <sachinp@linux.ibm.com> writes:

>> 1. First try to map things using PMD (2M)
>> 2. With altmap if altmap cross-boundary check returns true, fall back to PAGE_SIZE
>> 3. IF we can't allocate PMD_SIZE backing memory for vmemmap, fallback to PAGE_SIZE
>> 
>> On removing vmemmap mapping, check if every subsection that is using the vmemmap
>> area is invalid. If found to be invalid, that implies we can safely free the
>> vmemmap area. We don't use the PAGE_UNUSED pattern used by x86 because with 64K
>> page size, we need to do the above check even at the PAGE_SIZE granularity.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>> ---
>
> With this patch series applied I see the following warning
>
> [  OK  ] Started Monitoring of LVM2 mirrors,…sing dmeventd or progress polling.
> [    3.283884] papr_scm ibm,persistent-memory:ibm,pmemory@44104001: nvdimm pmu didn't register rc=-2
> [    3.284212] papr_scm ibm,persistent-memory:ibm,pmemory@44104002: nvdimm pmu didn't register rc=-2
> [    3.563890] radix-mmu: Mapped 0x0000040010000000-0x0000040c90000000 with 64.0 KiB pages
> [    3.703227] ------------[ cut here ]------------
> [    3.703236] failed to free all reserved pages
> [    3.703244] WARNING: CPU: 41 PID: 923 at mm/memremap.c:152 memunmap_pages+0x37c/0x3a0
> [    3.703252] Modules linked in: device_dax(+) nd_pmem nd_btt dax_pmem papr_scm libnvdimm pseries_rng vmx_crypto aes_gcm_p10_crypto ext4 mbcache jbd2 sd_mod t10_pi crc64_rocksoft crc64 sg ibmvscsi scsi_transport_srp ibmveth fuse
> [    3.703272] CPU: 41 PID: 923 Comm: systemd-udevd Not tainted 6.4.0-rc6-00037-gb6dad5178cea-dirty #1
> [    3.703276] Hardware name: IBM,9080-HEX POWER10 (raw) 0x800200 0xf000006 of:IBM,FW1030.20 (NH1030_058) hv:phyp pSeries
> [    3.703280] NIP:  c00000000057a18c LR: c00000000057a188 CTR: 00000000005ca81c
> [    3.703283] REGS: c000000032a170d0 TRAP: 0700   Not tainted  (6.4.0-rc6-00037-gb6dad5178cea-dirty)
> [    3.703286] MSR:  800000000282b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 48248824  XER: 00000002
> [    3.703296] CFAR: c00000000015f0c0 IRQMASK: 0  [    3.703296] GPR00: c00000000057a188 c000000032a17370 c000000001421500 0000000000000021  [    3.703296] GPR04: 00000000ffff7fff c000000032a17140 c000000032a17138 0000000000000027  [    3.703296] GPR08: c0000015c91a7c10 0000000000000001 0000000000000027 c000000002a18a20  [    3.703296] GPR12: 0000000048248824 c0000015cb9f4300 c000000032a17d68 c000000001262b20  [    3.703296] GPR16: c008000001310000 000000000000ff20 000000000000fff2 c0080000012d7418  [    3.703296] GPR20: c000000032a17c30 0000000000000004 ffffffffffffc005 0000000001000200  [    3.703296] GPR24: c000000002f11570 c00000000e376870 0000000000000001 0000000000000001  [    3.703296] GPR28: c00000000e376840 c00000000e3768c8 0000000000000000 c00000000e376840  [    3.703333] NIP [c00000000057a18c] memunmap_pages+0x37c/0x3a0
> [    3.703338] LR [c00000000057a188] memunmap_pages+0x378/0x3a0
> [    3.703342] Call Trace:
> [    3.703344] [c000000032a17370] [c00000000057a188] memunmap_pages+0x378/0x3a0 (unreliable)
> [    3.703349] [c000000032a17420] [c00000000057a928] memremap_pages+0x4a8/0x890
> [    3.703355] [c000000032a17500] [c00000000057ad4c] devm_memremap_pages+0x3c/0xd0
> [    3.703359] [c000000032a17540] [c0080000011c084c] dev_dax_probe+0x134/0x3a0 [device_dax]
> [    3.703366] [c000000032a175e0] [c0000000009f7e8c] dax_bus_probe+0xac/0x140
> [    3.703371] [c000000032a17610] [c0000000009b5828] really_probe+0x108/0x530
> [    3.703375] [c000000032a176a0] [c0000000009b5d04] __driver_probe_device+0xb4/0x200
> [    3.703379] [c000000032a17720] [c0000000009b5ea8] driver_probe_device+0x58/0x120
> [    3.703383] [c000000032a17760] [c0000000009b6298] __driver_attach+0x148/0x250
> [    3.703387] [c000000032a177e0] [c0000000009b1a58] bus_for_each_dev+0xa8/0x130
> [    3.703392] [c000000032a17840] [c0000000009b4b34] driver_attach+0x34/0x50
> [    3.703396] [c000000032a17860] [c0000000009b3b98] bus_add_driver+0x258/0x300
> [    3.703400] [c000000032a178f0] [c0000000009b78d4] driver_register+0xa4/0x1b0
> [    3.703404] [c000000032a17960] [c0000000009f9530] __dax_driver_register+0x50/0x70
> [    3.703409] [c000000032a17980] [c0080000011c1374] dax_init+0x3c/0x58 [device_dax]
> [    3.703414] [c000000032a179a0] [c000000000013260] do_one_initcall+0x60/0x2f0
> [    3.703418] [c000000032a17a70] [c000000000248af8] do_init_module+0x78/0x310
> [    3.703424] [c000000032a17af0] [c00000000024bcac] load_module+0x2a7c/0x2f30
> [    3.703429] [c000000032a17d00] [c00000000024c4f0] __do_sys_finit_module+0xe0/0x180
> [    3.703434] [c000000032a17e10] [c0000000000374c0] system_call_exception+0x140/0x350
> [    3.703439] [c000000032a17e50] [c00000000000d6a0] system_call_common+0x160/0x2e4
> [    3.703444] --- interrupt: c00 at 0x7fff9af2fb34
> [    3.703447] NIP:  00007fff9af2fb34 LR: 00007fff9b6dea9c CTR: 0000000000000000
> [    3.703450] REGS: c000000032a17e80 TRAP: 0c00   Not tainted  (6.4.0-rc6-00037-gb6dad5178cea-dirty)
> [    3.703453] MSR:  800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28222204  XER: 00000000
> [    3.703462] IRQMASK: 0  [    3.703462] GPR00: 0000000000000161 00007fffed351350 00007fff9b007300 000000000000000f  [    3.703462] GPR04: 00007fff9b6ead30 0000000000000000 000000000000000f 0000000000000000  [    3.703462] GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000  [    3.703462] GPR12: 0000000000000000 00007fff9b7c6610 0000000000020000 000000011057db18  [    3.703462] GPR16: 00000001105c0108 0000000110585f48 0000000000000000 0000000000000000  [    3.703462] GPR20: 0000000000000000 0000000110585f80 0000000147985200 00007fffed351570  [    3.703462] GPR24: 00000001105c0128 0000000000020000 0000000000000000 0000000147981010  [    3.703462] GPR28: 00007fff9b6ead30 0000000000020000 0000000000000000 0000000147985200  [    3.703497] NIP [00007fff9af2fb34] 0x7fff9af2fb34
> [    3.703499] LR [00007fff9b6dea9c] 0x7fff9b6dea9c
> [    3.703502] --- interrupt: c00
> [    3.703504] Code: 60000000 3d220170 8929b2b7 2f890000 409eff28 3c62ffe7 39200001 3d420170 3863c518 992ab2b7 4bbe4e55 60000000 <0fe00000> fac10060 fae10068 fb010070  [    3.703516] ---[ end trace 0000000000000000 ]---
> [    3.703520] device_dax: probe of dax0.0 failed with error -12
> [  OK  ] Created slice system-daxdev\x2dreconfigure.slice.
> [  OK  ] Started udev Wait for Complete Device Initialization.
> [  OK  ] Reached target Local File Systems (Pre).
> [  OK  ] Reached target Local File Systems.
>

The below change fixed the warning on the test machine you shared.

diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index 1c49af91fd9c..d884c1b39128 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -994,6 +994,7 @@ void __meminit vmemmap_set_pmd(pmd_t *pmdp, void *p, int node,
 	pte_t entry;
 	pte_t *ptep = pmdp_ptep(pmdp);
 
+	VM_BUG_ON(!IS_ALIGNED((unsigned long)(addr), PMD_SIZE));
 	entry = pfn_pte(__pa(p) >> PAGE_SHIFT, PAGE_KERNEL);
 	set_pte_at(&init_mm, addr, ptep, entry);
 	asm volatile("ptesync": : :"memory");
@@ -1012,6 +1013,10 @@ static pte_t * __meminit radix__vmemmap_pte_populate(pmd_t *pmd, unsigned long a
 		void *p;
 
 		if (!reuse) {
+
+			if (altmap && altmap_cross_boundary(altmap, addr, PAGE_SIZE))
+				altmap = NULL;
+
 			p = vmemmap_alloc_block_buf(PAGE_SIZE, node, altmap);
 			if (!p)
 				return NULL;
@@ -1028,6 +1033,8 @@ static pte_t * __meminit radix__vmemmap_pte_populate(pmd_t *pmd, unsigned long a
 			get_page(reuse);
 			p = page_to_virt(reuse);
 		}
+
+		VM_BUG_ON(!PAGE_ALIGNED(addr));
 		entry = pfn_pte(__pa(p) >> PAGE_SHIFT, PAGE_KERNEL);
 		set_pte_at(&init_mm, addr, pte, entry);
 		asm volatile("ptesync": : :"memory");
@@ -1108,10 +1115,14 @@ int __meminit radix__vmemmap_populate(unsigned long start, unsigned long end, in
 		pmd = vmemmap_pmd_alloc(pud, node, addr);
 		if (!pmd)
 			return -ENOMEM;
+
 		if (pmd_none(READ_ONCE(*pmd))) {
 			void *p;
 
-			if (altmap && altmap_cross_boundary(altmap, start, PMD_SIZE)) {
+			if (!IS_ALIGNED(addr, PMD_SIZE))
+				goto base_mapping;
+
+			if (altmap && altmap_cross_boundary(altmap, addr, PMD_SIZE)) {
 				/* make sure we don't create altmap mappings covery things outside. */
 				goto base_mapping;
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/16] powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix
       [not found] ` <20230606045608.55127-3-aneesh.kumar@linux.ibm.com>
@ 2023-06-21  4:08   ` Michael Ellerman
  2023-06-21  5:59     ` Aneesh Kumar K V
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2023-06-21  4:08 UTC (permalink / raw)
  To: Aneesh Kumar K.V, linux-mm, akpm, npiggin, christophe.leroy
  Cc: linuxppc-dev, Oscar Salvador, Mike Kravetz, Dan Williams,
	Joao Martins, Catalin Marinas, Muchun Song, Will Deacon,
	Aneesh Kumar K.V

"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
> This should not be within CONFIG_PPC_64S_HASHS_MMU. We use mmu_vmemmap_psize
> on radix while mapping the vmemmap area.
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
>  arch/powerpc/mm/book3s64/radix_pgtable.c | 2 --
>  1 file changed, 2 deletions(-)

This breaks microwatt_defconfig, which does not enable CONFIG_PPC_64S_HASH_MMU:

  ../arch/powerpc/mm/book3s64/radix_pgtable.c: In function ‘radix__early_init_mmu’:
  ../arch/powerpc/mm/book3s64/radix_pgtable.c:601:27: error: lvalue required as left operand of assignment
    601 |         mmu_virtual_psize = MMU_PAGE_4K;
        |                           ^
  make[5]: *** [../scripts/Makefile.build:252: arch/powerpc/mm/book3s64/radix_pgtable.o] Error 1
  make[4]: *** [../scripts/Makefile.build:494: arch/powerpc/mm/book3s64] Error 2
  make[3]: *** [../scripts/Makefile.build:494: arch/powerpc/mm] Error 2
  make[2]: *** [../scripts/Makefile.build:494: arch/powerpc] Error 2
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [/home/michael/linux/Makefile:2026: .] Error 2
  make: *** [Makefile:226: __sub-make] Error 2

Because mmu_virtual_psize is defined in hash_utils.c, which isn't built.

cheers


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 02/16] powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix
  2023-06-21  4:08   ` [PATCH 02/16] powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix Michael Ellerman
@ 2023-06-21  5:59     ` Aneesh Kumar K V
  0 siblings, 0 replies; 5+ messages in thread
From: Aneesh Kumar K V @ 2023-06-21  5:59 UTC (permalink / raw)
  To: Michael Ellerman, linux-mm, akpm, npiggin, christophe.leroy
  Cc: linuxppc-dev, Oscar Salvador, Mike Kravetz, Dan Williams,
	Joao Martins, Catalin Marinas, Muchun Song, Will Deacon

On 6/21/23 9:38 AM, Michael Ellerman wrote:
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
>> This should not be within CONFIG_PPC_64S_HASHS_MMU. We use mmu_vmemmap_psize
>> on radix while mapping the vmemmap area.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>> ---
>>  arch/powerpc/mm/book3s64/radix_pgtable.c | 2 --
>>  1 file changed, 2 deletions(-)
> 
> This breaks microwatt_defconfig, which does not enable CONFIG_PPC_64S_HASH_MMU:
> 
>   ../arch/powerpc/mm/book3s64/radix_pgtable.c: In function ‘radix__early_init_mmu’:
>   ../arch/powerpc/mm/book3s64/radix_pgtable.c:601:27: error: lvalue required as left operand of assignment
>     601 |         mmu_virtual_psize = MMU_PAGE_4K;
>         |                           ^
>   make[5]: *** [../scripts/Makefile.build:252: arch/powerpc/mm/book3s64/radix_pgtable.o] Error 1
>   make[4]: *** [../scripts/Makefile.build:494: arch/powerpc/mm/book3s64] Error 2
>   make[3]: *** [../scripts/Makefile.build:494: arch/powerpc/mm] Error 2
>   make[2]: *** [../scripts/Makefile.build:494: arch/powerpc] Error 2
>   make[2]: *** Waiting for unfinished jobs....
>   make[1]: *** [/home/michael/linux/Makefile:2026: .] Error 2
>   make: *** [Makefile:226: __sub-make] Error 2
> 
> Because mmu_virtual_psize is defined in hash_utils.c, which isn't built.
> 

Ok i missed the mmu_virtual_psize dependency there. Will add microwatt_defconfig to build configs. 


modified   arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -594,12 +594,14 @@ void __init radix__early_init_mmu(void)
 {
 	unsigned long lpcr;
 
+#ifdef CONFIG_PPC_64S_HASH_MMU
 #ifdef CONFIG_PPC_64K_PAGES
 	/* PAGE_SIZE mappings */
 	mmu_virtual_psize = MMU_PAGE_64K;
 #else
 	mmu_virtual_psize = MMU_PAGE_4K;
 #endif
+#endif
 
 #ifdef CONFIG_SPARSEMEM_VMEMMAP
 	/* vmemmap mapping */



> cheers



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-21  6:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230606045608.55127-1-aneesh.kumar@linux.ibm.com>
2023-06-14  4:11 ` [PATCH 00/16] Add support for DAX vmemmap optimization for ppc64 Aneesh Kumar K.V
     [not found] ` <20230606045608.55127-15-aneesh.kumar@linux.ibm.com>
2023-06-14 10:50   ` [PATCH 14/16] powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap handling function Sachin Sant
2023-06-15  2:23     ` Aneesh Kumar K.V
     [not found] ` <20230606045608.55127-3-aneesh.kumar@linux.ibm.com>
2023-06-21  4:08   ` [PATCH 02/16] powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix Michael Ellerman
2023-06-21  5:59     ` Aneesh Kumar K V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox