Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1006401ybx; Wed, 30 Oct 2019 08:29:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoPE68GE+DtTravtAViJWG5E/4b31d2ZuQRHm+mgjiNDRHbvzTfbT0hJDoKF7e4RyvsxIV X-Received: by 2002:a17:906:2989:: with SMTP id x9mr72911eje.318.1572449351770; Wed, 30 Oct 2019 08:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572449351; cv=none; d=google.com; s=arc-20160816; b=lcK5/Vu6wu7avETjqZaRRVzE3UJGgH3RJlyM00dvRYHoHa+3e3lv1KkTAIdDTKjWb4 5KOPoM96VHeFygMkrjL3AGPwZ/DFD5oJEsjbBdWbu0OH8AQxHmo+PPJrAkb2nLCSDLie 9KiEy691Y6RkRAMmlFuSf5D9QRdOX8jq8G/F3IGSpO0fngE2w12OMGNmLjG6b7FaI2UR AC+lAHdi0UFdmtz8XwFBQkohOsynyugsWfwj6H42IX4V8EWYyKQvB6wXNKXDt4802vd4 67GVaQkulEU+a5V7P1Tmx8lxZMv3e8f8OFN1YIQrmMerVnRgoSIlbn6iVtH/C/UJ2Jiw BtSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=KIpxAOKSVzSIfZqOc6lW8qiKlhIeR3AbgMHEUr/ULsQ=; b=U7n3lPD3Vi1HXR8fv4DFkWkcDZt68riRT1J3mUZMiqwKUBxDxKbvcAVrHNEbQj+f2k kB9ltb4MXmekRLIkYCNsAvt6+8abm0oQKDp19Y4XC8rJmAVD1uDs45Fv4uq3AXsSqRN3 EDu4GYGxCv5TUM9ebxvAR/yd7ZT64IpOJEVRQ9Znx7BPiRlTrAQ7fK4Wt4qCupzxEPK2 FO4kLp9mTP6kgEdaeHpnWS0CT3g8NLJiAawKVG9Rq7J8A/TIW9wHO7KeC/aRV0QZC4yS VM9q/f1I7WWPFH+aFUC21Y6guFFfpxdFWydsy487G6JFlHHB/0ahsFFjyQs0UkSpPZXn OKnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jr6si1417161ejb.307.2019.10.30.08.28.47; Wed, 30 Oct 2019 08:29:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbfJ3PZV (ORCPT + 99 others); Wed, 30 Oct 2019 11:25:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:56988 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726246AbfJ3PZU (ORCPT ); Wed, 30 Oct 2019 11:25:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2F6B7B1AE; Wed, 30 Oct 2019 15:25:19 +0000 (UTC) Date: Wed, 30 Oct 2019 16:25:17 +0100 (CET) From: Miroslav Benes To: Mark Rutland cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, amit.kachhap@arm.com, catalin.marinas@arm.com, deller@gmx.de, duwe@suse.de, James.Bottomley@HansenPartnership.com, james.morse@arm.com, jeyu@kernel.org, jpoimboe@redhat.com, jthierry@redhat.com, linux-parisc@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, svens@stackframe.org, takahiro.akashi@linaro.org, will@kernel.org Subject: Re: [PATCHv2 3/8] arm64: module: rework special section handling In-Reply-To: <20191029165832.33606-4-mark.rutland@arm.com> Message-ID: References: <20191029165832.33606-1-mark.rutland@arm.com> <20191029165832.33606-4-mark.rutland@arm.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Oct 2019, Mark Rutland wrote: > When we load a module, we have to perform some special work for a couple > of named sections. To do this, we iterate over all of the module's > sections, and perform work for each section we recognize. > > To make it easier to handle the unexpected absence of a section, and to > make the section-specific logic easer to read, let's factor the section s/easer/easier/ > search into a helper. Similar is already done in the core module loader, > and other architectures (and ideally we'd unify these in future). > > If we expect a module to have an ftrace trampoline section, but it > doesn't have one, we'll now reject loading the module. When > ARM64_MODULE_PLTS is selected, any correctly built module should have > one (and this is assumed by arm64's ftrace PLT code) and the absence of > such a section implies something has gone wrong at build time. > > Subsequent patches will make use of the new helper. > > Signed-off-by: Mark Rutland > Reviewed-by: Ard Biesheuvel > Cc: Catalin Marinas > Cc: James Morse > Cc: Will Deacon Reviewed-by: Miroslav Benes M