lkml.org 
[lkml]   [2022]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 2/8] KVM: arm64: Introduce pkvm_alloc_private_va_range()
On Tue, Mar 1, 2022 at 11:46 PM Marc Zyngier <maz@kernel.org> wrote:
>
> On Fri, 25 Feb 2022 03:34:47 +0000,
> Kalesh Singh <kaleshsingh@google.com> wrote:
> >
> > pkvm_hyp_alloc_private_va_range() can be used to reserve private VA ranges
> > in the pKVM nVHE hypervisor (). Also update __pkvm_create_private_mapping()
> > to allow specifying an alignment for the private VA mapping.
> >
> > These will be used to implement stack guard pages for pKVM nVHE hypervisor
> > (in a subsequent patch in the series).
> >
> > Credits to Quentin Perret <qperret@google.com> for the idea of moving
> > private VA allocation out of __pkvm_create_private_mapping()
> >
> > Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
> > ---
> >
> > Changes in v4:
> > - Handle null ptr in pkvm_alloc_private_va_range() and replace
> > IS_ERR_OR_NULL checks in callers with IS_ERR checks, per Fuad
> > - Fix kernel-doc comments format, per Fuad
> > - Format __pkvm_create_private_mapping() prototype args (< 80 col), per Fuad
> >
> > Changes in v3:
> > - Handle null ptr in IS_ERR_OR_NULL checks, per Mark
> >
> > Changes in v2:
> > - Allow specifying an alignment for the private VA allocations, per Marc
>
> I probably badly expressed my earlier concern.
>
> Yes, an alignment is necessary. But how often do we want an alignment
> that isn't naturally aligned to the size of the allocation (i.e. the
> power of 2 >= the size of the allocation)? This is what the rest of
> the kernel does (get_order() and co), and I thing we should follow
> this.

Hi Marc,

Thanks for clarifying. I think making the alignment implicitly based
on the size here will create unnecessary holes where PAGE_SIZE
alignment would be ok and potentially overflow the private VA space
earlier. Is it not a concern?

- Kalesh
>
> This applies to both this patch and the previous one.
>
> Thanks,
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>

\
 
 \ /
  Last update: 2022-03-02 18:26    [W:0.084 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site