Re: [PATCH 01/13] kmsan: Export kmsan_handle_dma

2024-02-19 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > kmsan_handle_dma is required by virtio drivers. Export kmsan_handle_dma > so that the drivers can be compiled as modules. > > Signed-off-by: Nicholas Miehlbradt > --- > mm/kmsan/hooks.c | 1 + > 1 file changed, 1 insertion(+) > > diff

Re: [PATCH] powerpc/code-patching: Disable KASAN in __patch_instructions()

2024-02-18 Thread Christophe Leroy
Le 13/02/2024 à 05:36, Benjamin Gray a écrit : > The memset/memcpy functions are by default instrumented by KASAN, which > complains about user memory access when using a poking page in > userspace. > > Using a userspace address is expected though, so don't instrument with > KASAN for this

Re: [PATCH v3] powerpc: Add gpr1 and fpu save/restore functions

2024-02-17 Thread Christophe Leroy
Le 16/02/2024 à 18:24, Timothy Pearson a écrit : > When building the kernel in size optimized mode with the amdgpu module > enabled, > gcc will begin referencing external gpr1 and fpu save/restore functions. This > will then cause a linker failure as we do not link against libgcc which >

Re: [PATCH v1 4/5] powerpc: Remove cpu-as-y completely

2024-02-16 Thread Christophe Leroy
Le 20/02/2023 à 07:00, Michael Ellerman a écrit : > Christophe Leroy writes: >> cpu-as-y is there to force assembler building options. >> But there is no need for that. Gcc is passed the necessary >> options and it automatically pass the appropriate option to >&

[PATCH 2/2] powerpc: Don't ignore errors from set_memory_{n}p() in __kernel_map_pages()

2024-02-16 Thread Christophe Leroy
/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hash.h | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 3 ++- arch/powerpc/mm/pageattr.c| 10 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH 1/2] powerpc: Refactor __kernel_map_pages()

2024-02-16 Thread Christophe Leroy
__kernel_map_pages() is almost identical for PPC32 and RADIX. Refactor it. On PPC32 it is not needed for KFENCE, but to keep it simple just make it similar to PPC64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 10 -- arch/powerpc/include/asm

[PATCH] powerpc: Handle error in mark_rodata_ro() and mark_initmem_nx()

2024-02-16 Thread Christophe Leroy
mark_rodata_ro() and mark_initmem_nx() use functions that can fail like set_memory_nx() and set_memory_ro(), leading to a not protected kernel. In case of failure, panic. Link: https://github.com/KSPP/linux/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/mm/book3s32/mmu.c | 7

[PATCH] powerpc/kprobes: Handle error returned by set_memory_rox()

2024-02-16 Thread Christophe Leroy
set_memory_rox() can fail. In case it fails, free allocated memory and return NULL. Link: https://github.com/KSPP/linux/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/kprobes.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH] powerpc: Implement set_memory_rox()

2024-02-16 Thread Christophe Leroy
rmation. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/set_memory.h | 7 +++ arch/powerpc/mm/pageattr.c| 4 2 files changed, 11 insertions(+) diff --git a/arch/powerpc/include/asm/set_memory.h b/arch/powerpc/include/asm/set_memory.h index 7ebc807aa8cc.

[PATCH] powerpc: Use user_mode() macro when possible

2024-02-16 Thread Christophe Leroy
There is a nice macro to check user mode. Use it instead of open coding anding with MSR_PR to increase readability and avoid having to comment what that anding is for. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 2 +- arch/powerpc/kernel/syscall.c| 2

[PATCH] powerpc/trace: Restrict hash_fault trace event to HASH MMU

2024-02-16 Thread Christophe Leroy
'perf list' on powerpc 8xx shows an event named "1:hash_fault". This event is pointless because trace_hash_fault() is called only from mm/book3s64/hash_utils.c Only define it when CONFIG_PPC_64S_HASH_MMU is selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/t

Re: [PATCH v4] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-14 Thread Christophe Leroy
0008364] > machine_check_early_common+0x134/0x1f8 > > Fix this by avoiding use of nmi_enter()/nmi_exit() in real mode if percpu > first chunk is not embedded. > > Signed-off-by: Mahesh Salgaonkar Reviewed-by: Christophe Leroy > --- > Changes in v4: > - Fix coding style

Re: [PATCH v3] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-14 Thread Christophe Leroy
l mode if percpu > first chunk is not embedded. > > Signed-off-by: Mahesh Salgaonkar > --- > Changes in v3: > - Address comments from Christophe Leroy to avoid using #ifdefs in the >code > - v2 at > https://lore.kernel.org/linuxppc-dev/20240205053647.1763446-1-mah...@linux

Re: [PATCH v2] powerpc: Add gpr1 and fpu save/restore functions

2024-02-13 Thread Christophe Leroy
Le 12/02/2024 à 18:14, Timothy Pearson a écrit : > When building the kernel in size optimized mode with the amdgpu module > enabled, > gcc will begin referencing external gpr1 and fpu save/restore functions. This > will then cause a linker failure as we do not link against libgcc which >

[PATCH] powerpc: Force inlining of arch_vmap_p{u/m}d_supported()

2024-02-13 Thread Christophe Leroy
rot) || | ^~~ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402131836.ou1tduoi-...@intel.com/ Fixes: 8309c9d71702 ("powerpc: inline huge vmap supported functions") Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vmalloc.h | 4 ++-- 1 fi

Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

2024-02-13 Thread Christophe Leroy
Hi Le 12/02/2024 à 21:04, Ricardo B. Marliere a écrit : > This series is part of an effort to cleanup the users of the driver > core, as can be seen in many recent patches authored by Greg across the > tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have > no dependency. They

Re: [PATCH v2 2/2] powerpc/bpf: enable kfunc call

2024-02-12 Thread Christophe Leroy
Le 01/02/2024 à 18:12, Hari Bathini a écrit : > With module addresses supported, override bpf_jit_supports_kfunc_call() > to enable kfunc support. Module address offsets can be more than 32-bit > long, so override bpf_jit_supports_far_kfunc_call() to enable 64-bit > pointers. What's the impact

