From nobody Fri Dec 19 17:37:57 2025 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B89438DD1 for ; Wed, 8 Jan 2025 18:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736362205; cv=none; b=gvhh9SgoD7GybPooDnRFOCGYhucJeB0dTQEcJLHvZ5LuvpHexx8kTMBXI4t6bIqQzIAT2qh7WqbBj1Qw0/1On+mbheC0TvQ4/IF2UkZycfmjixXxRAKLZMBidzNbcNDJ1/TUpb5Y1zpuzaXhsACWhZbdV3YwWK0qnIysiO4W5vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736362205; c=relaxed/simple; bh=PSo2/lOXLdAbBLFI9HqIkBg4P3ojWkalxsjwCFD8bMA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=timlzHgRw4QPodNwhpnrvPOU6Hp0oh1e3EAVmOHBRx7gn0y1QljVB09cjW8FB2lyH+sMf9fa8x36cDJbluHtr9u6orHbfyqj08vx5fgVCeVgUArX41z8tsfzaFY9nxaPOAB0lX6wCyBPjushoaGU7nUZjwr7zm+U/zU6V3UWimc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4YSxZ85Yfyz9sPd; Wed, 8 Jan 2025 19:40:48 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8rVyIxD7aMmT; Wed, 8 Jan 2025 19:40:48 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4YSxZ84hzyz9rvV; Wed, 8 Jan 2025 19:40:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8ADE58B783; Wed, 8 Jan 2025 19:40:48 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id eHaHAVFUYBnZ; Wed, 8 Jan 2025 19:40:48 +0100 (CET) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 15C5B8B768; Wed, 8 Jan 2025 19:40:48 +0100 (CET) From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin , Naveen N Rao , Madhavan Srinivasan Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Arvind Sankar , Kees Cook Subject: [PATCH] powerpc/32: Stop printing Kernel virtual memory layout Date: Wed, 8 Jan 2025 19:40:38 +0100 Message-ID: <430bc8c1f2ff2eb9224b04450e22db472b0b9fa9.1736361630.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736361639; l=2229; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=PSo2/lOXLdAbBLFI9HqIkBg4P3ojWkalxsjwCFD8bMA=; b=5ajoRupaJ2Z0D41DN3Y6Nl2LVCuyWAxqlJ9pw7gIQsHcthgwNdLlAXe+QtNf5T3soHyGeyOFj zgo89m8jH8QCqchHvCOjI4+floJ72g3w4t64BMaduz5kjMeZSng0DpZ X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Printing of Kernel virtual memory layout was added for debug purpose by commit f637a49e507c ("powerpc: Minor cleanups of kernel virt address space definitions") For security reasons, don't display the kernel's virtual memory layout. Other architectures have removed it through following commits. 071929dbdd86 ("arm64: Stop printing the virtual memory layout") 1c31d4e96b8c ("ARM: 8820/1: mm: Stop printing the virtual memory layout") 31833332f798 ("m68k/mm: Stop printing the virtual memory layout") fd8d0ca25631 ("parisc: Hide virtual kernel memory layout") 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory layout") Commit 681ff0181bbf ("x86/mm/init/32: Stop printing the virtual memory layout") thought x86 was the last one, but in reality powerpc/32 still had it. So remove it now on powerpc/32 as well. Cc: Arvind Sankar Cc: Kees Cook Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook --- arch/powerpc/mm/mem.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index c7708c8fad29..34806c858e54 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -319,28 +319,6 @@ void __init mem_init(void) per_cpu(next_tlbcam_idx, smp_processor_id()) =3D (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) - 1; #endif - -#ifdef CONFIG_PPC32 - pr_info("Kernel virtual memory layout:\n"); -#ifdef CONFIG_KASAN - pr_info(" * 0x%08lx..0x%08lx : kasan shadow mem\n", - KASAN_SHADOW_START, KASAN_SHADOW_END); -#endif - pr_info(" * 0x%08lx..0x%08lx : fixmap\n", FIXADDR_START, FIXADDR_TOP); -#ifdef CONFIG_HIGHMEM - pr_info(" * 0x%08lx..0x%08lx : highmem PTEs\n", - PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP)); -#endif /* CONFIG_HIGHMEM */ - if (ioremap_bot !=3D IOREMAP_TOP) - pr_info(" * 0x%08lx..0x%08lx : early ioremap\n", - ioremap_bot, IOREMAP_TOP); - pr_info(" * 0x%08lx..0x%08lx : vmalloc & ioremap\n", - VMALLOC_START, VMALLOC_END); -#ifdef MODULES_VADDR - pr_info(" * 0x%08lx..0x%08lx : modules\n", - MODULES_VADDR, MODULES_END); -#endif -#endif /* CONFIG_PPC32 */ } =20 void free_initmem(void) --=20 2.47.0