core: Move per_cpu::cpu_id initialization out of assembly code

We can trivially initialize this field during early setup if we pass the
value to entry(). Removes one offset define that needs to be kept in
manual sync with struct per_cpu.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Switch GDT, IDT and segments before enabling hypervisor page table

The Linux GDT and IDT are no longer accessible once we switched to the
hypervisor page table. So we need to move the latter after the switching
of those tables and segment registers to avoid occasional crashes during
hypervisor enabling.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
core: Prevent hugepage creation if physical and virtual addresses are unaligned

We can only create hugepages if the there is an alignment on the page
size by both the virtual and physical address. Without this check, we
crashed, e.g., on configurations that placed the hypervisor on physical
start addresses that were not 2M-aligned.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
x86: Fix enabling of 1G hugepages

These are not supported by all CPUs, in fact. So check support and
otherwise clear the corresponding page_size field in hv_paging. We keep
x86_64_paging as template for all the 4-level paging modes on x86-64.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>