Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2703055rwd; Fri, 26 May 2023 10:00:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6sed+hekn3qywoNdRaqljxmx9vcfX2UxgBYMcfCAM1k8YP8svFIywNvJysuBZTrd42oMoq X-Received: by 2002:a05:6a21:3388:b0:10b:91c5:45b5 with SMTP id yy8-20020a056a21338800b0010b91c545b5mr3560505pzb.31.1685120412378; Fri, 26 May 2023 10:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120412; cv=none; d=google.com; s=arc-20160816; b=J0gbkHdko+vroNi4nyWhdH9zmdGsJ4G0nsxai5onLsvjedMYHbHiHYvMxStE+6+xK6 BHl2yphxEf+gNZJ8Ext4OLkhqRyDwqdvZUmGeFfJoX0qwBcNMftBKqe3MVagMSZ3R2v2 SxWsMJrXfj2iGNMubH5BgNVAeTBuwRbRwpLcFV5Mw9qwxcU6V9VKNCgQpbtbMhLxrEhA xgyXsXCIN58cp7zDLj8+e8ihIQhxqElHMSIEPuEqwmqSmNSN8mcqY13AZQ3vy4zRz7h/ +6CAOeqXQf2xJqfI7Ujo+HmbWR1oQKWQ4BNZWmKNWvvjm1xbcPooSLjGYF6rUV4V/bim uTjQ== 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=x/jv5pnwRc6XJ7J+Byjsxom/Bi/vRkp7vjwp8yHPZa0=; b=QPH7PQyLVZv+/tw41VUhW/7nv4oqj2mWBlHk+mWQ7PpH+gkCnDckntGbDm8atHrzPX PzfobdOtAnBWnxRiPnDL2Smi+VidiU77hNG84oJPYeZd744839DzGZFqApBJklgPdn8i qAt1fnlV981cOdMsbi0JFn5SiwUy5icatKVSx4B7cSgX6CqEFbB+j0mTT5thQP652hCA OlFCOEoIUEfEtqCEcZ7HHda/l7vjkJGrr7VH14oZtFf/mIVzrXU7qok23rVqUPAalOBt QVnmIbiiE5NRQ2fpCLZZOis9ZI4oObe8+NnZQhfTVM4SMBJFnT4w6WBSRQCFea2LTTEk KxRw== 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 v3-20020a655c43000000b0051b9a71329fsi3875633pgr.360.2023.05.26.09.59.57; Fri, 26 May 2023 10:00:12 -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 S236495AbjEZQiZ (ORCPT + 99 others); Fri, 26 May 2023 12:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbjEZQiY (ORCPT ); Fri, 26 May 2023 12:38:24 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828F9BC for ; Fri, 26 May 2023 09:38:19 -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 01FAF40009; Fri, 26 May 2023 16:38:14 +0000 (UTC) Message-ID: Date: Fri, 26 May 2023 18:38:14 +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 , Alexandre Ghiti Cc: 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> From: Alexandre Ghiti In-Reply-To: <20230526-clergyman-wriggly-accc659a3fad@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, 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 On 26/05/2023 18:24, Conor Dooley wrote: > On Fri, May 26, 2023 at 05:46:30PM +0200, Alexandre Ghiti wrote: >> Early alternatives are called with the mmu disabled, and then should not >> access any global symbols through the GOT since it requires relocations, >> relocations that we do before but *virtually*. So only use medany code >> model for this early code. >> >> Signed-off-by: Alexandre Ghiti >> --- >> >> Note that I'm not very happy with this fix, I think we need to put more >> effort into "harmonizing" this very early code (ie before the mmu is >> enabled) as it is spread between different locations and compiled >> differently. > Totally & I'll happily spend the time trying to review that work. > >> I'll work on that later, but for now, this fix does what is >> needed to work (from my testing at least). Any Tested-by on the Unmatched >> and T-head boards is welcome! > On 6.4-rc1 & v6.4-rc1 + this patch, with CONFIG_RELOCATABLE added to my > config, my Nezha fails to boot. There is no output whatsoever from the > kernel. Turning off CONFIG_RELOCATABLE boots again. Damn, that's going to ruin my long week-end...Thanks though, I'll try to figure out what's going on, too bad I don't have any thead boards! Thanks again, Alex > I didn't test on my unmatched. > > Thanks, > Conor. > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv