Instructions
The attestation of the workload includes the CPU state information.
When the workload that was running in the AMD keep exits, the system stores the state in the special area (VMSA). When the workload is started again, it loads the state back. This is a well-defined process and works.
The initial state, however, needs to be better defined. Currently, it is defined by Kernel without userspace knowledge or ability to influence. As a result, Enarx does not know the initial state and has to guess. If it guesses right the attestation would include the correct data and everything would check out. If Enarx guesses wrong the attestation of the workload would be incorrect.
VMSA MUST be public, since all parties need to agree on it. So the kernel choosing this information on its own and making everyone guess is unexpected behavior.
There are two questions:
If the kernel chooses the initial state, it MUST communicate it to userspace. But this makes the process fragile. Every kernel version might choose a different initial state. So this is very bad for implementation stability.
Our preferred approach is that userspace chooses the initial value and communicates it to the kernel (and other parties).
The kernel can still choose to reject this initial state if it doesn't like it. But userspace gets more stability this way.
LAUNCH_UPDATE_VMSA_RESET_VECTOR
command with SEV_FEATURES
and VINTR_CTRL
as parameters (which will get measured). The firmware will overwrite the inital VMSA with its reset vector VMSA version and will add the SEV_FEATURES
and VINTR_CTRL
. So, it shouldn't make a difference what initial VMSA the kernel provides, the firmware would choose its own and this will keep the kernel out of the whole game.