Re: [PATCH 1/1] Fix boot on efi 32 bit Machines [try #4]



"H. Peter Anvin" <hpa@xxxxxxxxx> writes:

Eric W. Biederman wrote:


You probably don't want to put it in the bootloader. The kernel is easier to
upgrade than the bootloader, which is easier to upgrade than the firmware, so
it
makes more sense for the kernel to be as self-sufficient as is possible, or
at
least practical.
Regardless it would be nice if the efi implementation hacks were removed.

My favorite is this one in init/main.c #ifdef CONFIG_X86
if (efi_enabled)
efi_enter_virtual_mode();
#endif
Which pretty much guarantees efi won't be a distro supported feature
any time soon because it breaks kexec the ability of a kexec'd kernel
to boot and thus crash dump support. Or it does if you ever use efi
callbacks, and if you don't use efi callbacks there is no point in
calling that function. Why are efi callbacks not always done in
physical mode?


If nothing else, they should be isolated, and in the early kernel build a
datastructure like the e820 data structure, so the downstream kernel doesn't
deal with it.

I have no idea what the above does; it sounds to me like something that should
be possible to do differently, though.

Quite.

The part that is an obvious hack is that it shows up in init/main.c
for no apparent reason. Instead of being in architecture specific code
since it only applies to one architecture. ia64 which also uses efi
doesn't need to patch init/main.c

Basically this was just an example to add to the e820 map problem of what
a problem this code really is.

Thinking about the e820 problem. That is in the function:
e820_all_mapped(unsigned long s, unsigned long e, unsigned type)

Which is a test. I believe this is the sanity check to ensure the
pci express memory mapped configuration area is accessible.

In which case disabling the test is totally wrong,
and I agree with Linus that we need to convert the structure.

We need to know what the BIOS's idea of the memory map is and to be
able to query it.

Although I am surprised we could not just make that query by looking
at the resources. Possibly we are too early in boot.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: accessing NAND flash directly from CE
    ... Yeah I am going to try producing a driver based on the iMX31 NANDFMD code. ... Luckily I have experience with doing kernel upgrades and yes I totally agree ... No upgrade should be performed unless there is wall power and if kernel ... And don't upgrade the bootloader either. ...
    (microsoft.public.windowsce.embedded)
  • Re: [PATCH 5/5] x86_64 EFI support -v3: EFI document
    ... Now all the data in the zero page and standard boot protocol are ... The EFI bootloader does this through ... in kernel setup code, the EFI boot services must be used inside kernel ... Bootloader setups the parameter defined in standard boot protocol ...
    (Linux-Kernel)
  • Re: [PATCH 2.6.21 1/3] x86_64: EFI64 support
    ... First this seems to be quite different from what the 32bit EFI ... What format is the kernel image? ... mov %rsi,%rcx ... Who tells you the other CPUs don't use the current pgd? ...
    (Linux-Kernel)
  • [PATCH 2.6.21 1/3] x86_64: EFI64 support
    ... The following set of patches implements EFI x86_64 Linux kernel support. ... References to EFI and UEFI (Unified Extensible Firmware Interface) are used ...
    (Linux-Kernel)
  • Re: [PATCH 5/5] x86_64 EFI support -v3: EFI document
    ... kernel on my x86_64 EFI machine. ... It isn't clearly documented as a public interface but is the way ... On the other side since EFI doesn't not seem to have dual mode ... A trampoline switching to physical mode and maybe doing a 32->64 ...
    (Linux-Kernel)