Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86 Adapt prototypes and usage of rdmsr_locked() an...
details: https://anonhg.NetBSD.org/src/rev/e2722f21ef60
branches: trunk
changeset: 342686:e2722f21ef60
user: hannken <hannken%NetBSD.org@localhost>
date: Tue Jan 05 10:20:22 2016 +0000
description:
Adapt prototypes and usage of rdmsr_locked() and wrmsr_locked() to
their implementation. Both functions don't take the passcode as
argument.
As wrmsr_locked() no longer writes the passcode to the msr the
erratum 721 on my Opteron 2356 really gets patched and cc1 no longer
crashes with SIGSEGV.
diffstat:
sys/arch/x86/include/cpufunc.h | 6 +++---
sys/arch/x86/x86/errata.c | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diffs (64 lines):
diff -r 96c8d3c2d20a -r e2722f21ef60 sys/arch/x86/include/cpufunc.h
--- a/sys/arch/x86/include/cpufunc.h Tue Jan 05 09:37:11 2016 +0000
+++ b/sys/arch/x86/include/cpufunc.h Tue Jan 05 10:20:22 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.h,v 1.18 2014/02/25 22:16:52 dsl Exp $ */
+/* $NetBSD: cpufunc.h,v 1.19 2016/01/05 10:20:22 hannken Exp $ */
/*-
* Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -134,12 +134,12 @@
#define OPTERON_MSR_PASSCODE 0x9c5a203aU
uint64_t rdmsr(u_int);
-uint64_t rdmsr_locked(u_int, u_int);
+uint64_t rdmsr_locked(u_int);
int rdmsr_safe(u_int, uint64_t *);
uint64_t rdtsc(void);
uint64_t rdpmc(u_int);
void wrmsr(u_int, uint64_t);
-void wrmsr_locked(u_int, u_int, uint64_t);
+void wrmsr_locked(u_int, uint64_t);
void setfs(int);
void setusergs(int);
diff -r 96c8d3c2d20a -r e2722f21ef60 sys/arch/x86/x86/errata.c
--- a/sys/arch/x86/x86/errata.c Tue Jan 05 09:37:11 2016 +0000
+++ b/sys/arch/x86/x86/errata.c Tue Jan 05 10:20:22 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: errata.c,v 1.22 2015/07/27 15:45:20 msaitoh Exp $ */
+/* $NetBSD: errata.c,v 1.23 2016/01/05 10:20:22 hannken Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.22 2015/07/27 15:45:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.23 2016/01/05 10:20:22 hannken Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -294,7 +294,7 @@
(void)ci;
- val = rdmsr_locked(e->e_data1, OPTERON_MSR_PASSCODE);
+ val = rdmsr_locked(e->e_data1);
if ((val & e->e_data2) != 0)
return FALSE;
@@ -309,10 +309,10 @@
(void)ci;
- val = rdmsr_locked(e->e_data1, OPTERON_MSR_PASSCODE);
+ val = rdmsr_locked(e->e_data1);
if ((val & e->e_data2) != 0)
return FALSE;
- wrmsr_locked(e->e_data1, OPTERON_MSR_PASSCODE, val | e->e_data2);
+ wrmsr_locked(e->e_data1, val | e->e_data2);
aprint_debug_dev(ci->ci_dev, "erratum %d patched\n",
e->e_num);
Home |
Main Index |
Thread Index |
Old Index