From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752732AbdKHQx0 (ORCPT ); Wed, 8 Nov 2017 11:53:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60903 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751763AbdKHQxY (ORCPT ); Wed, 8 Nov 2017 11:53:24 -0500 Subject: Re: [tip:x86/asm] x86/umip: Add emulation code for UMIP instructions To: Linus Torvalds Cc: Paolo Bonzini , Peter Anvin , Borislav Petkov , Vlastimil Babka , Tony Luck , Fenghua Yu , Josh Poimboeuf , Borislav Petkov , Brian Gerst , Jonathan Corbet , "Ravi V. Shankar" , ricardo.neri-calderon@linux.intel.com, Chris Metcalf , Andrew Morton , Paul Gortmaker , Masami Hiramatsu , Andrew Lutomirski , Dave Hansen , ray.huang@amd.com, "Michael S. Tsirkin" , Linux Kernel Mailing List , Peter Zijlstra , Chen Yucong , Ingo Molnar , Jiri Slaby , Shuah Khan , Thomas Gleixner , "linux-tip-commits@vger.kernel.org" References: <1509935277-22138-8-git-send-email-ricardo.neri-calderon@linux.intel.com> From: Denys Vlasenko Message-ID: <3cdde8ac-500c-ddad-5ea5-a733e2c98d84@redhat.com> Date: Wed, 8 Nov 2017 17:53:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 08 Nov 2017 16:53:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/08/2017 05:34 PM, Linus Torvalds wrote: > On Wed, Nov 8, 2017 at 8:14 AM, Denys Vlasenko wrote: >> >> Can we avoid maintain emulation of these isns, by asking Wine to remove >> their use instead? > > If we ask the Wine people to remove the instruction use, that may mean > that we can avoid the emulation in four or five _years_ once everybody > has updated. > > But it wouldn't mean that we could avoid it today. We can postpone enabling UMIP by default by a year or so. By this time, new Wine will be on majority of users' machines. Then, when kernels switch to enable UMIP by default, umip=0 kernel flag can be used if somebody for some reason updates their kernel but not Wine. This is much less code, and simpler code, than implementing SIDT et al emulation. Keep in mind that our SIDT emulation itself can turn out to be buggy, in the worst case it may end up having worse holes that SIDT isns was - what if it can be tricked into writing into arbitrary kernel address?