Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933275AbcKGSiO (ORCPT ); Mon, 7 Nov 2016 13:38:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42710 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932635AbcKGSiM (ORCPT ); Mon, 7 Nov 2016 13:38:12 -0500 Date: Mon, 7 Nov 2016 16:38:08 -0200 From: Eduardo Habkost To: Paolo Bonzini Cc: David Matlack , Kyle Huey , "Robert O'Callahan" , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , X86 ML , Radim =?utf-8?B?S3LEjW3DocWZ?= , Jeff Dike , Richard Weinberger , Alexander Viro , Shuah Khan , Dave Hansen , Borislav Petkov , Peter Zijlstra , Boris Ostrovsky , Len Brown , "Rafael J. Wysocki" , Dmitry Safonov , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting Message-ID: <20161107183808.GV5057@thinpad.lan.raisama.net> References: <20161101013749.4003-1-khuey@kylehuey.com> <20161101013749.4003-8-khuey@kylehuey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fnord: you can see the fnord User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 07 Nov 2016 18:38:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 33 On Fri, Nov 04, 2016 at 10:57:27PM +0100, Paolo Bonzini wrote: > > > On 04/11/2016 21:34, David Matlack wrote: > > On Mon, Oct 31, 2016 at 6:37 PM, Kyle Huey wrote: > >> + case MSR_PLATFORM_INFO: > >> + /* cpuid faulting is supported */ > >> + msr_info->data = PLATINFO_CPUID_FAULT; > >> + break; > > > > This could break save/restore, if for example, a VM is migrated to a > > version of KVM without MSR_PLATFORM_INFO support. I think the way to > > handle this is to make MSR_PLATFORM_INFO writeable (but only from > > userspace) so that hypervisors can defend themselves (by setting this > > MSR to 0). > > Right---and with my QEMU hat on, this feature will have to be enabled > manually on the command line because of the way QEMU supports running > with old kernels. :( This however does not impact the KVM patch. > > We may decide that, because CPUID faulting doesn't have a CPUID bit and > is relatively a "fringe" feature, we are okay if the kernel enables this > unconditionally and then userspace can arrange to block migration (in > QEMU this would use a subsection). David, Eduardo, opinions? Doing this would let guest code intentionally prevent the VM from being migrated to some hosts. Maybe it would be still acceptable to do it by default, maybe not. But even if we decide to do this by default, I would like to have the ability to disable the feature just in case we find out it was a bad idea. -- Eduardo