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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMhGOVFg2PvhqHhj@google.com>
Date: Mon, 15 Sep 2025 10:00:41 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Chao Gao <chao.gao@...el.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Tom Lendacky <thomas.lendacky@....com>, Mathias Krause <minipli@...ecurity.net>, 
	John Allen <john.allen@....com>, Rick Edgecombe <rick.p.edgecombe@...el.com>, 
	Maxim Levitsky <mlevitsk@...hat.com>, Xiaoyao Li <xiaoyao.li@...el.com>, 
	Zhang Yi Z <yi.z.zhang@...ux.intel.com>
Subject: Re: [PATCH v15 35/41] KVM: selftests: Add an MSR test to exercise
 guest/host and read/write

On Mon, Sep 15, 2025, Chao Gao wrote:
> >+static void __vcpus_run(struct kvm_vcpu **vcpus, const int NR_VCPUS)
> >+{
> >+	int i;
> >+
> >+	for (i = 0; i < NR_VCPUS; i++)
> >+		do_vcpu_run(vcpus[i]);
> >+}
> >+
> >+static void vcpus_run(struct kvm_vcpu **vcpus, const int NR_VCPUS)
> >+{
> >+	__vcpus_run(vcpus, NR_VCPUS);
> >+	__vcpus_run(vcpus, NR_VCPUS);
> 
> ...
> 
> >+	for (idx = 0; idx < ARRAY_SIZE(__msrs); idx++) {
> >+		sync_global_to_guest(vm, idx);
> >+
> >+		vcpus_run(vcpus, NR_VCPUS);
> >+		vcpus_run(vcpus, NR_VCPUS);
> 
> We enter each vCPU 4 times for each MSR here. If I count correctly, only two of
> them are needed as the guest code syncs with the host twice for each MSR (one in
> guest_test_{un,}supported_msr(), the other at the end of guest_main()).

I'm 99% certain you're correct and that the second run is unnecessary.  I suspect
this is leftover crud from an earlier incarnation of the test that used a separate
VM for the "unsupported" features case (before I realized that the test could
abuse and test the fact that KVM doesn't require homogeneous vCPU models).

I'll triple check and post a fixup.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