Skip to content

Allow access to test UART from secure world for QEMU SBSA#227

Open
philgweber wants to merge 1 commit intoOpenDevicePartnership:mainfrom
philgweber:main
Open

Allow access to test UART from secure world for QEMU SBSA#227
philgweber wants to merge 1 commit intoOpenDevicePartnership:mainfrom
philgweber:main

Conversation

@philgweber
Copy link
Copy Markdown
Contributor

@philgweber philgweber commented Apr 10, 2026

Description

This change just maps in address range 0x60130000 as valid device memory, so in cases with QEMU where we expose an extra UART for test we can access this memory range from secure world. If UART is not exposed accesses will just fail in QEMU.

This UART is used to map to a physical UART on the computer running QEMU to allow us to attach external test devices for EC and other HW validation.

  • Impacts functionality? Adds support to access UART when exposed.
  • Impacts security? On computers where UART is mapped to physical device allows access to this physical device
  • Breaking change? No
  • Includes tests? Test cases and validation being added to odp-platform-qemu-sbsa which makes use of this feature.
  • Includes documentation? Documentation is added to SBSA for using this as it is not directly used withing patina-qemu

How This Was Tested

On odp-platform-qemu-sbsa branch with updated qemu from odp-qemu-builder and updated RUST partition to map this region in the DTS, validated that we can read/write data from secure partition over UART as specified.

Integration Instructions

N/A

@github-actions github-actions bot added the impact:security Has a security impact label Apr 10, 2026
@cfernald cfernald requested review from Raymond-MS and kuqin12 April 10, 2026 19:51
@makubacki makubacki enabled auto-merge (squash) April 10, 2026 19:58
+
+ memory@12 {
+ device_type = "device-memory"; /* UART */
+ reg = <0x0 0x60130000 0x0 0x00001000>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a UART region from a customized QEMU, right? The inbox sbsa does not have this port.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, as we removed the original C secure partition, the 0x60030000 port has no consumers as of today. I was going to switch stmm to use that port. But if you can make better use of 0x60030000, we can leave it mapped for your usage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I had patched QEMU here to exposed a fourth serial port since all the other ones were being used by QEMU. OpenDevicePartnership/odp-qemu-builder@49b63b5

If you are switching StMM to use the secure partition port, I can use the one StMM was using. For extra debug it may still be nice to have another extra port beyond that if we want to leave this one defined.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. I think we can get this in as there is no consumer from this current repo. But let's please add some more comments in the PR description with the QEMU customization link as the firmware will fault if we try to use this region with the in-stock qemu .

Copy link
Copy Markdown
Contributor

@Raymond-MS Raymond-MS left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:security Has a security impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants