From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: George Dunlap <dunlapg@umich.edu>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: stale TLB contents?
Date: Mon, 24 Jan 2011 14:23:39 +0100 [thread overview]
Message-ID: <4D3D7D5B.4010204@ts.fujitsu.com> (raw)
In-Reply-To: <AANLkTimmgCkO4HASxdks=eAyy9QKyGZ+Gvt6UnavRG33@mail.gmail.com>
On 01/24/11 14:11, George Dunlap wrote:
> If you're talking about just TLB stuff (not changes to the EPT
> tables), that should happen as a result of the context switch code
> (nothing to do with EPT). The code in question is here:
>
> xen/arch/x86/domain.c:context_switch()
> if ( unlikely(!cpu_isset(cpu, dirty_mask)&& !cpus_empty(dirty_mask)) )
> {
> /* Other cpus call __sync_local_execstate from flush ipi handler. */
> flush_tlb_mask(&dirty_mask);
> }
>
> "Dirty mask" means "where this vcpu has run"; since the vcpu in
> question will have run on another pcpu, this should happen before the
> vcpu is allowed to run on cpu 0 again.
Really?
I think you refer to this code in __context_switch():
/*
* Mark this CPU in next domain's dirty cpumasks before calling
* ctxt_switch_to(). This avoids a race on things like EPT flushing,
* which is synchronised on that function.
*/
if ( p->domain != n->domain )
cpu_set(cpu, n->domain->domain_dirty_cpumask);
cpu_set(cpu, n->vcpu_dirty_cpumask);
This should set the dirty bit for the physical cpu on which the vcpu is just
about to be started.
But the dirty bit of the previous vcpu is cleared a little bit later:
if ( p->domain != n->domain )
cpu_clear(cpu, p->domain->domain_dirty_cpumask);
cpu_clear(cpu, p->vcpu_dirty_cpumask);
Couldn't this leave the dirty mask to be empty again?
Juergen
--
Juergen Gross Principal Developer Operating Systems
TSP ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28 Internet: ts.fujitsu.com
D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html
next prev parent reply other threads:[~2011-01-24 13:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 13:00 stale TLB contents? Juergen Gross
2011-01-24 13:11 ` George Dunlap
2011-01-24 13:21 ` Tim Deegan
2011-01-24 13:23 ` Juergen Gross [this message]
2011-01-24 13:13 ` Tim Deegan
2011-01-24 13:29 ` Juergen Gross
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=4D3D7D5B.4010204@ts.fujitsu.com \
--to=juergen.gross@ts.fujitsu.com \
--cc=dunlapg@umich.edu \
--cc=xen-devel@lists.xensource.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 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.