qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

scripts/update-linux-headers.sh: pull virtio hdrs

It doesn't make sense to copy values manually:
the only issue with getting headers from linux
seems to be dealing with linux/types, we
can easily fix that automatically while importing.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>


+41
+41
scripts/update-linux-headers.sh
··· 28 28 output="$PWD" 29 29 fi 30 30 31 + cp_virtio() { 32 + from=$1 33 + to=$2 34 + virtio=$(find "$from" -name '*virtio*h') 35 + if [ "$virtio" ]; then 36 + rm -rf "$to" 37 + mkdir -p "$to" 38 + for f in $virtio; do 39 + if 40 + grep '#include' "$f" | grep -v -e 'linux/virtio' \ 41 + -e 'linux/types' \ 42 + -e 'linux/if_ether' \ 43 + > /dev/null 44 + then 45 + echo "Unexpected #include in input file $f". 46 + exit 2 47 + fi 48 + 49 + header=$(basename "$f"); 50 + sed -e 's/__u\([0-9][0-9]*\)/uint\1_t/g' \ 51 + -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \ 52 + -e 's/__be\([0-9][0-9]*\)/uint\1_t/g' \ 53 + -e 's/<linux\/\([^>]*\)>/"standard-headers\/linux\/\1"/' \ 54 + -e 's/__bitwise__//' \ 55 + -e 's/__attribute__((packed))/QEMU_PACKED/' \ 56 + "$f" > "$to/$header"; 57 + done 58 + fi 59 + } 60 + 31 61 # This will pick up non-directories too (eg "Kconfig") but we will 32 62 # ignore them in the next loop. 33 63 ARCHLIST=$(cd "$linux/arch" && echo *) ··· 75 105 else 76 106 cp "$linux/COPYING" "$output/linux-headers" 77 107 fi 108 + 109 + 110 + cp_virtio "$tmpdir/include/linux/" "$output/include/standard-headers/linux" 111 + 112 + cat <<EOF >$output/include/standard-headers/linux/types.h 113 + #include <stdint.h> 114 + #include "qemu/compiler.h" 115 + EOF 116 + cat <<EOF >$output/include/standard-headers/linux/if_ether.h 117 + #define ETH_ALEN 6 118 + EOF 78 119 79 120 rm -rf "$tmpdir"