From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Nikita Leshenko <nikita.leshchenko@oracle.com>, fengguang.wu@intel.com
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
dongx.peng@intel.com, jingqi.liu@intel.com, eddie.dong@intel.com,
dave.hansen@intel.com, ying.huang@intel.com, bgregg@netflix.com,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 1/5] [PATCH 1/5] kvm: register in task_struct
Date: Mon, 3 Sep 2018 18:03:49 +0200 [thread overview]
Message-ID: <0ef9ccdc-3eae-f0b9-5304-8552cb94d166@de.ibm.com> (raw)
In-Reply-To: <D3FBF73C-3C33-4F94-8BBB-CE6C70B81A70@oracle.com>
On 09/03/2018 04:10 PM, Nikita Leshenko wrote:
> On September 2, 2018 5:21:15 AM, fengguang.wu@intel.com wrote:
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 8b47507faab5..0c483720de8d 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -3892,6 +3892,7 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm)
>> if (type == KVM_EVENT_CREATE_VM) {
>> add_uevent_var(env, "EVENT=create");
>> kvm->userspace_pid = task_pid_nr(current);
>> + current->kvm = kvm;
>
> Is it OK to store `kvm` on the task_struct? What if the thread that
> originally created the VM exits? From the documentation it seems
> like a VM is associated with an address space and not a specific
> thread, so maybe it should be stored on mm_struct?
Yes, ioctls accessing the kvm can happen from all threads.
>
> From Documentation/virtual/kvm/api.txt:
> Only run VM ioctls from the same process (address space) that was used
> to create the VM.
>
> -Nikita
>> } else if (type == KVM_EVENT_DESTROY_VM) {
>> add_uevent_var(env, "EVENT=destroy");
>> }
>> --
>> 2.15.0
>>
>>
>>
>
next prev parent reply other threads:[~2018-09-03 16:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 14:10 Nikita Leshenko
2018-09-03 16:03 ` Christian Borntraeger [this message]
2018-09-04 0:28 ` Fengguang Wu
2018-09-04 0:46 ` Fengguang Wu
2018-09-04 6:37 ` Nikita Leshenko
2018-09-04 7:15 ` Fengguang Wu
2018-09-04 7:43 ` Christian Borntraeger
2018-09-04 8:31 ` Fengguang Wu
-- strict thread matches above, loose matches on Subject: below --
2018-09-01 11:28 [RFC][PATCH 0/5] introduce /proc/PID/idle_bitmap Fengguang Wu
2018-09-01 11:28 ` [RFC][PATCH 1/5] [PATCH 1/5] kvm: register in task_struct Fengguang Wu
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=0ef9ccdc-3eae-f0b9-5304-8552cb94d166@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=bgregg@netflix.com \
--cc=dave.hansen@intel.com \
--cc=dongx.peng@intel.com \
--cc=eddie.dong@intel.com \
--cc=fengguang.wu@intel.com \
--cc=jingqi.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nikita.leshchenko@oracle.com \
--cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox