On Wed, May 08, 2019 at 07:00:54PM +0300, Liran Alon wrote: > +Paolo > > What are your thoughts on this? What is the reason that KVM relies on > CPU_BASED_RDPMC_EXITING to be exposed from underlying CPU? How is it critical > for it’s functionality? If it’s because we want to make sure that we hide > host PMCs, we should condition this to be a min requirement of kvm_intel only > in case underlying CPU exposes PMU to begin with. Do you agree? If yes, I > can create the patch to fix this. I sent a revert of the change to hide CPU_BASED_RDPMC_EXITING, KVM's previous behavior is correct. The RDPMC instruction was introduced long before Architctural Perf Mon and so the existence of the exiting control is dependent only on the instruction, e.g. P4 (Prescott), Core (Yonah) and Core2 (Merom) all support VMX and RDPMC with non-archictectural perf mon capabilities. The KVM unit test first execute RDPMC with interception disabled in the unit test host, i.e. the #GP is the correct architectural behavior and needs to be handled by the unit test. The most robust fix would be to eat any #GP on RDPMC in the unit test, though it's likely much simpler to only execute RDPMC with interception disabled if arch perf mon is supported.