Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp566066ybt; Wed, 8 Jul 2020 06:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq5tsMSHIPMlkQ1pxkuI6xxv7lb72kyFmWBd2vCKO2KtVK3QaSjqXEwZAEzbYaL2NlzKHj X-Received: by 2002:a17:906:1d5b:: with SMTP id o27mr48813123ejh.367.1594215504971; Wed, 08 Jul 2020 06:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594215504; cv=none; d=google.com; s=arc-20160816; b=ENTYqawJSAVhle3IeL3nvRpP+/4tk+6hUNjtj7cgOckHgHo/BGub867sc8AB+Lzz38 ldGauTfLp8KB8VSwgZLhdmMpfRRJkUz0MreCl5/3PRVmoy/pSrZMroOcOtEilB3qELMZ rR9BKeNGqBS5ptYko0WcktY7b7aQc4RV7VA/rk5Gp4ALWh6cY/xNTfYwA1rBBxOHXbMS gxkPIhW4/EaronnERfhNedJy/mALjD/zTLYjrHoZe6T/1oKnOyrri2uKdUJH3Yw8PqxS rjhwmS51+G6NtjqI35xJFxfSKVIPs8RNHILVMBJTtml3Ij2F9WQzW2JjyVRKXNVkrSM9 1S7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=UnzpwKS7HlImYTr91e+G1wguCZAf7KQ6mVb43jEEZ3w=; b=mzgfSgLqIspSU/cy5gJWaDRe9RMrZ4JrWXhl0eIxrZkAZ7BVTltd66xtXBPd/DaE/f rIeYER+j9VeVlhHloJPJNTkQiwmf3I1bz6wPEjck1jMV6ig0+xvl3JkJshKrnTDxe4ea HTWWVnplDgUwOfKcpvBNRUNg2L5HKteery+isdCakLoJpVxFErba/tgMc9xDx1ZdqFYb tEEgaYcnx3NTaddW0KHCrCVJfNkYQIQrNom8npNc87QHnRu6HJNgK3k7iUJSDo2YVlZX HgSgsGFKWWW4pVnTDr3rFZMiW9iU2SadkGv/uBA6vQuX5LLepiSoR2vc2jtBZWCj3f1r aLUg== 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 i6si16563309ejj.508.2020.07.08.06.38.02; Wed, 08 Jul 2020 06:38:24 -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 S1729797AbgGHNgv (ORCPT + 99 others); Wed, 8 Jul 2020 09:36:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:28566 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729136AbgGHNgr (ORCPT ); Wed, 8 Jul 2020 09:36:47 -0400 IronPort-SDR: vDi9TIsAiLgs3ZjvNWcK/INI6BYBW05cSV5551oSWgDgvtPRqq5NWRUOxP//gdSHnAc5tk3enY rirNfaHMclVQ== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="149303332" X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="149303332" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 06:36:46 -0700 IronPort-SDR: sBjCS0bDzDZEStrVmswPSJTukdpM2T4Cpc8vJ1rdc5wyfQEHRCQvLOHemHrDeCSkqGdXbCtW+R FlnjpsDTWaXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="306048061" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga004.fm.intel.com with ESMTP; 08 Jul 2020 06:36:46 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 2D515301B2A; Wed, 8 Jul 2020 06:36:46 -0700 (PDT) Date: Wed, 8 Jul 2020 06:36:46 -0700 From: Andi Kleen To: Like Xu Cc: Paolo Bonzini , Peter Zijlstra , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , wei.w.wang@intel.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v12 06/11] KVM: vmx/pmu: Expose LBR to guest via MSR_IA32_PERF_CAPABILITIES Message-ID: <20200708133646.GM3448022@tassilo.jf.intel.com> References: <20200613080958.132489-1-like.xu@linux.intel.com> <20200613080958.132489-7-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200613080958.132489-7-like.xu@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + /* > + * As a first step, a guest could only enable LBR feature if its cpu > + * model is the same as the host because the LBR registers would > + * be pass-through to the guest and they're model specific. > + */ > + if (boot_cpu_data.x86_model != guest_cpuid_model(vcpu)) > + return false; Could we relax this in a followon patch? (after this series is merged) It's enough of the perf cap LBR version matches, don't need full model number match. This would require a way to configure the LBR version from qemu. This would allow more flexibility, for example migration from Icelake to Skylake and vice versa. -Andi