.
Signed-off-by: Christophe Leroy
Reported-by: kbuild test robot
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/set_memory.h | 2 ++
arch/powerpc/mm/pageattr.c
on !PPC_BOOK3S_604
- make module_alloc() use PAGE_KERNEL protection]
Signed-off-by: Jordan Niethe
---
v10: - Predicate on !PPC_BOOK3S_604
- Make module_alloc() use PAGE_KERNEL protection
v11: - Neaten up
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/module.c | 4 +++-
2
ot be
used for powerpc.
Commit d53d2f78cead ("bpf: Use vmalloc special flag") moved keeping
track of read-only memory to vmalloc. This included removing
bpf_jit_binary_unlock_ro(). Therefore there is no reason powerpc needs
its own bpf_jit_free(). Remove it.
Signed-off-by: Jordan Niethe
--
.
Signed-off-by: Christophe Leroy
Reported-by: kbuild test robot
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/set_memory.h | 2 ++
arch/powerpc/mm/pageattr.c
Add the necessary call to bpf_jit_binary_lock_ro() to remove write and
add exec permissions to the JIT image after it has finished being
written.
Without CONFIG_STRICT_MODULE_RWX the image will be writable and
executable until the call to bpf_jit_binary_lock_ro().
Signed-off-by: Jordan Niethe
-by: Christophe Leroy
[jpn: Reword commit message, switch to __vmalloc_node_range()]
Signed-off-by: Jordan Niethe
---
v9: - vmalloc_exec() no longer exists
- Set the page to RW before freeing it
v10: - use __vmalloc_node_range()
v11: - Neaten up
v12: - Switch from __vmalloc_node_range
a nop. setup_text_poke_area() relies
on kernel virtual memory, cpu hotplug and per_cpu_areas being setup.
setup_per_cpu_areas(), boot_cpu_hotplug_init() and mm_init() are called
before poking_init().
Turn setup_text_poke_area() into poking_init().
Reviewed-by: Russell Currey
Signed-off-by: Jordan
to manipulate ptes
- Radix: Add ptesync after set_pte_at()]
Signed-off-by: Jordan Niethe
---
v10: WARN if trying to change the hash linear map
v11: - Update copywrite dates
- Allow set memory functions to be used without Strict RWX
- Hash: Disallow certain regions and add comment explaining why
the previous revision is available here:
https://lore.kernel.org/linuxppc-dev/20210429031602.2606654-1-jniet...@gmail.com/
The changes in v12 for each patch:
Christophe Leroy (2):
powerpc/mm: implement set_memory_attr()
powerpc/32: use set_memory_attr()
Jordan Niethe (3):
powerpc/lib/code
is already done by the callers.
Signed-off-by: Christophe Leroy
[ruscur: rebase on powerpc/merge with Christophe's new patches]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/mm/pgtable_32.c | 60 ++--
1 file changed, 10 insertions
On Mon, May 10, 2021 at 11:18 AM Jordan Niethe wrote:
>
> From: Russell Currey
>
> The set_memory_{ro/rw/nx/x}() functions are required for
> STRICT_MODULE_RWX, and are generally useful primitives to have. This
> implementation is designed to be generic across powerpc's
On Wed, May 19, 2021 at 6:11 PM Naveen N. Rao
wrote:
>
> Christophe Leroy wrote:
> >
> >
> > Le 06/05/2020 à 05:40, Jordan Niethe a écrit :
> >> Do not allow inserting breakpoints on the suffix of a prefix instruction
> >> in kprobes.
> >>
>
On Mon, May 17, 2021 at 4:49 PM Christophe Leroy
wrote:
>
>
>
> Le 17/05/2021 à 05:28, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > To enable strict module RWX on powerpc, set:
> >
> > CONFIG_STRICT_MODULE_RWX=y
> >
> > You s
On Mon, May 17, 2021 at 4:40 PM Christophe Leroy
wrote:
>
>
>
> Le 17/05/2021 à 05:28, Jordan Niethe a écrit :
> > Add the necessary call to bpf_jit_binary_lock_ro() to remove write and
> > add exec permissions to the JIT image after it has finished being
>
On Mon, May 3, 2021 at 3:57 PM Christophe Leroy
wrote:
>
>
>
> Le 03/05/2021 à 07:39, Jordan Niethe a écrit :
> > On Thu, Apr 29, 2021 at 3:04 PM Christophe Leroy
> > wrote:
> >>
> >>
> >>
> >> Le 29/04/2021 à 05:15, Jordan Niethe a é
On Mon, May 3, 2021 at 4:22 PM Christophe Leroy
wrote:
>
>
>
> Le 03/05/2021 à 08:16, Jordan Niethe a écrit :
> > On Mon, May 3, 2021 at 3:57 PM Christophe Leroy
> > wrote:
> >>
> >>
> >>
> >> Le 03/05/2021 à 07:39, Jordan Niethe a éc
On Thu, Apr 29, 2021 at 3:04 PM Christophe Leroy
wrote:
>
>
>
> Le 29/04/2021 à 05:15, Jordan Niethe a écrit :
> > If MODULES_{VADDR,END} are not defined set them to VMALLOC_START and
> > VMALLOC_END respectively. This reduces the need for special cases. For
> > e
On Thu, Apr 29, 2021 at 5:32 PM Christophe Leroy
wrote:
>
>
>
> Le 29/04/2021 à 05:15, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > The set_memory_{ro/rw/nx/x}() functions are required for
> > STRICT_MODULE_RWX, and are generally useful primitiv
in the 5.8 development cycle:
>
> commit 7c95d8893fb55869882c9f68f4c94840dc43f18f
> Author: Jordan Niethe
> Date: Wed May 6 13:40:25 2020 +1000
>
> powerpc: Change calling convention for create_branch() et. al.
>
> create_branch(), create_cond_branch() and translate_br
-by: Christophe Leroy
[jpn: - Allow set memory functions to be used without Strict RWX
- Hash: Disallow certain regions
- Have change_page_attr() take function pointers to manipulate ptes
- Radix: Add ptesync after set_pte_at()]
Signed-off-by: Jordan Niethe
---
v10: WARN if trying to change
/
The changes in v11 for each patch:
Christophe Leroy (2):
powerpc/mm: implement set_memory_attr()
powerpc/32: use set_memory_attr()
Jordan Niethe (4):
powerpc/lib/code-patching: Set up Strict RWX patching earlier
powerpc: Always define MODULES_{VADDR,END}
v11: - Consider more places
is already done by the callers.
Signed-off-by: Christophe Leroy
[ruscur: rebase on powerpc/merge with Christophe's new patches]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/mm/pgtable_32.c | 60 ++--
1 file changed, 10 insertions
on !PPC_BOOK3S_604
- make module_alloc() use PAGE_KERNEL protection]
Signed-off-by: Jordan Niethe
---
v10: - Predicate on !PPC_BOOK3S_604
- Make module_alloc() use PAGE_KERNEL protection
v11: - Neaten up
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/module.c | 9 ++---
2
.
Signed-off-by: Christophe Leroy
Reported-by: kbuild test robot
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/set_memory.h | 2 ++
arch/powerpc/mm/pageattr.c
Add the necessary call to bpf_jit_binary_lock_ro() to remove write and
add exec permissions to the JIT image after it has finished being
written.
Without CONFIG_STRICT_MODULE_RWX the image will be writable and
executable until the call to bpf_jit_binary_lock_ro().
Signed-off-by: Jordan Niethe
conditional code in other places that need
to allocate from the module region (i.e., kprobes).
Signed-off-by: Jordan Niethe
---
v10: New to series
v11: - Consider more places MODULES_VADDR was being used
---
arch/powerpc/include/asm/pgtable.h| 11 +++
arch/powerpc/kernel/module.c
a nop. setup_text_poke_area() relies
on kernel virtual memory, cpu hotplug and per_cpu_areas being setup.
setup_per_cpu_areas(), boot_cpu_hotplug_init() and mm_init() are called
before poking_init().
Turn setup_text_poke_area() into poking_init().
Reviewed-by: Russell Currey
Signed-off-by: Jordan
-by: Christophe Leroy
[jpn: Reword commit message, switch to __vmalloc_node_range()]
Signed-off-by: Jordan Niethe
---
v9: - vmalloc_exec() no longer exists
- Set the page to RW before freeing it
v10: - use __vmalloc_node_range()
v11: - Neaten up
---
arch/powerpc/kernel/kprobes.c | 11
ot be
used for powerpc.
Commit d53d2f78cead ("bpf: Use vmalloc special flag") moved keeping
track of read-only memory to vmalloc. This included removing
bpf_jit_binary_unlock_ro(). Therefore there is no reason powerpc needs
its own bpf_jit_free(). Remove it.
Signed-off-by: Jordan Niethe
--
On Thu, Apr 29, 2021 at 2:53 PM Christophe Leroy
wrote:
>
>
>
> Le 29/04/2021 à 05:15, Jordan Niethe a écrit :
> > setup_text_poke_area() is a late init call so it runs before
> > mark_rodata_ro() and after the init calls. This lets all the init code
> > patching s
ot;)
Reviewed-by: Nicholas Piggin
Signed-off-by: Jordan Niethe
---
v2: Only ptesync is needed
v3: Fix Fixes tag
---
arch/powerpc/include/asm/book3s/64/radix.h | 6 --
arch/powerpc/mm/book3s64/radix_pgtable.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/pow
so is a convenient way to see this kind of fault.
Add a selftest to try and trigger this kind of a spurious fault. It
tests for 30 seconds which is usually long enough for the issue to show
up.
Signed-off-by: Jordan Niethe
---
v3: New to series
---
tools/testing/selftests/powerpc/mm/Makefile
Another revision to this series adding more Strict RWX support on powerpc, in
particular Strict Module RWX. This revision adds consideration for bpf.
The changes in v10 for each patch:
Christophe Leroy (2):
powerpc/mm: implement set_memory_attr()
powerpc/32: use set_memory_attr()
Jordan
From: Russell Currey
skiroot_defconfig is the only powerpc defconfig with STRICT_KERNEL_RWX
enabled, and if you want memory protection for kernel text you'd want it
for modules too, so enable STRICT_MODULE_RWX there.
Acked-by: Joel Stanley
Signed-off-by: Russell Currey
Signed-off-by: Jordan
.
Signed-off-by: Christophe Leroy
Reported-by: kbuild test robot
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/set_memory.h | 2 ++
arch/powerpc/mm/pageattr.c
is already done by the callers.
Signed-off-by: Christophe Leroy
[ruscur: rebase on powerpc/merge with Christophe's new patches]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/mm/pgtable_32.c | 60 ++--
1 file changed, 10 insertions
on !PPC_BOOK3S_604
- make module_alloc() use PAGE_KERNEL protection]
Signed-off-by: Jordan Niethe
---
v10: - Predicate on !PPC_BOOK3S_604
- Make module_alloc() use PAGE_KERNEL protection
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/kernel/module.c | 11 ---
2 files
linear map]
Signed-off-by: Jordan Niethe
---
v10: WARN if trying to change the hash linear map
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/set_memory.h | 32 ++
arch/powerpc/mm/Makefile | 2 +-
arch/powerpc/mm/pageattr.c
conditional code in other places that need
to allocate from the module region (i.e., kprobes).
Signed-off-by: Jordan Niethe
---
v10: New to series
---
arch/powerpc/include/asm/pgtable.h | 5 +
arch/powerpc/kernel/module.c | 5 +
2 files changed, 6 insertions(+), 4 deletions(-)
diff
a nop. setup_text_poke_area() relies
on kernel virtual memory, cpu hotplug and per_cpu_areas being setup.
setup_per_cpu_areas(), boot_cpu_hotplug_init() and mm_init() are called
before poking_init().
Turn setup_text_poke_area() into poking_init().
Reviewed-by: Russell Currey
Signed-off-by: Jordan
on its own]
Signed-off-by: Jordan Niethe
---
v10: check_wx_pages now affects kernel_page_tables rather then triggers
its own action.
---
arch/powerpc/Kconfig.debug | 6 --
arch/powerpc/mm/ptdump/ptdump.c | 34 -
2 files changed, 37 insertions(+), 3 del
to the JIT image after
it has finished being written.
Signed-off-by: Jordan Niethe
---
v10: New to series
---
arch/powerpc/net/bpf_jit_comp.c | 5 -
arch/powerpc/net/bpf_jit_comp64.c | 4
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch
-by: Christophe Leroy
[jpn: Reword commit message, switch to __vmalloc_node_range()]
Signed-off-by: Jordan Niethe
---
v9: - vmalloc_exec() no longer exists
- Set the page to RW before freeing it
v10: - use __vmalloc_node_range()
---
arch/powerpc/kernel/kprobes.c | 14 ++
1 file
On Fri, Apr 2, 2021 at 12:39 AM Michael Ellerman wrote:
>
> Hi Jordan,
>
> Jordan Niethe writes:
> > Load Multiple Word (lmw) and Store Multiple Word (stmw) will raise an
> > Alignment Exception:
> > - Little Endian mode: always
> > - Big E
on next plus "powerpc/mm/64s: Allow STRICT_KERNEL_RWX again"]
Signed-off-by: Jordan Niethe
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/set_memory.h | 32 +++
arch/powerpc/mm/Makefile | 2 +-
arch/powerpc/mm/pageattr.c
a nop. setup_text_poke_area() relies
on kernel virtual memory, cpu hotplug and per_cpu_areas being setup.
setup_per_cpu_areas(), boot_cpu_hotplug_init() and mm_init() are called
before poking_init().
Turn setup_text_poke_area() into poking_init().
Signed-off-by: Jordan Niethe
---
v9: New to series
From: Russell Currey
Very rudimentary, just
echo 1 > [debugfs]/check_wx_pages
and check the kernel log. Useful for testing strict module RWX.
Updated the Kconfig entry to reflect this.
Also fixed a typo.
Reviewed-by: Kees Cook
Signed-off-by: Russell Currey
Signed-off-by: Jor
free_insn_page()]
Signed-off-by: Jordan Niethe
---
v9: - vmalloc_exec() no longer exists
- Set the page to RW before freeing it
---
arch/powerpc/kernel/kprobes.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index
From: Russell Currey
skiroot_defconfig is the only powerpc defconfig with STRICT_KERNEL_RWX
enabled, and if you want memory protection for kernel text you'd want it
for modules too, so enable STRICT_MODULE_RWX there.
Acked-by: Joel Stanley
Signed-off-by: Russell Currey
Signed-off-by: Jordan
.
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 4498a27ac9db..d9cadc4212d0 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -137,6 +137,7
is already done by the callers.
Signed-off-by: Christophe Leroy
[ruscur: rebase on powerpc/merge with Christophe's new patches]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/mm/pgtable_32.c | 60 ++--
1 file changed, 10 insertions
.
Signed-off-by: Christophe Leroy
Reported-by: kbuild test robot
[ruscur: cast "data" to unsigned long instead of int]
Signed-off-by: Russell Currey
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/set_memory.h | 2 ++
arch/powerpc/mm/pageattr.c
On Tue, Mar 16, 2021 at 5:51 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > To enable strict module RWX on powerpc, set:
> >
> > CONFIG_STRICT_MODULE_RWX=y
> >
> > You s
On Tue, Mar 16, 2021 at 5:32 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > setup_text_poke_area() is a late init call so it runs before
> > mark_rodata_ro() and after the init calls. This lets all the init code
> > patching s
On Tue, Mar 16, 2021 at 5:44 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one
> > W+X page at boot by default. This can
On Tue, Mar 16, 2021 at 5:44 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one
> > W+X page at boot by default. This can
On Tue, Mar 16, 2021 at 6:25 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > From: Christophe Leroy
>
> Can you please update the whole series with my new email address:
> christophe.le...@csgroup.eu
Of course, I shall do that
On Wed, Mar 17, 2021 at 5:12 PM Christophe Leroy
wrote:
>
>
>
> Le 16/03/2021 à 04:17, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > With CONFIG_STRICT_KERNEL_RWX=y and CONFIG_KPROBES=y, there will be one
> > W+X page at boot by default. This can
of if there
is cache inhibited memory available or not.
Signed-off-by: Jordan Niethe
---
.../powerpc/alignment/alignment_handler.c | 96 ++-
1 file changed, 94 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/powerpc/alignment/alignment_handler.c
b/tools
s
instructions")
Signed-off-by: Jordan Niethe
---
arch/powerpc/lib/sstep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 683f7c20f74b..3953e63bbba5 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sste
buffers. memtrace is only available on powernv so there
will not be any chance of trying to do this in a guest.
Signed-off-by: Jordan Niethe
---
.../selftests/powerpc/alignment/alignment_handler.c | 11 +--
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/tools/testing
Let the memory removed from the linear mapping to be used for the trace
buffers be mmaped. This is a useful way of providing cache-inhibited
memory for the alignment_handler selftest.
Signed-off-by: Jordan Niethe
---
arch/powerpc/platforms/powernv/memtrace.c | 18 +-
1 file
On Tue, Mar 30, 2021 at 4:05 PM Christophe Leroy
wrote:
>
>
>
> Le 30/03/2021 à 06:51, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > Add the arch specific insn page allocator for powerpc. This allocates
> > ROX pages if STRICT_KERNEL_RWX is e
On Wed, Mar 31, 2021 at 10:16 PM Michael Ellerman wrote:
>
> Hi Jordan,
>
> A few nits below ...
>
> Jordan Niethe writes:
> > From: Russell Currey
> >
> > The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX,
> > a
On Tue, Mar 30, 2021 at 4:27 PM Christophe Leroy
wrote:
>
>
>
> Le 30/03/2021 à 06:51, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > skiroot_defconfig is the only powerpc defconfig with STRICT_KERNEL_RWX
> > enabled, and if you want memory p
On Fri, Apr 2, 2021 at 12:36 AM Christophe Leroy
wrote:
>
>
>
> Le 30/03/2021 à 06:51, Jordan Niethe a écrit :
> > If MODULES_{VADDR,END} are not defined set them to VMALLOC_START and
> > VMALLOC_END respectively. This reduces the need for special cases. For
> > e
On Thu, Apr 1, 2021 at 3:37 PM Aneesh Kumar K.V
wrote:
>
> Jordan Niethe writes:
>
> > From: Russell Currey
> >
> > The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX,
> > and are generally useful primitives to have. This implementation
On Tue, Mar 30, 2021 at 4:16 PM Christophe Leroy
wrote:
>
>
>
> Le 30/03/2021 à 06:51, Jordan Niethe a écrit :
> > From: Russell Currey
> >
> > The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX,
> > and are generally useful prim
On Wed, Apr 21, 2021 at 3:14 PM Christophe Leroy
wrote:
>
>
>
> Le 21/04/2021 à 04:46, Jordan Niethe a écrit :
> > On Fri, Apr 2, 2021 at 12:36 AM Christophe Leroy
> > wrote:
> >>
> >>
> >>
> >> Le 30/03/2021 à 06:51, Jordan Niethe a é
_init() calls __start() remove the offset
saved in p_branch_lt_off to return the targets to their original
addresses.
Signed-off-by: Jordan Niethe
---
arch/powerpc/include/asm/sections.h | 2 +
arch/powerpc/kernel/head_64.S | 66 +
arch/powerpc/kernel/vmlinux.ld
On Wed, Mar 31, 2021 at 10:24 PM Michael Ellerman wrote:
>
> Jordan Niethe writes:
> > From: Russell Currey
> >
> > Optionally run W+X checks when dumping pagetable information to
> > debugfs' kernel_page_tables.
> >
> > To use:
> > $ echo 1
On Wed, Mar 31, 2021 at 9:37 PM Michael Ellerman wrote:
>
> Jordan Niethe writes:
>
> > Once CONFIG_STRICT_MODULE_RWX is enabled there will be no need to
> > override bpf_jit_free() because it is now possible to set images
> > read-only. So use the default imple
On Sat, Aug 14, 2021 at 8:59 AM Fabiano Rosas wrote:
>
> Laurent Vivier writes:
>
> >
> > since this patch is merged my VM is experiencing a crash at boot (20% of
> > the time):
> >
> > [8.496850] kernel tried to execute exec-protected page
> > (c00804073278) - exploit
> > attempt?
On Sat, Sep 11, 2021 at 12:35 PM Christopher M. Riedl
wrote:
>
> x86 supports the notion of a temporary mm which restricts access to
> temporary PTEs to a single CPU. A temporary mm is useful for situations
> where a CPU needs to perform sensitive operations (such as patching a
>
On Sat, Sep 11, 2021 at 12:39 PM Christopher M. Riedl
wrote:
>
> When code patching a STRICT_KERNEL_RWX kernel the page containing the
> address to be patched is temporarily mapped as writeable. Currently, a
> per-cpu vmalloc patch area is used for this purpose. While the patch
> area is per-cpu,
On Thu, Sep 16, 2021 at 10:40 AM Christopher M. Riedl
wrote:
>
> On Tue Sep 14, 2021 at 11:24 PM CDT, Jordan Niethe wrote:
> > On Sat, Sep 11, 2021 at 12:39 PM Christopher M. Riedl
> > wrote:
> > > ...
> > > +/*
> > > + * This can be called for kern
On Thu, Sep 16, 2021 at 10:38 AM Christopher M. Riedl
wrote:
>
> On Sat Sep 11, 2021 at 4:14 AM CDT, Jordan Niethe wrote:
> > On Sat, Sep 11, 2021 at 12:39 PM Christopher M. Riedl
> > wrote:
> > >
> > > When code patching a STRICT_KERNEL_RWX kernel t
On Sat, Sep 11, 2021 at 12:39 PM Christopher M. Riedl
wrote:
>
> When code patching a STRICT_KERNEL_RWX kernel the page containing the
> address to be patched is temporarily mapped as writeable. Currently, a
> per-cpu vmalloc patch area is used for this purpose. While the patch
> area is per-cpu,
buildtime
and elimination of non possible parts of code at compile time. For this
to work radix_enabled() must be inlined so make it __always_inline.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=213803
Reported-by: Erhard F.
Suggested-by: Michael Ellerman
Signed-off-by: Jordan Niethe
---
arch/powerpc/i
for a synthetic implementation
and skip the test if so.
Signed-off-by: Jordan Niethe
---
v2: Added checking for synthetic implementation to more tests
---
.../selftests/powerpc/ptrace/ptrace-tm-gpr.c | 1 +
.../powerpc/ptrace/ptrace-tm-spd-gpr.c| 1 +
.../powerpc/ptrace/ptrace-tm-spd-tar.c
-by: Michael Neuling
Signed-off-by: Jordan Niethe
---
tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c | 2 +-
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-gpr.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace
On Wed, Sep 29, 2021 at 9:50 PM Christophe Leroy
wrote:
>
>
>
> Le 29/09/2021 à 13:18, Hari Bathini a écrit :
> > From: Ravi Bangoria
> >
> > BPF load instruction with BPF_PROBE_MEM mode can cause a fault
> > inside kernel. Append exception table for such instructions
> > within BPF program.
> >
On Thu, Sep 30, 2021 at 4:13 PM Daniel Axtens wrote:
>
> Hi Michael,
>
> > kvmppc_h_set_dabr(), and kvmppc_h_set_xdabr() which jumps into
> > it, need to use _GLOBAL_TOC to setup the kernel TOC pointer, because
> > kvmppc_h_set_dabr() uses LOAD_REG_ADDR() to load dawr_force_enable.
>
> This makes
mporary mm is in use - this may include breakpoints set by perf.
Based on x86 implementation:
commit cefa929c034e
("x86/mm: Introduce temporary mm structs")
Signed-off-by: Christopher M. Riedl
Signed-off-by: Jordan Niethe
---
v7: - use breakpoint_pause()/breakpoint_unpause()
- simplif
. Riedl (4):
powerpc/64s: Introduce temporary mm for Radix MMU
powerpc: Rework and improve STRICT_KERNEL_RWX patching
powerpc: Use WARN_ON and fix check in poking_init
powerpc/64s: Initialize and use a temporary mm for patching on Radix
Jordan Niethe (1):
powerpc: Allow clearing
a pause_breakpoints() function which will
clear the breakpoint registers without touching the state in
current_bkr[]. Add a pair function unpause_breakpoints() which will move
the state in current_brk[] back to the registers.
Signed-off-by: Jordan Niethe
---
v7: New to series
---
arch/powerpc
;x86/alternatives: Use temporary mm for text poking")
Signed-off-by: Christopher M. Riedl
Signed-off-by: Jordan Niethe
---
v7: - Change to patch_instruction_mm() instead of map_patch_mm() and
unmap_patch_mm()
- include ptesync
---
arch/powerpc/lib/code-patching.c | 106
error from __patch_instruction() properly.
Signed-off-by: Christopher M. Riedl
Signed-off-by: Jordan Niethe
---
v7: still pass addr to map_patch_area()
---
arch/powerpc/lib/code-patching.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/lib/code-patchin
le".
Also take this opportunity to fix the failure check in the WARN_ON():
cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, ...) returns a positive integer
on success and a negative integer on failure.
Signed-off-by: Christopher M. Riedl
Signed-off-by: Jordan Niethe
---
v7: no change
---
a
en_context mappings.
Signed-off-by: Jordan Niethe
---
arch/powerpc/net/bpf_jit.h| 5 ++
arch/powerpc/net/bpf_jit64.h | 30 +-
arch/powerpc/net/bpf_jit_comp32.c | 5 --
arch/powerpc/net/bpf_jit_comp64.c | 96 ---
4 files changed, 71 insertions(+), 65
nop
8: xor r8,r8,r8
c: rotlwi r8,r8,0
10: xor r5,r5,r5
14: rotlwi r5,r5,0
18: mr r4,r3
1c: li r8,66
20: add r8,r8,r5
24: rotlwi r8,r8,0
28: mr r3,r8
2c: blr
Signed-off-by: Jordan Niethe
---
arch/powerpc/net/bpf_jit64.h
registers to ppc registers.
Signed-off-by: Jordan Niethe
---
arch/powerpc/net/bpf_jit_comp64.c | 163 +-
1 file changed, 69 insertions(+), 94 deletions(-)
diff --git a/arch/powerpc/net/bpf_jit_comp64.c
b/arch/powerpc/net/bpf_jit_comp64.c
index de8595880fee..1dfec85bb03b
On Sat, Mar 12, 2022 at 6:30 PM Christophe Leroy
wrote:
>
> Hi Jordan
>
> Le 10/11/2021 à 01:37, Jordan Niethe a écrit :
> > From: "Christopher M. Riedl"
> >
> > Rework code-patching with STRICT_KERNEL_RWX to prepare for a later patch
> > which uses
On Wed, Feb 23, 2022 at 1:34 AM Christophe Leroy
wrote:
>
>
>
> Le 02/06/2020 à 07:27, Jordan Niethe a écrit :
> > Currently prefixed instructions are treated as two word instructions by
> > show_user_instructions(), treat them as a single instruction. '<' an
More "wrapper" style accessor generating macros will be introduced for
the nestedv2 guest support. Rename the existing macros with more
descriptive names now so there is a consistent naming convention.
Reviewed-by: Nicholas Piggin
Signed-off-by: Jordan Niethe
---
v3:
- New to
Introduce accessor generator macros for VCPU registers. Use the accessor
functions to replace direct accesses to this registers.
This will be important later for Nested APIv2 support which requires
additional functionality for accessing and modifying VCPU state.
Signed-off-by: Jordan Niethe
Introduce accessor generator macros for VCORE registers. Use the accessor
functions to replace direct accesses to this registers.
This will be important later for Nested APIv2 support which requires
additional functionality for accessing and modifying VCPU state.
Signed-off-by: Jordan Niethe
eries_rpt_invalidate() to
match that. Update the callers of pseries_rpt_invalidate() to also take
an unsigned long if they take an lpid value.
Signed-off-by: Jordan Niethe
---
v3:
- New to series
v4:
- Use u64
- Change format strings instead of casting
---
arch/powerpc/include/asm/k
the value of elements and parsing buffers. This will be used
later by the nestedv2 guest support.
Signed-off-by: Jordan Niethe
---
v2:
- Add missing #ifdef CONFIG_VSXs
- Move files from lib/ to kvm/
- Guard compilation on CONFIG_KVM_BOOK3S_HV_POSSIBLE
- Use kunit for guest state buffer
that is not currently present.
kvmppc_set_msr_hv() already exists, it is used for the
kvmppc_ops::set_msr callback.
Introduce a low level accessor __kvmppc_{s,g}et_msr_hv() that simply
gets and sets shregs::msr. This will be extend for Nested APIv2 support.
Signed-off-by: Jordan Niethe
---
v4:
- New
401 - 500 of 591 matches
Mail list logo