From: "Herongguang (Stephen)" <herongguang.he@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>, <rkrcmar@redhat.com>,
<kvm@vger.kernel.org>
Cc: <qemu-devel@nongnu.org>, <wangxinxin.wang@huawei.com>
Subject: Re: [PATCH v2] KVM: pci-assign: do not map smm memory slot pages
Date: Tue, 28 Mar 2017 09:08:33 +0800 [thread overview]
Message-ID: <58D9B791.2000905@huawei.com> (raw)
In-Reply-To: <4c9e0c46-ac81-a455-e2ed-530ad916ff71@redhat.com>
From 8f5b9d2c2944ea7cd8149e9d3b4088f487217d20 Mon Sep 17 00:00:00 2001
From: herongguang <herongguang.he@huawei.com>
Date: Mon, 27 Mar 2017 15:08:59 +0800
Subject: [PATCH] KVM: pci-assign: do not map smm memory slot pages in vt-d
page table
or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
destroy VM.
This is consistent with current vfio implementation.
Signed-off-by: herongguang <herongguang.he@huawei.com>
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 482612b..9018d06 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1052,7 +1052,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
* changes) is disallowed above, so any other attribute changes getting
* here can be skipped.
*/
- if ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE)) {
+ if ((as_id == 0) && ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE))) {
r = kvm_iommu_map_pages(kvm, &new);
return r;
}
--
1.7.12.4
On 2017/3/27 20:22, Paolo Bonzini wrote:
>
>
> On 27/03/2017 09:21, Herongguang (Stephen) wrote:
>> From f6f0ee6831488bef7af841cb86f3d85a04848fe5 Mon Sep 17 00:00:00 2001
>> From: herongguang <herongguang.he@huawei.com>
>> Date: Mon, 27 Mar 2017 15:08:59 +0800
>> Subject: [PATCH] KVM: pci-assign: do not map smm memory slot pages
>> in vt-d page table
>>
>> or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
>> destroy VM.
>>
>> This is consistent with current vfio implementation.
>
> Oops, you forgot a Signed-off-by.
>
> Paolo
>
>> ---
>> virt/kvm/kvm_main.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 482612b..9018d06 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -1052,7 +1052,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
>> * changes) is disallowed above, so any other attribute changes
>> getting
>> * here can be skipped.
>> */
>> - if ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE)) {
>> + if ((as_id == 0) && ((change == KVM_MR_CREATE) || (change ==
>> KVM_MR_MOVE))) {
>> r = kvm_iommu_map_pages(kvm, &new);
>> return r;
>> }
>
> .
>
WARNING: multiple messages have this Message-ID (diff)
From: "Herongguang (Stephen)" <herongguang.he@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
rkrcmar@redhat.com, kvm@vger.kernel.org
Cc: qemu-devel@nongnu.org, wangxinxin.wang@huawei.com
Subject: Re: [Qemu-devel] [PATCH v2] KVM: pci-assign: do not map smm memory slot pages
Date: Tue, 28 Mar 2017 09:08:33 +0800 [thread overview]
Message-ID: <58D9B791.2000905@huawei.com> (raw)
In-Reply-To: <4c9e0c46-ac81-a455-e2ed-530ad916ff71@redhat.com>
From 8f5b9d2c2944ea7cd8149e9d3b4088f487217d20 Mon Sep 17 00:00:00 2001
From: herongguang <herongguang.he@huawei.com>
Date: Mon, 27 Mar 2017 15:08:59 +0800
Subject: [PATCH] KVM: pci-assign: do not map smm memory slot pages in vt-d
page table
or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
destroy VM.
This is consistent with current vfio implementation.
Signed-off-by: herongguang <herongguang.he@huawei.com>
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 482612b..9018d06 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1052,7 +1052,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
* changes) is disallowed above, so any other attribute changes getting
* here can be skipped.
*/
- if ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE)) {
+ if ((as_id == 0) && ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE))) {
r = kvm_iommu_map_pages(kvm, &new);
return r;
}
--
1.7.12.4
On 2017/3/27 20:22, Paolo Bonzini wrote:
>
>
> On 27/03/2017 09:21, Herongguang (Stephen) wrote:
>> From f6f0ee6831488bef7af841cb86f3d85a04848fe5 Mon Sep 17 00:00:00 2001
>> From: herongguang <herongguang.he@huawei.com>
>> Date: Mon, 27 Mar 2017 15:08:59 +0800
>> Subject: [PATCH] KVM: pci-assign: do not map smm memory slot pages
>> in vt-d page table
>>
>> or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
>> destroy VM.
>>
>> This is consistent with current vfio implementation.
>
> Oops, you forgot a Signed-off-by.
>
> Paolo
>
>> ---
>> virt/kvm/kvm_main.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 482612b..9018d06 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -1052,7 +1052,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
>> * changes) is disallowed above, so any other attribute changes
>> getting
>> * here can be skipped.
>> */
>> - if ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE)) {
>> + if ((as_id == 0) && ((change == KVM_MR_CREATE) || (change ==
>> KVM_MR_MOVE))) {
>> r = kvm_iommu_map_pages(kvm, &new);
>> return r;
>> }
>
> .
>
next prev parent reply other threads:[~2017-03-28 1:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 11:14 [PATCH] KVM: unmap SMM memslots in vt-d table herongguang
2017-03-25 11:14 ` [Qemu-devel] " herongguang
2017-03-27 7:21 ` [PATCH v2] KVM: pci-assign: do not map smm memory slot pages Herongguang (Stephen)
2017-03-27 7:21 ` [Qemu-devel] " Herongguang (Stephen)
2017-03-27 11:53 ` Paolo Bonzini
2017-03-27 11:53 ` [Qemu-devel] " Paolo Bonzini
2017-03-27 12:22 ` Paolo Bonzini
2017-03-27 12:22 ` [Qemu-devel] " Paolo Bonzini
2017-03-27 12:58 ` hrg
2017-03-28 1:08 ` Herongguang (Stephen) [this message]
2017-03-28 1:08 ` Herongguang (Stephen)
2017-03-28 8:09 ` Paolo Bonzini
2017-03-28 8:09 ` [Qemu-devel] " Paolo Bonzini
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=58D9B791.2000905@huawei.com \
--to=herongguang.he@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=wangxinxin.wang@huawei.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.