* [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-18 6:43 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-18 6:43 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-hyperv, Peter Zijlstra, Catalin Marinas, x86, Dexuan Cui,
linux-kernel, linux-mm, Jessica Yu, Vitaly Kuznetsov,
Will Deacon, linux-arm-kernel
Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
page read-only just after the allocation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/arm64/kernel/probes/kprobes.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
index d1c95dcf1d7833..cbe49cd117cfec 100644
--- a/arch/arm64/kernel/probes/kprobes.c
+++ b/arch/arm64/kernel/probes/kprobes.c
@@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
void *alloc_insn_page(void)
{
- void *page;
-
- page = vmalloc_exec(PAGE_SIZE);
- if (page) {
- set_memory_ro((unsigned long)page, 1);
- set_vm_flush_reset_perms(page);
- }
-
- return page;
+ return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
+ GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
+ NUMA_NO_NODE, __func__);
}
/* arm kprobe: install breakpoint in text */
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 6:43 ` Christoph Hellwig
@ 2020-06-18 8:55 ` David Hildenbrand
-1 siblings, 0 replies; 35+ messages in thread
From: David Hildenbrand @ 2020-06-18 8:55 UTC (permalink / raw)
To: Christoph Hellwig, Andrew Morton
Cc: Dexuan Cui, Vitaly Kuznetsov, Peter Zijlstra, Catalin Marinas,
Will Deacon, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On 18.06.20 08:43, Christoph Hellwig wrote:
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
I do wonder if something like vmalloc_prot(size, prot) would make this
(and the other two users) easier to read.
So instead of ripping out vmalloc_exec(), converting it into
vmalloc_prot() instead.
Did you consider that?
Apart from that LGTM
> }
>
> /* arm kprobe: install breakpoint in text */
>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-18 8:55 ` David Hildenbrand
0 siblings, 0 replies; 35+ messages in thread
From: David Hildenbrand @ 2020-06-18 8:55 UTC (permalink / raw)
To: Christoph Hellwig, Andrew Morton
Cc: linux-hyperv, Peter Zijlstra, Catalin Marinas, x86, Dexuan Cui,
linux-kernel, linux-mm, Jessica Yu, Vitaly Kuznetsov,
Will Deacon, linux-arm-kernel
On 18.06.20 08:43, Christoph Hellwig wrote:
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
I do wonder if something like vmalloc_prot(size, prot) would make this
(and the other two users) easier to read.
So instead of ripping out vmalloc_exec(), converting it into
vmalloc_prot() instead.
Did you consider that?
Apart from that LGTM
> }
>
> /* arm kprobe: install breakpoint in text */
>
--
Thanks,
David / dhildenb
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 8:55 ` David Hildenbrand
@ 2020-06-18 10:35 ` Peter Zijlstra
-1 siblings, 0 replies; 35+ messages in thread
From: Peter Zijlstra @ 2020-06-18 10:35 UTC (permalink / raw)
To: David Hildenbrand
Cc: Christoph Hellwig, Andrew Morton, Dexuan Cui, Vitaly Kuznetsov,
Catalin Marinas, Will Deacon, Jessica Yu, x86, linux-arm-kernel,
linux-kernel, linux-hyperv, linux-mm
On Thu, Jun 18, 2020 at 10:55:58AM +0200, David Hildenbrand wrote:
> On 18.06.20 08:43, Christoph Hellwig wrote:
> > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > page read-only just after the allocation.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> > arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> > 1 file changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> > index d1c95dcf1d7833..cbe49cd117cfec 100644
> > --- a/arch/arm64/kernel/probes/kprobes.c
> > +++ b/arch/arm64/kernel/probes/kprobes.c
> > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> >
> > void *alloc_insn_page(void)
> > {
> > - void *page;
> > -
> > - page = vmalloc_exec(PAGE_SIZE);
> > - if (page) {
> > - set_memory_ro((unsigned long)page, 1);
> > - set_vm_flush_reset_perms(page);
> > - }
> > -
> > - return page;
> > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > + NUMA_NO_NODE, __func__);
>
> I do wonder if something like vmalloc_prot(size, prot) would make this
> (and the other two users) easier to read.
>
> So instead of ripping out vmalloc_exec(), converting it into
> vmalloc_prot() instead.
>
> Did you consider that?
For x86 Christoph did module_alloc_prot(), which is in his more
extensive set of patches addressing this. I suspect that would be the
right thing for ARM64 as well.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-18 10:35 ` Peter Zijlstra
0 siblings, 0 replies; 35+ messages in thread
From: Peter Zijlstra @ 2020-06-18 10:35 UTC (permalink / raw)
To: David Hildenbrand
Cc: linux-hyperv, Catalin Marinas, x86, Dexuan Cui, linux-kernel,
Christoph Hellwig, linux-mm, Jessica Yu, Vitaly Kuznetsov,
Will Deacon, Andrew Morton, linux-arm-kernel
On Thu, Jun 18, 2020 at 10:55:58AM +0200, David Hildenbrand wrote:
> On 18.06.20 08:43, Christoph Hellwig wrote:
> > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > page read-only just after the allocation.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> > arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> > 1 file changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> > index d1c95dcf1d7833..cbe49cd117cfec 100644
> > --- a/arch/arm64/kernel/probes/kprobes.c
> > +++ b/arch/arm64/kernel/probes/kprobes.c
> > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> >
> > void *alloc_insn_page(void)
> > {
> > - void *page;
> > -
> > - page = vmalloc_exec(PAGE_SIZE);
> > - if (page) {
> > - set_memory_ro((unsigned long)page, 1);
> > - set_vm_flush_reset_perms(page);
> > - }
> > -
> > - return page;
> > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > + NUMA_NO_NODE, __func__);
>
> I do wonder if something like vmalloc_prot(size, prot) would make this
> (and the other two users) easier to read.
>
> So instead of ripping out vmalloc_exec(), converting it into
> vmalloc_prot() instead.
>
> Did you consider that?
For x86 Christoph did module_alloc_prot(), which is in his more
extensive set of patches addressing this. I suspect that would be the
right thing for ARM64 as well.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 10:35 ` Peter Zijlstra
@ 2020-06-18 13:50 ` Christoph Hellwig
-1 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-18 13:50 UTC (permalink / raw)
To: Peter Zijlstra
Cc: David Hildenbrand, Christoph Hellwig, Andrew Morton, Dexuan Cui,
Vitaly Kuznetsov, Catalin Marinas, Will Deacon, Jessica Yu, x86,
linux-arm-kernel, linux-kernel, linux-hyperv, linux-mm
On Thu, Jun 18, 2020 at 12:35:06PM +0200, Peter Zijlstra wrote:
> On Thu, Jun 18, 2020 at 10:55:58AM +0200, David Hildenbrand wrote:
> > On 18.06.20 08:43, Christoph Hellwig wrote:
> > > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > > page read-only just after the allocation.
> > >
> > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > > ---
> > > arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> > > 1 file changed, 3 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> > > index d1c95dcf1d7833..cbe49cd117cfec 100644
> > > --- a/arch/arm64/kernel/probes/kprobes.c
> > > +++ b/arch/arm64/kernel/probes/kprobes.c
> > > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> > >
> > > void *alloc_insn_page(void)
> > > {
> > > - void *page;
> > > -
> > > - page = vmalloc_exec(PAGE_SIZE);
> > > - if (page) {
> > > - set_memory_ro((unsigned long)page, 1);
> > > - set_vm_flush_reset_perms(page);
> > > - }
> > > -
> > > - return page;
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> >
> > I do wonder if something like vmalloc_prot(size, prot) would make this
> > (and the other two users) easier to read.
> >
> > So instead of ripping out vmalloc_exec(), converting it into
> > vmalloc_prot() instead.
> >
> > Did you consider that?
>
> For x86 Christoph did module_alloc_prot(), which is in his more
> extensive set of patches addressing this. I suspect that would be the
> right thing for ARM64 as well.
Yes. The somewhat hacky way I added it cause problems for UML, so I
instead plan to do a series converting all architectures over to
module_alloc_prot, plus lots of other cleanups in the area that I
noticed.
I don't think vmalloc_prot is a good idea per se, as there only few
potential users, and I don't want too many vmalloc APIs.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-18 13:50 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-18 13:50 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-hyperv, David Hildenbrand, Catalin Marinas, x86,
Dexuan Cui, linux-kernel, Christoph Hellwig, linux-mm,
Jessica Yu, Vitaly Kuznetsov, Will Deacon, Andrew Morton,
linux-arm-kernel
On Thu, Jun 18, 2020 at 12:35:06PM +0200, Peter Zijlstra wrote:
> On Thu, Jun 18, 2020 at 10:55:58AM +0200, David Hildenbrand wrote:
> > On 18.06.20 08:43, Christoph Hellwig wrote:
> > > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > > page read-only just after the allocation.
> > >
> > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > > ---
> > > arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> > > 1 file changed, 3 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> > > index d1c95dcf1d7833..cbe49cd117cfec 100644
> > > --- a/arch/arm64/kernel/probes/kprobes.c
> > > +++ b/arch/arm64/kernel/probes/kprobes.c
> > > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> > >
> > > void *alloc_insn_page(void)
> > > {
> > > - void *page;
> > > -
> > > - page = vmalloc_exec(PAGE_SIZE);
> > > - if (page) {
> > > - set_memory_ro((unsigned long)page, 1);
> > > - set_vm_flush_reset_perms(page);
> > > - }
> > > -
> > > - return page;
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> >
> > I do wonder if something like vmalloc_prot(size, prot) would make this
> > (and the other two users) easier to read.
> >
> > So instead of ripping out vmalloc_exec(), converting it into
> > vmalloc_prot() instead.
> >
> > Did you consider that?
>
> For x86 Christoph did module_alloc_prot(), which is in his more
> extensive set of patches addressing this. I suspect that would be the
> right thing for ARM64 as well.
Yes. The somewhat hacky way I added it cause problems for UML, so I
instead plan to do a series converting all architectures over to
module_alloc_prot, plus lots of other cleanups in the area that I
noticed.
I don't think vmalloc_prot is a good idea per se, as there only few
potential users, and I don't want too many vmalloc APIs.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 6:43 ` Christoph Hellwig
@ 2020-06-18 9:27 ` Peter Zijlstra
-1 siblings, 0 replies; 35+ messages in thread
From: Peter Zijlstra @ 2020-06-18 9:27 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, Dexuan Cui, Vitaly Kuznetsov, Catalin Marinas,
Will Deacon, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On Thu, Jun 18, 2020 at 08:43:06AM +0200, Christoph Hellwig wrote:
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
> }
I think this has the exact same range issue as the x86 user. But it
might be less fatal if their PLT magic can cover the full range.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-18 9:27 ` Peter Zijlstra
0 siblings, 0 replies; 35+ messages in thread
From: Peter Zijlstra @ 2020-06-18 9:27 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-hyperv, Catalin Marinas, x86, Dexuan Cui, linux-kernel,
linux-mm, Jessica Yu, Andrew Morton, Will Deacon,
Vitaly Kuznetsov, linux-arm-kernel
On Thu, Jun 18, 2020 at 08:43:06AM +0200, Christoph Hellwig wrote:
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
> }
I think this has the exact same range issue as the x86 user. But it
might be less fatal if their PLT magic can cover the full range.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 6:43 ` Christoph Hellwig
` (2 preceding siblings ...)
(?)
@ 2020-06-21 2:16 ` Andrew Morton
2020-06-23 9:05 ` Christoph Hellwig
-1 siblings, 1 reply; 35+ messages in thread
From: Andrew Morton @ 2020-06-21 2:16 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Dexuan Cui, Vitaly Kuznetsov, Peter Zijlstra, Catalin Marinas,
Will Deacon, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On Thu, 18 Jun 2020 08:43:06 +0200 Christoph Hellwig <hch@lst.de> wrote:
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
> }
>
> /* arm kprobe: install breakpoint in text */
But why. I think this is just a cleanup, doesn't address any runtime issue?
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-21 2:16 ` Andrew Morton
@ 2020-06-23 9:05 ` Christoph Hellwig
2020-06-23 9:07 ` Will Deacon
0 siblings, 1 reply; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-23 9:05 UTC (permalink / raw)
To: Andrew Morton
Cc: Christoph Hellwig, Dexuan Cui, Vitaly Kuznetsov, Peter Zijlstra,
Catalin Marinas, Will Deacon, Jessica Yu, x86, linux-arm-kernel,
linux-kernel, linux-hyperv, linux-mm
On Sat, Jun 20, 2020 at 07:16:16PM -0700, Andrew Morton wrote:
> On Thu, 18 Jun 2020 08:43:06 +0200 Christoph Hellwig <hch@lst.de> wrote:
>
> > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > page read-only just after the allocation.
> >
> > --- a/arch/arm64/kernel/probes/kprobes.c
> > +++ b/arch/arm64/kernel/probes/kprobes.c
> > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> >
> > void *alloc_insn_page(void)
> > {
> > - void *page;
> > -
> > - page = vmalloc_exec(PAGE_SIZE);
> > - if (page) {
> > - set_memory_ro((unsigned long)page, 1);
> > - set_vm_flush_reset_perms(page);
> > - }
> > -
> > - return page;
> > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > + NUMA_NO_NODE, __func__);
> > }
> >
> > /* arm kprobe: install breakpoint in text */
>
> But why. I think this is just a cleanup, doesn't address any runtime issue?
It doesn't "fix" an issue - it just simplifies and speeds up the code.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-23 9:05 ` Christoph Hellwig
@ 2020-06-23 9:07 ` Will Deacon
2020-06-23 9:37 ` Peter Zijlstra
0 siblings, 1 reply; 35+ messages in thread
From: Will Deacon @ 2020-06-23 9:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, Dexuan Cui, Vitaly Kuznetsov, Peter Zijlstra,
Catalin Marinas, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On Tue, Jun 23, 2020 at 11:05:05AM +0200, Christoph Hellwig wrote:
> On Sat, Jun 20, 2020 at 07:16:16PM -0700, Andrew Morton wrote:
> > On Thu, 18 Jun 2020 08:43:06 +0200 Christoph Hellwig <hch@lst.de> wrote:
> >
> > > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > > page read-only just after the allocation.
> > >
> > > --- a/arch/arm64/kernel/probes/kprobes.c
> > > +++ b/arch/arm64/kernel/probes/kprobes.c
> > > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> > >
> > > void *alloc_insn_page(void)
> > > {
> > > - void *page;
> > > -
> > > - page = vmalloc_exec(PAGE_SIZE);
> > > - if (page) {
> > > - set_memory_ro((unsigned long)page, 1);
> > > - set_vm_flush_reset_perms(page);
> > > - }
> > > -
> > > - return page;
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> > > }
> > >
> > > /* arm kprobe: install breakpoint in text */
> >
> > But why. I think this is just a cleanup, doesn't address any runtime issue?
>
> It doesn't "fix" an issue - it just simplifies and speeds up the code.
Ok, but I don't understand the PLT comment from Peter in
20200618092754.GF576905@hirez.programming.kicks-ass.net:
| I think this has the exact same range issue as the x86 user. But it
| might be less fatal if their PLT magic can cover the full range.
Peter, please could you elaborate on your concern? I feel like I'm missing
some context.
Cheers,
Will
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-23 9:07 ` Will Deacon
@ 2020-06-23 9:37 ` Peter Zijlstra
2020-06-23 9:57 ` Will Deacon
0 siblings, 1 reply; 35+ messages in thread
From: Peter Zijlstra @ 2020-06-23 9:37 UTC (permalink / raw)
To: Will Deacon
Cc: Christoph Hellwig, Andrew Morton, Dexuan Cui, Vitaly Kuznetsov,
Catalin Marinas, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On Tue, Jun 23, 2020 at 10:07:58AM +0100, Will Deacon wrote:
> On Tue, Jun 23, 2020 at 11:05:05AM +0200, Christoph Hellwig wrote:
> > On Sat, Jun 20, 2020 at 07:16:16PM -0700, Andrew Morton wrote:
> > > On Thu, 18 Jun 2020 08:43:06 +0200 Christoph Hellwig <hch@lst.de> wrote:
> > >
> > > > Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> > > > page read-only just after the allocation.
> > > >
> > > > --- a/arch/arm64/kernel/probes/kprobes.c
> > > > +++ b/arch/arm64/kernel/probes/kprobes.c
> > > > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> > > >
> > > > void *alloc_insn_page(void)
> > > > {
> > > > - void *page;
> > > > -
> > > > - page = vmalloc_exec(PAGE_SIZE);
> > > > - if (page) {
> > > > - set_memory_ro((unsigned long)page, 1);
> > > > - set_vm_flush_reset_perms(page);
> > > > - }
> > > > -
> > > > - return page;
> > > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > > + NUMA_NO_NODE, __func__);
> > > > }
> > > >
> > > > /* arm kprobe: install breakpoint in text */
> > >
> > > But why. I think this is just a cleanup, doesn't address any runtime issue?
> >
> > It doesn't "fix" an issue - it just simplifies and speeds up the code.
>
> Ok, but I don't understand the PLT comment from Peter in
> 20200618092754.GF576905@hirez.programming.kicks-ass.net:
>
> | I think this has the exact same range issue as the x86 user. But it
> | might be less fatal if their PLT magic can cover the full range.
>
> Peter, please could you elaborate on your concern? I feel like I'm missing
> some context.
On x86 we can only directly call code in a (signed) 32bit immediate
range (2G) and our kernel text and module range are constrained by that.
IIRC ARM64 has an even smaller immediate range and needs to play fixup
games with trampolines or somesuch (there was an ARM specific name for
it that I've misplaced again). Does that machinery cover the entire
vmalloc space or are you only able to fix up for a smaller range?
Your arch/arm64/kernel/module.c:module_alloc() implementation seems to
have an explicit module range different from the full vmalloc range, I'm
thinking this is for a reason.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-23 9:37 ` Peter Zijlstra
@ 2020-06-23 9:57 ` Will Deacon
0 siblings, 0 replies; 35+ messages in thread
From: Will Deacon @ 2020-06-23 9:57 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Christoph Hellwig, Andrew Morton, Dexuan Cui, Vitaly Kuznetsov,
Catalin Marinas, Jessica Yu, x86, linux-arm-kernel, linux-kernel,
linux-hyperv, linux-mm
On Tue, Jun 23, 2020 at 11:37:14AM +0200, Peter Zijlstra wrote:
> On Tue, Jun 23, 2020 at 10:07:58AM +0100, Will Deacon wrote:
> > On Tue, Jun 23, 2020 at 11:05:05AM +0200, Christoph Hellwig wrote:
> > > On Sat, Jun 20, 2020 at 07:16:16PM -0700, Andrew Morton wrote:
> > > > On Thu, 18 Jun 2020 08:43:06 +0200 Christoph Hellwig <hch@lst.de> wrote:
> > > > > --- a/arch/arm64/kernel/probes/kprobes.c
> > > > > +++ b/arch/arm64/kernel/probes/kprobes.c
> > > > > @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
> > > > >
> > > > > void *alloc_insn_page(void)
> > > > > {
> > > > > - void *page;
> > > > > -
> > > > > - page = vmalloc_exec(PAGE_SIZE);
> > > > > - if (page) {
> > > > > - set_memory_ro((unsigned long)page, 1);
> > > > > - set_vm_flush_reset_perms(page);
> > > > > - }
> > > > > -
> > > > > - return page;
> > > > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > > > + NUMA_NO_NODE, __func__);
> > > > > }
> > > > >
> > > > > /* arm kprobe: install breakpoint in text */
> > > >
> > > > But why. I think this is just a cleanup, doesn't address any runtime issue?
> > >
> > > It doesn't "fix" an issue - it just simplifies and speeds up the code.
> >
> > Ok, but I don't understand the PLT comment from Peter in
> > 20200618092754.GF576905@hirez.programming.kicks-ass.net:
> >
> > | I think this has the exact same range issue as the x86 user. But it
> > | might be less fatal if their PLT magic can cover the full range.
> >
> > Peter, please could you elaborate on your concern? I feel like I'm missing
> > some context.
>
> On x86 we can only directly call code in a (signed) 32bit immediate
> range (2G) and our kernel text and module range are constrained by that.
>
> IIRC ARM64 has an even smaller immediate range and needs to play fixup
> games with trampolines or somesuch (there was an ARM specific name for
> it that I've misplaced again). Does that machinery cover the entire
> vmalloc space or are you only able to fix up for a smaller range?
>
> Your arch/arm64/kernel/module.c:module_alloc() implementation seems to
> have an explicit module range different from the full vmalloc range, I'm
> thinking this is for a reason.
Ah, gotcha. In this case, we're talking about the kprobe out-of-line
buffer. We don't directly branch to that; instead we take a BRK exception
and either exception return + singlestep the OOL buffer, or we simulate
the instruction if it's doing anything PC-relative, so I don't see the
need for a PLT.
Will
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-18 6:43 ` Christoph Hellwig
(?)
@ 2020-06-27 7:34 ` Ard Biesheuvel
-1 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:34 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, linux-hyperv, Peter Zijlstra, Catalin Marinas,
X86 ML, Dexuan Cui, Linux Kernel Mailing List, linux-mm,
Jessica Yu, Vitaly Kuznetsov, Will Deacon, Linux ARM
On Thu, 18 Jun 2020 at 08:44, Christoph Hellwig <hch@lst.de> wrote:
>
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
Why is this passing a string for the 'caller' argument, and not the
address of the caller?
> }
>
> /* arm kprobe: install breakpoint in text */
> --
> 2.26.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-27 7:34 ` Ard Biesheuvel
0 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:34 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-hyperv, Peter Zijlstra, Catalin Marinas, X86 ML,
Dexuan Cui, Linux Kernel Mailing List, linux-mm, Jessica Yu,
Andrew Morton, Will Deacon, Vitaly Kuznetsov, Linux ARM
On Thu, 18 Jun 2020 at 08:44, Christoph Hellwig <hch@lst.de> wrote:
>
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
Why is this passing a string for the 'caller' argument, and not the
address of the caller?
> }
>
> /* arm kprobe: install breakpoint in text */
> --
> 2.26.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-27 7:34 ` Ard Biesheuvel
0 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:34 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, linux-hyperv, Peter Zijlstra, Catalin Marinas,
X86 ML, Dexuan Cui, Linux Kernel Mailing List, linux-mm,
Jessica Yu, Vitaly Kuznetsov, Will Deacon, Linux ARM
On Thu, 18 Jun 2020 at 08:44, Christoph Hellwig <hch@lst.de> wrote:
>
> Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the
> page read-only just after the allocation.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> arch/arm64/kernel/probes/kprobes.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index d1c95dcf1d7833..cbe49cd117cfec 100644
> --- a/arch/arm64/kernel/probes/kprobes.c
> +++ b/arch/arm64/kernel/probes/kprobes.c
> @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
>
> void *alloc_insn_page(void)
> {
> - void *page;
> -
> - page = vmalloc_exec(PAGE_SIZE);
> - if (page) {
> - set_memory_ro((unsigned long)page, 1);
> - set_vm_flush_reset_perms(page);
> - }
> -
> - return page;
> + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> + NUMA_NO_NODE, __func__);
Why is this passing a string for the 'caller' argument, and not the
address of the caller?
> }
>
> /* arm kprobe: install breakpoint in text */
> --
> 2.26.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-27 7:34 ` Ard Biesheuvel
@ 2020-06-27 7:56 ` Christoph Hellwig
-1 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-27 7:56 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Christoph Hellwig, Andrew Morton, linux-hyperv, Peter Zijlstra,
Catalin Marinas, X86 ML, Dexuan Cui, Linux Kernel Mailing List,
linux-mm, Jessica Yu, Vitaly Kuznetsov, Will Deacon, Linux ARM
On Sat, Jun 27, 2020 at 09:34:42AM +0200, Ard Biesheuvel wrote:
> > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > + NUMA_NO_NODE, __func__);
>
> Why is this passing a string for the 'caller' argument, and not the
> address of the caller?
Dementia. Fix sent.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-27 7:56 ` Christoph Hellwig
0 siblings, 0 replies; 35+ messages in thread
From: Christoph Hellwig @ 2020-06-27 7:56 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: linux-hyperv, Peter Zijlstra, Catalin Marinas, X86 ML,
Dexuan Cui, Linux Kernel Mailing List, Vitaly Kuznetsov,
linux-mm, Jessica Yu, Andrew Morton, Will Deacon,
Christoph Hellwig, Linux ARM
On Sat, Jun 27, 2020 at 09:34:42AM +0200, Ard Biesheuvel wrote:
> > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > + NUMA_NO_NODE, __func__);
>
> Why is this passing a string for the 'caller' argument, and not the
> address of the caller?
Dementia. Fix sent.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
2020-06-27 7:56 ` Christoph Hellwig
(?)
@ 2020-06-27 7:57 ` Ard Biesheuvel
-1 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:57 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, linux-hyperv, Peter Zijlstra, Catalin Marinas,
X86 ML, Dexuan Cui, Linux Kernel Mailing List, linux-mm,
Jessica Yu, Vitaly Kuznetsov, Will Deacon, Linux ARM
On Sat, 27 Jun 2020 at 09:57, Christoph Hellwig <hch@lst.de> wrote:
>
> On Sat, Jun 27, 2020 at 09:34:42AM +0200, Ard Biesheuvel wrote:
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> >
> > Why is this passing a string for the 'caller' argument, and not the
> > address of the caller?
>
> Dementia. Fix sent.
:-)
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-27 7:57 ` Ard Biesheuvel
0 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:57 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-hyperv, Peter Zijlstra, Catalin Marinas, X86 ML,
Dexuan Cui, Linux Kernel Mailing List, linux-mm, Jessica Yu,
Andrew Morton, Will Deacon, Vitaly Kuznetsov, Linux ARM
On Sat, 27 Jun 2020 at 09:57, Christoph Hellwig <hch@lst.de> wrote:
>
> On Sat, Jun 27, 2020 at 09:34:42AM +0200, Ard Biesheuvel wrote:
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> >
> > Why is this passing a string for the 'caller' argument, and not the
> > address of the caller?
>
> Dementia. Fix sent.
:-)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 2/3] arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page
@ 2020-06-27 7:57 ` Ard Biesheuvel
0 siblings, 0 replies; 35+ messages in thread
From: Ard Biesheuvel @ 2020-06-27 7:57 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Morton, linux-hyperv, Peter Zijlstra, Catalin Marinas,
X86 ML, Dexuan Cui, Linux Kernel Mailing List, linux-mm,
Jessica Yu, Vitaly Kuznetsov, Will Deacon, Linux ARM
On Sat, 27 Jun 2020 at 09:57, Christoph Hellwig <hch@lst.de> wrote:
>
> On Sat, Jun 27, 2020 at 09:34:42AM +0200, Ard Biesheuvel wrote:
> > > + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
> > > + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
> > > + NUMA_NO_NODE, __func__);
> >
> > Why is this passing a string for the 'caller' argument, and not the
> > address of the caller?
>
> Dementia. Fix sent.
:-)
^ permalink raw reply [flat|nested] 35+ messages in thread