Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp442671rwb; Fri, 4 Aug 2023 15:44:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdtUeieZIXmBJF6JaqCOq/0s0vgA9WZskoo43Gkyr5NSvseFJvqN8bgfoE2/lgINQ9CuL9 X-Received: by 2002:adf:ea42:0:b0:313:e741:1caa with SMTP id j2-20020adfea42000000b00313e7411caamr2207448wrn.25.1691189098034; Fri, 04 Aug 2023 15:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691189098; cv=none; d=google.com; s=arc-20160816; b=peOnBvfTnAGDmFaSDF5Dt9BCMNEMks+AkJT8KTYlbdo5QTYpdza7F0IX1BL0CGaF1g 9shPmEEo4zUPpSC+YX8MgQ6KreoBWjKAqVDjeiIR4UUVAIhgtDEPCArqVyxPQ7qzj3zy PfKskjlDaGRCD5D5GCcO3vbeIYQhk8FGc16UJs4+Ds64B92M5lCsB+4s11CCHflozgcM n/QMNM7OYrMdkAE58PDeR4kxu4p+BkXmiD1ci2RNMyu1Mo/eHZVbfSvrgDHSEHK29C5s LtGet9o+8jfgIZlswD4IMt6SFKDeC91Zj/jpOV8LZsdgdmqvoQrPA//s9n7Y1OZg/8fM RTKg== 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=9zaXJKmcj+MwCrZ8Trkm9EFDo0x/bUBjbe64OrU0o0E=; fh=kXLF4rQemaX0TYWH7Sw0Brd137jdRyrAyW7K/E/dWXw=; b=llZ/omVIVHRhC3WTH3PMcySbKbAdme4yGR63rAw/2aXk44/Vkq2R2o2GjCIFreyYJw oUu+2Jw7wT70dISIHpIKcepceVg1Tj+cI7sDEkwZ4/9FeI3DSEquA6rFUlDWim5JmO9x iYAeobDvRS0DmuLt37jAFOIEPL4MMUYud8YjTrsZDhTnHuIfpnmKF3mSpCgX7Eg82DQ2 67xUJbmaKh2oxtKiAGVamD63DRbQg5i1dtHA+rneuGkpkFLVFLin+kr2VEZBcopMpzRn MJAbu8PVVB4kducH1BGPmx1novNpxq4UzkIF9Y2HkDB7oVwIY9EO/+quDDiVEI64gZh7 HjYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=X6kn5AgZ; 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 l25-20020aa7c3d9000000b0051e0d7f1e3esi2152647edr.419.2023.08.04.15.44.29; Fri, 04 Aug 2023 15:44:58 -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=20221208 header.b=X6kn5AgZ; 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 S229744AbjHDViI (ORCPT + 99 others); Fri, 4 Aug 2023 17:38:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbjHDViH (ORCPT ); Fri, 4 Aug 2023 17:38:07 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CBAB2 for ; Fri, 4 Aug 2023 14:38:06 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1bba7a32a40so20133955ad.0 for ; Fri, 04 Aug 2023 14:38:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691185086; x=1691789886; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9zaXJKmcj+MwCrZ8Trkm9EFDo0x/bUBjbe64OrU0o0E=; b=X6kn5AgZtYo94YUVeDf2+BOWljOG+XKtCYClw5OZnE6uoDzKhPvXX0M7r0Vv9WP546 CvNWqAwD7gr+FXeRR14zI2JOfXcmh+l8nDjxc4/iGxtAsBPpOM9cS//pz9YV8UVxY6sC YPSUbwkOrVgGuH2sRkOmTh1NlztGxoZ9cqHjq4DL9p9ydU2odLeCoU2s3w2G3VYvhG1Q 28uI/kshRQw3nQWWYcjgEbtlwpTQRSwVQWcDD7QXKI0+krPX2Kn8D013iMAASy//82e2 BnYeawn+smwXRZIQN8V9cBE2k+D1iWGQJIrT3BUgK8qp2biJFbgM5Mm7ML4zGOg8ENfq vmtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691185086; x=1691789886; 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=9zaXJKmcj+MwCrZ8Trkm9EFDo0x/bUBjbe64OrU0o0E=; b=TamOSR6xR3R2EKdWaOGMrnO/vovBOv+Yy/ZqDwZMTaBg+Ld1nS9QMMfpphfC2yX1WU 0Bccm9CBhzh+6tkhkJxQhYtUUaBr2u9NTIfD04GK2KYQEKSu2QZRSCSgnHe9uVw13lCF 0Nd54lk2taey6aB7r3JoVzP4fnWtAqiY0Y+cDSx5cl0Lj1HUBbUBvTy/HPn12PEwXEbD RTL7On2fpEQMNNCyrp5Rg5Ksum89ZrxOce++sq3z5ySRQ2lca1kQA+PlLKhKMLCXkwxn STB2hy3sGh547Dasuicz0hnvV/7em5vXo+T/8pxvG96QYpH68JGBjTLBj9VIcPOcqJSp SBuQ== X-Gm-Message-State: AOJu0YwMzEM5QQpuenUQwYDalmAY1DcQanetoTOJscTsLgbUpUEe+jME 4uBcLEeDuYAteOjN6R2+chf155j5g7o= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:e844:b0:1bb:91c9:d334 with SMTP id t4-20020a170902e84400b001bb91c9d334mr10999plg.0.1691185085970; Fri, 04 Aug 2023 14:38:05 -0700 (PDT) Date: Fri, 4 Aug 2023 14:38:04 -0700 In-Reply-To: <20230803042732.88515-19-weijiang.yang@intel.com> Mime-Version: 1.0 References: <20230803042732.88515-1-weijiang.yang@intel.com> <20230803042732.88515-19-weijiang.yang@intel.com> Message-ID: Subject: Re: [PATCH v5 18/19] KVM:nVMX: Refine error code injection to nested VM From: Sean Christopherson To: Yang Weijiang Cc: pbonzini@redhat.com, peterz@infradead.org, john.allen@amd.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, rick.p.edgecombe@intel.com, chao.gao@intel.com, binbin.wu@linux.intel.com 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 This is not "refinement", this is full on supporting a new nVMX feature. Please phrase the shortlog accordingly, e.g. something like this (it's not very good, but it's a start). KVM: nVMX: Add support for exposing "No PM H/W error code checks" to L1 Regarding shortlog, please update all of them in this series to put a space after the colon, i.e. "KVM: VMX:" and "KVM: x86:", not "KVM:x86:". > static void nested_vmx_setup_cr_fixed(struct nested_vmx_msrs *msrs) > diff --git a/arch/x86/kvm/vmx/nested.h b/arch/x86/kvm/vmx/nested.h > index 96952263b029..1884628294e4 100644 > --- a/arch/x86/kvm/vmx/nested.h > +++ b/arch/x86/kvm/vmx/nested.h > @@ -284,6 +284,13 @@ static inline bool nested_cr4_valid(struct kvm_vcpu *vcpu, unsigned long val) > __kvm_is_valid_cr4(vcpu, val); > } > > +static inline bool nested_cpu_has_no_hw_errcode(struct kvm_vcpu *vcpu) > +{ > + struct vcpu_vmx *vmx = to_vmx(vcpu); > + > + return vmx->nested.msrs.basic & VMX_BASIC_NO_HW_ERROR_CODE; The "CC" part of my suggestion is critical to this being sane. As is, this reads "nested CPU has no hardware error code", which is not even remotely close to the truth. static inline bool nested_cpu_has_no_hw_errcode_cc(struct kvm_vcpu *vcpu) { return to_vmx(vcpu)->nested.msrs.basic & VMX_BASIC_NO_HW_ERROR_CODE_CC; } [*] https://lore.kernel.org/all/ZJ7vyBw1nbTBOfuf@google.com