Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4199580ioo; Wed, 25 May 2022 18:11:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1/NnfxHkCTJZdQePXVAkRgYUfNXnOkAxfNAwoqzDMqHduisuE/j9VxDHa32SHYCBRX2fU X-Received: by 2002:a17:902:8605:b0:15d:10dc:1c6f with SMTP id f5-20020a170902860500b0015d10dc1c6fmr35581701plo.4.1653527472525; Wed, 25 May 2022 18:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653527472; cv=none; d=google.com; s=arc-20160816; b=Z8ym9fsgdRIU3rfSLLkkmoRJ4evssnW5gX0T4bjOh5N7H2EF6eUqOPUvnERVc78txq jm8z9WX1XV01nZSPwurtUSzwrTzUzQJ9vpNTt989waTDCplwWmFJaLTbq1jgQ6zgU/LJ Ken3Ohit9pyIqcWO79Ag1BIJ8v7QvxWRyc2xhVqZVFsOaa8oDXUDq/QrTTUrfjrH7j2e 0rPS4gQ1ZshvbXC62DhAYTeFs3N+397E4aUW+KeAs+4NfPrUiU8S9A0SgorZD197Pi7X r/jKYgJfLUwFWdrufdobGs54MXPHgJSEIzV1pgdEKDElZDkzJ74mOh6OxulWPFusQDHW AEig== 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:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tsEdLKvObPS7G8Z2sQJhN9Qv1wSfra+nvCaaXzSR3NE=; b=oQxbGdHCr/NQQV1l19mmivj1RsauZ1jSOYLbxdnQmHfY0p7ViM/s9LeayZ8YRH9eCz hzPP4FwpYFGQ48/IggA0WFBn+6URCCi68zAyl/Bg8VmVx6PjSsKlgDOvKSpsnMysZ32M epP/3gbHfycQF8lfMbgp9RpQxuuwYSfiKp8pdabeuHL0LBHasQnou49j4BD4rjQU+63I PLVSD8t909s4c/RM5Wfl9eizFmh9b4qKsaDD1+uO9ApKnffHpqeVn5jVLkcsatqWP5sj V58OgFCYcaHCvroXnz4v5TE+F2sRUM8G1T+Yif8yht+hvuSwbjUNlBLwk+Jf4pHXJvt8 hifw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TPnIR59M; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc21-20020a656d95000000b003c64af6e01dsi698912pgb.123.2022.05.25.18.11.00; Wed, 25 May 2022 18:11:12 -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=@google.com header.s=20210112 header.b=TPnIR59M; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343491AbiEYRrA (ORCPT + 99 others); Wed, 25 May 2022 13:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245758AbiEYRq5 (ORCPT ); Wed, 25 May 2022 13:46:57 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 455BB46B3D for ; Wed, 25 May 2022 10:46:56 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id c15-20020a9d684f000000b0060b097c71ecso7735827oto.10 for ; Wed, 25 May 2022 10:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tsEdLKvObPS7G8Z2sQJhN9Qv1wSfra+nvCaaXzSR3NE=; b=TPnIR59MQ45wZoYaGmL9O8worQ137EbRsvzppbPyS1whsq0eOeIpSRl+fYbYGKYU8l X30g8eKP+oGDmMHHKGkodCqfuh3KmP3trn/mrXHSBGS9ytHpirPwoESMELyEwL7drh8i VD6AGeyGlDOZ2EKmkoTsu/UHywH1C8Ar9cV6oyPzecPth3ANRjY1/7pVeXISKns7zJv/ BlEkvE6dcmUr5lEp491jGCQZeEZkpGQ7JMwJmr8W/L1F0+mtVzegIBrSov65CWaev1py YMI7xfBe0+JlXfSL+HVk3H0ZwkvQ1oWXgcK3aRJB2LxWd+N0IaE6Y6//JkENHMzUiP2v eRZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tsEdLKvObPS7G8Z2sQJhN9Qv1wSfra+nvCaaXzSR3NE=; b=lFSGwmrr8gaIZRdVlKR34+kydPzTGIlU85IDB465/1TiSm34EKNMuFgbkdvwAJqAIo yNEFrhOd3nK+Lck5NsCW1kWt1Hgoq7rE27oWgsMBHWJXuUrI1q5txJOKpnl8Md/KT1gd LqoS3zqiPidhkPN22iSfdE159MiOhIu4qcUCfi4t6J4KdEjLsrBjbmUtfZ8wlJJ6Ef1h QiXPdiVdbXuSgSkLzlBDbhP48nIthqAe6D4oq7P+TWSI+qQcUogsYfzjOuKTUZDm7qNe lqixKHdls9Orh0b51nFy1Ol5pD80dCJAlkhnqpP1N7ljz1TO2zdR8p1QpMqct5I6+6tD 3J9A== X-Gm-Message-State: AOAM532Vqxy6I27yopKm37hSip6JS+uWg+tEhCBTvNyTRU1fIl8r9jxb /mZG9CCTLmM7SE4o2sWi1PudiyZumsGn+XHQ0GakFQ== X-Received: by 2002:a05:6830:280e:b0:606:ae45:6110 with SMTP id w14-20020a056830280e00b00606ae456110mr12927454otu.14.1653500815319; Wed, 25 May 2022 10:46:55 -0700 (PDT) MIME-Version: 1.0 References: <20220520204115.67580-1-jon@nutanix.com> <3C8F5313-2830-46E3-A512-CFA4A24C24D7@nutanix.com> In-Reply-To: <3C8F5313-2830-46E3-A512-CFA4A24C24D7@nutanix.com> From: Jim Mattson Date: Wed, 25 May 2022 10:46:43 -0700 Message-ID: Subject: Re: [PATCH v3] KVM: VMX: do not disable interception for MSR_IA32_SPEC_CTRL on eIBRS To: Jon Kohler Cc: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , Andrea Arcangeli , Josh Poimboeuf , Waiman Long , Kees Cook , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Wed, May 25, 2022 at 10:14 AM Jon Kohler wrote: > > > > > On May 25, 2022, at 1:04 PM, Sean Christopherson wr= ote: > > > > On Fri, May 20, 2022, Jon Kohler wrote: > >> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > >> index 610355b9ccce..1c725d17d984 100644 > >> --- a/arch/x86/kvm/vmx/vmx.c > >> +++ b/arch/x86/kvm/vmx/vmx.c > >> @@ -2057,20 +2057,32 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, = struct msr_data *msr_info) > >> return 1; > >> > >> vmx->spec_ctrl =3D data; > >> - if (!data) > >> + > >> + /* > >> + * Disable interception on the first non-zero write, unle= ss the > >> + * guest is hosted on an eIBRS system and setting only > > > > The "unless guest is hosted on an eIBRS system" blurb is wrong and does= n't match > > Ah right, thanks for catching that > > > the code. Again, it's all about whether eIBRS is advertised to the gue= st. With > > some other minor tweaking to wrangle the comment to 80 chars... > > RE 80 chars - quick question (and forgive the silly question here), but h= ow are you > counting that? I=E2=80=99ve got my editor cutting at 79 cols, where tab s= ize is accounted > for as 4 cols, so the longest line on my side for this patch is 72-73 or = so. Tab stops are every 8 characters. :-)