changeset 20667:0b0021acb842 draft

build: migrate x86 workaround defs into config files
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sat, 25 Aug 2018 09:11:30 -0400
parents bec3d89ff0f6
children b847a8f35be6
files kernel/arch/x86/Sconfig kernel/arch/x86/Sconfig.workarounds usr/src/uts/i86pc/Makefile.i86pc usr/src/uts/i86pc/Makefile.workarounds usr/src/uts/i86xpv/Makefile.i86xpv usr/src/uts/intel/genunix/Makefile
diffstat 6 files changed, 97 insertions(+), 143 deletions(-) [+]
line wrap: on
line diff
--- a/kernel/arch/x86/Sconfig	Wed Dec 07 22:47:29 2016 +0200
+++ b/kernel/arch/x86/Sconfig	Sat Aug 25 09:11:30 2018 -0400
@@ -32,6 +32,7 @@
    BUILD_KMOD_64
    #t)
 
+ (include "Sconfig.workarounds")
  (include "../../../Sconfig"))
 
 ; vim: set syntax=scheme:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/arch/x86/Sconfig.workarounds	Sat Aug 25 09:11:30 2018 -0400
@@ -0,0 +1,94 @@
+((config
+   ; SWAPGS May Fail To Read Correct GS Base
+   OPTERON_ERRATUM_88
+   #t)
+
+ (config
+   ; Software Prefetches May Report A Page Fault
+   OPTERON_ERRATUM_91
+   #t)
+
+ (config
+   ; RSM Auto-Halt Restart Returns To Incorrect RIP
+   OPTERON_ERRATUM_93
+   #t)
+
+ (config
+   ; RET Instruction May Return To Incorrect EIP
+   OPTERON_ERRATUM_95
+   #t)
+
+ (config
+   ; DRAM scrubber must not be enabled on a node with discontiguous cs range
+   OPTERON_ERRATUM_99
+   #t)
+
+ (config
+   ; Compatibility Mode Branches Transfer to Illegal Address
+   OPTERON_ERRATUM_100
+   #t)
+
+ (config
+   ; DRAM Scrubber May Cause Data Corruption When Using Node-Interleaved Memory
+   OPTERON_ERRATUM_101
+   #t)
+
+ (config
+   ; CPUID Instruction May Return Incorrect Model Number in Some Processors
+   OPTERON_ERRATUM_108
+   #t)
+
+ (config
+   ; Certain Reverse REP MOVS May Produce Unpredictable Behaviour
+   OPTERON_ERRATUM_109
+   #t)
+
+ (config
+   ; Sequential Execution Across Non_Canonical Boundary Caused Processor Hang
+   OPTERON_ERRATUM_121
+   #t)
+
+ (config
+   ; TLB Flush Filter May Cause Cohenrency Problem in Multiprocessor Systems
+   OPTERON_ERRATUM_122
+   #t)
+
+ (config
+   ; Bypassed Reads May Cause Data Corruption of System Hang in Dual Core
+   ; Processors
+   OPTERON_ERRATUM_123
+   #t)
+
+ (config
+   ; Multiprocessor Systems with Four or More Cores May Deadlock Waiting for
+   ; a Probe Response
+   OPTERON_ERRATUM_131
+   #t)
+
+ (config
+   ; TSC may drift when C1-Clock ramping enabled
+   OPTERON_WORKAROUND_6336786
+   #t)
+
+ (config
+   ; Mutex primitives don't work as expected
+   OPTERON_WORKAROUND_6323525
+   #t)
+
+ (config
+   ; Some Registered DIMMs incompatible with address parity feature
+   OPTERON_ERRATUM_172
+   #t)
+
+ (config
+   ; L2 Eviction May Occur During Processor Operation To Set Accessed or
+   ; Dirty Bit
+   OPTERON_ERRATUM_298
+   #t)
+
+ (config
+   ; Processor May Incorrectly Update Stack Pointer
+   OPTERON_ERRATUM_721
+   #t))
+
+; vim: set syntax=scheme:
--- a/usr/src/uts/i86pc/Makefile.i86pc	Wed Dec 07 22:47:29 2016 +0200
+++ b/usr/src/uts/i86pc/Makefile.i86pc	Sat Aug 25 09:11:30 2018 -0400
@@ -143,12 +143,6 @@
 MACHINE_DEFS	 = -D$(PLATFORM) -D_MACHDEP
 
 #
-#	Software workarounds for hardware "features"
-#
-
-include	$(UTSBASE)/$(PLATFORM)/Makefile.workarounds
-
-#
 #	Debugging level
 #
 #	Special knowledge of which special debugging options effect which
@@ -188,7 +182,7 @@
 #	Collect the preprocessor definitions to be associated with *all*
 #	files.
 #
-ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
+ALL_DEFS	 = $(MACHINE_DEFS) $(DEBUG_DEFS) \
 		   $(OPTION_DEFS)
 GENASSYM_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS) \
 			-fno-eliminate-unused-debug-symbols \
--- a/usr/src/uts/i86pc/Makefile.workarounds	Wed Dec 07 22:47:29 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# This makefile contains workaround defines to be shared
-# by Makefile.i86pc and the genunix Makefile.
-#
-
-#
-# SWAPGS May Fail To Read Correct GS Base
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_88
-
-#
-# Software Prefetches May Report A Page Fault
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_91
-
-#
-# RSM Auto-Halt Restart Returns To Incorrect RIP
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_93
-
-#
-# RET Instruction May Return To Incorrect EIP
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_95
-
-#
-# DRAM scrubber must not be enabled on a node with discontiguous cs range
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_99
-
-#
-# Compatibility Mode Branches Transfer to Illegal Address
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_100
-
-#
-# DRAM Scrubber May Cause Data Corruption When Using Node-Interleaved Memory
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_101
-
-#
-# CPUID Instruction May Return Incorrect Model Number in Some Processors
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_108
-
-#
-# Certain Reverse REP MOVS May Produce Unpredictable Behaviour
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_109
-
-#
-# Sequential Execution Across Non_Canonical Boundary Caused Processor Hang
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_121
-
-#
-# TLB Flush Filter May Cause Cohenrency Problem in Multiprocessor Systems
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_122
-
-#
-# Bypassed Reads May Cause Data Corruption of System Hang in Dual Core
-# Processors
-#
-# Solaris does not currently support PowerNow which is required for this
-# Erratum. Check anyway.
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_123
-
-#
-# Multiprocessor Systems with Four or More Cores May Deadlock Waiting for a
-# Probe Response
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_131
-
-#
-# TSC may drift when C1-Clock ramping enabled
-#
-WORKAROUND_DEFS += -DOPTERON_WORKAROUND_6336786
-
-#
-# Mutex primitives don't work as expected
-#
-WORKAROUND_DEFS += -DOPTERON_WORKAROUND_6323525
-
-#
-# Some Registered DIMMs incompatible with address parity feature
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_172
-
-#
-# L2 Eviction May Occur During Processor Operation To Set
-# Accessed or Dirty Bit.
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_298
-
-#
-# Processor May Incorrectly Update Stack Pointer
-#
-WORKAROUND_DEFS += -DOPTERON_ERRATUM_721
--- a/usr/src/uts/i86xpv/Makefile.i86xpv	Wed Dec 07 22:47:29 2016 +0200
+++ b/usr/src/uts/i86xpv/Makefile.i86xpv	Sat Aug 25 09:11:30 2018 -0400
@@ -136,12 +136,6 @@
 MACHINE_DEFS	 = -D__$(PLATFORM) -D__xpv -D_MACHDEP
 
 #
-#	Software workarounds for hardware "features"
-#
-
-include	$(UTSBASE)/i86pc/Makefile.workarounds
-
-#
 #	Debugging level
 #
 #	Special knowledge of which special debugging options effect which
@@ -183,7 +177,7 @@
 #	Collect the preprocessor definitions to be associated with *all*
 #	files.
 #
-ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
+ALL_DEFS	 = $(MACHINE_DEFS) $(DEBUG_DEFS) \
 		   $(OPTION_DEFS)
 GENASSYM_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS) \
 			-fno-eliminate-unused-debug-symbols \
--- a/usr/src/uts/intel/genunix/Makefile	Wed Dec 07 22:47:29 2016 +0200
+++ b/usr/src/uts/intel/genunix/Makefile	Sat Aug 25 09:11:30 2018 -0400
@@ -118,10 +118,3 @@
 #	Include common targets.
 #
 include $(UTSBASE)/intel/Makefile.targ
-
-#
-#	Software workarounds for hardware "features".
-#
-include	$(UTSBASE)/i86pc/Makefile.workarounds
-
-ALL_DEFS += $(WORKAROUND_DEFS)