Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-22 Thread Borislav Petkov
On Tue, Jan 22, 2019 at 11:32:41AM +0800, Chao Fan wrote: > But I notice the only function call entry is in kaslr.c which needs > RANDOMIZE_BASE, so do I need change it as: > vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/acpi.o Well, the very first patch in this thread doesn't have anything to

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-21 Thread Chao Fan
On Mon, Jan 21, 2019 at 09:29:32AM +0100, Borislav Petkov wrote: >On Mon, Jan 21, 2019 at 09:18:30AM +0800, Chao Fan wrote: >> So I have changed as this method and put in my mail thread, you may not >> notice, so I put here for my function if I need to fill the >> boot_parameters: >> >> static

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-21 Thread Borislav Petkov
On Mon, Jan 21, 2019 at 04:43:52PM +0800, Chao Fan wrote: > Since I didn't see where Xen to fill the value, if > boot_params->acpi_rsdp_addr is filled before my code, I just need to > read it. If when I try to read it but not found, then parse RSDP and > fill the RSDP address to

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-21 Thread Chao Fan
On Mon, Jan 21, 2019 at 09:29:32AM +0100, Borislav Petkov wrote: >On Mon, Jan 21, 2019 at 09:18:30AM +0800, Chao Fan wrote: >> So I have changed as this method and put in my mail thread, you may not >> notice, so I put here for my function if I need to fill the >> boot_parameters: >> >> static

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-21 Thread Borislav Petkov
On Mon, Jan 21, 2019 at 09:18:30AM +0800, Chao Fan wrote: > So I have changed as this method and put in my mail thread, you may not > notice, so I put here for my function if I need to fill the > boot_parameters: > > static inline acpi_physical_address get_boot_params_rsdp(void) > { >

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-20 Thread Chao Fan
On Fri, Jan 18, 2019 at 11:26:36AM +0100, Borislav Petkov wrote: >On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote: >> How about we refill the boot_params.acpi_rsdp_addr if it is not valid >> in early code, so it could be used as a reliable RSDP address source? >> That should make

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-18 Thread Borislav Petkov
On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote: > How about we refill the boot_params.acpi_rsdp_addr if it is not valid > in early code, so it could be used as a reliable RSDP address source? > That should make things easier. > > But if early code should parse it and store it should

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-18 Thread Rafael J. Wysocki
On Fri, Jan 18, 2019 at 5:47 AM Kairui Song wrote: > > On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki wrote: > > > > On Thu, Jan 17, 2019 at 9:53 AM Dave Young wrote: > > > > > > Add linux-acpi list > > > > Well, thanks, but please resend the patches with a CC to linux-acpi. > > > > Hi, sure

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-17 Thread Kairui Song
On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki wrote: > > On Thu, Jan 17, 2019 at 9:53 AM Dave Young wrote: > > > > Add linux-acpi list > > Well, thanks, but please resend the patches with a CC to linux-acpi. > Hi, sure will do. Any thought on adding an acpi_os_get_root_pointer_late and

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-17 Thread Rafael J. Wysocki
On Thu, Jan 17, 2019 at 9:53 AM Dave Young wrote: > > Add linux-acpi list Well, thanks, but please resend the patches with a CC to linux-acpi. > On 01/17/19 at 03:41pm, Kairui Song wrote: > > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > > > > > > On Wed, Jan 16, 2019 at 03:08:42PM

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-17 Thread Dave Young
+ linux-acpi list On 01/17/19 at 03:49pm, Chao Fan wrote: > On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote: > >On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > >> > >> On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > >> > I didn't see a way to reuse things in

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-17 Thread Dave Young
Add linux-acpi list On 01/17/19 at 03:41pm, Kairui Song wrote: > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > > > > On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > > > I didn't see a way to reuse things in that patch series, situation is > > > different, in that patch

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-17 Thread Kairui Song
On Thu, Jan 17, 2019 at 3:51 PM Chao Fan wrote: > > On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote: > >On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > >> > >> On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > >> > I didn't see a way to reuse things in that

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-16 Thread Chao Fan
On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote: >On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: >> >> On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: >> > I didn't see a way to reuse things in that patch series, situation is >> > different, in that patch it needs

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-16 Thread Kairui Song
On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov wrote: > > On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > > I didn't see a way to reuse things in that patch series, situation is > > different, in that patch it needs to get RSDP in very early boot stage > > so it did everything

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-16 Thread Rafael J. Wysocki
On 1/16/2019 7:51 AM, Dave Young wrote: On 01/16/19 at 01:09pm, Kairui Song wrote: On Wed, Jan 16, 2019 at 11:32 AM Dave Young wrote: On 01/16/19 at 12:10am, Borislav Petkov wrote: On Tue, Jan 15, 2019 at 05:58:34PM +0800, Kairui Song wrote: When efi=noruntime or efi=oldmap is used, EFI

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-16 Thread Borislav Petkov
On Wed, Jan 16, 2019 at 03:08:42PM +0800, Kairui Song wrote: > I didn't see a way to reuse things in that patch series, situation is > different, in that patch it needs to get RSDP in very early boot stage > so it did everything from scratch, in this patch kexec_file_load need > to get RSDP too,

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Kairui Song
On Wed, Jan 16, 2019 at 7:10 AM Borislav Petkov wrote: > > +#ifdef CONFIG_ACPI > > + /* Setup ACPI RSDP pointer in case EFI is not available in second > > kernel */ > > + if (!acpi_disabled && (!efi_enabled(EFI_RUNTIME_SERVICES) || > > efi_enabled(EFI_OLD_MEMMAP))) { > > +

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Dave Young
On 01/16/19 at 01:09pm, Kairui Song wrote: > On Wed, Jan 16, 2019 at 11:32 AM Dave Young wrote: > > > > On 01/16/19 at 12:10am, Borislav Petkov wrote: > > > On Tue, Jan 15, 2019 at 05:58:34PM +0800, Kairui Song wrote: > > > > When efi=noruntime or efi=oldmap is used, EFI services won't be > > >

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Kairui Song
On Wed, Jan 16, 2019 at 11:32 AM Dave Young wrote: > > On 01/16/19 at 12:10am, Borislav Petkov wrote: > > On Tue, Jan 15, 2019 at 05:58:34PM +0800, Kairui Song wrote: > > > When efi=noruntime or efi=oldmap is used, EFI services won't be available > > > in the second kernel, therefore the second

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Dave Young
On 01/16/19 at 12:10am, Borislav Petkov wrote: > On Tue, Jan 15, 2019 at 05:58:34PM +0800, Kairui Song wrote: > > When efi=noruntime or efi=oldmap is used, EFI services won't be available > > in the second kernel, therefore the second kernel will not be able to get > > the ACPI RSDP address from

Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Borislav Petkov
On Tue, Jan 15, 2019 at 05:58:34PM +0800, Kairui Song wrote: > When efi=noruntime or efi=oldmap is used, EFI services won't be available > in the second kernel, therefore the second kernel will not be able to get > the ACPI RSDP address from firmware by calling EFI services and won't > boot.

[PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map

2019-01-15 Thread Kairui Song
When efi=noruntime or efi=oldmap is used, EFI services won't be available in the second kernel, therefore the second kernel will not be able to get the ACPI RSDP address from firmware by calling EFI services and won't boot. Previously we are expecting the user to set the acpi_rsdp= on kernel