[PATCH kvmtool v3 3/9] update_headers.sh: arm64: Copy sve_context.h if available

Dave Martin
2019-05-30T15:14:13Z

The SVE KVM support for arm64 includes the additional backend
header <asm/sve_context.h> from <asm/kvm.h>.

So update this header if it is available.

To avoid creating a sudden dependency on a specific minimum kernel
version, ignore the header if the source kernel tree doesn't have
it.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
util/update_headers.sh | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/util/update_headers.sh b/util/update_headers.sh
index a7e21b8..90d3ead 100755
--- a/util/update_headers.sh
+++ b/util/update_headers.sh
@@ -25,11 +25,22 @@ fi

cp -- "$LINUX_ROOT/include/uapi/linux/kvm.h" include/linux

+unset KVMTOOL_PATH
+
+copy_arm64 () {
+ local src=$LINUX_ROOT/arch/$arch/include/uapi/asm/sve_context.h
+
+ if [ -e "$src" ]
+ then
+ cp -- "$src" "$KVMTOOL_PATH/include/asm"
+ fi
+}
+
for arch in arm arm64 mips powerpc x86
do
case "$arch" in
arm) KVMTOOL_PATH=arm/aarch32 ;;
- arm64) KVMTOOL_PATH=arm/aarch64 ;;
+ arm64) KVMTOOL_PATH=arm/aarch64; copy_arm64 ;;
*) KVMTOOL_PATH=$arch ;;
esac
cp -- "$LINUX_ROOT/arch/$arch/include/uapi/asm/kvm.h" \
--
2.1.4