From: Andrea Arcangeli <andrea@suse.de>
To: Martin Dalecki <dalecki@evision-ventures.com>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: Q: backport of the free_pgtables tlb fixes to 2.4
Date: Thu, 23 May 2002 23:15:37 +0200 [thread overview]
Message-ID: <20020523211537.GA21164@dualathlon.random> (raw)
In-Reply-To: <20020523195757.GW21164@dualathlon.random> <Pine.LNX.4.33.0205231300530.4338-100000@penguin.transmeta.com> <20020523204101.GY21164@dualathlon.random> <3CED48C8.80406@evision-ventures.com>
On Thu, May 23, 2002 at 09:53:44PM +0200, Martin Dalecki wrote:
> Uz.ytkownik Andrea Arcangeli napisa?:
>
> >What I don't understand is how the BTB can invoke random userspace tlb
> >fills when we are running do_munmap, there's no point at all in doing
> >that. If the cpu see a read of an user address after invalidate_tlb,
> >the tlb must not be started because it's before an invalidate_tlb.
> >
> >And if it's true not even irq are barriers for the tlb fills invoked by
> >this p4-BTB thing, so if leave_mm is really necessary, then 2.5 is as
> >well wrong in UP, because the pagetable can be scribbled by irqs in a UP
> >machine, and so the fastmode must go away even in 1 cpu systems.
>
> I for one would be really really surprised if the execution of an
> interrupt isn't treating the BTB specially. If one reads
me too of course. If an irq isn't making UP-transparent the speculative
actions of the BTB, then 2.5 is still buggy in allowing the fast mode in
UP machines (beause the irq can allocate the pagetable and scribble over
it so then the tlb will be filled with global garbage). To make things
more clear this is what will happen right now in 2.5 if the irq isn't
serializing the BTB speculative tlb fills:
CPU1
munmap
.. speculation starts ..
.. TLB reads pmd entry, so it now knows the phys address of the pte ..
clear pmd entry
free pte
(doesn't matter if we clear the pmd entry or if we free the pte first)
irq fired, BTB speculative actions aren't stopped they runs speculative in parallel to the irq
alloc page - get old pte
scribble on pte
.. TLB reads the contents of the pte at the phys address now invalid ..
.. tlb fill ends and we filled the tlb with random pte contents marked global ...
If instead the irq is serializing the BTB actions as expected (the
invariant is that an UP machine will never see any speculative action
internally, speculations is a problem only with SMP on shared memory
or while talking with hardware devices outside the local cpu), then it
means the above cannot happen, so 2.5 isn't buggy in allowing the
fastmode with 1 cpu systems, but then it also means 2.5 is overkill in
the leave_mm hack and so we can drop it.
Andrea
next prev parent reply other threads:[~2002-05-23 21:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-23 5:14 Q: backport of the free_pgtables tlb fixes to 2.4 Andrea Arcangeli
2002-05-23 6:01 ` Linus Torvalds
2002-05-23 19:57 ` Andrea Arcangeli
2002-05-23 20:05 ` Linus Torvalds
2002-05-23 20:41 ` Andrea Arcangeli
2002-05-23 19:53 ` Martin Dalecki
2002-05-23 21:15 ` Andrea Arcangeli [this message]
2002-05-23 20:40 ` Martin Dalecki
2002-05-23 22:04 ` Linus Torvalds
2002-05-23 23:22 ` Andrea Arcangeli
2002-05-23 23:51 ` Linus Torvalds
2002-05-24 0:27 ` Andrea Arcangeli
-- strict thread matches above, loose matches on Subject: below --
2002-05-31 13:19 Roland Fehrenbacher
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=20020523211537.GA21164@dualathlon.random \
--to=andrea@suse.de \
--cc=dalecki@evision-ventures.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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