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=-2.2 required=3.0 tests=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 CC1AEC433DF for ; Thu, 11 Jun 2020 14:11:24 +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 9BD542083E for ; Thu, 11 Jun 2020 14:11:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QAjjpRH9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BD542083E 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=UzUA0sloeLocshlN46nshj3V1+p5QLa3liasXgHImKs=; b=QAjjpRH9COmjwH 4Rwo4RUfzFx8FVFg48+slTp0GzhB8mbyDQwtIv3CZ+AqtEBCPIN/CbhQLC6KxlWu5/Km/3kJml7Rt S2d9BcAanE5XR+5vkRfIgvYd7jDrt2ejOvtzTWF01NxitqsbwOLfCNjCAOfSKAgc+CCOQJEAA0dEW 32qDOHYffWlkHHEMghUWMaRNwAWi/YiOQfYHqKnTeQxS7qbQJB89wARhipHzZMS3pEKi5dMxs2Qmx mAC415RUIRe2B7hHHlXHDiYMzzdmyiRpVFaZ8W4G0FSQIoWCuxL5XVhTvgdN1jS7YCmBC8zCAjtYe Fzxv2C0D+fe0WP+U7fjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjNvI-0004d5-UJ; Thu, 11 Jun 2020 14:11:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjNvG-0004cW-33 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jun 2020 14:11:15 +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 E45301F1; Thu, 11 Jun 2020 07:11:11 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A4C0F3F6CF; Thu, 11 Jun 2020 07:11:08 -0700 (PDT) Date: Thu, 11 Jun 2020 15:11:02 +0100 From: Catalin Marinas To: Wooyeon Kim Subject: Re: [PATCH] arm64: fpsimd: Added API to manage fpsimd state inside kernel Message-ID: <20200611141101.GA31408@gaia> References: <20200605073052.23044-1-wooy88.kim@samsung.com> <20200605103705.GD85498@C02TD0UTHF1T.local> <20200608103340.GA31466@arm.com> <001401d63fd4$95646690$c02d33b0$@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <001401d63fd4$95646690$c02d33b0$@samsung.com> 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-20200611_071114_176024_1D8D0AEA X-CRM114-Status: GOOD ( 12.03 ) 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: 'Mark Rutland' , 'Bhupesh Sharma' , 'Julien Grall' , 'Vincenzo Frascino' , 'Will Deacon' , yhwan.joo@samsung.com, 'Anisse Astier' , 'Marc Zyngier' , 'Allison Randal' , 'Sanghoon Lee' , 'Wooki Min' , 'Dave Martin' , 'Kees Cook' , 'Suzuki K Poulose' , jihun.kim@samsung.com, 'Kristina Martsenko' , 'Jeongtae Park' , 'Thomas Gleixner' , linux-arm-kernel@lists.infradead.org, 'Steve Capper' , 'Greg Kroah-Hartman' , linux-kernel@vger.kernel.org, 'James Morse' , 'Sudeep Holla' , dh.han@samsung.com 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 Thu, Jun 11, 2020 at 06:42:12PM +0900, Wooyeon Kim wrote: > I am in charge of camera driver development in Samsung S.LSI division. > > In order to guarantee real time processing such as Camera 3A algorithm in > current or ongoing projects, prebuilt binary is loaded and used in kernel > space, rather than user space. Thanks for the additional details. If you do such intensive processing in an IRQ context you'd probably introduce additional IRQ latency. Wouldn't offloading such work to a real-time (user) thread help? In a non-preempt-rt kernel, I don't think you can get much in terms of (soft) guarantees for IRQ latency anyway. > Because the binary is built with other standard library which could use > FPSIMD register, kernel API should keep the original FPSIMD state for other > user tasks. Can you not recompile those libraries not to use FP? As Mark said, for a kernel API we require at least an in-kernel, upstreamed, user of that functionality. > In the case of the kernel_neon_begin / kernel_neon_end that you mentioned, > there is a limitation that cannot be used in hardirq context. > Also, if another kernel task switching occurs while kernel API is being > used, fpsimd register corruption may occur. kernel_neon_begin/end disable preemption, so you can't have a task switch (you can have interrupts though but we don't allow FPSIMD in IRQ context). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel