Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp166818pxa; Fri, 21 Aug 2020 04:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAL7dJCeYq4/VRh47z1b/BtRBv8Yzc3a5B4HBlBu0Yl3bmwudswFAxGg/HKWsa7Sjm2VJS X-Received: by 2002:a50:c3c4:: with SMTP id i4mr2306456edf.244.1598008784827; Fri, 21 Aug 2020 04:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598008784; cv=none; d=google.com; s=arc-20160816; b=cT36+Lv4jcMrdg5bJm4IVzvBOry1txOoQbK398RyZCX42sg9AL4f3pSCPJapJnVNmX Np0bNEPtrHLskEzIFsZSNh98J32kRrOFhA0Nmmx2ovVRdxES8KRTTjuDHgZKCu5Bohnx rFAcJuCKlmX+Gr26grbHLFcu3l6dZqCenRdwzcyvnvKG53YAy14aIYjlMBVzBfbdBWRB VWP9Jjk534qtaUbFRGE6vCelNYwvnaiQPndOaAjhjBjFJ8sYRWIbTh0S9iz4b9ZfhDY8 neE7ULnR6sued9LJyR8tXxBtc74R1kYF5D7Xx7xn6WZWeSHingKbGFGFCHOvTdSYbiow KMJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C7vQlv0q4PJbYwWsJd/1SDmIiCI8gtzanilofMZYda8=; b=gYgNQHQU0thidzBkBMtzitASLXtLlgFqsRWxavC1FWZ5ESw8Qd8UK8wFl4nXa+qNJf hwIoxvsb55Sx/56E0b6bfcD+N7+spmujCmZLLsx6NvRn/ZuVBjdfu5SFW7lGKOeeMPVw BlpjwfC0B7Ajqj7JBt3/ZWWskBJyq0dhBkWxEuXrC5y6R09EY3Xz/AjmrBEUac6b840N qUTceFQ20nDA0Oxq+tJW0Jq88CXf2YEntc6T+wmc7Np4O+aolP4FnT2/bXH/NKmPliiV BoHSYgbG8E0YO9pJTOyJ+PrdnzlY/7DITJvLem0NYHE53HHVieDnIYxPouv1lpyT7rfM wO0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q1IE6xSe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si140695ejz.594.2020.08.21.04.19.21; Fri, 21 Aug 2020 04:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q1IE6xSe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727899AbgHULRU (ORCPT + 99 others); Fri, 21 Aug 2020 07:17:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:60704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727106AbgHULRJ (ORCPT ); Fri, 21 Aug 2020 07:17:09 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 123242072D; Fri, 21 Aug 2020 11:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598008625; bh=wsJMHwvewGqUDJUzfhs5P78BW+2XX/LSgMLqfV+VlNU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q1IE6xSeHH5Qh4LS4LHPTCqSPoACbXLs5TwLnZEEz4/ynQT366k5uktdoAx0PGG76 jxlPILGfjRQeQhbcnHXVrU1mr1HBImxWeVJgBW/H7o4VaUeE1vEEygTAurYAd57uXD mJ48mvCjCcRNArwcBxp2xnDg1+q21PntwfyMNWbA= Date: Fri, 21 Aug 2020 12:17:01 +0100 From: Will Deacon To: =?utf-8?B?5b2t5rWpKFJpY2hhcmQp?= Cc: Ard Biesheuvel , "catalin.marinas@arm.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] arm64/module-plts: Consider the special case where plt_max_entries is 0 Message-ID: <20200821111700.GD20455@willie-the-truck> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 08:48:11AM +0000, 彭浩(Richard) wrote: > On Thu, Jul 09, 2020 at 07:18:01AM +0000,Peng Hao(Richard) wrote: > > On Thu, 9 Jul 2020 at 09:50, Peng Hao(Richard) wrote: > > >> >Apparently, you are hitting a R_AARCH64_JUMP26 or R_AARCH64_CALL26 > > >> >relocation that operates on a b or bl instruction that is more than > > >> >128 megabytes away from its target. > > >> > > > >> My understanding is that a module that calls functions that are not part of the module will use PLT. > > >> Plt_max_entries =0 May occur if a module does not depend on other module functions. > > >> > > > > > >A PLT slot is allocated for each b or bl instruction that refers to a > > >symbol that lives in a different section, either of the same module > > > (e.g., bl in .init calling into .text), of another module, or of the > > >core kernel. > > > > > >I don't see how you end up with plt_max_entries in this case, though. > > if a module does not depend on other module functions, PLT entries in the module is equal to 0. > > >This brings me back to my earlier question: if there are no PLT entries in > >the module, then count_plts() will not find any R_AARCH64_JUMP26 or > >R_AARCH64_CALL26 relocations that require PLTs and will therefore return 0. > >The absence of these relocations means that module_emit_plt_entry() will not > >be called by apply_relocate_add(), and so your patch should have no effect. > 1.The module in question is the calling function from core kernel.( Ib_core.ko triggered the warning multiple times). > 2. There are multiple threads loading IB_core.ko > [ 73.388931] ###cpu=33, name=ib_core, core_plts=0, init_plts=0 > [ 73.402102] #### cpu=33,pid=2297,name=ib_core, module_emit_plt_entry:plt_num_entries=1, plt_max_entries=0 (warning) > [ 73.439391] ###cpu=24, name=ib_core, core_plts=0, init_plts=0 > [ 73.448617] ###cpu=4, name=ib_core, core_plts=0, init_plts=0 > [ 73.547535] ###cpu=221, name=ib_core, core_plts=0, init_plts=0 > [ 75.198075] #### cpu=24,pid=2336,name=ib_core, module_emit_plt_entry:plt_num_entries=1, plt_max_entries=0 (warning) > [ 75.489496] #### cpu=4,pid=2344,name=ib_core, module_emit_plt_entry:plt_num_entries=1, plt_max_entries=0(warning) > > I don't understand why count_plts returns 0 when CONFIG_RANDOMIZE_BASE=n for R_AARCH64_JUMP26 and R_AARCH64_CALL26. > > 3. Set CONFIG_ARM64_MODULE_PLTS=y and restart the server several times without triggering this warning. Can you provide a means for us to reproduce this failure with an upstream kernel, please? I really can't tell what's going on from the report. If I can reproduce the problem locally, then I'm happy to take a look. Thanks, Will