# HG changeset patch # User Hans Rosenfeld # Date 1371663265 14400 # Node ID e9339ccf0537c888aee5c51656f8ed73e87ce375 # Parent b99338e2b7ed0a5a46fc2db08e29e3acc4cdd06f 3832 AMD E721 workaround panics on KVM Reviewed by: Marcel Telka Reviewed by: Robert Mustacchi Approved by: Dan McDonald diff -r b99338e2b7ed -r e9339ccf0537 usr/src/uts/i86pc/os/mp_startup.c --- a/usr/src/uts/i86pc/os/mp_startup.c Wed Jun 19 07:56:09 2013 -0700 +++ b/usr/src/uts/i86pc/os/mp_startup.c Wed Jun 19 13:34:25 2013 -0400 @@ -28,6 +28,7 @@ */ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ #include @@ -77,6 +78,7 @@ #include #endif #include +#include struct cpu cpus[1]; /* CPU data */ struct cpu *cpu[NCPU] = {&cpus[0]}; /* pointers to all CPUs */ @@ -1186,7 +1188,13 @@ if (cpuid_opteron_erratum(cpu, 721) > 0) { #if defined(OPTERON_ERRATUM_721) - wrmsr(MSR_AMD_DE_CFG, rdmsr(MSR_AMD_DE_CFG) | AMD_DE_CFG_E721); + on_trap_data_t otd; + + if (!on_trap(&otd, OT_DATA_ACCESS)) + wrmsr(MSR_AMD_DE_CFG, + rdmsr(MSR_AMD_DE_CFG) | AMD_DE_CFG_E721); + no_trap(); + opteron_erratum_721++; #else workaround_warning(cpu, 721);