Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp937547rdf; Wed, 22 Nov 2023 00:33:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4sfZobpkqjN0blXggNaeSxCzvJlu1cCCm7nFXvgc7tzBM4k3/zLwE54VtKKp0kuo3bFQP X-Received: by 2002:a05:6808:15a8:b0:3b8:3d30:6a18 with SMTP id t40-20020a05680815a800b003b83d306a18mr1894077oiw.11.1700642022381; Wed, 22 Nov 2023 00:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700642022; cv=none; d=google.com; s=arc-20160816; b=VZh8bcCESExC+R8q3m+CxXs2a67HjWg6uQqs1TAq6rHfqgkWOArReCEY4IHdCvjJdA ON8JhCBpcaWcfv8UrlOiI1gD1Z+DkaVvDb/csMp9rGEyH94Gi4kVPPSXWjpC7yzt8pjC nx2dzsuuSvxTo8EUNynjeDd/9I12wpi0hvAAp6Kpv0DUvAu19+YIZ92zTvWZ9PR/zEfd x9+io6REswE5CYP5+t4lsXR4G0lLGo8MIUwjIVgT5EXu55kyaUl37i2kX7KItmfU+rIb Vgh+uXW2nva7ci63VwlQSfIY5QAI01SliEPqoE1WpzbG7DZmzuwKjVLUWSMtMKq45Ouh 5M9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=c3B+JcPJMghWo+nJ71PzWYCU8IF2ZA/XTIwpeIzvQJc=; fh=IDf48gpEIn5TwFtMc5zDJFKFMNSvdjYpTjDmMqo5Y+s=; b=kBdYQfJTWCY7zcRSHEK2TYjz+AiJ1vjq7GHgsk9p7UnRiJOro2fB9tHAgZzbAyFd9S t025jMS2Vad+afS2T2ix4L70wt6/rRBQezYoluU2oPdhDXIVXYLr4e+X++8b3DNu4sOe 5hEmEYRTCfS7Ooj5VYKNbKfD6Q71OChshwqe6RKlj5PxHkHSh1mn+k4qthUs1MuWSr1r y+oW2iVgciM0kRb5n782GLmdMIyKpWVE/Xb0Yg6gZHX/Ys2ZPllvJyGZ5Ls6zoYEiAe4 o+9dF5q9oooCGOnw3aCf+HruZ0pH6uEO85xpav6xvB7fyMI7wNSRZ4jhyZTu3ZZg84OQ Ccjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iry9qYaA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l184-20020a6325c1000000b00578e0ff59bbsi12471231pgl.865.2023.11.22.00.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 00:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iry9qYaA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8439E81A6E7C; Wed, 22 Nov 2023 00:33:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235073AbjKVIdl (ORCPT + 99 others); Wed, 22 Nov 2023 03:33:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbjKVIdk (ORCPT ); Wed, 22 Nov 2023 03:33:40 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9DA0109 for ; Wed, 22 Nov 2023 00:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=c3B+JcPJMghWo+nJ71PzWYCU8IF2ZA/XTIwpeIzvQJc=; b=iry9qYaAzZ72Yw7RgNmlMyzxch uBcG/uUni+Zl/djnDtICDx2l+t+X3Ms06RvQs4Lb3itE+ICRA3BnUQ28ve4901i8R99Of7L2yah8D RblXmxBNOT8SZ7EBXHivnR/9JonEkP8AEz38O1JNMe914sZQ5FMz2k2Jr39lzxrjJl/9/hXlr6jaT 12mYDAlJbu2ZIMzyAGZU06bSsjjuQnN46n5Ddo7tAMPWslUGtxgB2dPGvggIsGAiGH+vRaouJkXNV grvsGAUvQL6fLENnXHV+maDUx3GbhmSxIZtB7YLNaGffCD8FCcCGJH+zdWAY+BERdes5OswtdPonj UpNoiBaA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r5ifs-0014GP-2o; Wed, 22 Nov 2023 08:33:32 +0000 Date: Wed, 22 Nov 2023 00:33:32 -0800 From: Christoph Hellwig To: Samuel Holland Cc: Palmer Dabbelt , Harry Wentland , Leo Li , Rodrigo Siqueira , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , Christian =?iso-8859-1?Q?K=F6nig?= , Alex Deucher , Pan Xinhui , Daniel Vetter , amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 1/3] riscv: Add support for kernel-mode FPU Message-ID: References: <20231122030621.3759313-1-samuel.holland@sifive.com> <20231122030621.3759313-2-samuel.holland@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231122030621.3759313-2-samuel.holland@sifive.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 00:33:41 -0800 (PST) On Tue, Nov 21, 2023 at 07:05:13PM -0800, Samuel Holland wrote: > +static inline void kernel_fpu_begin(void) > +{ > + preempt_disable(); > + fstate_save(current, task_pt_regs(current)); > + csr_set(CSR_SSTATUS, SR_FS); > +} > + > +static inline void kernel_fpu_end(void) > +{ > + csr_clear(CSR_SSTATUS, SR_FS); > + fstate_restore(current, task_pt_regs(current)); > + preempt_enable(); > +} Is there any critical reason to inline these two? I'd much rather see them out of line and exported instead of the low-level helpers.