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

Updates for ARC feedback #182, #198 and #201 #208

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

vlsunil
Copy link
Collaborator

@vlsunil vlsunil commented Nov 8, 2024

My attempt to resolve ARC feedback regarding UEFI variable persistence, SATP and ACPI device property section. Please review and suggest better wordings or if I am missing any thing.

@vlsunil
Copy link
Collaborator Author

vlsunil commented Nov 8, 2024

@andreiw @jhauser-us @avpatel @adurbin-rivos - please review.

@vlsunil vlsunil changed the title Updates to ARC feedback #182, #198 and #201 Updates for ARC feedback #182, #198 and #201 Nov 8, 2024
Copy link
Collaborator

@andreiw andreiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention of URT_040 was to avoid RPi-like UEFI implementations, where NV variables are in practice volatile after ExitBootServices. This leads to bad experiences with OS installers and probably other things.

Pi 4 had no non-volatile store beyond the SD card. Variables were persisted in RPI_EFI.FD during Boot Services, but he SD card could not be accessed after OS use, so - no non-volatile vars in the OS.

URT_040 refers to a behavior wrt ResetSystem, and that was intended - again, deficient designs like RPi4 could, during their ResetSystem path, flush out NV variables to persistent store (now that the OS is out of the way)

Copy link
Collaborator

@andreiw andreiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate to be pendantic, but the UEFI spec already talks about identity mapping for RAM regions as a requirement.

Probably want an additional requirement that EFI_MEMORY_ATTRIBUTE_PROTOCOL and EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() are implemented and non-dummy (really affects page attributes).

@adurbin-rivos
Copy link
Collaborator

It seems that people feel that system designs should follow the already written requirements in the specs vs trying to re-describe or over-describe things to keep people from shooting themselves in the foot. I'm fine w/ these changes as I'm more on the side of "people should design things correctly" vs trying to prevent larger mistakes.

@adurbin-rivos adurbin-rivos self-assigned this Nov 8, 2024
@ved-rivos
Copy link
Collaborator

If its a common mistake then its not a bad idea to call it out. The rule book is intended to be helpful.

uefi.adoc Outdated Show resolved Hide resolved
@vlsunil
Copy link
Collaborator Author

vlsunil commented Nov 11, 2024

The intention of URT_040 was to avoid RPi-like UEFI implementations, where NV variables are in practice volatile after ExitBootServices. This leads to bad experiences with OS installers and probably other things.

Pi 4 had no non-volatile store beyond the SD card. Variables were persisted in RPI_EFI.FD during Boot Services, but he SD card could not be accessed after OS use, so - no non-volatile vars in the OS.

URT_040 refers to a behavior wrt ResetSystem, and that was intended - again, deficient designs like RPi4 could, during their ResetSystem path, flush out NV variables to persistent store (now that the OS is out of the way)

Ahh OK. Thanks!. I thought that was the intention. In that case, let's rephrase the requirement that "The UEFI variables MUST be persistent across ResetSystem() call". I hope that should be clear enough requirement.

@vlsunil
Copy link
Collaborator Author

vlsunil commented Nov 11, 2024

I hate to be pendantic, but the UEFI spec already talks about identity mapping for RAM regions as a requirement.

While I agree with that, I think it is better to mention again here since we are talking about MMU configuration. This should make it clear that we are still requiring identity map while configuring non-BARE mode.

Probably want an additional requirement that EFI_MEMORY_ATTRIBUTE_PROTOCOL and EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() are implemented and non-dummy (really affects page attributes).

Good point. However, it is better to avoid requiring EFI_CPU_ARCH_PROTOCOL which is part of PI spec. Better to leave to the FW implementation to provide EFI_MEMORY_ATTRIBUTE_PROTOCOL even when they are not PI complaint. WDYT?

URT_040 merely states that non-volatile UEFI variables must be
persistent across reboots. This is redundant statement and the
requirement is not very clear. The intention of the requirement is to
mandate non-volatile UEFI variables. So, just make it is clear that UEFI
variables must be persistent.

Fixes: riscv-non-isa#201
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
The intention of UEFI_030 is to configure the MMU in UEFI firmware for
memory protection use cases while keeping the identify mapping. Add bit
more text around this to clarify the intention.

Fixes: riscv-non-isa#182
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
The RVI-specific ACPI Device Properties section exists as a place holder
to define standard DSD properties in the "rscv-" namespace. While there
are no properties currently defined, it is the place where one can add
new properties approved by appropriate RVI forum. Try to reword to make
the intention clear.

Fixes: riscv-non-isa#198
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
@avpatel avpatel merged commit c477510 into riscv-non-isa:main Nov 19, 2024
2 checks passed
@xypron
Copy link
Contributor

xypron commented Dec 3, 2024

In that case, let's rephrase the requirement that "The UEFI variables MUST be persistent across ResetSystem() call". I hope that should be clear enough requirement.

This get's it wrong. Volatile variables should not be persisted. Only variables with attribute EFI_VARIABLE_NON_VOLATILE must be persisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants