[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/9] kern/ieee1275/init: ppc64: Implement alloc_mem_restricte
From: |
Daniel Kiper |
Subject: |
Re: [PATCH 6/9] kern/ieee1275/init: ppc64: Implement alloc_mem_restricted |
Date: |
Fri, 10 Nov 2023 14:18:52 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Fri, Nov 10, 2023 at 06:39:56PM +0530, Hari Bathini wrote:
> On 31/10/23 11:20 pm, Stefan Berger wrote:
> > Implement alloc_mem_restricted that uses regions_claim() for memory
> > allocation. The ieee1275 loader will use this function on PowerVM
> > and PowerKVM and thus avoid usage of memory that it is not allowed
> > to use.
> >
> > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
> > Cc: Hari Bathini <hbathini@linux.ibm.com>
> > Cc: Pavithra Prakash <pavrampu@in.ibm.com>
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Carolyn Scherrer <cpscherr@us.ibm.com>
> > Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
> > Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
> > ---
> > grub-core/kern/ieee1275/init.c | 7 +++++++
> > include/grub/powerpc/ieee1275/alloc.h | 3 +++
> > 2 files changed, 10 insertions(+)
> >
> > diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
> > index 542a4c595..6a3532aa7 100644
> > --- a/grub-core/kern/ieee1275/init.c
> > +++ b/grub-core/kern/ieee1275/init.c
> > @@ -585,6 +585,13 @@ region_claim (grub_uint64_t addr, grub_uint64_t len,
> > grub_memory_type_t type,
> > return ret;
> > }
> > +int
> > +alloc_mem_restricted (grub_uint64_t addr, grub_uint64_t len,
> > grub_memory_type_t type,
> > + void *ctx)
> > +{
> > + return regions_claim (addr, len, type, ctx);
> > +}
> > +
> > static grub_err_t
> > grub_ieee1275_mm_add_region (grub_size_t size, unsigned int flags)
> > {
> > diff --git a/include/grub/powerpc/ieee1275/alloc.h
> > b/include/grub/powerpc/ieee1275/alloc.h
> > index 6bfd3d986..14e37908e 100644
> > --- a/include/grub/powerpc/ieee1275/alloc.h
> > +++ b/include/grub/powerpc/ieee1275/alloc.h
> > @@ -14,4 +14,7 @@ struct regions_claim_request {
> > grub_size_t align; /* alignment restrictions */
> > };
> > +int EXPORT_FUNC(alloc_mem_restricted) (grub_uint64_t addr, grub_uint64_t
> > len,
> > + grub_memory_type_t type, void *ctx);
> > +
>
> Why not export regions_claim() itself instead of introducing this
> new function?
Yeah, good point. By the way, all exported functions have to be prefixed
with "grub_".
Daniel