Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4367591rwd; Tue, 30 May 2023 04:37:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fyC0ME6FrWuH3+kY++8HKzbGyvVyFHrDjyo/dV+Mmy8h4zKZwdRsNqPVj6s6cVcr5Qp4j X-Received: by 2002:a17:90a:1f41:b0:24e:2e86:5465 with SMTP id y1-20020a17090a1f4100b0024e2e865465mr2160532pjy.31.1685446645417; Tue, 30 May 2023 04:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685446645; cv=none; d=google.com; s=arc-20160816; b=0KCpqRYhCnhHNoVb7vQahsqaPo7cxoP3QpEFJtdnWQT4lUY/kc7p1+c6deCt33i1uO aXR9+ZwY2ApmT2ULkgFOzCu7coveEj0JuUMNkx5gbYV9akhXSphD2WbxykCOeuFbnC+0 R2s6R3gFUCCI/IUnfdVtARuBJa71ZIFyY5XjwCctOfEEwTxpVABoBdTqx8a42iOrE11k +CV7zOffHWkPyDjFlfRmR70FP7feVhc0ckSlmq4EmsG2vXKzdbhnv8afCBeKvRk6K4Qz seFZ79AaAIZTHfvs/fSEK5TjxnK6u2SzRUYF4AXM1QASgXd+EHiUPeq2OlHkSX+FBzKF OnIg== 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=j9I56BwKJC+BbnxkzOeSVjINNxm7Kz+ydMtYSbEYEBo=; b=XPENWTPigfHtvqB/+GlRARlQ0xQmrhM8EVTZeTyG+ynIlwFudzWI44VspxDNzjJc+S dKT6f3Tj3jlFm9sIJMlAJ7Rq6ni32Q2FNGdDrlyW63V2/fbVmXFJ8EIzKbjCycZYekYa ac3VdrFoTYA4rL0baW4yePXKdXDJ5DQYturi1Wnayr1UDOc89ss5zoT/hESOQqt2wEAB UHQgLcHE/ltUcXx2C5TTfWKbzQ7hQRrd1JDyooYsLk2cJXbmHmaVrqoUN2CvsLYxe0W/ hRXhMSIHCR02SdoQ5vxPAepG/D/5Zyh4zlv4kLJ1hzVUikdLEHL1T+7eKlQpxr4ShF4C MWvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=J9cVZikY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iq14-20020a17090afb4e00b0025027e0ad3dsi11109103pjb.81.2023.05.30.04.37.13; Tue, 30 May 2023 04:37:25 -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=@microchip.com header.s=mchp header.b=J9cVZikY; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbjE3L2F (ORCPT + 99 others); Tue, 30 May 2023 07:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjE3L2E (ORCPT ); Tue, 30 May 2023 07:28:04 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED5C7D9 for ; Tue, 30 May 2023 04:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1685446082; x=1716982082; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=j9I56BwKJC+BbnxkzOeSVjINNxm7Kz+ydMtYSbEYEBo=; b=J9cVZikYXoVE5PENBGvd2nyHtpQ7vjiUVQ+kgqef5e35NC4CcUbEgL72 EaxCK2zJWoKfnNhpvMA8Gr55WshUIbFPxpJ4y6bVfnQqG3ptZZVLhpfWN XeN1FK/4235v0IcaHDmpAFJ2db9w6KfcDlR1wMemdLkmiUzKlZ8ua4W6E SIwFAHa1Bky1SP5NVDpmacBSnwphkvYb6kjpM74LeqsWMD7Emei22lzNo Nudw2pPJ6nL5ip9mGDXFfC2N8a7XSqxz2GyGu90TwI3/PLiAmxunKDzVD x4eLXpd3JarvPmWDyf91DOw3yaRH/MO1mlXPjR3TGoH5g6Tay/GMz9aJt A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681196400"; d="asc'?scan'208";a="227570029" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 May 2023 04:28:02 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 30 May 2023 04:28:01 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 30 May 2023 04:27:59 -0700 Date: Tue, 30 May 2023 12:27:37 +0100 From: Conor Dooley To: Alexandre Ghiti CC: Conor Dooley , Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andreas Schwab , , Subject: Re: [PATCH -fixes] riscv: Fix relocatable kernels with early alternatives using -fno-pie Message-ID: <20230530-polka-trifle-7ccd7a093099@wendy> References: <20230526-rockfish-moody-f6d3e71f9d24@spud> <20230527-hyperlink-doctrine-ef22cfcb508a@spud> <20230528-darkness-grandly-6cb9e014391d@spud> <20230528-uneatable-earpiece-3f8673548863@spud> <20230529-skillet-quarters-3fbc3b6edb3a@spud> <41e57bb9-ce0c-7772-abeb-5c01d5ec19bb@ghiti.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ijmS6XfW1T6Cta2t" Content-Disposition: inline In-Reply-To: <41e57bb9-ce0c-7772-abeb-5c01d5ec19bb@ghiti.fr> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 --ijmS6XfW1T6Cta2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 29, 2023 at 09:37:28PM +0200, Alexandre Ghiti wrote: > On 29/05/2023 21:06, Conor Dooley wrote: > > On Mon, May 29, 2023 at 08:51:57PM +0200, Alexandre Ghiti wrote: > > > On 28/05/2023 15:56, Conor Dooley wrote: > > > > On Sun, May 28, 2023 at 03:42:59PM +0200, Alexandre Ghiti wrote: > > > > > Hmmm, it still works for me with both clang and gcc-9. > > > > gcc-9 is a bit of a relic, do you have more recent compilers lying > > > > around? If not, I can try some older compilers at some point. > > > >=20 > > > > > You don't have to do that now but is there a way I could get your= compiled > > > > > image? With the sha1 used to build it? Sorry, I don't see what ha= ppens, I > > > > > need to get my hands dirty in some debug! > > > > What do you mean by "sha1"? It falls with v6.4-rc1 which is a stable > > > > hash, if that's what you're looking for. > > > >=20 > > > > Otherwise, > > > > https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vm= linux.bin > > > > (ignore the release crap haha, too lazy to find a proper hosting > > > > mechanism) > > >=20 > > > Ok, I don't get much info without the symbols, can you also provide t= he > > > vmlinux please? But at least your image does not boot, not during the= early > > > boot though because the mmu is enabled. > > Do you see anything print when you try it? Cos I do not. Iff I have time > > tomorrow, I'll go poking with gdb. I'm sorry I have not really done any > > investigating, I have been really busy this last week or so with > > dt-binding stuff but I should be freer again from tomorrow. > >=20 > > https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vmlinux >=20 >=20 > Better, the trap happens in kasan_early_init() when it tries to access a > global symbol using the GOT but ends up with a NULL pointer, which is wei= rd. > So to me, this is not related to kasan, it happens that kasan_early_init() > is the first function called after enabling the mmu, I think you may have= an > issue with the filling of the relocations. Yeah, it reproduces without KASAN. > Sorry to bother you again, but if > at some point you can recompile with DEBUG_INFO enabled, that would be > perfect! And also provide the vmlinux.relocs file. Sorry for all that, too > bad I can't reproduce it. New vmlinux & vmlinux.relocs here: https://microchiptechnology-my.sharepoint.com/:u:/g/personal/conor_dooley_m= icrochip_com/EZpFNxYYrnNAh5Z3c-rf0pUBBpdPGTLafqdtfcXRUUBkXw?e=3D7KKMHX They're pretty massive unfortunately & hopefully that is not some garbage internal-only link. =2Econfig is a wee bit different, cos different build machine, but the problem still manifests on a icicle. I've added it to the tarball just in case. > > > I tried with gcc-12 and it still works fine on my end, so frustrating! > > Crap! Also, should you not be enjoying a public holiday rather than > > debugging?! Or maybe debugging is enjoyable for you... >=20 >=20 > Ahah, this is what I enjoy doing when the kids finally sleep :) >=20 >=20 > Thank you again for your very quick feedback, really appreciated! No worries. --ijmS6XfW1T6Cta2t Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZHXdqAAKCRB4tDGHoIJi 0lM7AP0U38KNP3c0yvn8PKfKxVr1SpAhJSK43MDqw7G9XFbtGgEAlCUv8lOmrwge 9usJ8IHOH3/p8eTuvB89kQgqwjxZGQg= =mBwb -----END PGP SIGNATURE----- --ijmS6XfW1T6Cta2t--