Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp801161yba; Wed, 24 Apr 2019 09:48:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5zdP1YPsIXknc1Jb2mJcgNzn6vVZHlYEQL+qqgcNNklgD+rfzhW1kHjeoT252yNxXb8Ic X-Received: by 2002:a62:69c2:: with SMTP id e185mr34336969pfc.119.1556124496448; Wed, 24 Apr 2019 09:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556124496; cv=none; d=google.com; s=arc-20160816; b=hejQwYbAxh68DtVdQzt2O8eU5FycoCO/Ny/wpQc+uz2vEWG0Pal9+LbZEYNARxrsUk y13D8spwjKJ0YNCjtBXfDdfKE5jr76nNazdB812uTX5wTSActueWMyFG3A0K3B8gTUOg gi32e9ckzzXPs60fZe2TKw6HoZXbxejlCLcrtSobsmHxUMMVF9HncIFIqqy7mqwIzzDT jYDFdKbROLG5vlJv9h2EUnlkbJOykuxONT/jwIySKTY4M7sf52NTvazrdDvKnky+C5xL 7QlnkgtA1sgILaCfWXwSAnxb8DO92pJcrzrL10FaJyN7kqg4jHctfNUtZ2p071Pe2DM/ 1hjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VrcpxD/eOBGelu6F9L6Y1oahjzVxXGhQAkbUZ3DK1l0=; b=tBzwwh6jcKy7fjdRNC01hLP10JcW7zhgD7hokctFpP2LlvKiFThg0RvXbAzMALW9b9 BHYwnps5K7zcB++H0sa0ODKQYQlIJx0RCwX7aixdd+/7JvixRpvntG1cKDaP3dMq7/XJ zL4/GA7RsCgSiCls7QktfmpXj8aw8dz6kpQ+yMJhmPkfK9D2/Co3TOTpxelu1IiFynkW QayLD0HInTOCBu3FPAbimJaB3UwfACCnT+cDVasfROqL8eRGqgJTzszJst5yh2en++uk O3HfdQTSzTLNiaEv9dpqV5hTFNcTSSPtQUpYaUo4jf1KsezICKigFyJpoJgDrIbZ6mXc vPGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si19095268pfd.17.2019.04.24.09.48.00; Wed, 24 Apr 2019 09:48:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732756AbfDXQpo (ORCPT + 99 others); Wed, 24 Apr 2019 12:45:44 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48822 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726935AbfDXQpo (ORCPT ); Wed, 24 Apr 2019 12:45:44 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EB505374; Wed, 24 Apr 2019 09:45:43 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A3D1C3F557; Wed, 24 Apr 2019 09:45:39 -0700 (PDT) Date: Wed, 24 Apr 2019 17:45:37 +0100 From: Mark Rutland To: Mathieu Desnoyers Cc: Peter Zijlstra , "Paul E . McKenney" , Boqun Feng , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Thomas Gleixner , Andy Lutomirski , Dave Watson , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H . Peter Anvin" , Andi Kleen , Chris Lameter , Ben Maurer , Steven Rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes , Shuah Khan , linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH for 5.2 08/10] rseq/selftests: aarch64 code signature: handle big-endian environment Message-ID: <20190424164536.GE21101@lakrids.cambridge.arm.com> References: <20190424152502.14246-1-mathieu.desnoyers@efficios.com> <20190424152502.14246-9-mathieu.desnoyers@efficios.com> <20190424164032.GD21101@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190424164032.GD21101@lakrids.cambridge.arm.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 24, 2019 at 05:40:33PM +0100, Mark Rutland wrote: > On Wed, Apr 24, 2019 at 11:25:00AM -0400, Mathieu Desnoyers wrote: > > +/* > > + * aarch64 -mbig-endian generates mixed endianness code vs data: > > + * little-endian code and big-endian data. Ensure the RSEQ_SIG signature > > + * matches code endianness. > > + */ > > +#define RSEQ_SIG_CODE 0xd428bc00 /* BRK #0x45E0. */ > > + > > +#ifdef __AARCH64EB__ > > +#define RSEQ_SIG_DATA 0x00bc28d4 /* BRK #0x45E0. */ > > +#else > > +#define RSEQ_SIG_DATA RSEQ_SIG_CODE > > +#endif > > + > > +#define RSEQ_SIG RSEQ_SIG_DATA > > > > #define rseq_smp_mb() __asm__ __volatile__ ("dmb ish" ::: "memory") > > #define rseq_smp_rmb() __asm__ __volatile__ ("dmb ishld" ::: "memory") > > @@ -121,7 +134,7 @@ do { \ > > > > #define RSEQ_ASM_DEFINE_ABORT(label, abort_label) \ > > " b 222f\n" \ > > - " .inst " __rseq_str(RSEQ_SIG) "\n" \ > > + " .inst " __rseq_str(RSEQ_SIG_CODE) "\n" \ > > I don't think this is right; the .inst directive _should_ emit the value > in the instruction stream endianness (i.e. LE, regardless of the data > endianness). Now I see the RSEQ_CODE value isn't endian-swapped as teh RSEQ_DATA value is, so the code above is fine. Sory for the noise. Thanks, Mark.