Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-15 Thread Marco Elver
On Thu, 15 Oct 2020 at 15:39, Mark Rutland wrote: > On Wed, Oct 14, 2020 at 09:12:37PM +0200, Marco Elver wrote: > > On Thu, 8 Oct 2020 at 12:45, Mark Rutland wrote: > > > On Thu, Oct 08, 2020 at 11:40:52AM +0200, Marco Elver wrote: > > > > On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: > > >

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-15 Thread Mark Rutland
On Wed, Oct 14, 2020 at 09:12:37PM +0200, Marco Elver wrote: > On Thu, 8 Oct 2020 at 12:45, Mark Rutland wrote: > > On Thu, Oct 08, 2020 at 11:40:52AM +0200, Marco Elver wrote: > > > On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: > > > > > > If you need virt_to_page() to work, the address has

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-14 Thread Marco Elver
On Thu, 8 Oct 2020 at 12:45, Mark Rutland wrote: > On Thu, Oct 08, 2020 at 11:40:52AM +0200, Marco Elver wrote: > > On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: > > [...] > > > > > If you need virt_to_page() to work, the address has to be part of the > > > > > linear/direct map. > > [...] > >

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-08 Thread Mark Rutland
On Thu, Oct 08, 2020 at 11:40:52AM +0200, Marco Elver wrote: > On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: > [...] > > > > If you need virt_to_page() to work, the address has to be part of the > > > > linear/direct map. > [...] > > > > What's the underlying requirement here? Is this a perform

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-08 Thread Marco Elver
On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: [...] > > > If you need virt_to_page() to work, the address has to be part of the > > > linear/direct map. [...] > > What's the underlying requirement here? Is this a performance concern, > codegen/codesize, or something else? It used to be perform

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-01 Thread Mark Rutland
On Thu, Oct 01, 2020 at 01:24:49PM +0200, Alexander Potapenko wrote: > Mark, > > > If you need virt_to_page() to work, the address has to be part of the > > linear/direct map. > > > > If you need to find the struct page for something that's part of the > > kernel image you can use virt_to_page(lm_

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-10-01 Thread Alexander Potapenko
Mark, > If you need virt_to_page() to work, the address has to be part of the > linear/direct map. > > If you need to find the struct page for something that's part of the > kernel image you can use virt_to_page(lm_alias(x)). > > > Looks like filling page table entries (similarly to what's being d

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-29 Thread Alexander Potapenko
On Tue, Sep 29, 2020 at 4:28 PM Mark Rutland wrote: > > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > Add architecture specific implementation details for KFENCE and enable > > KFENCE for the arm64 architecture. In particular, this implements the > > required interface in . Curr

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-29 Thread Alexander Potapenko
> > On x86 we just do `char __kfence_pool[KFENCE_POOL_SIZE] ...;` to > > statically allocate the pool. On arm64 this doesn't seem to work > > because static memory doesn't have struct pages? > > Are you using virt_to_page() directly on that statically-allocated > __kfence_pool? If so you'll need to

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-29 Thread Mark Rutland
On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > Add architecture specific implementation details for KFENCE and enable > KFENCE for the arm64 architecture. In particular, this implements the > required interface in . Currently, the arm64 version does > not yet use a statically alloca

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-29 Thread Mark Rutland
On Fri, Sep 25, 2020 at 05:25:11PM +0200, Alexander Potapenko wrote: > Will, > > > Given that the pool is relatively small (i.e. when compared with our virtual > > address space), dedicating an area of virtual space sounds like it makes > > the most sense here. How early do you need it to be avail

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-29 Thread Mark Rutland
On Tue, Sep 22, 2020 at 11:56:26AM +0200, Marco Elver wrote: > On Mon, 21 Sep 2020 at 19:44, Will Deacon wrote: > [...] > > > > > > For ARM64, we would like to solicit feedback on what the best > > > > > > option is > > > > > > to obtain a constant address for __kfence_pool. One option is to > >

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-28 Thread Marco Elver
On Mon, 21 Sep 2020 at 16:31, Will Deacon wrote: > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > Add architecture specific implementation details for KFENCE and enable > > KFENCE for the arm64 architecture. In particular, this implements the > > required interface in . Currently

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-25 Thread Alexander Potapenko
Will, > Given that the pool is relatively small (i.e. when compared with our virtual > address space), dedicating an area of virtual space sounds like it makes > the most sense here. How early do you need it to be available? How do we assign struct pages to a fixed virtual space area (I'm current

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-22 Thread Marco Elver
On Mon, 21 Sep 2020 at 19:44, Will Deacon wrote: [...] > > > > > For ARM64, we would like to solicit feedback on what the best option > > > > > is > > > > > to obtain a constant address for __kfence_pool. One option is to > > > > > declare > > > > > a memory range in the memory layout to be dedi

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-21 Thread Will Deacon
On Mon, Sep 21, 2020 at 05:37:10PM +0200, Alexander Potapenko wrote: > On Mon, Sep 21, 2020 at 4:58 PM Alexander Potapenko wrote: > > > > On Mon, Sep 21, 2020 at 4:31 PM Will Deacon wrote: > > > > > > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > > > Add architecture specific i

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-21 Thread Alexander Potapenko
On Mon, Sep 21, 2020 at 4:58 PM Alexander Potapenko wrote: > > On Mon, Sep 21, 2020 at 4:31 PM Will Deacon wrote: > > > > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > > Add architecture specific implementation details for KFENCE and enable > > > KFENCE for the arm64 architectu

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-21 Thread Alexander Potapenko
On Mon, Sep 21, 2020 at 4:31 PM Will Deacon wrote: > > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > Add architecture specific implementation details for KFENCE and enable > > KFENCE for the arm64 architecture. In particular, this implements the > > required interface in . Curre

Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64

2020-09-21 Thread Will Deacon
On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > Add architecture specific implementation details for KFENCE and enable > KFENCE for the arm64 architecture. In particular, this implements the > required interface in . Currently, the arm64 version does > not yet use a statically alloca