From patchwork Fri Jun 23 15:21:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 9806779 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 256AA60329 for ; Fri, 23 Jun 2017 15:21:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15200285E8 for ; Fri, 23 Jun 2017 15:21:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 095632869B; Fri, 23 Jun 2017 15:21:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89B85285E8 for ; Fri, 23 Jun 2017 15:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754421AbdFWPVP (ORCPT ); Fri, 23 Jun 2017 11:21:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbdFWPVO (ORCPT ); Fri, 23 Jun 2017 11:21:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7B7DC04D2E4 for ; Fri, 23 Jun 2017 15:21:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D7B7DC04D2E4 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=drjones@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D7B7DC04D2E4 Received: from cav-thunderx1s-cn88xx-03.khw.lab.eng.bos.redhat.com (cav-thunderx1s-cn88xx-03.khw.lab.eng.bos.redhat.com [10.16.185.204]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2841E53C62; Fri, 23 Jun 2017 15:21:11 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: rkrcmar@redhat.com, pbonzini@redhat.com, lvivier@redhat.com, thuth@redhat.com, david@redhat.com Subject: [PATCH] errata: check kernel-extraversion Date: Fri, 23 Jun 2017 11:21:10 -0400 Message-Id: <1498231270-38476-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Jun 2017 15:21:14 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When checking a kernel version to see if errata should be set, also check the kernel extraversion, if given in the errata.txt. Also, reformat errata.txt to allow for longer version names and to remove the tabs. Signed-off-by: Andrew Jones --- errata.txt | 14 +++++++------- scripts/arch-run.bash | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/errata.txt b/errata.txt index 5608a308ce7c..b943695173e0 100644 --- a/errata.txt +++ b/errata.txt @@ -1,7 +1,7 @@ -#---------------:-----------------------:-------------------------------------- -# commit : minimum kernel : summary -# 12 hex digits : version : -#---------------:-----------------------:-------------------------------------- -9e3f7a296940 : 4.9 : arm64: KVM: pmu: Fix AArch32 cycle counter access -6c7a5dce22b3 : 4.12 : KVM: arm/arm64: fix races in kvm_psci_vcpu_on -#---------------:-----------------------:-------------------------------------- +#---------------:-------------------------------:--------------------------------------------------- +# commit : minimum kernel : summary +# 12 hex digits : version : +#---------------:-------------------------------:--------------------------------------------------- +9e3f7a296940 : 4.9 : arm64: KVM: pmu: Fix AArch32 cycle counter access +6c7a5dce22b3 : 4.12 : KVM: arm/arm64: fix races in kvm_psci_vcpu_on +#---------------:-------------------------------:--------------------------------------------------- diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 7c6c79ad3a9d..8cea8c49d847 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -189,11 +189,16 @@ env_add_errata () env_generate_errata () { local kernel_version_string=$(uname -r) - local kernel_version kernel_patchlevel kernel_sublevel - local line commit minver errata v p s have + local kernel_version kernel_patchlevel kernel_sublevel kernel_extraversion + local line commit minver errata rest v p s x have - IFS=. read kernel_version kernel_patchlevel kernel_sublevel <<<$kernel_version_string + IFS=. read kernel_version kernel_patchlevel rest <<<$kernel_version_string + IFS=- read kernel_sublevel kernel_extraversion <<<$rest kernel_sublevel=${kernel_sublevel%%[!0-9]*} + kernel_extraversion=${kernel_extraversion%%[!0-9]*} + + ! [[ $kernel_sublevel =~ ^[0-9]+$ ]] && unset $kernel_sublevel + ! [[ $kernel_extraversion =~ ^[0-9]+$ ]] && unset $kernel_extraversion [ "$ENVIRON_DEFAULT" != "yes" ] && return [ ! -f "$ERRATATXT" ] && return @@ -205,16 +210,37 @@ env_generate_errata () errata="ERRATA_$commit" test -v $errata && continue - IFS=. read v p s <<<$minver + IFS=. read v p rest <<<$minver + IFS=- read s x <<<$rest s=${s%%[!0-9]*} + x=${x%%[!0-9]*} + + if ! [[ $v =~ ^[0-9]+$ ]] || ! [[ $p =~ ^[0-9]+$ ]]; then + echo "Bad minimum kernel version in $ERRATATXT, $minver" + exit 2 + fi + ! [[ $s =~ ^[0-9]+$ ]] && unset $s + ! [[ $x =~ ^[0-9]+$ ]] && unset $x if (( $kernel_version > $v || ($kernel_version == $v && $kernel_patchlevel > $p) )); then have=y elif (( $kernel_version == $v && $kernel_patchlevel == $p )); then if [ "$kernel_sublevel" ] && [ "$s" ]; then - if (( $kernel_sublevel >= $s )); then + if (( $kernel_sublevel > $s )); then have=y + elif (( $kernel_sublevel == $s )); then + if [ "$kernel_extraversion" ] && [ "$x" ]; then + if (( $kernel_extraversion >= $x )); then + have=y + else + have=n + fi + elif [ "$x" ] && (( $x != 0 )); then + have=n + else + have=y + fi else have=n fi