From: Mike Rapoport <rppt@linux.ibm.com>
To: Andreas Larsson <andreas@gaisler.com>
Cc: David Miller <davem@davemloft.net>,
sparclinux@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
linux-kernel@vger.kernel.org, software@gaisler.com
Subject: Re: [PATCH] sparc32: Limit memblock allocation to low memory
Date: Thu, 04 Feb 2021 17:19:27 +0000 [thread overview]
Message-ID: <20210204171927.GK299309@linux.ibm.com> (raw)
In-Reply-To: <20210204162053.3954-1-andreas@gaisler.com>
On Thu, Feb 04, 2021 at 05:20:53PM +0100, Andreas Larsson wrote:
> Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use
> memblocks instead of bootmem, but also made high memory available via
> memblock allocation which does work together with e.g. phys_to_virt and
> leads to crashes.
>
> This changes back to only low memory being allocatable in the early
> stages, now using memblock allocation.
>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> arch/sparc/mm/init_32.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
> index eb2946b1df8a..6139c5700ccc 100644
> --- a/arch/sparc/mm/init_32.c
> +++ b/arch/sparc/mm/init_32.c
> @@ -197,6 +197,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
> size = memblock_phys_mem_size() - memblock_reserved_size();
> *pages_avail = (size >> PAGE_SHIFT) - high_pages;
>
> + /* Only allow low memory to be allocated via memblock allocation */
> + memblock_set_current_limit(max_low_pfn << PAGE_SHIFT);
> +
> return max_pfn;
> }
>
> --
> 2.17.1
>
--
Sincerely yours,
Mike.
WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@linux.ibm.com>
To: Andreas Larsson <andreas@gaisler.com>
Cc: David Miller <davem@davemloft.net>,
sparclinux@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
linux-kernel@vger.kernel.org, software@gaisler.com
Subject: Re: [PATCH] sparc32: Limit memblock allocation to low memory
Date: Thu, 4 Feb 2021 19:19:27 +0200 [thread overview]
Message-ID: <20210204171927.GK299309@linux.ibm.com> (raw)
In-Reply-To: <20210204162053.3954-1-andreas@gaisler.com>
On Thu, Feb 04, 2021 at 05:20:53PM +0100, Andreas Larsson wrote:
> Commit cca079ef8ac29a7c02192d2bad2ffe4c0c5ffdd0 changed sparc32 to use
> memblocks instead of bootmem, but also made high memory available via
> memblock allocation which does work together with e.g. phys_to_virt and
> leads to crashes.
>
> This changes back to only low memory being allocatable in the early
> stages, now using memblock allocation.
>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> arch/sparc/mm/init_32.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
> index eb2946b1df8a..6139c5700ccc 100644
> --- a/arch/sparc/mm/init_32.c
> +++ b/arch/sparc/mm/init_32.c
> @@ -197,6 +197,9 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
> size = memblock_phys_mem_size() - memblock_reserved_size();
> *pages_avail = (size >> PAGE_SHIFT) - high_pages;
>
> + /* Only allow low memory to be allocated via memblock allocation */
> + memblock_set_current_limit(max_low_pfn << PAGE_SHIFT);
> +
> return max_pfn;
> }
>
> --
> 2.17.1
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2021-02-04 17:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 16:20 [PATCH] sparc32: Limit memblock allocation to low memory Andreas Larsson
2021-02-04 16:20 ` Andreas Larsson
2021-02-04 17:19 ` Mike Rapoport [this message]
2021-02-04 17:19 ` Mike Rapoport
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=20210204171927.GK299309@linux.ibm.com \
--to=rppt@linux.ibm.com \
--cc=andreas@gaisler.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=software@gaisler.com \
--cc=sparclinux@vger.kernel.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.