From: Paolo Bonzini Subject: Re: [PATCH] kvm/x86/vmx: switch MSR_MISC_FEATURES_ENABLES between host and guest Date: Thu, 14 Mar 2019 12:30:54 +0100 Message-ID: <7629bbe3-03d0-8f78-28b5-ac4eb34d24c4@redhat.com> References: <20190314063858.18292-1-xiaoyao.li@linux.intel.com> <059a5c6309b0e43695e5532e698d07750502d6d3.camel@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Kyle Huey , Chao Gao , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , kvm list , open list To: Xiaoyao Li , Kyle Huey Return-path: In-Reply-To: <059a5c6309b0e43695e5532e698d07750502d6d3.camel@linux.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 14/03/19 11:43, Xiaoyao Li wrote: > Yes, you are right. With your patches, only when we enable cpuid faulting for > the QEMU or other VMM userspace processes via arch_prctl, does it "leak" into > the KVM guest. > > But arch_prctl is not the only way to enable it. We can enable cpuid faulting > via module "msr.ko". And I think it's indeed an issue, we should not ignore it > as it needs special cases and purpose to make it happen so far. Whatever is done with "msr.ko" is a non-issue. msr.ko is at best a debugging tool if you use it for MSRs that the kernel can write. That said, even the arch_prctl is an issue, as well as Peter's patch you quote below. The patch is a good idea even though it should be implemented in a more efficient way. Paolo > Besides, Peter's this patch https://patchwork.kernel.org/patch/10850143/ is much > likely to cause the cpuid fauting enabled in host by default during kernel > startup. If that one is going to be applied, it's better to fix the cpuid > faulting leak issue before that.