On Wed, Jun 03, 2020 at 11:59:23AM +0200, Auger Eric wrote: > Hi Drew, > > On 6/3/20 11:37 AM, Andrew Jones wrote: > > On Mon, Jun 01, 2020 at 03:04:33PM +0000, Salil Mehta wrote: > >> Hello, > >> I could see below within function fdt_add_pmu_nodes() part of > >> hw/arm/virt.c during virt machine initialization time: > >> > >> Observation: > >> In below function, support of PMU feature is being checked for > >> each vcpu and if the PMU is found part of the features then PMU > >> is initialized with in the host/KVM. But if there is even one > >> vcpu which is found to not support the PMU then loop is exited > >> and PMU is not initialized for the rest of the vcpus as well. > >> > >> Questions: > >> Q1. Not sure what is the logic of the premature exit and not > >> continuing with further checks and initialization of other > >> VCPU PMUs? > > > > KVM requires all VCPUs to have a PMU if one does. > > I fail to find where this is enforced? Do you know the place?
kvm_vcpu_set_target(), called from KVM_ARM_VCPU_INIT. It ensures all VCPUs have identical features selected. The PMU requires a VCPU feature (KVM_ARM_VCPU_PMU_V3) to be set. Thanks, drew