From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755290AbbCaQno (ORCPT ); Tue, 31 Mar 2015 12:43:44 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:34587 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbbCaQnn (ORCPT ); Tue, 31 Mar 2015 12:43:43 -0400 Date: Tue, 31 Mar 2015 18:43:37 +0200 From: Ingo Molnar To: Denys Vlasenko Cc: Denys Vlasenko , Brian Gerst , Andy Lutomirski , Borislav Petkov , the arch/x86 maintainers , Linux Kernel Mailing List , Linus Torvalds Subject: Re: [PATCH] x86/asm/entry/64: better check for canonical address Message-ID: <20150331164337.GA8462@gmail.com> References: <20150327081141.GA9526@gmail.com> <551534B1.6090908@redhat.com> <20150327111738.GA8749@gmail.com> <20150327113430.GC14778@gmail.com> <551549AF.50808@redhat.com> <20150327121645.GC15631@gmail.com> <55154DB3.9000008@redhat.com> <20150328091106.GA5361@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Denys Vlasenko wrote: > > I guess they could optimize it by adding a single "I am a modern > > OS executing regular userspace" flag to the descriptor [or > > expressing the same as a separate instruction], to avoid all that > > legacy crap that won't trigger on like 99.999999% of systems ... > > Yes, that would be a useful addition. Interrupt servicing on x86 > takes a non-negligible hit because of IRET slowness. But ... to react to your other patch: detecting the common easy case and doing a POPF+RET ourselves ought to be pretty good as well? But only if ptregs->rip != the magic RET itself, to avoid recursion. Even with all those extra checks it should still be much faster. Thanks, Ingo