public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
@ 2025-03-10 12:10 memristor2 via groups.io
  2025-03-10 12:39 ` Ajan
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 12:10 UTC (permalink / raw)
  To: devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 2529 bytes --]

Hello everyone,
This problem is something I have had struggling with for a while now.
The issue is that I built coreboot with and UEFIPayload/UniversalPayload eveything goes fine but when I try to boot Ubuntu the kernel simply hangs after exit_boot_services even though it returns with success. Windows didn't boot either but turning off the debug macros seemed to fix the issue and windows boots now, even though it has a more complicated process in booting after ExitBootServices since it calls RunTimeServices. I checked the kernel's code (using linux-5.19.1) every thing seems to be fine but somehow after the address of startup_32 is returned and called to, the system hangs.
This is part of the efi_main code inside the kernel:

status = efi_load_initrd(image, &addr, &size, hdr->initrd_addr_max,
ULONG_MAX);
if (status != EFI_SUCCESS)
gotofail;
if (size > 0) {
efi_set_u64_split(addr, &hdr->ramdisk_image,
&boot_params->ext_ramdisk_image);
efi_set_u64_split(size, &hdr->ramdisk_size,
&boot_params->ext_ramdisk_size);
}

/*
* If the boot loader gave us a value for secure_boot then we use that,
* otherwise we ask the BIOS.
*/
if (boot_params->secure_boot == efi_secureboot_mode_unset)
boot_params->secure_boot = efi_get_secureboot();

/* Ask the firmware to clear memory on unclean shutdown */
efi_enable_reset_attack_mitigation();

efi_random_get_seed();

efi_retrieve_tpm2_eventlog();

setup_graphics(boot_params);

setup_efi_pci(boot_params);

setup_quirks(boot_params, bzimage_addr, buffer_end - buffer_start);

status = exit_boot(boot_params, handle);
if (status != EFI_SUCCESS) {
efi_err("exit_boot() failed!\n");
gotofail;
}
returnbzimage_addr;
All of the routines before returning bzimage_addr returns successfully but nothing happens after this.
Could this be MemoryMap and adress relocation related?
I don't even know if this is an EDK2 issue or should I change a configuration in coreboot (I highly doubt it being the second one. That's why I am emailing here).
I should also add that RngDxe and Tpm2Dxe are not loaded but i don't think that would be the cause.
Any help is appreciated.

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121165): https://edk2.groups.io/g/devel/message/121165
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 8930 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 12:10 [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload memristor2 via groups.io
@ 2025-03-10 12:39 ` Ajan
  2025-03-10 12:57   ` memristor2 via groups.io
  0 siblings, 1 reply; 11+ messages in thread
From: Ajan @ 2025-03-10 12:39 UTC (permalink / raw)
  To: memristor2, devel

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

You can have a try on this:
1. If this issue is relocation or alsr related, disable kernel alsr in boot option might help.
2. Use assembly code or inline c code to print log to serial port (0x3f8 for x86) for log tracing if you are running on top of Bare Metal hardware.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121168): https://edk2.groups.io/g/devel/message/121168
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 1085 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 12:39 ` Ajan
@ 2025-03-10 12:57   ` memristor2 via groups.io
  2025-03-10 13:11     ` Ajan
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 12:57 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

I don't know how to do the first one.
I don't see any option for this in edk2 or coreboot or while building the kernel. there are some guides on how to due this but they are only when you are inside the OS.

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Monday, March 10th, 2025 at 4:09 PM, Ajan <ajan.zhong@newfw.com> wrote:

> You can have a try on this:
> 1. If this issue is relocation or alsr related, disable kernel alsr in boot option might help.
> 2. Use assembly code or inline c code to print log to serial port (0x3f8 for x86) for log tracing if you are running on top of Bare Metal hardware.
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121169): https://edk2.groups.io/g/devel/message/121169
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2116 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 12:57   ` memristor2 via groups.io
@ 2025-03-10 13:11     ` Ajan
  2025-03-10 13:29       ` memristor2 via groups.io
  0 siblings, 1 reply; 11+ messages in thread
From: Ajan @ 2025-03-10 13:11 UTC (permalink / raw)
  To: memristor2, devel

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

On Mon, Mar 10, 2025 at 08:57 PM, memristor2 wrote:

> 
> I don't see any option for this in edk2 or coreboot or while building the
> kernel. there are some guides on how to due this but they are only when
> you are ins

Append "nokaslr" in "CONFIG_CMDLINE" when building kernel.

keyword "nokaslr" in https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html
and "built-in kernel command string" https://www.kernelconfig.io/config_cmdline


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121170): https://edk2.groups.io/g/devel/message/121170
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 1546 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 13:11     ` Ajan
@ 2025-03-10 13:29       ` memristor2 via groups.io
  2025-03-10 13:30         ` memristor2 via groups.io
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 13:29 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]

