linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/2] arm64: Mark kernel page ranges contiguous
Date: Wed, 16 Mar 2016 18:20:26 +0000	[thread overview]
Message-ID: <20160316182025.GD13423@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <20160226172825.GK29125@arm.com>

On Fri, Feb 26, 2016 at 05:28:26PM +0000, Will Deacon wrote:
> On Thu, Feb 25, 2016 at 02:46:54PM -0600, Jeremy Linton wrote:
> > On 02/25/2016 10:16 AM, Will Deacon wrote:
> > >On Fri, Feb 19, 2016 at 11:46:23AM -0600, Jeremy Linton wrote:
> > >>+static void clear_cont_pte_range(pte_t *pte, unsigned long addr)
> > >>+{
> > >>+	int i;
> > >>+
> > >>+	pte -= CONT_RANGE_OFFSET(addr);
> > >>+	for (i = 0; i < CONT_PTES; i++) {
> > >>+		if (pte_cont(*pte))
> > >>+			set_pte(pte, pte_mknoncont(*pte));
> > >>+		pte++;
> > >>+	}
> > >>+	flush_tlb_all();
> > >
> > >Do you still need this invalidation? I thought the table weren't even
> > >live at this point?
> > 
> > Well it continues to match the calls in alloc_init_p*.
> 
> Ok, but if it's not needed (and I don't think it is), then we should
> remove the invalidation from there too rather than add more of it.

I agree. Talking to Mark R, I think all the create_pgd_mapping code
should be trimmed of p*d splitting entirely (with some warnings left in
place).

The efi_create_mapping() case is done on efi_mm anyway with a low
address and non-active TTBR0_EL1. As Mark suggested, dropping p*d
splitting should work for this case as well by ignoring the next
consecutive mapping if it overlaps since it's a linear mapping (possibly
some permissions may need to be upgraded). In this case, the TLBI would
be done by efi_create_mapping() or even skipped altogether assuming that
no page tables are changed (only going from invalid to valid).

My preference, however, would be for efi_create_mapping() should use a
different mechanism from create_pgd_mapping (aimed at very early memmap)
like remap_pfn_range() but I haven't looked in detail on whether this is
feasible.

Once we have this clean-up in place, we can rebase the contiguous PTE
patches on top and remove unnecessary TLBI.

-- 
Catalin

      reply	other threads:[~2016-03-16 18:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 17:46 [PATCH v3 0/2] flag contiguous PTEs in linear mapping Jeremy Linton
2016-02-19 17:46 ` [PATCH v3 1/2] arm64: mm: Enable CONT_SIZE aligned sections for 64k page kernels Jeremy Linton
2016-02-19 17:46 ` [PATCH v3 2/2] arm64: Mark kernel page ranges contiguous Jeremy Linton
2016-02-22 10:28   ` Ard Biesheuvel
2016-02-22 15:39     ` Jeremy Linton
2016-02-25 16:16   ` Will Deacon
2016-02-25 20:46     ` Jeremy Linton
2016-02-26 17:28       ` Will Deacon
2016-03-16 18:20         ` Catalin Marinas [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=20160316182025.GD13423@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).