linux-stable/arch
Jing Zhang cb082bfab5 KVM: stats: Add fd-based API to read binary stats data
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>
2021-06-24 11:47:57 -04:00
..
alpha Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
arc ARC: mm: Use max_high_pfn as a HIGHMEM zone border 2021-05-10 12:38:59 -07:00
arm xen/swiotlb: check if the swiotlb has already been initialized 2021-05-14 15:52:11 +02:00
arm64 KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
csky arch/csky patches for 5.13-rc1 2021-05-03 12:58:31 -07:00
h8300 arch: rearrange headers inclusion order in asm/bitops for m68k, sh and h8300 2021-05-06 19:24:11 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
m68k Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
microblaze tracing updates for 5.13 2021-05-03 11:19:54 -07:00
mips KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
nds32 tracing updates for 5.13 2021-05-03 11:19:54 -07:00
nios2 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-05-02 09:14:01 -07:00
openrisc drivers/char: remove /dev/kmem for good 2021-05-07 00:26:34 -07:00
parisc Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
powerpc KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
riscv riscv: remove unused handle_exception symbol 2021-05-06 09:40:16 -07:00
s390 KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
sh sh: Remove unused variable 2021-05-10 23:23:04 +02:00
sparc Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
um Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00
x86 KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
xtensa Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Add Landlock, a new LSM from Mickaël Salaün <mic@linux.microsoft.com> 2021-05-01 18:50:44 -07:00