https://github.com/torvalds/linux
Revision 0afe64bebb13509ef9a4be9deb18286b4c052c93 authored by Linus Torvalds on 20 October 2021, 15:52:10 UTC, committed by Linus Torvalds on 20 October 2021, 15:52:10 UTC
Pull kvm fixes from Paolo Bonzini:
 "Tools:
   - kvm_stat: do not show halt_wait_ns since it is not a cumulative statistic

  x86:
   - clean ups and fixes for bus lock vmexit and lazy allocation of rmaps
   - two fixes for SEV-ES (one more coming as soon as I get reviews)
   - fix for static_key underflow

  ARM:
   - Properly refcount pages used as a concatenated stage-2 PGD
   - Fix missing unlock when detecting the use of MTE+VM_SHARED"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: SEV-ES: reduce ghcb_sa_len to 32 bits
  KVM: VMX: Remove redundant handling of bus lock vmexit
  KVM: kvm_stat: do not show halt_wait_ns
  KVM: x86: WARN if APIC HW/SW disable static keys are non-zero on unload
  Revert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET"
  KVM: SEV-ES: Set guest_state_protected after VMSA update
  KVM: X86: fix lazy allocation of rmaps
  KVM: SEV-ES: fix length of string I/O
  KVM: arm64: Release mmap_lock when using VM_SHARED with MTE
  KVM: arm64: Report corrupted refcount at EL2
  KVM: arm64: Fix host stage-2 PGD refcount
  KVM: s390: Function documentation fixes
2 parent s d9abdee + 9f1ee7b
Raw File
Tip revision: 0afe64bebb13509ef9a4be9deb18286b4c052c93 authored by Linus Torvalds on 20 October 2021, 15:52:10 UTC
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Tip revision: 0afe64b
adjust_autoksyms.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only

# Script to update include/generated/autoksyms.h and dependency files
#
# Copyright:	(C) 2016  Linaro Limited
# Created by:	Nicolas Pitre, January 2016
#

# Update the include/generated/autoksyms.h file.
#
# For each symbol being added or removed, the corresponding dependency
# file's timestamp is updated to force a rebuild of the affected source
# file. All arguments passed to this script are assumed to be a command
# to be exec'd to trigger a rebuild of those files.

set -e

cur_ksyms_file="include/generated/autoksyms.h"
new_ksyms_file="include/generated/autoksyms.h.tmpnew"

info() {
	if [ "$quiet" != "silent_" ]; then
		printf "  %-7s %s\n" "$1" "$2"
	fi
}

info "CHK" "$cur_ksyms_file"

# Use "make V=1" to debug this script.
case "$KBUILD_VERBOSE" in
*1*)
	set -x
	;;
esac

# Generate a new symbol list file
$CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file"

# Extract changes between old and new list and touch corresponding
# dependency files.
changed=$(
count=0
sort "$cur_ksyms_file" "$new_ksyms_file" | uniq -u |
sed -n 's/^#define __KSYM_\(.*\) 1/\1/p' |
while read sympath; do
	if [ -z "$sympath" ]; then continue; fi
	depfile="include/ksym/${sympath}"
	mkdir -p "$(dirname "$depfile")"
	touch "$depfile"
	# Filesystems with coarse time precision may create timestamps
	# equal to the one from a file that was very recently built and that
	# needs to be rebuild. Let's guard against that by making sure our
	# dep files are always newer than the first file we created here.
	while [ ! "$depfile" -nt "$new_ksyms_file" ]; do
		touch "$depfile"
	done
	echo $((count += 1))
done | tail -1 )
changed=${changed:-0}

if [ $changed -gt 0 ]; then
	# Replace the old list with tne new one
	old=$(grep -c "^#define __KSYM_" "$cur_ksyms_file" || true)
	new=$(grep -c "^#define __KSYM_" "$new_ksyms_file" || true)
	info "KSYMS" "symbols: before=$old, after=$new, changed=$changed"
	info "UPD" "$cur_ksyms_file"
	mv -f "$new_ksyms_file" "$cur_ksyms_file"
	# Then trigger a rebuild of affected source files
	exec $@
else
	rm -f "$new_ksyms_file"
fi
back to top