Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1108185yba; Wed, 24 Apr 2019 15:17:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+Poio8NMZ8Vbio6vwbM6en1lj2+Vbg9PtoVCAknN+kChAbhVdcUdlV4hrfVET8O2Kp1Ky X-Received: by 2002:a17:902:864b:: with SMTP id y11mr33108262plt.1.1556144225809; Wed, 24 Apr 2019 15:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556144225; cv=none; d=google.com; s=arc-20160816; b=LxafiupBRwa7UYLCJDm62lx1dG8mlX7IiF0BC8SYxf6SL9NAsV0g6W+qROApq7dYLm lu6vHMDW47i5Qf0eZFFQe4amNrN5qHhgkz7yyMDcu55xoXkmg0GbcUeo/fKBeeCBXiYS quKF7dYHIvClpUX9dd4FE6RgmtjvNHYJ1S1LB9mNI6XLMr4W/wIzPQMb6GEoKEWjDl2D LzL041yyoTNn22uYlRZ1Dx/IlxoQjB1b0ut3cUYldhyQD61ocXX3VwE7DNAbP/YLz6Me I3/4Q7mcvAHKfTYKT1uqAaudFr4l3LYcuy0ldW4cgOjawYQ1D5QApnH+mdWRALz88R/w SqUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=Ex/Bez+rbJXKFeKiO+tud5TSRCa9wwv9WZfRFYB+rpU=; b=mGBiEA9fDVN9KNLgoXNYvCQA79j/2GoMRJYI0AGXfbbnWd7rLh4M1N5I27N3ZHZYtB 3m6+tsrQEleu5U9+U3z8m8dHlNUINMmFFZtJ0ruBBglRS+12F8+AtqZMGa5vCJV6DE32 bDPUos7Duchse/3M+NoCsN/kROF9RwaElqvwHAvkEVg9CSX2MzKY5GEQtapNHLFC+syZ dR7AWKmoAgZwhMphEU5V89FL6SXFPw6uCq4g5nTzp1t+CndGBhKuOxxrOa+1IyxmrdMA tHixmOWm3JRZk75oT56n8uW4ayzjJf9TD5GQ6YzKlMnH2GQ+jRvd9i6neueorYrOCsKB Y1NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=uH0nPsdq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si19508237plt.354.2019.04.24.15.16.50; Wed, 24 Apr 2019 15:17:05 -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; dkim=pass header.i=@efficios.com header.s=default header.b=uH0nPsdq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733035AbfDXRA5 (ORCPT + 99 others); Wed, 24 Apr 2019 13:00:57 -0400 Received: from mail.efficios.com ([167.114.142.138]:38992 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730260AbfDXRA5 (ORCPT ); Wed, 24 Apr 2019 13:00:57 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 9DB081DAA44; Wed, 24 Apr 2019 13:00:55 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id NS6s5Twc3ZW5; Wed, 24 Apr 2019 13:00:55 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 2A4271DAA3F; Wed, 24 Apr 2019 13:00:55 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 2A4271DAA3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1556125255; bh=Ex/Bez+rbJXKFeKiO+tud5TSRCa9wwv9WZfRFYB+rpU=; h=Date:From:To:Message-ID:MIME-Version; b=uH0nPsdquveZSmK71XqKTTshkDN2apTeJjhgmdE8bOSuEnyP+nA6mI6k3KZCKnFNm qk0379wSp0C5Dtusi6wYQrCtilibk+BFPUm6ivfXv/YTSmdfT7mhfIprKg8cKiUatu IO9lmP4/kGiXTjiIC5J8ad645I+aI+t3QOKVnUo7KmR1qULq4xcIzbdgOuQjnH9SZV /olZknLqAKk5JfedVeS0reeah2CKPEYwKh1L2TdSFWkcmU+oLReJx6NbOEw8sLK9NR l2bCEz+zByLWgvFyk1I4oM1rK30jKx8Zt7Ltfr5E6NmzJXnn6fjL81Q9nwPuCIbOms 97UpKKFQ38Img== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id pdPlonkO4ApW; Wed, 24 Apr 2019 13:00:55 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 0A13C1DAA38; Wed, 24 Apr 2019 13:00:55 -0400 (EDT) Date: Wed, 24 Apr 2019 13:00:54 -0400 (EDT) From: Mathieu Desnoyers To: Mark Rutland Cc: Will Deacon , Peter Zijlstra , "Paul E . McKenney" , Boqun Feng , linux-kernel , linux-api , Thomas Gleixner , Andy Lutomirski , Dave Watson , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , Andi Kleen , Chris Lameter , Ben Maurer , rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Michael Kerrisk , Joel Fernandes , shuah , linux-kselftest Message-ID: <697611694.604.1556125254852.JavaMail.zimbra@efficios.com> In-Reply-To: <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> <20190424165150.GF21101@lakrids.cambridge.arm.com> Subject: Re: [RFC PATCH for 5.2 08/10] rseq/selftests: aarch64 code signature: handle big-endian environment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.12_GA_3794 (ZimbraWebClient - FF66 (Linux)/8.8.12_GA_3794) Thread-Topic: rseq/selftests: aarch64 code signature: handle big-endian environment Thread-Index: OBjeHUeE7gQ5xyWKTP757DExutwbEw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Apr 24, 2019, at 12:51 PM, Mark Rutland mark.rutland@arm.com wrote: > 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. Considering that those RSEQ_SIG* define will end up in public bits/rseq.h headers within glibc, I'm tempted to keep the amount of dependencies on external headers to a minimum, if it's OK with you. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com