All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v1 1/1] kexec: x86: Include pref_address when looking for a memory hole
Date: Fri, 15 Nov 2024 09:45:08 +0000	[thread overview]
Message-ID: <20241115094508.GG1062410@kernel.org> (raw)
In-Reply-To: <20241113154437.2860694-1-andriy.shevchenko@linux.intel.com>

On Wed, Nov 13, 2024 at 05:44:37PM +0200, Andy Shevchenko wrote:
> When the kernel is built relocatable, the starting address can be
> anything above 1Mb on x86. However, the startup_*() entries consider
> that the minumum address for the kernel for the decompression has to
> be at least LOAD_PHYSICAL_ADDR which is turn the value that is provided
> as pref_address in boot protocol. The boot protocol itself says:
> 
>   This field, if nonzero, represents a preferred load address for the
>   kernel.  A relocating bootloader should attempt to load at this
>   address if possible.
> 
> Besides that the code in the kernel (arch/x86/kernel/kexec-bzimage64.c)
> has these lines (in bzImage64_load() function):
> 
>     if (header->pref_address < MIN_KERNEL_LOAD_ADDR)
>         kbuf.buf_min = MIN_KERNEL_LOAD_ADDR;
>     else
>         kbuf.buf_min = header->pref_address;
> 
> All that said, do the same in kexec tools. Without this patch
> the relocatable kernel may end up in the memory hole that is
> not enough for in-place decompression and Bad Things will happen
> as it's proven on Intel Merrifield, that has a reserved memory
> block starting at 64Mb.
> 
> Note, it doesn't mean that kernel has no issues itself in this particular
> stage, but at least we may work around some corner cases for kexec.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks Andy, applied.


      reply	other threads:[~2024-11-15  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 15:44 [PATCH v1 1/1] kexec: x86: Include pref_address when looking for a memory hole Andy Shevchenko
2024-11-15  9:45 ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241115094508.GG1062410@kernel.org \
    --to=horms@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.