Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3567897rwd; Mon, 29 May 2023 12:49:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52emz85PBwAKXLg1/Pj4J9RIXxq/CZeKgGJ8xXd56CrDc/GLQi7wjwYk+yqRiz8ySFfR/9 X-Received: by 2002:a17:902:e546:b0:1b0:3224:e53a with SMTP id n6-20020a170902e54600b001b03224e53amr250536plf.20.1685389796498; Mon, 29 May 2023 12:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685389796; cv=none; d=google.com; s=arc-20160816; b=zlp7lmxYAfkApjh2CuW/+tXRW0+CKXUQ+2tvkCmHH5SZ6g1sLljKqak5L0rSWTxSCL KPUb9/DDZX8rf8fb/bM9kGoW1I6QyihxwRV/QdFFjHtuAMjnv34B6GY+n3jwRiQWx9dY syenNSpcbNoO2Su1LHorDycj/teC8wgm+gsBVqJSDPw0WbZzTVwA9DV8ylkCdfC9UboW lcLzDlx1j8bFs63756YjKVY5QK3m1+8bCeRqkuIYu5SeDeXCWPRdRik0vOfqXWNod5UM Glxugk22sU8qHWXRNseZEpdLxCK6E8x+s/GqwFnqpmq8jXjIgefaie4kSDR5PWWH3NIv 6dkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=oq1c39MKH+yNAaPmddm2CI2RRMFb6w9D82ZgbryzkJA=; b=VjWnhAyud7fE/FDYN0MrLRN4EFdXsJoi3fg4Gjfh0zwug+xzE/4Almn1OLjFT24Fu5 xniayeNtN3Ssg+2dL9rd5VRgjGkaV0CMPJerDChGfKs9pNsjT+LGbY1m75tQ81BX1DbL /43bPoxBH5D77DE6SZ6BwIb6xEU2xOXAmJeCvVzt5cI9gou87kytAdFyKtgUlmbLWnMm ptqRcwxC3v/+Zlo+mJh4l97u+FdK+ItMrZRykRcJZYL6YEIH1UQR56lEj70WgD/X3hKH RmlPyH5MPwOc3PG9N72wdhjTkGrER2hkzThnVsf5lc+pxXsMkB3XsjCO1vfpYSXms51u hXLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a170902e84f00b001a64b603189si10853983plg.100.2023.05.29.12.49.42; Mon, 29 May 2023 12:49:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229499AbjE2Thk (ORCPT + 99 others); Mon, 29 May 2023 15:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjE2Thj (ORCPT ); Mon, 29 May 2023 15:37:39 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9A7B7 for ; Mon, 29 May 2023 12:37:33 -0700 (PDT) X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr X-GND-Sasl: alex@ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id D5EEFC0006; Mon, 29 May 2023 19:37:28 +0000 (UTC) Message-ID: <41e57bb9-ce0c-7772-abeb-5c01d5ec19bb@ghiti.fr> Date: Mon, 29 May 2023 21:37:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH -fixes] riscv: Fix relocatable kernels with early alternatives using -fno-pie Content-Language: en-US To: Conor Dooley Cc: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andreas Schwab , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230526154630.289374-1-alexghiti@rivosinc.com> <20230526-clergyman-wriggly-accc659a3fad@spud> <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> From: Alexandre Ghiti In-Reply-To: <20230529-skillet-quarters-3fbc3b6edb3a@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 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. >>> >>>> 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 happens, 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. >>> >>> Otherwise, >>> https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vmlinux.bin >>> (ignore the release crap haha, too lazy to find a proper hosting >>> mechanism) >> >> Ok, I don't get much info without the symbols, can you also provide the >> 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. > > https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vmlinux 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 weird. 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. 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. > >> 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... Ahah, this is what I enjoy doing when the kids finally sleep :) Thank you again for your very quick feedback, really appreciated! > > Cheers, > Conor.