From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 063A7C433E0 for ; Wed, 10 Feb 2021 15:44:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C1ADE64DE8 for ; Wed, 10 Feb 2021 15:44:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1ADE64DE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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=mkroZGCVG3SYSfPfZT/gvOGXCVIul8gIrp/NQLYawgE=; b=aTDZLkxBFXeuOrhSuB1VLB5yZ HtS+GDTLM9dBYH+5nF0aCAjPYph+E9RONNgSH8QrBwThfIZxBraNNQj0W8FvP2CyO9gWm2F3oe1I9 t29A6ikjKqSDUZ73DOBnmj8RGAV3lwGwoRa6JzHi32ci9QZ6/4yJlxJvNoPs+m+YLHeUNmcIbUdC8 dhE9qDRojimgR/sbZZ9yMW+8/UfZvEKP2jWg/sp7TfOjHGx4CWQsfVwS/Ad63AnAyNMjZs9Wrv+dc WnqJ6t51O+dxbybVtZs9BE3lbVTTTw2Zm5FHGGZgSCJNtDGPMLfDWdBHo2bbkz8oV4BXye6gy0jp7 /Ic7Qy87g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9reH-0002d6-M0; Wed, 10 Feb 2021 15:43:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9reF-0002cl-9Q for linux-arm-kernel@lists.infradead.org; Wed, 10 Feb 2021 15:43:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 99470D6E; Wed, 10 Feb 2021 07:43:14 -0800 (PST) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7CD3F3F73B; Wed, 10 Feb 2021 07:43:13 -0800 (PST) Date: Wed, 10 Feb 2021 15:42:51 +0000 From: Dave Martin To: Mark Brown Subject: Re: [PATCH v7 1/2] arm64/sve: Split TIF_SVE into separate execute and register state flags Message-ID: <20210210154249.GK21837@arm.com> References: <20210201122901.11331-1-broonie@kernel.org> <20210201122901.11331-2-broonie@kernel.org> <20210210105650.GI21837@arm.com> <20210210145452.GA4748@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210210145452.GA4748@sirena.org.uk> 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-20210210_104323_408425_7E75F113 X-CRM114-Status: GOOD ( 27.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Julien Grall , Catalin Marinas , Zhang Lei , Will Deacon , linux-arm-kernel@lists.infradead.org, Daniel Kiss Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 10, 2021 at 02:54:52PM +0000, Mark Brown wrote: > On Wed, Feb 10, 2021 at 10:56:55AM +0000, Dave Martin wrote: > > On Mon, Feb 01, 2021 at 12:29:00PM +0000, Mark Brown wrote: > > > > + if (test_thread_flag(TIF_SVE_EXEC)) { > > > + vl = sve_vq_from_vl(current->thread.sve_vl) - 1; > > > One more nit: because of the confusion that can arises from "vl" being a > > somewhat overloaded term in the architecture, I was trying to avoid > > using the name "vl" for anything that isn't the vector length in bytes. > > > Can this instead be renamed to vq_minus_1 to match the function > > arguments it's passed for? > > Oh, *that's* what that's all about. I spent quite a bit of time trying > to figure out why we were sometimes using vq_minus_1 but never managed > to get to the bottom of it - it's an awkward name and there's nothing in > the code that explains the logic behind when we use it so it was really > confusing. We can do the rename but I'm not sure it's achieving the > goal of comprehensibility. Ah, I see. The reason for the difference is that the vector length is encoded in ZCR_ELx.LEN as the vector length in quadwords ("vq" -- see Documentation/arm64/sve.rst) minus one. It seemed poor practice to do the conversion in asm where the compiler can't see or optimise it, plus I didn't want the possibility of passing meaningless values at that level. So the caller has to validate the vector length with sve_vl_valid() where deemed necessary, and then convert explicitly. Either way, calling this "vl" is breaking a useful convention that's followed throughout the rest of the kernel, so I'd prefer we call it something else -- but within reason, I don't mind what name is used. > > > (You could save a couple of lines by moving the declaration here and > > combining it with this assignment too.) > > Not really the coding style in the file though. I'm not sure there's really a rigid convention in this file, other than keeping declarations at the start of blocks. I tend to push declarations down when it doesn't harm readability -- i.e., when the function is more than a screenful and/or the relevant block already has braces enclosing several lines. But it's a moot point. Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel