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.2 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 E49CFC433B4 for ; Thu, 8 Apr 2021 16:45:18 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 852086101E for ; Thu, 8 Apr 2021 16:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 852086101E 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc: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=cAQtrClb3Ief+pCWQ0d8EQYp2Q73tB1AGhJ0Qjp2e1g=; b=A0GAsvyvvNrEltprWzO9Q9sGe HNj3GYAfPsaMY8zxgzyZxE2WYR/2lRjp8xPdqTNNQVhP1qE4mr0gMuHXSMDY4b4+xlMRJfemDWgQ6 0bm7+o+tsvj/SeInkiaivb2rRQrfxAZcOu6fsGmlG92RC2fOb9aMG8ApfBv8jAyvv2NZpxfcKSCgs 6guD8PF76Vz4RzVR1RQHc+4+ya3EUa16RbCk4PCQMq4fKPREI3WvSUannIikTlWyemFdh6TXLxMF1 92xDk9XPhIh372N35S6wT1sbOwqFIHg67ABpMLw8uZ5ls+xEn9n6oBU5MzBzzuHQ4CoCcOAMj6jqw ZKOlIQaTg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUXkn-008fbT-Km; Thu, 08 Apr 2021 16:43:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUXkj-008fb0-DE for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 16:43:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 74BF460FE6; Thu, 8 Apr 2021 16:43:30 +0000 (UTC) Date: Thu, 8 Apr 2021 17:43:27 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Julien Grall , Zhang Lei , Dave Martin , Daniel Kiss , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/sve: Rework SVE access trap to convert state in registers Message-ID: <20210408164327.GB7676@arm.com> References: <20210312190313.24598-1-broonie@kernel.org> <20210407114511.GA21451@arm.com> <20210407124806.GC5510@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210407124806.GC5510@sirena.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_174333_782442_10D62D22 X-CRM114-Status: GOOD ( 18.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, Apr 07, 2021 at 01:48:06PM +0100, Mark Brown wrote: > On Wed, Apr 07, 2021 at 12:45:12PM +0100, Catalin Marinas wrote: > > The other case is TIF_FOREIGN_FPSTATE being set in do_sve_acc(). Since > > we never return to user with this flag set, when can we actually hit the > > 'else' path in your patch? > > We'd have to have been preempted between entering the kernel and > actually handling the access trap, I can't think of a scenario where > that would happen but it seemed easier to have the code to handle it > than to make absolutely sure that there was no possible case that I was > missing. I think we should have the detection code either way in case > it does end up happening somehow but it could be changed to use > WARN_ON_ONCE() or something instead of silently handling it? If we get preempted before do_sve_acc() (and that's possible as the interrupts are enabled), if the interrupted thread wakes up on another CPU it will have TIF_FOREIGN_FPSTATE set so that it retrieves the new state. So the patch looks fine to me. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel