Skip to content
Snippets Groups Projects
  • Andy Shevchenko's avatar
    0c92af9e
    x86/Documentation: Update algo in init_size description of boot protocol · 0c92af9e
    Andy Shevchenko authored
    
    [ Upstream commit be4ca6c53e66cb275cf0d71f32dac0c4606b9dc0 ]
    
    The init_size description of boot protocol has an example of the runtime
    start address for the compressed bzImage. For non-relocatable kernel
    it relies on the pref_address value (if not 0), but for relocatable case
    only pays respect to the load_addres and kernel_alignment, and it is
    inaccurate for the latter. Boot loader must consider the pref_address
    as the Linux kernel relocates to it before being decompressed as nicely
    described in this commit message a year ago:
    
      43b1d3e6 ("kexec: Allocate kernel above bzImage's pref_address")
    
    Due to this documentation inaccuracy some of the bootloaders (*) made a
    mistake in the calculations and if kernel image is big enough, this may
    lead to unbootable configurations.
    
    *)
      In particular, kexec-tools missed that and resently got a couple of
      changes which will be part of v2.0.30 release. For the record,
      commit 43b1d3e6 only fixed the kernel kexec implementation and
      also missed to update the init_size description.
    
    While at it, make an example C-like looking as it's done elsewhere in
    the document and fix indentation as presribed by the reStructuredText
    specifications, so the syntax highliting will work properly.
    
    Fixes: 43b1d3e6 ("kexec: Allocate kernel above bzImage's pref_address")
    Fixes: d297366b ("x86: document new bzImage fields")
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Link: https://lore.kernel.org/r/20241125105005.1616154-1-andriy.shevchenko@linux.intel.com
    
    
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    0c92af9e
    History
    x86/Documentation: Update algo in init_size description of boot protocol
    Andy Shevchenko authored
    
    [ Upstream commit be4ca6c53e66cb275cf0d71f32dac0c4606b9dc0 ]
    
    The init_size description of boot protocol has an example of the runtime
    start address for the compressed bzImage. For non-relocatable kernel
    it relies on the pref_address value (if not 0), but for relocatable case
    only pays respect to the load_addres and kernel_alignment, and it is
    inaccurate for the latter. Boot loader must consider the pref_address
    as the Linux kernel relocates to it before being decompressed as nicely
    described in this commit message a year ago:
    
      43b1d3e6 ("kexec: Allocate kernel above bzImage's pref_address")
    
    Due to this documentation inaccuracy some of the bootloaders (*) made a
    mistake in the calculations and if kernel image is big enough, this may
    lead to unbootable configurations.
    
    *)
      In particular, kexec-tools missed that and resently got a couple of
      changes which will be part of v2.0.30 release. For the record,
      commit 43b1d3e6 only fixed the kernel kexec implementation and
      also missed to update the init_size description.
    
    While at it, make an example C-like looking as it's done elsewhere in
    the document and fix indentation as presribed by the reStructuredText
    specifications, so the syntax highliting will work properly.
    
    Fixes: 43b1d3e6 ("kexec: Allocate kernel above bzImage's pref_address")
    Fixes: d297366b ("x86: document new bzImage fields")
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Link: https://lore.kernel.org/r/20241125105005.1616154-1-andriy.shevchenko@linux.intel.com
    
    
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>