17 Dec, 2011

1 commit

  • The efi boot stub tries to read the entire initrd in 1 go, however
    some efi implementations hang if too much if asked to read too much
    data at the same time. After some experimentation I found out that my
    asrock p67 board will hang if asked to read chunks of 4MiB, so use a
    safe value.

    elilo reads in chunks of 16KiB, but since that requires many read
    calls I use a value of 1 MiB. hpa suggested adding individual
    blacklists for when systems are found where this value causes a crash.

    Signed-off-by: Maarten Lankhorst
    Link: http://lkml.kernel.org/r/4EEB3A02.3090201@gmail.com
    Signed-off-by: H. Peter Anvin

    Maarten Lankhorst
     

13 Dec, 2011

1 commit

  • There is currently a large divide between kernel development and the
    development of EFI boot loaders. The idea behind this patch is to give
    the kernel developers full control over the EFI boot process. As
    H. Peter Anvin put it,

    "The 'kernel carries its own stub' approach been very successful in
    dealing with BIOS, and would make a lot of sense to me for EFI as
    well."

    This patch introduces an EFI boot stub that allows an x86 bzImage to
    be loaded and executed by EFI firmware. The bzImage appears to the
    firmware as an EFI application. Luckily there are enough free bits
    within the bzImage header so that it can masquerade as an EFI
    application, thereby coercing the EFI firmware into loading it and
    jumping to its entry point. The beauty of this masquerading approach
    is that both BIOS and EFI boot loaders can still load and run the same
    bzImage, thereby allowing a single kernel image to work in any boot
    environment.

    The EFI boot stub supports multiple initrds, but they must exist on
    the same partition as the bzImage. Command-line arguments for the
    kernel can be appended after the bzImage name when run from the EFI
    shell, e.g.

    Shell> bzImage console=ttyS0 root=/dev/sdb initrd=initrd.img

    v7:
    - Fix checkpatch warnings.

    v6:

    - Try to allocate initrd memory just below hdr->inird_addr_max.

    v5:

    - load_options_size is UTF-16, which needs dividing by 2 to convert
    to the corresponding ASCII size.

    v4:

    - Don't read more than image->load_options_size

    v3:

    - Fix following warnings when compiling CONFIG_EFI_STUB=n

    arch/x86/boot/tools/build.c: In function ‘main’:
    arch/x86/boot/tools/build.c:138:24: warning: unused variable ‘pe_header’
    arch/x86/boot/tools/build.c:138:15: warning: unused variable ‘file_sz’

    - As reported by Matthew Garrett, some Apple machines have GOPs that
    don't have hardware attached. We need to weed these out by
    searching for ones that handle the PCIIO protocol.

    - Don't allocate memory if no initrds are on cmdline
    - Don't trust image->load_options_size

    Maarten Lankhorst noted:
    - Don't strip first argument when booted from efibootmgr
    - Don't allocate too much memory for cmdline
    - Don't update cmdline_size, the kernel considers it read-only
    - Don't accept '\n' for initrd names

    v2:

    - File alignment was too large, was 8192 should be 512. Reported by
    Maarten Lankhorst on LKML.
    - Added UGA support for graphics
    - Use VIDEO_TYPE_EFI instead of hard-coded number.
    - Move linelength assignment until after we've assigned depth
    - Dynamically fill out AddressOfEntryPoint in tools/build.c
    - Don't use magic number for GDT/TSS stuff. Requested by Andi Kleen
    - The bzImage may need to be relocated as it may have been loaded at
    a high address address by the firmware. This was required to get my
    macbook booting because the firmware loaded it at 0x7cxxxxxx, which
    triggers this error in decompress_kernel(),

    if (heap > ((-__PAGE_OFFSET-(128<
    Cc: Matthew Garrett
    Tested-by: Henrik Rydberg
    Signed-off-by: Matt Fleming
    Link: http://lkml.kernel.org/r/1321383097.2657.9.camel@mfleming-mobl1.ger.corp.intel.com
    Signed-off-by: H. Peter Anvin

    Matt Fleming
     

28 Sep, 2011

1 commit

  • There are numerous broken references to Documentation files (in other
    Documentation files, in comments, etc.). These broken references are
    caused by typo's in the references, and by renames or removals of the
    Documentation files. Some broken references are simply odd.

    Fix these broken references, sometimes by dropping the irrelevant text
    they were part of.

    Signed-off-by: Paul Bolle
    Signed-off-by: Jiri Kosina

    Paul Bolle
     

26 May, 2011

1 commit

  • This has been obsoleted by the root= commandline and the rdev utility
    for many, many years. People who still depend on this will surely
    have a copy of the rdev utility around, the rest of the world gets rid
    of another piece of buildhost-dependent data in the build. Thanks to
    Paul Bolle for the build.c cleanup.

    Cc: Paul Bolle
    Signed-off-by: Michal Marek
    Link: http://lkml.kernel.org/r/1302607824-24699-1-git-send-email-mmarek@suse.cz
    Signed-off-by: H. Peter Anvin

    Michal Marek
     

26 Apr, 2011

1 commit

  • When we use BIOS function e801 to probe memory, we should use ax/bx
    (or cx/dx) as a pair, not mix and match. This was a typo during the
    translation from assembly code, and breaks at least one set of
    machines in the field (which return cx = dx = 0).

    Reported-and-tested-by: Chris Samuel
    Fix-proposed-by: Thomas Meyer
    Link: http://lkml.kernel.org/r/1303566747.12067.10.camel@localhost.localdomain

    H. Peter Anvin
     

02 Mar, 2011

1 commit


14 Jan, 2011

1 commit

  • This integrates the XZ decompression code to the x86 pre-boot code.

    mkpiggy.c is updated to reserve about 32 KiB more buffer safety margin for
    kernel decompression. It is done unconditionally for all decompressors to
    keep the code simpler.

    The XZ decompressor needs around 30 KiB of heap, so the heap size is
    increased to 32 KiB on both x86-32 and x86-64.

    Documentation/x86/boot.txt is updated to list the XZ magic number.

    With the x86 BCJ filter in XZ, XZ-compressed x86 kernel tends to be a few
    percent smaller than the equivalent LZMA-compressed kernel.

    Signed-off-by: Lasse Collin
    Cc: "H. Peter Anvin"
    Cc: Alain Knaff
    Cc: Albin Tonnerre
    Cc: Phillip Lougher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lasse Collin
     

07 Jan, 2011

1 commit


17 Dec, 2010

1 commit

  • A relocatable kernel can be anywhere in lowmem -- and in the case of a
    kdump kernel, is likely to be fairly high. Since the early page
    tables map everything from address zero up we need to make sure we
    allocate enough brk that we can map all of lowmem if we need to.

    Reported-by: Stanislaw Gruszka
    Signed-off-by: H. Peter Anvin
    Tested-by: Yinghai Lu
    LKML-Reference:

    H. Peter Anvin
     

11 Nov, 2010

1 commit


08 Oct, 2010

1 commit

  • The kernel decompression code parses the ELF header and then copies
    the segment to the corresponding destination. Currently it uses slow
    byte-copy code. This patch makes it use the string copy operations
    instead.

    In the test the copy performance can be improved very significantly after using
    the string copy operation mechanism.
    1. The copy time can be reduced from 150ms to 20ms on one Atom machine
    2. The copy time can be reduced about 80% on another machine
    The time is reduced from 7ms to 1.5ms when using 32-bit kernel.
    The time is reduced from 10ms to 2ms when using 64-bit kernel.

    Signed-off-by: Zhao Yakui
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Zhao Yakui
     

22 Sep, 2010

2 commits


03 Aug, 2010

4 commits

  • It is a subset of functionality, so name it ctype.h. Also,
    reorganize header files so #include statements are clustered near the
    top as they should be.

    Signed-off-by: H. Peter Anvin
    LKML-Reference:

    H. Peter Anvin
     
  • This enables the decompressor output to be seen on the serial console.
    Most of the code is shared with the regular boot code.

    We could add printf to the decompressor if needed, but currently there
    is no sufficiently compelling user.

    -v2: define BOOT_BOOT_H to avoid include boot.h
    -v3: early_serial_base need to be static in misc.c ?
    -v4: create seperate string.c printf.c cmdline.c early_serial_console.c
    after hpa's patch that allow global variables in compressed/misc stage
    -v5: remove printf.c related

    Signed-off-by: Yinghai Lu
    Signed-off-by: H. Peter Anvin

    Yinghai Lu
     
  • Separate early_serial_console from tty.c

    This allows for reuse of
    early_serial_console.c/string.c/printf.c/cmdline.c in boot/compressed/.

    -v2: according to hpa, don't include string.c etc
    -v3: compressed/misc.c must have early_serial_base as static, so move it back to tty.c
    for setup code

    Signed-off-by: Yinghai Lu
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Yinghai Lu
     
  • In order for global variables and functions to work in the
    decompressor, we need to fix up the GOT in assembly code.

    Signed-off-by: H. Peter Anvin
    LKML-Reference:

    H. Peter Anvin
     

15 Jul, 2010

1 commit

  • putchar is using early_serial_base to check if port is initialized.

    So we only assign it after early_serial_init() is called,
    in case we need use VGA to debug early serial console.

    Also add display for port addr and baud.

    -v2: update to current tip

    Acked-by: Pekka Enberg
    Signed-off-by: Yinghai Lu
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Yinghai Lu
     

14 Jul, 2010

1 commit


13 Jul, 2010

1 commit

  • This patch adds serial I/O support to the real-mode setup (very early
    boot) printf(). It's useful for debugging boot code when running Linux
    under KVM, for example. The actual code was lifted from early printk.

    Cc: Cyrill Gorcunov
    Cc: Ingo Molnar
    Cc: Yinghai Lu
    Signed-off-by: Pekka Enberg
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Pekka Enberg
     

11 Jun, 2010

1 commit


01 Jun, 2010

1 commit

  • * 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits)
    kbuild: Revert part of e8d400a to resolve a conflict
    kbuild: Fix checking of scm-identifier variable
    gconfig: add support to show hidden options that have prompts
    menuconfig: add support to show hidden options which have prompts
    gconfig: remove show_debug option
    gconfig: remove dbg_print_ptype() and dbg_print_stype()
    kconfig: fix zconfdump()
    kconfig: some small fixes
    add random binaries to .gitignore
    kbuild: Include gen_initramfs_list.sh and the file list in the .d file
    kconfig: recalc symbol value before showing search results
    .gitignore: ignore *.lzo files
    headerdep: perlcritic warning
    scripts/Makefile.lib: Align the output of LZO
    kbuild: Generate modules.builtin in make modules_install
    Revert "kbuild: specify absolute paths for cscope"
    kbuild: Do not unnecessarily regenerate modules.builtin
    headers_install: use local file handles
    headers_check: fix perl warnings
    export_report: fix perl warnings
    ...

    Linus Torvalds
     

26 May, 2010

1 commit

  • This reverts commit b3b77c8caef1750ebeea1054e39e358550ea9f55, which was
    also totally broken (see commit 0d2daf5cc858 that reverted the crc32
    version of it). As reported by Stephen Rothwell, it causes problems on
    big-endian machines:

    > In file included from fs/jfs/jfs_types.h:33,
    > from fs/jfs/jfs_incore.h:26,
    > from fs/jfs/file.c:22:
    > fs/jfs/endian24.h:36:101: warning: "__LITTLE_ENDIAN" is not defined

    The kernel has never had that crazy "__BYTE_ORDER == __LITTLE_ENDIAN"
    model. It's not how we do things, and it isn't how we _should_ do
    things. So don't go there.

    Requested-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 May, 2010

1 commit

  • Linux does not define __BYTE_ORDER in its endian header files which makes
    some header files bend backwards to get at the current endian. Lets
    #define __BYTE_ORDER in big_endian.h/litte_endian.h to make it easier for
    header files that are used in user space too.

    In userspace the convention is that

    1. _both_ __LITTLE_ENDIAN and __BIG_ENDIAN are defined,
    2. you have to test for e.g. __BYTE_ORDER == __BIG_ENDIAN.

    Signed-off-by: Joakim Tjernlund
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joakim Tjernlund
     

03 Mar, 2010

1 commit


01 Mar, 2010

2 commits


20 Feb, 2010

1 commit

  • The code for setting standard VGA modes probes for the current mode,
    and skips the mode setting if the mode is 3 (color text 80x25) or 7
    (mono text 80x25). Unfortunately, there are BIOSes, including the
    VMware BIOS, which report the previous mode if function 0F is queried
    while the screen is in a VESA mode, and of course, nothing can help a
    mode poked directly into the hardware.

    As such, the safe option is to set the mode anyway, and only query to
    see if we should be using mode 7 rather than mode 3. People who don't
    want any mode setting at all should probably use vga=0x0f04
    (VIDEO_CURRENT_MODE). It's possible that should be the kernel
    default.

    Reported-by Rene Arends
    Signed-off-by: H. Peter Anvin
    LKML-Reference:

    H. Peter Anvin
     

19 Feb, 2010

1 commit


18 Feb, 2010

1 commit

  • When we restore the screen content after a mode change, we return the
    cursor to its former position. However, we need to also update
    boot_params.screen_info accordingly, so that the decompression code
    knows where on the screen the cursor is. Just in case the video BIOS
    does something extra screwy, read the cursor position back from the
    BIOS instead of relying on it doing the right thing.

    While we're at it, make sure we cap the cursor position to the new
    screen coordinates.

    Reported-by: Wim Osterholt
    Bugzilla-Reference: http://bugzilla.kernel.org/show_bug.cgi?id=15329
    Signed-off-by: H. Peter Anvin

    H. Peter Anvin
     

08 Feb, 2010

1 commit


06 Feb, 2010

1 commit

  • Iomem has no special significance on x86. Use the standard mem*
    functions instead of trying to call other versions. Some fixups
    are needed to match the function prototypes.

    Signed-off-by: Brian Gerst
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Brian Gerst
     

12 Jan, 2010

1 commit

  • The necessary changes to the x86 Kconfig and boot/compressed to allow the
    use of this new compression method

    Signed-off-by: Albin Tonnerre
    Acked-by: H. Peter Anvin
    Tested-by: Wu Zhangjin
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Tested-by: Russell King
    Acked-by: Russell King
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Albin Tonnerre
     

28 Dec, 2009

1 commit


26 Dec, 2009

1 commit

  • Recently, some distros have started shipping versions of gcc which
    default to -march=i686. This breaks building kernels for pre-i686
    machines, even if they have been selected in Kconfig, due to the
    generation of CMOV instructions.

    There isn't enough benefit to try to preserve the generation of these
    instructions even when selected, so simply force -march=i386 for the
    decompressor when building a 32-bit kernel.

    Reported-and-tested-by: Chris Rankin
    Signed-off-by: H. Peter Anvin
    LKML-Reference:

    H. Peter Anvin
     

17 Dec, 2009

1 commit

  • * 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
    net: fix for utsrelease.h moving to generated
    gen_init_cpio: fixed fwrite warning
    kbuild: fix make clean after mismerge
    kbuild: generate modules.builtin
    genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
    score: add asm/asm-offsets.h wrapper
    unifdef: update to upstream revision 1.190
    kbuild: specify absolute paths for cscope
    kbuild: create include/generated in silentoldconfig
    scripts/package: deb-pkg: use fakeroot if available
    scripts/package: add KBUILD_PKG_ROOTCMD variable
    scripts/package: tar-pkg: use tar --owner=root
    Kbuild: clean up marker
    net: add net_tstamp.h to headers_install
    kbuild: move utsrelease.h to include/generated
    kbuild: move autoconf.h to include/generated
    drop explicit include of autoconf.h
    kbuild: move compile.h to include/generated
    kbuild: drop include/asm
    kbuild: do not check for include/asm-$ARCH
    ...

    Fixed non-conflicting clean merge of modpost.c as per comments from
    Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
    that needed to be changed to generated/autoconf.h)

    Linus Torvalds
     

15 Dec, 2009

1 commit

  • This adds a new category of symbols to the relocs program: symbols
    which are known to be relative, even though the linker emits them as
    absolute; this is the case for symbols that live in the linker script,
    which currently applies to _end.

    Unfortunately the previous workaround of putting _end in its own empty
    section was defeated by newer binutils, which remove empty sections
    completely.

    This patch also changes the symbol matching to use regular expressions
    instead of hardcoded C for specific patterns.

    This is a decidedly non-minimal patch: a modified version of the
    relocs program is used as part of the Syslinux build, and this is
    basically a backport to Linux of some of those changes; they have
    thus been well tested.

    Signed-off-by: H. Peter Anvin
    LKML-Reference:
    Acked-by: Michal Marek
    Tested-by: Sedat Dilek

    H. Peter Anvin
     

12 Dec, 2009

2 commits


09 Dec, 2009

1 commit