Re: [PATCH v2 2/3] arm64: kexec: allocate memory space avoiding reserved regions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 16, 2019 at 09:16:06AM -0500, Masayoshi Mizuma wrote:
> On Mon, Dec 16, 2019 at 11:22:56AM +0530, Bhupesh Sharma wrote:
> > Thanks Masa,

[...]

> > Since this is an old thread, it would be useful for people looking at
> > the same, if you can add some comments/details about why you think
> > this nit is needed.
> 
> Thank you for your follow up and I'm sorry I didn't explain it.
> mem_regions_alloc_and_exclude() may fail in case realloc() or
> mem_region_exclude() fail, so it would be better to add the error
> handling.
> 
> > 
> > Also if Akashi agrees with the same, it would be better if he could
> > send a rebased version of the patchset (with your comments addressed),
> > so that the same can be picked for upstream kexec-tools cleanly.
> 
> Sounds great!

I have almost forgotten the background of this patch.
If you see that it is still useful, please feel free to re-post it.

Thanks,
-Takahiro Akashi

> - Masa
> 
> > 
> > @Akashi- Hi Akashi, Please let us know your views.
> > 
> > Thanks,
> > Bhupesh
> > 
> > > +                     dbgprintf("%s:-      %016llx - %016llx\n",
> > > > +                                     __func__, start, end);
> > > > +             }
> > > > +     }
> > > > +
> > > > +     fclose(fp);
> > > > +
> > > > +     *range = memranges.ranges;
> > > > +     *ranges = memranges.size;
> > > >
> > > >       /* As a fallback option, we can try determining the PHYS_OFFSET
> > > >        * value from the '/proc/iomem' entries as well.
> > > > @@ -976,52 +1041,15 @@ static int get_memory_ranges_iomem_cb(void *data, int nr, char *str,
> > > >        * between the user-space and kernel space 'PHYS_OFFSET'
> > > >        * value.
> > > >        */
> > > > -     set_phys_offset(r->start, "iomem");
> > > > +     if (memranges.size)
> > > > +             set_phys_offset(memranges.ranges[0].start, "iomem");
> > > >
> > > > -     dbgprintf("%s: %016llx - %016llx : %s", __func__, r->start,
> > > > -             r->end, str);
> > > > +     dbgprint_mem_range("System RAM ranges;",
> > > > +                             memranges.ranges, memranges.size);
> > > >
> > > >       return 0;
> > > >  }
> > > >
> > > > -/**
> > > > - * get_memory_ranges_iomem - Try to get the memory ranges from
> > > > - * /proc/iomem.
> > > > - */
> > > > -
> > > > -static int get_memory_ranges_iomem(struct memory_range *array,
> > > > -     unsigned int *count)
> > > > -{
> > > > -     *count = kexec_iomem_for_each_line(NULL,
> > > > -             get_memory_ranges_iomem_cb, array);
> > > > -
> > > > -     if (!*count) {
> > > > -             dbgprintf("%s: failed: No RAM found.\n", __func__);
> > > > -             return EFAILED;
> > > > -     }
> > > > -
> > > > -     return 0;
> > > > -}
> > > > -
> > > > -/**
> > > > - * get_memory_ranges - Try to get the memory ranges some how.
> > > > - */
> > > > -
> > > > -int get_memory_ranges(struct memory_range **range, int *ranges,
> > > > -     unsigned long kexec_flags)
> > > > -{
> > > > -     static struct memory_range array[KEXEC_SEGMENT_MAX];
> > > > -     unsigned int count;
> > > > -     int result;
> > > > -
> > > > -     result = get_memory_ranges_iomem(array, &count);
> > > > -
> > > > -     *range = result ? NULL : array;
> > > > -     *ranges = result ? 0 : count;
> > > > -
> > > > -     return result;
> > > > -}
> > > > -
> > > >  int arch_compat_trampoline(struct kexec_info *info)
> > > >  {
> > > >       return 0;
> > > > --
> > > > 2.19.1
> > > >
> > > >
> > >
> > 

_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux