Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4080343rdb; Mon, 11 Dec 2023 08:17:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IELehxpEqKcS2pnXKAwXfWGTfHoceb4oCTm1zWxR7OBRZyLIApRD9M9971AiiH2voq2rB8S X-Received: by 2002:a05:6a00:4b13:b0:6ce:6cf3:38b7 with SMTP id kq19-20020a056a004b1300b006ce6cf338b7mr2596521pfb.8.1702311443362; Mon, 11 Dec 2023 08:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702311443; cv=none; d=google.com; s=arc-20160816; b=t/hMH3DXCrAFaogGDOAHK0cv6/sWZD3cXpPqPCP78eQIPOWTb5wfi3YwRP33/hRxbM MAtlsiPEnZz4j1ambZV+a30OuGbFfL8ZyJPmgEEhhZ79Hg6PtUoR/uunYkkrRp7I+ENV QAcHapDOXIp1w0hJUOtEgzrtWURUHGVcuer5i0Ap909iZ16PQN4DA9/ODayfBJklLAco 5UV5gLxe54E/2/7f0PC5mdkCTW+IhomboCigomrbT4mt7oOz39n2BaAHx3lDht0/RgmZ YKlB6kbAAqrxzYPv2H8vj6LV2OEzEJ4ArnWmgTDa8nMlaeaLAe22kYDAHQwy0FTwgmW6 0YSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9O17D9j4YT4XtoaSYd3/nhs4s1HCIt9uZx1EA+AxCks=; fh=e3m65UazIH+HUEhdRVRE0F2xa8ZvmBmcMlz9rRG2mH8=; b=GOcdvlb/GEM51z+Y/DCmwJTzmLoFcLuG36UdF9yKljmDFsJd8lez2CZQTJqqrI9+6R kYcu6BHXB+0gIbIg0Y6LUp5nc3PS6rnIypToZ677iOO8oRYgT94TutXn+hG2QHq6bnMt Ly5Zjzc5owDVlZ05NOhE3JgAd1PBbzK/8GfTx32AlVWfpsj1xCRxCMtMan29M9Cb+5UY CfFN2dCBKahm2Nc9G7u/Dfs1XEWYCuKtyQ23oTVstgfGmITW9PgXCKL6UX9nL199qEKR 6JDi6sYSaItnxCC0k2sWEtblNQ/bk8eiNLR/Xo8oiSJdSYaxz+n8qotwFTST/OYX4cvE eMEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=QhHAruhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id by12-20020a056a02058c00b005c66c2d0a5csi6474531pgb.484.2023.12.11.08.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=QhHAruhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0EE20806139B; Mon, 11 Dec 2023 08:17:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234991AbjLKQQ4 (ORCPT + 99 others); Mon, 11 Dec 2023 11:16:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344690AbjLKQQM (ORCPT ); Mon, 11 Dec 2023 11:16:12 -0500 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13031198 for ; Mon, 11 Dec 2023 08:16:16 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-67ea7dbd51cso24933346d6.3 for ; Mon, 11 Dec 2023 08:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1702311375; x=1702916175; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9O17D9j4YT4XtoaSYd3/nhs4s1HCIt9uZx1EA+AxCks=; b=QhHAruhHDJwS1YqCWWOQjZe6vFaNZl9vgrCfr2rLk9334kqkidfz2I6xFi2MqCplRK HsRzepNc+fum+8+RIuauotY7cHATmK/eMKsnfV8ms2fP6nSNVCqcFUC7zmC/Nkm9ZwWW f0ZiLblbVR982iaPGxCRzOj8zDxoJ4o+hU+HdQ5znBuUlKgjWrSAaeO+z8su6MlRihKc keIHTLn2X4M+dJx5N5IkONalQ9m0AUtZJWKh8W8zBfA9PSke2nihsWQl1/fH2SRMuHg1 P4W4zt4SWofkbaBfwPZsvWksGts4NRS9buQk1JL+imD4BcQ33oW2Cj5/lepwoN1nia0g ZABQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702311375; x=1702916175; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9O17D9j4YT4XtoaSYd3/nhs4s1HCIt9uZx1EA+AxCks=; b=q5/oHNSB7yANXeogNQPkhISBJMtS7nszlYgm0t/TfTMGiWiJs+9CBmNoW5zLiq05Si BIVH1MBgIUKlrNPlfT2OKnsQ6wkn3RpPcCNcmL/+8FY8kL5E5gIAe5VAngqxI2Yoi98P zqtVD5q3bOZv9ji4JakeSvDNTKKLpWK2cc0CFQsRhW0qwRXpQzqhcAyVFSiaYPrdvnkb ziadIF8tMO3lbGbOO0R3gvcV+oYYVebX0j8AzFLTSD0I2lazq7Wzbpl/+RkgJzwyF/qF 68aBGKvlo1+Y96oFtAyXBGQtS9hz0nvVv3VIYg95WMlRmK0EBoJV1LAzo12RimOZ2wb3 zyAw== X-Gm-Message-State: AOJu0YyCGDX3U0/FZLrq4Cf756hSAM2aYuEOiLRAP8yQW3mwUDlXGrQO SXpTf0AtlhyrgdY1TLaczVp4+Q== X-Received: by 2002:a05:6214:1fd9:b0:67e:b878:8e48 with SMTP id jh25-20020a0562141fd900b0067eb8788e48mr4904522qvb.39.1702311375258; Mon, 11 Dec 2023 08:16:15 -0800 (PST) Received: from ?IPV6:2600:1700:2000:b002:f8a3:26ec:ac85:392e? ([2600:1700:2000:b002:f8a3:26ec:ac85:392e]) by smtp.gmail.com with ESMTPSA id d17-20020a0cf6d1000000b0067a18167533sm3380983qvo.83.2023.12.11.08.16.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 08:16:15 -0800 (PST) Message-ID: <3f28c1f7-f29c-461f-a90e-58d8e0996cc0@sifive.com> Date: Mon, 11 Dec 2023 10:16:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 09/12] riscv: Add support for kernel-mode FPU Content-Language: en-US To: Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linux-arch@vger.kernel.org References: <20231208055501.2916202-1-samuel.holland@sifive.com> <20231208055501.2916202-10-samuel.holland@sifive.com> From: Samuel Holland In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 08:17:20 -0800 (PST) On 2023-12-11 10:11 AM, Christoph Hellwig wrote: >> +#ifdef __riscv_f >> + >> +#define kernel_fpu_begin() \ >> + static_assert(false, "floating-point code must use a separate translation unit") >> +#define kernel_fpu_end() kernel_fpu_begin() >> + >> +#else >> + >> +void kernel_fpu_begin(void); >> +void kernel_fpu_end(void); >> + >> +#endif > > I'll assume this is related to trick that places code in a separate > translation unit, but I fail to understand it. Can you add a comment > explaining it? Yes, I can add a comment. Here, __riscv_f refers to RISC-V's F extension for single-precision floating point, which is enabled by CC_FLAGS_FPU.