linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: LPAE: Invalidate the TLB for module addresses during translation fault
Date: Thu, 23 Feb 2012 19:50:03 +0000	[thread overview]
Message-ID: <20120223195003.GD22562@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1330019981-18743-1-git-send-email-catalin.marinas@arm.com>

On Thu, Feb 23, 2012 at 05:59:41PM +0000, Catalin Marinas wrote:
> During the free_pgtables() call all user and modules/pkmap entries are
> removed.

Err, no.  free_pgtables() should only ever touch up to TASK_SIZE, which
is the maximum size of userspace.  Moreover, because TASK_SIZE does not
cover an entire pud, free_pgtables() should not be removing the pud
table.

> There is a small window between pud_clear() and pmd_free_tlb() in
> free_pmd_range() where the pud entry was cleared but the TLB has not
> been invalidated yet and the CPU may have cached the original (valid)
> pud entry in the TLB. A scenario like below would get stuck in
> continuous prefetch abort:
> 
> 1. Current process exiting. The modules pmd entries not populated
> 2. exit_mmap() -> ... -> pmd_free_tlb()
> 3. pud_clear() for the 1GB pud containing user stack and modules (no TLB
>    invalidation yet)

This is where things are wrong.  Because the request should not be
requesting that the entire pud is being cleared, it should not be
removed from the pgd.

So, there's some debugging to be done here.

  reply	other threads:[~2012-02-23 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 17:59 [PATCH] ARM: LPAE: Invalidate the TLB for module addresses during translation fault Catalin Marinas
2012-02-23 19:50 ` Russell King - ARM Linux [this message]
2012-02-23 22:13   ` Catalin Marinas
2012-02-24  9:58     ` Catalin Marinas
2012-02-24 10:12       ` Russell King - ARM Linux
2012-02-24 11:39         ` Catalin Marinas

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=20120223195003.GD22562@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).