Re: [tip:x86/microcode] x86/microcode_intel_early.c: Early updateucode on Intel's CPU

From: Yinghai Lu
Date: Tue Dec 11 2012 - 13:41:57 EST


On Tue, Dec 11, 2012 at 10:20 AM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> On 12/11/2012 10:02 AM, H. Peter Anvin wrote:
>>
>>
>> The more I think about it, the more I think the right answer is the one
>> we have pretty stated all along: if using the 64-bit entry point it is
>> the responsibility of the boot loader to make sure the kernel, the setup
>> data, and the initramfs are all mapped on entry.
>>

arch/x86/kernel/head_64.S::startup_64

is setting up its own page table

>
> This, in turn, brings up another major problem with the 64-bit entry point:
> right now it assumes page tables set up the way the current kernels expect
> them, but the way the kernel expects pages to be laid out on the future is
> almost guaranteed to change. We need to formalize the expectations of the
> page table layout at 64-bit entry, and check to see what the implications of
> that are.
>
> In particular, we may need to build a set of scaffolding page tables in the
> brk when entered from the 64-bit entry point and switch to them a lot
> sooner. We wouldn't have to do that when coming from the 16/32-bit entry
> points since we'd control the layout of those page tables.
>
> Oh how fun...

now in for-x86-boot:
http://git.kernel.org/?p=linux/kernel/git/yinghai/linux-yinghai.git;a=commit;h=8e4e093e6d140f1316953437fdde4e826f5cfd98

it adds extra mapping from the whole kernel when kernel is loaded above 1G.
from round_down(_text, 2M) to round_up(_end -1, 2M).

Do you mean we need to add extra mapping for realmode_data, cmdline,
ramdisk too? (not include setup_data, and it is accessed via
early_ioremap later).

but if the user memmap to exclude some page, we will still need to
relocate the ramdisk.

Yinghai
--
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/