From: Hugh Dickins <hugh@veritas.com>
To: Andi Kleen <ak@suse.de>
Cc: Dave Jones <davej@redhat.com>,
"Sergey S. Kostyliov" <rathamahata@ehouse.ru>,
Clem Taylor <clem.taylor@gmail.com>,
Chris Wright <chrisw@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: x86-64 bad pmds in 2.6.11.6
Date: Thu, 14 Apr 2005 18:34:58 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.61.0504141804480.26008@goblin.wat.veritas.com> (raw)
In-Reply-To: <20050414170117.GD22573@wotan.suse.de>
On Thu, 14 Apr 2005, Andi Kleen wrote:
>
> Thanks for the analysis. However I doubt the load_cr3 patch can fix
> it. All it does is to stop the CPU from prefetching mappings (which
> can cause different problem).
I thought that the leave_mm code (before your patch) flushes the TLB, but
restores cr3 to the mm, while removing that cpu from the mm's cpu_vm_mask.
So any speculation, not just prefetching, on that cpu is in danger of
bringing address translations according to that mm back into the TLB.
But when the mm is torn down in exit_mmap, there's no longer any record
that the TLB on that cpu needs flushing, so stale translations remain.
As a rule, we always flush TLB _after_ invalidating, not just before,
for this kind of reason.
My paranoia of speculation may be excessive: I _think_ what I outline
above is a real possibility on Intel, but you and others know AMD much
better than I (and the reports I've seen are on AMD64, not EM64T).
> But the Linux code who does bad pmd checks
> never looks at CR3 anyways, it always uses the current->mm. If
> bad pmd sees a bad page it must be still in the page tables of the MM,
> not a stable TLB entry.
Sure, the "mm/memory.c:97: bad pmd" messages are coming from
clear_pmd_range, when the corrupted task exits later (but probably
not much later, since its user stack is oddly distributed across
two different pages: some mentioned SIGSEGVs I think).
The pmd really is bad, but it got to be bad because it had stack data
written into it by create_elf_tables, when the TLB mistakenly thought
it already knew what physical page 0x00007ffffffff000 was mapped to
(prior kernel accesses to that user stack are not by user address).
Hugh
next prev parent reply other threads:[~2005-04-14 17:35 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-30 21:44 Dave Jones
2005-03-31 10:41 ` Andi Kleen
2005-03-31 21:52 ` Dave Jones
2005-04-01 11:52 ` Sergey S. Kostyliov
2005-04-07 2:49 ` Dave Jones
2005-04-07 6:29 ` Andi Kleen
2005-04-14 13:54 ` Hugh Dickins
2005-04-14 17:01 ` Andi Kleen
2005-04-14 17:34 ` Hugh Dickins [this message]
2005-04-14 18:10 ` Andi Kleen
2005-04-14 18:11 ` x86-64 bad pmds in 2.6.11.6 II Andi Kleen
2005-04-14 18:27 ` Chris Wright
2005-04-15 17:24 ` Andi Kleen
2005-04-15 17:28 ` Chris Wright
2005-04-15 17:58 ` Hugh Dickins
2005-04-15 18:07 ` Dave Jones
2005-04-22 17:37 ` Debugging patch was " Andi Kleen
2005-04-27 14:23 ` New debugging " Andi Kleen
2005-04-27 17:37 ` Dave Jones
2005-04-29 11:07 ` Hans Kristian Rosbach
2005-04-19 13:35 ` Andi Kleen
2005-04-19 15:52 ` Hugh Dickins
2005-04-29 11:12 ` Christopher Warner
2005-04-29 16:13 ` Chris Wright
2005-04-29 17:32 ` Dave Jones
2005-05-02 17:00 ` Andi Kleen
2005-05-02 15:28 ` Christopher Warner
2005-05-02 20:33 ` Chris Wright
2005-05-02 21:08 ` Dave Jones
2005-05-03 14:28 ` Andi Kleen
2005-05-03 15:15 ` Dave Jones
2005-05-10 9:36 ` Christopher Warner
2005-05-10 16:26 ` Chris Wright
2005-05-10 12:03 ` Christopher Warner
2005-05-10 16:38 ` Dave Jones
2005-05-10 16:46 ` Andi Kleen
2005-05-10 16:59 ` Dave Jones
2005-05-10 20:32 ` Andi Kleen
2005-05-10 20:43 ` Chris Wright
2005-05-12 21:23 ` Andi Kleen
2005-05-13 21:51 ` Peter J. Stieber
2005-05-14 17:29 ` Peter J. Stieber
2005-04-08 16:33 x86-64 bad pmds in 2.6.11.6 Clem Taylor
2005-08-08 16:55 Andy Davidson
2005-09-20 17:12 Charles McCreary
2005-09-20 17:30 ` Linus Torvalds
2005-09-20 19:44 ` Chris Wedgwood
2005-09-20 23:23 ` Dave Jones
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=Pine.LNX.4.61.0504141804480.26008@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=ak@suse.de \
--cc=chrisw@osdl.org \
--cc=clem.taylor@gmail.com \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rathamahata@ehouse.ru \
/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
all inboxes | Powered by JetHome®