Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3328984pxk; Mon, 5 Oct 2020 07:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrbiXNLaBgXKnM/TMEh/NJS2wCvrMvcuuzxSRtCzHHGBL8CMc88i2xKQyPq3fBth4sC+bl X-Received: by 2002:a17:906:1c0f:: with SMTP id k15mr2153186ejg.343.1601906938288; Mon, 05 Oct 2020 07:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601906938; cv=none; d=google.com; s=arc-20160816; b=BCtslnbLvowd2aOeNMC2S4A8pDea77W49ETGm14Q0uy5r59kImi6lRWwVSEBMru4RY OLnXnyhS5ecXobwzzkFVuDhhHIr7PPiAfnUaLwAVRX10kZOsR8OboKPf5wjnzR5+N6kJ 7Z3d7Ewj65sQPiTdXHb3yROVztxXK6Qwssiee2N8wyOYnqaLB+cJjkFm2sqm88JrrdQ+ /yM3pKu6n9HbA02f1MisQrtp7DMG9pT3JhQuS/S45WMyIKBW6NoeqBdFVa0Ea4pQNDbR x7iCQnwF5S067NOId8zWwf7Zf35Jy4RXkp6UAcdlosXvmoB0w3YUDv38RBJIGQF7dVJi ckrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5FiubZDjnEvbMrof1WsbVv3DYVP1R+np4/DBi1Pvea4=; b=orNQ31ZA3M5hfXG2RWiekd/rlK5Y8Zpf63+ZV/JWlzXWLuHjdj4X/xOJXFfPJfcLfn 1XTpeTTC5I9PQKiDqqU1QX0LpWE6WA6uUvudlWbEPY1kXD9ufjHaPiaO0+NsNBXxmLiX TZVxkkmF9nF+xvLqcqDYQwllgmHxyGVHBkUULkhUzv9GJmrRCgUJa3K/nCZ7HXoobjFH cfbQlWJ0oaud5CAdRecOJxKIIY9RGZ1SEWLh5zNLG//Q3BSk+L/fVsCMn3sWfCo43OKz xEGzijnLK3aKAPs7b+YbM5QS3RXf/2t7490LYTxuDKAawuse1VRQXDFn9WX9630axZ1L yMCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AuKPEKYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si36861edr.273.2020.10.05.07.08.34; Mon, 05 Oct 2020 07:08:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AuKPEKYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726364AbgJEOEB (ORCPT + 99 others); Mon, 5 Oct 2020 10:04:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:42783 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbgJEOEA (ORCPT ); Mon, 5 Oct 2020 10:04:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601906639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5FiubZDjnEvbMrof1WsbVv3DYVP1R+np4/DBi1Pvea4=; b=AuKPEKYIzqsd92fooobbwPV2m//mIS/Nd88GZcBmElcg9RAcw9pLdttkpJGaS4yRPJjXTc 5c9b/DzWpDnUpd5ooTI+eEP34pUStwdWVx1bO9OUC5lgAnld6fQcaUl5aRGHjVQ9byuwnf UPswJ07vnNXSU56xVN2v6AeFvex1EY0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4--71tJyiMOjmzBkmiMdQs5g-1; Mon, 05 Oct 2020 10:03:58 -0400 X-MC-Unique: -71tJyiMOjmzBkmiMdQs5g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2C21101FFA0; Mon, 5 Oct 2020 14:03:55 +0000 (UTC) Received: from treble (ovpn-119-43.rdu2.redhat.com [10.10.119.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C06C378824; Mon, 5 Oct 2020 14:03:36 +0000 (UTC) Date: Mon, 5 Oct 2020 09:03:28 -0500 From: Josh Poimboeuf To: Vasily Gorbik Cc: Peter Zijlstra , Thomas Gleixner , Masami Hiramatsu , David Laight , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Miroslav Benes , Alexandre Chartre , Julien Thierry , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v4 4/4] objtool: fix x86 orc generation on big endian cross compiles Message-ID: <20201005140328.hpbpkfpx3hmpuapt@treble> References: <20201002160114.7yb7z7aeijhchpwl@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 04, 2020 at 04:30:54PM +0200, Vasily Gorbik wrote: > @@ -77,8 +78,9 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, > if (entry->feature) { > unsigned short feature; > > - feature = *(unsigned short *)(sec->data->d_buf + offset + > - entry->feature); > + feature = bswap_if_needed(*(unsigned short *)(sec->data->d_buf + > + offset + > + entry->feature)); > arch_handle_alternative(feature, alt); > } > --- > arch/x86/include/asm/orc_types.h | 10 +++++ > tools/arch/x86/include/asm/orc_types.h | 10 +++++ > .../arch/x86/include/arch_endianness.h | 9 +++++ > tools/objtool/check.c | 5 ++- > tools/objtool/endianness.h | 38 +++++++++++++++++++ > tools/objtool/orc_dump.c | 5 ++- > tools/objtool/orc_gen.c | 3 ++ > tools/objtool/special.c | 6 ++- > 8 files changed, 80 insertions(+), 6 deletions(-) > create mode 100644 tools/objtool/arch/x86/include/arch_endianness.h > create mode 100644 tools/objtool/endianness.h > > diff --git a/arch/x86/include/asm/orc_types.h b/arch/x86/include/asm/orc_types.h > index fdbffec4cfde..5a2baf28a1dc 100644 This patch is misformatted. Almost like it was concatenated with itself? -- Josh