Wow I was definitely NOT expecting that to work. Thanks a lot you're a life saver So I got very curious why does this happen and how to give it a permanent fix within the since the firmware might be provided to some other end users and we can't just tell them to disable ASLR for each linux they might be installing.

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Monday, March 10th, 2025 at 4:41 PM, Ajan <ajan.zhong@newfw.com> wrote:

> On Mon, Mar 10, 2025 at 08:57 PM, memristor2 wrote:
>
>> I don't see any option for this in edk2 or coreboot or while building the kernel. there are some guides on how to due this but they are only when you are ins
>
> Append "nokaslr" in "CONFIG_CMDLINE" when building kernel.
>
> keyword "nokaslr" in https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html
> and "built-in kernel command string" https://www.kernelconfig.io/config_cmdline
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121171): https://edk2.groups.io/g/devel/message/121171
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2797 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 13:29       ` memristor2 via groups.io
@ 2025-03-10 13:30         ` memristor2 via groups.io
  2025-03-10 13:38           ` Ajan
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 13:30 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 5418 bytes --]

it did boot into the kernel but now it panics at this:
3.158250] DMAR: SATC flags: 0x0
[ 3.162182] DMAR-IR: IOAPIC id 0 under DRHD base 0x907e0000 IOMMU 15
[ 3.169612] DMAR-IR: HPET id 0 under DRHD base 0x907e0000
[ 3.175862] DMAR-IR: Queued invalidation will be enabled to support x2apic a.
[ 3.195752] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 3.207576] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 3.231463] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x2s
[ 3.243344] Calibrating delay loop (skipped), value calculated using timer f)
[ 3.247339] pid_max: default: 196608 minimum: 1536
S[Rxmedenbyltedsrcxg//Coaff0oc * as *
[ 3.255337] kernel tried to execute N)
[ 3.255337] BUG: unable to handle page fault for address: 0000000063441850
[ 3.255337] #PF: supervisor instruction fetch in kernel mode
[ 3.255337] #PF: error_code(0x0011) - permissions violation
[ 3.255337] PGD 4a35063 P4D 4a36063 PUD 4a3b063 PMD 4a3c063 PTE 8000000063443
[ 3.255337] Oops: 0011 [#1] PREEMPT SMP NOPTI
[ 3.255337] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-32-generic #33~u
[ 3.255337] Hardware name: Intel Avenue City CRB/Avenue City CRB, BIOS 24.085
[ 3.255337] RIP: 0010:0x63441850
[ 3.255337] Code: Unable to access opcode bytes at RIP 0x63441826.
[ 3.255337] RSP: 0000:ffffffff830035d8 EFLAGS: 00010002
[ 3.255337] RAX: 0000000063441850 RBX: ffffffff83003758 RCX: 0000000090000002
[ 3.255337] RDX: 0000000003050007 RSI: 00000000000000e7 RDI: 0000000000000078
[ 3.255337] RBP: ffffffff83003710 R08: 0000000000000000 R09: 0000000063334000
[ 3.255337] R10: 00000000000003f8 R11: 0000000000000000 R12: 00000000633400e0
[ 3.255337] R13: 0000000090000002 R14: 0000000003050007 R15: 0000000063333435
[ 3.255337] FS: 0000000000000000(0000) GS:ff1100005ae00000(0000) knlGS:00000
[ 3.255337] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3.255337] CR2: 0000000063441850 CR3: 0000000004ac4002 CR4: 00000000000616f0
[ 3.255337] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 3.255337] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400
[ 3.255337] Call Trace:
[ 3.255337] <TASK>
[ 3.255337] ? put_dec+0x1c/0xb0
[ 3.255337] ? number+0x3a3/0x3f0
[ 3.255337] ? rmqueue_pcplist.constprop.0+0x1ca/0x1f0
[ 3.255337] ? get_page_from_freelist+0x307/0x490
[ 3.255337] ? post_alloc_hook+0xdf/0x120
[ 3.255337] ? __efi_call+0x25/0x30
[ 3.255337] ? kernel_fpu_begin_mask+0x2b/0xc0
[ 3.255337] ? efi_set_virtual_address_map+0x73/0xb9
[ 3.255337] ? __efi_enter_virtual_mode+0x1a2/0x219
[ 3.255337] ? efi_enter_virtual_mode+0x38/0x4c
[ 3.255337] ? start_kernel+0x43b/0x4e4
[ 3.255337] ? x86_64_start_reservations+0x24/0x2c
[ 3.255337] ? x86_64_start_kernel+0xee/0x103
[ 3.255337] ? secondary_startup_64_no_verify+0xe5/0xeb
[ 3.255337] </TASK>
[ 3.255337] Modules linked in:
[ 3.255337] CR2: 0000000063441850
[ 3.255337] ---[ end trace 0000000000000000 ]---
[ 3.255337] RIP: 0010:0x63441850
[ 3.255337] Code: Unable to access opcode bytes at RIP 0x63441826.
[ 3.255337] RSP: 0000:ffffffff830035d8 EFLAGS: 00010002
[ 3.255337] RAX: 0000000063441850 RBX: ffffffff83003758 RCX: 0000000090000002
[ 3.255337] RDX: 0000000003050007 RSI: 00000000000000e7 RDI: 0000000000000078
[ 3.255337] RBP: ffffffff83003710 R08: 0000000000000000 R09: 0000000063334000
[ 3.255337] R10: 00000000000003f8 R11: 0000000000000000 R12: 00000000633400e0
[ 3.255337] R13: 0000000090000002 R14: 0000000003050007 R15: 0000000063333435
[ 3.255337] FS: 0000000000000000(0000) GS:ff1100005ae00000(0000) knlGS:00000
[ 3.255337] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 3.255337] CR2: 0000000063441850 CR3: 0000000004ac4002 CR4: 00000000000616f0
[ 3.255337] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 3.255337] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400
[ 3.255337] Kernel panic - not syncing: Attempted to kill the idle task! [ 3.255337] ---[ end Kernel panic - not syncing: Attempted to kill the idle -

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Monday, March 10th, 2025 at 4:59 PM, memristor2 <memristor2@proton.me> wrote:

> Wow I was definitely NOT expecting that to work. Thanks a lot you're a life saver So I got very curious why does this happen and how to give it a permanent fix within the since the firmware might be provided to some other end users and we can't just tell them to disable ASLR for each linux they might be installing.
>
> Sent with [Proton Mail](https://proton.me/mail/home) secure email.
>
> On Monday, March 10th, 2025 at 4:41 PM, Ajan <ajan.zhong@newfw.com> wrote:
>
>> On Mon, Mar 10, 2025 at 08:57 PM, memristor2 wrote:
>>
>>> I don't see any option for this in edk2 or coreboot or while building the kernel. there are some guides on how to due this but they are only when you are ins
>>
>> Append "nokaslr" in "CONFIG_CMDLINE" when building kernel.
>>
>> keyword "nokaslr" in https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html
>> and "built-in kernel command string" https://www.kernelconfig.io/config_cmdline
>> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121172): https://edk2.groups.io/g/devel/message/121172
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 14349 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 13:30         ` memristor2 via groups.io
@ 2025-03-10 13:38           ` Ajan
  2025-03-10 13:53             ` memristor2 via groups.io
       [not found]             ` <182B756C71707289.31525@groups.io>
  0 siblings, 2 replies; 11+ messages in thread
From: Ajan @ 2025-03-10 13:38 UTC (permalink / raw)
  To: memristor2, devel

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

On Mon, Mar 10, 2025 at 09:30 PM, memristor2 wrote:

> 
> BUG: unable to handle page fault for address: 0000000063441850

To "nokaslr", maybe MemMap or E820 table passed to Linux kernel is incorrect. Then you need to check MemMap or E820 table entries.

To kernel panic, page fault triggered at 0x63441850 with log " BUG: unable to handle page fault for address: 0000000063441850 ". This issue might be caused by invalid page table access. And also it seems you are using FPU " kernel_fpu_begin_mask+0x2b/0xc0 " , maybe you need to check whether FPU has been initialized correctly.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121173): https://edk2.groups.io/g/devel/message/121173
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2534 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-10 13:38           ` Ajan
@ 2025-03-10 13:53             ` memristor2 via groups.io
       [not found]             ` <182B756C71707289.31525@groups.io>
  1 sibling, 0 replies; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-10 13:53 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

