All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
	Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 3/3] MIPS: mm: adjust PKMAP location
Date: Tue, 11 Apr 2017 12:49:05 +0300	[thread overview]
Message-ID: <0e5c3c4d-abfb-25bb-cb2d-c27448283353@cogentembedded.com> (raw)
In-Reply-To: <1491894036-5440-4-git-send-email-marcin.nowakowski@imgtec.com>

Hello!

On 4/11/2017 10:00 AM, Marcin Nowakowski wrote:

> Space reserved for PKMap should span from PKMAP_BASE to FIXADDR_START.
> For large page sizes this is not the case as eg. for 64k pages the range
> currently defined is from 0xfe000000 to 0x102000000(!!) which obviously
> isn't right.
> Remove the hardcoded location and set the BASE address as an offset from
> FIXADDR_START.
>
> Since all PKMAP ptes have to be placed in a contiguous memory, ensure

    PTEs?

> that this is the case by placing them all in a single page. This is
> achieved by aligning the end address to pkmap pages count pages.
>
> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
> ---
>  arch/mips/include/asm/pgtable-32.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h
> index 6f94bed..74afe8c 100644
> --- a/arch/mips/include/asm/pgtable-32.h
> +++ b/arch/mips/include/asm/pgtable-32.h
> @@ -19,6 +19,10 @@
>  #define __ARCH_USE_5LEVEL_HACK
>  #include <asm-generic/pgtable-nopmd.h>
>
> +#ifdef CONFIG_HIGHMEM
> +#include <asm/highmem.h>
> +#endif
> +
>  extern int temp_tlb_entry;
>
>  /*
> @@ -62,7 +66,8 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
>
>  #define VMALLOC_START	  MAP_BASE
>
> -#define PKMAP_BASE		(0xfe000000UL)
> +#define PKMAP_END	((FIXADDR_START) & ~((LAST_PKMAP << PAGE_SHIFT)-1))

    Why parens around FIXADDR_START?
    Also could you be consistent and add spaces around - too?

> +#define PKMAP_BASE	(PKMAP_END - PAGE_SIZE * LAST_PKMAP)
>
>  #ifdef CONFIG_HIGHMEM
>  # define VMALLOC_END	(PKMAP_BASE-2*PAGE_SIZE)

MBR, Sergei

      reply	other threads:[~2017-04-11  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  7:00 [PATCH 0/3] mips highmem fixes Marcin Nowakowski
2017-04-11  7:00 ` Marcin Nowakowski
2017-04-11  7:00 ` [PATCH 1/3] MIPS: mm: fixed mappings: correct initialisation Marcin Nowakowski
2017-04-11  7:00   ` Marcin Nowakowski
2017-04-11  7:00 ` [PATCH 2/3] MIPS: highmem: ensure that we don't use more than one page for PTEs Marcin Nowakowski
2017-04-11  7:00   ` Marcin Nowakowski
2017-04-11  7:00 ` [PATCH 3/3] MIPS: mm: adjust PKMAP location Marcin Nowakowski
2017-04-11  7:00   ` Marcin Nowakowski
2017-04-11  9:49   ` Sergei Shtylyov [this message]

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=0e5c3c4d-abfb-25bb-cb2d-c27448283353@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-mips@linux-mips.org \
    --cc=marcin.nowakowski@imgtec.com \
    --cc=ralf@linux-mips.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.