* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 7:41 ` Kairui Song
0 siblings, 0 replies; 50+ messages in thread
From: Kairui Song @ 2019-01-17 7:41 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, tglx, mingo, hpa, x86, Dave Young, Baoquan He,
kexec, akpm, robert.moore, erik.schmauss, rafael.j.wysocki,
Len Brown, Chao Fan
On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > to get RSDP too, but everything is well setup so things are a lot
> > easier, just read from current boot_prams, efi and fallback to
> > acpi_find_root_pointer should be good.
>
> No no. Early code should find out that venerable RSDP thing once and
> will save it somewhere for further use. No gazillion parsings of it.
> Just once and share it with the rest of the code that needs it.
>
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 be done in
Chao's patch, or I can post another patch to do it if Chao's patch is
merged.
For now I think good to have something like this in this patch series
to always keep storing acpi_rsdp in late code,
acpi_os_get_root_pointer_late (maybe comeup with a better name later)
could be used anytime to get RSDP and no extra parsing:
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
#endif
}
-#ifdef CONFIG_KEXEC
static unsigned long acpi_rsdp;
+#ifdef CONFIG_KEXEC
static int __init setup_acpi_rsdp(char *arg)
{
return kstrtoul(arg, 16, &acpi_rsdp);
@@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
early_param("acpi_rsdp", setup_acpi_rsdp);
#endif
+acpi_physical_address acpi_os_get_root_pointer_late(void) {
+ return acpi_rsdp;
+}
+
acpi_physical_address __init acpi_os_get_root_pointer(void)
{
acpi_physical_address pa;
-#ifdef CONFIG_KEXEC
if (acpi_rsdp)
return acpi_rsdp;
-#endif
+
pa = acpi_arch_get_root_pointer();
- if (pa)
+ if (pa) {
+ acpi_rsdp = pa;
return pa;
+ }
if (efi_enabled(EFI_CONFIG_TABLES)) {
- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
+ acpi_rsdp = efi.acpi20;
return efi.acpi20;
- if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+ }
+ if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
+ acpi_rsdp = efi.acpi;
return efi.acpi;
+ }
pr_err(PREFIX "System description tables not found\n");
} else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
acpi_find_root_pointer(&pa);
}
+ acpi_rsdp = pa;
return pa;
}
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.
--
Best Regards,
Kairui Song
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 7:41 ` Kairui Song
@ 2019-01-17 7:49 ` Chao Fan
-1 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-17 7:49 UTC (permalink / raw)
To: Kairui Song
Cc: rafael.j.wysocki, Baoquan He, erik.schmauss, x86, kexec,
linux-kernel, robert.moore, mingo, Borislav Petkov, hpa, tglx,
Dave Young, akpm, Len Brown
On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote:
>On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
>> > to get RSDP too, but everything is well setup so things are a lot
>> > easier, just read from current boot_prams, efi and fallback to
>> > acpi_find_root_pointer should be good.
>>
>> No no. Early code should find out that venerable RSDP thing once and
>> will save it somewhere for further use. No gazillion parsings of it.
>> Just once and share it with the rest of the code that needs it.
>>
>
>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.
I think it's OK.
Try to read it, if get RSDP, use it.
If not, search in EFI/BIOS/... and refill the RSDP to
boot_params.acpi_rsdp_addr.
By the way, I search kernel code, I didn't find other code fill and
use it, only you(KEXEC) are trying to fill it.
If I miss something, please let me know.
Thanks,
Chao Fan
>
>But if early code should parse it and store it should be done in
>Chao's patch, or I can post another patch to do it if Chao's patch is
>merged.
>
>For now I think good to have something like this in this patch series
>to always keep storing acpi_rsdp in late code,
>acpi_os_get_root_pointer_late (maybe comeup with a better name later)
>could be used anytime to get RSDP and no extra parsing:
>
>--- a/drivers/acpi/osl.c
>+++ b/drivers/acpi/osl.c
>@@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> #endif
> }
>
>-#ifdef CONFIG_KEXEC
> static unsigned long acpi_rsdp;
>+#ifdef CONFIG_KEXEC
> static int __init setup_acpi_rsdp(char *arg)
> {
> return kstrtoul(arg, 16, &acpi_rsdp);
>@@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> early_param("acpi_rsdp", setup_acpi_rsdp);
> #endif
>
>+acpi_physical_address acpi_os_get_root_pointer_late(void) {
>+ return acpi_rsdp;
>+}
>+
> acpi_physical_address __init acpi_os_get_root_pointer(void)
> {
> acpi_physical_address pa;
>
>-#ifdef CONFIG_KEXEC
> if (acpi_rsdp)
> return acpi_rsdp;
>-#endif
>+
> pa = acpi_arch_get_root_pointer();
>- if (pa)
>+ if (pa) {
>+ acpi_rsdp = pa;
> return pa;
>+ }
>
> if (efi_enabled(EFI_CONFIG_TABLES)) {
>- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
>+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
>+ acpi_rsdp = efi.acpi20;
> return efi.acpi20;
>- if (efi.acpi != EFI_INVALID_TABLE_ADDR)
>+ }
>+ if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
>+ acpi_rsdp = efi.acpi;
> return efi.acpi;
>+ }
> pr_err(PREFIX "System description tables not found\n");
> } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> acpi_find_root_pointer(&pa);
> }
>
> + acpi_rsdp = pa;
> return pa;
> }
>
>> --
>> Regards/Gruss,
>> Boris.
>>
>> Good mailing practices for 400: avoid top-posting and trim the reply.
>--
>Best Regards,
>Kairui Song
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 7:49 ` Chao Fan
0 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-17 7:49 UTC (permalink / raw)
To: Kairui Song
Cc: Borislav Petkov, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
On Thu, Jan 17, 2019 at 03:41:13PM +0800, Kairui Song wrote:
>On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
>> > to get RSDP too, but everything is well setup so things are a lot
>> > easier, just read from current boot_prams, efi and fallback to
>> > acpi_find_root_pointer should be good.
>>
>> No no. Early code should find out that venerable RSDP thing once and
>> will save it somewhere for further use. No gazillion parsings of it.
>> Just once and share it with the rest of the code that needs it.
>>
>
>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.
I think it's OK.
Try to read it, if get RSDP, use it.
If not, search in EFI/BIOS/... and refill the RSDP to
boot_params.acpi_rsdp_addr.
By the way, I search kernel code, I didn't find other code fill and
use it, only you(KEXEC) are trying to fill it.
If I miss something, please let me know.
Thanks,
Chao Fan
>
>But if early code should parse it and store it should be done in
>Chao's patch, or I can post another patch to do it if Chao's patch is
>merged.
>
>For now I think good to have something like this in this patch series
>to always keep storing acpi_rsdp in late code,
>acpi_os_get_root_pointer_late (maybe comeup with a better name later)
>could be used anytime to get RSDP and no extra parsing:
>
>--- a/drivers/acpi/osl.c
>+++ b/drivers/acpi/osl.c
>@@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> #endif
> }
>
>-#ifdef CONFIG_KEXEC
> static unsigned long acpi_rsdp;
>+#ifdef CONFIG_KEXEC
> static int __init setup_acpi_rsdp(char *arg)
> {
> return kstrtoul(arg, 16, &acpi_rsdp);
>@@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> early_param("acpi_rsdp", setup_acpi_rsdp);
> #endif
>
>+acpi_physical_address acpi_os_get_root_pointer_late(void) {
>+ return acpi_rsdp;
>+}
>+
> acpi_physical_address __init acpi_os_get_root_pointer(void)
> {
> acpi_physical_address pa;
>
>-#ifdef CONFIG_KEXEC
> if (acpi_rsdp)
> return acpi_rsdp;
>-#endif
>+
> pa = acpi_arch_get_root_pointer();
>- if (pa)
>+ if (pa) {
>+ acpi_rsdp = pa;
> return pa;
>+ }
>
> if (efi_enabled(EFI_CONFIG_TABLES)) {
>- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
>+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
>+ acpi_rsdp = efi.acpi20;
> return efi.acpi20;
>- if (efi.acpi != EFI_INVALID_TABLE_ADDR)
>+ }
>+ if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
>+ acpi_rsdp = efi.acpi;
> return efi.acpi;
>+ }
> pr_err(PREFIX "System description tables not found\n");
> } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> acpi_find_root_pointer(&pa);
> }
>
> + acpi_rsdp = pa;
> return pa;
> }
>
>> --
>> Regards/Gruss,
>> Boris.
>>
>> Good mailing practices for 400: avoid top-posting and trim the reply.
>--
>Best Regards,
>Kairui Song
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 7:49 ` Chao Fan
@ 2019-01-17 8:20 ` Kairui Song
-1 siblings, 0 replies; 50+ messages in thread
From: Kairui Song @ 2019-01-17 8:20 UTC (permalink / raw)
To: Chao Fan
Cc: rafael.j.wysocki, Baoquan He, erik.schmauss, x86, kexec,
linux-kernel, robert.moore, mingo, Borislav Petkov, hpa, tglx,
Dave Young, akpm, Len Brown
On Thu, Jan 17, 2019 at 3:51 PM Chao Fan <fanc.fnst@cn.fujitsu.com> 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> >> > to get RSDP too, but everything is well setup so things are a lot
> >> > easier, just read from current boot_prams, efi and fallback to
> >> > acpi_find_root_pointer should be good.
> >>
> >> No no. Early code should find out that venerable RSDP thing once and
> >> will save it somewhere for further use. No gazillion parsings of it.
> >> Just once and share it with the rest of the code that needs it.
> >>
> >
> >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.
>
> I think it's OK.
> Try to read it, if get RSDP, use it.
> If not, search in EFI/BIOS/... and refill the RSDP to
> boot_params.acpi_rsdp_addr.
> By the way, I search kernel code, I didn't find other code fill and
> use it, only you(KEXEC) are trying to fill it.
> If I miss something, please let me know.
Yes, kexec would read RSDP again to pass it to second kernel, and only
if EFI is disabled (efi=noruntime/old_map, else second kernel will get
rsdp just fine). Not sure if any other component would use it.
>
> Thanks,
> Chao Fan
>
--
Best Regards,
Kairui Song
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 8:20 ` Kairui Song
0 siblings, 0 replies; 50+ messages in thread
From: Kairui Song @ 2019-01-17 8:20 UTC (permalink / raw)
To: Chao Fan
Cc: Borislav Petkov, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
On Thu, Jan 17, 2019 at 3:51 PM Chao Fan <fanc.fnst@cn.fujitsu.com> 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> >> > to get RSDP too, but everything is well setup so things are a lot
> >> > easier, just read from current boot_prams, efi and fallback to
> >> > acpi_find_root_pointer should be good.
> >>
> >> No no. Early code should find out that venerable RSDP thing once and
> >> will save it somewhere for further use. No gazillion parsings of it.
> >> Just once and share it with the rest of the code that needs it.
> >>
> >
> >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.
>
> I think it's OK.
> Try to read it, if get RSDP, use it.
> If not, search in EFI/BIOS/... and refill the RSDP to
> boot_params.acpi_rsdp_addr.
> By the way, I search kernel code, I didn't find other code fill and
> use it, only you(KEXEC) are trying to fill it.
> If I miss something, please let me know.
Yes, kexec would read RSDP again to pass it to second kernel, and only
if EFI is disabled (efi=noruntime/old_map, else second kernel will get
rsdp just fine). Not sure if any other component would use it.
>
> Thanks,
> Chao Fan
>
--
Best Regards,
Kairui Song
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 7:49 ` Chao Fan
@ 2019-01-17 8:54 ` Dave Young
-1 siblings, 0 replies; 50+ messages in thread
From: Dave Young @ 2019-01-17 8:54 UTC (permalink / raw)
To: Chao Fan
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, x86, kexec,
linux-kernel, robert.moore, linux-acpi, mingo, Borislav Petkov,
hpa, tglx, erik.schmauss, akpm, Len Brown
+ 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> >> > to get RSDP too, but everything is well setup so things are a lot
> >> > easier, just read from current boot_prams, efi and fallback to
> >> > acpi_find_root_pointer should be good.
> >>
> >> No no. Early code should find out that venerable RSDP thing once and
> >> will save it somewhere for further use. No gazillion parsings of it.
> >> Just once and share it with the rest of the code that needs it.
> >>
> >
> >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.
>
> I think it's OK.
> Try to read it, if get RSDP, use it.
> If not, search in EFI/BIOS/... and refill the RSDP to
> boot_params.acpi_rsdp_addr.
> By the way, I search kernel code, I didn't find other code fill and
> use it, only you(KEXEC) are trying to fill it.
> If I miss something, please let me know.
>
> Thanks,
> Chao Fan
>
> >
> >But if early code should parse it and store it should be done in
> >Chao's patch, or I can post another patch to do it if Chao's patch is
> >merged.
> >
> >For now I think good to have something like this in this patch series
> >to always keep storing acpi_rsdp in late code,
> >acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> >could be used anytime to get RSDP and no extra parsing:
> >
> >--- a/drivers/acpi/osl.c
> >+++ b/drivers/acpi/osl.c
> >@@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > #endif
> > }
> >
> >-#ifdef CONFIG_KEXEC
> > static unsigned long acpi_rsdp;
> >+#ifdef CONFIG_KEXEC
> > static int __init setup_acpi_rsdp(char *arg)
> > {
> > return kstrtoul(arg, 16, &acpi_rsdp);
> >@@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > early_param("acpi_rsdp", setup_acpi_rsdp);
> > #endif
> >
> >+acpi_physical_address acpi_os_get_root_pointer_late(void) {
> >+ return acpi_rsdp;
> >+}
> >+
> > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > {
> > acpi_physical_address pa;
> >
> >-#ifdef CONFIG_KEXEC
> > if (acpi_rsdp)
> > return acpi_rsdp;
> >-#endif
> >+
> > pa = acpi_arch_get_root_pointer();
> >- if (pa)
> >+ if (pa) {
> >+ acpi_rsdp = pa;
> > return pa;
> >+ }
> >
> > if (efi_enabled(EFI_CONFIG_TABLES)) {
> >- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> >+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> >+ acpi_rsdp = efi.acpi20;
> > return efi.acpi20;
> >- if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> >+ }
> >+ if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> >+ acpi_rsdp = efi.acpi;
> > return efi.acpi;
> >+ }
> > pr_err(PREFIX "System description tables not found\n");
> > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > acpi_find_root_pointer(&pa);
> > }
> >
> > + acpi_rsdp = pa;
> > return pa;
> > }
> >
> >> --
> >> Regards/Gruss,
> >> Boris.
> >>
> >> Good mailing practices for 400: avoid top-posting and trim the reply.
> >--
> >Best Regards,
> >Kairui Song
> >
> >
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 8:54 ` Dave Young
0 siblings, 0 replies; 50+ messages in thread
From: Dave Young @ 2019-01-17 8:54 UTC (permalink / raw)
To: Chao Fan
Cc: Kairui Song, Borislav Petkov, linux-kernel, tglx, mingo, hpa, x86,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown, linux-acpi
+ 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> >> > to get RSDP too, but everything is well setup so things are a lot
> >> > easier, just read from current boot_prams, efi and fallback to
> >> > acpi_find_root_pointer should be good.
> >>
> >> No no. Early code should find out that venerable RSDP thing once and
> >> will save it somewhere for further use. No gazillion parsings of it.
> >> Just once and share it with the rest of the code that needs it.
> >>
> >
> >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.
>
> I think it's OK.
> Try to read it, if get RSDP, use it.
> If not, search in EFI/BIOS/... and refill the RSDP to
> boot_params.acpi_rsdp_addr.
> By the way, I search kernel code, I didn't find other code fill and
> use it, only you(KEXEC) are trying to fill it.
> If I miss something, please let me know.
>
> Thanks,
> Chao Fan
>
> >
> >But if early code should parse it and store it should be done in
> >Chao's patch, or I can post another patch to do it if Chao's patch is
> >merged.
> >
> >For now I think good to have something like this in this patch series
> >to always keep storing acpi_rsdp in late code,
> >acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> >could be used anytime to get RSDP and no extra parsing:
> >
> >--- a/drivers/acpi/osl.c
> >+++ b/drivers/acpi/osl.c
> >@@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > #endif
> > }
> >
> >-#ifdef CONFIG_KEXEC
> > static unsigned long acpi_rsdp;
> >+#ifdef CONFIG_KEXEC
> > static int __init setup_acpi_rsdp(char *arg)
> > {
> > return kstrtoul(arg, 16, &acpi_rsdp);
> >@@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > early_param("acpi_rsdp", setup_acpi_rsdp);
> > #endif
> >
> >+acpi_physical_address acpi_os_get_root_pointer_late(void) {
> >+ return acpi_rsdp;
> >+}
> >+
> > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > {
> > acpi_physical_address pa;
> >
> >-#ifdef CONFIG_KEXEC
> > if (acpi_rsdp)
> > return acpi_rsdp;
> >-#endif
> >+
> > pa = acpi_arch_get_root_pointer();
> >- if (pa)
> >+ if (pa) {
> >+ acpi_rsdp = pa;
> > return pa;
> >+ }
> >
> > if (efi_enabled(EFI_CONFIG_TABLES)) {
> >- if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> >+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> >+ acpi_rsdp = efi.acpi20;
> > return efi.acpi20;
> >- if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> >+ }
> >+ if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> >+ acpi_rsdp = efi.acpi;
> > return efi.acpi;
> >+ }
> > pr_err(PREFIX "System description tables not found\n");
> > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > acpi_find_root_pointer(&pa);
> > }
> >
> > + acpi_rsdp = pa;
> > return pa;
> > }
> >
> >> --
> >> Regards/Gruss,
> >> Boris.
> >>
> >> Good mailing practices for 400: avoid top-posting and trim the reply.
> >--
> >Best Regards,
> >Kairui Song
> >
> >
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 7:41 ` Kairui Song
@ 2019-01-17 8:53 ` Dave Young
-1 siblings, 0 replies; 50+ messages in thread
From: Dave Young @ 2019-01-17 8:53 UTC (permalink / raw)
To: Kairui Song
Cc: rafael.j.wysocki, Baoquan He, x86, kexec, linux-kernel,
robert.moore, linux-acpi, mingo, Borislav Petkov, hpa, tglx,
erik.schmauss, akpm, Chao Fan, Len Brown
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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > to get RSDP too, but everything is well setup so things are a lot
> > > easier, just read from current boot_prams, efi and fallback to
> > > acpi_find_root_pointer should be good.
> >
> > No no. Early code should find out that venerable RSDP thing once and
> > will save it somewhere for further use. No gazillion parsings of it.
> > Just once and share it with the rest of the code that needs it.
> >
>
> 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 be done in
> Chao's patch, or I can post another patch to do it if Chao's patch is
> merged.
>
> For now I think good to have something like this in this patch series
> to always keep storing acpi_rsdp in late code,
> acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> could be used anytime to get RSDP and no extra parsing:
>
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> #endif
> }
>
> -#ifdef CONFIG_KEXEC
> static unsigned long acpi_rsdp;
> +#ifdef CONFIG_KEXEC
> static int __init setup_acpi_rsdp(char *arg)
> {
> return kstrtoul(arg, 16, &acpi_rsdp);
> @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> early_param("acpi_rsdp", setup_acpi_rsdp);
> #endif
>
> +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> + return acpi_rsdp;
> +}
> +
> acpi_physical_address __init acpi_os_get_root_pointer(void)
> {
> acpi_physical_address pa;
>
> -#ifdef CONFIG_KEXEC
> if (acpi_rsdp)
> return acpi_rsdp;
> -#endif
> +
> pa = acpi_arch_get_root_pointer();
> - if (pa)
> + if (pa) {
> + acpi_rsdp = pa;
> return pa;
> + }
>
> if (efi_enabled(EFI_CONFIG_TABLES)) {
> - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> + acpi_rsdp = efi.acpi20;
> return efi.acpi20;
> - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> + }
> + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> + acpi_rsdp = efi.acpi;
> return efi.acpi;
> + }
> pr_err(PREFIX "System description tables not found\n");
> } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> acpi_find_root_pointer(&pa);
> }
>
> + acpi_rsdp = pa;
> return pa;
> }
>
> > --
> > Regards/Gruss,
> > Boris.
> >
> > Good mailing practices for 400: avoid top-posting and trim the reply.
> --
> Best Regards,
> Kairui Song
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 8:53 ` Dave Young
0 siblings, 0 replies; 50+ messages in thread
From: Dave Young @ 2019-01-17 8:53 UTC (permalink / raw)
To: Kairui Song
Cc: Borislav Petkov, linux-kernel, tglx, mingo, hpa, x86, Baoquan He,
kexec, akpm, robert.moore, erik.schmauss, rafael.j.wysocki,
Len Brown, Chao Fan, linux-acpi
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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > to get RSDP too, but everything is well setup so things are a lot
> > > easier, just read from current boot_prams, efi and fallback to
> > > acpi_find_root_pointer should be good.
> >
> > No no. Early code should find out that venerable RSDP thing once and
> > will save it somewhere for further use. No gazillion parsings of it.
> > Just once and share it with the rest of the code that needs it.
> >
>
> 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 be done in
> Chao's patch, or I can post another patch to do it if Chao's patch is
> merged.
>
> For now I think good to have something like this in this patch series
> to always keep storing acpi_rsdp in late code,
> acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> could be used anytime to get RSDP and no extra parsing:
>
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> #endif
> }
>
> -#ifdef CONFIG_KEXEC
> static unsigned long acpi_rsdp;
> +#ifdef CONFIG_KEXEC
> static int __init setup_acpi_rsdp(char *arg)
> {
> return kstrtoul(arg, 16, &acpi_rsdp);
> @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> early_param("acpi_rsdp", setup_acpi_rsdp);
> #endif
>
> +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> + return acpi_rsdp;
> +}
> +
> acpi_physical_address __init acpi_os_get_root_pointer(void)
> {
> acpi_physical_address pa;
>
> -#ifdef CONFIG_KEXEC
> if (acpi_rsdp)
> return acpi_rsdp;
> -#endif
> +
> pa = acpi_arch_get_root_pointer();
> - if (pa)
> + if (pa) {
> + acpi_rsdp = pa;
> return pa;
> + }
>
> if (efi_enabled(EFI_CONFIG_TABLES)) {
> - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> + acpi_rsdp = efi.acpi20;
> return efi.acpi20;
> - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> + }
> + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> + acpi_rsdp = efi.acpi;
> return efi.acpi;
> + }
> pr_err(PREFIX "System description tables not found\n");
> } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> acpi_find_root_pointer(&pa);
> }
>
> + acpi_rsdp = pa;
> return pa;
> }
>
> > --
> > Regards/Gruss,
> > Boris.
> >
> > Good mailing practices for 400: avoid top-posting and trim the reply.
> --
> Best Regards,
> Kairui Song
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 8:53 ` Dave Young
@ 2019-01-17 9:39 ` Rafael J. Wysocki
-1 siblings, 0 replies; 50+ messages in thread
From: Rafael J. Wysocki @ 2019-01-17 9:39 UTC (permalink / raw)
To: Dave Young
Cc: Rafael Wysocki, Kairui Song, Baoquan He, the arch/x86 maintainers,
kexec, Linux Kernel Mailing List, Robert Moore,
ACPI Devel Maling List, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Thomas Gleixner, Schmauss, Erik, Andrew Morton,
Chao Fan, Len Brown
On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > > to get RSDP too, but everything is well setup so things are a lot
> > > > easier, just read from current boot_prams, efi and fallback to
> > > > acpi_find_root_pointer should be good.
> > >
> > > No no. Early code should find out that venerable RSDP thing once and
> > > will save it somewhere for further use. No gazillion parsings of it.
> > > Just once and share it with the rest of the code that needs it.
> > >
> >
> > 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 be done in
> > Chao's patch, or I can post another patch to do it if Chao's patch is
> > merged.
> >
> > For now I think good to have something like this in this patch series
> > to always keep storing acpi_rsdp in late code,
> > acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> > could be used anytime to get RSDP and no extra parsing:
> >
> > --- a/drivers/acpi/osl.c
> > +++ b/drivers/acpi/osl.c
> > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > #endif
> > }
> >
> > -#ifdef CONFIG_KEXEC
> > static unsigned long acpi_rsdp;
> > +#ifdef CONFIG_KEXEC
> > static int __init setup_acpi_rsdp(char *arg)
> > {
> > return kstrtoul(arg, 16, &acpi_rsdp);
> > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > early_param("acpi_rsdp", setup_acpi_rsdp);
> > #endif
> >
> > +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> > + return acpi_rsdp;
> > +}
> > +
> > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > {
> > acpi_physical_address pa;
> >
> > -#ifdef CONFIG_KEXEC
> > if (acpi_rsdp)
> > return acpi_rsdp;
> > -#endif
> > +
> > pa = acpi_arch_get_root_pointer();
> > - if (pa)
> > + if (pa) {
> > + acpi_rsdp = pa;
> > return pa;
> > + }
> >
> > if (efi_enabled(EFI_CONFIG_TABLES)) {
> > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> > + acpi_rsdp = efi.acpi20;
> > return efi.acpi20;
> > - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> > + }
> > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> > + acpi_rsdp = efi.acpi;
> > return efi.acpi;
> > + }
> > pr_err(PREFIX "System description tables not found\n");
> > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > acpi_find_root_pointer(&pa);
> > }
> >
> > + acpi_rsdp = pa;
> > return pa;
> > }
> >
> > > --
> > > Regards/Gruss,
> > > Boris.
> > >
> > > Good mailing practices for 400: avoid top-posting and trim the reply.
> > --
> > Best Regards,
> > Kairui Song
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-17 9:39 ` Rafael J. Wysocki
0 siblings, 0 replies; 50+ messages in thread
From: Rafael J. Wysocki @ 2019-01-17 9:39 UTC (permalink / raw)
To: Dave Young
Cc: Kairui Song, Borislav Petkov, Linux Kernel Mailing List,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
the arch/x86 maintainers, Baoquan He, kexec, Andrew Morton,
Robert Moore, Schmauss, Erik, Rafael Wysocki, Len Brown, Chao Fan,
ACPI Devel Maling List
On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > > to get RSDP too, but everything is well setup so things are a lot
> > > > easier, just read from current boot_prams, efi and fallback to
> > > > acpi_find_root_pointer should be good.
> > >
> > > No no. Early code should find out that venerable RSDP thing once and
> > > will save it somewhere for further use. No gazillion parsings of it.
> > > Just once and share it with the rest of the code that needs it.
> > >
> >
> > 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 be done in
> > Chao's patch, or I can post another patch to do it if Chao's patch is
> > merged.
> >
> > For now I think good to have something like this in this patch series
> > to always keep storing acpi_rsdp in late code,
> > acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> > could be used anytime to get RSDP and no extra parsing:
> >
> > --- a/drivers/acpi/osl.c
> > +++ b/drivers/acpi/osl.c
> > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > #endif
> > }
> >
> > -#ifdef CONFIG_KEXEC
> > static unsigned long acpi_rsdp;
> > +#ifdef CONFIG_KEXEC
> > static int __init setup_acpi_rsdp(char *arg)
> > {
> > return kstrtoul(arg, 16, &acpi_rsdp);
> > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > early_param("acpi_rsdp", setup_acpi_rsdp);
> > #endif
> >
> > +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> > + return acpi_rsdp;
> > +}
> > +
> > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > {
> > acpi_physical_address pa;
> >
> > -#ifdef CONFIG_KEXEC
> > if (acpi_rsdp)
> > return acpi_rsdp;
> > -#endif
> > +
> > pa = acpi_arch_get_root_pointer();
> > - if (pa)
> > + if (pa) {
> > + acpi_rsdp = pa;
> > return pa;
> > + }
> >
> > if (efi_enabled(EFI_CONFIG_TABLES)) {
> > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> > + acpi_rsdp = efi.acpi20;
> > return efi.acpi20;
> > - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> > + }
> > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> > + acpi_rsdp = efi.acpi;
> > return efi.acpi;
> > + }
> > pr_err(PREFIX "System description tables not found\n");
> > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > acpi_find_root_pointer(&pa);
> > }
> >
> > + acpi_rsdp = pa;
> > return pa;
> > }
> >
> > > --
> > > Regards/Gruss,
> > > Boris.
> > >
> > > Good mailing practices for 400: avoid top-posting and trim the reply.
> > --
> > Best Regards,
> > Kairui Song
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 9:39 ` Rafael J. Wysocki
@ 2019-01-18 4:47 ` Kairui Song
-1 siblings, 0 replies; 50+ messages in thread
From: Kairui Song @ 2019-01-18 4:47 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Rafael Wysocki, Baoquan He, Schmauss, Erik,
the arch/x86 maintainers, kexec, Linux Kernel Mailing List,
Robert Moore, ACPI Devel Maling List, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Dave Young,
Andrew Morton, Chao Fan, Len Brown
On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 store rsdp
pointer as mentioned? Will updat the patch and post V2, and cc
linux-acpi as well later.
> > On 01/17/19 at 03:41pm, Kairui Song wrote:
> > > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > > > to get RSDP too, but everything is well setup so things are a lot
> > > > > easier, just read from current boot_prams, efi and fallback to
> > > > > acpi_find_root_pointer should be good.
> > > >
> > > > No no. Early code should find out that venerable RSDP thing once and
> > > > will save it somewhere for further use. No gazillion parsings of it.
> > > > Just once and share it with the rest of the code that needs it.
> > > >
> > >
> > > 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 be done in
> > > Chao's patch, or I can post another patch to do it if Chao's patch is
> > > merged.
> > >
> > > For now I think good to have something like this in this patch series
> > > to always keep storing acpi_rsdp in late code,
> > > acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> > > could be used anytime to get RSDP and no extra parsing:
> > >
> > > --- a/drivers/acpi/osl.c
> > > +++ b/drivers/acpi/osl.c
> > > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > > #endif
> > > }
> > >
> > > -#ifdef CONFIG_KEXEC
> > > static unsigned long acpi_rsdp;
> > > +#ifdef CONFIG_KEXEC
> > > static int __init setup_acpi_rsdp(char *arg)
> > > {
> > > return kstrtoul(arg, 16, &acpi_rsdp);
> > > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > > early_param("acpi_rsdp", setup_acpi_rsdp);
> > > #endif
> > >
> > > +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> > > + return acpi_rsdp;
> > > +}
> > > +
> > > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > > {
> > > acpi_physical_address pa;
> > >
> > > -#ifdef CONFIG_KEXEC
> > > if (acpi_rsdp)
> > > return acpi_rsdp;
> > > -#endif
> > > +
> > > pa = acpi_arch_get_root_pointer();
> > > - if (pa)
> > > + if (pa) {
> > > + acpi_rsdp = pa;
> > > return pa;
> > > + }
> > >
> > > if (efi_enabled(EFI_CONFIG_TABLES)) {
> > > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> > > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> > > + acpi_rsdp = efi.acpi20;
> > > return efi.acpi20;
> > > - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> > > + }
> > > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> > > + acpi_rsdp = efi.acpi;
> > > return efi.acpi;
> > > + }
> > > pr_err(PREFIX "System description tables not found\n");
> > > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > > acpi_find_root_pointer(&pa);
> > > }
> > >
> > > + acpi_rsdp = pa;
> > > return pa;
> > > }
> > >
> > > > --
> > > > Regards/Gruss,
> > > > Boris.
> > > >
> > > > Good mailing practices for 400: avoid top-posting and trim the reply.
> > > --
> > > Best Regards,
> > > Kairui Song
--
Best Regards,
Kairui Song
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-18 4:47 ` Kairui Song
0 siblings, 0 replies; 50+ messages in thread
From: Kairui Song @ 2019-01-18 4:47 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Dave Young, Borislav Petkov, Linux Kernel Mailing List,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
the arch/x86 maintainers, Baoquan He, kexec, Andrew Morton,
Robert Moore, Schmauss, Erik, Rafael Wysocki, Len Brown, Chao Fan,
ACPI Devel Maling List
On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 store rsdp
pointer as mentioned? Will updat the patch and post V2, and cc
linux-acpi as well later.
> > On 01/17/19 at 03:41pm, Kairui Song wrote:
> > > On Wed, Jan 16, 2019 at 5:46 PM Borislav Petkov <bp@alien8.de> 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 from scratch, in this patch kexec_file_load need
> > > > > to get RSDP too, but everything is well setup so things are a lot
> > > > > easier, just read from current boot_prams, efi and fallback to
> > > > > acpi_find_root_pointer should be good.
> > > >
> > > > No no. Early code should find out that venerable RSDP thing once and
> > > > will save it somewhere for further use. No gazillion parsings of it.
> > > > Just once and share it with the rest of the code that needs it.
> > > >
> > >
> > > 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 be done in
> > > Chao's patch, or I can post another patch to do it if Chao's patch is
> > > merged.
> > >
> > > For now I think good to have something like this in this patch series
> > > to always keep storing acpi_rsdp in late code,
> > > acpi_os_get_root_pointer_late (maybe comeup with a better name later)
> > > could be used anytime to get RSDP and no extra parsing:
> > >
> > > --- a/drivers/acpi/osl.c
> > > +++ b/drivers/acpi/osl.c
> > > @@ -180,8 +180,8 @@ void acpi_os_vprintf(const char *fmt, va_list args)
> > > #endif
> > > }
> > >
> > > -#ifdef CONFIG_KEXEC
> > > static unsigned long acpi_rsdp;
> > > +#ifdef CONFIG_KEXEC
> > > static int __init setup_acpi_rsdp(char *arg)
> > > {
> > > return kstrtoul(arg, 16, &acpi_rsdp);
> > > @@ -189,28 +189,38 @@ static int __init setup_acpi_rsdp(char *arg)
> > > early_param("acpi_rsdp", setup_acpi_rsdp);
> > > #endif
> > >
> > > +acpi_physical_address acpi_os_get_root_pointer_late(void) {
> > > + return acpi_rsdp;
> > > +}
> > > +
> > > acpi_physical_address __init acpi_os_get_root_pointer(void)
> > > {
> > > acpi_physical_address pa;
> > >
> > > -#ifdef CONFIG_KEXEC
> > > if (acpi_rsdp)
> > > return acpi_rsdp;
> > > -#endif
> > > +
> > > pa = acpi_arch_get_root_pointer();
> > > - if (pa)
> > > + if (pa) {
> > > + acpi_rsdp = pa;
> > > return pa;
> > > + }
> > >
> > > if (efi_enabled(EFI_CONFIG_TABLES)) {
> > > - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
> > > + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
> > > + acpi_rsdp = efi.acpi20;
> > > return efi.acpi20;
> > > - if (efi.acpi != EFI_INVALID_TABLE_ADDR)
> > > + }
> > > + if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
> > > + acpi_rsdp = efi.acpi;
> > > return efi.acpi;
> > > + }
> > > pr_err(PREFIX "System description tables not found\n");
> > > } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
> > > acpi_find_root_pointer(&pa);
> > > }
> > >
> > > + acpi_rsdp = pa;
> > > return pa;
> > > }
> > >
> > > > --
> > > > Regards/Gruss,
> > > > Boris.
> > > >
> > > > Good mailing practices for 400: avoid top-posting and trim the reply.
> > > --
> > > Best Regards,
> > > Kairui Song
--
Best Regards,
Kairui Song
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-18 4:47 ` Kairui Song
@ 2019-01-18 9:45 ` Rafael J. Wysocki
-1 siblings, 0 replies; 50+ messages in thread
From: Rafael J. Wysocki @ 2019-01-18 9:45 UTC (permalink / raw)
To: Kairui Song
Cc: Rafael Wysocki, Baoquan He, Rafael J. Wysocki, Schmauss, Erik,
the arch/x86 maintainers, kexec, Linux Kernel Mailing List,
Robert Moore, ACPI Devel Maling List, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Dave Young,
Andrew Morton, Chao Fan, Len Brown
On Fri, Jan 18, 2019 at 5:47 AM Kairui Song <kasong@redhat.com> wrote:
>
> On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 store rsdp
> pointer as mentioned?
It is a good idea in general IMO, but all depends on how the code
changes will look like.
> Will updat the patch and post V2, and cc linux-acpi as well later.
Thanks!
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-18 9:45 ` Rafael J. Wysocki
0 siblings, 0 replies; 50+ messages in thread
From: Rafael J. Wysocki @ 2019-01-18 9:45 UTC (permalink / raw)
To: Kairui Song
Cc: Rafael J. Wysocki, Dave Young, Borislav Petkov,
Linux Kernel Mailing List, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, the arch/x86 maintainers, Baoquan He, kexec,
Andrew Morton, Robert Moore, Schmauss, Erik, Rafael Wysocki,
Len Brown, Chao Fan, ACPI Devel Maling List
On Fri, Jan 18, 2019 at 5:47 AM Kairui Song <kasong@redhat.com> wrote:
>
> On Thu, Jan 17, 2019 at 5:40 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Thu, Jan 17, 2019 at 9:53 AM Dave Young <dyoung@redhat.com> 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 store rsdp
> pointer as mentioned?
It is a good idea in general IMO, but all depends on how the code
changes will look like.
> Will updat the patch and post V2, and cc linux-acpi as well later.
Thanks!
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-17 7:41 ` Kairui Song
@ 2019-01-18 10:26 ` Borislav Petkov
-1 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-18 10:26 UTC (permalink / raw)
To: Kairui Song
Cc: rafael.j.wysocki, Baoquan He, erik.schmauss, x86, kexec,
linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young, akpm,
Chao Fan, Len Brown
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 be done in
> Chao's patch, or I can post another patch to do it if Chao's patch is
> merged.
Chao's stuff does the as early as possible parsing of RDSP. Then, it
should be saved into boot_params and everything else should read it from
there. Simple.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-18 10:26 ` Borislav Petkov
0 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-18 10:26 UTC (permalink / raw)
To: Kairui Song
Cc: linux-kernel, tglx, mingo, hpa, x86, Dave Young, Baoquan He,
kexec, akpm, robert.moore, erik.schmauss, rafael.j.wysocki,
Len Brown, Chao Fan
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 be done in
> Chao's patch, or I can post another patch to do it if Chao's patch is
> merged.
Chao's stuff does the as early as possible parsing of RDSP. Then, it
should be saved into boot_params and everything else should read it from
there. Simple.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-18 10:26 ` Borislav Petkov
@ 2019-01-21 1:18 ` Chao Fan
-1 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-21 1:18 UTC (permalink / raw)
To: Borislav Petkov
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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 things easier.
>>
>> But if early code should parse it and store it should be done in
>> Chao's patch, or I can post another patch to do it if Chao's patch is
>> merged.
>
>Chao's stuff does the as early as possible parsing of RDSP. Then, it
>should be saved into boot_params and everything else should read it from
>there. Simple.
Hi Boris,
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)
{
return boot_params->acpi_rsdp_addr;
}
static acpi_physical_address get_rsdp_addr(void)
{
bool boot_params_rsdp_exist;
acpi_physical_address pa;
pa = get_acpi_rsdp();
if (!pa)
pa = get_boot_params_rsdp();
if (!pa) {
pa = efi_get_rsdp_addr();
boot_params_rsdp_exist = false;
}
else
boot_params_rsdp_exist = true;
if (!pa)
pa = bios_get_rsdp_addr();
if (pa && !boot_params_rsdp_exist)
boot_params.acpi_rsdp_addr = pa;
return pa;
}
At the same time, I notice kernel only parses it when
"#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
update the define of EARLY_SRAT_PARSE:
config EARLY_SRAT_PARSE
bool "EARLY SRAT parsing"
def_bool y
depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
If I miss something, please let me know.
Or in my PATCHSET, I don't need to fill boot_parameters, just
leave the job another PATCH?
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-21 1:18 ` Chao Fan
0 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-21 1:18 UTC (permalink / raw)
To: Borislav Petkov
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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 things easier.
>>
>> But if early code should parse it and store it should be done in
>> Chao's patch, or I can post another patch to do it if Chao's patch is
>> merged.
>
>Chao's stuff does the as early as possible parsing of RDSP. Then, it
>should be saved into boot_params and everything else should read it from
>there. Simple.
Hi Boris,
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)
{
return boot_params->acpi_rsdp_addr;
}
static acpi_physical_address get_rsdp_addr(void)
{
bool boot_params_rsdp_exist;
acpi_physical_address pa;
pa = get_acpi_rsdp();
if (!pa)
pa = get_boot_params_rsdp();
if (!pa) {
pa = efi_get_rsdp_addr();
boot_params_rsdp_exist = false;
}
else
boot_params_rsdp_exist = true;
if (!pa)
pa = bios_get_rsdp_addr();
if (pa && !boot_params_rsdp_exist)
boot_params.acpi_rsdp_addr = pa;
return pa;
}
At the same time, I notice kernel only parses it when
"#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
update the define of EARLY_SRAT_PARSE:
config EARLY_SRAT_PARSE
bool "EARLY SRAT parsing"
def_bool y
depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
If I miss something, please let me know.
Or in my PATCHSET, I don't need to fill boot_parameters, just
leave the job another PATCH?
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-21 1:18 ` Chao Fan
@ 2019-01-21 8:29 ` Borislav Petkov
-1 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-21 8:29 UTC (permalink / raw)
To: Chao Fan
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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)
> {
> return boot_params->acpi_rsdp_addr;
> }
Why do you need that silly wrapper?
> static acpi_physical_address get_rsdp_addr(void)
> {
> bool boot_params_rsdp_exist;
What's that bool supposed to do?
> acpi_physical_address pa;
>
> pa = get_acpi_rsdp();
>
> if (!pa)
> pa = get_boot_params_rsdp();
>
> if (!pa) {
> pa = efi_get_rsdp_addr();
> boot_params_rsdp_exist = false;
> }
> else
> boot_params_rsdp_exist = true;
>
> if (!pa)
> pa = bios_get_rsdp_addr();
>
> if (pa && !boot_params_rsdp_exist)
> boot_params.acpi_rsdp_addr = pa;
>
> return pa;
> }
>
> At the same time, I notice kernel only parses it when
> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
> update the define of EARLY_SRAT_PARSE:
>
> config EARLY_SRAT_PARSE
> bool "EARLY SRAT parsing"
> def_bool y
> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
Actually, you don't need that anymore - make it unconditionally
built-in. Because there are a bunch of users which need this and instead
of complicating this config option with a bunch of dependencies, we can
just as well have it always on.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-21 8:29 ` Borislav Petkov
0 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-21 8:29 UTC (permalink / raw)
To: Chao Fan
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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)
> {
> return boot_params->acpi_rsdp_addr;
> }
Why do you need that silly wrapper?
> static acpi_physical_address get_rsdp_addr(void)
> {
> bool boot_params_rsdp_exist;
What's that bool supposed to do?
> acpi_physical_address pa;
>
> pa = get_acpi_rsdp();
>
> if (!pa)
> pa = get_boot_params_rsdp();
>
> if (!pa) {
> pa = efi_get_rsdp_addr();
> boot_params_rsdp_exist = false;
> }
> else
> boot_params_rsdp_exist = true;
>
> if (!pa)
> pa = bios_get_rsdp_addr();
>
> if (pa && !boot_params_rsdp_exist)
> boot_params.acpi_rsdp_addr = pa;
>
> return pa;
> }
>
> At the same time, I notice kernel only parses it when
> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
> update the define of EARLY_SRAT_PARSE:
>
> config EARLY_SRAT_PARSE
> bool "EARLY SRAT parsing"
> def_bool y
> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
Actually, you don't need that anymore - make it unconditionally
built-in. Because there are a bunch of users which need this and instead
of complicating this config option with a bunch of dependencies, we can
just as well have it always on.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-21 8:29 ` Borislav Petkov
@ 2019-01-21 8:43 ` Chao Fan
-1 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-21 8:43 UTC (permalink / raw)
To: Borislav Petkov
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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 inline acpi_physical_address get_boot_params_rsdp(void)
>> {
>> return boot_params->acpi_rsdp_addr;
>> }
>
>Why do you need that silly wrapper?
Will drop it.
>
>> static acpi_physical_address get_rsdp_addr(void)
>> {
>> bool boot_params_rsdp_exist;
>
>What's that bool supposed to do?
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 boot_params->acpi_rsdp_addr.
>
>> acpi_physical_address pa;
>>
>> pa = get_acpi_rsdp();
>>
>> if (!pa)
>> pa = get_boot_params_rsdp();
>>
>> if (!pa) {
>> pa = efi_get_rsdp_addr();
>> boot_params_rsdp_exist = false;
>> }
>> else
>> boot_params_rsdp_exist = true;
>>
>> if (!pa)
>> pa = bios_get_rsdp_addr();
>>
>> if (pa && !boot_params_rsdp_exist)
>> boot_params.acpi_rsdp_addr = pa;
>>
>> return pa;
>> }
>>
>> At the same time, I notice kernel only parses it when
>> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
>> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
>> update the define of EARLY_SRAT_PARSE:
>>
>> config EARLY_SRAT_PARSE
>> bool "EARLY SRAT parsing"
>> def_bool y
>> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
>
>Actually, you don't need that anymore - make it unconditionally
>built-in. Because there are a bunch of users which need this and instead
>of complicating this config option with a bunch of dependencies, we can
>just as well have it always on.
If I need to fill boot_params->acpi_rsdp_addr, I think we can make it
unconditionally built-in.
Thanks,
Chao Fan
>
>Thx.
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-21 8:43 ` Chao Fan
0 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-21 8:43 UTC (permalink / raw)
To: Borislav Petkov
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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 inline acpi_physical_address get_boot_params_rsdp(void)
>> {
>> return boot_params->acpi_rsdp_addr;
>> }
>
>Why do you need that silly wrapper?
Will drop it.
>
>> static acpi_physical_address get_rsdp_addr(void)
>> {
>> bool boot_params_rsdp_exist;
>
>What's that bool supposed to do?
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 boot_params->acpi_rsdp_addr.
>
>> acpi_physical_address pa;
>>
>> pa = get_acpi_rsdp();
>>
>> if (!pa)
>> pa = get_boot_params_rsdp();
>>
>> if (!pa) {
>> pa = efi_get_rsdp_addr();
>> boot_params_rsdp_exist = false;
>> }
>> else
>> boot_params_rsdp_exist = true;
>>
>> if (!pa)
>> pa = bios_get_rsdp_addr();
>>
>> if (pa && !boot_params_rsdp_exist)
>> boot_params.acpi_rsdp_addr = pa;
>>
>> return pa;
>> }
>>
>> At the same time, I notice kernel only parses it when
>> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
>> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
>> update the define of EARLY_SRAT_PARSE:
>>
>> config EARLY_SRAT_PARSE
>> bool "EARLY SRAT parsing"
>> def_bool y
>> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
>
>Actually, you don't need that anymore - make it unconditionally
>built-in. Because there are a bunch of users which need this and instead
>of complicating this config option with a bunch of dependencies, we can
>just as well have it always on.
If I need to fill boot_params->acpi_rsdp_addr, I think we can make it
unconditionally built-in.
Thanks,
Chao Fan
>
>Thx.
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-21 8:43 ` Chao Fan
@ 2019-01-21 9:19 ` Borislav Petkov
-1 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-21 9:19 UTC (permalink / raw)
To: Chao Fan
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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 boot_params->acpi_rsdp_addr.
And you can't simply do:
if (boot_params.acpi_rsdp_addr)
return;
at the beginning of that function?
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-21 9:19 ` Borislav Petkov
0 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-21 9:19 UTC (permalink / raw)
To: Chao Fan
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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 boot_params->acpi_rsdp_addr.
And you can't simply do:
if (boot_params.acpi_rsdp_addr)
return;
at the beginning of that function?
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-21 8:29 ` Borislav Petkov
@ 2019-01-22 3:32 ` Chao Fan
-1 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-22 3:32 UTC (permalink / raw)
To: Borislav Petkov
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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 inline acpi_physical_address get_boot_params_rsdp(void)
>> {
>> return boot_params->acpi_rsdp_addr;
>> }
>
>Why do you need that silly wrapper?
>
>> static acpi_physical_address get_rsdp_addr(void)
>> {
>> bool boot_params_rsdp_exist;
>
>What's that bool supposed to do?
>
>> acpi_physical_address pa;
>>
>> pa = get_acpi_rsdp();
>>
>> if (!pa)
>> pa = get_boot_params_rsdp();
>>
>> if (!pa) {
>> pa = efi_get_rsdp_addr();
>> boot_params_rsdp_exist = false;
>> }
>> else
>> boot_params_rsdp_exist = true;
>>
>> if (!pa)
>> pa = bios_get_rsdp_addr();
>>
>> if (pa && !boot_params_rsdp_exist)
>> boot_params.acpi_rsdp_addr = pa;
>>
>> return pa;
>> }
>>
>> At the same time, I notice kernel only parses it when
>> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
>> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
>> update the define of EARLY_SRAT_PARSE:
>>
>> config EARLY_SRAT_PARSE
>> bool "EARLY SRAT parsing"
>> def_bool y
>> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
>
>Actually, you don't need that anymore - make it unconditionally
>built-in. Because there are a bunch of users which need this and instead
>of complicating this config option with a bunch of dependencies, we can
>just as well have it always on.
According to your reply, I change it as:
vmlinux-objs-y += $(obj)/acpi.o
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
Thanks,
Chao Fan
>
>Thx.
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-22 3:32 ` Chao Fan
0 siblings, 0 replies; 50+ messages in thread
From: Chao Fan @ 2019-01-22 3:32 UTC (permalink / raw)
To: Borislav Petkov
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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 inline acpi_physical_address get_boot_params_rsdp(void)
>> {
>> return boot_params->acpi_rsdp_addr;
>> }
>
>Why do you need that silly wrapper?
>
>> static acpi_physical_address get_rsdp_addr(void)
>> {
>> bool boot_params_rsdp_exist;
>
>What's that bool supposed to do?
>
>> acpi_physical_address pa;
>>
>> pa = get_acpi_rsdp();
>>
>> if (!pa)
>> pa = get_boot_params_rsdp();
>>
>> if (!pa) {
>> pa = efi_get_rsdp_addr();
>> boot_params_rsdp_exist = false;
>> }
>> else
>> boot_params_rsdp_exist = true;
>>
>> if (!pa)
>> pa = bios_get_rsdp_addr();
>>
>> if (pa && !boot_params_rsdp_exist)
>> boot_params.acpi_rsdp_addr = pa;
>>
>> return pa;
>> }
>>
>> At the same time, I notice kernel only parses it when
>> "#ifdef CONFIG_ACPI", we should keep sync with kernel, but I think
>> we are parsing SRAT, CONFIG_ACPI is needed sure, so I am going to
>> update the define of EARLY_SRAT_PARSE:
>>
>> config EARLY_SRAT_PARSE
>> bool "EARLY SRAT parsing"
>> def_bool y
>> depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
>
>Actually, you don't need that anymore - make it unconditionally
>built-in. Because there are a bunch of users which need this and instead
>of complicating this config option with a bunch of dependencies, we can
>just as well have it always on.
According to your reply, I change it as:
vmlinux-objs-y += $(obj)/acpi.o
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
Thanks,
Chao Fan
>
>Thx.
>
>--
>Regards/Gruss,
> Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
2019-01-22 3:32 ` Chao Fan
@ 2019-01-22 12:17 ` Borislav Petkov
-1 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-22 12:17 UTC (permalink / raw)
To: Chao Fan
Cc: rafael.j.wysocki, Kairui Song, Baoquan He, erik.schmauss, x86,
kexec, linux-kernel, robert.moore, mingo, hpa, tglx, Dave Young,
akpm, Len Brown
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 do
with CONFIG_RANDOMIZE_BASE but wants RDSP too.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH v2 2/2] x86, kexec_file_load: make it work with efi=noruntime or efi=old_map
@ 2019-01-22 12:17 ` Borislav Petkov
0 siblings, 0 replies; 50+ messages in thread
From: Borislav Petkov @ 2019-01-22 12:17 UTC (permalink / raw)
To: Chao Fan
Cc: Kairui Song, linux-kernel, tglx, mingo, hpa, x86, Dave Young,
Baoquan He, kexec, akpm, robert.moore, erik.schmauss,
rafael.j.wysocki, Len Brown
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 do
with CONFIG_RANDOMIZE_BASE but wants RDSP too.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 50+ messages in thread