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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 D26BEC433E9 for ; Tue, 19 Jan 2021 11:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA47222DD3 for ; Tue, 19 Jan 2021 11:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390958AbhASLXK (ORCPT ); Tue, 19 Jan 2021 06:23:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391209AbhASLKI (ORCPT ); Tue, 19 Jan 2021 06:10:08 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86DEC0613D3 for ; Tue, 19 Jan 2021 03:08:35 -0800 (PST) Received: from zn.tnic (p200300ec2f0bca00c2aa0e949335efb7.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:ca00:c2aa:e94:9335:efb7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 784801EC05DE; Tue, 19 Jan 2021 12:08:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1611054514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Kdn7P9WzM0xVuzlmYLDRSLdnweoXLWKsFHtwTTxXd58=; b=Yyg/bTelymTJ0F9UpgftO+yPBlfEV8L22ww9skrs1MsNIWHTchstJ475l4N/bwhKNRDPM6 Mr9YSQQwwscqCJ1G+UyZyWLcoWfmPt5fybGyVMa61P/Y/SKUDzDrQBEbNt33RIdk4t+JNg gEMmqq7jRx58floTsezJhbnPXeIXFFw= Date: Tue, 19 Jan 2021 12:08:34 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: x86@kernel.org, LKML , Krzysztof Mazur , Krzysztof =?utf-8?Q?Ol=C4=99dzki?= , Arnd Bergmann Subject: Re: [PATCH 1/4] x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state Message-ID: <20210119110834.GH27433@zn.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just nitpicks: On Sun, Jan 17, 2021 at 10:20:38PM -0800, Andy Lutomirski wrote: > Currently, requesting kernel FPU access doesn't distinguish which parts of > the extended ("FPU") state are needed. This is nice for simplicity, but > there are a few cases in which it's suboptimal: > > - The vast majority of in-kernel FPU users want XMM/YMM/ZMM state but do > not use legacy 387 state. These users want MXCSR initialized but don't > care about the FPU control word. Skipping FNINIT would save time. > (Empirically, FNINIT is several times slower than LDMXCSR.) > > - Code that wants MMX doesn't want need MXCSR or FCW initialized. "want/need" ? > _mmx_memcpy(), for example, can run before CR4.OSFXSR gets set, and > initializing MXCSR will fail. "... because LDMXCSR generates an #UD when the aforementioned CR4 bit is not set." > - Any future in-kernel users of XFD (eXtended Feature Disable)-capable > dynamic states will need special handling. > > This patch adds a more specific API that allows callers specify exactly s/This patch adds/Add/ > what they want. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette