this by the call to jump_label_init() in early_init_devtree().
This creates a window in which JUMP_LABEL_FEATURE_CHECK_DEBUG will not
detect misuse and report errors. Add a flag specifically to indicate
when {cpu,mmu}_has_feature() is safe to use.
Signed-off-by: Nicholas Miehlbradt
---
v2: Reword commit message
On 28/3/2024 2:20 am, Christophe Leroy wrote:
Le 27/03/2024 à 05:59, Nicholas Miehlbradt a écrit :
JUMP_LABEL_FEATURE_CHECK_DEBUG used static_key_initialized to determine
whether {cpu,mmu}_has_feature() was used before static keys were
initialized. However, {cpu,mmu}_has_feature() should
On 28/3/2024 2:20 am, Christophe Leroy wrote:
Le 27/03/2024 à 05:59, Nicholas Miehlbradt a écrit :
JUMP_LABEL_FEATURE_CHECK_DEBUG used static_key_initialized to determine
whether {cpu,mmu}_has_feature() was used before static keys were
initialized. However, {cpu,mmu}_has_feature() should
there is a window in which JUMP_LABEL_FEATURE_CHECK_DEBUG
will not report errors. Add a flag specifically to indicate when
{cpu,mmu}_has_feature() is safe to use.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/include/asm/cpu_has_feature.h | 2 +-
arch/powerpc/include/asm/feature-fixups.h
On 14/12/2023 8:00 pm, Christophe Leroy wrote:
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
On 14/12/2023 8:25 pm, Christophe Leroy wrote:
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
On 14/12/2023 8:17 pm, Christophe Leroy wrote:
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
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 --git a/mm/kmsan/hooks.c b/mm/kmsan/hooks.c
index 7a30274b893c
plpar_hcall provides to the hypervisor a buffer where return data should be
placed. The hypervisor initializes the buffers which is not visible to
KMSAN so unpoison them manually.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/platforms/pseries/hvconsole.c | 2 ++
arch/powerpc/sysdev/xive
KMSAN does not unpoison the ainsn field of a kprobe struct correctly.
Manually unpoison it to prevent false positives.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/kernel/kprobes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel
(CONFIG_PPC32).
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/include/asm/book3s/64/pgtable.h | 42
arch/powerpc/kernel/module.c | 2 +-
2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h
b/arch
higher than this.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/include/asm/kmsan.h | 44
1 file changed, 44 insertions(+)
create mode 100644 arch/powerpc/include/asm/kmsan.h
diff --git a/arch/powerpc/include/asm/kmsan.h b/arch/powerpc/include/asm/kmsan.h
new
rtas_call provides a buffer where the return data should be placed. Rtas
initializes the buffer which is not visible to KMSAN so unpoison it
manually.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/platforms/pseries/nvram.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch
be instrumented to
propagate/check metadata.
Alias calls to mem{set,cpy,move} to __msan_mem{set,cpy,move} in
instrumented code to correctly propagate metadata.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/include/asm/kmsan.h | 7 +++
arch/powerpc/include/asm/string.h
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 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -217,6 +217,7
pt_regs is initialized ppc_save_regs which is implemented in assembly
and therefore does not mark the struct as initialized. Unpoison it so
that it will not generate false positives.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/include/asm/interrupt.h | 2 ++
arch/powerpc/kernel/irq_64.c
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.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/kernel/process.c| 6 +++---
arch/powerpc/kernel
] https://lore.kernel.org/linux-mm/20231121220155.1217090-1-...@linux.ibm.com/
[3]
https://lore.kernel.org/linux-rtc/20231129073647.2624497-1-nicho...@linux.ibm.com/
Nicholas Miehlbradt (13):
kmsan: Export kmsan_handle_dma
hvc: Fix use of uninitialized array in udbg_hvc_putc
powerpc: Disable
All elements of bounce_buffer are eventually read and passed to the
hypervisor so it should probably be fully initialized.
Signed-off-by: Nicholas Miehlbradt
---
drivers/tty/hvc/hvc_vio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty
Other sanitizers are disabled for these, disable KMSAN too.
prom_init.o can only reference a limited set of external symbols. KMSAN
adds additional references which are not permitted so disable
sanitization.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/kernel/Makefile | 2 ++
arch
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 changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/Kconfig
boundaries.
Signed-off-by: Nicholas Miehlbradt
---
v3: Move STACK_FRAME_PARAMS macros to ppc_asm.h
Add diagram in comments to show position of pointers into the stack during
execution
v2: Rename PARAMETER_SAVE_OFFSET to STACK_FRAME_PARAMS
Add definitions of STACK_FRAME_PARAMS for PPC32
-by: Nicholas Miehlbradt
---
v2: Rename PARAMETER_SAVE_OFFSET to STACK_FRAME_PARAMS
Add definitions of STACK_FRAME_PARAMS for PPC32 and remove dependancy on
PPC64
Ignore the current stack frame and start with it's parent, similar to x86
v1:
https://lore.kernel.org/linuxppc-dev
On 14/12/2022 10:39 pm, Nicholas Piggin wrote:
On Wed Dec 14, 2022 at 6:39 PM AEST, Christophe Leroy wrote:
Le 14/12/2022 à 05:42, Nicholas Miehlbradt a écrit :
Walks the stack when copy_{to,from}_user address is in the stack to
ensure that the object being copied is entirely within
-by: Nicholas Miehlbradt
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/thread_info.h | 38 ++
2 files changed, 39 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2ca5418457ed..4c59d139ea83 100644
--- a/arch/powerpc
-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c
b/arch/powerpc/mm/book3s64/hash_utils.c
index fc92613dc2bf..e63ff401a6ea 100644
NCE memory is initially allocated using memblock but is
later marked as SLAB allocated. This necessitates the change
to __pud_free to ensure that the KFENCE pages are freed
appropriately.
Based on previous work by Christophe Leroy and Jordan Niethe.
Signed-off-by: Nicholas Miehlbradt
---
v2: Refactor
v3:
From: Christophe Leroy
If the page is already mapped resp. already unmapped, bail out.
Signed-off-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm
There is support for DEBUG_PAGEALLOC on hash but not on radix.
Add support on radix.
Signed-off-by: Nicholas Miehlbradt
---
v2: Revert change to radix_memory_block_size, instead set the size
in radix_init_pgtable and radix__create_section_mapping directly.
v3: Remove max_mapping_size argument
From: Christophe Leroy
If the page is already mapped resp. already unmapped, bail out.
Signed-off-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm
NCE memory is initially allocated using memblock but is
later marked as SLAB allocated. This necessitates the change
to __pud_free to ensure that the KFENCE pages are freed
appropriately.
Based on previous work by Christophe Leroy and Jordan Niethe.
Signed-off-by: Nicholas Miehlbradt
---
v2: Refactor
-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c
b/arch/powerpc/mm/book3s64/hash_utils.c
index fc92613dc2bf..e63ff401a6ea 100644
There is support for DEBUG_PAGEALLOC on hash but not on radix.
Add support on radix.
Signed-off-by: Nicholas Miehlbradt
---
v2: Revert change to radix_memory_block_size, instead set the size
in radix_init_pgtable and radix__create_section_mapping directly.
---
arch/powerpc/mm/book3s64
From: Christophe Leroy
If the page is already mapped resp. already unmapped, bail out.
Signed-off-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm
-by: Christophe Leroy
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/hash_utils.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c
b/arch/powerpc/mm/book3s64/hash_utils.c
index fc92613dc2bf..e63ff401a6ea 100644
NCE memory is initially allocated using memblock but is
later marked as SLAB allocated. This necessitates the change
to __pud_free to ensure that the KFENCE pages are freed
appropriately.
Based on previous work by Christophe Leroy and Jordan Niethe.
Signed-off-by: Nicholas Miehlbradt
---
arch/power
There is support for DEBUG_PAGEALLOC on hash but not on radix.
Add support on radix.
Signed-off-by: Nicholas Miehlbradt
---
arch/powerpc/mm/book3s64/radix_pgtable.c | 16 +++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c
b
On 17/8/2022 4:15 pm, Jordan Niethe wrote:
On Wed, 2022-08-17 at 15:06 +1000, Russell Currey wrote:
From: Nicholas Miehlbradt
This selftest is designed to cover execute-only protections
on the Radix MMU but will also work with Hash.
The tests are based on those found in pkey_exec_test
Add POWER9 and POWER10 to CPU families and list Radix MMU.
Signed-off-by: Nicholas Miehlbradt
---
Documentation/powerpc/cpu_families.rst | 13 +
1 file changed, 13 insertions(+)
diff --git a/Documentation/powerpc/cpu_families.rst
b/Documentation/powerpc/cpu_families.rst
index
39 matches
Mail list logo