From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH 7/9] KVM: Expose the architectural performance monitoring CPUID leaf Date: Tue, 01 Nov 2011 11:43:14 -0600 Message-ID: <4EB02FB2.3010606@gmail.com> References: <1319993624-20247-1-git-send-email-gleb@redhat.com> <1319993624-20247-8-git-send-email-gleb@redhat.com> <4EB01507.1020607@gmail.com> <20111101161815.GB16539@redhat.com> <4EB01D49.6010309@gmail.com> <20111101164052.GC16539@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com, linux-kernel@redhat.com, mingo@elte.hu, a.p.zijlstra@chello.nl, acme@ghostprotocols.net To: Gleb Natapov Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:65458 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751951Ab1KARnU (ORCPT ); Tue, 1 Nov 2011 13:43:20 -0400 Received: by gyb13 with SMTP id 13so7264407gyb.19 for ; Tue, 01 Nov 2011 10:43:19 -0700 (PDT) In-Reply-To: <20111101164052.GC16539@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/01/2011 10:40 AM, Gleb Natapov wrote: >>>> If PERF_EVENTS is disabled in the host kernel will KVM return the right >>>> thing for the guest that might have PERF_EVENTS enabled? >>>> >>> With correct implementation of perf_get_x86_pmu_capability() it should. >>> PERF_EVENTS disable version should set cap.version to zero, so guest will >>> find that vcpu does not provide architectural PMU. >> >> Ok. >> >> I was also thinking about kvm-kmod where newer KVM source is compiled >> against older kernels - which at one point had PERF_EVENTS as a >> configurable parameter. In this case it is possible to have perf events >> disabled host side yet enabled guest side. >> > KVM PMU implementation uses host perf events to talk to HW. Without host > perf infrastructure KVM will not be able to provide PMU to a guest. Or > are you saying that we should support compiling KVM with !PERF_EVENTS? I'd > rather just make KVM select PERF_EVENTS. Strictly speaking KVM does not require PERF_EVENTS; it only requires it if a PMU is to be offered to the guest -- which is a new KVM feature. Not requiring PERF_EVENTS makes kvm-kmod a bit simpler, a use case where the kvm source deals with a pre-configured kernel. David