#!/bin/sh # Script to create/update include/generated/autoksyms.h and dependency files # # Copyright: (C) 2016 Linaro Limited # Created by: Nicolas Pitre, January 2016 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # Create/update the include/generated/autoksyms.h file from the list # of all module's needed symbols as recorded on the third line of # .tmp_versions/*.mod files. # # 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 # We need access to CONFIG_ symbols case "${KCONFIG_CONFIG}" in */*) . "${KCONFIG_CONFIG}" ;; *) # Force using a file from the current directory . "./${KCONFIG_CONFIG}" esac # In case it doesn't exist yet... if [ -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi # Generate a new ksym list file with symbols needed by the current # set of modules. cat > "$new_ksyms_file" << EOT /* * Automatically generated file; DO NOT EDIT. */ EOT [ "$(ls -A "$MODVERDIR")" ] && sed -ns -e '3{s/ /\n/g;/^$/!p;}' "$MODVERDIR"/*.mod | sort -u | while read sym; do if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then sym="${sym#_}" fi echo "#define __KSYM_${sym} 1" done >> "$new_ksyms_file" # Special case for modversions (see modpost.c) if [ -n "$CONFIG_MODVERSIONS" ]; then echo "#define __KSYM_module_layout 1" >> "$new_ksyms_file" fi # 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' | tr "A-Z_" "a-z/" | while read sympath; do if [ -z "$sympath" ]; then continue; fi depfile="include/config/ksym/${sympath}.h" mkdir -p "$(dirname "$depfile")" touch "$depfile" 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 /a>/x25/x25_dev.c
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2017-01-28 11:46:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 10:59:48 +0100
commit433e19cf33d34bb6751c874a9c00980552fe508c (patch)
treece6547ef2987fbb289fa28f03536328a42781651 /net/x25/x25_dev.c
parent191e885a2e130e639bb0c8ee350d7047294f2ce6 (diff)
Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read()
Commit a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") added the proper mb(), but removed the test "prev_write_sz < pending_sz" when making the signal decision. As a result, the guest can signal the host unnecessarily, and then the host can throttle the guest because the host thinks the guest is buggy or malicious; finally the user running stress test can perceive intermittent freeze of the guest. This patch brings back the test, and properly handles the in-place consumption APIs used by NetVSC (see get_next_pkt_raw(), put_pkt_raw() and commit_rd_index()). Fixes: a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") Signed-off-by: Dexuan Cui <decui@microsoft.com> Reported-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Tested-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: <stable@vger.kernel.org> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/x25/x25_dev.c')