we don't need to uncondtionally set it.
Worksaround a suspected bug in newer Linux KVM, which may trigger a
#GP fault on writes to this MSR.
ok mlarkin@
-/* $OpenBSD: identcpu.c,v 1.103 2018/07/23 23:25:02 brynet Exp $ */
+/* $OpenBSD: identcpu.c,v 1.104 2018/08/01 20:33:53 brynet Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
uint64_t msr;
msr = rdmsr(MSR_DE_CFG);
- msr |= DE_CFG_SERIALIZE_LFENCE;
- wrmsr(MSR_DE_CFG, msr);
+ if ((msr & DE_CFG_SERIALIZE_LFENCE) == 0) {
+ msr |= DE_CFG_SERIALIZE_LFENCE;
+ wrmsr(MSR_DE_CFG, msr);
+ }
}
}
-/* $OpenBSD: machdep.c,v 1.622 2018/07/30 14:19:12 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.623 2018/08/01 20:33:53 brynet Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
uint64_t msr;
msr = rdmsr(MSR_DE_CFG);
- msr |= DE_CFG_SERIALIZE_LFENCE;
- wrmsr(MSR_DE_CFG, msr);
+ if ((msr & DE_CFG_SERIALIZE_LFENCE) == 0) {
+ msr |= DE_CFG_SERIALIZE_LFENCE;
+ wrmsr(MSR_DE_CFG, msr);
+ }
}
}