Ok I'll look into this thanks for the help again. this seems that this new panic is a rather complicated challenge to overcome. I hope you wouldn't mind asking more questions about this matter on the mailling list.

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Monday, March 10th, 2025 at 5:08 PM, Ajan <ajan.zhong@newfw.com> wrote:

> On Mon, Mar 10, 2025 at 09:30 PM, memristor2 wrote:
>
>> BUG: unable to handle page fault for address: 0000000063441850
>
> To "nokaslr", maybe MemMap or E820 table passed to Linux kernel is incorrect. Then you need to check MemMap or E820 table entries.
>
> To kernel panic, page fault triggered at 0x63441850 with log "BUG: unable to handle page fault for address: 0000000063441850 ". This issue might be caused by invalid page table access. And also it seems you are using FPU "kernel_fpu_begin_mask+0x2b/0xc0 ", maybe you need to check whether FPU has been initialized correctly.
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121174): https://edk2.groups.io/g/devel/message/121174
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 3570 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
       [not found]             ` <182B756C71707289.31525@groups.io>
@ 2025-03-12 10:05               ` memristor2 via groups.io
  2025-03-12 13:44                 ` Ajan
  0 siblings, 1 reply; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-12 10:05 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 8074 bytes --]

So i resolved the previous mentioned issue by turning off all of the debug logs which I had manually added.
But now I have a bigger issue.
So Ubuntu started crating processes but eventually has to kill a lot of them due to lack of memory. the log is as below:

[ 0.000000] signal:maxsigframesize:11952
[ 0.000000] BIOS-providedphysicalRAMmap:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000000fff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000001000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000062e57fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000062e58000-0x0000000062e5bfff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000062e5c000-0x0000000063241fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000063242000-0x0000000063449fff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000006344a000-0x0000000063454fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000063455000-0x0000000063466fff] ACPIdata
[ 0.000000] BIOS-e820: [mem 0x0000000063467000-0x0000000063467fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000063468000-0x000000008fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ff020000-0x00000000ff05ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000107f000000-0x000000107fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0004380004000000-0x00043c0803ffffff] usable
[ 0.000000] NX(ExecuteDisable)protection:active
[ 0.000000] efi:EFIv2.70byEDKII
[ 0.000000] efi:SMBIOS=0x633f8000SMBIOS3.0=0x633f6000ACPI=0x63466000ACPI2.0=0x63466014MEMATTR=0x6030a198RNG=0x63455018
[ 0.000000] efi:seedingentropypool
[ 0.000000] random:crnginitdone
[ 0.000000] efi:memattr:UnexpectedEFIMemoryAttributestableversion2
[ 0.000000] secureboot:Securebootdisabled
[ 0.000000] SMBIOS3.0.0present.
[ 0.000000] DMI:IntelAvenueCityCRB/AvenueCityCRB,BIOS24.08-1681-ge90fc546e75e-dirty03/03/2025
[ 0.000000] tsc:Detected2400.000MHzprocessor
[ 0.000022] e820:update [mem 0x00000000-0x00000fff] usable==>reserved
[ 0.000031] e820:remove [mem 0x000a0000-0x000fffff] usable
[ 0.000053] last_pfn=0x43c0804000max_arch_pfn=0x10000000000
[ 0.000927] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
[ 0.005359] totalRAMcovered: 260096M
[ 0.005688] Foundoptimalsettingformtrrcleanup
[ 0.005690] gran_size: 64K chunk_size: 64K num_reg: 7 lose cover RAM: 0G
[ 0.007933] e820: update [mem 0x80000000-0xffffffff] usable ==> reserved
[ 0.007941] e820: update [mem 0x4000000000-0x43c0803ffffff] usable ==> reserved
[ 0.007948] WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing 4227072MB of RAM.
[ 0.007951] updatee820formtrr
[ 0.007966] modifiedphysicalRAMmap:
[ 0.007967] modified: [mem 0x0000000000000000-0x0000000000000fff] reserved
[ 0.007972] modified: [mem 0x0000000000001000-0x000000000009ffff] usable
[ 0.007977] modified: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[ 0.007982] modified: [mem 0x0000000000100000-0x0000000062e57fff] usable
[ 0.007986] modified: [mem 0x0000000062e58000-0x0000000062e5bfff] reserved
[ 0.007990] modified: [mem 0x0000000062e5c000-0x0000000063241fff] usable
[ 0.007994] modified: [mem 0x0000000063242000-0x0000000063449fff] reserved
[ 0.007998] modified: [mem 0x000000006344a000-0x0000000063454fff] usable
[ 0.008001] modified: [mem 0x0000000063455000-0x0000000063466fff] ACPIdata
[ 0.008006] modified: [mem 0x0000000063467000-0x0000000063467fff] usable
[ 0.008009] modified: [mem 0x0000000063468000-0x000000008fffffff] reserved
[ 0.008013] modified: [mem 0x00000000ff020000-0x00000000ff05ffff] reserved
[ 0.008017] modified: [mem 0x000000107f000000-0x000000107fffffff] reserved
[ 0.008021] modified: [mem 0x0004380004000000-0x00043c0803ffffff] reserved
[ 0.008026] last_pfn=0x63468max_arch_pfn=0x10000000000
[ 0.008031] x2apic: enabled by BIOS, switching to x2apic ops
[ 0.033808] UsingGBpagesfordirectmapping
[ 0.035735] secureboot: Secure boot disabled
[ 0.035737] RAMDISK: [mem 0x511da000-0x5949efff]
-------------CUT----------------------------------------
[ 0.036485] ACPI: SRAT: Node 0 PXM 0 [mem 0x80000000-0x83ffffff]
[ 0.036490] ACPI: SRAT: Node 0 PXM 0 [mem 0x4380004000000-0x43c0803ffffff]
[ 0.036502] NUMA: Initialized distance table, cnt=2[ 0.036525] NUMA: nodes only cover 0MB of your 1585MB e820 RAM. Not used.-------------CUT----------------------------------------

Ubuntu 22.04.2 LTS ubuntu ttyS0

ubuntu login: [ 93.934333] Outofmemory:Killedprocess2834(Xorg)total-vm:2410176kB,anon-rss:19688kB,file-rss:60kB,shmem-rss:0kB,UID:0pgtables:528kBoom_score_adj:0
[ 109.368462] Outofmemory: Killed process 2752 (ubiquity-dm) total-vm:50252kB, anon-rss:9864kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:116kB oom_score_adj:0
[ 132.992458] Outofmemory: Killed process 2680 (networkd-dispat) total-vm:50060kB, anon-rss:9280kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:108kB oom_score_adj:0
[ 149.140831] Outofmemory: Killed process 2806 (unattended-upgr) total-vm:127148kB, anon-rss:8664kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:128kB oom_score_adj:0
[ 157.427804] Outofmemory: Killed process 2742 (zsysd) total-vm:1241788kB, anon-rss:4492kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:192kB oom_score_adj:0
[ 173.943224] Outofmemory: Killed process 3017 ((sd-pam)) total-vm:169992kB, anon-rss:4116kB, file-rss:0kB, shmem-rss:0kB, UID:999 pgtables:88kB oom_score_adj:0
[ 182.849249] Outofmemory: Killed process 2631 (systemd-resolve) total-vm:25272kB, anon-rss:3992kB, file-rss:0kB, shmem-rss:0kB, UID:101 pgtables:96kB oom_score_adj:0
[ 186.329839] Outofmemory: Killed process 2683 (rsyslogd) total-vm:222452kB, anon-rss:2804kB, file-rss:0kB, shmem-rss:0kB, UID:104 pgtables:76kB oom_score_adj:0
[ 192.928732] Outofmemory: Killed process 2673 (NetworkManager) total-vm:269532kB, anon-rss:2516kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:136kB oom_score_adj:0
[ 215.287255] Outofmemory: Killed process 2734 (udisksd) total-vm:392540kB, anon-rss:1948kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:128kB oom_score_adj:0
It seems that there is a problem with edk when programming the MTRRs and I lot of ram is not covered. In the log it's written:

WARNING: BIOS bug: CPU MTRRs don't cover all of memory, losing 4227072MB of RAM
which means i dont have 4128Gbytes of ram which is also something I don't understand because the platform has only about 128Gb of ram. Anyways in the log it says there is only 1500Mbs ram available. What happened to the rest of it? what's going on?
Is there anything useful I could study? on other hints?
I should also mention that I have disabled the ASLR in the kernel

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Monday, March 10th, 2025 at 5:23 PM, memristor2 via groups.io <memristor2=proton.me@groups.io> wrote:

> Ok I'll look into this thanks for the help again. this seems that this new panic is a rather complicated challenge to overcome. I hope you wouldn't mind asking more questions about this matter on the mailling list.
>
> Sent with [Proton Mail](https://proton.me/mail/home) secure email.
>
> On Monday, March 10th, 2025 at 5:08 PM, Ajan <ajan.zhong@newfw.com> wrote:
>
>> On Mon, Mar 10, 2025 at 09:30 PM, memristor2 wrote:
>>
>>> BUG: unable to handle page fault for address: 0000000063441850
>>
>> To "nokaslr", maybe MemMap or E820 table passed to Linux kernel is incorrect. Then you need to check MemMap or E820 table entries.
>>
>> To kernel panic, page fault triggered at 0x63441850 with log "BUG: unable to handle page fault for address: 0000000063441850 ". This issue might be caused by invalid page table access. And also it seems you are using FPU "kernel_fpu_begin_mask+0x2b/0xc0 ", maybe you need to check whether FPU has been initialized correctly.
>
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121189): https://edk2.groups.io/g/devel/message/121189
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 35356 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-12 10:05               ` memristor2 via groups.io
@ 2025-03-12 13:44                 ` Ajan
  2025-03-12 13:46                   ` memristor2 via groups.io
  0 siblings, 1 reply; 11+ messages in thread
