LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v10 06/12] powerpc: inline huge vmap supported functions
From: Nicholas Piggin @ 2021-01-25 11:37 UTC (permalink / raw)
  To: Andrew Morton, Christophe Leroy, linux-mm
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	Zefan Li, Jonathan Cameron, Rick Edgecombe, linuxppc-dev
In-Reply-To: <c03010a7-a358-0321-d5d4-80a770c2213f@csgroup.eu>

Excerpts from Christophe Leroy's message of January 25, 2021 6:42 pm:
> 
> 
> Le 24/01/2021 à 09:22, Nicholas Piggin a écrit :
>> This allows unsupported levels to be constant folded away, and so
>> p4d_free_pud_page can be removed because it's no longer linked to.
> 
> Ah, ok, you did it here. Why not squashing this patch into patch 5 directly ?

To reduce arch code movement in the first patch and split up these arch
patches to get separate acks for them.

Maybe overkill for these changes but doesn't hurt I think.

Thanks,
Nick

^ permalink raw reply

* [PATCH] powerpc: remove unneeded semicolons
From: Chengyang Fan @ 2021-01-25  9:53 UTC (permalink / raw)
  To: mpe; +Cc: joe, linuxppc-dev

Remove superfluous semicolons after function definitions.

Signed-off-by: Chengyang Fan <cy.fan@huawei.com>
---
 arch/powerpc/include/asm/book3s/32/mmu-hash.h       |  2 +-
 arch/powerpc/include/asm/book3s/64/mmu.h            |  2 +-
 arch/powerpc/include/asm/book3s/64/tlbflush-radix.h |  2 +-
 arch/powerpc/include/asm/book3s/64/tlbflush.h       |  2 +-
 arch/powerpc/include/asm/firmware.h                 |  2 +-
 arch/powerpc/include/asm/kvm_ppc.h                  |  6 +++---
 arch/powerpc/include/asm/paca.h                     |  6 +++---
 arch/powerpc/include/asm/rtas.h                     |  2 +-
 arch/powerpc/include/asm/setup.h                    |  6 +++---
 arch/powerpc/include/asm/simple_spinlock.h          |  4 ++--
 arch/powerpc/include/asm/smp.h                      |  2 +-
 arch/powerpc/include/asm/xmon.h                     |  4 ++--
 arch/powerpc/kernel/prom.c                          |  2 +-
 arch/powerpc/kernel/setup.h                         | 12 ++++++------
 arch/powerpc/platforms/powernv/subcore.h            |  2 +-
 arch/powerpc/platforms/pseries/pseries.h            |  2 +-
 16 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/32/mmu-hash.h b/arch/powerpc/include/asm/book3s/32/mmu-hash.h
index 685c589e723f..b85f8e114a9c 100644
--- a/arch/powerpc/include/asm/book3s/32/mmu-hash.h
+++ b/arch/powerpc/include/asm/book3s/32/mmu-hash.h
@@ -94,7 +94,7 @@ typedef struct {
 } mm_context_t;
 
 void update_bats(void);
-static inline void cleanup_cpu_mmu_context(void) { };
+static inline void cleanup_cpu_mmu_context(void) { }
 
 /* patch sites */
 extern s32 patch__hash_page_A0, patch__hash_page_A1, patch__hash_page_A2;
diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
index 995bbcdd0ef8..eace8c3f7b0a 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu.h
@@ -239,7 +239,7 @@ static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base,
 #ifdef CONFIG_PPC_PSERIES
 extern void radix_init_pseries(void);
 #else
-static inline void radix_init_pseries(void) { };
+static inline void radix_init_pseries(void) { }
 #endif
 
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
index 94439e0cefc9..8b33601cdb9d 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-radix.h
@@ -35,7 +35,7 @@ extern void radix__flush_pwc_lpid(unsigned int lpid);
 extern void radix__flush_all_lpid(unsigned int lpid);
 extern void radix__flush_all_lpid_guest(unsigned int lpid);
 #else
-static inline void radix__tlbiel_all(unsigned int action) { WARN_ON(1); };
+static inline void radix__tlbiel_all(unsigned int action) { WARN_ON(1); }
 static inline void radix__flush_tlb_lpid_page(unsigned int lpid,
 					unsigned long addr,
 					unsigned long page_size)
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h
index dcb5c3839d2f..215973b4cb26 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h
@@ -31,7 +31,7 @@ static inline void tlbiel_all(void)
 		hash__tlbiel_all(TLB_INVAL_SCOPE_GLOBAL);
 }
 #else
-static inline void tlbiel_all(void) { BUG(); };
+static inline void tlbiel_all(void) { BUG(); }
 #endif
 
 static inline void tlbiel_all_lpid(bool radix)
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h
index aa6a5ef5d483..7604673787d6 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -137,7 +137,7 @@ extern unsigned int __start___fw_ftr_fixup, __stop___fw_ftr_fixup;
 #ifdef CONFIG_PPC_PSERIES
 void pseries_probe_fw_features(void);
 #else
-static inline void pseries_probe_fw_features(void) { };
+static inline void pseries_probe_fw_features(void) { }
 #endif
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 0a056c64c317..259ba4ce9ad3 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -627,9 +627,9 @@ extern int h_ipi_redirect;
 static inline struct kvmppc_passthru_irqmap *kvmppc_get_passthru_irqmap(
 				struct kvm *kvm)
 	{ return NULL; }
-static inline void kvmppc_alloc_host_rm_ops(void) {};
-static inline void kvmppc_free_host_rm_ops(void) {};
-static inline void kvmppc_free_pimap(struct kvm *kvm) {};
+static inline void kvmppc_alloc_host_rm_ops(void) {}
+static inline void kvmppc_free_host_rm_ops(void) {}
+static inline void kvmppc_free_pimap(struct kvm *kvm) {}
 static inline int kvmppc_xics_rm_complete(struct kvm_vcpu *vcpu, u32 hcall)
 	{ return 0; }
 static inline int kvmppc_xics_enabled(struct kvm_vcpu *vcpu)
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 9454d29ff4b4..1a4f6da3be5f 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -285,9 +285,9 @@ extern void free_unused_pacas(void);
 
 #else /* CONFIG_PPC64 */
 
-static inline void allocate_paca_ptrs(void) { };
-static inline void allocate_paca(int cpu) { };
-static inline void free_unused_pacas(void) { };
+static inline void allocate_paca_ptrs(void) { }
+static inline void allocate_paca(int cpu) { }
+static inline void free_unused_pacas(void) { }
 
 #endif /* CONFIG_PPC64 */
 
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 332e1000ca0f..658448ca5b8a 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -369,7 +369,7 @@ void rtas_initialize(void);
 #else
 static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;}
 static inline void pSeries_coalesce_init(void) { }
-static inline void rtas_initialize(void) { };
+static inline void rtas_initialize(void) { }
 #endif
 
 extern int call_rtas(const char *, int, int, unsigned long *, ...);
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index a466749703f1..e89bfebd4e00 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -58,7 +58,7 @@ void do_rfi_flush_fixups(enum l1d_flush_type types);
 #ifdef CONFIG_PPC_BARRIER_NOSPEC
 void setup_barrier_nospec(void);
 #else
-static inline void setup_barrier_nospec(void) { };
+static inline void setup_barrier_nospec(void) { }
 #endif
 void do_uaccess_flush_fixups(enum l1d_flush_type types);
 void do_entry_flush_fixups(enum l1d_flush_type types);
@@ -68,13 +68,13 @@ extern bool barrier_nospec_enabled;
 #ifdef CONFIG_PPC_BARRIER_NOSPEC
 void do_barrier_nospec_fixups_range(bool enable, void *start, void *end);
 #else
-static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { };
+static inline void do_barrier_nospec_fixups_range(bool enable, void *start, void *end) { }
 #endif
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 void setup_spectre_v2(void);
 #else
-static inline void setup_spectre_v2(void) {};
+static inline void setup_spectre_v2(void) {}
 #endif
 void do_btb_flush_fixups(void);
 
diff --git a/arch/powerpc/include/asm/simple_spinlock.h b/arch/powerpc/include/asm/simple_spinlock.h
index 9c3c30534333..5b862de29dff 100644
--- a/arch/powerpc/include/asm/simple_spinlock.h
+++ b/arch/powerpc/include/asm/simple_spinlock.h
@@ -90,8 +90,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
 void splpar_spin_yield(arch_spinlock_t *lock);
 void splpar_rw_yield(arch_rwlock_t *lock);
 #else /* SPLPAR */
