Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4160406ioo; Wed, 25 May 2022 16:59:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoprLzW0o/3hJ9ovQAeYQIBcUzSRKukZJXG4IWzk/6ZTyR9vUBW7LHSOXKauELg08kDCel X-Received: by 2002:a17:903:187:b0:162:4a31:f6ab with SMTP id z7-20020a170903018700b001624a31f6abmr9636349plg.36.1653523166209; Wed, 25 May 2022 16:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653523166; cv=none; d=google.com; s=arc-20160816; b=bM6ga75wb5V6AejEzhAaQDJ/ZOUE1em3OrudKzMxjlScxyW+Zl/ELKn2KvBDLn1keU c5cds2WvZC5FUHDWG2ctMal7Ods0JJWtzfxhwx2gTlUzraHoZ5cs5BXDIA37j4TUR3ad pY5LgrqKdBmLLBO0CkdqVPE9+c60DiXBsEwKwr/5df6W1GHiV8u+FTD5OD8GrLLHskWE Ix8MXEcHW1JNnWiiKDRLjHX/aZVu0US7cE483LCMU88lHr9BmWm2M0KxaDyXMafK5oil rrUiCtLxHS7z4blgmZ4VLIXcPhJUBg2YjpK2KxCnDk3JwURTpoWJp1L6jjDhkVcc+uJi 5sTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uKOzhX8ru6YupzPPVUW9G2G9XsQPjTP3RBRMRT4HCrs=; b=VKCyBACImYF1FZvA++cDwB2/8fKW99x5Tnc4RgO+WsJR5EEzQ/c9zqBs4d05VTQNeX 4DWAWQS3J3r5zldPYmtAVOzsJFax2jsLWm3qOhZbBt+pfCwT0QW15w08pI4upBVBmqTN 4osbz6YmtSzkNwDgMQNvEb1tct9m6MmEgkRQEKSd5/9D0uSzElV5DjXW3lKeo/eS8X2y QK5Bxcg9y+WQmFuvd3zka6OC4NRzQz4ima7LzGPuE3p+yGVA6fvz4kx4n69+tN60DITp 6O4YdwhIvEXYsrFWdpsYcDDzr4drnUuQmgQiiF0uiYlsvCgGd2y8XMhzOedikD1GRpnd 06tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=FyAccB0o; 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 pf9-20020a17090b1d8900b001e09b7beb09si416846pjb.49.2022.05.25.16.59.14; Wed, 25 May 2022 16:59:26 -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=FyAccB0o; 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 S245687AbiEYRcg (ORCPT + 99 others); Wed, 25 May 2022 13:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiEYRce (ORCPT ); Wed, 25 May 2022 13:32:34 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21B28AE271 for ; Wed, 25 May 2022 10:32:33 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id x2-20020a17090a1f8200b001e07a64c461so2237891pja.4 for ; Wed, 25 May 2022 10:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=uKOzhX8ru6YupzPPVUW9G2G9XsQPjTP3RBRMRT4HCrs=; b=FyAccB0oXpEBuBOxcmix4vQsWmUhUjnf8be7oMXpDUvwUENkgP2x52FT40EnpIwaDw fr7MQg1gH5pfpoKEKmgLmSRpwRlAPv8uoNHjnRignSUoOSY63W//VWSR9MNj3WEMZl9/ r2TUYrBLGdbL31Kf1hstHdiIZU1+LVMfCtS1w/GwV0Mal1LlQSx4qu6gSfpjnoR4D23Z MLyKNO6dX/cfK0OfvmedVYFnTH464/YqGeh4FOr7MpVuPDU/EZ0wGow3LN2QFt69oqYc y6DbaDylpoEwuA6Rjyra8npsj12P/Mg+qEJDmSTLh/PY8OhbUdTB0Mry8fiSV0LD/08Z HKvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=uKOzhX8ru6YupzPPVUW9G2G9XsQPjTP3RBRMRT4HCrs=; b=c9AKn9lLvHfga4eRaExDCfUqxeTQOhHoC2tXA/s2urgQQ+wScsjVXqYjONC/D3RXOo ZmhBn/GL8jGXHiJAZ191ZNH9YHYDvuFtN1ETMiVYhG41P0k3X6lMDeQvah46leDUvGhU 6i3nQqFwUhwTbMh6DmMS84oeKW6w70zradO6LGSRSC7AAXDiA/iADtLJpN4B05WBaykC M95FhlNVBPR6UnRZ4dQG+mXcBfAuRi8g7rR3svoWei6KHPj/oWx/fpeC7viaMKRbBajh wdA9n77Zp+/BMC4/Yb5bIhqt7RQQnBJ+fi3vHNDCrAvvdrucSgycPYCLxTdU5M+LUG8T g5cQ== X-Gm-Message-State: AOAM531YgI+osYIvmhksVo8Ma7rkrLndT2F1NNrEY1Y/2dQy2EUSu6JH 3AXEojPCdDZ4TPfo/pBT11iJsQ== X-Received: by 2002:a17:90a:5ae1:b0:1db:d0a4:30a4 with SMTP id n88-20020a17090a5ae100b001dbd0a430a4mr11701841pji.128.1653499952316; Wed, 25 May 2022 10:32:32 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id b6-20020a170902a9c600b001624dab05edsm3506026plr.8.2022.05.25.10.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 10:32:31 -0700 (PDT) Date: Wed, 25 May 2022 17:32:28 +0000 From: Sean Christopherson To: Jon Kohler Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , 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" Subject: Re: [PATCH v3] KVM: VMX: do not disable interception for MSR_IA32_SPEC_CTRL on eIBRS Message-ID: References: <20220520204115.67580-1-jon@nutanix.com> <3C8F5313-2830-46E3-A512-CFA4A24C24D7@nutanix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3C8F5313-2830-46E3-A512-CFA4A24C24D7@nutanix.com> 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, Jon Kohler wrote: > > On May 25, 2022, at 1:04 PM, Sean Christopherson wrote: > > the code. Again, it's all about whether eIBRS is advertised to the guest. With > > some other minor tweaking to wrangle the comment to 80 chars... > > RE 80 chars - quick question (and forgive the silly question here), but how are you > counting that? I’ve got my editor cutting at 79 cols, where tab size is accounted > for as 4 cols, so the longest line on my side for this patch is 72-73 or so. Tabs are 8 cols in the kernel. FWIW, your patch was totally fine with respect to wrapping, my comment was purely to give the heads up that I arbitrarily tweaked other bits of the comment to adjust for my suggested reword. > These also pass the checkpatch.pl script as well, so I just want to make sure > going forward I’m formatting them appropriately. For future reference, checkpatch.pl only yells if a line length exceeds 100 chars. The 80 char limit is a soft limit, with 100 chars being a mostly-firm limit. checkpatch used to yell at 80, but was changed because too many people were interpreting 80 chars as a hard limit and blindly wrapping code to make checkpatch happy at the cost of yielding less readable code. Whether or not to run over the soft limit is definitely subjective, just try to use common sense. E.g. overflowing by 1-2 chars, not a big deal, especially if the statement would otherwise fit on a single line, i.e. doesn't already wrap. A decent example is the SGX MSRs, which allows the SGX_LC_ENABLED check to run over a little, but wraps the data update. The reasoning is that if (!msr_info->host_initiated && (!guest_cpuid_has(vcpu, X86_FEATURE_SGX_LC) || ((vmx->msr_ia32_feature_control & FEAT_CTL_LOCKED) && !(vmx->msr_ia32_feature_control & FEAT_CTL_SGX_LC_ENABLED)))) return 1; is much more readable than if (!msr_info->host_initiated && (!guest_cpuid_has(vcpu, X86_FEATURE_SGX_LC) || ((vmx->msr_ia32_feature_control & FEAT_CTL_LOCKED) && !(vmx->msr_ia32_feature_control & FEAT_CTL_SGX_LC_ENABLED)))) return 1; but this vmx->msr_ia32_sgxlepubkeyhash [msr_index - MSR_IA32_SGXLEPUBKEYHASH0] = data; is only isn't _that_ much worse than running the line way out, and ~93 chars gets to be a bit too long. vmx->msr_ia32_sgxlepubkeyhash[msr_index - MSR_IA32_SGXLEPUBKEYHASH0] = data;