Re: [PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported

2024-02-12 Thread Christophe Leroy
Le 01/02/2024 à 18:12, Hari Bathini a écrit : > Currently, bpf jit code on powerpc assumes all the bpf functions and > helpers to be kernel text. This is false for kfunc case, as function > addresses are mostly module addresses in that case. Ensure module > addresses are supported to enable

Re: [PATCH] powerpc/ftrace: Ignore ftrace locations in exit text sections

2024-02-12 Thread Christophe Leroy
Le 09/02/2024 à 08:59, Naveen N Rao a écrit : > Michael reported that we are seeing ftrace bug on bootup when KASAN is > enabled, and if we are using -fpatchable-function-entry: > > ftrace: allocating 47780 entries in 18 pages > ftrace-powerpc: 0xc20b3d5c: No module provided

Re: [PATCH] powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E

2024-02-12 Thread Christophe Leroy
nd expect PPC_FEATURE_BOOKE. > Debugging an application with gdb is no longer working on e5500/e6500 > because the 64-bit detection relies on PPC_FEATURE_BOOKE for Book-E. > > Fixes: e320a76db4b0 ("powerpc/cputable: Split cpu_specs[] out of cputable.h") > Signed-off-by: David Engra

Re: [PATCH v2] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-12 Thread Christophe Leroy
Le 05/02/2024 à 06:36, Mahesh Salgaonkar a écrit : > [Vous ne recevez pas souvent de courriers de mah...@linux.ibm.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > nmi_enter()/nmi_exit() touches per cpu variables which can lead to kernel >

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-31 Thread Christophe Leroy
Le 31/01/2024 à 16:17, Marek Szyprowski a écrit : > [Vous ne recevez pas souvent de courriers de m.szyprow...@samsung.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hi Christophe, > > On 31.01.2024 12:58, Christophe

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-31 Thread Christophe Leroy
Hi, Le 30/01/2024 à 18:48, Marek Szyprowski a écrit : > [Vous ne recevez pas souvent de courriers de m.szyprow...@samsung.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Dear All, > > On 30.01.2024 12:03, Christophe Ler

BUG: KASAN: vmalloc-out-of-bounds in memset32 (bpf_prog_pack_free)

2024-01-31 Thread Christophe Leroy
Hi, Got the following BUG while loading module test_bpf.ko No time to investigate for now. root@vgoip:~# insmod test_bpf.ko [ 263.409030] == [ 263.416415] BUG: KASAN: vmalloc-out-of-bounds in memset32+0x5c/0xa0 [ 263.422952]

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-30 Thread Christophe Leroy
Le 30/01/2024 à 21:27, Luis Chamberlain a écrit : > On Tue, Jan 30, 2024 at 06:48:11PM +0100, Marek Szyprowski wrote: >> Dear All, >> >> On 30.01.2024 12:03, Christophe Leroy wrote: >>> Le 30/01/2024 à 10:16, Chen-Yu Tsai a écrit : >>>> [Vous

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-30 Thread Christophe Leroy
n wrote: >> On Thu, Dec 21, 2023 at 10:02:46AM +0100, Christophe Leroy wrote: >>> Declaring rodata_enabled and mark_rodata_ro() at all time >>> helps removing related #ifdefery in C files. >>> >>> Signed-off-by: Christophe Leroy >> >> Very nice

[PATCH v2 5/5] mm: ptdump: add check_wx_pages debugfs attribute

2024-01-30 Thread Christophe Leroy
Add a readable attribute in debugfs to trigger a W^X pages check at any time. To trigger the test, just read /sys/kernel/debug/check_wx_pages It will report FAILED if the test failed, SUCCESS otherwise. Detailed result is provided into dmesg. Signed-off-by: Christophe Leroy --- v2: Make

[PATCH v2 4/5] mm: ptdump: Have ptdump_check_wx() return bool

2024-01-30 Thread Christophe Leroy
Have ptdump_check_wx() return true when the check is successful or false otherwise. Signed-off-by: Christophe Leroy --- v2: New --- arch/arm64/mm/ptdump.c | 11 --- arch/powerpc/mm/ptdump/ptdump.c | 13 + arch/riscv/mm/ptdump.c | 11 --- arch/s390

[PATCH v2 3/5] powerpc,s390: ptdump: Define ptdump_check_wx() regardless of CONFIG_DEBUG_WX

2024-01-30 Thread Christophe Leroy
Following patch will use ptdump_check_wx() regardless of CONFIG_DEBUG_WX, so define it at all times on powerpc and s390 just like other architectures. Though keep the WARN_ON_ONCE() only when CONFIG_DEBUG_WX is set. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/ptdump.c | 7

[PATCH v2 2/5] arm64, powerpc, riscv, s390, x86: ptdump: Refactor CONFIG_DEBUG_WX

2024-01-30 Thread Christophe Leroy
-by: Christophe Leroy Reviewed-by: Alexandre Ghiti --- v2: For x86 change macro ptdump_check_wx() to ptdump_check_wx --- arch/arm64/include/asm/ptdump.h | 7 --- arch/arm64/mm/mmu.c | 2 -- arch/powerpc/mm/mmu_decl.h | 6 -- arch/powerpc/mm/pgtable_32.c| 4

[PATCH v2 1/5] arm: ptdump: Rename CONFIG_DEBUG_WX to CONFIG_ARM_DEBUG_WX

2024-01-30 Thread Christophe Leroy
CONFIG_DEBUG_WX is a core option defined in mm/Kconfig.debug To avoid any future conflict, rename ARM version into CONFIG_ARM_DEBUG_WX. Signed-off-by: Christophe Leroy --- v2: Fixed left-over debug_checkwx() in mark_rodata_ro() and updated defconfigs --- arch/arm/Kconfig.debug

[PATCH v2 0/5] mm: ptdump: Refactor CONFIG_DEBUG_WX and check_wx_pages debugfs attribute

2024-01-30 Thread Christophe Leroy
(). Then implement a debugfs attribute that can be used to trigger a W^X test at anytime and regardless of CONFIG_DEBUG_WX Changes in v2: - Fixed a few build failures (patch 1 and 2) - Added patch 4 - Make the attribute return SUCCESS/FAILURE as suggested by Heiko (patch 5) Christophe Leroy (5): arm

Re: [PATCH v2 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes()

2024-01-25 Thread Christophe Leroy
> Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- > include/linux/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index f6d0e3513948a..351cd9dc7194f 100644 > -

Re: [PATCH v2 10/15] powerpc/mm: use pte_next_pfn() in set_ptes()

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 20:32, David Hildenbrand a écrit : > Let's use our handy new helper. Note that the implementation is slightly > different, but shouldn't really make a difference in practice. > > Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- >

Re: [PATCH v2 04/15] powerpc/pgtable: define PFN_PTE_SHIFT

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 20:32, David Hildenbrand a écrit : > We want to make use of pte_next_pfn() outside of set_ptes(). Let's > simply define PFN_PTE_SHIFT, required by pte_next_pfn(). > > Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- > arch/powerpc/inc

Re: [PATCH] powerpc/papr_scm: Move duplicate definitions to common header files

2024-01-25 Thread Christophe Leroy
Le 18/04/2022 à 06:38, Shivaprasad G Bhat a écrit : > papr_scm and ndtest share common PDSM payload structs like > nd_papr_pdsm_health. Presently these structs are duplicated across > papr_pdsm.h and ndtest.h header files. Since 'ndtest' is essentially > arch independent and can run on platforms

Re: [PATCH v6 (proposal)] powerpc/cpu: enable nr_cpus for crash kernel

2024-01-25 Thread Christophe Leroy
Hi, Le 22/05/2018 à 10:23, Pingfan Liu a écrit : > For kexec -p, the boot cpu can be not the cpu0, this causes the problem > to alloc paca[]. In theory, there is no requirement to assign cpu's logical > id as its present seq by device tree. But we have something like > cpu_first_thread_sibling(),

Re: [PATCH] powerpc/fadump: update kernel logs before fadump crash begins

2024-01-25 Thread Christophe Leroy
Hi, Le 06/06/2020 à 06:45, Sourabh Jain a écrit : When we hit the fadump crash via the panic path the pstore update is missing. This is observed when commit 8341f2f222d7 ("sysrq: Use panic() to force a crash") changed the sysrq-trigger to take panic path instead of die path. The PPC panic

Re: [PATCH] powerpc: build-time fixup alternate feature relative addresses

2024-01-25 Thread Christophe Leroy
Hi Nic, Le 21/05/2017 à 03:01, Nicholas Piggin a écrit : Implement build-time fixup of alternate feature relative addresses for the out-of-line ("else") patch code. This is done post-link with a new powerpc build tool that parses relocations and fixup structures, and adjusts branch

Re: [PATCH 8/8] powerpc/rtas: consume retry statuses in sys_rtas()

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 17:33, Nathan Lynch a écrit : > Christophe Leroy writes: >> Hi Nathan, >> >> Le 06/03/2023 à 22:33, Nathan Lynch via B4 Relay a écrit : >>> From: Nathan Lynch >>> >>> The kernel can handle retrying RTAS function calls in response

Re: [PATCH 8/8] powerpc/rtas: consume retry statuses in sys_rtas()

2024-01-25 Thread Christophe Leroy
Hi Nathan, Le 06/03/2023 à 22:33, Nathan Lynch via B4 Relay a écrit : > From: Nathan Lynch > > The kernel can handle retrying RTAS function calls in response to > -2/990x in the sys_rtas() handler instead of relaying the intermediate > status to user space. From this series with still have

Re: [PATCH v2] powerpc/6xx: set High BAT Enable flag on G2_LE cores

2024-01-25 Thread Christophe Leroy
bootloader already. > > Fixes: e4d6654ebe6e ("powerpc/mm/32s: rework mmu_mapin_ram()") > Signed-off-by: Matthias Schiffer Reviewed-by: Christophe Leroy > --- > > v2: > - Use the G2_LE name for cores that have this HID2 register > - Extend __setup_cpu_603 in

Re: [PATCH] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 11:08, Kunwu Chan a écrit : > This part was commented from commit a33a7d7309d7 > ("[PATCH] spufs: implement mfc access for PPE-side DMA") > in about 18 years before. > > If there are no plans to enable this part code in the future, > we can remove this dead code. > >

Re: [PATCH] powerpc/iommu: Code cleanup for cell/iommu.c

2024-01-24 Thread Christophe Leroy
Le 25/01/2024 à 03:46, Kunwu Chan a écrit : > This part was commented from commit 165785e5c0be ("[POWERPC] Cell > iommu support") in about 17 years before. > > If there are no plans to enable this part code in the future, > we can remove this dead code. > > Signed-off-by: Kunwu Chan > --- >

Re: ps3_gelic_net.c issue (linux kernel 6.8-rc1)

2024-01-24 Thread Christophe Leroy
Hi, Le 24/01/2024 à 09:41, sambat goson a écrit : > > Hi, > I've just test it and find below code not proper in function > "gelic_descr_prepare_rx", line 398. > it causes error as my attached file. > > descr->skb = netdev_alloc_skb(*card->netdev, rx_skb_size); > if (!descr->skb) { >

Re: [PATCH] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-24 Thread Christophe Leroy
Le 24/01/2024 à 10:36, Kunwu Chan a écrit : > This part was commented from commit 2f4cf5e42d13 ("Add book3s.c") > in about 14 years before. > If there are no plans to enable this part code in the future, > we can remove this dead code. > > Signed-off-by: Kunwu Chan > --- >

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:38, Ryan Roberts a écrit : > On 23/01/2024 11:31, David Hildenbrand wrote: > If high bits are used for > something else, then we might produce a garbage PTE on overflow, but that > shouldn't really matter I concluded for folio_pte_batch() purposes, we'd >

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:08, Ryan Roberts a écrit : > On 23/01/2024 10:48, David Hildenbrand wrote: >> On 23.01.24 11:34, Ryan Roberts wrote: >>> On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT,

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 11:48, David Hildenbrand a écrit : > On 23.01.24 11:34, Ryan Roberts wrote: >> On 22/01/2024 19:41, David Hildenbrand wrote: >>> We want to make use of pte_next_pfn() outside of set_ptes(). Let's >>> simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). >>> >>> Signed-off-by:

Re: [PING PATCH] powerpc/kasan: Fix addr error caused by page alignment

2024-01-22 Thread Christophe Leroy
Le 23/01/2024 à 02:45, Jiangfeng Xiao a écrit : > [Vous ne recevez pas souvent de courriers de xiaojiangf...@huawei.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > In kasan_init_region, when k_start is not page aligned, > at the begin of

Re: [PATCH] powerpc/6xx: set High BAT Enable flag on G2 cores

2024-01-19 Thread Christophe Leroy
Le 19/01/2024 à 14:41, Matthias Schiffer a écrit : >> >> Thinking about it once more, can we do even more simple ? >> >> Why do we need that __setup_cpu_g2() at all ? >> >> You could just add the following into __set_cpu_603() >> >> diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S >>

Re: [PATCH v2 06/13] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing

2024-01-15 Thread Christophe Leroy
Le 15/01/2024 à 19:37, Jason Gunthorpe a écrit : > On Wed, Jan 03, 2024 at 05:14:16PM +0800, pet...@redhat.com wrote: >> From: Peter Xu >> >> Hugepd format for GUP is only used in PowerPC with hugetlbfs. There are >> some kernel usage of hugepd (can refer to hugepd_populate_kernel() for >>

Re: [PATCH] powerpc/Makefile: Remove bits related to the previous use of -mcmodel=large

2024-01-09 Thread Christophe Leroy
y: Naveen N Rao Reviewed-by: Christophe Leroy Small comment below, > --- > arch/powerpc/Makefile | 6 +- > arch/powerpc/kernel/Makefile| 3 --- > arch/powerpc/lib/Makefile | 2 -- > arch/powerpc/mm/Makefile| 2 -- >

[PATCH 4/4] ptdump: add check_wx_pages debugfs attribute

2024-01-09 Thread Christophe Leroy
Add a writable attribute in debugfs to trigger a W^X pages check at any time. To trigger the test, just echo any numeric value into /sys/kernel/debug/check_wx_pages The result is provided into dmesg. Signed-off-by: Christophe Leroy --- mm/ptdump.c | 19 +++ 1 file changed, 19

[PATCH 3/4] powerpc,s390: Define ptdump_check_wx() regardless of CONFIG_DEBUG_WX

2024-01-09 Thread Christophe Leroy
Following patch will use ptdump_check_wx() regardless of CONFIG_DEBUG_WX, so define it at all times of powerpc and s390 just like other architectures. Though keep the WARN_ON_ONCE() only when CONFIG_DEBUG_WX is set. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/ptdump.c | 7

[PATCH 2/4] arm64, powerpc, riscv, s390, x86: Refactor CONFIG_DEBUG_WX

2024-01-09 Thread Christophe Leroy
-by: Christophe Leroy --- arch/arm64/include/asm/ptdump.h | 7 --- arch/arm64/mm/mmu.c | 2 -- arch/powerpc/mm/mmu_decl.h | 6 -- arch/powerpc/mm/pgtable_32.c| 4 arch/powerpc/mm/pgtable_64.c| 3 --- arch/powerpc/mm/ptdump/ptdump.c | 3 +++ arch/riscv

[PATCH 1/4] arm: ptdump: Rename CONFIG_DEBUG_WX to CONFIG_ARM_DEBUG_WX

2024-01-09 Thread Christophe Leroy
CONFIG_DEBUG_WX is a core option defined in mm/Kconfig.debug To avoid any future conflict, rename ARM version into CONFIG_ARM_DEBUG_WX. Signed-off-by: Christophe Leroy --- arch/arm/Kconfig.debug| 2 +- arch/arm/include/asm/ptdump.h | 6 +++--- 2 files changed, 4 insertions(+), 4

[PATCH 0/4] Refactor CONFIG_DEBUG_WX and check_wx_pages debugfs attribute

2024-01-09 Thread Christophe Leroy
(). Then implement a debugfs attribute that can be used to trigger a W^X test at anytime and regardless of CONFIG_DEBUG_WX Christophe Leroy (4): arm: ptdump: Rename CONFIG_DEBUG_WX to CONFIG_ARM_DEBUG_WX arm64, powerpc, riscv, s390, x86: Refactor CONFIG_DEBUG_WX powerpc,s390: Define

Re: [PATCH] powerpc: Fix preserved memory size for int-vectors

2024-01-09 Thread Christophe Leroy
Le 09/01/2024 à 04:38, GUO Zihua a écrit : > [Vous ne recevez pas souvent de courriers de guozi...@huawei.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > The first 32k of memory is reserved for interrupt vectors, however for > powerpc64 this

Re: [PATCH v1 1/1] powerpc/powernv: fix up kernel compile issues

2024-01-03 Thread Christophe Leroy
Hi, Le 02/01/2024 à 03:48, Luming Yu a écrit : > [Vous ne recevez pas souvent de courriers de luming...@shingroup.cn. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > up kernel is quite useful to silicon validation, despite > it is rare to be

Re: [PATCH v2 00/13] mm/gup: Unify hugetlb, part 2

2024-01-03 Thread Christophe Leroy
Le 03/01/2024 à 10:14, pet...@redhat.com a écrit : > From: Peter Xu > > > Test Done > = > > This v1 went through the normal GUP smoke tests over different memory > types on archs (using VM instances): x86_64, aarch64, ppc64le. For > aarch64, tested over 64KB cont_pte huge pages.

Re: [PATCH] powerpc/6xx: set High BAT Enable flag on G2 cores

2023-12-22 Thread Christophe Leroy
Le 22/12/2023 à 09:48, Matthias Schiffer a écrit : > [Vous ne recevez pas souvent de courriers de > matthias.schif...@ew.tq-group.com. Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > On Thu, 2023-12-21 at 13:57 +0000, Christo

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2023-12-22 Thread Christophe Leroy
Kees >> >> Christophe Leroy writes: >>> Declaring rodata_enabled and mark_rodata_ro() at all time >>> helps removing related #ifdefery in C files. >>> >>> Signed-off-by: Christophe Leroy >>> --- >>> include/linux/init.h |

Re: [PATCH] powerpc/6xx: set High BAT Enable flag on G2 cores

2023-12-22 Thread Christophe Leroy
Le 22/12/2023 à 09:34, Matthias Schiffer a écrit : > [Vous ne recevez pas souvent de courriers de > matthias.schif...@ew.tq-group.com. Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > On Fri, 2023-12-22 at 12:16 +1100, Michael Ellerman wrote: >>

Re: [RFC PATCH 6/9] powerpc/ftrace: Update and move function profile instructions out-of-line

2023-12-21 Thread Christophe Leroy
Le 21/12/2023 à 15:25, Steven Rostedt a écrit : > On Thu, 21 Dec 2023 10:46:08 + > Christophe Leroy wrote: > >>> To enable ftrace, the nop at function entry is changed to an >>> unconditional branch to 'tramp'. The call to ftrace_caller() may be >&g

Re: [PATCH] powerpc/6xx: set High BAT Enable flag on G2 cores

2023-12-21 Thread Christophe Leroy
Le 21/12/2023 à 13:45, Matthias Schiffer a écrit : > MMU_FTR_USE_HIGH_BATS is set for G2-based cores (G2_LE, e300cX), but the > high BATs need to be enabled in HID2 to work. Add register definitions > and introduce a G2 variant of __setup_cpu_603. Well spotted. I have a mpc8321, hence e300c2.

Re: powerpc: several early boot regressions on MPC52xx

2023-12-21 Thread Christophe Leroy
Le 21/12/2023 à 11:33, Matthias Schiffer a écrit : > [Vous ne recevez pas souvent de courriers de > matthias.schif...@ew.tq-group.com. Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > On Wed, 2023-12-20 at 14:55 +0000, Christo

Re: [RFC PATCH 6/9] powerpc/ftrace: Update and move function profile instructions out-of-line

2023-12-21 Thread Christophe Leroy
Le 08/12/2023 à 17:30, Naveen N Rao a écrit : > Function profile sequence on powerpc includes two instructions at the > beginning of each function: > > mflrr0 > bl ftrace_caller > > The call to ftrace_caller() gets nop'ed out during kernel boot and is > patched in when

[PATCH 3/3] powerpc: Simplify strict_kernel_rwx_enabled()

2023-12-21 Thread Christophe Leroy
Now that rodata_enabled is always declared, remove #ifdef and define a single version of strict_kernel_rwx_enabled(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu.h | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/mmu.h b

[PATCH 2/3] modules: Remove #ifdef CONFIG_STRICT_MODULE_RWX around rodata_enabled

2023-12-21 Thread Christophe Leroy
Now that rodata_enabled is declared at all time, the #ifdef CONFIG_STRICT_MODULE_RWX can be removed. Signed-off-by: Christophe Leroy --- kernel/module/strict_rwx.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/module/strict_rwx.c b/kernel/module/strict_rwx.c

[PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2023-12-21 Thread Christophe Leroy
Declaring rodata_enabled and mark_rodata_ro() at all time helps removing related #ifdefery in C files. Signed-off-by: Christophe Leroy --- include/linux/init.h | 4 init/main.c | 21 +++-- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include

Re: powerpc: several early boot regressions on MPC52xx

2023-12-20 Thread Christophe Leroy
Le 19/12/2023 à 14:34, Matthias Schiffer a écrit : > [Vous ne recevez pas souvent de courriers de > matthias.schif...@ew.tq-group.com. Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > On Mon, 2023-12-18 at 19:48 +0000, Christo

Re: powerpc: several early boot regressions on MPC52xx

2023-12-18 Thread Christophe Leroy
Hi Matthias, Le 18/12/2023 à 14:48, Matthias Schiffer a écrit : > Hi all, > > I'm currently in the process of porting our ancient TQM5200 SoM to a modern > kernel, and I've > identified a number of regressions that cause early boot failures (before the > UART console has been > initialized)

Re: [PATCH v4 02/10] locking: introduce devm_mutex_init

2023-12-17 Thread Christophe Leroy
Le 17/12/2023 à 02:05, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hello Christophe > > On 12/15/23 08:46, Christophe Ler

Re: [PATCH RFC v4-bis] locking: introduce devm_mutex_init

2023-12-15 Thread Christophe Leroy
Le 15/12/2023 à 16:58, Andy Shevchenko a écrit : > On Fri, Dec 15, 2023 at 8:23 AM Christophe Leroy > wrote: >> >> From: George Stark >> >> Using of devm API leads to a certain order of releasing resources. >> So all dependent resources which ar

Re: [PATCH] arch: powerpc: kernel: fixed some typos

2023-12-15 Thread Christophe Leroy
Le 15/12/2023 à 12:58, Ghanshyam Agrawal a écrit : > [Vous ne recevez pas souvent de courriers de ghanshyam1...@gmail.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Fixed some typos This kind of change is a waist of time for us and a

[PATCH RFC v4-bis] locking: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
. Since mutex_destroy() actually does nothing in non-debug builds frequently calling mutex_destroy() is just ignored which is safe for now but wrong formally and can lead to a problem if mutex_destroy() will be extended so introduce devm_mutex_init() Signed-off-by: George Stark Signed-off-by: Christophe

Re: [PATCH v4 02/10] locking: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 22:48, Waiman Long a écrit : > On 12/14/23 14:53, Christophe Leroy wrote: >> >> Le 14/12/2023 à 19:48, Waiman Long a écrit : >>> On 12/14/23 12:36, George Stark wrote: >>>> Using of devm API leads to a certain order of releasing resources. &

Re: [PATCH v4 02/10] locking: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 19:48, Waiman Long a écrit : > > On 12/14/23 12:36, George Stark wrote: >> Using of devm API leads to a certain order of releasing resources. >> So all dependent resources which are not devm-wrapped should be deleted >> with respect to devm-release order. Mutex is one of such

Re: [PATCH v4 02/10] locking: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 18:36, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Using of devm API leads to a certain order of releasing resources. > So all

Re: [PATCH v3 03/11] devm-helpers: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 13:48, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hello Christophe > > On 12/14/23 13:06, C

Re: [PATCH v3 03/11] devm-helpers: introduce devm_mutex_init

2023-12-14 Thread Christophe Leroy
Le 13/12/2023 à 23:30, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Using of devm API leads to a certain order of releasing resources. > So all

Re: [PATCH 13/13] powerpc: Enable KMSAN on powerpc

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > Enable KMSAN in the Kconfig. > > Signed-off-by: Nicholas Miehlbradt > --- > arch/powerpc/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index e33e3250c478..71cc7d2a0a72

Re: [PATCH 12/13] powerpc/string: Add KMSAN support

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > KMSAN expects functions __mem{set,cpy,move} so add aliases pointing to > the respective functions. > > Disable use of architecture specific memset{16,32,64} to ensure that > metadata is correctly updated and strn{cpy,cmp} and mem{chr,cmp}

Re: [PATCH 11/13] powerpc: Implement architecture specific KMSAN interface

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > arch_kmsan_get_meta_or_null finds the metadata addresses for addresses > in the ioremap region which is mapped separately on powerpc. > > kmsan_vir_addr_valid is the same as virt_addr_valid except excludes the > check that addr is less than

Re: [PATCH 10/13] powerpc: Define KMSAN metadata address ranges for vmalloc and ioremap

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > Splits the vmalloc region into four. The first quarter is the new > vmalloc region, the second is used to store shadow metadata and the > third is used to store origin metadata. The fourth quarter is unused. > > Do the same for the ioremap

Re: [PATCH 09/13] powerpc: Disable KMSAN checks on functions which walk the stack

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > Functions which walk the stack read parts of the stack which cannot be > instrumented by KMSAN e.g. the backchain. Disable KMSAN sanitization of > these functions to prevent false positives. Do other architectures have to do it as well ? I

Re: [PATCH 04/13] powerpc: Disable CONFIG_DCACHE_WORD_ACCESS when KMSAN is enabled

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > Word sized accesses may read uninitialized data when optimizing loads. > Disable this optimization when KMSAN is enabled to prevent false > positives. > > Signed-off-by: Nicholas Miehlbradt > --- > arch/powerpc/Kconfig | 2 +- > 1 file

Re: [PATCH 02/13] hvc: Fix use of uninitialized array in udbg_hvc_putc

2023-12-14 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > All elements of bounce_buffer are eventually read and passed to the > hypervisor so it should probably be fully initialized. should or shall ? > > Signed-off-by: Nicholas Miehlbradt Should be a Fixed: tag ? > --- >

Re: [PATCH 1/1] powerpc/debug: implement HAVE_USER_RETURN_NOTIFIER

2023-12-10 Thread Christophe Leroy
Le 11/12/2023 à 03:50, Luming Yu a écrit : > [Vous ne recevez pas souvent de courriers de luming...@shingroup.cn. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > The support for user return notifier infrastructure > is hooked into powerpc

Re: [PATCH RFC/RFT 3/4] riscv: Stop emitting preventive sfence.vma for new userspace mappings

2023-12-07 Thread Christophe Leroy
The subject says "riscv:" but it changes core part and several arch. Maybe this commit should be split in two commits, one for API changes that changes flush_tlb_fix_spurious_fault() to flush_tlb_fix_spurious_write_fault() and adds flush_tlb_fix_spurious_read_fault() including the change in

Re: [PATCH RFC/RFT 2/4] riscv: Add a runtime detection of invalid TLB entries caching

2023-12-07 Thread Christophe Leroy
Le 07/12/2023 à 16:03, Alexandre Ghiti a écrit : > This mechanism allows to completely bypass the sfence.vma introduced by > the previous commit for uarchs that do not cache invalid TLB entries. > > Signed-off-by: Alexandre Ghiti > --- > arch/riscv/mm/init.c | 124

Re: [PATCH RFC/RFT 1/4] riscv: Stop emitting preventive sfence.vma for new vmalloc mappings

2023-12-07 Thread Christophe Leroy
Le 07/12/2023 à 16:03, Alexandre Ghiti a écrit : > In 6.5, we removed the vmalloc fault path because that can't work (see > [1] [2]). Then in order to make sure that new page table entries were > seen by the page table walker, we had to preventively emit a sfence.vma > on all harts [3] but this

Re: [PATCH] drm/amdgpu: drop the long-double-128 powerpc check/hack

2023-12-07 Thread Christophe Leroy
Le 31/03/2023 à 12:53, Michael Ellerman a écrit : > "Daniel Kolesa" writes: >> Commit c653c591789b ("drm/amdgpu: Re-enable DCN for 64-bit powerpc") >> introduced this check as a workaround for the driver not building >> with toolchains that default to 64-bit long double. > ... >> In mainline,

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

2023-12-07 Thread Christophe Leroy
Le 07/12/2023 à 13:51, George Stark a écrit : > > > On 12/7/23 15:28, Christophe Leroy wrote: >> >> >> Le 07/12/2023 à 13:02, Andy Shevchenko a écrit : >>> On Thu, Dec 7, 2023 at 1:23 AM George Stark >>> wrote: >>>> On 12/7/23 0

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

2023-12-07 Thread Christophe Leroy
Le 07/12/2023 à 12:59, Andy Shevchenko a écrit : > On Thu, Dec 7, 2023 at 1:23 AM George Stark wrote: >> On 12/7/23 01:37, Christophe Leroy wrote: >>> Le 06/12/2023 à 23:14, Christophe Leroy a écrit : >>>> Le 06/12/2023 à 19:58, George Stark a écrit : >>>&

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

2023-12-07 Thread Christophe Leroy
Le 07/12/2023 à 13:02, Andy Shevchenko a écrit : > On Thu, Dec 7, 2023 at 1:23 AM George Stark wrote: >> On 12/7/23 01:37, Christophe Leroy wrote: >>> Le 06/12/2023 à 23:14, Christophe Leroy a écrit : > > ... > >>> Looking at it closer, I have the

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

2023-12-06 Thread Christophe Leroy
Le 06/12/2023 à 23:14, Christophe Leroy a écrit : > > > Le 06/12/2023 à 19:58, George Stark a écrit : >> [Vous ne recevez pas souvent de courriers de >> gnst...@salutedevices.com. Découvrez pourquoi ceci est important à >> https://aka.ms/LearnAboutSenderIdenti

[PATCH v2] i2c: cpm: Remove linux,i2c-index conversion from be32

2023-12-06 Thread Christophe Leroy
/202312042210.ql4da8av-...@intel.com/ Signed-off-by: Christophe Leroy --- v2: Use u32 directly, remove be32_to_cpu(). --- drivers/i2c/busses/i2c-cpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 9a664abf734d

Re: [PATCH v2 01/10] devm-helpers: introduce devm_mutex_init

2023-12-06 Thread Christophe Leroy
Le 06/12/2023 à 19:58, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hello Hans > > Thanks for the review. > > On 12/6/23 18:01, Hans de Goede

<    1   2   3   4   5   6   7   8   9   10   >