2024-06-20 08:31:02 +00:00
|
|
|
From dd543686c34fc3c6ddfafc0104066889ad9d1813 Mon Sep 17 00:00:00 2001
|
2024-02-19 10:57:22 +00:00
|
|
|
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
|
Date: Tue, 30 Jan 2024 14:04:41 +0100
|
2024-03-12 07:30:57 +00:00
|
|
|
Subject: [PATCH] OvmfPkg/Sec: use cache type #defines from ArchitecturalMsr.h
|
2024-02-19 10:57:22 +00:00
|
|
|
|
|
|
|
RH-Author: Gerd Hoffmann <None>
|
|
|
|
RH-MergeRequest: 55: OvmfPkg/Sec: Setup MTRR early in the boot process.
|
|
|
|
RH-Jira: RHEL-21704
|
|
|
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
|
RH-Commit: [4/4] 55f00e3e153ca945ca458e7abc26780a8d83ac85 (kraxel.rh/centos-src-edk2)
|
|
|
|
|
|
|
|
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
|
Message-ID: <20240130130441.772484-5-kraxel@redhat.com>
|
2024-03-12 07:30:57 +00:00
|
|
|
|
|
|
|
patch_name: edk2-OvmfPkg-Sec-use-cache-type-defines-from-Architectura.patch
|
|
|
|
present_in_specfile: true
|
|
|
|
location_in_specfile: 52
|
2024-02-19 10:57:22 +00:00
|
|
|
---
|
|
|
|
OvmfPkg/IntelTdx/Sec/SecMain.c | 2 +-
|
|
|
|
OvmfPkg/Sec/SecMain.c | 2 +-
|
|
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/OvmfPkg/IntelTdx/Sec/SecMain.c b/OvmfPkg/IntelTdx/Sec/SecMain.c
|
2024-06-20 08:31:02 +00:00
|
|
|
index 7094d86159..1a19f26178 100644
|
2024-02-19 10:57:22 +00:00
|
|
|
--- a/OvmfPkg/IntelTdx/Sec/SecMain.c
|
|
|
|
+++ b/OvmfPkg/IntelTdx/Sec/SecMain.c
|
2024-06-20 08:31:02 +00:00
|
|
|
@@ -69,7 +69,7 @@ SecMtrrSetup (
|
2024-02-19 10:57:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-06-20 08:31:02 +00:00
|
|
|
index 725b57e2fa..26963b924d 100644
|
2024-02-19 10:57:22 +00:00
|
|
|
--- a/OvmfPkg/Sec/SecMain.c
|
|
|
|
+++ b/OvmfPkg/Sec/SecMain.c
|
2024-06-20 08:31:02 +00:00
|
|
|
@@ -765,7 +765,7 @@ SecMtrrSetup (
|
2024-02-19 10:57:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|