Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I: Improvements for booting to Linux on RISC-V #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JohnAZoidberg
Copy link
Owner

Some miscellaneous patches, that each compile and still boot to UEFI
Shell, to allow for booting to Linux on HW and also prepare for Linux on
RiscvVirtPkg (RISC-V OVMF equivalent).

@JohnAZoidberg JohnAZoidberg marked this pull request as ready for review October 3, 2021 17:23
@JohnAZoidberg JohnAZoidberg force-pushed the improvements-for-booting-to-linux-on-riscv branch from 74c52b0 to 79e7101 Compare October 4, 2021 11:14
@JohnAZoidberg
Copy link
Owner Author

Sent to edk2-devel and reviewed already.

@JohnAZoidberg JohnAZoidberg force-pushed the improvements-for-booting-to-linux-on-riscv branch from 79e7101 to 3b4c3ca Compare October 16, 2021 09:14
Not DiskIoDxe because we don't have a disk, just for loading from
Ramdisks.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
While enumerating the PCIe devices, the driver tries to set some caching
attributes on the memory.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Otherwise it will crash on QEMU 6.0 with:

> Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A PciHostBridgeDxe.efi
> InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BF351F98
> ProtectUefiImageCommon - 0xBF365BC0
>   - 0x00000000BF814000 - 0x00000000000124C0
> PROGRESS CODE: V03040002 I0
> ProcessPciHost: Config[0x30000000+0x10000000) Bus[0x0..0xFF] Io[0x0+0x10000)@0x3000000 Mem32[0x40000000+0x40000000)@0x0 Mem64[0x400000000+0x400000000)@0x0
> CpuSetMemoryAttributes: Set memory attributes not supported yet
> CpuSetMemoryAttributes: Set memory attributes not supported yet
> RootBridge: PciRoot(0x0)
>   Support/Attr: 70001 / 70001
>     DmaAbove4G: Yes
> NoExtConfSpace: No
>      AllocAttr: 3 (CombineMemPMem Mem64Decode)
>            Bus: 0 - FF Translation=0
>             Io: 0 - FFFF Translation=0
>            Mem: 40000000 - 7FFFFFFF Translation=0
>     MemAbove4G: 400000000 - 7FFFFFFFF Translation=0
>           PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
>    PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
> CpuSetMemoryAttributes: Set memory attributes not supported yet
>
> ASSERT_EFI_ERROR (Status = Not Found)
> ASSERT [PciHostBridgeDxe] /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI_ERROR (CheckStatus)
> QEMU: Terminated

Change works on QEMU 5.2 and 6.0.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Otherwise we can't load a 3rd party image because we're still in DXE.
MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents
that.

Cc: Abner Chang <abner.chang@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
@JohnAZoidberg JohnAZoidberg force-pushed the improvements-for-booting-to-linux-on-riscv branch from 3b4c3ca to 3767cee Compare October 16, 2021 09:22
@JohnAZoidberg
Copy link
Owner Author

Added all the Reviewed-by and patchcheck says it's ok.
One commit message is too long, but I can't change it because it's the log output.

@JohnAZoidberg JohnAZoidberg changed the title Improvements for booting to Linux on RISC-V I: Improvements for booting to Linux on RISC-V Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant