Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1561888

Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection
Date 2017-01-18 16:20 +0100
Message-ID <t10bM-5IB-19@gated-at.bofh.it> (permalink)
References (2 earlier) <t0WBb-3tQ-9@gated-at.bofh.it> <t0XQD-49m-21@gated-at.bofh.it> <t0Y9Y-4vs-29@gated-at.bofh.it> <t0YjE-4z4-31@gated-at.bofh.it> <t1025-5Fi-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 18, 2017 at 02:51:31PM +0000, Punit Agrawal wrote:
> I should've clarified in my reply that I wasn't looking to support the
> third instance from Mark's examples above - "monitor all vCPUs on a
> pCPU". I think it'll be quite expensive to figure out which threads from
> a given pool are vCPUs.

I'm not sure I follow why you would need to do that?

In that case, we'd open a CPU-bound perf event for the pCPU, which would
get installed in the CPU context immediately. It would be present for
all tasks.

Given it's present for all tasks, we don't need to figure out which
happen to have vCPUs. The !vCPU tasks simply shouldn't trigger events.

Am I missing something?

> For the other instances, we only need to find the vCPU for a given
> pid. Userspace will hand us a pid that needs to be checked against vCPUs
> to establish that it is a valid vCPU pid (here I was looking to use
> kvm_vcpu->pid and kvm->pid introduced in Patch 2).

Thinking about this further, a pid is not a unique identifier for either
a vCPU or a VM.

A single task (which has a single pid), could own multiple VMs, each
with multiple vCPUs. A thread pool (with several pids) could share those
arbitrarily. So we need VM and vCPU IDs which are distinct from pids or
tids.

I see that struct kvm_vcpu has a vcpu_id (which from a glance appears to
be local to the kvm instance). It's not clear to me if a kvm instance
could be shared by multiple processes, or if we can get away with a
process-local ID.

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Marc Zyngier <marc.zyngier@arm.com> - 2017-01-18 12:30 +0100
  Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Mark Rutland <mark.rutland@arm.com> - 2017-01-18 13:50 +0100
    Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-18 14:10 +0100
      Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Marc Zyngier <marc.zyngier@arm.com> - 2017-01-18 14:20 +0100
        Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-18 16:10 +0100
          Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Mark Rutland <mark.rutland@arm.com> - 2017-01-18 16:20 +0100
            Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-18 17:30 +0100
              Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Mark Rutland <mark.rutland@arm.com> - 2017-01-18 19:10 +0100
                Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Christoffer Dall <christoffer.dall@linaro.org> - 2017-01-19 17:50 +0100
                Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-23 12:30 +0100
      Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM  introspection Will Deacon <will.deacon@arm.com> - 2017-01-18 14:50 +0100
        Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-18 16:00 +0100
  Re: [PATCH v3 6/9] kvm: arm/arm64: Add host pmu to support VM introspection Punit Agrawal <punit.agrawal@arm.com> - 2017-01-18 14:10 +0100

csiph-web