[PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-22 Thread Andrew Cooper
Make the "no extended leaves" case fatal and remove one level of indentation. Defer the max-leaf aquisition until it is first used. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Daniel P. Smith CC: Marek Marczykowski-Górecki CC: Alejandro Vall

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-23 Thread Marek Marczykowski-Górecki
On Mon, Jul 22, 2024 at 11:18:37AM +0100, Andrew Cooper wrote: > Make the "no extended leaves" case fatal and remove one level of indentation. > Defer the max-leaf aquisition until it is first used. > > No functional change. > > Signed-off-by: Andrew Cooper Acked-by: Marek Marczykowski-Górecki

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-23 Thread Alejandro Vallejo
On Mon Jul 22, 2024 at 11:18 AM BST, Andrew Cooper wrote: > Make the "no extended leaves" case fatal and remove one level of indentation. > Defer the max-leaf aquisition until it is first used. > > No functional change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monn

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-23 Thread Jan Beulich
On 23.07.2024 15:47, Alejandro Vallejo wrote: > On Mon Jul 22, 2024 at 11:18 AM BST, Andrew Cooper wrote: >> +if ( (eax >> 16) != 0x8000 || eax < 0x8000U ) >> +blexit(L"In 64bit mode, but no extended CPUID leaves?!?"); > > I'm not sure about the condition even for the old code. If

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-24 Thread Alejandro Vallejo
On Wed Jul 24, 2024 at 6:42 AM BST, Jan Beulich wrote: > On 23.07.2024 15:47, Alejandro Vallejo wrote: > > On Mon Jul 22, 2024 at 11:18 AM BST, Andrew Cooper wrote: > >> +if ( (eax >> 16) != 0x8000 || eax < 0x8000U ) > >> +blexit(L"In 64bit mode, but no extended CPUID leaves?!?"); >

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-24 Thread Jan Beulich
On 22.07.2024 12:18, Andrew Cooper wrote: > --- a/xen/arch/x86/efi/efi-boot.h > +++ b/xen/arch/x86/efi/efi-boot.h > @@ -738,29 +738,30 @@ static void __init efi_arch_handle_module(const struct > file *file, > > static void __init efi_arch_cpu(void) > { > -uint32_t eax = cpuid_eax(0x800

Re: [PATCH 1/2] x86/efi: Simplify efi_arch_cpu() a little

2024-07-24 Thread Jan Beulich
On 24.07.2024 15:28, Alejandro Vallejo wrote: > On Wed Jul 24, 2024 at 6:42 AM BST, Jan Beulich wrote: >> On 23.07.2024 15:47, Alejandro Vallejo wrote: >>> On Mon Jul 22, 2024 at 11:18 AM BST, Andrew Cooper wrote: +if ( (eax >> 16) != 0x8000 || eax < 0x8000U ) +blexit(L"In