From: Andrew Cooper Date: Mon, 1 Nov 2021 10:19:57 +0000 (+0000) Subject: x86/setup: Read CR4 earlier in __start_xen() X-Git-Tag: archive/raspbian/4.16.1-1+rpi1^2~38^2~50 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=875830393a420eedd2fb0cdba3e8512532c7daee;p=xen.git x86/setup: Read CR4 earlier in __start_xen() This is necessary for read_cr4() to function correctly. Move the EFER caching at the same time. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich (cherry picked from commit 9851bc4939101828d2ad7634b93c0d9ccaef5b7e) --- diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 369691dd13..9eba93b139 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -873,6 +873,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) /* Full exception support from here on in. */ + rdmsrl(MSR_EFER, this_cpu(efer)); + asm volatile ( "mov %%cr4,%0" : "=r" (get_cpu_info()->cr4) ); + /* Enable NMIs. Our loader (e.g. Tboot) may have left them disabled. */ enable_nmis(); @@ -919,9 +922,6 @@ void __init noreturn __start_xen(unsigned long mbi_p) parse_video_info(); - rdmsrl(MSR_EFER, this_cpu(efer)); - asm volatile ( "mov %%cr4,%0" : "=r" (get_cpu_info()->cr4) ); - /* We initialise the serial devices very early so we can get debugging. */ ns16550.io_base = 0x3f8; ns16550.irq = 4;