Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1129608yba; Wed, 24 Apr 2019 15:45:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7xUITGbg19ZdJWC97+8uMM/oyL53jw2im4OtD/BZnnn47Na9wM9sSJ0yVfGW+HZrDpHDX X-Received: by 2002:a17:902:e610:: with SMTP id cm16mr33062843plb.189.1556145918409; Wed, 24 Apr 2019 15:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556145918; cv=none; d=google.com; s=arc-20160816; b=Ql6dJmktNm71IxgA9OJ450XxdKLmZ956JhCE2BnpshVgJklFgtvWMED75PQdxV/faf QMui+6phjkIMmSKI9friUOIoR38DNCbGgVUyPD2YgzhadJNbZROrcs+T0WVHpGskgI7d ZQ21zBUxjgmGDyG/hwvP53P00/xfUyIlfNViUGy4u/GMOBNWO+c5PS5aM5nPeYBtoPv5 11ycPoyZcyKy5npf0AccilRNO8fG5aFZAvFv3c1xQHN12sgAUqaHF1rKJa59fa+gBcRd MmvadB4udh+gYfap04nw50FQjw6WLkfsAwI/lTL/GxylObKPMztQgb+3JBY9TnujonVG I5Tw== 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=DPZxSR6wYKJnzekC6sgrLt8hlX9/r4//uloKdoG3rCc=; b=UQ4YxUsfDo54kDpHd03xZkcnuryBsB5YTuoA5Vkzpkr+mqNYSHbCxExLr2VZojsjsW Y7oTuHyGGJPdJz2hKHzZdckwyuzjQJB8vsMIoLLsEjwERIqqcfqk3Hp3HjKyDeLwbeeL 27AHSpSWmU1e13Sl2RyKZ0ELlI+xl5qrwk2GZWsJNYW+Tj6hIRxetikH89wivBSWBhtl lWGtdNzRwrELS/udU8ihMg0K6RqeuhQI3mS3mmQ1dWJPezAiGxHS8zGSUokrhHviMVSZ ueE8h9xw5un9PaJHV5xmZPYwmZGsinj+z384QDUhYg4KS3AFUpgE8/P4BH969GTqTdzI l6fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=Z65Z2ecO; 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 az5si19833521plb.111.2019.04.24.15.45.01; Wed, 24 Apr 2019 15:45:18 -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=Z65Z2ecO; 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 S1733114AbfDXRDC (ORCPT + 99 others); Wed, 24 Apr 2019 13:03:02 -0400 Received: from mail.efficios.com ([167.114.142.138]:39754 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730708AbfDXRDB (ORCPT ); Wed, 24 Apr 2019 13:03:01 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id CC7AB1DAAE6; Wed, 24 Apr 2019 13:02:59 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id yNASwfcFOYXs; Wed, 24 Apr 2019 13:02:59 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 75F621DAADF; Wed, 24 Apr 2019 13:02:59 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 75F621DAADF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1556125379; bh=DPZxSR6wYKJnzekC6sgrLt8hlX9/r4//uloKdoG3rCc=; h=Date:From:To:Message-ID:MIME-Version; b=Z65Z2ecOVrs5AYVi+2oZhJCtp57WyBQsC1D3s1U5WPpHO39pLlAw2/R91pN8mFecy XWPTMW34QEbvnQdhm+mJWud5p0GsFMI8a/gKUVgteJZZfBqKMjg487isP6iaYTwggr hTfA1ZkgUgwQnBCLbKYMJCmbf+ps+v2PX6RyPkbh2TvgvX+uxsTcgJ3kAthDu+EvP6 Yxx4Fb9Dxo4b6AOMQ/JIVccnUpYYutZnCsehdnzbGc0wdd+jCHMjE7eL3bj6MqHiFU eNcUvkWDxX8RhCQe+xRSopaMNjl1RhSRcaYafOI1NGE79mUJIS1INtZM+E7/eizsFG 4kvv5wIYOj77Q== 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 L4OG3F3Nyf9m; Wed, 24 Apr 2019 13:02:59 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 5860E1DAAD8; Wed, 24 Apr 2019 13:02:59 -0400 (EDT) Date: Wed, 24 Apr 2019 13:02:59 -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: <2087640779.608.1556125379269.JavaMail.zimbra@efficios.com> In-Reply-To: <697611694.604.1556125254852.JavaMail.zimbra@efficios.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> <697611694.604.1556125254852.JavaMail.zimbra@efficios.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: OBjeHUeE7gQ5xyWKTP757DExutwbEyS+nxVk Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Apr 24, 2019, at 1:00 PM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote: > ----- 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. Also, I'm not sure the le32_to_cpu() approach would work in __ASSEMBLER__ builds. Thanks, Mathieu > > Thanks, > > Mathieu > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com