-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support for Arm CCA guest firmware v3 (RMM-v1.0-rel0) #6480
Open
samimujawar
wants to merge
57
commits into
tianocore:master
Choose a base branch
from
samimujawar:3223_arm_cca_rmm_v1.0_rel0_v3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
33d03a0
ArmPkg: Add helper function to detect RME
samimujawar 571106d
ArmPkg: Introduce SetMemoryProtectionAttribute() for Realms
samimujawar 95c8d03
ArmPkg: Extend number of parameter registers in SMC call
samimujawar c52c4f2
ArmVirtPkg: Add Arm CCA Realm Service Interface Library
samimujawar e6a862d
ArmVirtPkg: ArmCcaRsiLib: Add interfaces to manage the Realm IPA state
samimujawar f7deb4a
ArmVirtPkg: ArmCcaRsiLib: Add an interface to get an attestation token
samimujawar d231896
ArmVirtPkg: ArmCcaRsiLib: Add interfaces to get/extend REMs
samimujawar 2776a72
ArmVirtPkg: ArmCcaRsiLib: Add an interface to make a RSI Host Call
samimujawar 64a6ed3
ArmVirtPkg: Define a GUID HOB for IPA width of a Realm
samimujawar 0a39bde
ArmVirtPkg: Add library for Arm CCA initialisation in PEI
samimujawar f3ae8ce
ArmVirtPkg: Add NULL instance of ArmCcaInitPeiLib
samimujawar 3d4d8cb
ArmVirtPkg: Add library for Arm CCA helper functions
samimujawar d5b68cc
ArmVirtPkg: Add Null instance of ArmCcaLib
samimujawar 354de43
ArmVirtPkg: Define an interface to configure MMIO regions for Arm CCA
samimujawar e1f5304
ArmVirtPkg: CloudHv: Add a NULL implementation of ArmCcaConfigureMmio
samimujawar 5bcb8cb
ArmVirtPkg: Qemu: Add a NULL implementation of ArmCcaConfigureMmio
samimujawar 5233327
ArmVirtPkg: Xen: Add a NULL implementation of ArmCcaConfigureMmio
samimujawar 9d45084
ArmVirtPkg: Configure the MMIO regions for Arm CCA
samimujawar c5ec28e
ArmVirtPkg: Kvmtool: Use Null version of DebugLib in PrePi
samimujawar 9f7b47c
ArmVirtPkg: Add Arm CCA libraries for Kvmtool guest firmware
samimujawar bd5b011
ArmVirtPkg: Arm CCA configure system memory in early Pei
samimujawar 99dd7ed
ArmVirtPkg: Perform Arm CCA initialisation in the Pei phase
samimujawar 009e0c3
ArmVirtPkg: Introduce Realm Aperture Management Protocol
samimujawar 9faad03
ArmVirtPkg: IoMMU driver to DMA from Realms
samimujawar b567cb4
ArmVirtPkg: Enable Virtio communication for Arm CCA
samimujawar c32af9b
MdePkg: Warn if AArch64 RNDR instruction is not supported
samimujawar 7e6f46f
ArmVirtPkg: Kvmtool: Switch to use BaseRng for AArch64
samimujawar ae52985
ArmVirtPkg: ArmCcaRsiLib: Fix incorrect RSI version masks
samimujawar 56bc6aa
ArmVirtPkg: ArmCcaRsiLib: Fix size of Imm field in HostCallArgs
samimujawar 3743ca3
ArmVirtPkg: RMM 1.0-bet1 - Update width of RSI host call struct
samimujawar bb5b2bb
ArmVirtPkg: RMM 1.0-bet2 - Increase number of RSI host call args
samimujawar add3c5e
ArmVirtPkg: RMM 1.0-eac0 - Update RsiSetIpaState parameter usage
samimujawar 67911fa
ArmVirtPkg: RMM 1.0-eac1 - Relax alignment of RSI host call arg
samimujawar 069fedb
ArmVirtPkg: RMM 1.0-eac2 - Update RsiRealmConfig structure
samimujawar 510d606
ArmVirtPkg: RMM 1.0-eac2 - Add RIPAS DESTROYED state
samimujawar fee563d
ArmVirtPkg: RMM 1.0-eac2 - Add RsiRipasChangeFlags definitions
samimujawar 6af2c0b
ArmVirtPkg: RMM 1.0-eac2 - Add Flags to RsiSetIpaState()
samimujawar f1a3e5c
ArmVirtPkg: RMM 1.0-eac3 - Handle RsiSetIpaState() response
samimujawar da5c906
ArmVirtPkg: RMM 1.0-eac4 - Add RSI Features support
samimujawar 2617e5f
ArmVirtPkg: RMM 1.0-eac5 - Attestation token API updates
samimujawar 63cb1ba
ArmVirtPkg: RMM 1.0-eac5 - Update RSI Version support
samimujawar 79791d4
ArmVirtPkg: ArmCcaLib: Cache current world value
samimujawar ea67920
ArmVirtPkg: ArmCcaIoMmu: Provide an implementation for SetAttribute
samimujawar 2a745dd
ArmVirtPkg: RMM 1.0-rel0 - Update RIPAS state to add RipasDev
samimujawar 39f68d0
ArmVirtPkg: RMM 1.0-rel0 - Add IPA range param to RsiGetIpaState()
samimujawar 32923c2
ArmVirtPkg: RMM 1.0-rel0 - Add RPV to RealmConfig
samimujawar f7c1410
ArmVirtPkg: RMM 1.0-rel0 - Add RSI_ERROR_UNKNOWN return code
samimujawar f4b937e
ArmVirtPkg: Introduce an ArmPlatformDeviceInfo lib
samimujawar eb79f94
ArmVirtPkg: ArmPlarformDeviceInfoLib - add GIC parser
samimujawar 67145cf
ArmVirtPkg: ArmPlarformDeviceInfoLib - add PCI parser
samimujawar 5f5ad19
ArmVirtPkg: ArmPlatformDeviceInfoLib - add dev parser
samimujawar 678cd43
ArmVirtPkg: ArmPlatformDeviceInfoLib - add serial parser
samimujawar c2454b2
ArmVirtPkg: ArmPlatformDeviceInfoLib - add RTC parser
samimujawar 16f089c
ArmVirtPkg: Kvmtool - Parse FDT to populate mem map
samimujawar 209dbf5
ArmVirtPkg: RMM 1.0-rel0 - Helper to check protected MMIO address
samimujawar 43476c3
ArmVirtPkg: RMM 1.0-rel0 - Exclude MMIO config of Realm Devices
samimujawar 535c33f
ArmVirtPkg: Kvmtool: Only install IORT if ITS is present
samimujawar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in the Arm CCA PR? On a quick glance this looks like some independent change.
Also why put this into ArmVirt? We have other platforms like riscv which use device trees too and can probably use this code too, so I think OvmfPkg would be a better place for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Gerd,
Thank you for reviewing the patch series and for the feedback.
Yes, I agree this is an independent change and is a general improvement for normal VMs as well. However, this was introduced as this a requirement for a Realm VM, please see
43476c3 and therefore submitted along with this series.
However, please do let me know if you think I should submit this as a separate patch.
I agree this can be utilised by other architectures as well and it can be moved to OvmfPkg. However, I think there may be some additional changes required for supporting other architectures, e.g. there is a pending series that should help pave the way for this change, see a1f2654
Since this patch is a subset of the FdtHwInfoParser, I think similar changes would apply here as well. Considering that, I think it would be good to pursue this effort once the RiscV support is enabled in Dynamic Tables.
Please do let me know if you think otherwise, and I will update this PR accordingly.
Regards,
Sami Mujawar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew. Is there some overview how the hardware detection works in for Realm VMs? Apparently this is different from the usual qemu workflow, where qemu generates both FDT and ACPI tables, the guest firmware simply downloads them via FwCfg and installs them in guest memory.
So Realm VMs get a FDT only apparently (where does it come from?), then use DynamicTablesPkg to generate the ACPI tables inside the guest, correct? Where exactly in this workflow is this change needed? Parse the FDT and generate descriptions tables which DynamicTablesPkg can consume?
On riscv: Yes, sure, additinal changes will be needed to have the riscv firmware actually use this (and this is obviously beyond the scope of this PR).. But if this is something which is likely to happen we should merge the code into OvmfPkg right away instead of merging to ArmVirt and move over to OvmfPkg later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the ACPI table generation is specific to the ArmVirtKvmTool. If I remember correctly, ArmVirtQemu and ArmVirtCloudHv don't have it, so it's not (yet) a property of Realm VMs, only Kvmtool VMs. At the moment in my experimental Realm support for ArmVirtQemu, QEMU still generates ACPI tables in addition to FDT (though I haven't tested ACPI boot).
There is a larger question of whether we should create a single edk2 image for all Realm VMs, based on ArmVirtKvmtool but supporting QEMU, cloud-hypervisor and others. Given that Realm VMs have specific needs (initialization through RMM RSI, early attestation, lack of NV storage, reduced attack surface...) it would be nice to have all those things in a single image rather than porting them to each existing ArmVirt*. I've been meaning to investigate this but haven't found the time.
Having FDT->ACPI generation on this single image could also be useful for attestation. Given that firmware tables are measured (to ensure the untrusted host does not include harmful data in them), a verifier needs to be able to independently reconstruct the firmware tables, and it would reduce the efforts needed by verifiers to only measure one set of firmware tables rather than both FDT and ACPI. In QEMU the FDT is placed in memory, and ACPI tables are sent via FwCfg (whose address is found in the FDT). I believe CloudHV places both in memory and the project doesn't want to implement FwCfg.
This would require FDT to be able to represent everything ACPI can (at least for arm64 VMs), and some things may be missing. vCPU hotplug is a recent feature on Arm and I believe still requires ACPI at the moment. There might be others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the reasons qemu generates ACPI tables for the guest is to decouple firmware and qemu, i.e. qemu can add new features which require ACPI table updates without depending on firmware updates.
This might be less of a concern for Realm VMs. I'm wondering whenever it is actually possible to support cpu hotplug (or memory hotplug) for Realm VMs, and there are probably more features which are not useful for CC guests.
So the idea to have a single Realm VM firmware image and have the image generate ACPI tables from FDT looks workable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While being at it: Setting
PcdConfidentialComputingGuestAttr
probably makes sense.