All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, joerg.roedel@amd.com,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH 3/4] Nested SVM: Implement INVLPGA v2
Date: Tue, 19 May 2009 15:10:59 +0200	[thread overview]
Message-ID: <1818B7EE-E513-4DE3-A77A-EC65186E0044@suse.de> (raw)
In-Reply-To: <4A12AD0C.9030402@redhat.com>


On 19.05.2009, at 14:58, Avi Kivity wrote:

> Alexander Graf wrote:
>> SVM adds another way to do INVLPG by ASID which Hyper-V makes use of,
>> so let's implement it!
>>
>> For now we just do the same thing invlpg does, as asid switching
>> means we flush the mmu anyways. That might change one day though.
>>
>> v2 makes invlpga do the same as invlpg, not flush the whole mmu
>>
>> +static int invlpga_interception(struct vcpu_svm *svm, struct  
>> kvm_run *kvm_run)
>> +{
>> +	struct kvm_vcpu *vcpu = &svm->vcpu;
>> +	nsvm_printk("INVLPGA\n");
>> +
>> +	/* Let's treat INVLPGA the same as INVLPG */
>> +	kvm_mmu_invlpg(vcpu, vcpu->arch.regs[VCPU_REGS_RAX]);
>> +
>> +	svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
>> +	skip_emulated_instruction(&svm->vcpu);
>> +	return 1;
>> +}
>>
>
> I think that for ASID!=0 you can actually do nothing.  The guest  
> entry is a cr3 switch, so we'll both get a tlb flush and a resync on  
> any modified ptes.

Right, the only situation I can imagine this isn't fulfilled is when  
INVLPGA isn't trapped in the 1st level guest, but issued in the 2nd  
level one. That should be rather rare though ;-).

Alex


  reply	other threads:[~2009-05-19 13:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 10:53 [PATCH 0/4] Add rudimentary Hyper-V guest support v2 Alexander Graf
2009-05-19 10:54 ` [PATCH 1/4] Add definition for IGNNE MSR Alexander Graf
2009-05-19 10:54   ` [PATCH 2/4] Implement Hyper-V MSRs v2 Alexander Graf
2009-05-19 10:54     ` [PATCH 3/4] Nested SVM: Implement INVLPGA v2 Alexander Graf
2009-05-19 10:54       ` [PATCH 4/4] Nested SVM: Improve interrupt injection v2 Alexander Graf
2009-05-19 13:22         ` Gleb Natapov
2009-06-15 11:47           ` Alexander Graf
2009-06-15 11:56             ` Gleb Natapov
2009-05-19 12:58       ` [PATCH 3/4] Nested SVM: Implement INVLPGA v2 Avi Kivity
2009-05-19 13:10         ` Alexander Graf [this message]
2009-05-19 13:19           ` Avi Kivity
2009-05-19 13:54         ` Marcelo Tosatti
2009-05-19 13:56           ` Avi Kivity
2009-05-19 13:58             ` Marcelo Tosatti
2009-05-19 15:18               ` Alexander Graf
2009-05-19 16:33                 ` Marcelo Tosatti
2009-05-19 16:35                 ` Avi Kivity
2009-05-19 12:52     ` [PATCH 2/4] Implement Hyper-V MSRs v2 Avi Kivity
2009-06-15 11:45       ` Alexander Graf

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=1818B7EE-E513-4DE3-A77A-EC65186E0044@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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.