From: Ajan @ 2025-03-12 13:44 UTC (permalink / raw)
  To: memristor2, devel

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

On Wed, Mar 12, 2025 at 06:05 PM, memristor2 wrote:

> 
> efi: memattr: Unexpected EFI Memory Attributes table version 2
> 

It should be an E820 table issue or MTRR issue.
There should be memory resource Hob info printed when Payload boots, you can check whether all memory maps are correct.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121190): https://edk2.groups.io/g/devel/message/121190
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 1622 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload
  2025-03-12 13:44                 ` Ajan
@ 2025-03-12 13:46                   ` memristor2 via groups.io
  0 siblings, 0 replies; 11+ messages in thread
From: memristor2 via groups.io @ 2025-03-12 13:46 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 811 bytes --]

WIll do. Thanks

Sent with [Proton Mail](https://proton.me/mail/home) secure email.

On Wednesday, March 12th, 2025 at 5:14 PM, Ajan <ajan.zhong@newfw.com> wrote:

> On Wed, Mar 12, 2025 at 06:05 PM, memristor2 wrote:
>
>> efi:memattr:UnexpectedEFIMemoryAttributestableversion2
>
> It should be an E820 table issue or MTRR issue.
> There should be memory resource Hob info printed when Payload boots, you can check whether all memory maps are correct.
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121191): https://edk2.groups.io/g/devel/message/121191
Mute This Topic: https://groups.io/mt/111617309/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 2460 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-03-12 13:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 12:10 [edk2-devel] Linux kernel Hangs after exit_boot_services using UEFIPayload memristor2 via groups.io
2025-03-10 12:39 ` Ajan
2025-03-10 12:57   ` memristor2 via groups.io
2025-03-10 13:11     ` Ajan
2025-03-10 13:29       ` memristor2 via groups.io
2025-03-10 13:30         ` memristor2 via groups.io
2025-03-10 13:38           ` Ajan
2025-03-10 13:53             ` memristor2 via groups.io
     [not found]             ` <182B756C71707289.31525@groups.io>
2025-03-12 10:05               ` memristor2 via groups.io
2025-03-12 13:44                 ` Ajan
2025-03-12 13:46                   ` memristor2 via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox