All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Egger, Christoph" <chegger@amazon.de>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: hap_invlpg() vs INVLPGA
Date: Fri, 29 Jan 2016 15:02:38 +0100	[thread overview]
Message-ID: <56AB70FE.9030906@amazon.de> (raw)
In-Reply-To: <56AB6FB7.7030003@amazon.de>

On 29/01/16 14:57, Egger, Christoph wrote:
> On 29/01/16 14:24, Jan Beulich wrote:
>> Christoph,
>>
>> in commit dd6de3ab99 ("Implement Nested-on-Nested") you added
>> code to hap_invlpg() supposedly emulating INVLPGA. I've been
>> stumbling across this a number of times in the past, not being able
>> to make the connection between (a) VMX/EPT and INVLPGA and
>> (b) SVM's INVLPGA intercept and this function.
> 
> When you boot Windows 7 as L1 guest and XP-Mode as L2 guest then
> L2 guest uses INVLPG instruction to invalidate a page and L1 guest
> handles this via using INVLPGA instruction.
> 
> The INVLPG intercept flushes the nested hap p2m which is effectively
> a TLB flush to the L1 guest.

... actually to the L2 guest. Sorry for the typo.

> Then this intercept is injected into L1 guest.
> 
> The INVLPGA instruction enforces a new ASID.
> 
> If the nested hap p2m is NULL then p2m_flush() should effectively
> be a noop but it may not crash the guest.
> 
> What I don't remember is if Windows 7 must be 32bit or 64bit
> to reproduce this.
> 
> Christoph
> 
>> I'm asking in the context of a reported crash resulting from the
>> nv_p2m field being NULL during emulation of an INVLPG instruction
>> in a guest with nesting enabled but - afaict - not actually used. Of
>> course I could submit a patch adding a NULL check here, but I'd
>> like to understand what this code is for, and hence whether the
>> better fix wouldn't be to get rid of it.
>>
>> Jan
> 

Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B

  reply	other threads:[~2016-01-29 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 13:24 hap_invlpg() vs INVLPGA Jan Beulich
2016-01-29 13:57 ` Egger, Christoph
2016-01-29 14:02   ` Egger, Christoph [this message]
2016-01-29 15:53     ` Jan Beulich
2016-01-29 17:09       ` Egger, Christoph
2016-02-01  8:04         ` Jan Beulich
2016-02-01  8:14           ` Egger, Christoph
2016-02-01  9:00             ` Jan Beulich
2016-02-01  9:41               ` Egger, Christoph
2016-02-01  9:58                 ` Jan Beulich

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=56AB70FE.9030906@amazon.de \
    --to=chegger@amazon.de \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.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.