From: Marcelo Tosatti <mtosatti@redhat.com>
To: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: Paul Mackerras <paulus@samba.org>, Alexander Graf <agraf@suse.de>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly
Date: Fri, 10 Aug 2012 18:35:53 +0000 [thread overview]
Message-ID: <20120810183553.GA16345@amt.cnet> (raw)
In-Reply-To: <20120810110909.fd044ae1.yoshikawa.takuya@oss.ntt.co.jp>
On Fri, Aug 10, 2012 at 11:09:09AM +0900, Takuya Yoshikawa wrote:
> On Thu, 9 Aug 2012 22:25:32 -0300
> Marcelo Tosatti <mtosatti@redhat.com> wrote:
>
> > I'll send a patch to flush per memslot in the next days, you can work
> > out the PPC details in the meantime.
Not anymore.
> Are you going to implement that using slot_bitmap?
>
> Since I'm now converting kvm_mmu_slot_remove_write_access() to
> rmap based protection, I'd like to hear your plan.
>
> If you can use the stale memslot to restrict the flush, that
> should live with rmap based protection.
There's no plan. I just wanted to confirm this before converting
to per-memslot flush.
1) __kvm_set_memory_region line 807:
* - gfn_to_hva (kvm_read_guest, gfn_to_pfn)
* - kvm_is_visible_gfn (mmu_check_roots)
*/
kvm_arch_flush_shadow(kvm);
kfree(old_memslots);
}
This can be converted to per-memslot flush.
2) __kvm_set_memory_region line 846:
/*
* If the new memory slot is created, we need to clear all
* mmio sptes.
*/
if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT)
kvm_arch_flush_shadow(kvm);
This must flush all translations in the new and old GPA ranges:
a) to remove any mmio sptes that existed in the new GPA range
(see ce88decffd17bf9f373cc233c for a description).
b) to remove any translations in the old range (this is
necessary because change of GPA base is allowed).
Alex/Paul, slot creation should be rare (and modification of GPA base
should not be used, even though it is supported). But if you really need
a new callback, the two points above are what the second call needs (x86
will flush everything).
The other two kvm_arch_flush_shadow in kvm_mmu_notifier_release and
kvm_destroy_vm must remove all sptes obviously.
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Cc: Paul Mackerras <paulus@samba.org>, Alexander Graf <agraf@suse.de>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly
Date: Fri, 10 Aug 2012 15:35:53 -0300 [thread overview]
Message-ID: <20120810183553.GA16345@amt.cnet> (raw)
In-Reply-To: <20120810110909.fd044ae1.yoshikawa.takuya@oss.ntt.co.jp>
On Fri, Aug 10, 2012 at 11:09:09AM +0900, Takuya Yoshikawa wrote:
> On Thu, 9 Aug 2012 22:25:32 -0300
> Marcelo Tosatti <mtosatti@redhat.com> wrote:
>
> > I'll send a patch to flush per memslot in the next days, you can work
> > out the PPC details in the meantime.
Not anymore.
> Are you going to implement that using slot_bitmap?
>
> Since I'm now converting kvm_mmu_slot_remove_write_access() to
> rmap based protection, I'd like to hear your plan.
>
> If you can use the stale memslot to restrict the flush, that
> should live with rmap based protection.
There's no plan. I just wanted to confirm this before converting
to per-memslot flush.
1) __kvm_set_memory_region line 807:
* - gfn_to_hva (kvm_read_guest, gfn_to_pfn)
* - kvm_is_visible_gfn (mmu_check_roots)
*/
kvm_arch_flush_shadow(kvm);
kfree(old_memslots);
}
This can be converted to per-memslot flush.
2) __kvm_set_memory_region line 846:
/*
* If the new memory slot is created, we need to clear all
* mmio sptes.
*/
if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT)
kvm_arch_flush_shadow(kvm);
This must flush all translations in the new and old GPA ranges:
a) to remove any mmio sptes that existed in the new GPA range
(see ce88decffd17bf9f373cc233c for a description).
b) to remove any translations in the old range (this is
necessary because change of GPA base is allowed).
Alex/Paul, slot creation should be rare (and modification of GPA base
should not be used, even though it is supported). But if you really need
a new callback, the two points above are what the second call needs (x86
will flush everything).
The other two kvm_arch_flush_shadow in kvm_mmu_notifier_release and
kvm_destroy_vm must remove all sptes obviously.
next prev parent reply other threads:[~2012-08-10 18:35 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 10:02 [PATCH 0/5] Improve memory slot handling and other fixes Paul Mackerras
2012-08-06 10:02 ` Paul Mackerras
2012-08-06 10:03 ` [PATCH 1/5] KVM: PPC: Book3S HV: Fix incorrect branch in H_CEDE code Paul Mackerras
2012-08-06 10:03 ` Paul Mackerras
2012-08-06 10:04 ` [PATCH 2/5] KVM: PPC: Quieten message about allocating linear regions Paul Mackerras
2012-08-06 10:04 ` Paul Mackerras
2012-08-06 10:06 ` [PATCH 3/5] KVM: PPC: Book3S HV: Handle memory slot deletion and modification correctly Paul Mackerras
2012-08-06 10:06 ` Paul Mackerras
2012-08-09 18:16 ` Marcelo Tosatti
2012-08-09 18:16 ` Marcelo Tosatti
2012-08-10 0:34 ` Paul Mackerras
2012-08-10 0:34 ` Paul Mackerras
2012-08-10 1:25 ` Marcelo Tosatti
2012-08-10 1:25 ` Marcelo Tosatti
2012-08-10 1:33 ` Marcelo Tosatti
2012-08-10 1:33 ` Marcelo Tosatti
2012-08-10 2:09 ` Takuya Yoshikawa
2012-08-10 2:09 ` Takuya Yoshikawa
2012-08-10 18:35 ` Marcelo Tosatti [this message]
2012-08-10 18:35 ` Marcelo Tosatti
2012-08-11 0:37 ` Paul Mackerras
2012-08-11 0:37 ` Paul Mackerras
2012-08-13 16:34 ` Marcelo Tosatti
2012-08-13 16:34 ` Marcelo Tosatti
2012-08-13 22:04 ` Marcelo Tosatti
2012-08-13 22:04 ` Marcelo Tosatti
2012-08-15 9:26 ` Avi Kivity
2012-08-15 9:26 ` Avi Kivity
2012-08-15 17:59 ` Marcelo Tosatti
2012-08-15 17:59 ` Marcelo Tosatti
2012-08-17 7:06 ` Benjamin Herrenschmidt
2012-08-17 7:06 ` Benjamin Herrenschmidt
2012-08-17 18:39 ` Marcelo Tosatti
2012-08-17 18:39 ` Marcelo Tosatti
2012-08-17 20:32 ` Benjamin Herrenschmidt
2012-08-17 20:32 ` Benjamin Herrenschmidt
2012-08-23 13:55 ` Marcelo Tosatti
2012-08-23 13:55 ` Marcelo Tosatti
2012-08-24 9:29 ` Paul Mackerras
2012-08-24 9:29 ` Paul Mackerras
2012-08-24 18:58 ` Marcelo Tosatti
2012-08-24 18:58 ` Marcelo Tosatti
2012-08-19 9:39 ` Avi Kivity
2012-08-19 9:39 ` Avi Kivity
2012-08-15 6:06 ` Paul Mackerras
2012-08-15 6:06 ` Paul Mackerras
2012-08-15 9:23 ` Avi Kivity
2012-08-15 9:23 ` Avi Kivity
2012-08-06 10:06 ` [PATCH 4/5] KVM: PPC: Book3S HV: Take the SRCU read lock before looking up memslots Paul Mackerras
2012-08-06 10:06 ` Paul Mackerras
2012-08-09 18:22 ` Marcelo Tosatti
2012-08-09 18:22 ` Marcelo Tosatti
2012-08-10 0:45 ` Paul Mackerras
2012-08-10 0:45 ` Paul Mackerras
2012-08-06 10:08 ` [RFC PATCH 5/5] KVM: PPC: Take the SRCU lock around memslot use Paul Mackerras
2012-08-06 10:08 ` Paul Mackerras
2012-08-09 18:27 ` Marcelo Tosatti
2012-08-09 18:27 ` Marcelo Tosatti
2012-08-10 0:37 ` Paul Mackerras
2012-08-10 0:37 ` Paul Mackerras
2012-08-10 9:27 ` Alexander Graf
2012-08-10 9:27 ` Alexander Graf
2012-08-15 8:16 ` Benjamin Herrenschmidt
2012-08-15 8:16 ` Benjamin Herrenschmidt
2012-08-10 9:23 ` [PATCH 0/5] Improve memory slot handling and other fixes Alexander Graf
2012-08-10 9:23 ` 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=20120810183553.GA16345@amt.cnet \
--to=mtosatti@redhat.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=paulus@samba.org \
--cc=yoshikawa.takuya@oss.ntt.co.jp \
/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.