Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp607250ybz; Wed, 15 Apr 2020 15:03:01 -0700 (PDT) X-Google-Smtp-Source: APiQypIehpZlUAyahU7Mr8ktfBuKqqgiim1LlOjBANA612XvflFEVAQiOdVFOq8oxhPkQNJ+p8oe X-Received: by 2002:aa7:c64a:: with SMTP id z10mr27431097edr.126.1586988181611; Wed, 15 Apr 2020 15:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988181; cv=none; d=google.com; s=arc-20160816; b=EbscuxBNgCZW+n2BmGThjKl3BKwjk6sThfJcHHr8rK94rHqnlTuD5YtlWtbvLCteuv +lJlJadX34onGznv+SmpS4WN1+zhBQd0l2hglvo1ayvcJcYP9D9Jp1VkjjEeg4dQhk4f Rh9SUVYTWEqeKJIADnACHPsM2KXbDuCoApQ8mjLL4cyPgwF7GBoV1UsoJVcDAhD8aa78 6zxIabICvRhdSBuMrJ4wWZ1v3Dwn1AwWNShydhsDJtDcROJQJDplQs65m4XSrMOAxV3b AzE5IIDZhpShyk5yLu2ZlEhq/knon3GBzzn23WDvNIZyl52nY/Zk9xhgl1OQJzzWLD8d llow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=l/aLyaeqZbH8/HPqqTBWscvZIxRoDc4mLeeqIyl//TQ=; b=anruHyaLi3CWmvpF/U5rTP30jasClY6M7lvpbIX59NfItQywKWWvk0mOcSecHtyu3e 8mXNAo1Yzof0CbuUe3o3BjSWeMdkSiTDXOGD295yE3v0PEZC7bGSFHYwVGxxtl0ISa/J 4hyuI/KZpyEVmQXFAjGifzlF0oCtrYCejVXM4dwsPC0J/BTvimEF/3rPTnpVFIoe9dwR zbU04yIRC+Mhg56S3nCILdHOnL1jjhqzAGkpYZ1G38vHOtEyNPADai3Dy+FzFM3e8qpS q9YT9CGFVk1Jv2vubUrNOiAUbaiXvEZFOZvCasW2rAKmnV4i0VRcA6HqsnUEXxukoa3P OdHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si12869297edg.339.2020.04.15.15.02.35; Wed, 15 Apr 2020 15:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407902AbgDOChf (ORCPT + 99 others); Tue, 14 Apr 2020 22:37:35 -0400 Received: from mga18.intel.com ([134.134.136.126]:21022 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728267AbgDOCh1 (ORCPT ); Tue, 14 Apr 2020 22:37:27 -0400 IronPort-SDR: 4q9rNAAYexd7d2NFzb/KI0wdbc5nWP6kJHpCqMR+mFIG6Z5DEZ7PGvNcbY8QbkZWsxlmuBl+6C uE820vEgPtbA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 19:37:26 -0700 IronPort-SDR: OqNLaOw3JF/FuoJ8wEVXwaYE4EFIrrIf7Gmgt4l2XkUrfzesJw1451rmBQIbGK+bc+BvfQ35Nc BoFXCSzu5L8Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,385,1580803200"; d="scan'208";a="298873774" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2020 19:37:26 -0700 Date: Tue, 14 Apr 2020 19:37:26 -0700 From: Sean Christopherson To: Jon Cargille Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Northup , Eric Northup Subject: Re: [PATCH 1/1] KVM: pass through CPUID(0x80000006) Message-ID: <20200415023726.GD12547@linux.intel.com> References: <20200415012320.236065-1-jcargill@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415012320.236065-1-jcargill@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 06:23:20PM -0700, Jon Cargille wrote: > From: Eric Northup > > Return L2 cache and TLB information to guests. > They could have been set before, but the defaults that KVM returns will be > necessary for usermode that doesn't supply their own CPUID tables. I don't follow the changelog. The code makes sense, but I don't understand the justification. This only affects KVM_GET_SUPPORTED_CPUID, i.e. what's advertised to userspace, it doesn't directly change CPUID emulation in any way. The "They could have been set before" blurb is especially confusing. I assume you want to say something like: Return the host's L2 cache and TLB information for CPUID.0x80000006 instead of zeroing out the entry as part of KVM_GET_SUPPORTED_CPUID. This allows a userspace VMM to feed KVM_GET_SUPPORTED_CPUID's output directly into KVM_SET_CPUID2 (without breaking the guest). > Signed-off-by: Eric Northup > Signed-off-by: Eric Northup > Signed-off-by: Jon Cargille > Signed-off-by: Jim Mattson Jim's tag is unnecessary, unless he was a middleman between Eric and Jon, in which case Jim's tag should also come between Eric's and Jon's. Only one of Eric's signoffs is needed (the one that matches the From: tag, i.e. is the official author). I'm guessing Google would prefer the author to be the @google.com address. > --- > arch/x86/kvm/cpuid.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index b1c469446b072..4a8d67303a42c 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -734,6 +734,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, > entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features; > cpuid_mask(&entry->ecx, CPUID_8000_0001_ECX); > break; > + case 0x80000006: > + /* L2 cache and TLB: pass through host info. */ > + break; > case 0x80000007: /* Advanced power management */ > /* invariant TSC is CPUID.80000007H:EDX[8] */ > entry->edx &= (1 << 8); > -- > 2.25.1.481.gfbce0eb801-goog >