From 5788cec18b0fcdf7560096c211058beb238d46d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Wed, 15 May 2019 10:56:49 +0200 Subject: [PATCH] fix(mds): ARM and CAVIUM are not thought to be vulnerable --- spectre-meltdown-checker.sh | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 165878f..0906103 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -325,6 +325,14 @@ is_cpu_vulnerable() variant_mlpds='' variant_mdsum='' + if is_cpu_mds_free; then + [ -z "$variant_msbds" ] && variant_msbds=immune + [ -z "$variant_mfbds" ] && variant_mfbds=immune + [ -z "$variant_mlpds" ] && variant_mlpds=immune + [ -z "$variant_mdsum" ] && variant_mdsum=immune + _debug "is_cpu_vulnerable: cpu not affected by Microarchitectural Data Sampling" + fi + if is_cpu_specex_free; then variant1=immune variant2=immune @@ -365,13 +373,6 @@ is_cpu_vulnerable() [ -z "$variant4" ] && variant4=immune _debug "is_cpu_vulnerable: cpu not affected by speculative store bypass so not vuln to variant4" fi - if is_cpu_mds_free; then - [ -z "$variant_msbds" ] && variant_msbds=immune - [ -z "$variant_mfbds" ] && variant_mfbds=immune - [ -z "$variant_mlpds" ] && variant_mlpds=immune - [ -z "$variant_mdsum" ] && variant_mdsum=immune - _debug "is_cpu_vulnerable: cpu not affected by Microarchitectural Data Sampling" - fi # variant 4a for xeon phi if [ "$cpu_family" = 6 ]; then if [ "$cpu_model" = "$INTEL_FAM6_XEON_PHI_KNL" ] || [ "$cpu_model" = "$INTEL_FAM6_XEON_PHI_KNM" ]; then @@ -420,13 +421,6 @@ is_cpu_vulnerable() [ -z "$variant4" ] && variant4=immune _debug "is_cpu_vulnerable: cpu not affected by speculative store bypass so not vuln to variant4" fi - if is_cpu_mds_free; then - [ -z "$variant_msbds" ] && variant_msbds=immune - [ -z "$variant_mfbds" ] && variant_mfbds=immune - [ -z "$variant_mlpds" ] && variant_mlpds=immune - [ -z "$variant_mdsum" ] && variant_mdsum=immune - _debug "is_cpu_vulnerable: cpu not affected by Microarchitectural Data Sampling" - fi variantl1tf=immune elif [ "$cpu_vendor" = CAVIUM ]; then variant3=immune @@ -602,7 +596,7 @@ is_cpu_mds_free() fi fi fi - + if is_amd; then if [ "$cpu_family" = "18" ] || \ [ "$cpu_family" = "17" ] || \ @@ -611,12 +605,16 @@ is_cpu_mds_free() return 0 fi fi + if is_hygon; then return 0 + elif [ "$cpu_vendor" = CAVIUM ]; then + return 0 + elif [ "$cpu_vendor" = ARM ]; then + return 0 fi - - return 1 - + + return 1 } is_cpu_ssb_free()