]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/retpoline-extract
x86/speculation/mds: Add mitigation control for MDS
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / retpoline-extract
1 #!/bin/bash
2
3 cd "$1" || exit 1
4
5 # Find all valid retpoline information, collate the detected and
6 # safe information together. Join the result to find the detected
7 # but non-safe elements. These are our concern.
8 ur_detected=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-detected")
9 ur_safe=$(mktemp --tmpdir "retpoline-check-XXXXXX.ur-safe")
10
11 find "." -path './drivers/firmware/efi/libstub' -prune -o \
12 -path './arch/x86/boot' -prune -o \
13 -path './arch/x86/purgatory' -prune -o \
14 -name \*.ur-detected -print0 | xargs -0 cat | \
15 sed -e "s@^$1@@" -e "s@ $2/@ @" -e "s@^/@@" | \
16 sort -k 1b,1 >"$ur_detected"
17 find "." -name \*.ur-safe -print0 | xargs -0 cat | \
18 sed -e "s@^$1@@" -e "s@^/@@" | \
19 sort -k 1b,1 >"$ur_safe"
20
21 join -v 1 -j 1 "$ur_detected" "$ur_safe" | sed -s 's/[^ ]* *//'
22
23 rm -f "$ur_detected" "$ur_safe"