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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7DBCC77B75 for ; Fri, 12 May 2023 12:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240895AbjELMxQ (ORCPT ); Fri, 12 May 2023 08:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240097AbjELMxM (ORCPT ); Fri, 12 May 2023 08:53:12 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982BB14E44 for ; Fri, 12 May 2023 05:52:38 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683895950; 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: in-reply-to:in-reply-to:references:references; bh=Q1Qnr6qOh5XLwLTUnA7hAJyWDHMXCkJRQnSY5Vv2iFI=; b=RLKM1irkA/S6PX5pgp00KghEnw1PJxlRcdAqv7K9iRiuwO9abG66QLIqqEINhLfB18ejov kmjTGbzivVDl/RcY/qZgTOniOrSmDYZNTVXI/RQ/CtI9toNONXIjndW0s8Qikn4DKJeCM4 wMjs6CEDpOc82EwvqNA+0jy7S2c/jnB0md2Gi+ThyDAMFHaQWA9bEKYKMZzEv+I0EuUpdD Q6aarvkxQr3T6DKtUpG642NKXHsntlJ0ey2qXoARgh117e8KdqD/vmRQcAa5H75JHfHgYc LTcGYGHsqm2MsX1vljRhXV46X0M+uuLqdQ6cHyMpU4Tgq5vhRWbRiWqJ4GvCJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683895950; 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: in-reply-to:in-reply-to:references:references; bh=Q1Qnr6qOh5XLwLTUnA7hAJyWDHMXCkJRQnSY5Vv2iFI=; b=BPEF2auQlKPvkeFlI6HKQG5cpnsOSyIpScFOUchyabKoijX+U/82lP2gWW5meqoOjAtSCm E9Sln1sGHvRY/ZBg== To: Adamos Ttofari Cc: attofari@amazon.de, Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kyle Huey , "Chang S. Bae" , Andrew Cooper , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86: fpu: Keep xfd_state always in sync with MSR_IA32_XFD In-Reply-To: <20230512113900.56393-1-attofari@amazon.de> References: <20230511152818.13839-1-attofari@amazon.de> <20230512113900.56393-1-attofari@amazon.de> Date: Fri, 12 May 2023 14:52:30 +0200 Message-ID: <87y1ltbtkh.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 12 2023 at 11:38, Adamos Ttofari wrote: > if (cpu_feature_enabled(X86_FEATURE_XFD)) > - wrmsrl(MSR_IA32_XFD, init_fpstate.xfd); > + xfd_set_state(init_fpstate.xfd); > @@ -914,8 +915,7 @@ void fpu__resume_cpu(void) > xfeatures_mask_independent()); > } > > - if (fpu_state_size_dynamic()) > - wrmsrl(MSR_IA32_XFD, current->thread.fpu.fpstate->xfd); > + xfd_update_state(current->thread.fpu.fpstate); How is that supposed to work? this_cpu(xfd_state) == current->thread.fpu.fpstate->xfd So the MSR write won't happen. Thanks, tglx