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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 7C0A7CA9EC5 for ; Wed, 30 Oct 2019 15:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4915020679 for ; Wed, 30 Oct 2019 15:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbfJ3PZV (ORCPT ); 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-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@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 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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 27BA6CA9EC5 for ; Wed, 30 Oct 2019 15:25:31 +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 E3FDB20679 for ; Wed, 30 Oct 2019 15:25:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bIxqkfKv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3FDB20679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=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: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DbI5s+3VmVbZbcfZKa89QEvIFGQ4FjNJ4pJwjS22Xao=; b=bIxqkfKvi9NziL xssxFPWe9c1oP0CiHgyxbEVpm65e1CGDQBkKvyggrl7nHp856QBEnkubBDMX51ugvOq1EEjQK6R3O LfyeS0yPCGJKQyaS24w9VWouCoycOvj6Y8HeRF3CTOoelE9Ypcw32EPlvg/yNYALQGjKsno/k4Qvm 9umXDoyeHLYdb7hdePDIDimFwvtiEqtEC0ko9TvWktmbN6JbYyXLiL4e23gzn08YK1TBdywEx7mzj CONIOm2Pi3PQOz7a6y/DxaojHgcDhMvBkbDF2yFKuKMvKoa+9qy5ZgBwu58VXdRfJqVzffPh9+2s4 Cpn8ot2IXnrmiqy7+5xA==; 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 1iPpqe-00057B-DT; Wed, 30 Oct 2019 15:25:24 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPpqa-00056K-Kj for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2019 15:25:22 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191030_082520_821813_627026E3 X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jthierry@redhat.com, linux-parisc@vger.kernel.org, peterz@infradead.org, catalin.marinas@arm.com, deller@gmx.de, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, James.Bottomley@HansenPartnership.com, takahiro.akashi@linaro.org, will@kernel.org, mingo@redhat.com, james.morse@arm.com, jeyu@kernel.org, amit.kachhap@arm.com, svens@stackframe.org, duwe@suse.de, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel