All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: David Daney <ddaney.cavm@gmail.com>, <linux-mips@linux-mips.org>,
	<ralf@linux-mips.org>, David Daney <david.daney@cavium.com>,
	<stable@vger.kernel.org>
Subject: Re: MIPS: Make set_pte() SMP safe.
Date: Tue, 4 Aug 2015 13:01:59 -0700	[thread overview]
Message-ID: <55C11A37.5070509@caviumnetworks.com> (raw)
In-Reply-To: <55C10F4B.2050003@imgtec.com>

On 08/04/2015 12:15 PM, Leonid Yegoshin wrote:
> David,
>
> Did you observe this in real?

Yes.  It is not hypothetical.


> The function __get_vm_area_node() allocates a guard page if flag
> VM_NO_GUARD is not used and I don't see any use of it in source.
>
> In past vmap allocated a guard page even unconditionally.

It has nothing to do with guard pages per se.  The problem is if a vmap 
range (including guard page) ends on an even PFN.  The buddy code will 
clobber the PTE for PFN+1.  If another vmap operation is executing in 
set_pte() for the clobbered location, you can get corrupted page tables.


>
> - Leonid.
>

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
	linux-mips@linux-mips.org, ralf@linux-mips.org,
	David Daney <david.daney@cavium.com>,
	stable@vger.kernel.org
Subject: Re: MIPS: Make set_pte() SMP safe.
Date: Tue, 4 Aug 2015 13:01:59 -0700	[thread overview]
Message-ID: <55C11A37.5070509@caviumnetworks.com> (raw)
Message-ID: <20150804200159.8EA4Fd4a08kDhdbWuJYKMJvUUSo2PeUuXKJ8bn_SiLo@z> (raw)
In-Reply-To: <55C10F4B.2050003@imgtec.com>

On 08/04/2015 12:15 PM, Leonid Yegoshin wrote:
> David,
>
> Did you observe this in real?

Yes.  It is not hypothetical.


> The function __get_vm_area_node() allocates a guard page if flag
> VM_NO_GUARD is not used and I don't see any use of it in source.
>
> In past vmap allocated a guard page even unconditionally.

It has nothing to do with guard pages per se.  The problem is if a vmap 
range (including guard page) ends on an even PFN.  The buddy code will 
clobber the PTE for PFN+1.  If another vmap operation is executing in 
set_pte() for the clobbered location, you can get corrupted page tables.


>
> - Leonid.
>

  reply	other threads:[~2015-08-04 20:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  0:48 [PATCH] MIPS: Make set_pte() SMP safe David Daney
2015-08-04  0:48 ` David Daney
2015-08-04 19:15 ` Leonid Yegoshin
2015-08-04 19:15   ` Leonid Yegoshin
2015-08-04 20:01   ` David Daney [this message]
2015-08-04 20:01     ` David Daney
2015-08-04 20:32     ` Leonid Yegoshin
2015-08-04 20:32       ` Leonid Yegoshin
2015-08-04 20:36       ` Leonid Yegoshin
2015-08-04 20:36         ` Leonid Yegoshin
2015-08-04 20:38         ` David Daney
2015-08-04 20:38           ` David Daney
2015-08-04 20:47           ` Leonid Yegoshin
2015-08-04 20:47             ` Leonid Yegoshin
2015-08-04 20:48       ` David Daney
2015-08-04 20:48         ` David Daney
2015-08-04 20:58         ` Leonid Yegoshin
2015-08-04 20:58           ` Leonid Yegoshin
2015-08-24  3:28 ` [PATCH] " Joshua Kinard
  -- strict thread matches above, loose matches on Subject: below --
2015-08-04  0:48 David Daney
2015-08-04  0:48 David Daney
2015-08-04  0:48 David Daney

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=55C11A37.5070509@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=Leonid.Yegoshin@imgtec.com \
    --cc=david.daney@cavium.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=stable@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.