Skip to content

[Bug]: Panic in patina-qemu #558

@Javagedes

Description

@Javagedes

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

There is currently a panic at top of tree patina-qemu + patina-dxe-core-qemu + patina. I will have all related commits in the versioning section below.

I traced this to the following commit in the patina repo - Update to patina-paging v8 - e.g. it does not panic before this commit; it does panic after this commit.

INFO - INFO - InstallProtocolInterface: B7DFB4E1-052F-449F-87BE-9818FC91B733 @ 0x000000007ddef218
INFO - INFO - InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B @ 0x000000007e55de00
INFO - ERROR - EXCEPTION: PAGE FAULT
INFO - ERROR - Accessed Address: 0x51ff8
INFO - ERROR - Paging Enabled: true
INFO - ERROR - Instruction Pointer: 0x7ea6bb3e
INFO - ERROR - Code Segment: 0x38
INFO - ERROR - RFLAGS: 0x202
INFO - ERROR - Stack Segment: 0x30
INFO - ERROR - Data Segment: 0x30
INFO - ERROR - Stack Pointer: 0x7e97dc60
INFO - ERROR - Page Directory Base: 0x51000
INFO - ERROR - Paging Features (cr4): 0x668
INFO - ERROR - Error Code: 0x0
INFO -
INFO - ERROR - Page not present
INFO -
INFO - ERROR - R/W: Read
INFO -
INFO - ERROR - Mode: Supervisor
INFO -
INFO - ERROR - Reserved bit violation
INFO -
INFO - ERROR - Instruction fetch access

<Repeat the above until presumably a stack overflow>

INFO - ERROR - panicked at C:\src\patina2\patina\core\patina_internal_cpu\src\interrupts\x64\interrupt_manager.rs:121:5:
INFO - EXCEPTION: DOUBLE FAULT
INFO - InterruptStackFrame {
INFO -     instruction_pointer: VirtAddr(
INFO -         0x7ea455ca,
INFO -     ),
INFO -     code_segment: SegmentSelector {
INFO -         index: 0x7,
INFO -         rpl: Ring0,
INFO -     },
INFO -     cpu_flags: RFlags(
INFO -         PARITY_FLAG | 0x2,
INFO -     ),
INFO -     stack_pointer: VirtAddr(
INFO -         0x7e95f000,
INFO -     ),
INFO -     stack_segment: SegmentSelector {
INFO -         index: 0x6,
INFO -         rpl: Ring0,
INFO -     },
INFO - }
INFO - INFO - Dumping stack trace with PC: 0x7e9ecc9f, SP: 0x7eb11bf8
INFO - INFO -       # Child-SP              Return Address         Call Site
INFO - INFO -       0 000000007EB11BF8      000000007E9875B8       qemu_q35_dxe_core-14a830e799bba721+6DC9F
INFO - INFO -       1 000000007EB11C28      000000007EA9185F       qemu_q35_dxe_core-14a830e799bba721+85B8
INFO - INFO -       2 000000007EB11D38      000000007E9E8974       qemu_q35_dxe_core-14a830e799bba721+11285F
INFO - INFO -       3 000000007EB11D78      0000000000000006       qemu_q35_dxe_core-14a830e799bba721+69974
INFO - ERROR - StackTrace: Failed to locate a PE Image in memory with rip: 6

Expected Behavior

patina-qemu should be able to boot the UEFI Shell

Steps To Reproduce

<Assuming all repos are cloned to c:\\src\\patina >
2. Clone top of tree patina
3. Clone top of tree patina-dxe-core-qemu
4. run cargo make q35 C:\\src\\patina\\patina to build q35's dxe-core with top of tree patina
5. clone patina-qemu
6. setup patina-qemu - e.g. stuart_setup, stuart_update,
7. run stuart_build -c .\Platforms\QemuQ35Pkg\PlatformBuild.py --FlashRom BLD_*_DXE_CORE_BINARY_PATH=C:\src\patina\patina-dxe-core-qemu\target\x86_64-unknown-uefi
8. See build error
9. In patina checkout any commit before 3bb9821 and follow the above steps again
10. Do not see build error

Build Environment

- OS(s): Windows
- Tool Chain(s): VS2022
- Targets Impacted: DEBUG, RELEASE

Version Information

PATINA - c9dd63

PATINA-DXE-CORE-QEMU - 4A10032

PATINA-QEMU - f1d0933

Urgency

High

Are you going to fix this?

Someone else needs to fix it

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

@os-d @cfernald @kuqin12

Metadata

Metadata

Assignees

Labels

state:needs-triageNeeds to triaged to determine next stepstype:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions