[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMfM4Fu+Q6gpZKYF@intel.com>
Date: Mon, 15 Sep 2025 16:22:56 +0800
From: Chao Gao <chao.gao@...el.com>
To: Sean Christopherson <seanjc@...gle.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
>+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()).
Powered by blists - more mailing lists