Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp568199pxu; Thu, 15 Oct 2020 10:43:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytpyW9UHEFqxFzBSpS0j8+Hwbo3BziVpMWIfuJ8JioltO49GSAiI4tdZAjpMeB5WjKLJVR X-Received: by 2002:a17:906:a859:: with SMTP id dx25mr5582002ejb.459.1602783808223; Thu, 15 Oct 2020 10:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602783808; cv=none; d=google.com; s=arc-20160816; b=IXgPlFWXXRz2v9xwoAOQ/49jf3MyZDiRCRM84CEOSZHPLwdzQUROlNA32AscQqGebN xfi84R8XllTdOY5TcO/6E5bW1gPs9QmpmUIm1SrUyJcatVRbBFIqk7lzrB2uEvusKL5E UTbl2f8apvoJ4HrXGtwzqqLs3iuk4HXu2MWr60n3M3fyPlriW1dS/PsMrDw0oqOMoJrB 4fxYgQPp9SoftyC4rPg1A6I21mkKoy3pqXstfQP7bTUkozz5mAJucBu5O/PtfCk9twH3 WOw5S4dB0zAJdlLp5/3YbCG0kY9V63juIyZz7e/A7mEpm5YcbWgG86ZjZYyhNZhb2hPz pTYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PXzy1d3ckMk0Ny0gHfuwHvgJ6RXIhGLeAUjxyUMOj74=; b=BIB4u1yPlrYUNf2nS/kJaOtqNLKtV41ATo4pOuQWvKN97U/qlQSRg3skjy5kZYQps7 EhyaNjxoCVURP5xk376BZH0e/MKqD7+0KR/+Y3JOE2gA/KkSl/w0fur3JbfiL2hglwPF XnqqWWt0CgURYEuq8teRiuCAcQkGV8u4sQyNeKulf+/XAIleOD2fymE9C+ly41ZDH/Y9 faWl+A/LMDLqtt76aeYd2C2dv3KJIRPNbUEOlxopyT+S7VfCHrA8gThMNTA1oDkVg4mi r6WOcCzqx7qgaE439CdE8d0ogJANqdrhZWC+t58LywzUZXla19RwNTzlhi+XXd13Zs/N UtPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YZbkD9vM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i6si2483583edb.260.2020.10.15.10.43.00; Thu, 15 Oct 2020 10:43:28 -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=@google.com header.s=20161025 header.b=YZbkD9vM; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729045AbgJOGYk (ORCPT + 99 others); Thu, 15 Oct 2020 02:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728662AbgJOGYk (ORCPT ); Thu, 15 Oct 2020 02:24:40 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3679AC061755 for ; Wed, 14 Oct 2020 23:24:40 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id h5so1876345wrv.7 for ; Wed, 14 Oct 2020 23:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PXzy1d3ckMk0Ny0gHfuwHvgJ6RXIhGLeAUjxyUMOj74=; b=YZbkD9vMiz5BzYxugQodbY8GjIsUu9NZMMfVV6I+A0SuakkKwK87m8Mt6+3RgPHchE 8p0/mxoEh81CbftpKckrDFXk4zF+O3+fTs8kjsCiL+Prl6lFiAlEBVd3hnL1ELLihZu0 49zucOkSqjTj9l/Zb7mMAyvFgykwp+Dv25lOu4Qo5zkoCcNIL4GJlAu9mBS9LACtkNPe x6KzG7b1i5DJvl1hvDKGNZUBB9AtOuxVtfQpwnW1maOLeTKwTB/avP7sy6d6Y2Wh2a8m RP3+cr9MKuy/NLMQH+8nh+FtMT6g0DHF4ViKmATpr/SHP/V6CJZdTk7Gzq3BDX4/QMg0 D3hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PXzy1d3ckMk0Ny0gHfuwHvgJ6RXIhGLeAUjxyUMOj74=; b=EyQ9nsBL28a7r+I6VNvYeURrLXqLhrtrU30mwYesLI9sExfG2GBp2o3wUwLNlbUY2e zfyOENFqePWDXNrArtNtABsyTVTVCjHPNh+YVc4CfKSckHWq6ympSY/Nc3pJ11cb0dkq jgfeLov2U6yZzXegCDL/XhPT5UYtdvRCoGSjs275Kb9xp5YY/jKa+dYbB1fvqIcTTvs4 P9/sPe1eDA49C///0rjFpOsFUTlKsKvz2/WCTVxWUpx3ZdQ7qU7LHFwNzEt8uPZVeaon jvrZ54KlnTLkm2FqVRKYdDXd8oc4LIVcggAV5khToL54dT89Raqb86G43U4LUC3VSYF+ 6/Hw== X-Gm-Message-State: AOAM5315QkCPngFWMUaUanJ0M6TuMYc4qPmr3mdbLdzdq1iiHZHGVwsg dnadKd8phJsA3NC/E9v+6bl9vq4e58whTK6n05DOazwOtMfLZQ== X-Received: by 2002:a5d:6407:: with SMTP id z7mr2524568wru.271.1602743078716; Wed, 14 Oct 2020 23:24:38 -0700 (PDT) MIME-Version: 1.0 References: <160208761921.7002.1321765913567405137.tip-bot2@tip-bot2> <20201009203822.GA2974@worktop.programming.kicks-ass.net> <20201009204921.GB21731@zn.tnic> <20201010174415.zwopoy6vpficoqlr@treble> <20201012091236.0f9a64bfedb8825732b65ea5@kernel.org> <20201012153949.jfwa7rgpzu5b7ld4@treble> <20201014162859.987d5f71f5e5456ffb812abc@kernel.org> In-Reply-To: <20201014162859.987d5f71f5e5456ffb812abc@kernel.org> From: Ian Rogers Date: Wed, 14 Oct 2020 23:24:26 -0700 Message-ID: Subject: Re: [tip: objtool/core] x86/insn: Support big endian cross-compiles To: Masami Hiramatsu Cc: Josh Poimboeuf , Borislav Petkov , Peter Zijlstra , LKML , linux-tip-commits@vger.kernel.org, Martin Schwidefsky , Vasily Gorbik , x86 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 12:29 AM Masami Hiramatsu wrote: > > On Mon, 12 Oct 2020 10:39:49 -0500 > Josh Poimboeuf wrote: > > > On Mon, Oct 12, 2020 at 09:12:36AM +0900, Masami Hiramatsu wrote: > > > On Sat, 10 Oct 2020 12:44:15 -0500 > > > Josh Poimboeuf wrote: > > > > > > > On Fri, Oct 09, 2020 at 10:49:21PM +0200, Borislav Petkov wrote: > > > > > On Fri, Oct 09, 2020 at 10:38:22PM +0200, Peter Zijlstra wrote: > > > > > > On Wed, Oct 07, 2020 at 04:20:19PM -0000, tip-bot2 for Martin Schwidefsky wrote: > > > > > > > The following commit has been merged into the objtool/core branch of tip: > > > > > > > > > > > > > > Commit-ID: 2a522b53c47051d3bf98748418f4f8e5f20d2c04 > > > > > > > Gitweb: https://git.kernel.org/tip/2a522b53c47051d3bf98748418f4f8e5f20d2c04 > > > > > > > Author: Martin Schwidefsky > > > > > > > AuthorDate: Mon, 05 Oct 2020 17:50:31 +02:00 > > > > > > > Committer: Josh Poimboeuf > > > > > > > CommitterDate: Tue, 06 Oct 2020 09:32:29 -05:00 > > > > > > > > > > > > > > x86/insn: Support big endian cross-compiles > > > > > > > > > > > > > > x86 instruction decoder code is shared across the kernel source and the > > > > > > > tools. Currently objtool seems to be the only tool from build tools needed > > > > > > > which breaks x86 cross compilation on big endian systems. Make the x86 > > > > > > > instruction decoder build host endianness agnostic to support x86 cross > > > > > > > compilation and enable objtool to implement endianness awareness for > > > > > > > big endian architectures support. > > > > > > > > > > > > > > Signed-off-by: Martin Schwidefsky > > > > > > > Co-developed-by: Vasily Gorbik > > > > > > > Signed-off-by: Vasily Gorbik > > > > > > > Acked-by: Masami Hiramatsu > > > > > > > Signed-off-by: Josh Poimboeuf > > > > > > > > > > > > This commit breaks the x86 build with CONFIG_X86_DECODER_SELFTEST=y. > > > > > > > > > > > > I've asked Boris to truncate tip/objtool/core. > > > > > > > > > > Yeah, top 4 are gone until this is resolved. > > > > > > > > Masami, I wonder if we even need these selftests anymore? Objtool > > > > already decodes the entire kernel. > > > > > > No, they have different roles. The selftest checks if the decoder > > > works correctly by comparing with the output of objdump. > > > > > > As far as I can see, the objtool relies on the sanity of the decoder > > > (it trusts the output of the decoder). > > > > Ok. I wonder if we should move the decoder selftest to the 'tools' > > subdirectory. > > It is in the arch/x86/tools, so it is already in a kind of tools :) > But yeah, it was considered to be used only on x86. But if someone > start trying to run it on non-x86, cross compiling, we need to > reconsider that. > > Thank you, > > -- > Masami Hiramatsu There is undefined behavior that is present in the x86 insn.c code as described in: https://lore.kernel.org/lkml/20190724184512.162887-4-nums@google.com/ I resent this patch fixing other potential undefined behavior: https://lore.kernel.org/lkml/20201015062148.1437894-1-irogers@google.com/T/#t The misaligned loads will likely break on anything non-x86. Thanks, Ian