@@ -86,7 +86,6 @@ def test_with_any_microvm(test_microvm_any):
86
86
import tempfile
87
87
import uuid
88
88
import json
89
- import re
90
89
91
90
import pytest
92
91
@@ -485,30 +484,9 @@ def test_multiple_microvms(test_fc_session_root_path, context, bin_cloner_path):
485
484
def test_spectre_mitigations ():
486
485
"""Check the kernel is compiled with SPECTREv2 mitigations."""
487
486
488
- def check_retpoline (body ):
489
- # We check for full retpoline support by checking if the kernel was:
490
- # 1. compiled with CONFIG_RETPOLINE
491
- # 2. built with a retpoline-capable compiler
492
-
493
- _ , stdout , _ = utils .run_cmd ("uname -r" )
494
- opt_config = "/boot/config-{}" .format (stdout .rstrip ())
495
- assert os .path .exists (opt_config )
496
- code , _ , _ = utils .run_cmd (
497
- "grep -q '^CONFIG_RETPOLINE' {}" .format (opt_config ), ignore_return_code = True
498
- )
499
- if code != 0 :
500
- return False
501
-
502
- # As per the spectre-meltdown-checker, if retpoline or retpolines exist as
503
- # whole words and minimial is not found, then it's full retpoline.
504
- words = re .split (" |; |, |: |\n " , body )
505
- if ("retpoline" in words or "retpolines" in words ) and "minimal" not in words :
506
- return True
507
- return False
508
-
509
487
def x86_64 (body ):
510
488
return ("IBPB: conditional" in body or "IBPB: always-on" in body ) and (
511
- "Enhanced IBRS" in body or check_retpoline ( body . lower ())
489
+ "Enhanced IBRS" in body or "IBRS" in body
512
490
)
513
491
514
492
def aarch64 (body ):
0 commit comments