aboutsummaryrefslogtreecommitdiffstats
path: root/launch-qemu.sh
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2020-05-24 07:14:11 -0500
committerBrijesh Singh <brijesh.singh@amd.com>2020-05-24 07:14:11 -0500
commitcd68fbefd9c9470539cf5656074906b3baeca63c (patch)
treebabbd696343964675dc905a9bbae758fcf1ed732 /launch-qemu.sh
parentf50f628deebbb0b6f5ec64fe5f4d7137f83e3f5b (diff)
downloadcachepc-amdsev-cd68fbefd9c9470539cf5656074906b3baeca63c.tar.gz
cachepc-amdsev-cd68fbefd9c9470539cf5656074906b3baeca63c.zip
fix SEV policy calculation and remove thp change from grub
Diffstat (limited to 'launch-qemu.sh')
-rwxr-xr-xlaunch-qemu.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/launch-qemu.sh b/launch-qemu.sh
index db13e7f..43cec9b 100755
--- a/launch-qemu.sh
+++ b/launch-qemu.sh
@@ -220,12 +220,15 @@ if [ ${SEV} = "1" ]; then
[ "${ALLOW_DEBUG}" = "1" ] && POLICY=$((POLICY & ~0x01))
[ "${SEV_ES}" = "1" ] && POLICY=$((POLICY | 0x04))
SEV_POLICY=$(printf ",policy=%#x" $POLICY)
- SEV_POLICY=",policy=0xB0000"
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))
+
# check if THP is disable
cat /sys/kernel/mm/transparent_hugepage/enabled | grep -w "\[never\]"
if [ $? -ne 0 ]; then