x86/boot: Don't map 0 during boot
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 6 Jan 2020 13:37:41 +0000 (13:37 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 10 Jan 2020 17:45:30 +0000 (17:45 +0000)
commitfaa85d4fb39554b382ec3d6d5ec82a9ffc9c63f5
tree31c819149d81d0cbdaba8a98b7ef79d3b7c8cc48
parenta8d27a54cc9cccac38a515cdf6339d5ef9d4fcb8
x86/boot: Don't map 0 during boot

In particular, it causes accidental NULL pointer dereferences to go unnoticed.

The majority of the early operation takes place either in Real mode, or
Protected Unpaged mode.  The only bit which requires pagetable mappings is the
trampoline transition into Long mode and jump to the higher mappings, so there
is no need for the whole bottom 2M to be mapped.

Introduce a new l1_bootmap in .init.data, and use it instead of l1_identmap.
The EFI boot path doesn't pass through the trampoline, so doesn't need any
adjustment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/x86_64.S