Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3311679iob; Mon, 16 May 2022 19:01:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0ZxFofwnqBXjvMl24BfVOQP+ygdWojhLdNDuc8TyvA1gERv/rMmDN0xbW3y1JxrTk8DO+ X-Received: by 2002:a63:1e55:0:b0:3db:84c2:8b2c with SMTP id p21-20020a631e55000000b003db84c28b2cmr17004846pgm.546.1652752894462; Mon, 16 May 2022 19:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652752894; cv=none; d=google.com; s=arc-20160816; b=b9gPQhBVEGMVZHC/veEsFizcPM2aJBvyEoQ1oS/9OE5lXPyoetOotLsSrDbswLywTC cC74Bw57S+Zv3TS2piCq4ygVoeOE9c3fuVodKiMrggmF7CrT8FVueuWmVFkf6iEW1hLi BzL2m+Ib1lfV0zyZGsh6cbeKlsT7CeJwVJCLL8CA9tsobwf1U58dhHSNpR4m8Av39oOy bL0f29LV7OI3M6hlx8a44umYf+p+S+OlWX2wsv5W01U0r5YILxdyqL+1ZJaV7DgLKRN2 H8VYTDFlYQuS1msvcJ39cfkkJe5A2voKoOBlaXFnlim8x/E2ASCnzPv15x96+0fTR7FB 7qQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=CgyJ1bZZA2Xr1Oc6Ya/N2yM31d0pFi9AId2A5XTR4BY=; b=Y9/0LA7YqvLKNiSSLTghcoUtYlKzaAYFZ4aB+s1UbGsHt6quFNS7FA2Qq+6KLB3nJx HLYtOX128EDBR6POh/BVBV0ESZN2vnyHNME6c+iKDhc6XNH5pA03pTJBug7ITHlLmqfh 80r9ZuKPSB0oah2jq8kTBuVtZSm4Ycvm89E4jZQoHERLeALceA/39p4lzp+q9UW/qkB9 EDjHoKz9379qGaA91PNh1pRG58ERyb5Ysn3maCP5ueuZeKkebnXjfus8pexQcXKWVuSk oyxopU9NPbu9fInTHdBWK8y7r9tLKlGS20QhZxvUSBbCJ/bUro3ELa8ltCMWzu6jJCtS COfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fmtrZst7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a635717000000b003db2e79f827si13935165pgb.150.2022.05.16.19.01.22; Mon, 16 May 2022 19:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fmtrZst7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S245498AbiEPP4f (ORCPT + 99 others); Mon, 16 May 2022 11:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244552AbiEPP41 (ORCPT ); Mon, 16 May 2022 11:56:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F1B519FF4 for ; Mon, 16 May 2022 08:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652716585; 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=CgyJ1bZZA2Xr1Oc6Ya/N2yM31d0pFi9AId2A5XTR4BY=; b=fmtrZst76bd9l1CpdVZwlZvL++C3VUtpEApcNzM5VjpT3BMkmfotbD4hgjEdRl638NYCw6 Ae6WNKmMSh3UmddIlj3de4dVqIdp4d47vV2YVLmz7UooxZcSnr/z0SHepIPyT1LJyyb85M qxQFkHZTsZwdeEDUuu9euhdhDp5hkPo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-J5Nz8hgrOHueTZmlA0JEew-1; Mon, 16 May 2022 11:56:22 -0400 X-MC-Unique: J5Nz8hgrOHueTZmlA0JEew-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8DED803D45; Mon, 16 May 2022 15:56:21 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E06A440C1244; Mon, 16 May 2022 15:56:21 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 24GFuLGH031395; Mon, 16 May 2022 11:56:21 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 24GFuLp9031391; Mon, 16 May 2022 11:56:21 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Mon, 16 May 2022 11:56:21 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Peter Zijlstra cc: Linus Torvalds , Josh Poimboeuf , linux-kernel@vger.kernel.org Subject: Re: [PATCH] objtool: fix objtool regression on x32 systems In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 May 2022, Peter Zijlstra wrote: > On Mon, May 16, 2022 at 11:06:36AM -0400, Mikulas Patocka wrote: > > The patch 4abff6d48dbc ("objtool: Fix code relocs vs weak symbols") makes > > the kernel unbootable. The patch c087c6e7b551 ("objtool: Fix type of > > reloc::addend") attempts to fix it by replacing 'int' with 'long'. > > > > However, we may be running on a system with x32 ABI and 'long' on x32 is > > 32-bit, thus the patch c087c6e7b551 doesn't really change anything and we > > still end up with miscompiled kernel. This patch replaces 'long' with > > 'long long', so that the 64-bit kernel is correctly compiled on a x32 > > system. > > Hurmph.. you're building a 64bit kernel on a x32 hosted machine? And > this is the *only* thing that goes sideways? I use the x32 ABI (that is 64-bit mode with addresses truncated to 32-bit). gcc compiled for the x32 ABI is about 5% to 10% faster than gcc compiled for the amd64 ABI. I installed the x32 gcc from Debian Ports. > I suspect quite a bit of objtool assumes LP64 and won't quite work right > on ILP32 and we've just been lucky so far. With this patch, the compiled kernel works. With kernels 5.17 or older, it also works. I bisected it and the breakage is caused by the commit 4abff6d48dbc. Mikulas