Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752805AbdCHP47 (ORCPT ); Wed, 8 Mar 2017 10:56:59 -0500 Received: from mail-ua0-f171.google.com ([209.85.217.171]:34099 "EHLO mail-ua0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbdCHP45 (ORCPT ); Wed, 8 Mar 2017 10:56:57 -0500 MIME-Version: 1.0 In-Reply-To: <20170308003254.27833-20-ricardo.neri-calderon@linux.intel.com> References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <20170308003254.27833-20-ricardo.neri-calderon@linux.intel.com> From: Andy Lutomirski Date: Wed, 8 Mar 2017 07:54:51 -0800 Message-ID: Subject: Re: [v6 PATCH 19/21] x86/traps: Fixup general protection faults caused by UMIP To: Ricardo Neri Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Peter Zijlstra , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Liang Z Li , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka , Chen Yucong , Alexandre Julliard , Stas Sergeev , Fenghua Yu , "Ravi V. Shankar" , Shuah Khan , "linux-kernel@vger.kernel.org" , X86 ML , linux-msdos@vger.kernel.org, wine-devel@winehq.org, Tony Luck Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 753 Lines: 14 On Tue, Mar 7, 2017 at 4:32 PM, Ricardo Neri wrote: > If the User-Mode Instruction Prevention CPU feature is available and > enabled, a general protection fault will be issued if the instructions > sgdt, sldt, sidt, str or smsw are executed from user-mode context > (CPL > 0). If the fault was caused by any of the instructions protected > by UMIP, fixup_umip_exception will emulate dummy results for these > instructions. If emulation is successful, the result is passed to the > user space program and no SIGSEGV signal is emitted. > > Please note that fixup_umip_exception also caters for the case when > the fault originated while running in virtual-8086 mode. Reviewed-by: Andy Lutomirski