summaryrefslogtreecommitdiff
path: root/usr.sbin/cpucontrol/intel.c
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2018-05-12 15:34:35 +0000
committerEd Maste <emaste@FreeBSD.org>2018-05-12 15:34:35 +0000
commit09e24fbe184ce8416d467bd2dd7ef246fa09897c (patch)
tree2caaeea92c92d5cab02ba3a055cb3fe7fec20307 /usr.sbin/cpucontrol/intel.c
parent0fb349906ef68608577702ca46e86aafdd7456b2 (diff)
downloadsrc-test2-09e24fbe184ce8416d467bd2dd7ef246fa09897c.tar.gz
src-test2-09e24fbe184ce8416d467bd2dd7ef246fa09897c.zip
Notes
Diffstat (limited to 'usr.sbin/cpucontrol/intel.c')
-rw-r--r--usr.sbin/cpucontrol/intel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/cpucontrol/intel.c b/usr.sbin/cpucontrol/intel.c
index 7eca224e1ee7..8ad1908bd386 100644
--- a/usr.sbin/cpucontrol/intel.c
+++ b/usr.sbin/cpucontrol/intel.c
@@ -95,7 +95,8 @@ intel_update(const char *dev, const char *path)
void *fw_data;
size_t data_size, total_size;
cpuctl_msr_args_t msrargs = {
- .msr = MSR_IA32_PLATFORM_ID,
+ .msr = MSR_BIOS_SIGN,
+ .data = 0,
};
cpuctl_cpuid_args_t idargs = {
.level = 1, /* Signature. */
@@ -115,12 +116,18 @@ intel_update(const char *dev, const char *path)
WARN(0, "could not open %s for writing", dev);
return;
}
+ error = ioctl(devfd, CPUCTL_WRMSR, &msrargs);
+ if (error < 0) {
+ WARN(0, "ioctl(%s)", dev);
+ goto fail;
+ }
error = ioctl(devfd, CPUCTL_CPUID, &idargs);
if (error < 0) {
WARN(0, "ioctl(%s)", dev);
goto fail;
}
signature = idargs.data[0];
+ msrargs.msr = MSR_IA32_PLATFORM_ID;
error = ioctl(devfd, CPUCTL_RDMSR, &msrargs);
if (error < 0) {
WARN(0, "ioctl(%s)", dev);