firmware: dmi_scan: Make it work in kexec'ed kernel
Subsystems (6)
cover firmware: dmi_scan: Make it work in kexec'ed kernel
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Andy Shevchenko (2):
firmware: dmi_scan: Split out dmi_get_entry_point() helper
firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Documentation/admin-guide/kernel-parameters.txt | 5 +++ drivers/firmware/dmi_scan.c | 49 +++++++++++++++---------- 2 files changed, 35 insertions(+), 19 deletions(-)
Signature · 1 line
2.10.2
PATCH 1/2 firmware: dmi_scan: Split out dmi_get_entry_point() helper
This is preparatory patch to pass DMI entry point to kexec'ed kernel.
--- drivers/firmware/dmi_scan.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/firmware/dmi_scan.c +17 -20
@@ -595,11 +595,8 @@ static int __init dmi_smbios3_present(const u8 *buf)return 1 ; } -void __init dmi_scan_machine (void ) +static resource_size_t __init dmi_get_entry_point (void ) { -char __iomem *p, *q; -char buf[32 ]; -if (efi_enabled (EFI_CONFIG_TABLES )) {/* * According to the DMTF SMBIOS reference spec v3.0.0, it is
@@ -614,32 +611,32 @@ void __init dmi_scan_machine(void)* have the 64-bit entry point, but fail to decode it, fall * back to the legacy one (if available) */ -if (efi.smbios3 !=EFI_INVALID_TABLE_ADDR ) { - p =dmi_early_remap (efi.smbios3,32 ); -if (p ==NULL ) - goto error; -memcpy_fromio (buf, p,32 ); -dmi_early_unmap (p,32 ); - -if (!dmi_smbios3_present (buf)) { - dmi_available =1 ; - goto out; - } - } -if (efi.smbios ==EFI_INVALID_TABLE_ADDR ) - goto error; +if (efi.smbios3 !=EFI_INVALID_TABLE_ADDR ) +return efi.smbios3; +if (efi.smbios !=EFI_INVALID_TABLE_ADDR ) +return efi.smbios; + } +return 0 ; +} + +void __init dmi_scan_machine (void ) +{ +resource_size_t ep =dmi_get_entry_point (); +char __iomem *p, *q; +char buf[32 ]; +if (ep) {/* This is called as a core_initcall() because it isn't * needed during early boot. This also means we can * iounmap the space when we're done with it. */ - p =dmi_early_remap (efi.smbios,32 ); + p =dmi_early_remap (ep,32 );if (p ==NULL ) goto error;memcpy_fromio (buf, p,32 );dmi_early_unmap (p,32 ); -if (!dmi_present (buf)) { +if (!dmi_smbios3_present (buf) || !dmi_present (buf)) { dmi_available =1 ; goto out; }
Signature · 1 line
2.10.2
Re: [PATCH v1 1/2] firmware: dmi_scan: Split out dmi_get_entry_point() helper
Hi Andy,
Quoted 1 line · Andy Shevchenko
This is preparatory patch to pass DMI entry point to kexec'ed kernel.
You are doing more than that. You are actually changing the logic. There is this comment in the code:
* [...] If we
* have the 64-bit entry point, but fail to decode it, fall
* back to the legacy one (if available)
The original code was doing that, but your code does not. You will select one entry point, try to decode it, and if it fails, there is no fallback. dmi_present(buf) is not realistically going to succeed in decoding an SMBIOS 3 entry point, just like dmi_smbios3_present(buf) has zero chance of success on an SMBIOS 2 entry point. This is merely wasting CPU cycles without actually providing a fallback solution.
It can be discussed whether this fallback mechanism is mandatory to keep, but dropping it silently as part of refactoring and leaving the comment in is not OK.
Quoted 10 lines
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/firmware/dmi_scan.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-)drivers/firmware/dmi_scan.c +0
-0
drivers/firmware/dmi_scan.c static int __init dmi_smbios3_present(const u8 *buf) · line 598
Quoted 5 lines
drivers/firmware/dmi_scan.c +1
-1@@ -595,11 +595,8 @@ static int __init dmi_smbios3_present(const u8 *buf)return 1 ; } -void __init dmi_scan_machine (void ) +static resource_size_t __init dmi_get_entry_point (void )
I would like this function to have "efi" in its name, as it is EFI-specific.
Quoted 26 lines
drivers/firmware/dmi_scan.c +1
-17{ -char __iomem *p, *q; -char buf[32 ]; -if (efi_enabled (EFI_CONFIG_TABLES )) {/* * According to the DMTF SMBIOS reference spec v3.0.0, it is @@ -614,32 +611,32 @@ void __init dmi_scan_machine(void)* have the 64-bit entry point, but fail to decode it, fall * back to the legacy one (if available) */ -if (efi.smbios3 !=EFI_INVALID_TABLE_ADDR ) { - p =dmi_early_remap (efi.smbios3,32 ); -if (p ==NULL ) - goto error; -memcpy_fromio (buf, p,32 ); -dmi_early_unmap (p,32 ); - -if (!dmi_smbios3_present (buf)) { - dmi_available =1 ; - goto out; - } - } -if (efi.smbios ==EFI_INVALID_TABLE_ADDR ) - goto error; +if (efi.smbios3 !=EFI_INVALID_TABLE_ADDR )
drivers/firmware/dmi_scan.c void __init dmi_scan_machine(void) · line 624
Quoted 10 lines
drivers/firmware/dmi_scan.c +10
-0+return efi.smbios3; +if (efi.smbios !=EFI_INVALID_TABLE_ADDR ) +return efi.smbios; + } +return 0 ; +} + +void __init dmi_scan_machine (void ) +{ +resource_size_t ep =dmi_get_entry_point ();
Likewise, this variable should have "efi" in its name.
Quoted 20 lines
drivers/firmware/dmi_scan.c +5
-2+char __iomem *p, *q; +char buf[32 ]; +if (ep) {/* This is called as a core_initcall() because it isn't * needed during early boot. This also means we can * iounmap the space when we're done with it. */ - p =dmi_early_remap (efi.smbios,32 ); + p =dmi_early_remap (ep,32 );if (p ==NULL ) goto error;memcpy_fromio (buf, p,32 );dmi_early_unmap (p,32 ); -if (!dmi_present (buf)) { +if (!dmi_smbios3_present (buf) || !dmi_present (buf)) { dmi_available =1 ; goto out; }
Signature · 2 lines
Jean Delvare SUSE L3 Support
PATCH 2/2 firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
In reply to Andy ShevchenkoUntil now kexec'ed kernel has no clue where to look for DMI entry point.
Pass it via kernel command line parameter in the same way as it's done for ACPI RSDP.
--- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ drivers/firmware/dmi_scan.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +5 -0
@@ -843,6 +843,11 @@ The filter can be disabled or changed to another driver later using sysfs. + dmi_entry_point= [DMI,EFI,KEXEC] + Pass the DMI entry point to the kernel, mostly used + on machines running EFI runtime service to boot the + second kernel for kdump. + drm_kms_helper.edid_firmware=[<connector>:]<file>[,[<connector>:]<file>] Broken monitors, graphic adapters, KVMs and EDIDless panels may send no or incorrect EDID data sets.
drivers/firmware/dmi_scan.c +14 -0
@@ -595,8 +595,22 @@ static int __init dmi_smbios3_present(const u8 *buf)return 1 ; } +#ifdef CONFIG_KEXEC +static unsigned long dmi_entry_point; +static int __init setup_dmi_entry_point (char *arg) +{ +return kstrtoul (arg,16 , &dmi_entry_point); +} +early_param ("dmi_entry_point" , setup_dmi_entry_point); +#endif +static resource_size_t __init dmi_get_entry_point (void ) { +#ifdef CONFIG_KEXEC +if (dmi_entry_point) +return dmi_entry_point; +#endif +if (efi_enabled (EFI_CONFIG_TABLES )) {/* * According to the DMTF SMBIOS reference spec v3.0.0, it is
Signature · 1 line
2.10.2
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Hi Andy,
Quoted 4 lines · Andy Shevchenko
Until now kexec'ed kernel has no clue where to look for DMI entry point.
Pass it via kernel command line parameter in the same way as it's done for ACPI RSDP.
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Adding Eric to Cc for his opinion.
Quoted 50 lines
Signed-off-by Andy Shevchenko <[email protected]>--- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ drivers/firmware/dmi_scan.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+)Documentation/admin-guide/kernel-parameters.txt +5
-0@@ -843,6 +843,11 @@ The filter can be disabled or changed to another driver later using sysfs. + dmi_entry_point= [DMI,EFI,KEXEC] + Pass the DMI entry point to the kernel, mostly used + on machines running EFI runtime service to boot the + second kernel for kdump. + drm_kms_helper.edid_firmware=[<connector>:]<file>[,[<connector>:]<file>] Broken monitors, graphic adapters, KVMs and EDIDless panels may send no or incorrect EDID data sets.drivers/firmware/dmi_scan.c +14
-0@@ -595,8 +595,22 @@ static int __init dmi_smbios3_present(const u8 *buf)return 1 ; } +#ifdef CONFIG_KEXEC +static unsigned long dmi_entry_point; +static int __init setup_dmi_entry_point (char *arg) +{ +return kstrtoul (arg,16 , &dmi_entry_point); +} +early_param ("dmi_entry_point" , setup_dmi_entry_point); +#endif +static resource_size_t __init dmi_get_entry_point (void ) { +#ifdef CONFIG_KEXEC +if (dmi_entry_point) +return dmi_entry_point; +#endif +if (efi_enabled (EFI_CONFIG_TABLES )) {/* * According to the DMTF SMBIOS reference spec v3.0.0, it is
Signature · 2 lines
Jean Delvare SUSE L3 Support
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 5 lines · Jean Delvare
Hi Andy,
Quoted 2 lines · Andy Shevchenko
Until now kexec'ed kernel has no clue where to look for DMI entry point.
Quoted 8 lines
Quoted 2 lines
Pass it via kernel command line parameter in the same way as it's done for ACPI RSDP.
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in x86_64.
Is there any test log with latest mainline kernel about this?
Quoted 45 lines
Adding Eric to Cc for his opinion.
Quoted 42 lines
Signed-off-by Andy Shevchenko <[email protected]>--- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ drivers/firmware/dmi_scan.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+)Documentation/admin-guide/kernel-parameters.txt +5
-0@@ -843,6 +843,11 @@ The filter can be disabled or changed to another driver later using sysfs. + dmi_entry_point= [DMI,EFI,KEXEC] + Pass the DMI entry point to the kernel, mostly used + on machines running EFI runtime service to boot the + second kernel for kdump. + drm_kms_helper.edid_firmware=[<connector>:]<file>[,[<connector>:]<file>] Broken monitors, graphic adapters, KVMs and EDIDless panels may send no or incorrect EDID data sets.drivers/firmware/dmi_scan.c +9
-0@@ -595,8 +595,22 @@ static int __init dmi_smbios3_present(const u8 *buf)return 1 ; } +#ifdef CONFIG_KEXEC +static unsigned long dmi_entry_point; +static int __init setup_dmi_entry_point (char *arg) +{ +return kstrtoul (arg,16 , &dmi_entry_point); +} +early_param ("dmi_entry_point" , setup_dmi_entry_point); +#endif +static resource_size_t __init dmi_get_entry_point (void ) {
Quoted 18 lines
Quoted 8 lines
drivers/firmware/dmi_scan.c +5
-0+#ifdef CONFIG_KEXEC +if (dmi_entry_point) +return dmi_entry_point; +#endif +if (efi_enabled (EFI_CONFIG_TABLES )) {/* * According to the DMTF SMBIOS reference spec v3.0.0, it is Signature · 7 lines
Jean Delvare SUSE L3 Support _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 18 lines · Dave Young
Quoted 10 lines · Jean Delvare
Hi Andy,
Quoted 6 lines · Andy Shevchenko
Until now kexec'ed kernel has no clue where to look for DMI entry point.
Pass it via kernel command line parameter in the same way as it's done for ACPI
RSDP.Quoted 6 lines
I am no kexec expert but this confuses me. Shouldn't the second kernel
have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.
Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for X86_64 then maybe it can be generalized to X86?
Signature · 2 lines
Jean Delvare SUSE L3 Support
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?
For X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as the X86_64 since the virtual address space is limited.
But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Thanks
Dave
Quoted 4 lines
Signature · 3 lines
-- Jean Delvare SUSE L3 Support
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 19 lines · Dave Young
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?
Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Sorry for a delay.
Eventually I found time to check this.
Unfortunately the efi=noruntime didn't help:
# uname -a Linux buildroot 5.3.0-rc7+ #17 Thu Sep 5 16:08:22 EEST 2019 i586 GNU/Linux # dmidecode # dmidecode 4.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry. # # cat /proc/cmdline ... ignore_loglevel efi=noruntime earlycon=efifb acpi_rsdp=0xf01e014
So, I am all ears to anything else to try.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
In reply to Dave YoungQuoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?
Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Can we apply these patches for now until you will find better solution?
P.S. I may resend them rebased on recent vanilla.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 30 lines · Andy Shevchenko
Quoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Quoted 6 lines
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
Adding a command line option won't fix stomped tables.
So what I would suggest is:
a) Verify that dmidecode works before kexec.
b) Test to see if dmidecode works after kexec.
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
Now using a non-efi method of dmi detection relies on the tables being between 0xF0000 and 0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's. So if that doesn't work on Intel Galileo that is probably a firmware problem.
Eric
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 4 lines · Eric W. Biederman
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
That must have been long ago. A recent version of dmidecode (>= 3.0) running on a recent kernel
(>= d7f96f97c4031fa4ffdb7801f9aae23e96170a6f, v4.2) will read the DMI data from /sys/firmware/dmi/tables, so it is very much relying on the kernel doing the right thing. If not, it will still try to fallback to reading from /dev/mem directly on certain architectures. You can force that old method with --no-sysfs.
Hope that helps,
Signature · 2 lines
Jean Delvare SUSE L3 Support
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 15 lines · Jean Delvare
Quoted 4 lines · Eric W. Biederman
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
That must have been long ago. A recent version of dmidecode (>= 3.0) running on a recent kernel
(>=d7f96f97c4031fa4ffdb7801f9aae23e96170a6f, v4.2) will read the DMI data from/sys/firmware/dmi/tables, so it is very much relying on the kernel doing the right thing. If not, it will still try to fallback to reading from/dev/memdirectly on certain architectures. You can force that old method with --no-sysfs.
Quoted 1 line
Hope that helps,
I don't understand how it possible can help for in-kernel code, like DMI quirks in a drivers.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Jean Delvare
Quoted 4 lines · Eric W. Biederman
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
That must have been long ago. A recent version of dmidecode (>= 3.0) running on a recent kernel
(>=d7f96f97c4031fa4ffdb7801f9aae23e96170a6f, v4.2) will read the DMI data from/sys/firmware/dmi/tables, so it is very much relying on the kernel doing the right thing. If not, it will still try to fallback to reading from/dev/memdirectly on certain architectures. You can force that old method with --no-sysfs.
Quoted 4 lines
Quoted 1 line
Hope that helps,
I don't understand how it possible can help for in-kernel code, like DMI quirks in a drivers.
OK, just ignore me then, probably I misunderstood the point made by Eric.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 17 lines · Jean Delvare
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Jean Delvare
Quoted 4 lines · Eric W. Biederman
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
That must have been long ago. A recent version of dmidecode (>= 3.0) running on a recent kernel
(>=d7f96f97c4031fa4ffdb7801f9aae23e96170a6f, v4.2) will read the DMI data from/sys/firmware/dmi/tables, so it is very much relying on the kernel doing the right thing. If not, it will still try to fallback to reading from/dev/memdirectly on certain architectures. You can force that old method with --no-sysfs.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Hope that helps,
I don't understand how it possible can help for in-kernel code, like DMI quirks in a drivers.
OK, just ignore me then, probably I misunderstood the point made by Eric.
No. I just haven't dived into this area of code in a long time.
It seems a little indirect to use dmidecode as the test to see if the kernel has the pointer to the dmitables, but with the knowledge you provided it seems like a perfectly valid test.
Eric
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 24 lines · Eric W. Biederman
Quoted 22 lines · Jean Delvare
Quoted 20 lines · Andy Shevchenko
Quoted 15 lines · Jean Delvare
Quoted 4 lines · Eric W. Biederman
Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
That must have been long ago. A recent version of dmidecode (>= 3.0) running on a recent kernel
(>=d7f96f97c4031fa4ffdb7801f9aae23e96170a6f, v4.2) will read the DMI data from/sys/firmware/dmi/tables, so it is very much relying on the kernel doing the right thing. If not, it will still try to fallback to reading from/dev/memdirectly on certain architectures. You can force that old method with --no-sysfs.Quoted 1 line
Hope that helps,
I don't understand how it possible can help for in-kernel code, like DMI quirks in a drivers.
Quoted 8 lines
Quoted 2 lines
OK, just ignore me then, probably I misunderstood the point made by Eric.
No. I just haven't dived into this area of code in a long time.
It seems a little indirect to use dmidecode as the test to see if the kernel has the pointer to the dmitables, but with the knowledge you provided it seems like a perfectly valid test.
In any case that doesn't work. See my response to Ard.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
In reply to Eric W. BiedermanQuoted 35 lines · Eric W. Biederman
Quoted 34 lines · Andy Shevchenko
Quoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)
Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.
Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.
Does the
commit 4996c02306a25def1d352ec8e8f48895bbc7dea9
Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400
ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.
# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
=== with patch applied ===
# dmidecode
...
Release Date: 03/10/2015
...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 119 lines · Andy Shevchenko
Quoted 35 lines · Eric W. Biederman
Quoted 34 lines · Andy Shevchenko
Quoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 4 lines · Ard Biesheuvel
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Eric W. Biederman
Quoted 1 line · Andy Shevchenko
On Sat, Dec 17, 2016 at 06:57:21PM +0800, Dave Young wrote:
...
Quoted 91 lines
Quoted 82 lines
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Quoted 7 lines
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
On Microsoft Surface 3 tablet:
=== First kernel ===
# uname -a
(Previously reported issue on)
Linux buildroot 4.13.0+ #39 SMP Tue Sep 5 14:58:23 EEST 2017 x86_64 GNU/Linux
(Updated today to)
Linux buildroot 5.4.0+ #2 SMP Tue Nov 26 15:36:31 EET 2019 x86_64 GNU/Linux
# ls -l /sys/firmware/dmi/tables/ total 0 -r-------- 1 root root 825 Jan 21 15:41 DMI -r-------- 1 root root 31 Jan 21 15:41 smbios_entry_point
# od -Ax -tx1 /sys/firmware/dmi/tables/smbios_entry_point 000000 5f 53 4d 5f 0f 1f 02 08 6a 00 00 00 00 00 00 00 000010 5f 44 4d 49 5f e0 39 03 00 40 5b 7b 0f 00 27 00001f
# dmesg | grep -i dmi [ 0.000000] DMI: Microsoft Corporation Surface 3/Surface 3, BIOS 1.50410.78 03/10/2015 [ 0.403058] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
# dmesg | grep -i smb [ 0.000000] efi: ESRT=0x7b7c6c98 ACPI=0x7ad5a000 ACPI 2.0=0x7ad5a000 SMBIOS=0x7b5f7d18 [ 0.000000] SMBIOS 2.8 present.
=== kexec'ed kernel ===
# uname -a (in both cases, see above `uname -a`, the same version) Linux buildroot 5.5.0-rc7+ #161 SMP Tue Jan 21 15:50:02 EET 2020 x86_64 GNU/Linux
# dmidecode # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 147 lines · Andy Shevchenko
Quoted 4 lines · Ard Biesheuvel
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Eric W. Biederman
Quoted 1 line · Andy Shevchenko
On Sat, Dec 17, 2016 at 06:57:21PM +0800, Dave Young wrote:
...
Quoted 91 lines
Quoted 82 lines
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Quoted 7 lines
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
On Microsoft Surface 3 tablet:
=== First kernel ===
# uname -a(Previously reported issue on)
Linux buildroot 4.13.0+ #39 SMP Tue Sep 5 14:58:23 EEST 2017x86_64GNU/Linux(Updated today to)
Linux buildroot 5.4.0+ #2 SMP Tue Nov 26 15:36:31 EET 2019x86_64GNU/Linux# ls -l /sys/firmware/dmi/tables/ total 0(quoted diff) +0
-2-r-------- 1 root root 825 Jan 21 15:41 DMI -r-------- 1 root root 31 Jan 21 15:41 smbios_entry_point# od -Ax -tx1 /sys/firmware/dmi/tables/smbios_entry_point 000000 5f 53 4d 5f 0f 1f 02 08 6a 00 00 00 00 00 00 00 000010 5f 44 4d 49 5f e0 39 03 00 40 5b 7b 0f 00 27 00001f# dmesg | grep -i dmi [ 0.000000] DMI: Microsoft Corporation Surface 3/Surface 3, BIOS 1.50410.78 03/10/2015 [ 0.403058] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)# dmesg | grep -i smb [ 0.000000] efi: ESRT=0x7b7c6c98 ACPI=0x7ad5a000 ACPI 2.0=0x7ad5a000 SMBIOS=0x7b5f7d18 [ 0.000000] SMBIOS 2.8 present.=== kexec'ed kernel ===
# uname -a (in both cases, see above `uname -a`, the same version) Linux buildroot 5.5.0-rc7+ #161 SMP Tue Jan 21 15:50:02 EET 2020 x86_64 GNU/Linux# dmidecode # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
Quoted 4 lines
# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
This sounds like at least something of a different issue, with similar symptoms.
I don't think it is fundamentally wrong to pass the location of the dmi tables in a command line option. If you can build that command line option independent of kexec and it takes practically no maintenance then it does not harm, and can be used as a debug option by others.
My primary concern with your original patch is because it did not apply to any version of the kernel in Linus's git tree that it had not been tested on any code.
That said let me lay some background on kexec and efi so we can have a productive conversation about how to maintain their cooperation in the long term. I am going to do this from memory so please forgive me where I get my details slightly off.
EFI has two interesting calls for an operating system.
SetVirtualMap
ExitBootServices
The law of large numbers strongly suggests that when it comes to emperical testing any interface that is not so heavily used it will fail to boot all operating systems if it doesn't work will have at least one broken implementation somewhere. A bug so bad nothing can boot means the hardware is unshippable and so will not be seen in the wild. As firmware is essentially fixed once a machine ships this means that all firmware problems have to be dealt with by the boot loader and the operating system.
SetVirtualMap by design can be called only once, which is problematic when you are switching operating systems on a running system (kexec). Last I was paying attention there were also systems discovered that won't work if SetVirtualMap is not called at all. I believe the solution adopted for x86_64 was to always map EFI at the same location in the page tables and only call SetVirtualMap the first time.
ExitBootSerives is similarly challenging as it can only be called once, and there are systems that get it wrong if you call it at all. Even if ExitBootServices works you can't depend on any of the boot services for the second kernel.
There are two primary uses for kexec. To use the first kernel as a boot loader in which case it is desiable for everything to work after kexec is called. To use the second kernel as something to capture a crash dump in which case simply a best effor is needed and failing cleanly if something won't work properly.
You are running interactive commands so I presume you are wanting to use kexec as a bootloader.
I don't know where things are now but for a while was no desire to address the concerns of people using kexec by the folks implementing EFI or the folks implementing EFI support in the kernel. But that is probably how we got into a situation where efi support does not work cleanly.
EFI choosing to place firwmare tables in somewhere besides their architecturally defined location does not help.
I don't practically have a system with EFI so I have not personally cared to fix any of the problems.
My sense is that for making EFI calls from any linux kernel should be isolated in it's own page table, so isolate as much as possible any EFI bugs from the rest of the kernel. That is probably also needed to provide a guard against speculative execution side channel attacks.
I can see doing some work to get EFI functional after kexec if it isn't but at the same time I am not a fan of performing any unnecessary firmware calls. Someone sometime will implement one wrong, and it will be a headache for everyone until it is removed.
By the same token I don't understand the problem with DMI not working. As I recall all the linux kernel really uses DMI for is to decide which quirks to apply. It might be better just to pass a board name string on the kernel command line, and use that string for quirk selection instead. A simple string seems like an easy to implement and use debug command line option, that has uses outside of kexec. AKA testing to see if quirks do what you expect them too.
Which brings us to the question of quirks. Why are quirks important? If they are that suggests something else is wrong. Maybe that something else should be fixed.
Why do those boards need the DMI information in the first place?
Eric
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Quoted 6 lines · Eric W. Biederman
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Ard Biesheuvel
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Eric W. Biederman
Quoted 1 line · Andy Shevchenko
On Sat, Dec 17, 2016 at 06:57:21PM +0800, Dave Young wrote:
...
Quoted 147 lines
Quoted 139 lines
Quoted 91 lines
Quoted 82 lines
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Quoted 7 lines
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
On Microsoft Surface 3 tablet:
=== First kernel ===
# uname -a(Previously reported issue on)
Linux buildroot 4.13.0+ #39 SMP Tue Sep 5 14:58:23 EEST 2017x86_64GNU/Linux(Updated today to)
Linux buildroot 5.4.0+ #2 SMP Tue Nov 26 15:36:31 EET 2019x86_64GNU/Linux# ls -l /sys/firmware/dmi/tables/ total 0(quoted diff) +0
-2-r-------- 1 root root 825 Jan 21 15:41 DMI -r-------- 1 root root 31 Jan 21 15:41 smbios_entry_point# od -Ax -tx1 /sys/firmware/dmi/tables/smbios_entry_point 000000 5f 53 4d 5f 0f 1f 02 08 6a 00 00 00 00 00 00 00 000010 5f 44 4d 49 5f e0 39 03 00 40 5b 7b 0f 00 27 00001f# dmesg | grep -i dmi [ 0.000000] DMI: Microsoft Corporation Surface 3/Surface 3, BIOS 1.50410.78 03/10/2015 [ 0.403058] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)# dmesg | grep -i smb [ 0.000000] efi: ESRT=0x7b7c6c98 ACPI=0x7ad5a000 ACPI 2.0=0x7ad5a000 SMBIOS=0x7b5f7d18 [ 0.000000] SMBIOS 2.8 present.=== kexec'ed kernel ===
# uname -a (in both cases, see above `uname -a`, the same version) Linux buildroot 5.5.0-rc7+ #161 SMP Tue Jan 21 15:50:02 EET 2020 x86_64 GNU/Linux# dmidecode # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.Quoted 4 lines
# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.This sounds like at least something of a different issue, with similar symptoms.
Quoted 8 lines
I don't think it is fundamentally wrong to pass the location of the dmi tables in a command line option. If you can build that command line option independent of kexec and it takes practically no maintenance then it does not harm, and can be used as a debug option by others.
My primary concern with your original patch is because it did not apply to any version of the kernel in Linus's git tree that it had not been tested on any code.
As I have told couple of times there is no issue for me to rebase on any subsytem tree. Do you want EFI one as a base?
Quoted 4 lines
That said let me lay some background on kexec and efi so we can have a productive conversation about how to maintain their cooperation in the long term. I am going to do this from memory so please forgive me where I get my details slightly off.
Thank you for that, but as far as I'm concerned those calls are not significant in the second kernel for my test purposes. Basically the issue is to supply DMI information, which is static, to the second kernel.
...
Quoted 4 lines
ExitBootSerives is similarly challenging as it can only be called once, and there are systems that get it wrong if you call it at all. Even if ExitBootServices works you can't depend on any of the boot services for the second kernel.
And I do not need. At least I haven't (yet?) found an issue with that.
...
Quoted 8 lines
There are two primary uses for kexec. To use the first kernel as a boot loader in which case it is desiable for everything to work after kexec is called. To use the second kernel as something to capture a crash dump in which case simply a best effor is needed and failing cleanly if something won't work properly.
You are running interactive commands so I presume you are wanting to use kexec as a bootloader.
We are using kexec to run kernel over network. That's how our (local) lab infrastructure looks like. Basically what we need is to be able to test drivers on SUT as a primary concern here.
...
Quoted 3 lines
By the same token I don't understand the problem with DMI not working. As I recall all the linux kernel really uses DMI for is to decide which quirks to apply.
Yes, that's usual (historical) way for quirks on x86.
Quoted 5 lines
It might be better just to pass a board name string
on the kernel command line, and use that string for quirk selection instead. A simple string seems like an easy to implement and use debug command line option, that has uses outside of kexec. AKA testing to see if quirks do what you expect them too.
Huh?! No way, we have a (1st) kernel platform agnostic. This will make it board dependent. Moreover, second kernel needs to be *heavily* patched for this. It's way to nowhere.
Quoted 5 lines
Which brings us to the question of quirks. Why are quirks important? If they are that suggests something else is wrong. Maybe that something else should be fixed.
Why do those boards need the DMI information in the first place?
I didn't get a sarcasm in above few paragraphs, but we are living in ideal world, you know...
So, I will rebase and submit a new version of the series with extended commit message. Problem is there and should be addressed.
Thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
In reply to Ard BiesheuvelQuoted 129 lines · Ard Biesheuvel
Quoted 119 lines · Andy Shevchenko
Quoted 35 lines · Eric W. Biederman
Quoted 34 lines · Andy Shevchenko
Quoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Quoted 7 lines
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
Can you tell how to do this and I will try to get information?
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
Fixed Ard's address
Quoted 145 lines · Andy Shevchenko
Quoted 129 lines · Ard Biesheuvel
Quoted 119 lines · Andy Shevchenko
Quoted 35 lines · Eric W. Biederman
Quoted 34 lines · Andy Shevchenko
Quoted 21 lines · Dave Young
Ccing efi people.
Quoted 9 lines · Jean Delvare
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Dave Young
Quoted 5 lines · Jean Delvare
I am no kexec expert but this confuses me. Shouldn't the second kernel have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
If it was done for
X86_64then maybe it can be generalized to X86?Quoted 7 lines
For
X86_64, we have a new way for efi runtime memmory mapping, in i386 code it still use old ioremap way. It is impossible to use same way as theX86_64since the virtual address space is limited.But maybe for 32bit, kexec kernel can run in physical mode, but I'm not sure, I would suggest Andy to do a test first with efi=noruntime for kexec 2nd kernel.
Guys, it was quite a long no hear from you. As I told you the proposed work around didn't help. Today I found that Microsoft Surface 3 also affected by this.
Quoted 7 lines
Quoted 2 lines
Can we apply these patches for now until you will find better solution?
Not a chance. The patches don't apply to any kernel in the git history.
Which may be part of your problem. You are or at least were running with code that has not been merged upstream.
It's done against linux-next.
Applied clearly. (Not the version in this more than yearly old series of course, that's why I told I can resend)Quoted 9 lines
Quoted 1 line
P.S. I may resend them rebased on recent vanilla.Second. I looked at your test results and they don't directly make sense. dmidecode bypasses the kernel completely or it did last time I looked so I don't know why you would be using that to test if something in the kernel is working.
However dmidecode failing suggests that the actual problem is something in the first kernel is stomping the dmi tables.
See below.
Quoted 1 line
Adding a command line option won't fix stomped tables.
It provides a mechanism, which seems to be absent, to the second kernel to know where to look for SMBIOS tables.
Quoted 2 lines
So what I would suggest is:
a) Verify that dmidecode works before kexec.Yes, it does.
Quoted 1 line
b) Test to see if dmidecode works after kexec.
No, it doesn't.
Quoted 3 lines
c) Once (a) shows that dmidecode works and (b) shows that dmidecode fails figure out what is stomping your dmi tables during or before kexec and that is what should get fixed.
The problem here as I can see it that EFI and kexec protocols are not friendly to each other.
I'm not an expert in either. That's why I'm asking for possible solutions. And this needs to be done in kernel to allow drivers to work.Does the
commit
4996c02306a25def1d352ec8e8f48895bbc7dea9Author: Takao Indoh <[email protected]> Date: Thu Jul 14 18:05:21 2011 -0400ACPI: introduce "acpi_rsdp=" parameter for kdump
description shed a light on this?
Quoted 4 lines
Now using a non-efi method of dmi detection relies on the tables being between
0xF0000and0x10000. AKA the last 64K of the first 1MiB of memory. You might check to see if your dmi tables are in that address range.# dmidecode --no-sysfs # dmidecode 3.2 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.=== with patch applied ===
# dmidecode ... Release Date: 03/10/2015 ...Quoted 7 lines
Otherwise I suspect the good solution is to give efi it's own page tables in the kernel and switch to it whenever efi functions are called.
But on 32bit the Linux kernel has historically been just fine directly accessing the hardware, and ignoring efi and all of the other BIOS's.
Quoted 8 lines
It seems not only for 32-bit Linux kernel anymore. MS Surface 3 runs 64-bit code.
Quoted 2 lines
So if that doesn't work on Intel Galileo that is probably a firmware problem.
It's not only about Galileo anymore.
Quoted 7 lines
Looking at the x86 kexec EFI code, it seems that it has special handling for the legacy SMBIOS table address, but not for the SMBIOS3 table address, which was introduced to accommodate SMBIOS tables living in memory that is not 32-bit addressable.
Could anyone check whether these systems provide SMBIOS 3.0 tables, and whether their address gets virtually remapped at ExitBootServices?
Can you tell how to do this and I will try to get information?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 2/2] firmware: dmi_scan: Pass dmi_entry_point to kexec'ed kernel
In reply to Andy ShevchenkoQuoted 19 lines · Andy Shevchenko
Quoted 18 lines · Dave Young
Quoted 16 lines · Jean Delvare
Hi Andy,
Quoted 6 lines · Andy Shevchenko
Until now kexec'ed kernel has no clue where to look for DMI entry point.
Pass it via kernel command line parameter in the same way as it's done for ACPI
RSDP.I am no kexec expert but this confuses me. Shouldn't the second kernel
have access to the EFI systab as the first kernel does? It includes many more pointers than just ACPI and DMI tables, and it would seem inconvenient to have to pass all these addresses individually explicitly.
Quoted 6 lines
Quoted 2 lines
Yes, in modern linux kernel, kexec has the support for EFI, I think it should work naturally at least in
x86_64.Thanks for this good news!
Unfortunately Intel Galileo is 32-bit platform.
Maybe you can try use efi=noruntime kernel parameter in kexec/kdump kernel, see if it works or not.
Quoted 4 lines
Signature · 3 lines
-- Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Guys, it was quite a long no hear from you.
Today I found that Microsoft Surface 3 also affected by this.
Can we apply these patches for now until you will find better solution?
P.S. I may resend them rebased on recent vanilla.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Quoted 6 lines
Guys, it was quite a long no hear from you.
Today I found that Microsoft Surface 3 also affected by this.Can we apply these patches for now until you will find better solution?
P.S. I may resend them rebased on recent vanilla.
Okay, since there is no reply I take it as confirmation that the problem exists and needs to be addressed. So, I'll send a new version of the series with updated commit messages (to mention Surface 3 issue).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Guys, it was quite a long no hear from you.
Today I found that Microsoft Surface 3 also affected by this.
Quoted 7 lines
Quoted 3 lines
Can we apply these patches for now until you will find better solution?
P.S. I may resend them rebased on recent vanilla.Okay, since there is no reply I take it as confirmation that the problem exists and needs to be addressed. So, I'll send a new version of the series with updated commit messages (to mention Surface 3 issue).
Ah, I found reply from Eric from Jan 21, this year. Somehow it's slipped thru my eyes.
I'll read it carefully and react accordingly.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
+Cc: Ard
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Hi,
Quoted 13 lines · Andy Shevchenko
+Cc: Ard
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (kexec_file_load):
kexec/arch/i386/x86-linux-setup.c +4 -1
@@ -533,7 +533,8 @@ struct efi_setup_data {uint64_t runtime;uint64_t tables;uint64_t smbios; -uint64_t reserved[8 ]; +uint64_t smbios3; +uint64_t reserved[7 ]; };struct setup_data {
@@ -580,6 +581,8 @@ static int get_efi_values(struct efi_set ret =get_efi_value ("/sys/firmware/efi/systab" ,"SMBIOS=0x" , &esd->smbios); + ret |=get_efi_value ("/sys/firmware/efi/systab" ,"SMBIOS3=0x" , + &esd->smbios3); ret |=get_efi_value ("/sys/firmware/efi/fw_vendor" ,"0x" , &esd->fw_vendor); ret |= get_efi_value("/sys/firmware/efi/runtime", "0x",
=============================================
Kernel patch:
arch/x86/include/asm/efi.h +2 -1
@@ -167,7 +167,8 @@ struct efi_setup_data {u64 __unused;u64 tables;u64 smbios; -u64 reserved[8 ]; +u64 smbios3; +u64 reserved[7 ]; };extern u64 efi_setup;
arch/x86/kernel/kexec-bzimage64.c +1 -0
@@ -144,6 +144,7 @@ prepare_add_efi_setup_data(struct boot_p esd->fw_vendor = efi_fw_vendor; esd->tables = efi_config_table; esd->smbios = efi.smbios; + esd->smbios3 = efi.smbios3; sd->type =SETUP_EFI ; sd->len =sizeof (struct efi_setup_data );
arch/x86/platform/efi/quirks.c +6 -4
@@ -497,8 +497,8 @@ void __init efi_free_boot_services(void)* their physical addresses therefore we pass them via setup_data and * correct those entries to their respective physical addresses here. * -* Currently only handles smbios which is necessary for some firmware -* implementation. +* Currently only handles smbios and smbios3 which is necessary for +* some firmware implementation. */ int __init efi_reuse_config (u64 tables,int nr_tables) {
@@ -521,7 +521,7 @@ int __init efi_reuse_config(u64 tables, goto out; } -if (!data->smbios) +if (!data->smbios && !data->smbios3) goto out_memremap; sz =sizeof (efi_config_table_64_t);
@@ -538,8 +538,10 @@ int __init efi_reuse_config(u64 tables, guid = ((efi_config_table_64_t *)p)->guid; -if (!efi_guidcmp (guid,SMBIOS_TABLE_GUID )) +if (!efi_guidcmp (guid,SMBIOS_TABLE_GUID ) && data->smbios) ((efi_config_table_64_t *)p)->table = data->smbios; +else if (!efi_guidcmp (guid,SMBIOS3_TABLE_GUID ) && data->smbios3) + ((efi_config_table_64_t *)p)->table = data->smbios3; p += sz; }early_memunmap (tablep, nr_tables * sz);
Thanks
Dave
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 9 lines · Dave Young
Hi,
Quoted 7 lines · Andy Shevchenko
+Cc: Ard
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
You can always access to it via lore :-)
https://lore.kernel.org/linux-efi/[email protected]/T/#u
(Okay, it's not full, but contains main parts anyway)
Quoted 7 lines
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
Quoted 5 lines
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
So, AFAIU I have to apply patch to kexec tools for the fist kernel + userspace and apply kernel patch for the second kernel? Or it's all for the first one?
Quoted 2 lines
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (
kexec_file_load):
Here is how we are using it:
https://github.com/andy-shev/buildroot/blob/intel/board/intel/common/netboot/udhcpc-script.sh#L54
Quoted 86 lines
kexec/arch/i386/x86-linux-setup.c +4
-1@@ -533,7 +533,8 @@ struct efi_setup_data {uint64_t runtime;uint64_t tables;uint64_t smbios; -uint64_t reserved[8 ]; +uint64_t smbios3; +uint64_t reserved[7 ]; };struct setup_data {@@ -580,6 +581,8 @@ static int get_efi_values(struct efi_set ret =get_efi_value ("/sys/firmware/efi/systab" ,"SMBIOS=0x" , &esd->smbios); + ret |=get_efi_value ("/sys/firmware/efi/systab" ,"SMBIOS3=0x" , + &esd->smbios3); ret |=get_efi_value ("/sys/firmware/efi/fw_vendor" ,"0x" , &esd->fw_vendor); ret |= get_efi_value("/sys/firmware/efi/runtime", "0x",=============================================
Kernel patch:arch/x86/include/asm/efi.h +2
-1@@ -167,7 +167,8 @@ struct efi_setup_data {u64 __unused;u64 tables;u64 smbios; -u64 reserved[8 ]; +u64 smbios3; +u64 reserved[7 ]; };extern u64 efi_setup;arch/x86/kernel/kexec-bzimage64.c +1
-0@@ -144,6 +144,7 @@ prepare_add_efi_setup_data(struct boot_p esd->fw_vendor = efi_fw_vendor; esd->tables = efi_config_table; esd->smbios = efi.smbios; + esd->smbios3 = efi.smbios3; sd->type =SETUP_EFI ; sd->len =sizeof (struct efi_setup_data );arch/x86/platform/efi/quirks.c +6
-4@@ -497,8 +497,8 @@ void __init efi_free_boot_services(void)* their physical addresses therefore we pass them via setup_data and * correct those entries to their respective physical addresses here. * -* Currently only handles smbios which is necessary for some firmware -* implementation. +* Currently only handles smbios and smbios3 which is necessary for +* some firmware implementation. */ int __init efi_reuse_config (u64 tables,int nr_tables) {@@ -521,7 +521,7 @@ int __init efi_reuse_config(u64 tables, goto out; } -if (!data->smbios) +if (!data->smbios && !data->smbios3) goto out_memremap; sz =sizeof (efi_config_table_64_t);@@ -538,8 +538,10 @@ int __init efi_reuse_config(u64 tables, guid = ((efi_config_table_64_t *)p)->guid; -if (!efi_guidcmp (guid,SMBIOS_TABLE_GUID )) +if (!efi_guidcmp (guid,SMBIOS_TABLE_GUID ) && data->smbios) ((efi_config_table_64_t *)p)->table = data->smbios; +else if (!efi_guidcmp (guid,SMBIOS3_TABLE_GUID ) && data->smbios3) + ((efi_config_table_64_t *)p)->table = data->smbios3; p += sz; }early_memunmap (tablep, nr_tables * sz);Thanks
Dave
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 35 lines · Andy Shevchenko
Quoted 6 lines · Dave Young
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
You can always access to it via lore :-)
https://lore.kernel.org/linux-efi/[email protected]/T/#u(Okay, it's not full, but contains main parts anyway)
Quoted 7 lines
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
Quoted 5 lines
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
Quoted 8 lines
So, AFAIU I have to apply patch to kexec tools for the fist kernel + userspace and apply kernel patch for the second kernel? Or it's all for the first one?
Quoted 2 lines
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (
kexec_file_load):Here is how we are using it:
https://github.com/andy-shev/buildroot/blob/intel/board/intel/common/netboot/udhcpc-script.sh#L54
Okay, thanks for the patches. I have applied them to both kernels, so the first one and second one are the same and kexec tools have a patch provided in the user space of the both kernels (only first one in use though).
Before applying your patch, I have reverted my hacks (as per this series).
Result is:
# uname -a Linux buildroot 5.13.0-rc5+ #1 SMP Mon Jun 7 19:49:40 EEST 2021 i586 GNU/Linux # dmidecode # dmidecode 3.3 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
I.o.w. it does NOT fix the issue. My patches do (with a hint from user space).
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 10 lines · Dave Young
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
You can always access to it via lore :-)
https://lore.kernel.org/linux-efi/[email protected]/T/#u
Thanks. Hmm, this is for 32bit efi. kexec efi boot support was only added for 64bit. So if 32bit dmidecode does not work I'm not surprise.
Quoted 34 lines
Quoted 17 lines
(Okay, it's not full, but contains main parts anyway)
Quoted 7 lines
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
Quoted 5 lines
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
Quoted 8 lines
So, AFAIU I have to apply patch to kexec tools for the fist kernel + userspace and apply kernel patch for the second kernel? Or it's all for the first one?
Quoted 2 lines
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (
kexec_file_load):Here is how we are using it:
https://github.com/andy-shev/buildroot/blob/intel/board/intel/common/netboot/udhcpc-script.sh#L54Okay, thanks for the patches. I have applied them to both kernels, so the first one and second one are the same and kexec tools have a patch provided in the user space of the both kernels (only first one in use though).
Before applying your patch, I have reverted my hacks (as per this series).
Result is:
Quoted 8 lines
# uname -a Linux buildroot 5.13.0-rc5+ #1 SMP Mon Jun 7 19:49:40 EEST 2021 i586 GNU/Linux # dmidecode # dmidecode 3.3 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.I.o.w. it does NOT fix the issue. My patches do (with a hint from user space).
As I said, since it is 32bit efi, so your test results are expected, also no need to check the kernel log about SMBIOS3 address changed or not.
Quoted 6 lines
Signature · 3 lines
-- With Best Regards, Andy Shevchenko
Thanks
Dave
Quoted 65 lines · Dave Young
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 10 lines · Dave Young
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
You can always access to it via lore :-)
https://lore.kernel.org/linux-efi/[email protected]/T/#uThanks. Hmm, this is for 32bit efi. kexec efi boot support was only added for 64bit. So if 32bit dmidecode does not work I'm not surprise.
Quoted 41 lines
Quoted 17 lines
(Okay, it's not full, but contains main parts anyway)
Quoted 7 lines
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
Quoted 5 lines
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
Quoted 8 lines
So, AFAIU I have to apply patch to kexec tools for the fist kernel + userspace and apply kernel patch for the second kernel? Or it's all for the first one?
Quoted 2 lines
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (
kexec_file_load):Here is how we are using it:
https://github.com/andy-shev/buildroot/blob/intel/board/intel/common/netboot/udhcpc-script.sh#L54Okay, thanks for the patches. I have applied them to both kernels, so the first one and second one are the same and kexec tools have a patch provided in the user space of the both kernels (only first one in use though).
Before applying your patch, I have reverted my hacks (as per this series).
Result is:
# uname -a Linux buildroot 5.13.0-rc5+ #1 SMP Mon Jun 7 19:49:40 EEST 2021 i586 GNU/Linux # dmidecode # dmidecode 3.3 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.
Quoted 5 lines
Quoted 1 line
I.o.w. it does NOT fix the issue. My patches do (with a hint from user space).
As I said, since it is 32bit efi, so your test results are expected, also no need to check the kernel log about SMBIOS3 address changed or not.
So, what shall I do? It's already 5 years passed without any progress while my patches definitely help here.
Should I rebase and resubmit?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 68 lines · Andy Shevchenko
Quoted 67 lines · Dave Young
Quoted 12 lines · Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 10 lines · Dave Young
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Until now DMI information is lost when kexec'ing. Fix this in the same way as it has been done for ACPI RSDP.
Series has been tested on Galileo Gen2 where DMI is used by drivers, in particular the default I2C host speed is choosen based on DMI system information and now gets it correct.
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Still nothing happens for a while and problem still exists. Can we do something about it, please?
Seems I totally missed this thread. Old emails lost.
You can always access to it via lore :-)
https://lore.kernel.org/linux-efi/[email protected]/T/#uThanks. Hmm, this is for 32bit efi. kexec efi boot support was only added for 64bit. So if 32bit dmidecode does not work I'm not surprise.
Quoted 42 lines
Quoted 17 lines
(Okay, it's not full, but contains main parts anyway)
Quoted 7 lines
The question Ard asked is to confirm if the firmware converted the SMBIOS3 addr to a virtual address after exit boot service. I do not remember some easy way to check it due to lost the context of the code. But you can try to check it via dmesg|grep SMBIOS both in normal boot and kexeced boot log. And then compare if those addresses are identical.
Quoted 5 lines
If the SMBIOS3 addr in kexec kernel is different then it should have been modified by firmware. Then we need patch kernel and kexec-tools to support it.
You can try below patch to see if it works:
Quoted 8 lines
So, AFAIU I have to apply patch to kexec tools for the fist kernel + userspace and apply kernel patch for the second kernel? Or it's all for the first one?
Quoted 2 lines
apply a kexec-tools patch to kexec-tools if you do not use kexec -s (
kexec_file_load):Here is how we are using it:
https://github.com/andy-shev/buildroot/blob/intel/board/intel/common/netboot/udhcpc-script.sh#L54Okay, thanks for the patches. I have applied them to both kernels, so the first one and second one are the same and kexec tools have a patch provided in the user space of the both kernels (only first one in use though).
Before applying your patch, I have reverted my hacks (as per this series).
Result is:
# uname -a Linux buildroot 5.13.0-rc5+ #1 SMP Mon Jun 7 19:49:40 EEST 2021 i586 GNU/Linux # dmidecode # dmidecode 3.3 Scanning /dev/mem for entry point. # No SMBIOS nor DMI entry point found, sorry.I.o.w. it does NOT fix the issue. My patches do (with a hint from user space).
Quoted 7 lines
Quoted 3 lines
As I said, since it is 32bit efi, so your test results are expected, also no need to check the kernel log about SMBIOS3 address changed or not.
So, what shall I do? It's already 5 years passed without any progress while my patches definitely help here.
Should I rebase and resubmit?
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Quoted 5 lines
Signature · 3 lines
-- With Best Regards, Andy Shevchenko
Thanks
Dave
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
========= kernel draft patch ==============
--- arch/x86/boot/header.S | 2 +- arch/x86/platform/efi/efi.c | 6 +++--- arch/x86/platform/efi/quirks.c | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-)
arch/x86/boot/header.S +1 -1
@@ -416,7 +416,7 @@ xloadflags: # define XLF23 0 #endif -#if defined(CONFIG_X86_64) && defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE) +#if defined(CONFIG_EFI) && defined(CONFIG_KEXEC_CORE) # define XLF4 XLF_EFI_KEXEC #else # define XLF4 0
arch/x86/platform/efi/efi.c +3 -3
@@ -710,10 +710,10 @@ static void __init kexec_enter_virtual_munsigned int num_pages;/* -* We don't do virtual mode, since we don't do runtime services, on -* non-native EFI. +* We don't do virtual mode, since we don't do runtime services +* on non-native or IA32 EFI. */ -if (efi_is_mixed ()) { +if (!efi_enabled (EFI_64BIT )) {efi_memmap_unmap ();clear_bit (EFI_RUNTIME_SERVICES , &efi.flags);return ;
arch/x86/platform/efi/quirks.c +0 -3
@@ -524,9 +524,6 @@ int __init efi_reuse_config(u64 tables,if (!efi_setup)return 0 ; -if (!efi_enabled (EFI_64BIT )) -return 0 ; - data =early_memremap (efi_setup,sizeof (*data));if (!data) { ret = -ENOMEM ;
========= kexec-tools draft patch =========
--- kexec/arch/i386/kexec-bzImage.c | 5 +++++ 1 file changed, 5 insertions(+)
kexec/arch/i386/kexec-bzImage.c +5 -0
@@ -83,6 +83,11 @@ int bzImage_probe(const char *buf, off_tif (probe_debug) {fprintf (stderr,"It's a bzImage\n" ); } + +#define XLF_EFI_KEXEC (1 << 4) +if ((header->xloadflags &XLF_EFI_KEXEC ) ==XLF_EFI_KEXEC ) + bzImage_support_efi_boot =1 ; +return 0 ; }
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 13 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
Quoted 8 lines
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Hold on, I may have made a mistake during testing. Let me retest this.
Signature · 9 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 18 lines · Andy Shevchenko
Quoted 17 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
Quoted 6 lines
Quoted 4 lines
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Hold on, I may have made a mistake during testing. Let me retest this.
Double checked, confirmed that it's NOT working.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Ard Biesheuvel
maintainerQuoted 20 lines · Andy Shevchenko
Quoted 18 lines · Andy Shevchenko
Quoted 17 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Hold on, I may have made a mistake during testing. Let me retest this.
Double checked, confirmed that it's NOT working.
Apologies for chiming in so late - in my defence, I was on vacation :-)
So if I understand the thread correctly, the Surface 3 provides a SMBIOS entry point (not SMBIOS3), and it does not get picked up by the second kernel, right?
I would still prefer to get to the bottom of this before papering over it with command line options. If the memory gets corrupted by the first kernel, maybe we are not preserving it correctly in the first kernel.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 31 lines · Ard Biesheuvel
Quoted 19 lines · Andy Shevchenko
Quoted 18 lines · Andy Shevchenko
Quoted 17 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Hold on, I may have made a mistake during testing. Let me retest this.
Double checked, confirmed that it's NOT working.
Apologies for chiming in so late - in my defence, I was on vacation :-)
Quoted 8 lines
So if I understand the thread correctly, the Surface 3 provides a SMBIOS entry point (not SMBIOS3), and it does not get picked up by the second kernel, right?
I would still prefer to get to the bottom of this before papering over it with command line options. If the memory gets corrupted by the first kernel, maybe we are not preserving it correctly in the first kernel.
There are _at least_ two platforms which are affected by this:
- Intel Galileo
- Microsoft Surface 3
For the time being I'm testing this on the former one. If we get something working there, I will perform similar tests on the latter one. And who knows how many more platforms are affected, because kexec is usually not what many people are using every day, however we (my teammates and I) use such a setup _a lot_.on a number of platforms It appears that only those two were found in our zoo to behave badly.
Signature · 7 lines
With Best Regards, Andy Shevchenko _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 19 lines · Andy Shevchenko
Quoted 18 lines · Andy Shevchenko
Quoted 17 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Hold on, I may have made a mistake during testing. Let me retest this.
Double checked, confirmed that it's NOT working.
Any news here?
Shall I resend my series?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Ard Biesheuvel
maintainerQuoted 26 lines · Andy Shevchenko
Quoted 24 lines · Andy Shevchenko
Quoted 23 lines · Andy Shevchenko
Quoted 21 lines · Andy Shevchenko
Quoted 9 lines · Dave Young
Quoted 6 lines
Probably it is doable to have kexec on 32bit efi working without runtime service support, that means no need the trick of fixed mapping.
If I can restore my vm to boot 32bit efi on this weekend then I may provide some draft patches for test.
Unfortunately I failed to setup a 32bit efi guest, here are some untested draft patches, please have a try.
Thanks for the patches.
As previously, I have reverted my hacks and applied your patches (also I dropped patches from previous mail against kernel and kexec-tools) for both kernel and user space on first and second environments.
It does NOT solve the issue.
If there is no idea pops up soon, I'm going to resend my series that workarounds the issue.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Hold on, I may have made a mistake during testing. Let me retest this.
Double checked, confirmed that it's NOT working.
Any news here?
Shall I resend my series?
As I said before:
"""
I would still prefer to get to the bottom of this before papering over it with command line options. If the memory gets corrupted by the first kernel, maybe we are not preserving it correctly in the first kernel.
"""
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 3 lines · Ard Biesheuvel
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko
On Mon, Jun 14, 2021 at 08:07:33PM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
Double checked, confirmed that it's NOT working.
Any news here?
Shall I resend my series?
Quoted 8 lines
As I said before:
"""
I would still prefer to get to the bottom of this before papering over it with command line options. If the memory gets corrupted by the first kernel, maybe we are not preserving it correctly in the first kernel.
"""
And I can't agree more, but above I asked about news, implying if there is anything to test?
The issue is still there and it becomes a bit annoying to see my hack patches in every tree I have been using.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Ard Biesheuvel
maintainerQuoted 23 lines · Andy Shevchenko
Quoted 3 lines · Ard Biesheuvel
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Andy Shevchenko
On Mon, Jun 14, 2021 at 08:07:33PM +0300, Andy Shevchenko wrote:
...
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
Double checked, confirmed that it's NOT working.
Any news here?
Shall I resend my series?
Quoted 8 lines
As I said before:
"""
I would still prefer to get to the bottom of this before papering over it with command line options. If the memory gets corrupted by the first kernel, maybe we are not preserving it correctly in the first kernel.
"""
Quoted 5 lines
And I can't agree more, but above I asked about news, implying if there is anything to test?
The issue is still there and it becomes a bit annoying to see my hack patches in every tree I have been using.
If nobody can be bothered to properly diagnose this, how important is it, really?
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec