Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp356232ybt; Wed, 8 Jul 2020 01:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI4OlFLxS37qquU1uLKzA2fR3hmla9RCPpvUcVAGqC5o7Aun5TvrwPsSx2LzANrCnKN4Oa X-Received: by 2002:a17:906:c259:: with SMTP id bl25mr50502761ejb.303.1594196907750; Wed, 08 Jul 2020 01:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594196907; cv=none; d=google.com; s=arc-20160816; b=jLb9lzjuYoW+FgnV2cmabqIrJ1ssSUCcVZfgJ9JX5dV7dyWSTXrnutT63zutTqO7S3 /rWlmsvysayScBlozyeR6yKb2jv9cLZqx6IU8IIt2aS1a7XsinXJGkJe/fPFtcK5gnd+ JRbEsuuIOI4uh4OQDuuYGbMUQ2MZ5v/tDeJdEwqdTAluHUMPz8qIn9awKEVSW2Ed6Up0 PqhALuJrBVjCD3/6dlwDIGSOaBLpWeIxStzC0LVU4MKYKxQPJkZD+Lu1YXIXDMVPzWGA 551byEZuU+qrFT0dfCSWe46Xtb1k93h01ENxGC48hKBADbF6Uci65jY7IW6bSFPM49lm JeGQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nvbrPzuC0EcwA27dysqXcD2lzcHMuCzSz8se8JOR9n4=; b=m84hP7LAGUVdOZnpayVUE5GqE54BzoiqtFsJT27zXR5ODdKcQckhtos3DL5jqAB9DX lmfBavGrm3iFGwSsvKezf44Hv8bDfKiboVqzm3RJ8JtTkQSqu4gDwT3QODltJtboNAiq M4cS+1tsEEiRPTAYDYCpRg4TnKWMQxho2HsHG+S7+qqjF3G4F1OjA9FU5VctGea7JajK k4shJUezfBeqPsE7oiZ33uAgFCLKQprE4W8987Id9whA5hbDutdLceCCTcpozpNTssF9 KsSXUASYNxtCydVy1eo90peGUUOjfF6RllsPav1d8xr+NICtkgYsxYGyi3CLNh0NE9RN vuCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BlJsDcsw; 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 h16si16273827ejb.456.2020.07.08.01.28.04; Wed, 08 Jul 2020 01:28:27 -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=BlJsDcsw; 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 S1726751AbgGHIZY (ORCPT + 99 others); Wed, 8 Jul 2020 04:25:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:39426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbgGHIZY (ORCPT ); Wed, 8 Jul 2020 04:25:24 -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 3F569206DF; Wed, 8 Jul 2020 08:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594196724; bh=Xq8WxMIJ5au6LWJ2NQRhkLUVFSQxA8qnihUYmtBcxPs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BlJsDcswX9/ttFiNhIeYMqGOG2dogoSP4jqNED11NqBSEphw9HOf3aL/99QAyTyHU yqGAoiaAsvtFlOmrXDl/U38HYICnNHfFyrrhiQn2zuUOLa7DJfwDB+FZycGYqhyUum JYdMS5qiS4XCx2cAQS8flqRu7Tf8WLi85c9MQODg= Date: Wed, 8 Jul 2020 09:25:20 +0100 From: Will Deacon To: Peng Hao Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ardb@kernel.org Subject: Re: [PATCH] arm64/module-plts: Consider the special case where plt_max_entries is 0 Message-ID: <20200708082519.GA25634@willie-the-truck> References: <20200707114608.24197-1-richard.peng@oppo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707114608.24197-1-richard.peng@oppo.com> 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 [+Ard] On Tue, Jul 07, 2020 at 07:46:08AM -0400, Peng Hao wrote: > If plt_max_entries is 0, a warning is triggered. > WARNING: CPU: 200 PID: 3000 at arch/arm64/kernel/module-plts.c:97 module_emit_plt_entry+0xa4/0x150 Which kernel are you seeing this with? There is a PLT-related change in for-next/core, and I'd like to rule if out if possible. > Signed-off-by: Peng Hao > --- > arch/arm64/kernel/module-plts.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c > index 65b08a74aec6..1868c9ac13f2 100644 > --- a/arch/arm64/kernel/module-plts.c > +++ b/arch/arm64/kernel/module-plts.c > @@ -79,7 +79,8 @@ u64 module_emit_plt_entry(struct module *mod, Elf64_Shdr *sechdrs, > int i = pltsec->plt_num_entries; > int j = i - 1; > u64 val = sym->st_value + rela->r_addend; > - > + if (pltsec->plt_max_entries == 0) > + return 0; Hmm, but if there aren't any PLTs then how do we end up here? Will