All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Daniel Axtens <dja@axtens.net>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	kasan-dev@googlegroups.com, linux-mm@kvack.org
Subject: [PATCH v9 05/11] powerpc/32: use memset() instead of memset_io() to zero BSS
Date: Fri,  1 Mar 2019 12:33:43 +0000 (UTC)	[thread overview]
Message-ID: <9718764d2702d89df6de6e9607e5e53256f766c1.1551443453.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1551443452.git.christophe.leroy@c-s.fr>

Since commit 400c47d81ca38 ("powerpc32: memset: only use dcbz once cache is
enabled"), memset() can be used before activation of the cache,
so no need to use memset_io() for zeroing the BSS.

Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/early_32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/early_32.c b/arch/powerpc/kernel/early_32.c
index cf3cdd81dc47..3482118ffe76 100644
--- a/arch/powerpc/kernel/early_32.c
+++ b/arch/powerpc/kernel/early_32.c
@@ -21,8 +21,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
 {
 	unsigned long offset = reloc_offset();
 
-	/* First zero the BSS -- use memset_io, some platforms don't have caches on yet */
-	memset_io((void __iomem *)PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
+	/* First zero the BSS */
+	memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
 
 	/*
 	 * Identify the CPU type and fix up code sections
-- 
2.13.3


WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@c-s.fr>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Daniel Axtens <dja@axtens.net>
Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com
Subject: [PATCH v9 05/11] powerpc/32: use memset() instead of memset_io() to zero BSS
Date: Fri,  1 Mar 2019 12:33:43 +0000 (UTC)	[thread overview]
Message-ID: <9718764d2702d89df6de6e9607e5e53256f766c1.1551443453.git.christophe.leroy@c-s.fr> (raw)
In-Reply-To: <cover.1551443452.git.christophe.leroy@c-s.fr>

Since commit 400c47d81ca38 ("powerpc32: memset: only use dcbz once cache is
enabled"), memset() can be used before activation of the cache,
so no need to use memset_io() for zeroing the BSS.

Acked-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/kernel/early_32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/early_32.c b/arch/powerpc/kernel/early_32.c
index cf3cdd81dc47..3482118ffe76 100644
--- a/arch/powerpc/kernel/early_32.c
+++ b/arch/powerpc/kernel/early_32.c
@@ -21,8 +21,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
 {
 	unsigned long offset = reloc_offset();
 
-	/* First zero the BSS -- use memset_io, some platforms don't have caches on yet */
-	memset_io((void __iomem *)PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
+	/* First zero the BSS */
+	memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
 
 	/*
 	 * Identify the CPU type and fix up code sections
-- 
2.13.3


  parent reply	other threads:[~2019-03-01 12:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 12:33 [PATCH v9 00/11] KASAN for powerpc/32 Christophe Leroy
2019-03-01 12:33 ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 01/11] powerpc/32: Move early_init() in a separate file Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 02/11] powerpc: prepare string/mem functions for KASAN Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-04  5:26   ` Daniel Axtens
2019-03-04  5:26     ` Daniel Axtens
2019-03-06 21:54     ` Christophe Leroy
2019-03-06 21:54       ` Christophe Leroy
2019-03-08  3:44       ` Daniel Axtens
2019-03-08  3:44         ` Daniel Axtens
2019-03-07  6:19     ` Christophe Leroy
2019-03-07  6:19       ` Christophe Leroy
2019-03-08  4:49       ` Daniel Axtens
2019-03-08  4:49         ` Daniel Axtens
2019-03-01 12:33 ` [PATCH v9 03/11] powerpc/prom_init: don't use string functions from lib/ Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 04/11] powerpc/mm: don't use direct assignation during early boot Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` Christophe Leroy [this message]
2019-03-01 12:33   ` [PATCH v9 05/11] powerpc/32: use memset() instead of memset_io() to zero BSS Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 06/11] powerpc/32: make KVIRT_TOP dependent on FIXMAP_START Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 07/11] powerpc/32: prepare shadow area for KASAN Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 08/11] powerpc: disable KASAN instrumentation on early/critical files Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 09/11] powerpc/32: Add KASAN support Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 10/11] powerpc/32s: move hash code patching out of MMU_init_hw() Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy
2019-03-01 12:33 ` [PATCH v9 11/11] powerpc/32s: set up an early static hash table for KASAN Christophe Leroy
2019-03-01 12:33   ` Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9718764d2702d89df6de6e9607e5e53256f766c1.1551443453.git.christophe.leroy@c-s.fr \
    --to=christophe.leroy@c-s.fr \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=benh@kernel.crashing.org \
    --cc=dja@axtens.net \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.