aboutsummaryrefslogtreecommitdiffstats
path: root/launch-qemu.sh
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2021-08-20 11:48:44 -0500
committerBrijesh Singh <brijesh.singh@amd.com>2021-08-20 11:48:44 -0500
commitf12e63e0716e7b23a8284cfec3433a17fd1f562b (patch)
treef36cb962fa491bcf63724aa0ea2b374fd6c5afa9 /launch-qemu.sh
parent45dcd909861eebb4fba4349788b261d4cb7877d6 (diff)
downloadcachepc-amdsev-f12e63e0716e7b23a8284cfec3433a17fd1f562b.tar.gz
cachepc-amdsev-f12e63e0716e7b23a8284cfec3433a17fd1f562b.zip
update to use newer commit
Diffstat (limited to 'launch-qemu.sh')
-rwxr-xr-xlaunch-qemu.sh17
1 files changed, 7 insertions, 10 deletions
diff --git a/launch-qemu.sh b/launch-qemu.sh
index c5fff7b..e8a4722 100755
--- a/launch-qemu.sh
+++ b/launch-qemu.sh
@@ -53,6 +53,7 @@ run_cmd () {
}
get_cbitpos() {
+ modprobe cpuid
#
# Get C-bit position directly from the hardware
# Reads of /dev/cpu/x/cpuid have to be 16 bytes in size
@@ -215,6 +216,9 @@ fi
# If this is SEV guest then add the encryption device objects to enable support
if [ ${SEV} = "1" ]; then
+ add_opts "-machine memory-encryption=sev0,vmport=off"
+ get_cbitpos
+
if [ "${ALLOW_DEBUG}" = "1" -o "${SEV_ES}" = 1 ]; then
POLICY=$((0x01))
[ "${ALLOW_DEBUG}" = "1" ] && POLICY=$((POLICY & ~0x01))
@@ -223,17 +227,10 @@ if [ ${SEV} = "1" ]; then
fi
if [ "${SEV_SNP}" = 1 ]; then
- SEV_GUEST_SNP=",snp=yes"
-
- POLICY=$((0x30000))
- SEV_POLICY=$(printf ",policy=%#x" $POLICY)
- [ "${ALLOW_DEBUG}" = "1" ] && POLICY=$((POLICY | 0x80000))
+ add_opts "-object sev-snp-guest,id=sev0,cbitpos=${CBITPOS},reduced-phys-bits=1"
+ else
+ add_opts "-object sev-guest,id=sev0${SEV_POLICY},cbitpos=${CBITPOS},reduced-phys-bits=1"
fi
-
- get_cbitpos
-
- add_opts "-object sev-guest,id=sev0${SEV_POLICY},cbitpos=${CBITPOS},reduced-phys-bits=1${SEV_GUEST_SNP}"
- add_opts "-machine memory-encryption=sev0,vmport=off"
fi
# if -kernel arg is specified then use the kernel provided in command line for boot