Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4832158ybl; Mon, 13 Jan 2020 22:03:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzprNFCs6Jg8QbUhuapiBRN4i9ervnez1/BrsvruxHoWBrmb3Et3xsp1oQXYt+oubhuFcnx X-Received: by 2002:aca:cd92:: with SMTP id d140mr15135210oig.68.1578981781261; Mon, 13 Jan 2020 22:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578981781; cv=none; d=google.com; s=arc-20160816; b=oGsFuzjfyp78z6cku3AZ3kqUb0ykmlDKCyOwTSf0y5Hu64o0tG5swErm6+3L+C4ywT ahk3ivBjM2NyZbR4yatA4RR9blU9E7T7SN+1cuswdFPlIXk5/fDCTT9DVp+uIxJM911n BFMcf5sp0NQ9UqqVuM2kP90RJbWncQzz3B8KPpsKegDG34l0DyLqUrd+i/zdEra5uEDK XyLrUB0h+b8zqyZVDZb/XlreGD7KklJofz28rWVJIv0g7NaOQTcUP4aWuO814uWeGvE1 0Bap7q3Fyg+7z2KjsKrUUXjc+kO8dyX6uJ5axuSAyH4hYYi2smij2Zh+6DUWcwxsHOoO hcNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=vdxzvfVoP07Rsjq+uKFqtnwzeRwNxhQVZy8XUveg81Y=; b=Qor1QG2bZcij813L/6hTcqTK7NoYzbmcMYQi398qXXbhaxAeUqK/jRRjQKe9x5YIyg Mb8jQL82UWQT+CfuH0DCSz4tI5+2v1VdamQSeevxoCUjiStbSyfyS2GLoLTtiwvoU6Qc t7uGODi19Ehgyexi9xUjh75dGtDtKdN85h7DD0bajUvW8sHS4H3ItbM2bs+HcPjiYPzM bPgnC3nRnSO/OuxqFd7zrNlYV73Q6J2CP7awaqO7fOtnzD0VHiIULqvnqkF5zikSxiaD 1vbKAsDUo2d/XGIyoO18qPlbCMYB5xKPoZqvsWvsUUTRrM7lCaxyq7jE3bhEc2LjIAuo M3QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=VeacHFBr; 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 g126si6851608oif.106.2020.01.13.22.02.48; Mon, 13 Jan 2020 22:03:01 -0800 (PST) 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; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=VeacHFBr; 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 S1727072AbgANGBL (ORCPT + 99 others); Tue, 14 Jan 2020 01:01:11 -0500 Received: from ozlabs.org ([203.11.71.1]:57653 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbgANGBL (ORCPT ); Tue, 14 Jan 2020 01:01:11 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 47xfw44QqWz9s29; Tue, 14 Jan 2020 17:01:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1578981669; bh=ALUqYMWpSbT7KFgjzz53QbyoSg0qLp1ykpVazbFizZs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VeacHFBr9aPVdYAUvzFeq7NcHKql1k4vcG9bAmkdkP0pLZT7B8j9hNg3y/L2RIj9z BDaQF4D7aqE14D9Thn18l0FaoUHV0MaHWCuzMCISlSlohqUG5aJmgPaqSUHFG5pZDH FtazzpjNGDaGyyQQo9DBN6op1Tr8bmfsN1XPWXeUYzy93mOdMhtt1HwSzVUM1om7au CC3fquYcjZWeqzToqCOweP0/3oRjXtSeSnhe0mK50gFHFLqurE3ZpFfKwqaTm2/OG0 2rOZERZDdudk46PoAypvGV0rRE7BUMwHg1S7rOqLB/nkd1kf9uT10bWmc1AQBFFHvh UMMy2sUoIk97A== From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/ptdump: don't entirely rebuild kernel when selecting CONFIG_PPC_DEBUG_WX In-Reply-To: <176774c19b0398634e004835b9515c93030d326f.1578645835.git.christophe.leroy@c-s.fr> References: <176774c19b0398634e004835b9515c93030d326f.1578645835.git.christophe.leroy@c-s.fr> Date: Tue, 14 Jan 2020 16:01:10 +1000 Message-ID: <87muaqa861.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Selecting CONFIG_PPC_DEBUG_WX only impacts ptdump and pgtable_32/64 > init calls. Declaring related functions in asm/pgtable.h implies > rebuilding almost everything. > > Move ptdump_check_wx() declaration in a new dedicated header file. Can you put it in arch/powerpc/mm/mmu_decl.h ? That already exists for things that are private to arch/powerpc/mm, which this function is AFAICT. cheers > arch/powerpc/include/asm/pgtable.h | 6 ------ > arch/powerpc/include/asm/ptdump.h | 15 +++++++++++++++ > arch/powerpc/mm/pgtable_32.c | 1 + > arch/powerpc/mm/pgtable_64.c | 1 + > arch/powerpc/mm/ptdump/ptdump.c | 1 + > 5 files changed, 18 insertions(+), 6 deletions(-) > create mode 100644 arch/powerpc/include/asm/ptdump.h > > diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h > index 0e4ec8cc37b7..8cc543ed114c 100644 > --- a/arch/powerpc/include/asm/pgtable.h > +++ b/arch/powerpc/include/asm/pgtable.h > @@ -94,12 +94,6 @@ void mark_initmem_nx(void); > static inline void mark_initmem_nx(void) { } > #endif > > -#ifdef CONFIG_PPC_DEBUG_WX > -void ptdump_check_wx(void); > -#else > -static inline void ptdump_check_wx(void) { } > -#endif > - > /* > * When used, PTE_FRAG_NR is defined in subarch pgtable.h > * so we are sure it is included when arriving here. > diff --git a/arch/powerpc/include/asm/ptdump.h b/arch/powerpc/include/asm/ptdump.h > new file mode 100644 > index 000000000000..246b92c21729 > --- /dev/null > +++ b/arch/powerpc/include/asm/ptdump.h > @@ -0,0 +1,15 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _ASM_POWERPC_PTDUMP_H > +#define _ASM_POWERPC_PTDUMP_H > + > +#ifndef __ASSEMBLY__ > + > +#ifdef CONFIG_PPC_DEBUG_WX > +void ptdump_check_wx(void); > +#else > +static inline void ptdump_check_wx(void) { } > +#endif > + > +#endif /* __ASSEMBLY__ */ > + > +#endif /* _ASM_POWERPC_PTDUMP_H */ > diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c > index 73b84166d06a..6c866f1b1eeb 100644 > --- a/arch/powerpc/mm/pgtable_32.c > +++ b/arch/powerpc/mm/pgtable_32.c > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > > #include > > diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c > index e78832dce7bb..3686cd887c2f 100644 > --- a/arch/powerpc/mm/pgtable_64.c > +++ b/arch/powerpc/mm/pgtable_64.c > @@ -45,6 +45,7 @@ > #include > #include > #include > +#include > > #include > > diff --git a/arch/powerpc/mm/ptdump/ptdump.c b/arch/powerpc/mm/ptdump/ptdump.c > index 2f9ddc29c535..d7b02bcd0691 100644 > --- a/arch/powerpc/mm/ptdump/ptdump.c > +++ b/arch/powerpc/mm/ptdump/ptdump.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include "ptdump.h" > > -- > 2.13.3