mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
cb082bfab5
This commit defines the API for userspace and prepare the common functionalities to support per VM/VCPU binary stats data readings. The KVM stats now is only accessible by debugfs, which has some shortcomings this change series are supposed to fix: 1. The current debugfs stats solution in KVM could be disabled when kernel Lockdown mode is enabled, which is a potential rick for production. 2. The current debugfs stats solution in KVM is organized as "one stats per file", it is good for debugging, but not efficient for production. 3. The stats read/clear in current debugfs solution in KVM are protected by the global kvm_lock. Besides that, there are some other benefits with this change: 1. All KVM VM/VCPU stats can be read out in a bulk by one copy to userspace. 2. A schema is used to describe KVM statistics. From userspace's perspective, the KVM statistics are self-describing. 3. With the fd-based solution, a separate telemetry would be able to read KVM stats in a less privileged environment. 4. After the initial setup by reading in stats descriptors, a telemetry only needs to read the stats data itself, no more parsing or setup is needed. Reviewed-by: David Matlack <dmatlack@google.com> Reviewed-by: Ricardo Koller <ricarkol@google.com> Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com> Reviewed-by: Fuad Tabba <tabba@google.com> Tested-by: Fuad Tabba <tabba@google.com> #arm64 Signed-off-by: Jing Zhang <jingzhangos@google.com> Message-Id: <20210618222709.1858088-3-jingzhangos@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
27 lines
806 B
Makefile
27 lines
806 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for Kernel-based Virtual Machine module
|
|
#
|
|
|
|
ccflags-y += -I $(srctree)/$(src)
|
|
|
|
KVM=../../../virt/kvm
|
|
|
|
obj-$(CONFIG_KVM) += kvm.o
|
|
obj-$(CONFIG_KVM) += hyp/
|
|
|
|
kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \
|
|
$(KVM)/vfio.o $(KVM)/irqchip.o $(KVM)/binary_stats.o \
|
|
arm.o mmu.o mmio.o psci.o perf.o hypercalls.o pvtime.o \
|
|
inject_fault.o va_layout.o handle_exit.o \
|
|
guest.o debug.o reset.o sys_regs.o \
|
|
vgic-sys-reg-v3.o fpsimd.o pmu.o \
|
|
arch_timer.o trng.o\
|
|
vgic/vgic.o vgic/vgic-init.o \
|
|
vgic/vgic-irqfd.o vgic/vgic-v2.o \
|
|
vgic/vgic-v3.o vgic/vgic-v4.o \
|
|
vgic/vgic-mmio.o vgic/vgic-mmio-v2.o \
|
|
vgic/vgic-mmio-v3.o vgic/vgic-kvm-device.o \
|
|
vgic/vgic-its.o vgic/vgic-debug.o
|
|
|
|
kvm-$(CONFIG_HW_PERF_EVENTS) += pmu-emul.o
|