You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/cca-container/cca-mec.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,29 +14,28 @@ Download the [`armswdev/cca-learning-path:cca-simulation-v3`](https://hub.docker
14
14
15
15
## About Memory Encryption Context (MEC)
16
16
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.
18
18
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.
20
20
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.
22
21
23
-
## RMM without FEAT_MEC
22
+
## Run the FVP without FEAT_MEC
24
23
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.
26
25
27
-
First, fire up a container:
26
+
First, start the docker container:
28
27
29
28
```console
30
29
docker run --rm -it armswdev/cca-learning-path:cca-simulation-v3
31
30
```
32
31
33
-
Then start a CCA host in the FVP (without MEC):
32
+
Then start a CCA host in the FVP without enabling MEC:
34
33
35
34
```console
36
35
./run-cca-fvp.sh
37
36
```
38
37
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:
40
39
41
40
```output
42
41
Trying ::1...
@@ -68,19 +67,19 @@ RMM_MEM_SCRUB_METHOD=2 is set but FEAT_MEC is not present.
68
67
SMC_RMI_VERSION 10000 > RMI_SUCCESS 10000 10001
69
68
```
70
69
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_MECis not available.
72
71
73
72
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.
74
73
75
-
## RMM with FEAT_MEC enabled
74
+
## Run the FVP with FEAT_MEC enabled
76
75
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:
78
77
79
78
```console
80
79
./run-cca-fvp.sh --enable-mec
81
80
```
82
81
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:
84
83
85
84
```output
86
85
Trying ::1...
@@ -104,6 +103,8 @@ RMM_MEM_SCRUB_METHOD 2 is selected.
104
103
SMC_RMI_VERSION 10000 > RMI_SUCCESS 10000 10001
105
104
```
106
105
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.
108
107
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