From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932128AbbJNLab (ORCPT ); Wed, 14 Oct 2015 07:30:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33050 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752506AbbJNLaY (ORCPT ); Wed, 14 Oct 2015 07:30:24 -0400 Subject: Re: [PATCH] KVM: VMX: enable LBR virtualization To: Jian Zhou , herongguang.he@huawei.com, zhang.zhanghailiang@huawei.com, gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <1444471906-8496-1-git-send-email-jianjay.zhou@huawei.com> <561BA323.7090002@huawei.com> <561BAB15.8090700@redhat.com> <561E3BDB.4080904@huawei.com> Cc: weidong.huang@huawei.com, peter.huangpeng@huawei.com From: Paolo Bonzini Message-ID: <561E3CC8.7080309@redhat.com> Date: Wed, 14 Oct 2015 13:30:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <561E3BDB.4080904@huawei.com> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/2015 13:26, Jian Zhou wrote: > On 12/10/2015 20:44, Paolo Bonzini wrote: >> In addition, the MSR numbers may differ between the guest and the host, >> because it is possible to emulate e.g. a Core CPU on a Core 2 CPU. So I >> recommend against using the atomic switch mechanism for the from/to MSRs. > > The vLBR feature depends on vPMU, and to enable vPMU, it needs to > specify the "cpu mode" in the guest XML as host-passthrough. I think > the MSR numbers between the guest and the host are the same in this > senario. Does it depend on vPMU _for Linux guests_ or in general? My impression is that LBR can be used by the guest independent of the PMU. You should also write a unit test for kvm-unit-tests to test the behavior of your implementation. Thanks, Paolo