[coreboot-gerrit] Change in coreboot[master]: soc/intel/denverton_ns: Implement AES-NI Lock
Julien Viard de Galbert (Code Review)
gerrit at coreboot.org
Thu Mar 29 15:08:02 CEST 2018
Julien Viard de Galbert has uploaded this change for review. ( https://review.coreboot.org/25440
Change subject: soc/intel/denverton_ns: Implement AES-NI Lock
......................................................................
soc/intel/denverton_ns: Implement AES-NI Lock
Change-Id: I6cf3484e46eebd3dc753d0903ea8555712b99b7e
Signed-off-by: Julien Viard de Galbert <jviarddegalbert at online.net>
---
M src/soc/intel/denverton_ns/cpu.c
M src/soc/intel/denverton_ns/include/soc/msr.h
2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/25440/1
diff --git a/src/soc/intel/denverton_ns/cpu.c b/src/soc/intel/denverton_ns/cpu.c
index ede4dae..d22cc58 100644
--- a/src/soc/intel/denverton_ns/cpu.c
+++ b/src/soc/intel/denverton_ns/cpu.c
@@ -107,6 +107,13 @@
msr.lo |= FAST_STRINGS_ENABLE_BIT;
wrmsr(IA32_MISC_ENABLE, msr);
+ /* Lock AES-NI only if supported */
+ if (cpuid_ecx(1) & (1 << 25)) {
+ msr = rdmsr(MSR_FEATURE_CONFIG);
+ msr.lo |= FEATURE_CONFIG_LOCK; /* Lock AES-NI */
+ wrmsr(MSR_FEATURE_CONFIG, msr);
+ }
+
/* Enable Turbo */
enable_turbo();
diff --git a/src/soc/intel/denverton_ns/include/soc/msr.h b/src/soc/intel/denverton_ns/include/soc/msr.h
index 05ccc65..cc2e26e 100644
--- a/src/soc/intel/denverton_ns/include/soc/msr.h
+++ b/src/soc/intel/denverton_ns/include/soc/msr.h
@@ -29,6 +29,8 @@
#define MSR_PMG_CST_CONFIG_CONTROL 0xe2
#define MSR_PMG_IO_CAPTURE_BASE 0xe4
#define MSR_FEATURE_CONFIG 0x13c
+#define FEATURE_CONFIG_RESERVED_MASK 0x3ULL
+#define FEATURE_CONFIG_LOCK (1 << 0)
#define IA32_MCG_CAP 0x179
#define IA32_MCG_CAP_COUNT_MASK 0xff
#define IA32_MCG_CAP_CTL_P_BIT 8
--
To view, visit https://review.coreboot.org/25440
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cf3484e46eebd3dc753d0903ea8555712b99b7e
Gerrit-Change-Number: 25440
Gerrit-PatchSet: 1
Gerrit-Owner: Julien Viard de Galbert <jviarddegalbert at online.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180329/dadc182d/attachment-0001.html>
More information about the coreboot-gerrit
mailing list