Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6634C04AB5 for ; Mon, 3 Jun 2019 11:09:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B4FB23BF6 for ; Mon, 3 Jun 2019 11:09:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KfQ3nkT8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B4FB23BF6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/eDnIy6zM8UhENShm2x/coJUKOsXl7YIJ1Zv4TJv6g8=; b=KfQ3nkT8vIevsq r/ZmLQaQwL/NWdT2LnJwHiySdqxbYInB9bwE6TMkO6ltzWQdBQSx5no5/dZveUQTHJ7Btf5VhftN2 0H7FQrDVAGgqujE/Dl8/45S98lqwUglNtqw5HPboaBxTaFZSpvUAEPwuMgFU0JwGCokwcvym7QDeH wEU9GPylnIQBhJIxBeELSdREGlXFizLLWsPHGZlIBu8dGlAOZFkWGdLdfwC/MPOcRbsxzk3TjMZzD 6WSp+VMwHjM/JFB8ToQyEpK7Nq6jQ/LyQtDOxcNpXhetBNKbAXYpmmP+H6Dh4NHnk5ywQ9+aFC132 lfbICkouPhIPNtHDQz2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXkpt-0008Hi-QO; Mon, 03 Jun 2019 11:09:05 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXkpr-0008H6-2w for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2019 11:09:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0DB8A78; Mon, 3 Jun 2019 04:09:02 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EE1C3F5AF; Mon, 3 Jun 2019 04:09:00 -0700 (PDT) Date: Mon, 3 Jun 2019 12:08:58 +0100 From: Dave Martin To: Andre Przywara Subject: Re: [PATCH kvmtool v3 3/9] update_headers.sh: arm64: Copy sve_context.h if available Message-ID: <20190603110858.GI28398@e103592.cambridge.arm.com> References: <1559229194-3036-1-git-send-email-Dave.Martin@arm.com> <1559229194-3036-4-git-send-email-Dave.Martin@arm.com> <20190531180340.047189da@donnerap.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190531180340.047189da@donnerap.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190603_040903_129853_F877F9FD X-CRM114-Status: GOOD ( 23.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoffer Dall , Marc Zyngier , Will Deacon , Kristina Martsenko , Zhang Lei , Amit Daniel Kachhap , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 31, 2019 at 06:03:40PM +0100, Andre Przywara wrote: > On Thu, 30 May 2019 16:13:08 +0100 > Dave Martin wrote: > > > The SVE KVM support for arm64 includes the additional backend > > header from . > > > > 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 > > --- > > 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 > > To go with your previous patches, aren't you missing the quotes here? Hmmm, good question. This is "obviously" a fancy variable assignment, and so there would be no word splitting after expansion. So quotes wouldn't be needed here, just as with a simple assignment. bash and ash seem to work this way. dash doesn't though, and a padantic reading of the bash man page suggests that the dash behaviour may be more correct: i.e., local is just a command, whose arguments are expanded in the usual way, even if it happens to assign variables as part of its behaviour. So, while I'm not sure whether or not quotes are officially needed here, I guess we should have them to be on the safe side. > > + > > + if [ -e "$src" ] > > + then > > + cp -- "$src" "$KVMTOOL_PATH/include/asm" > > + fi > > +} > > + > > Maybe we can make this slightly more generic? > copy_optional_arch() { > local src="$LINUX_ROOT/arch/$arch/include/uapi/$1" > [ -r "$src" ] && cp -- "$src" "$KVMTOOL_PATH/include/asm" > } > ... > arm64) KVMTOOL_PATH=arm/aarch64 > copy_optional_arch asm/sve_context.h > ;; Happy to change it along those lines. It's certainly possible this will be needed again later for some future arch header. Also, foo && bar exits the shell if foo yields false and set -e is in effect, so I've reverted back to using an if. (I'm still a little confused though, since I struggled to reproduce this behaviour outside the script.) Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel