Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296AbbBXWvv (ORCPT ); Tue, 24 Feb 2015 17:51:51 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35102 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752351AbbBXWvu (ORCPT ); Tue, 24 Feb 2015 17:51:50 -0500 Message-ID: <54ED005E.4070603@zytor.com> Date: Tue, 24 Feb 2015 14:51:10 -0800 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Borislav Petkov , Denys Vlasenko CC: Denys Vlasenko , Andy Lutomirski , Linus Torvalds , Steven Rostedt , Ingo Molnar , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , Linux Kernel Mailing List Subject: Re: [PATCH 1/4] x86: entry.S: tidy up several suboptimal insns References: <1424803895-4420-1-git-send-email-dvlasenk@redhat.com> <20150224195801.GM3420@pd.tnic> <20150224203635.GN3420@pd.tnic> In-Reply-To: <20150224203635.GN3420@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 863 Lines: 29 On 02/24/2015 12:36 PM, Borislav Petkov wrote: > On Tue, Feb 24, 2015 at 09:13:03PM +0100, Denys Vlasenko wrote: >> They aren't equal. $1 and $2 in two lowest bits will also >> be interpreted as "userspace" here. "Equal to $3" sends >> a wrong message here to a human reading the code, >> the code doesn't test for CPL=3, it tests for any nonzero CPL. > > Doh, of course. > > I was going to propose to make it even more explicit: > > andb $3, CS(%rsp)... > > but that's destructive. > > So yours makes it less misleading, actually. To me at least and > obviously. > Yes, please use JZ/JNZ with TEST. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/