From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936303AbdKPRZn (ORCPT ); Thu, 16 Nov 2017 12:25:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:49765 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934634AbdKPRZe (ORCPT ); Thu, 16 Nov 2017 12:25:34 -0500 Date: Thu, 16 Nov 2017 18:25:20 +0100 From: Borislav Petkov To: "Natarajan, Janakarajan" Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Paolo Bonzini , Radim Krcmar , Len Brown , Kyle Huey , Kan Liang , Grzegorz Andrejczuk , Tom Lendacky , Tony Luck Subject: Re: [PATCH v2 3/4] Add support for AMD Core Perf Extension in guest Message-ID: <20171116172520.4lgdvpcdxuxenxc7@pd.tnic> References: <5113a9d6e76d2c6050c1fba4007068340321521c.1509985085.git.Janakarajan.Natarajan@amd.com> <20171109183425.rhqc5wrltznt5tcf@pd.tnic> <07f23e5e-2747-b0bc-1b93-f83f3982649a@amd.com> <20171115190755.5n2zskcr2d4bmewp@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 16, 2017 at 11:13:47AM -0600, Natarajan, Janakarajan wrote: > On 11/15/2017 1:07 PM, Borislav Petkov wrote: > > On Wed, Nov 15, 2017 at 01:04:03PM -0600, Natarajan, Janakarajan wrote: > > > So, when the amd_pmu_init is called, a query to guest_cpuid_family() gives a > > > value of -1. > > And that is because...? And it can be fixed to give the proper guest family I > > presume ...? > > Qemu initially creates a vcpu with KVM_CREATE_VCPU which in kvm initializes > the pmu. Later on > the cpuid is set using KVM_SET_CPUID2 which sets all the cpuid entries in > kvm and the pmu refresh is called. That doesn't answer my questions above. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --