Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4871100rdb; Fri, 15 Sep 2023 15:15:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGReBYZGO9KHReIS5E0AIFwAIl2LIdYbV4EnbKFGJpAji9UFYyP8kbJsLVvmhx7ncVqCibZ X-Received: by 2002:a05:6a20:6a20:b0:159:f5fb:bf74 with SMTP id p32-20020a056a206a2000b00159f5fbbf74mr3392035pzk.3.1694816115764; Fri, 15 Sep 2023 15:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694816115; cv=none; d=google.com; s=arc-20160816; b=C4uItncDjTP/ZiWPFIFB+HWgE8oUfN1OD7deNvdS3q6DJwHSvC4z1xc7a+s/awgg5q YPEAScEz0QjYbO8YawS10926Y7y+sQffTh9RNVNVoDXSc+ivoZoI5FvcN16fdpoYK3Cq 9BvWYUr9++npHq+QQWuF3+rv/UxUK+gb0b3YWtoKEF6uNjcJtXh5TsOiF26Xyi1Z9LU8 gJiRicrQIK/+EyrLGvqG6Nvv64M03lvzXcVsNjnl5Uu2SrKN7F4LezhEzw00H5HsJ8DA JBPOzJc+32gVr0OIp0ZmKYWN0iDEdVpvlXINsckJvKnTAsYo7rqVSLeDfPqMfgI+xbYP PCFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=EgH0+vdWhBKkmAM68hgMPvRed2JPtKLNHbHYRKgOnaE=; fh=OT24FjEwwODiSXbG1bLxfFmr8v5jULddwRt+0A0b4Mc=; b=t+C2/DVi6HFYUxccQIouyvdJFhoumTHHWbhD4AriH+apXgg7CZCTI5JDFdghhwhqLk LrbL9akyLk+PGY5HFwVSNrmAsbt0NXNebqRlsw0bky346Fnuf3yXRki1INSFLAZrknQw MQa+4gaCG0TsCz1n+smoSvgIY1YuAGsp2Sw+AWzNNhk7cwt7PRi9GMuGPuSt6wCxYpbN NTlwD4qXmoLf2JMlX6WBrFgnA/jEoVvjBWWH9Zu/zozZt+a1cAW85xGoD/qQdHlEXqK+ OVxWK0WUbh4t2qSNoi8il/4T3Mtm/qrYo60qgd37X4HXiL9LT+LRBTgX/zhT31I4tncY 93ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nvG530dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ch13-20020a056a00288d00b00689f1186cfdsi3927592pfb.29.2023.09.15.15.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:15:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nvG530dI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C8CC484DBA0A; Fri, 15 Sep 2023 07:33:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235701AbjIOOcz (ORCPT + 99 others); Fri, 15 Sep 2023 10:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235633AbjIOOcy (ORCPT ); Fri, 15 Sep 2023 10:32:54 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9C41FC9 for ; Fri, 15 Sep 2023 07:32:49 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-59c07ca1b44so14181657b3.3 for ; Fri, 15 Sep 2023 07:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694788369; x=1695393169; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=EgH0+vdWhBKkmAM68hgMPvRed2JPtKLNHbHYRKgOnaE=; b=nvG530dICqf28YeKAeGxKwv1ltN9QWRsvVqHfVeux/kZjFi/i7Dh6xPr1OFEOSG5Xa 3JoC+o3GB3In0lZcNxbo17KtK6lcKpzZV5zYTHpI01QYMT2/BJJ2mOfsRn5LFjatkfow 2zBhZh+A3410kgLflKUx3BrTFz5xUZ7ei/h2lcLSj1HpaStfFTLy2by1LGkdnlrAwqqI qSJLJfzg0kApN0rMl+x9dQFQii7EmHnMSS5RCVBYZOtEUCwTK5LagmvbPuaNQNUEh4nn ZLHxJD9MmPueDkY/iWZwH6wt7xtZ2fbRxaxhVwGkRwmw8cF/pG5xEEPU+Jrnru7x3l5q 4LmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694788369; x=1695393169; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EgH0+vdWhBKkmAM68hgMPvRed2JPtKLNHbHYRKgOnaE=; b=IEeFWQmz2oOUfUppPW33UWAyF08C4iYscuuVQJh8rCL/opmMxeHRVJtFM02Y+g9p1p 4QK/eAEUHIJL2vO4PV6LzeeLFis1nqcfS6GlpLyAURib5zOEkvZ3qk6VRRKLahoL0+d0 boPhlchWYEm6e0ulRRGCv19nQdvWsM7TfmeNZwPhP4qE21xvI2CPu1kEcNpSGaldR1WB nm3pfiFsod+LuqgYZEiIriJBoTnypXkRGUMBXJuQr7M0jb/RbCkG3s/XsLJA4LEZGOiH cxpVjsKXlkEzu6IzT3vJaEu1dY8HHnQVl7/PX1WKzE9MRB9OVwOdPFYr5621CkwTRB4B 0VrQ== X-Gm-Message-State: AOJu0YzMiSzNAND3/3ep4KGecl7L8SdDSj43+Ju50Uj2/u7JTmA5TRbR RKMhASyvbFzv3EFPtXtXBoYRKmAE2NQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:ac55:0:b0:59b:ee27:bbe9 with SMTP id z21-20020a81ac55000000b0059bee27bbe9mr47809ywj.9.1694788368840; Fri, 15 Sep 2023 07:32:48 -0700 (PDT) Date: Fri, 15 Sep 2023 07:32:47 -0700 In-Reply-To: <1e155a46-78f3-51f4-40a0-a94386e8f627@amd.com> Mime-Version: 1.0 References: <8a5c1d2637475c7fb9657cdd6cb0e86f2bb3bab6.1694721045.git.thomas.lendacky@amd.com> <1e155a46-78f3-51f4-40a0-a94386e8f627@amd.com> Message-ID: Subject: Re: [PATCH 1/2] KVM: SVM: Fix TSC_AUX virtualization setup From: Sean Christopherson To: Tom Lendacky Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Babu Moger Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 07:33:01 -0700 (PDT) On Fri, Sep 15, 2023, Tom Lendacky wrote: > On 9/14/23 16:13, Sean Christopherson wrote: > This toggling possibility raises a question related to the second patch in > this series that eliminates the use of the user return MSR for TSC_AUX. > Depending on when the interfaces are called (set CPUID, host-initiated WRMSR > of TSC_AUX, set CPUID again), I think we could end up in a state where the > host TSC_AUX may not get restored properly, not 100% sure at the moment, > though. Give me a few minutes to respond to patch 2, I think it can be much simpler, more performant, and avoid any races. > Let me drop that patch from the series for now and just send the fix(es). > I'll work through the other scenarios and code paths and send the user > return MSR optimization as a separate series later.