Skip to content

Commit 450a563

Browse files
ouptonbonzini
authored andcommitted
KVM: stats: Fix value for KVM_STATS_UNIT_MAX for boolean stats
commit 1b870fa ("kvm: stats: tell userspace which values are boolean") added a new stat unit (boolean) but failed to raise KVM_STATS_UNIT_MAX. Fix by pointing UNIT_MAX at the new max value of UNIT_BOOLEAN. Fixes: 1b870fa ("kvm: stats: tell userspace which values are boolean") Reported-by: Janis Schoetterl-Glausch <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7962918 commit 450a563

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5658,7 +5658,7 @@ by a string of size ``name_size``.
56585658
#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
56595659
#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
56605660
#define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT)
5661-
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES
5661+
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN
56625662

56635663
#define KVM_STATS_BASE_SHIFT 8
56645664
#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)

include/uapi/linux/kvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ struct kvm_stats_header {
20842084
#define KVM_STATS_UNIT_SECONDS (0x2 << KVM_STATS_UNIT_SHIFT)
20852085
#define KVM_STATS_UNIT_CYCLES (0x3 << KVM_STATS_UNIT_SHIFT)
20862086
#define KVM_STATS_UNIT_BOOLEAN (0x4 << KVM_STATS_UNIT_SHIFT)
2087-
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_CYCLES
2087+
#define KVM_STATS_UNIT_MAX KVM_STATS_UNIT_BOOLEAN
20882088

20892089
#define KVM_STATS_BASE_SHIFT 8
20902090
#define KVM_STATS_BASE_MASK (0xF << KVM_STATS_BASE_SHIFT)

0 commit comments

Comments
 (0)