All of lore.kernel.org
 help / color / mirror / Atom feed
From: Like Xu <like.xu.linux@gmail.com>
To: Xiong Zhang <xiong.y.zhang@intel.com>
Cc: seanjc@google.com, weijiang.yang@intel.com,
	dapeng1.mi@linux.intel.com, zhiyuan.lv@intel.com,
	zhenyu.z.wang@intel.com, kan.liang@intel.com,
	kvm list <kvm@vger.kernel.org>
Subject: Re: [PATCH v3] Documentation: KVM: Add vPMU implementaion and gap document
Date: Mon, 21 Aug 2023 14:04:39 +0800	[thread overview]
Message-ID: <0dcbe9ca-cf44-8bb8-ddaa-99f66b0146d3@gmail.com> (raw)
In-Reply-To: <20230810054518.329117-1-xiong.y.zhang@intel.com>

On 10/8/2023 1:45 pm, Xiong Zhang wrote:
> +1. Overview
> +===========
> +
> +KVM has supported PMU virtualization on x86 for many years and provides

"logical core level PMU virtualization"

> +MSR based Arch PMU interface to the guest. The major features include

Drop the "MSR based Arch PMU interface" statement, considering RDPMC.

> +Arch PMU v2, LBR and PEBS. Users have the same operation to profile

include (Arch for Intel) pmu versions up to 2, basic counters, Intel LBR and 
PEBS, etc.

> +performance in guest and host.

Any pmu profiler that works on host based on core pmu (e.g. Linux perl tool) can
be expected to work on guest.

On linux host and guest, the perf subsystem manages pmu hardware resources.

> +KVM is a normal perf subsystem user as other perf subsystem users. When

, but in the kernel space like nmi_watchdog and some ebpf programs that use pmu.

> +the guest access vPMU MSRs, KVM traps it and creates a perf event for it.

This is inaccurate.

KVM emulates the different guest's PMU capabilities as accurately as
possible via creating the appropriate perf_event(s) in the kernel space
to occupy the corresponding PMU resources from the host.

> +This perf event takes part in perf scheduler to request PMU resources
> +and let the guest use these resources.

 From the host perf-core perspective, these KVM-created perf events
take part in perf scheduler, just like any other perf_events.

> +
> +This document describes the X86 PMU virtualization architecture design

Intel PMU only or add more AMD stuff.

> +and opens. It is organized as follows: Next section describes more
> +details of Linux perf scheduler as it takes a key role in vPMU
> +implementation and allocates PMU resources for guest usage. Then Arch
> +PMU virtualization and LBR virtualization are introduced, each feature
> +has sections to introduce implementation overview,  the expectation and
> +gaps when host and guest perf events coexist.

  parent reply	other threads:[~2023-08-21  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  5:45 [PATCH v3] Documentation: KVM: Add vPMU implementaion and gap document Xiong Zhang
2023-08-21  5:40 ` Like Xu
2023-08-22  8:39   ` Zhang, Xiong Y
2023-08-21  6:04 ` Like Xu [this message]
2023-08-21  6:39 ` Like Xu
2023-08-21  7:23 ` Like Xu
2023-08-21  7:38 ` Like Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0dcbe9ca-cf44-8bb8-ddaa-99f66b0146d3@gmail.com \
    --to=like.xu.linux@gmail.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=kan.liang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=weijiang.yang@intel.com \
    --cc=xiong.y.zhang@intel.com \
    --cc=zhenyu.z.wang@intel.com \
    --cc=zhiyuan.lv@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.