Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2941586rdb; Wed, 4 Oct 2023 17:11:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFW+gDO+/SaD2NU98JKOL5wk0Ng8pUB9/fkLYT/KLrmpesp3NAdG615aHp/OwI3fSxSa8RM X-Received: by 2002:a54:4894:0:b0:3a7:1e40:6ce9 with SMTP id r20-20020a544894000000b003a71e406ce9mr3718968oic.26.1696464697801; Wed, 04 Oct 2023 17:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696464697; cv=none; d=google.com; s=arc-20160816; b=ODzzIJpBICBMEIgWTOiVeAh1zhBqstLqo1Ebj9dbvPuU2xa91dZIpepsqlGDOniUTJ hX4mD7OUGQi7aolzmWXGIFuzPJxybagvgR88zRiFl+34ag4lJWhyqA/XsOXOgJLGJ+A1 JVKPKXheC2kYzdUN1v8CfzKkYEh7C13E2Q5ZuBpH7u/4uVy0wV6Ipb+kyGkzB22AbcfW a6aCERnmlEiWewwsMn2P+oT5/NBVqKj/O1YhkKOYuczeakF26hEZspcXNzMfdIWl71ia d7IcKeX80SywVnuTSp1TmBGliDCUE6EHjTCxokWJDIeMxyMYgwaQcOTne7qLrJlmHwlQ VAXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:from:subject :message-id:references:mime-version:in-reply-to:date:dkim-signature; bh=gPugQrDnD73C5LTJhkV2zm1niwL250wt+6xcFQiBy84=; fh=AfsjATVnzZRJaUrZvZrNsvo4nEvCYzJfa655Qzt9sTo=; b=ya5yYjYCww8xSPse85EBItXR6WJA3KwYHydujTCwkIP90m8K1BIFqWdYaEk9h4vyEP XEhkRW5lj2u/sRNZwMxyHclalcYikcFYC2A1T6yi0DeWgFLRACnvJOZyJKP2/zwxy9Uj SkhAt6ouIBGBLiERDy8HeSmueNLBo1nb80dpTwe29KG+sIRcPeWhSqw4dcZ6rjmLmsXY gFVQCZDTyMkgA+U8nyUeILgAjsMLM0tP047645ry0IAUA1qUgfFttVMVZFnAGDEP34Z3 1gdndPDqfEDDC7eoVfXOERFYLSX2RH2Tl85fkZ5MCgnMTqz8BzxgsngVxo6T/cav7G48 xlPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dn0OGU81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j71-20020a638b4a000000b0058962af84easi272275pge.135.2023.10.04.17.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 17:11:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Dn0OGU81; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 11F1180B3B62; Wed, 4 Oct 2023 17:11:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244211AbjJEAKl (ORCPT + 99 others); Wed, 4 Oct 2023 20:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244205AbjJEAKj (ORCPT ); Wed, 4 Oct 2023 20:10:39 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66E21DD for ; Wed, 4 Oct 2023 17:10:33 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-2773ced5d40so412455a91.1 for ; Wed, 04 Oct 2023 17:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696464633; x=1697069433; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=gPugQrDnD73C5LTJhkV2zm1niwL250wt+6xcFQiBy84=; b=Dn0OGU81g5mIl6PaMNEj/WH0T2m6BygJ7GoIzh8tNy6B6ZqiGV0VmP3sGr+RdBkrsq jJoZjHteDHnA4LzSxuILn3AGoM6mddseCTXeEff2DpViwJlAW+KDaUXyDf/ZH6giXRGq hdiNt7tZ/oR4AEt16VMjK3Jq1reANaBFLMg4HBeSmAdjgXFOLP++kYOR10zAnzPPDGmQ xf9igVp63LSJgfpCsfsW2C2AXA7RGvw9pKt0lpLlPqDL5LK1dAnkYw2g+MHWIBm3c9qv nMaVbetDv/ODkCf7LtoACjq6mWXq32DRMrHEsenx2Mqj1MyqjgD94CyovVfnQx724oSb +NfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696464633; x=1697069433; h=content-transfer-encoding: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=gPugQrDnD73C5LTJhkV2zm1niwL250wt+6xcFQiBy84=; b=DcxhG9Ahe+9fMm0ebv9yWkB1O0rNBMOkmjX2sVmdBFzMEsQR0d0LaUKCuNWyjArHMT 4h2AyrRguVXlD22b4H1DtT17kXlqawQvwdg2DJksCd2OBWn9WckPuT5t4Juz4xuhBi9M QgRt2ceTkE09cDhUxQWPAP4KapIVrhz52Hp7cPCdTcs7hDejxOD/dhPazsMevyMRzSio P6ideWxu2vrFe80fvIoeSP/UKTg7G8bDNxwWFIIshc/UymTvj4PS5YdJJ8XoOUAR7qap Q7mzaOzMBSiVXbWv9JX0TFCu65YGp+yVDtkkxGJllMO8a0CoOoEk+GV+fkt3WKJM0qUN SBlw== X-Gm-Message-State: AOJu0Yxyo1xXZxvZv/SMb4K8COPUoIdBfI+lmYa+UjPbWueUs3j6gqmQ NWElVfjVVLkjvI5Tw+kUj45O2yUgaHY= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90b:8d8:b0:278:fb8b:32ae with SMTP id ds24-20020a17090b08d800b00278fb8b32aemr61159pjb.9.1696464632755; Wed, 04 Oct 2023 17:10:32 -0700 (PDT) Date: Wed, 4 Oct 2023 17:10:31 -0700 In-Reply-To: Mime-Version: 1.0 References: <0ffde769702c6cdf6b6c18e1dcb28b25309af7f7.1695659717.git.maciej.szmigiero@oracle.com> <8c6a1fc8-2ac5-4767-8b02-9ef56434724e@maciej.szmigiero.name> Message-ID: Subject: Re: [PATCH] KVM: x86: Ignore MSR_AMD64_BU_CFG access From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , Borislav Petkov , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Tom Lendacky Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 17:11:01 -0700 (PDT) On Mon, Oct 02, 2023, Maciej S. Szmigiero wrote: > On 26.09.2023 00:25, Tom Lendacky wrote: > > > > It's partially documented in various AMD BKDGs, however I couldn't = find > > > > any definition for this particular bit (8) - other than that it is = reserved. > > >=20 > > > I found it as MSR_AMD64_BU_CFG for Model 16h, but that's Jaguar/Puma,= not Zen1. > > > My guess is that Windows is trying to write this thing: > > >=20 > > > =C2=A0=C2=A0 MSRC001_1023 [Table Walker Configuration] (Core::X86::Ms= r::TW_CFG) > > > =C2=A0=C2=A0 Read-write. Reset: 0000_0000_0000_0000h. > > > =C2=A0=C2=A0 _lthree0_core[3,1]; MSRC001_1023 > > >=20 > > > =C2=A0=C2=A0 Bits=C2=A0=C2=A0 Description > > > =C2=A0=C2=A0 63:50=C2=A0 Reserved. > > > =C2=A0=C2=A0 49=C2=A0=C2=A0=C2=A0=C2=A0 TwCfgCombineCr0Cd: combine CR= 0_CD for both threads of a core. Read-write. Reset: 0. Init: BIOS,1. > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1=3DThe host C= r0_Cd values from the two threads are OR'd together and used by both thread= s. > > > =C2=A0=C2=A0 48:0=C2=A0=C2=A0 Reserved. > > >=20 > > > Though that still doesn't explain bit 8...=C2=A0 Perhaps a chicken-bi= t related to yet > > > another speculation bug? > > >=20 > > > Boris or Tom, any idea what Windows is doing?=C2=A0 I doubt it change= s our options in > > > terms of "fixing" this in KVM, but having a somewhat accurate/helpful= changelog > > > would be nice. > >=20 > > It's definitely not related to a speculation bug, but I'm unsure what w= as > > told to Microsoft that has them performing that WRMSR. The patch does t= he > > proper thing, though, as a guest shouldn't be updating that setting. > >=20 > > And TW_CFG is the proper name of that MSR for Zen. >=20 > So, should I prepare v2 with MSR_AMD64_BU_CFG -> MSR_AMD64_TW_CFG change? If we can get Paolo's attention, I'd like to get his thoughts on punting th= is to QEMU/userspace. I'm worried that "handling" uarch specific MSRs in KVM = is going to paint us into a corner and force KVM to check guest F/M/S someday,= which I want to avoid at pretty much all costs.