]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - arch/arm64/kvm/guest.c
Merge tag 'kvmarm-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmar...
[mirror_ubuntu-jammy-kernel.git] / arch / arm64 / kvm / guest.c
index 60815ae477cfbbb4663c32faba4130a125ce15f1..1dfb83578277091f539cc986852405a1178983b7 100644 (file)
 
 #include "trace.h"
 
-struct kvm_stats_debugfs_item debugfs_entries[] = {
-       VCPU_STAT("halt_successful_poll", halt_successful_poll),
-       VCPU_STAT("halt_attempted_poll", halt_attempted_poll),
-       VCPU_STAT("halt_poll_invalid", halt_poll_invalid),
-       VCPU_STAT("halt_wakeup", halt_wakeup),
-       VCPU_STAT("hvc_exit_stat", hvc_exit_stat),
-       VCPU_STAT("wfe_exit_stat", wfe_exit_stat),
-       VCPU_STAT("wfi_exit_stat", wfi_exit_stat),
-       VCPU_STAT("mmio_exit_user", mmio_exit_user),
-       VCPU_STAT("mmio_exit_kernel", mmio_exit_kernel),
-       VCPU_STAT("exits", exits),
-       VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns),
-       VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns),
-       { NULL }
+const struct _kvm_stats_desc kvm_vm_stats_desc[] = {
+       KVM_GENERIC_VM_STATS()
+};
+static_assert(ARRAY_SIZE(kvm_vm_stats_desc) ==
+               sizeof(struct kvm_vm_stat) / sizeof(u64));
+
+const struct kvm_stats_header kvm_vm_stats_header = {
+       .name_size = KVM_STATS_NAME_SIZE,
+       .num_desc = ARRAY_SIZE(kvm_vm_stats_desc),
+       .id_offset =  sizeof(struct kvm_stats_header),
+       .desc_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE,
+       .data_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE +
+                      sizeof(kvm_vm_stats_desc),
+};
+
+const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
+       KVM_GENERIC_VCPU_STATS(),
+       STATS_DESC_COUNTER(VCPU, hvc_exit_stat),
+       STATS_DESC_COUNTER(VCPU, wfe_exit_stat),
+       STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
+       STATS_DESC_COUNTER(VCPU, mmio_exit_user),
+       STATS_DESC_COUNTER(VCPU, mmio_exit_kernel),
+       STATS_DESC_COUNTER(VCPU, exits)
+};
+static_assert(ARRAY_SIZE(kvm_vcpu_stats_desc) ==
+               sizeof(struct kvm_vcpu_stat) / sizeof(u64));
+
+const struct kvm_stats_header kvm_vcpu_stats_header = {
+       .name_size = KVM_STATS_NAME_SIZE,
+       .num_desc = ARRAY_SIZE(kvm_vcpu_stats_desc),
+       .id_offset = sizeof(struct kvm_stats_header),
+       .desc_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE,
+       .data_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE +
+                      sizeof(kvm_vcpu_stats_desc),
 };
 
 static bool core_reg_offset_is_vreg(u64 off)