Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10283813rwr; Fri, 12 May 2023 06:20:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6r0NMCRE72XOlTt2/KsD/u7mh/E4pFr79bs98e58vKr6syJxrTqk8+zJK++qlyAz+9Gyog X-Received: by 2002:a17:90b:885:b0:23f:abfc:5acb with SMTP id bj5-20020a17090b088500b0023fabfc5acbmr25683929pjb.18.1683897627213; Fri, 12 May 2023 06:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683897627; cv=none; d=google.com; s=arc-20160816; b=WoLtToVdUGmW16cboHxS0wEuXywLTe5czAbmYqO4pSn0O2Iy3vH1L/Oeu75syPFUl/ LqEgiA+jCSYKdebJwF7qb3B44pGnuzKRUrbe+mseO2HLfanzX93dd8UGwA9yPNDx9pMi 8nl1svKXf/trWPnxZ713reMt/OVldTKLFimhfyudzQVJn2OePKD9gA5xTTwNikGDeKsE TyjA806GrACA4bYIjTesE53xDb1wryd+EXHwZbb+/JhLtS8RarDerGOFWFeWpXag/JBU 6oa2Bk7t3DFGUksB8K1UyXe9wjNqtqBcnWfAO6YwrVBO/4jEjEnp7oaUCcUrHqoA0L/N stzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=Q1Qnr6qOh5XLwLTUnA7hAJyWDHMXCkJRQnSY5Vv2iFI=; b=KzYUu9XStLSkxQJPHad/mQKwi6djGqQ9FTzTWyna64jetTWMi/BGrO27OPncBDLV3d 1AfkLwW9uehdTliaKt3iZPaps5c8ZSuzL5Ng1QakrPR921jhBHQcKzReJuO5QnbXkPnj wnYaCAJYAG1N3C8WJuHhqmRau34DRp5TWBiIoxVPzz/8dqlDjcBVZPNDl6zF9DQFnvBP 7sDsZTvh5xC5ABYC90L64CzdjR3INpwxEITWaKdMU/eyqbkPP6u9ow5SVrndDm4vj/HT 45jTgZXLHlyM4CaovNXFEkYm3057S+hyM7aeMms71OZd4rM5Pt6kbmct4v+GXhDo0q5l D7EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RLKM1irk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a633609000000b0051b3d5543c3si9201802pga.130.2023.05.12.06.20.12; Fri, 12 May 2023 06:20:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RLKM1irk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240862AbjELMxP (ORCPT + 99 others); Fri, 12 May 2023 08:53:15 -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 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_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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