Skip to content

Commit 4e45a3e

Browse files
authored
Merge pull request #2671 from pareenaverma/content_review
MEC section edits to CCA LP
2 parents 684dac8 + c297e8d commit 4e45a3e

File tree

1 file changed

+15
-14
lines changed
  • content/learning-paths/servers-and-cloud-computing/cca-container

1 file changed

+15
-14
lines changed

content/learning-paths/servers-and-cloud-computing/cca-container/cca-mec.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,28 @@ Download the [`armswdev/cca-learning-path:cca-simulation-v3`](https://hub.docker
1414

1515
## About Memory Encryption Context (MEC)
1616

17-
Memory Encryption Contexts (MEC) are configurations of encryption that are associated with areas of memory, assigned by the MMU.
17+
Memory Encryption Contexts (MEC) is an extension of the Arm Realm Management Extension (RME). MEC extends the existing support for memory encryption, allowing multiple encryption contexts in the Realm Physical Address Space. In an RME system with MEC, each access to a physical address is tagged with a Memory Encryption Context Identifier (MECID), which associates the access with a specific memory encryption context. The Arm Confidential Compute Architecture (CCA) requires that the Realm, Secure, and Root PASes are encrypted. Without MEC, the encryption context used within each PAS is global to that PAS. For example, all Realm memory would use the same encryption context.
1818

19-
MEC is an extension to the Arm Realm Management Extension (RME). The RME system architecture requires that the Realm, Secure, and Root PASes are encrypted. The encryption key or tweak, or encryption context, used with each of these PASes is global within that PAS. So, for example, for the Realm PAS, all Realm memory uses the same encryption context.
19+
With MEC, this model is extended. Non-secure, Secure, and Root PAS accesses use a default MECID value (0), while the Realm PAS supports multiple MECIDs. This allows each Realm to use a distinct memory encryption context, providing additional defense in depth beyond the isolation already provided by RME. The Realm Management Monitor (RMM) itself can also use a separate encryption context.
2020

21-
With MEC this concept is broadened, and for the Realm PAS specifically, this allow each Realm to have a unique encryption context. This provides additional defense in depth to the isolation already provided in RME. Realms and RMM itself can all have separate encryption. MECIDs are identifying tags that are associated with different Memory Encryption Contexts. MECIDs are assigned to different software entities in the system, for example, Realms or the RMM.
2221

23-
## RMM without FEAT_MEC
22+
## Run the FVP without FEAT_MEC
2423

25-
When the FVP starts, it can be configured to advertize that it has MEC support by setting `FEAT_MEC` in the system configuration registers. The CCA software stack will detect that MEC is available, and as configured in the CCA stack built for the `armswdev/cca-learning-path:cca-simulation-v3` will make use of it.
24+
When the FVP starts, it can advertise support for MEC by exposing the `FEAT_MEC` CPU feature. The CCA software stack detects whether `FEAT_MEC` is available and enables MEC support accordingly.
2625

27-
First, fire up a container:
26+
First, start the docker container:
2827

2928
```console
3029
docker run --rm -it armswdev/cca-learning-path:cca-simulation-v3
3130
```
3231

33-
Then start a CCA host in the FVP (without MEC):
32+
Then start a CCA host in the FVP without enabling MEC:
3433

3534
```console
3635
./run-cca-fvp.sh
3736
```
3837

39-
This boots the 3 worlds. Switch to the second screen of `screen` by pressing `ctrl+a 2`, which corresponds to the output console of the RMM. It should look like:
38+
This boots the 3 worlds. Switch to the second `screen` console by pressing `ctrl+a 2`, which corresponds to the RMM output console. The output on the console should look similar to:
4039

4140
```output
4241
Trying ::1...
@@ -68,19 +67,19 @@ RMM_MEM_SCRUB_METHOD=2 is set but FEAT_MEC is not present.
6867
SMC_RMI_VERSION 10000 > RMI_SUCCESS 10000 10001
6968
```
7069

71-
Note how the RMM has detected `FEAT_MEC`is not available --- and complains about it.
70+
The messages indicate that the RMM has detected that FEAT_MEC is not available.
7271

7372
You can now bring down the FVP simulation. Switch back to the main `screen` console with `ctrl+a 1`, log in as `root` (no password) and `poweroff` to exit.
7473

75-
## RMM with FEAT_MEC enabled
74+
## Run the FVP with FEAT_MEC enabled
7675

77-
Now, start the CCA host in the FVP with `FEAT_MEC` enabled:
76+
Next, start the CCA host in the FVP with `FEAT_MEC` enabled:
7877

7978
```console
8079
./run-cca-fvp.sh --enable-mec
8180
```
8281

83-
This boots the 3 worlds again. Switch to the RMM output console (second screen of `screen` with `ctrl+a 2`). It should look like:
82+
This again boots the three worlds. Switch to the RMM output console (ctrl+a 2). It should look similar to:
8483

8584
```output
8685
Trying ::1...
@@ -104,6 +103,8 @@ RMM_MEM_SCRUB_METHOD 2 is selected.
104103
SMC_RMI_VERSION 10000 > RMI_SUCCESS 10000 10001
105104
```
106105

107-
With `FEAT_MEC` enabled, the RMM detects it and no longer complain about it missing. The RMM will now use different memory encryption contexts for each of the realms that you would start with the `lkvm` command from the previous pages.
106+
With FEAT_MEC enabled, the RMM detects MEC support and no longer reports it as missing. The RMM will now make use of multiple memory encryption contexts, assigning distinct MECIDs to Realms that you create using the lkvm command in the previous sections of this learning path.
108107

109-
You can now bring down the FVP simulation. Switch back to the main `screen` console with `ctrl+a 1`, log in as `root` (no password) and `poweroff` to exit. You can also exit the docker container with `exit`.
108+
You can now shut down the FVP simulation. Switch back to the main screen console with ctrl+a 1, log in as root (no password), and run poweroff to exit. You can then exit the docker container with exit.
109+
110+
You have learned how to enable Memory Encryption Contexts (MEC) on the FVP and verified that the RMM detects and uses this capability.

0 commit comments

Comments
 (0)