summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2024-01-25 08:39:18 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-26 06:04:49 +0000
commit78bccfec9ce5082499db035270e7998d5330d75c (patch)
treeb96ad729923fbb3fc39b4c019b18a71a0be321b1
parent71e6cc8dad2de85512de2fdd6439ae2ebada295d (diff)
downloadedk2-78bccfec9ce5082499db035270e7998d5330d75c.tar.gz
edk2-78bccfec9ce5082499db035270e7998d5330d75c.tar.bz2
edk2-78bccfec9ce5082499db035270e7998d5330d75c.zip
OvmfPkg/Sec: use cache type #defines from ArchitecturalMsr.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--OvmfPkg/IntelTdx/Sec/SecMain.c2
-rw-r--r--OvmfPkg/Sec/SecMain.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/OvmfPkg/IntelTdx/Sec/SecMain.c b/OvmfPkg/IntelTdx/Sec/SecMain.c
index 6eeae09e3b..95a31af029 100644
--- a/OvmfPkg/IntelTdx/Sec/SecMain.c
+++ b/OvmfPkg/IntelTdx/Sec/SecMain.c
@@ -69,7 +69,7 @@ SecMtrrSetup (
}
DefType.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE);
- DefType.Bits.Type = 6; /* write back */
+ DefType.Bits.Type = MSR_IA32_MTRR_CACHE_WRITE_BACK;
DefType.Bits.E = 1; /* enable */
AsmWriteMsr64 (MSR_IA32_MTRR_DEF_TYPE, DefType.Uint64);
}
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index b0bb7b295d..c1c08a947a 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -765,7 +765,7 @@ SecMtrrSetup (
}
DefType.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE);
- DefType.Bits.Type = 6; /* write back */
+ DefType.Bits.Type = MSR_IA32_MTRR_CACHE_WRITE_BACK;
DefType.Bits.E = 1; /* enable */
AsmWriteMsr64 (MSR_IA32_MTRR_DEF_TYPE, DefType.Uint64);
}