From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753167AbcHQSvf (ORCPT ); Wed, 17 Aug 2016 14:51:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51550 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752728AbcHQSvd (ORCPT ); Wed, 17 Aug 2016 14:51:33 -0400 Subject: Re: RFC: Petition Intel/AMD to add POPF_IF insn To: Linus Torvalds References: Cc: Ingo Molnar , Andy Lutomirski , Dan Williams , Alex Deucher , "Rafael J. Wysocki" , =?UTF-8?Q?Christian_K=c3=b6nig?= , Vinod Koul , Johannes Berg , Sara Sharon , Adrian Hunter , the arch/x86 maintainers , LKML From: Denys Vlasenko Message-ID: <8de26c33-5597-bf00-2ac5-d265ba01d0d4@redhat.com> Date: Wed, 17 Aug 2016 20:41:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 17 Aug 2016 18:41:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/17/2016 07:32 PM, Linus Torvalds wrote: > On Wed, Aug 17, 2016 at 10:20 AM, Denys Vlasenko wrote: >> Last year, a proposal was floated to avoid costly POPF. >> In particular, each spin_unlock_irqrestore() does it, >> a rather common operation. > > Quiet frankly, it takes so long for hw features that I don't think > it's worth it for something like this. True, it will take some ~5 years for new hardware to become widely used. OTOH 5 years will inevitably pass. Just like now 32-bit Linux userspace is commonly compiled to "i686" instruction set, because inevitably enough time has passed that you can safely assume most people run at least Pentium Pro-level CPU, with CMOV, CMPXCHG, etc. If the new instruction will be implemented with "REPZ POPF" encoding, no recompilation or alternatives will be needed for the new kernel to run on an old CPU. On an old CPU, entire EFLAGS will be restored. On a new one, only EFLAGS.IF.