-static inline void splpar_spin_yield(arch_spinlock_t *lock) {};
-static inline void splpar_rw_yield(arch_rwlock_t *lock) {};
+static inline void splpar_spin_yield(arch_spinlock_t *lock) {}
+static inline void splpar_rw_yield(arch_rwlock_t *lock) {}
 #endif
 
 static inline void spin_yield(arch_spinlock_t *lock)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index c4e2d53acd2b..7a13bc20f0a0 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -236,7 +236,7 @@ static inline void set_hard_smp_processor_id(int cpu, int phys)
 #if defined(CONFIG_PPC64) && (defined(CONFIG_SMP) || defined(CONFIG_KEXEC_CORE))
 extern void smp_release_cpus(void);
 #else
-static inline void smp_release_cpus(void) { };
+static inline void smp_release_cpus(void) { }
 #endif
 
 extern int smt_enabled_at_boot;
diff --git a/arch/powerpc/include/asm/xmon.h b/arch/powerpc/include/asm/xmon.h
index 454a7fc6113b..68bfb2361f03 100644
--- a/arch/powerpc/include/asm/xmon.h
+++ b/arch/powerpc/include/asm/xmon.h
@@ -17,8 +17,8 @@ struct pt_regs;
 extern int xmon(struct pt_regs *excp);
 extern irqreturn_t xmon_irq(int, void *);
 #else
-static inline void xmon_setup(void) { };
-static inline void xmon_register_spus(struct list_head *list) { };
+static inline void xmon_setup(void) { }
+static inline void xmon_register_spus(struct list_head *list) { }
 #endif
 
 #if defined(CONFIG_XMON) && defined(CONFIG_SMP)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ae3c41730367..9a4797d1d40d 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -707,7 +707,7 @@ static void __init save_fscr_to_task(void)
 		init_task.thread.fscr = mfspr(SPRN_FSCR);
 }
 #else
-static inline void save_fscr_to_task(void) {};
+static inline void save_fscr_to_task(void) {}
 #endif
 
 
diff --git a/arch/powerpc/kernel/setup.h b/arch/powerpc/kernel/setup.h
index 2dd0d9cb5a20..84058bbc8fe9 100644
--- a/arch/powerpc/kernel/setup.h
+++ b/arch/powerpc/kernel/setup.h
@@ -14,31 +14,31 @@ void irqstack_early_init(void);
 #ifdef CONFIG_PPC32
 void setup_power_save(void);
 #else
-static inline void setup_power_save(void) { };
+static inline void setup_power_save(void) { }
 #endif
 
 #if defined(CONFIG_PPC64) && defined(CONFIG_SMP)
 void check_smt_enabled(void);
 #else
-static inline void check_smt_enabled(void) { };
+static inline void check_smt_enabled(void) { }
 #endif
 
 #if defined(CONFIG_PPC_BOOK3E) && defined(CONFIG_SMP)
 void setup_tlb_core_data(void);
 #else
-static inline void setup_tlb_core_data(void) { };
+static inline void setup_tlb_core_data(void) { }
 #endif
 
 #if defined(CONFIG_PPC_BOOK3E) || defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 void exc_lvl_early_init(void);
 #else
-static inline void exc_lvl_early_init(void) { };
+static inline void exc_lvl_early_init(void) { }
 #endif
 
 #if defined(CONFIG_PPC64) || defined(CONFIG_VMAP_STACK)
 void emergency_stack_init(void);
 #else
-static inline void emergency_stack_init(void) { };
+static inline void emergency_stack_init(void) { }
 #endif
 
 #ifdef CONFIG_PPC64
@@ -55,7 +55,7 @@ extern unsigned long spr_default_dscr;
 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
 void kvm_cma_reserve(void);
 #else
-static inline void kvm_cma_reserve(void) { };
+static inline void kvm_cma_reserve(void) { }
 #endif
 
 #ifdef CONFIG_TAU
diff --git a/arch/powerpc/platforms/powernv/subcore.h b/arch/powerpc/platforms/powernv/subcore.h
index c8f574d1c04a..77feee8436d4 100644
--- a/arch/powerpc/platforms/powernv/subcore.h
+++ b/arch/powerpc/platforms/powernv/subcore.h
@@ -15,7 +15,7 @@
 void split_core_secondary_loop(u8 *state);
 extern void update_subcore_sibling_mask(void);
 #else
-static inline void update_subcore_sibling_mask(void) { };
+static inline void update_subcore_sibling_mask(void) { }
 #endif /* CONFIG_SMP */
 
 #endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 593840847cd3..4fe48c04c6c2 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -33,7 +33,7 @@ int smp_query_cpu_stopped(unsigned int pcpu);
 #define QCSS_HARDWARE_ERROR -1
 #define QCSS_HARDWARE_BUSY -2
 #else
-static inline void smp_init_pseries(void) { };
+static inline void smp_init_pseries(void) { }
 #endif
 
 extern void pseries_kexec_cpu_down(int crash_shutdown, int secondary);
-- 
2.25.1


^ permalink raw reply related

* Re: [PATCH v4 2/2] powerpc/mce: Remove per cpu variables from MCE handlers
From: Christophe Leroy @ 2021-01-25  9:24 UTC (permalink / raw)
  To: Ganesh Goudar, linuxppc-dev, mpe; +Cc: mahesh, npiggin
In-Reply-To: <20210122123244.34033-2-ganeshgr@linux.ibm.com>



Le 22/01/2021 à 13:32, Ganesh Goudar a écrit :
> Access to per-cpu variables requires translation to be enabled on
> pseries machine running in hash mmu mode, Since part of MCE handler
> runs in realmode and part of MCE handling code is shared between ppc
> architectures pseries and powernv, it becomes difficult to manage
> these variables differently on different architectures, So have
> these variables in paca instead of having them as per-cpu variables
> to avoid complications.
> 
> Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
> ---
> v2: Dynamically allocate memory for machine check event info
> 
> v3: Remove check for hash mmu lpar, use memblock_alloc_try_nid
>      to allocate memory.
> 
> v4: Spliting the patch into two.
> ---
>   arch/powerpc/include/asm/mce.h     | 18 +++++++
>   arch/powerpc/include/asm/paca.h    |  4 ++
>   arch/powerpc/kernel/mce.c          | 79 ++++++++++++++++++------------
>   arch/powerpc/kernel/setup-common.c |  2 +-
>   4 files changed, 70 insertions(+), 33 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 71f38e9248be..17dc451f0e45 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -916,7 +916,6 @@ void __init setup_arch(char **cmdline_p)
>   	/* On BookE, setup per-core TLB data structures. */
>   	setup_tlb_core_data();
>   #endif
> -

This line removal is really required for this patch ?

>   	/* Print various info about the machine that has been gathered so far. */
>   	print_system_info();
>   
> @@ -938,6 +937,7 @@ void __init setup_arch(char **cmdline_p)
>   	exc_lvl_early_init();
>   	emergency_stack_init();
>   
> +	mce_init();

You have to include mce.h to avoid build failure on PPC32.



>   	smp_release_cpus();
>   
>   	initmem_init();
> 

^ permalink raw reply

* Re: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings
From: Christophe Leroy @ 2021-01-25  9:14 UTC (permalink / raw)
  To: Nicholas Piggin, linux-mm, Andrew Morton
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	Zefan Li, Jonathan Cameron, Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124082230.2118861-12-npiggin@gmail.com>



Le 24/01/2021 à 09:22, Nicholas Piggin a écrit :
> Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC
> enables support on architectures that define HAVE_ARCH_HUGE_VMAP and
> supports PMD sized vmap mappings.
> 
> vmalloc will attempt to allocate PMD-sized pages if allocating PMD size
> or larger, and fall back to small pages if that was unsuccessful.
> 
> Architectures must ensure that any arch specific vmalloc allocations
> that require PAGE_SIZE mappings (e.g., module allocations vs strict
> module rwx) use the VM_NOHUGE flag to inhibit larger mappings.
> 
> When hugepage vmalloc mappings are enabled in the next patch, this
> reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node
> POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%.
> 
> This can result in more internal fragmentation and memory overhead for a
> given allocation, an option nohugevmalloc is added to disable at boot.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   arch/Kconfig            |  10 +++
>   include/linux/vmalloc.h |  18 ++++
>   mm/page_alloc.c         |   5 +-
>   mm/vmalloc.c            | 192 ++++++++++++++++++++++++++++++----------
>   4 files changed, 177 insertions(+), 48 deletions(-)
> 

> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 0377e1d059e5..eef61e0f5170 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c

> @@ -2691,15 +2746,18 @@ EXPORT_SYMBOL_GPL(vmap_pfn);
>   #endif /* CONFIG_VMAP_PFN */
>   
>   static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
> -				 pgprot_t prot, int node)
> +				 pgprot_t prot, unsigned int page_shift,
> +				 int node)
>   {
>   	const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
> -	unsigned int nr_pages = get_vm_area_size(area) >> PAGE_SHIFT;
> -	unsigned long array_size;
> -	unsigned int i;
> +	unsigned int page_order = page_shift - PAGE_SHIFT;
> +	unsigned long addr = (unsigned long)area->addr;
> +	unsigned long size = get_vm_area_size(area);
> +	unsigned int nr_small_pages = size >> PAGE_SHIFT;
>   	struct page **pages;
> +	unsigned int i;
>   
> -	array_size = (unsigned long)nr_pages * sizeof(struct page *);
> +	array_size = (unsigned long)nr_small_pages * sizeof(struct page *);

array_size() is a function in include/linux/overflow.h

For some reason, it breaks the build with your series.


>   	gfp_mask |= __GFP_NOWARN;
>   	if (!(gfp_mask & (GFP_DMA | GFP_DMA32)))
>   		gfp_mask |= __GFP_HIGHMEM;

^ permalink raw reply

* Re: [PATCH v10 06/12] powerpc: inline huge vmap supported functions
From: Christophe Leroy @ 2021-01-25  8:42 UTC (permalink / raw)
  To: Nicholas Piggin, linux-mm, Andrew Morton
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	Zefan Li, Jonathan Cameron, Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124082230.2118861-7-npiggin@gmail.com>



Le 24/01/2021 à 09:22, Nicholas Piggin a écrit :
> This allows unsupported levels to be constant folded away, and so
> p4d_free_pud_page can be removed because it's no longer linked to.

Ah, ok, you did it here. Why not squashing this patch into patch 5 directly ?

> 
> Cc: linuxppc-dev@lists.ozlabs.org
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   arch/powerpc/include/asm/vmalloc.h       | 19 ++++++++++++++++---
>   arch/powerpc/mm/book3s64/radix_pgtable.c | 21 ---------------------
>   2 files changed, 16 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/vmalloc.h b/arch/powerpc/include/asm/vmalloc.h
> index 105abb73f075..3f0c153befb0 100644
> --- a/arch/powerpc/include/asm/vmalloc.h
> +++ b/arch/powerpc/include/asm/vmalloc.h
> @@ -1,12 +1,25 @@
>   #ifndef _ASM_POWERPC_VMALLOC_H
>   #define _ASM_POWERPC_VMALLOC_H
>   
> +#include <asm/mmu.h>
>   #include <asm/page.h>
>   
>   #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
> -bool arch_vmap_p4d_supported(pgprot_t prot);
> -bool arch_vmap_pud_supported(pgprot_t prot);
> -bool arch_vmap_pmd_supported(pgprot_t prot);
> +static inline bool arch_vmap_p4d_supported(pgprot_t prot)
> +{
> +	return false;
> +}
> +
> +static inline bool arch_vmap_pud_supported(pgprot_t prot)
> +{
> +	/* HPT does not cope with large pages in the vmalloc area */
> +	return radix_enabled();
> +}
> +
> +static inline bool arch_vmap_pmd_supported(pgprot_t prot)
> +{
> +	return radix_enabled();
> +}
>   #endif
>   
>   #endif /* _ASM_POWERPC_VMALLOC_H */
> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
> index 743807fc210f..8da62afccee5 100644
> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
> @@ -1082,22 +1082,6 @@ void radix__ptep_modify_prot_commit(struct vm_area_struct *vma,
>   	set_pte_at(mm, addr, ptep, pte);
>   }
>   
> -bool arch_vmap_pud_supported(pgprot_t prot)
> -{
> -	/* HPT does not cope with large pages in the vmalloc area */
> -	return radix_enabled();
> -}
> -
> -bool arch_vmap_pmd_supported(pgprot_t prot)
> -{
> -	return radix_enabled();
> -}
> -
> -int p4d_free_pud_page(p4d_t *p4d, unsigned long addr)
> -{
> -	return 0;
> -}
> -
>   int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
>   {
>   	pte_t *ptep = (pte_t *)pud;
> @@ -1181,8 +1165,3 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
>   
>   	return 1;
>   }
> -
> -bool arch_vmap_p4d_supported(pgprot_t prot)
> -{
> -	return false;
> -}
> 

^ permalink raw reply

* Re: [PATCH v10 05/12] mm: HUGE_VMAP arch support cleanup
From: Christophe Leroy @ 2021-01-25  8:40 UTC (permalink / raw)
  To: Nicholas Piggin, linux-mm, Andrew Morton
  Cc: linux-arch, x86, H. Peter Anvin, Will Deacon, Catalin Marinas,
	Ding Tianhong, linux-kernel, Christoph Hellwig, Zefan Li,
	Borislav Petkov, Jonathan Cameron, Thomas Gleixner,
	Rick Edgecombe, linuxppc-dev, Ingo Molnar, linux-arm-kernel
In-Reply-To: <20210124082230.2118861-6-npiggin@gmail.com>



Le 24/01/2021 à 09:22, Nicholas Piggin a écrit :
> This changes the awkward approach where architectures provide init
> functions to determine which levels they can provide large mappings for,
> to one where the arch is queried for each call.
> 
> This removes code and indirection, and allows constant-folding of dead
> code for unsupported levels.

It looks like this is only the case when CONFIG_HAVE_ARCH_HUGE_VMAP is not defined.

When it is defined, for exemple on powerpc you defined arch_vmap_p4d_supported() as a regular 
function in arch/powerpc/mm/book3s64/radix_pgtable.c, so allthough it returns always false, it won't 
constant fold dead code.

> 
> This also adds a prot argument to the arch query. This is unused
> currently but could help with some architectures (e.g., some powerpc
> processors can't map uncacheable memory with large pages).
> 
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: x86@kernel.org
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64]
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   arch/arm64/include/asm/vmalloc.h         |  8 +++
>   arch/arm64/mm/mmu.c                      | 10 +--
>   arch/powerpc/include/asm/vmalloc.h       |  8 +++
>   arch/powerpc/mm/book3s64/radix_pgtable.c |  8 +--
>   arch/x86/include/asm/vmalloc.h           |  7 ++
>   arch/x86/mm/ioremap.c                    | 12 ++--
>   include/linux/io.h                       |  9 ---
>   include/linux/vmalloc.h                  |  6 ++
>   init/main.c                              |  1 -
>   mm/ioremap.c                             | 88 +++++++++---------------
>   10 files changed, 79 insertions(+), 78 deletions(-)
> 

Christophe

^ permalink raw reply

* Re: [PATCH v10 05/12] mm: HUGE_VMAP arch support cleanup
From: Christophe Leroy @ 2021-01-25  8:19 UTC (permalink / raw)
  To: Christoph Hellwig, Nicholas Piggin
  Cc: linux-arch, x86, H. Peter Anvin, Will Deacon, Ingo Molnar,
	Catalin Marinas, Ding Tianhong, linux-kernel, linux-mm, Zefan Li,
	Borislav Petkov, Jonathan Cameron, Andrew Morton, Rick Edgecombe,
	linuxppc-dev, Thomas Gleixner, linux-arm-kernel
In-Reply-To: <20210124114008.GE694255@infradead.org>



Le 24/01/2021 à 12:40, Christoph Hellwig a écrit :
>> diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.h
>> index 2ca708ab9b20..597b40405319 100644
>> --- a/arch/arm64/include/asm/vmalloc.h
>> +++ b/arch/arm64/include/asm/vmalloc.h
>> @@ -1,4 +1,12 @@
>>   #ifndef _ASM_ARM64_VMALLOC_H
>>   #define _ASM_ARM64_VMALLOC_H
>>   
>> +#include <asm/page.h>
>> +
>> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
>> +bool arch_vmap_p4d_supported(pgprot_t prot);
>> +bool arch_vmap_pud_supported(pgprot_t prot);
>> +bool arch_vmap_pmd_supported(pgprot_t prot);
>> +#endif
> 
> Shouldn't the be inlines or macros?  Also it would be useful
> if the architectures would not have to override all functions
> but just those that are it actually implements?
> 
> Also lots of > 80 char lines in the patch.
> 

Since https://github.com/linuxppc/linux/commit/bdc48fa11e46f867ea4d75fa59ee87a7f48be144
this 80 char limit is not strongly enforced anymore.

Allthough 80 is still the prefered limit, code is often more readable with a slightly longer single 
line that with lines splited.

Christophe

^ permalink raw reply

* [PATCH] KVM: PPC: Book3S: Assign boolean values to a bool variable
From: Jiapeng Zhong @ 2021-01-25  7:59 UTC (permalink / raw)
  To: paulus; +Cc: linux-kernel, kvm-ppc, Jiapeng Zhong, linuxppc-dev

Fix the following coccicheck warnings:

./arch/powerpc/kvm/book3s_hv_rm_xics.c:381:3-15: WARNING: Assignment of
0/1 to bool variable.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 arch/powerpc/kvm/book3s_hv_rm_xics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
index c2c9c73..68e509d 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
@@ -378,7 +378,7 @@ static void icp_rm_deliver_irq(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
 			arch_spin_unlock(&ics->lock);
 			icp->n_reject++;
 			new_irq = reject;
-			check_resend = 0;
+			check_resend = false;
 			goto again;
 		}
 	} else {
-- 
1.8.3.1


^ permalink raw reply related

* Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool
From: Jon Masters @ 2021-01-25  5:26 UTC (permalink / raw)
  To: Florian Fainelli, Konrad Rzeszutek Wilk, Claire Chang
  Cc: heikki.krogerus, peterz, grant.likely, paulus, will,
	Christoph Hellwig, Marek Szyprowski, sstabellini, Saravana Kannan,
	Frank Rowand, Joerg Roedel, rafael.j.wysocki, mingo,
	Bartosz Golaszewski, xen-devel, Thierry Reding, linux-devicetree,
	dan.j.williams, Robin Murphy, Rob Herring, boris.ostrovsky,
	Andy Shevchenko, jgross, Nicolas Boichat, Greg KH, rdunlap, lkml,
	Tomasz Figa, iommu, xypron.glpk, linuxppc-dev, bauerman
In-Reply-To: <aa5af7d1-779e-f0f6-e6ba-8040e603523f@gmail.com>

On 1/7/21 1:09 PM, Florian Fainelli wrote:
> On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote:
>> On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote:
>>> Hi Greg and Konrad,
>>>
>>> This change is intended to be non-arch specific. Any arch that lacks DMA access
>>> control and has devices not behind an IOMMU can make use of it. Could you share
>>> why you think this should be arch specific?
>>
>> The idea behind non-arch specific code is it to be generic. The devicetree
>> is specific to PowerPC, Sparc, and ARM, and not to x86 - hence it should
>> be in arch specific code.
> 
> In premise the same code could be used with an ACPI enabled system with
> an appropriate service to identify the restricted DMA regions and unlock
> them.
> 
> More than 1 architecture requiring this function (ARM and ARM64 are the
> two I can think of needing this immediately) sort of calls for making
> the code architecture agnostic since past 2, you need something that scales.
> 
> There is already code today under kernel/dma/contiguous.c that is only
> activated on a CONFIG_OF=y && CONFIG_OF_RESERVED_MEM=y system, this is
> no different.

<unrelated to these patches, which are useful for the case cited>

Just a note for history/archives that this approach would not be 
appropriate on general purpose Arm systems, such as SystemReady-ES 
edge/non-server platforms seeking to run general purpose distros. I want 
to have that in the record before someone at Arm (or NVidia, or a bunch 
of others that come to mind who have memory firewalls) gets an idea.

If you're working at an Arm vendor and come looking at this later 
thinking "wow, what a great idea!", please fix your hardware to have a 
real IOMMU/SMMU and real PCIe. You'll be pointed at this reply.

Jon.

-- 
Computer Architect

^ permalink raw reply

* Re: [PATCH] lib/sstep: Fix incorrect return from analyze_instr()
From: Ananth N Mavinakayanahalli @ 2021-01-25  4:52 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev
  Cc: naveen.n.rao, ravi.bangoria, paulus, sandipan
In-Reply-To: <87zh10pk50.fsf@mpe.ellerman.id.au>

On 1/23/21 6:03 AM, Michael Ellerman wrote:
> Ananth N Mavinakayanahalli <ananth@linux.ibm.com> writes:
>> We currently just percolate the return value from analyze_instr()
>> to the caller of emulate_step(), especially if it is a -1.
>>
>> For one particular case (opcode = 4) for instructions that
>> aren't currently emulated, we are returning 'should not be
>> single-stepped' while we should have returned 0 which says
>> 'did not emulate, may have to single-step'.
>>
>> Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
>> Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
>> ---
>>   arch/powerpc/lib/sstep.c |   49 +++++++++++++++++++++++++---------------------
>>   1 file changed, 27 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
>> index 5a425a4a1d88..a3a0373843cd 100644
>> --- a/arch/powerpc/lib/sstep.c
>> +++ b/arch/powerpc/lib/sstep.c
>> @@ -1445,34 +1445,39 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
>>   
>>   #ifdef __powerpc64__
>>   	case 4:
>> -		if (!cpu_has_feature(CPU_FTR_ARCH_300))
>> -			return -1;
>> -
>> -		switch (word & 0x3f) {
>> -		case 48:	/* maddhd */
>> -			asm volatile(PPC_MADDHD(%0, %1, %2, %3) :
>> -				     "=r" (op->val) : "r" (regs->gpr[ra]),
>> -				     "r" (regs->gpr[rb]), "r" (regs->gpr[rc]));
>> -			goto compute_done;
>> +		/*
>> +		 * There are very many instructions with this primary opcode
>> +		 * introduced in the ISA as early as v2.03. However, the ones
>> +		 * we currently emulate were all introduced with ISA 3.0
>> +		 */
>> +		if (cpu_has_feature(CPU_FTR_ARCH_300)) {
>> +			switch (word & 0x3f) {
>> +			case 48:	/* maddhd */
>> +				asm volatile(PPC_MADDHD(%0, %1, %2, %3) :
>> +					     "=r" (op->val) : "r" (regs->gpr[ra]),
>> +					     "r" (regs->gpr[rb]), "r" (regs->gpr[rc]));
>> +				goto compute_done;
> 
> Indenting everything makes this patch harder to read, and I think makes
> the resulting code harder to read too. We already have two levels of
> switch here, and we're inside a ~1700 line function, so keeping things
> simple is important I think.
> 
> Doesn't this achieve the same result?
> 
> diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
> index bf7a7d62ae8b..d631baaf1da2 100644
> --- a/arch/powerpc/lib/sstep.c
> +++ b/arch/powerpc/lib/sstep.c
> @@ -1443,8 +1443,10 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
>   
>   #ifdef __powerpc64__
>   	case 4:
> -		if (!cpu_has_feature(CPU_FTR_ARCH_300))
> -			return -1;
> +		if (!cpu_has_feature(CPU_FTR_ARCH_300)) {
> +			op->type = UNKNOWN;
> +			return 0;
> +		}
>   
>   		switch (word & 0x3f) {
>   		case 48:	/* maddhd */
> @@ -1470,7 +1472,8 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
>   		 * There are other instructions from ISA 3.0 with the same
>   		 * primary opcode which do not have emulation support yet.
>   		 */
> -		return -1;
> +		op->type = UNKNOWN;
> +		return 0;
>   #endif
>   
>   	case 7:		/* mulli */
> 

Looks good to me.

Acked-by: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>


-- 
Ananth

^ permalink raw reply

* [powerpc:merge] BUILD SUCCESS 44158b256b30415079588d0fcb1bccbdc2ccd009
From: kernel test robot @ 2021-01-25  3:58 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: 44158b256b30415079588d0fcb1bccbdc2ccd009  Automatic merge of 'fixes' into merge (2021-01-24 09:52)

elapsed time: 954m

configs tested: 140
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
mips                         tb0287_defconfig
mips                         mpc30x_defconfig
arm                           h5000_defconfig
sh                          rsk7264_defconfig
powerpc                 linkstation_defconfig
arm                      pxa255-idp_defconfig
arm                     am200epdkit_defconfig
mips                      pistachio_defconfig
xtensa                  cadence_csp_defconfig
powerpc                      chrp32_defconfig
arm                             mxs_defconfig
mips                     cu1000-neo_defconfig
powerpc                     tqm8560_defconfig
powerpc64                        alldefconfig
sh                        sh7757lcr_defconfig
sh                          kfr2r09_defconfig
arm                       cns3420vb_defconfig
powerpc                     ppa8548_defconfig
m68k                          multi_defconfig
sh                      rts7751r2d1_defconfig
mips                         tb0219_defconfig
mips                           ip27_defconfig
m68k                         apollo_defconfig
arc                        nsimosci_defconfig
powerpc                  mpc885_ads_defconfig
s390                          debug_defconfig
arm                          iop32x_defconfig
arm                          tango4_defconfig
mips                        nlm_xlr_defconfig
arm                          pxa3xx_defconfig
arm                         hackkit_defconfig
arm                          pcm027_defconfig
sh                            shmin_defconfig
powerpc                     mpc512x_defconfig
arm                      integrator_defconfig
h8300                       h8s-sim_defconfig
powerpc                      mgcoge_defconfig
arm                       aspeed_g5_defconfig
sh                     sh7710voipgw_defconfig
arm                          imote2_defconfig
mips                     loongson1b_defconfig
arm                            dove_defconfig
arm                            mps2_defconfig
sh                   rts7751r2dplus_defconfig
mips                        workpad_defconfig
powerpc                      walnut_defconfig
arm                           sama5_defconfig
mips                          ath79_defconfig
sh                           se7751_defconfig
mips                         bigsur_defconfig
csky                             alldefconfig
arm                          pxa168_defconfig
ia64                             allmodconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                             allnoconfig
c6x                              allyesconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                             allyesconfig
parisc                           allyesconfig
s390                                defconfig
i386                             allyesconfig
sparc                            allyesconfig
sparc                               defconfig
i386                               tinyconfig
i386                                defconfig
mips                             allyesconfig
mips                             allmodconfig
powerpc                          allyesconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a001-20210124
i386                 randconfig-a002-20210124
i386                 randconfig-a003-20210124
i386                 randconfig-a001-20210125
i386                 randconfig-a002-20210125
i386                 randconfig-a004-20210125
i386                 randconfig-a006-20210125
i386                 randconfig-a005-20210125
i386                 randconfig-a003-20210125
i386                 randconfig-a004-20210124
i386                 randconfig-a006-20210124
i386                 randconfig-a005-20210124
x86_64               randconfig-a012-20210124
x86_64               randconfig-a016-20210124
x86_64               randconfig-a015-20210124
x86_64               randconfig-a011-20210124
x86_64               randconfig-a013-20210124
x86_64               randconfig-a014-20210124
i386                 randconfig-a013-20210124
i386                 randconfig-a011-20210124
i386                 randconfig-a012-20210124
i386                 randconfig-a015-20210124
i386                 randconfig-a014-20210124
i386                 randconfig-a016-20210124
x86_64               randconfig-a003-20210125
x86_64               randconfig-a002-20210125
x86_64               randconfig-a001-20210125
x86_64               randconfig-a005-20210125
x86_64               randconfig-a006-20210125
x86_64               randconfig-a004-20210125
riscv                    nommu_k210_defconfig
riscv                            allyesconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                          rv32_defconfig
riscv                            allmodconfig
x86_64                                   rhel
x86_64                           allyesconfig
x86_64                    rhel-7.6-kselftests
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                      rhel-8.3-kbuiltin
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a003-20210124
x86_64               randconfig-a002-20210124
x86_64               randconfig-a001-20210124
x86_64               randconfig-a005-20210124
x86_64               randconfig-a006-20210124
x86_64               randconfig-a004-20210124

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply

* [powerpc:fixes-test] BUILD SUCCESS 4025c784c573cab7e3f84746cc82b8033923ec62
From: kernel test robot @ 2021-01-25  3:57 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test
branch HEAD: 4025c784c573cab7e3f84746cc82b8033923ec62  powerpc/64s: prevent recursive replay_soft_interrupts causing superfluous interrupt

elapsed time: 956m

configs tested: 147
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
mips                         tb0287_defconfig
mips                         mpc30x_defconfig
arm                           h5000_defconfig
sh                          rsk7264_defconfig
powerpc                 linkstation_defconfig
arm                      pxa255-idp_defconfig
arm                     am200epdkit_defconfig
mips                      pistachio_defconfig
xtensa                  cadence_csp_defconfig
arm                       aspeed_g5_defconfig
powerpc                 mpc832x_mds_defconfig
arm                          pcm027_defconfig
mips                        qi_lb60_defconfig
mips                  decstation_64_defconfig
powerpc                      chrp32_defconfig
arm                             mxs_defconfig
mips                     cu1000-neo_defconfig
powerpc                     tqm8560_defconfig
powerpc64                        alldefconfig
sh                        sh7757lcr_defconfig
sh                          kfr2r09_defconfig
arm                       cns3420vb_defconfig
powerpc                     ppa8548_defconfig
m68k                          multi_defconfig
sh                      rts7751r2d1_defconfig
mips                         tb0219_defconfig
mips                           ip27_defconfig
m68k                         apollo_defconfig
arc                        nsimosci_defconfig
powerpc                  mpc885_ads_defconfig
s390                          debug_defconfig
arm                          iop32x_defconfig
arm                          tango4_defconfig
mips                        nlm_xlr_defconfig
arm                          pxa3xx_defconfig
arm                         hackkit_defconfig
sh                            shmin_defconfig
powerpc                     mpc512x_defconfig
arm                      integrator_defconfig
arm                         cm_x300_defconfig
powerpc                 mpc8540_ads_defconfig
sh                          r7785rp_defconfig
arm                           sunxi_defconfig
h8300                       h8s-sim_defconfig
powerpc                      mgcoge_defconfig
sh                     sh7710voipgw_defconfig
arm                          imote2_defconfig
mips                     loongson1b_defconfig
arm                            dove_defconfig
arm                            mps2_defconfig
sh                   rts7751r2dplus_defconfig
mips                        workpad_defconfig
powerpc                      walnut_defconfig
arm                           sama5_defconfig
mips                          ath79_defconfig
sh                           se7751_defconfig
mips                         bigsur_defconfig
csky                             alldefconfig
arm                          pxa168_defconfig
ia64                             allmodconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                             allnoconfig
c6x                              allyesconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                             allyesconfig
parisc                           allyesconfig
s390                                defconfig
i386                             allyesconfig
sparc                            allyesconfig
sparc                               defconfig
i386                               tinyconfig
i386                                defconfig
mips                             allmodconfig
mips                             allyesconfig
powerpc                          allyesconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a001-20210124
i386                 randconfig-a002-20210124
i386                 randconfig-a003-20210124
i386                 randconfig-a004-20210124
i386                 randconfig-a006-20210124
i386                 randconfig-a005-20210124
i386                 randconfig-a001-20210125
i386                 randconfig-a002-20210125
i386                 randconfig-a004-20210125
i386                 randconfig-a006-20210125
i386                 randconfig-a005-20210125
i386                 randconfig-a003-20210125
x86_64               randconfig-a012-20210124
x86_64               randconfig-a016-20210124
x86_64               randconfig-a015-20210124
x86_64               randconfig-a011-20210124
x86_64               randconfig-a013-20210124
x86_64               randconfig-a014-20210124
i386                 randconfig-a013-20210124
i386                 randconfig-a011-20210124
i386                 randconfig-a012-20210124
i386                 randconfig-a015-20210124
i386                 randconfig-a014-20210124
i386                 randconfig-a016-20210124
x86_64               randconfig-a003-20210125
x86_64               randconfig-a002-20210125
x86_64               randconfig-a001-20210125
x86_64               randconfig-a005-20210125
x86_64               randconfig-a006-20210125
x86_64               randconfig-a004-20210125
riscv                    nommu_k210_defconfig
riscv                            allyesconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                          rv32_defconfig
riscv                            allmodconfig
x86_64                                   rhel
x86_64                           allyesconfig
x86_64                    rhel-7.6-kselftests
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                      rhel-8.3-kbuiltin
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a003-20210124
x86_64               randconfig-a002-20210124
x86_64               randconfig-a001-20210124
x86_64               randconfig-a005-20210124
x86_64               randconfig-a006-20210124
x86_64               randconfig-a004-20210124

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply

* Re: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings
From: Nicholas Piggin @ 2021-01-24 23:17 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, Randy Dunlap, Ding Tianhong, linux-kernel, linux-mm,
	Zefan Li, Jonathan Cameron, Andrew Morton, Rick Edgecombe,
	linuxppc-dev
In-Reply-To: <20210124150729.GC733865@infradead.org>

Excerpts from Christoph Hellwig's message of January 25, 2021 1:07 am:
> On Sun, Jan 24, 2021 at 06:22:29PM +1000, Nicholas Piggin wrote:
>> diff --git a/arch/Kconfig b/arch/Kconfig
>> index 24862d15f3a3..f87feb616184 100644
>> --- a/arch/Kconfig
>> +++ b/arch/Kconfig
>> @@ -724,6 +724,16 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
>>  config HAVE_ARCH_HUGE_VMAP
>>  	bool
>>  
>> +config HAVE_ARCH_HUGE_VMALLOC
>> +	depends on HAVE_ARCH_HUGE_VMAP
>> +	bool
>> +	help
>> +	  Archs that select this would be capable of PMD-sized vmaps (i.e.,
>> +	  arch_vmap_pmd_supported() returns true), and they must make no
>> +	  assumptions that vmalloc memory is mapped with PAGE_SIZE ptes. The
>> +	  VM_NOHUGE flag can be used to prohibit arch-specific allocations from
>> +	  using hugepages to help with this (e.g., modules may require it).
> 
> help texts don't make sense for options that aren't user visible.

Yeah it was supposed to just be a comment but if it was user visible 
then similar kind of thing would not make sense in help text, so I'll
just turn it into a real comment as per Randy's suggestion.

> More importantly, is there any good reason to keep the option and not
> just go the extra step and enable huge page vmalloc for arm64 and x86
> as well?

Yes they need to ensure they exclude vmallocs that can't be huge one
way or another (VM_ flag or prot arg).

After they're converted we can fold it into HUGE_VMAP.

>> +static inline bool is_vm_area_hugepages(const void *addr)
>> +{
>> +	/*
>> +	 * This may not 100% tell if the area is mapped with > PAGE_SIZE
>> +	 * page table entries, if for some reason the architecture indicates
>> +	 * larger sizes are available but decides not to use them, nothing
>> +	 * prevents that. This only indicates the size of the physical page
>> +	 * allocated in the vmalloc layer.
>> +	 */
>> +	return (find_vm_area(addr)->page_order > 0);
> 
> No need for the braces here.
> 
>>  }
>>  
>> +static int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
>> +		pgprot_t prot, struct page **pages, unsigned int page_shift)
>> +{
>> +	unsigned int i, nr = (end - addr) >> PAGE_SHIFT;
>> +
>> +	WARN_ON(page_shift < PAGE_SHIFT);
>> +
>> +	if (page_shift == PAGE_SHIFT)
>> +		return vmap_small_pages_range_noflush(addr, end, prot, pages);
> 
> This begs for a IS_ENABLED check to disable the hugepage code for
> architectures that don't need it.

Yeah good point.

>> +int map_kernel_range_noflush(unsigned long addr, unsigned long size,
>> +			     pgprot_t prot, struct page **pages)
>> +{
>> +	return vmap_pages_range_noflush(addr, addr + size, prot, pages, PAGE_SHIFT);
>> +}
> 
> Please just kill off map_kernel_range_noflush and map_kernel_range
> off entirely in favor of the vmap versions.

I can do a cleanup patch on top of it.

>> +	for (i = 0; i < area->nr_pages; i += 1U << area->page_order) {
> 
> Maybe using a helper that takes the vm_area_struct and either returns
> area->page_order or always 0 based on IS_ENABLED?

I'll see how it looks.

Thanks,
Nick

^ permalink raw reply

* [PATCH] powerpc: Update broken clean & mrproper
From: Andrew Delgadillo @ 2021-01-24 22:30 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev
  Cc: Andrew Delgadillo

commit cc8a51ca6f05 ("kbuild: always create directories of targets") breaks
mrproper on ppc. arch/powerpc/boot/arch/ is not cleaned up when running
mrproper. Before this patch:

$ make ARCH=powerpc
$ make ARCH=powerpc mrproper
$ git clean -ndxf
Would remove arch/powerpc/boot/arch

After this patch, the directory reported by git clean is no longer
reported.

Fixes: cc8a51ca6f05 ("kbuild: always create directories of targets")
Signed-off-by: Andrew Delgadillo <adelg@google.com>
---
 arch/powerpc/boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 2b8da923ceca..3cc762cce1a4 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -454,7 +454,7 @@ PHONY += install zInstall
 clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
 	zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
 	zImage.miboot zImage.pmac zImage.pseries \
-	zImage.maple simpleImage.* otheros.bld
+	zImage.maple simpleImage.* otheros.bld arch
 
 # clean up files cached by wrapper
 clean-kernel-base := vmlinux.strip vmlinux.bin
-- 
2.30.0.280.ga3ce27912f-goog


^ permalink raw reply related

* Re: [PATCH v4 2/2] powerpc/mce: Remove per cpu variables from MCE handlers
From: kernel test robot @ 2021-01-24 19:45 UTC (permalink / raw)
  To: Ganesh Goudar, linuxppc-dev, mpe
  Cc: clang-built-linux, Ganesh Goudar, kbuild-all, mahesh, npiggin
In-Reply-To: <20210122123244.34033-2-ganeshgr@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 5011 bytes --]

Hi Ganesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.11-rc4 next-20210122]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ganesh-Goudar/powerpc-mce-Reduce-the-size-of-event-arrays/20210124-191230
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r005-20210124 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project bd3a387ee76f58caa0d7901f3f84e9bb3d006f27)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/fab6401db419da33d1757ebf519f030ab758ae7a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ganesh-Goudar/powerpc-mce-Reduce-the-size-of-event-arrays/20210124-191230
        git checkout fab6401db419da33d1757ebf519f030ab758ae7a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/powerpc/kernel/setup-common.c:940:2: error: implicit declaration of function 'mce_init' [-Werror,-Wimplicit-function-declaration]
           mce_init();
           ^
   1 error generated.


vim +/mce_init +940 arch/powerpc/kernel/setup-common.c

   847	
   848	/*
   849	 * Called into from start_kernel this initializes memblock, which is used
   850	 * to manage page allocation until mem_init is called.
   851	 */
   852	void __init setup_arch(char **cmdline_p)
   853	{
   854		kasan_init();
   855	
   856		*cmdline_p = boot_command_line;
   857	
   858		/* Set a half-reasonable default so udelay does something sensible */
   859		loops_per_jiffy = 500000000 / HZ;
   860	
   861		/* Unflatten the device-tree passed by prom_init or kexec */
   862		unflatten_device_tree();
   863	
   864		/*
   865		 * Initialize cache line/block info from device-tree (on ppc64) or
   866		 * just cputable (on ppc32).
   867		 */
   868		initialize_cache_info();
   869	
   870		/* Initialize RTAS if available. */
   871		rtas_initialize();
   872	
   873		/* Check if we have an initrd provided via the device-tree. */
   874		check_for_initrd();
   875	
   876		/* Probe the machine type, establish ppc_md. */
   877		probe_machine();
   878	
   879		/* Setup panic notifier if requested by the platform. */
   880		setup_panic();
   881	
   882		/*
   883		 * Configure ppc_md.power_save (ppc32 only, 64-bit machines do
   884		 * it from their respective probe() function.
   885		 */
   886		setup_power_save();
   887	
   888		/* Discover standard serial ports. */
   889		find_legacy_serial_ports();
   890	
   891		/* Register early console with the printk subsystem. */
   892		register_early_udbg_console();
   893	
   894		/* Setup the various CPU maps based on the device-tree. */
   895		smp_setup_cpu_maps();
   896	
   897		/* Initialize xmon. */
   898		xmon_setup();
   899	
   900		/* Check the SMT related command line arguments (ppc64). */
   901		check_smt_enabled();
   902	
   903		/* Parse memory topology */
   904		mem_topology_setup();
   905	
   906		/*
   907		 * Release secondary cpus out of their spinloops at 0x60 now that
   908		 * we can map physical -> logical CPU ids.
   909		 *
   910		 * Freescale Book3e parts spin in a loop provided by firmware,
   911		 * so smp_release_cpus() does nothing for them.
   912		 */
   913	#ifdef CONFIG_SMP
   914		smp_setup_pacas();
   915	
   916		/* On BookE, setup per-core TLB data structures. */
   917		setup_tlb_core_data();
   918	#endif
   919		/* Print various info about the machine that has been gathered so far. */
   920		print_system_info();
   921	
   922		/* Reserve large chunks of memory for use by CMA for KVM. */
   923		kvm_cma_reserve();
   924	
   925		/*  Reserve large chunks of memory for us by CMA for hugetlb */
   926		gigantic_hugetlb_cma_reserve();
   927	
   928		klp_init_thread_info(&init_task);
   929	
   930		init_mm.start_code = (unsigned long)_stext;
   931		init_mm.end_code = (unsigned long) _etext;
   932		init_mm.end_data = (unsigned long) _edata;
   933		init_mm.brk = klimit;
   934	
   935		mm_iommu_init(&init_mm);
   936		irqstack_early_init();
   937		exc_lvl_early_init();
   938		emergency_stack_init();
   939	
 > 940		mce_init();

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25713 bytes --]

^ permalink raw reply

* Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.11-5 tag
From: pr-tracker-bot @ 2021-01-24 18:34 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Linus Torvalds, linux-kernel, npiggin, sandipan
In-Reply-To: <87tur6pm2v.fsf@mpe.ellerman.id.au>

The pull request you sent on Sun, 24 Jan 2021 23:15:52 +1100:

> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.11-5

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/14c50a66183856672d822f25dbb73ad26d1e8f11

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply

* Re: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings
From: Randy Dunlap @ 2021-01-24 18:06 UTC (permalink / raw)
  To: Christoph Hellwig, Nicholas Piggin
  Cc: linux-arch, Ding Tianhong, linux-kernel, linux-mm, Zefan Li,
	Jonathan Cameron, Andrew Morton, Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124150729.GC733865@infradead.org>

On 1/24/21 7:07 AM, Christoph Hellwig wrote:
>> +config HAVE_ARCH_HUGE_VMALLOC
>> +	depends on HAVE_ARCH_HUGE_VMAP
>> +	bool
>> +	help
>> +	  Archs that select this would be capable of PMD-sized vmaps (i.e.,
>> +	  arch_vmap_pmd_supported() returns true), and they must make no
>> +	  assumptions that vmalloc memory is mapped with PAGE_SIZE ptes. The
>> +	  VM_NOHUGE flag can be used to prohibit arch-specific allocations from
>> +	  using hugepages to help with this (e.g., modules may require it).
> help texts don't make sense for options that aren't user visible.

It's good that the Kconfig symbol is documented and it's better here
than having to dig thru git commit logs IMO.

It could be done as "# Arhcs that select" style comments instead
of Kconfig help text.


-- 
~Randy


^ permalink raw reply

* Re: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings
From: Christoph Hellwig @ 2021-01-24 15:07 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	linux-mm, Zefan Li, Jonathan Cameron, Andrew Morton,
	Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124082230.2118861-12-npiggin@gmail.com>

On Sun, Jan 24, 2021 at 06:22:29PM +1000, Nicholas Piggin wrote:
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 24862d15f3a3..f87feb616184 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -724,6 +724,16 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
>  config HAVE_ARCH_HUGE_VMAP
>  	bool
>  
> +config HAVE_ARCH_HUGE_VMALLOC
> +	depends on HAVE_ARCH_HUGE_VMAP
> +	bool
> +	help
> +	  Archs that select this would be capable of PMD-sized vmaps (i.e.,
> +	  arch_vmap_pmd_supported() returns true), and they must make no
> +	  assumptions that vmalloc memory is mapped with PAGE_SIZE ptes. The
> +	  VM_NOHUGE flag can be used to prohibit arch-specific allocations from
> +	  using hugepages to help with this (e.g., modules may require it).

help texts don't make sense for options that aren't user visible.

More importantly, is there any good reason to keep the option and not
just go the extra step and enable huge page vmalloc for arm64 and x86
as well?

> +static inline bool is_vm_area_hugepages(const void *addr)
> +{
> +	/*
> +	 * This may not 100% tell if the area is mapped with > PAGE_SIZE
> +	 * page table entries, if for some reason the architecture indicates
> +	 * larger sizes are available but decides not to use them, nothing
> +	 * prevents that. This only indicates the size of the physical page
> +	 * allocated in the vmalloc layer.
> +	 */
> +	return (find_vm_area(addr)->page_order > 0);

No need for the braces here.

>  }
>  
> +static int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
> +		pgprot_t prot, struct page **pages, unsigned int page_shift)
> +{
> +	unsigned int i, nr = (end - addr) >> PAGE_SHIFT;
> +
> +	WARN_ON(page_shift < PAGE_SHIFT);
> +
> +	if (page_shift == PAGE_SHIFT)
> +		return vmap_small_pages_range_noflush(addr, end, prot, pages);

This begs for a IS_ENABLED check to disable the hugepage code for
architectures that don't need it.

> +int map_kernel_range_noflush(unsigned long addr, unsigned long size,
> +			     pgprot_t prot, struct page **pages)
> +{
> +	return vmap_pages_range_noflush(addr, addr + size, prot, pages, PAGE_SHIFT);
> +}

Please just kill off map_kernel_range_noflush and map_kernel_range
off entirely in favor of the vmap versions.

> +	for (i = 0; i < area->nr_pages; i += 1U << area->page_order) {

Maybe using a helper that takes the vm_area_struct and either returns
area->page_order or always 0 based on IS_ENABLED?

^ permalink raw reply

* Re: [PATCH v10 10/12] mm/vmalloc: add vmap_range_noflush variant
From: Christoph Hellwig @ 2021-01-24 14:51 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	linux-mm, Zefan Li, Jonathan Cameron, Andrew Morton,
	Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124082230.2118861-11-npiggin@gmail.com>

On Sun, Jan 24, 2021 at 06:22:28PM +1000, Nicholas Piggin wrote:
> As a side-effect, the order of flush_cache_vmap() and
> arch_sync_kernel_mappings() calls are switched, but that now matches
> the other callers in this file.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply

* Re: [PATCH v10 09/12] mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c
From: Christoph Hellwig @ 2021-01-24 14:49 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: linux-arch, Ding Tianhong, linux-kernel, Christoph Hellwig,
	linux-mm, Zefan Li, Jonathan Cameron, Andrew Morton,
	Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124082230.2118861-10-npiggin@gmail.com>

On Sun, Jan 24, 2021 at 06:22:27PM +1000, Nicholas Piggin wrote:
> This is a generic kernel virtual memory mapper, not specific to ioremap.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

Although it would be nice if you could fix up the > 80 lines while
you're at it.

^ permalink raw reply

* Re: [PATCH v10 05/12] mm: HUGE_VMAP arch support cleanup
From: Nicholas Piggin @ 2021-01-24 12:22 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, x86, Thomas Gleixner, Will Deacon, Catalin Marinas,
	Ding Tianhong, linux-kernel, linux-mm, Zefan Li, Borislav Petkov,
	Jonathan Cameron, H. Peter Anvin, Andrew Morton, Rick Edgecombe,
	linuxppc-dev, Ingo Molnar, linux-arm-kernel
In-Reply-To: <20210124114008.GE694255@infradead.org>

Excerpts from Christoph Hellwig's message of January 24, 2021 9:40 pm:
>> diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.h
>> index 2ca708ab9b20..597b40405319 100644
>> --- a/arch/arm64/include/asm/vmalloc.h
>> +++ b/arch/arm64/include/asm/vmalloc.h
>> @@ -1,4 +1,12 @@
>>  #ifndef _ASM_ARM64_VMALLOC_H
>>  #define _ASM_ARM64_VMALLOC_H
>>  
>> +#include <asm/page.h>
>> +
>> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
>> +bool arch_vmap_p4d_supported(pgprot_t prot);
>> +bool arch_vmap_pud_supported(pgprot_t prot);
>> +bool arch_vmap_pmd_supported(pgprot_t prot);
>> +#endif
> 
> Shouldn't the be inlines or macros?  Also it would be useful
> if the architectures would not have to override all functions
> but just those that are it actually implements?

It gets better in the next patches. I did it this way again to avoid 
moving a lot of code at the same time as changing name / prototype
slightly.

I didn't see individual generic fallbacks being all that useful really 
at this scale. I don't mind keeping the explicit false.

> Also lots of > 80 char lines in the patch.

Yeah there's a few, I can reduce those.

Thanks,
Nick

^ permalink raw reply

* [GIT PULL] Please pull powerpc/linux.git powerpc-5.11-5 tag
From: Michael Ellerman @ 2021-01-24 12:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev, linux-kernel, npiggin, sandipan

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Linus,

Please pull some more powerpc fixes for 5.11:

The following changes since commit 41131a5e54ae7ba5a2bb8d7b30d1818b3f5b13d2:

  powerpc/vdso: Fix clock_gettime_fallback for vdso32 (2021-01-14 15:56:44 +1100)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git tags/powerpc-5.11-5

for you to fetch changes up to 08685be7761d69914f08c3d6211c543a385a5b9c:

  powerpc/64s: fix scv entry fallback flush vs interrupt (2021-01-20 15:58:19 +1100)

- ------------------------------------------------------------------
powerpc fixes for 5.11 #5

Fix a bad interaction between the scv handling and the fallback L1D flush, which
could lead to user register corruption. Only affects people using scv (~no one)
on machines with old firmware that are missing the L1D flush.

Two small selftest fixes.

Thanks to Eirik Fuller, Libor Pechacek, Nicholas Piggin, Sandipan Das, Tulio
Magno Quites Machado Filho.

- ------------------------------------------------------------------
Michael Ellerman (1):
      selftests/powerpc: Only test lwm/stmw on big endian

Nicholas Piggin (1):
      powerpc/64s: fix scv entry fallback flush vs interrupt

Sandipan Das (1):
      selftests/powerpc: Fix exit status of pkey tests


 arch/powerpc/include/asm/exception-64s.h                      | 13 +++++++++++
 arch/powerpc/include/asm/feature-fixups.h                     | 10 ++++++++
 arch/powerpc/kernel/entry_64.S                                |  2 +-
 arch/powerpc/kernel/exceptions-64s.S                          | 19 ++++++++++++++++
 arch/powerpc/kernel/vmlinux.lds.S                             |  7 ++++++
 arch/powerpc/lib/feature-fixups.c                             | 24 +++++++++++++++++---
 tools/testing/selftests/powerpc/alignment/alignment_handler.c |  5 +++-
 tools/testing/selftests/powerpc/mm/pkey_exec_prot.c           |  2 +-
 tools/testing/selftests/powerpc/mm/pkey_siginfo.c             |  2 +-
 9 files changed, 77 insertions(+), 7 deletions(-)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmANYaoACgkQUevqPMjh
pYDyFRAAqwsxxbbCe+AlggURQi7nap5JL4qHV0bEYPR34IEIPs9blDOb5ECQNbNt
fbxDK9y3ij5ceETsdzM6d3gkocBo/O8JMa9scfmHNFpQLWQk013MUg3YJQnycDkE
vpmaXPMdkcZv82VXdYe4DonhlS3FBTpbL1jPVZn6KIJGpiWfuS7vgptLeBqtMMZz
Mz4lAkzMKbSw/NmKe+Iq3Rc8zsw4C6gXPIhkNsD32s5U+lVMKLpFpxtwhxcGFxDy
sTUBWXJn+mW4+XJVNHQOvLN3gTPNgEcg2xoKkQiwB5/y+GKgPco24Ep6bUalYfNG
dViUAEgzpyhwTfkBxwwV8bpxSaw9HAQRjVC18QJ7sLM+ogHEJm7ejipAOmAfAzuf
+BwQgkSZ2I/peJJDNvVjC3vRIDl29LEA73ZORcp4ynDP/cKuhgvaYBTPCVCzcc0r
+bPXFEfS0OofLBkLekHIdSRfCLQjmQF/TB3CVkDAlDKjiMwTJk/khTn0+0RD6DRK
i/iBkCXjOBuizXkIzRUAit6YMMoO6Yt/nuyrPhDetBFpMPmZgAuLZCs1UI+qUR/L
lS4jOSUQnZqLXsDJqT7uUIdaWZPODdV1U8XEl1+C9xAZ5A4Juy9fFr2K91OtBa2e
/45tUCpDCmtt5aXZXWgwghJeQteBI0Ng5U4NH0asH2W8oVDFyRM=
=f+xY
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: [PATCH v10 04/12] mm/ioremap: rename ioremap_*_range to vmap_*_range
From: Nicholas Piggin @ 2021-01-24 12:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, Ding Tianhong, linux-kernel, linux-mm, Zefan Li,
	Jonathan Cameron, Andrew Morton, Rick Edgecombe, linuxppc-dev
In-Reply-To: <20210124113636.GD694255@infradead.org>

Excerpts from Christoph Hellwig's message of January 24, 2021 9:36 pm:
> On Sun, Jan 24, 2021 at 06:22:22PM +1000, Nicholas Piggin wrote:
>> This will be used as a generic kernel virtual mapping function, so
>> re-name it in preparation.
> 
> The new name looks ok, but shouldn't it also move to vmalloc.c with
> the more generic name and purpose?
> 

Yes, I moved it in a later patch to make reviewing easier. Rename in 
this one then the move patch is cut and paste.

Thanks,
Nick

^ permalink raw reply

* Re: [PATCH] powerpc/64s: fix scv entry fallback flush vs interrupt
From: Michael Ellerman @ 2021-01-24 11:54 UTC (permalink / raw)
  To: linuxppc-dev, Nicholas Piggin
  Cc: Tulio Magno Quites Machado Filho, Daniel Axtens
In-Reply-To: <20210111062408.287092-1-npiggin@gmail.com>

On Mon, 11 Jan 2021 16:24:08 +1000, Nicholas Piggin wrote:
> The L1D flush fallback functions are not recoverable vs interrupts,
> yet the scv entry flush runs with MSR[EE]=1. This can result in a
> timer (soft-NMI) or MCE or SRESET interrupt hitting here and overwriting
> the EXRFI save area, which ends up corrupting userspace registers for
> scv return.
> 
> Fix this by disabling RI and EE for the scv entry fallback flush.

Applied to powerpc/fixes.

[1/1] powerpc/64s: fix scv entry fallback flush vs interrupt
      https://git.kernel.org/powerpc/c/08685be7761d69914f08c3d6211c543a385a5b9c

cheers

^ permalink raw reply

* Re: [PATCH v10 05/12] mm: HUGE_VMAP arch support cleanup
From: Christoph Hellwig @ 2021-01-24 11:40 UTC (permalink / raw)
  To: Nicholas Piggin
  Cc: linux-arch, x86, H. Peter Anvin, Will Deacon, Ingo Molnar,
	Catalin Marinas, Ding Tianhong, linux-kernel, Christoph Hellwig,
	linux-mm, Zefan Li, Borislav Petkov, Jonathan Cameron,
	Andrew Morton, Rick Edgecombe, linuxppc-dev, Thomas Gleixner,
	linux-arm-kernel
In-Reply-To: <20210124082230.2118861-6-npiggin@gmail.com>

> diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.h
> index 2ca708ab9b20..597b40405319 100644
> --- a/arch/arm64/include/asm/vmalloc.h
> +++ b/arch/arm64/include/asm/vmalloc.h
> @@ -1,4 +1,12 @@
>  #ifndef _ASM_ARM64_VMALLOC_H
>  #define _ASM_ARM64_VMALLOC_H
>  
> +#include <asm/page.h>
> +
> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
> +bool arch_vmap_p4d_supported(pgprot_t prot);
> +bool arch_vmap_pud_supported(pgprot_t prot);
> +bool arch_vmap_pmd_supported(pgprot_t prot);
> +#endif

Shouldn't the be inlines or macros?  Also it would be useful
if the architectures would not have to override all functions
but just those that are it actually implements?

Also lots of > 80 char lines in the patch.

^ permalink raw reply


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