Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1104626yba; Wed, 24 Apr 2019 15:13:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0ftudma+2A+YqnMHQBA++GN350xEWyRJrI7zGg6hey9IEq60Hfdxvc+Fe42xtEgAwcK7N X-Received: by 2002:aa7:9294:: with SMTP id j20mr37169768pfa.64.1556143987369; Wed, 24 Apr 2019 15:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556143987; cv=none; d=google.com; s=arc-20160816; b=OJF2tkVHQ5imUh3td7WQEf4Smag4feyvDGJEoXRI+9ZM14NeUgos7kyYfmohXCzk+5 2A1Hon2Fp68LD3BZLG/ur6F7XmTN/FwsOTGatSHRwQLzJ+P9oiKfbRus2POxk9tvz34W 3fnv4zmdgniwm7sBwI8SWRC7tLWonZiyLkf3Vdp0dovTz1C4whnIPjbEKajJTQ3ftU6x kaFr6+tIl/zE/PRfA4q7Rsoseq66XaPCCUjhdy7YynNK36sWZkYZajZf4iNKXhF0Kfct A0wbeQRBTDH8zoKCgxIKbkzTuHYYP/ZA3/HS6fiFwlDyGysbrIxSB9Tf1Gx8rdOu92gq 5APQ== 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=rQBq4noTX5l0fbU230skPZHF3FHCde/D7jLadKZEuPY=; b=jZl2PVHj1IT/Gq7aIGTYiMT+1bUeAeyZIliVEOprrBYo/uyDXHdrlyPz4SG690Jm56 NwmjYtcnhlphhQIrncHo/ALQXsRHQs+u+ZjluPqZhHsUpBRzxOrcCFYKrldjgSnsg3Cp d0pSu2oAy7luHead1N2H7jmttvWqRffGea3okLqXmYg0ejFzbXFBpie02txt2PhwYGyl xPvTkzukczbgx0NQtUhNeEchAK52aDKRIaSLgYEs/4N7HpQWJ8vAtJg8Q0TdqvH+9uMm ThnauvePdBa5PAgSG/co0KmcO5+URJUxjIawV3dlfCgMPYkjmM4Ey3XJkgsFKIkMD3wd b/Cg== 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 98si20416885plb.84.2019.04.24.15.12.52; Wed, 24 Apr 2019 15:13:07 -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 S1732938AbfDXQv6 (ORCPT + 99 others); Wed, 24 Apr 2019 12:51:58 -0400 Received: from foss.arm.com ([217.140.101.70]:49046 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732439AbfDXQv5 (ORCPT ); Wed, 24 Apr 2019 12:51:57 -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 2D691374; Wed, 24 Apr 2019 09:51:57 -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 DB8313F557; Wed, 24 Apr 2019 09:51:52 -0700 (PDT) Date: Wed, 24 Apr 2019 17:51:50 +0100 From: Mark Rutland To: Will Deacon Cc: Mathieu Desnoyers , 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 , 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: <20190424165150.GF21101@lakrids.cambridge.arm.com> References: <20190424152502.14246-1-mathieu.desnoyers@efficios.com> <20190424152502.14246-9-mathieu.desnoyers@efficios.com> <20190424164538.GC18611@fuggles.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190424164538.GC18611@fuggles.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:45:38PM +0100, Will Deacon 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. */ > > It would be neater to implement swab32 and use that with RSEQ_SIG_CODE, If possible, marginally neater than that would be using le32_to_cpu(RSEQ_SIG_CODE), without any ifdeffery necessary. It looks like that's defined in tools/include/linux/kernel.h, but I'm not sure if that gets pulled into your include path. Thanks, Mark.