From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A38BC33C9E for ; Sat, 1 Feb 2020 14:00:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BD51206E6 for ; Sat, 1 Feb 2020 14:00:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bQV/xhhj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BD51206E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0mToehhGWSPNzAcDeyjSJ9nVB9OAXAWF1CiAKptCd+w=; b=bQV/xhhj8q/gjm w3SLKVhtnlLjE5dXVAsKsMa3YzbxRXPRYAokHnNSK4poYb2wojMTunP2ornHlS5m0M5T8srmSqnSj 7FYIV2aB3ZidaZz/Qtv6+atJgQ7caKDl9VSvQeguvx4noIkeGIUBrYZB7YQJPS97QsZSIhaZgYmkC XrFnrn5BSaEy1qU1qdT2NLFeUoo1KxmKpW6hPMXGRNWpyTjAU+EFxTfMk9fHf7dIa9zlnlH1AYzKH pk5IhB+5bMV1TCKxHVqidm/fCHitLpzYlj9EKf8AGuMabvVQQJ5VUSmL9rRJW7dSDv1bNimuYNq8Q yM62L5tYsGGgf2be8cfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixtJj-0003Mx-Rw; Sat, 01 Feb 2020 14:00:11 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixtJg-0002EI-Ak for linux-riscv@lists.infradead.org; Sat, 01 Feb 2020 14:00:10 +0000 X-Originating-IP: 79.86.19.127 Received: from [192.168.0.12] (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 1AC8F20006; Sat, 1 Feb 2020 13:59:49 +0000 (UTC) Subject: Re: Error on loading some network Kernel modules To: Anup Patel , Aurelien Jarno References: <20200131201118.GA4121429@aurel32.net> From: Alex Ghiti Message-ID: Date: Sat, 1 Feb 2020 08:59:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200201_060008_511898_C84802FE X-CRM114-Status: GOOD ( 18.23 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Eduardo de Paula , David Abdurachmanov , Paul Walmsley , Vincent Chen , Romain Dolbeau , linux-riscv Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On 2/1/20 2:52 AM, Anup Patel wrote: > On Sat, Feb 1, 2020 at 1:41 AM Aurelien Jarno wrote: >> On 2020-01-30 17:20, David Abdurachmanov wrote: >>> On Thu, Jan 30, 2020 at 4:00 AM Paul Walmsley wrote: >>>> On Tue, 28 Jan 2020, Carlos Eduardo de Paula wrote: >>>> >>>>> I currently run stock Kernel 5.5.0-rc7 on my Unleashed board with most >>>>> network features I need baked into the kernel instead of modules. >>>>> >>>>> I tried building a kernel with these network features as modules but >>>>> when loading some of them I got this error: >>>>> >>>>> root@unleashed:~# uname -a >>>>> Linux unleashed 5.5.0-rc7-dirty #4 SMP Fri Jan 24 18:16:43 -02 2020 >>>>> riscv64 GNU/Linux >>>>> >>>>> root@unleashed:~# modprobe br_netfilter >>>>> [ 139.290533] br_netfilter: target ffffffe0000422d8 can not be >>>>> addressed by the 32-bit offset from PC = 000000003dfd6deb >>>> This is a known issue: >>>> >>>> https://lore.kernel.org/linux-riscv/1572281840733.3517@european-processor-initiative.eu/ >>>> >>>> https://lore.kernel.org/linux-riscv/20191029105055.GA20736@aurel32.net/#r >>>> >>>> Vincent is looking into it and I expect there will be a fix soon. >>>> >>> Is this patch solving the problem? >>> >>> https://github.com/bjoto/linux/commit/8a56d1c8e8e91c1bc3893946d52b9217c96e1589 >> I have just tried that patch on top of a 5.4.13 kernel, and I confirm it >> fixes the issue. Thanks! > I guess this patch was lost over time. > > First of all we need to rebase this patch on latest kernel. > > The MODULES_xyz defines are totally redundant and create > confusion because with these defines it seems we are creating > separate virtual memory region for modules which is not true. > In fact, the patch only tries to ensure that modules are allocated > from the end-of VMALLOC region. > > I suggest to drop all MODULES_xyz defines and implement > module_alloc() as follows: > > void *module_alloc(unsigned long size) > { > return __vmalloc_node_range(size, 1, VMALLOC_END - SZ_128M, > VMALLOC_END, GFP_KERNEL, > PAGE_KERNEL_EXEC, 0, > NUMA_NO_NODE, > __builtin_return_address(0)); > } Why restrict to 128M whereas we have 2GB offset available to the end of the kernel ? I think the cleanest solution is to use the following range [&_end - 2 * SZ_1G; VMALLOC_END]. Alex > Maybe we can even have a kconfig options for MODULES_SIZE > which can be used in-place of SZ_128M in above code. > > Should I send a patch on latest kernel ?? > > Regards, > Anup >