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

Re: [Xen-devel] Fixes for low memory allocation machinery in early boot code



On Tue, Sep 20, 2016 at 07:23:06AM -0600, Jan Beulich wrote:
> >>> On 20.09.16 at 14:11, <daniel.kiper@xxxxxxxxxx> wrote:
> > On Fri, Sep 16, 2016 at 06:15:10AM -0600, Jan Beulich wrote:
> >> >>> On 14.09.16 at 10:23, <daniel.kiper@xxxxxxxxxx> wrote:
> >> > Additionally, my investigation has shown that there are no bound checks 
> >> > in
> >> > low memory allocation machinery for trampoline (by the way, in BIOS path 
> >> > we
> >> > allocate 64 KiB for trampoline but in EFI code we properly calculate its 
> >> > size;
> >> > so, I think we should do the same calculation in BIOS path), stack and 
> >> > boot data
> >> > taken from multiboot protocol. Hence, relevant fixes should be added 
> >> > here too.
> >>
> >> Would be nice, yes, but we need to weigh the need to presumably do
> >> at least some of this in assembly code (for now at least) against the
> >> potential gain.
> >>
> >> > Moreover I think that at least allocation machinery with additional 
> >> > checks
> >> > described in last paragraph can be used on EFI platforms when Xen is 
> >> > booted
> >> > via multiboot2 protocol. However, then high limit should be defined as 1 
> >> > MiB.
> >> > Though I think that low limit, 256 KiB, should stay as is.
> >>
> >> Why 1Mb? The 640k limit derives from hardware aspects, but doesn't
> >> depend on the software environment.
> >
> > I do not expect that anything which is not memory will reside between 640 
> > KiB
> > and 1 MiB on EFI platforms. So, if firmware says that it is usable why we 
> > cannot
> > use it? And I have a feeling that this idea lead to currently existing 
> > checks
> > around trampoline allocation code for EFI. Though, as I saw EFI platforms
> > usually does not expose region 640 KiB and 1 MiB as usable. However, this
> > does not mean that they cannot in the future.
>
> Hmm, when the region (or part of it) is reported as available, then I
> guess we could use it. But as to there being RAM - I doubt it, since
> for the next little while, EFI or not, we're talking about PC compatible
> systems, which don't normally have RAM in that range.

If we drop BIOS and move to EFI then compatibility with PC drops to tiny
fraction of original platform. So, in this context lack of VGA or anything
like that above 640 KiB is not an issue IMO and memory there would not be
very big surprise for me. However, if you care I would ask why do you use
1 MiB limit instead of 640 KiB in xen/arch/x86/efi/efi-boot.h? I do not
say this is huge mistake but I am curious why not 640 KiB? I suppose that
there was a reason for it but I cannot find anything about that in comments
or commit messages.

Daniel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.