Print this page
3832 AMD E721 workaround panics on KVM
Reviewed by: Marcel Telka <marcel@telka.sk>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/mp_startup.c
          +++ new/usr/src/uts/i86pc/os/mp_startup.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright (c) 2010, Intel Corporation.
  27   27   * All rights reserved.
  28   28   */
  29   29  /*
  30   30   * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
       31 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  31   32   */
  32   33  
  33   34  #include <sys/types.h>
  34   35  #include <sys/thread.h>
  35   36  #include <sys/cpuvar.h>
  36   37  #include <sys/cpu.h>
  37   38  #include <sys/t_lock.h>
  38   39  #include <sys/param.h>
  39   40  #include <sys/proc.h>
  40   41  #include <sys/disp.h>
↓ open down ↓ 29 lines elided ↑ open up ↑
  70   71  #include <vm/hat_i86.h>
  71   72  #include <vm/vm_dep.h>
  72   73  #include <sys/memnode.h>
  73   74  #include <sys/pci_cfgspace.h>
  74   75  #include <sys/mach_mmu.h>
  75   76  #include <sys/sysmacros.h>
  76   77  #if defined(__xpv)
  77   78  #include <sys/hypervisor.h>
  78   79  #endif
  79   80  #include <sys/cpu_module.h>
       81 +#include <sys/ontrap.h>
  80   82  
  81   83  struct cpu      cpus[1];                        /* CPU data */
  82   84  struct cpu      *cpu[NCPU] = {&cpus[0]};        /* pointers to all CPUs */
  83   85  struct cpu      *cpu_free_list;                 /* list for released CPUs */
  84   86  cpu_core_t      cpu_core[NCPU];                 /* cpu_core structures */
  85   87  
  86   88  #define cpu_next_free   cpu_prev
  87   89  
  88   90  /*
  89   91   * Useful for disabling MP bring-up on a MP capable system.
↓ open down ↓ 1089 lines elided ↑ open up ↑
1179 1181  #else
1180 1182                  workaround_warning(cpu, 6323525);
1181 1183                  missing++;
1182 1184  #endif
1183 1185          }
1184 1186  
1185 1187          missing += do_erratum_298(cpu);
1186 1188  
1187 1189          if (cpuid_opteron_erratum(cpu, 721) > 0) {
1188 1190  #if defined(OPTERON_ERRATUM_721)
1189      -                wrmsr(MSR_AMD_DE_CFG, rdmsr(MSR_AMD_DE_CFG) | AMD_DE_CFG_E721);
     1191 +                on_trap_data_t otd;
     1192 +
     1193 +                if (!on_trap(&otd, OT_DATA_ACCESS))
     1194 +                        wrmsr(MSR_AMD_DE_CFG,
     1195 +                            rdmsr(MSR_AMD_DE_CFG) | AMD_DE_CFG_E721);
     1196 +                no_trap();
     1197 +
1190 1198                  opteron_erratum_721++;
1191 1199  #else
1192 1200                  workaround_warning(cpu, 721);
1193 1201                  missing++;
1194 1202  #endif
1195 1203          }
1196 1204  
1197 1205  #ifdef __xpv
1198 1206          return (0);
1199 1207  #else
↓ open down ↓ 845 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX