From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938515AbcKKVLj (ORCPT ); Fri, 11 Nov 2016 16:11:39 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:32940 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935359AbcKKVLg (ORCPT ); Fri, 11 Nov 2016 16:11:36 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: [PATCH v11 7/7] KVM: x86: virtualize cpuid faulting From: Nadav Amit In-Reply-To: <20161110234055.8654-8-khuey@kylehuey.com> Date: Fri, 11 Nov 2016 12:54:46 -0800 Cc: "Robert O'Callahan" , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , X86 ML , Paolo Bonzini , =?utf-8?B?UmFkaW0gS3LEjW3DocWZ?= , Jeff Dike , Richard Weinberger , Alexander Viro , Shuah Khan , Dave Hansen , Borislav Petkov , Peter Zijlstra , Boris Ostrovsky , Len Brown , "Rafael J. Wysocki" , Dmitry Safonov , David Matlack , LKML , user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, KVM Message-Id: <26413C89-E639-4834-A600-C4B6679162F2@gmail.com> References: <20161110234055.8654-1-khuey@kylehuey.com> <20161110234055.8654-8-khuey@kylehuey.com> To: Kyle Huey X-Mailer: Apple Mail (2.3251) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uABLBhLh032491 > On Nov 10, 2016, at 3:40 PM, Kyle Huey wrote: > > Hardware support for faulting on the cpuid instruction is not required to > emulate it, because cpuid triggers a VM exit anyways. KVM handles the relevant > MSRs (MSR_PLATFORM_INFO and MSR_MISC_FEATURES_ENABLE) and upon a > cpuid-induced VM exit checks the cpuid faulting state and the CPL. > kvm_require_cpl is even kind enough to inject the GP fault for us. I think that for consistency you should also revise em_cpuid() of KVM instruction emulator. Otherwise it may be a potential security hazard (as far fetched as it currently seems). Nadav