Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2708292pxb; Tue, 19 Jan 2021 04:16:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEQ007eqZSOYICwFcShs9WG4B7IlE+/4XnqevVmQs/cQq87HuTTgjhx7iXoul3VbDWp3i7 X-Received: by 2002:a05:6402:1f4:: with SMTP id i20mr3064555edy.180.1611058615392; Tue, 19 Jan 2021 04:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611058615; cv=none; d=google.com; s=arc-20160816; b=i/UWWBJo4kFBrGSNZtU1sa7oewT8YrieGQ/R3U+MOvZlCT25jaevzEo0TYUhRggiYj zPSQjzTChYC6CHTzTslR2UYpsPjbkhJd0iIOpnNYJmYqJYbxsa2NZuXk7ak+B1duJF91 A7aAljATcR7qe3bPV2a8c40GwWx0HIyc3Vo5ZkSbXSX+WyzTuQTbFYuGFhAepF3FenPB n5uWIdK7rXRLAruSNo1MKFKqFkxuP/5ISiB45aZfHpDZPg8PxGUPiUdUcBhU2WS2gYyz 4DEssvBsR5+O4fmZ13Hq90alG835l5G9I32kCsMWT9OXbIGfTjamz+781wGUcqhNyGKe +26g== 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=Kdn7P9WzM0xVuzlmYLDRSLdnweoXLWKsFHtwTTxXd58=; b=M61paiYILi+iJqCitvJPzYB9ZIU3bu19BzPjZlh+LTaftT7t6uEvqSu3DOcb9w6FFI RP08PK5g3Wv3wRfGm5VnDeRsmDczB8WrIVSqHakacfC7towNdwe//bsP0/lVRJ3yzUu7 NazJXNLQkuVyE1uJ2i9LtkWGBp6IQsZmkz0M/kRYNii4D9AiXCO+noRcsu5XbDz6pVy+ UoC5fDfYIT89Xsy97umGcF0T7rEKzv7twSqzIpyoXQOE/fDlTvYElnfnWNm/sjWoEflh 4dfzU/eEZf25GVutIrpqK4IscCkh+X7VyJcFQ5l6FZd5YyCsS3gEzPSs+CEmBCE7uugX 16Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="Yyg/bTel"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp24si7481834ejc.495.2021.01.19.04.16.31; Tue, 19 Jan 2021 04:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="Yyg/bTel"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389741AbhASLWz (ORCPT + 99 others); Tue, 19 Jan 2021 06:22:55 -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