lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210513130655.73154-1-gshan@redhat.com>
Date:   Thu, 13 May 2021 21:06:55 +0800
From:   Gavin Shan <gshan@...hat.com>
To:     kvmarm@...ts.cs.columbia.edu
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        drjones@...hat.com, pbonzini@...hat.com, maz@...nel.org
Subject: [PATCH] KVM: arm64: selftests: Request PMU feature in get-reg-list

Since the following commit, PMU registers are hidden from user until
it's explicitly requested by feeding feature (KVM_ARM_VCPU_PMU_V3).
Otherwise, 74 missing PMU registers are missing as the following
log indicates.

   11663111cd49 ("KVM: arm64: Hide PMU registers from userspace when not available")

   # ./get-reg-list
   Number blessed registers:   308
   Number registers:           238

   There are 74 missing registers.
   The following lines are missing registers:

      	ARM64_SYS_REG(3, 0, 9, 14, 1),
	ARM64_SYS_REG(3, 0, 9, 14, 2),
             :
	ARM64_SYS_REG(3, 3, 14, 15, 7),

This fixes the issue of wrongly reported missing PMU registers by
requesting it explicitly.

Signed-off-by: Gavin Shan <gshan@...hat.com>
---
 tools/testing/selftests/kvm/aarch64/get-reg-list.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
index 486932164cf2..6c6bdc6f5dc3 100644
--- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c
+++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c
@@ -314,6 +314,8 @@ static void core_reg_fixup(void)
 
 static void prepare_vcpu_init(struct kvm_vcpu_init *init)
 {
+	init->features[0] |= 1 << KVM_ARM_VCPU_PMU_V3;
+
 	if (reg_list_sve())
 		init->features[0] |= 1 << KVM_ARM_VCPU_SVE;
 }
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