From: David Matlack <dmatlack@google.com>
To: pbonzini@redhat.com
Cc: David Matlack <dmatlack@google.com>,
kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
Gleb Natapov <gleb@redhat.com>, Rik van Riel <riel@redhat.com>,
seanjc@google.com, bgardon@google.com
Subject: [PATCH RESEND 2/2] Revert "KVM: set owner of cpu and vm file operations"
Date: Thu, 3 Mar 2022 18:33:28 +0000 [thread overview]
Message-ID: <20220303183328.1499189-3-dmatlack@google.com> (raw)
In-Reply-To: <20220303183328.1499189-1-dmatlack@google.com>
This reverts commit 3d3aab1b973b01bd2a1aa46307e94a1380b1d802.
Now that the KVM module's lifetime is tied to kvm.users_count, there is
no need to also tie it's lifetime to the lifetime of the VM and vCPU
file descriptors.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: David Matlack <dmatlack@google.com>
---
virt/kvm/kvm_main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index b59f0a29dbd5..73b8f70e16cc 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3684,7 +3684,7 @@ static int kvm_vcpu_release(struct inode *inode, struct file *filp)
return 0;
}
-static struct file_operations kvm_vcpu_fops = {
+static const struct file_operations kvm_vcpu_fops = {
.release = kvm_vcpu_release,
.unlocked_ioctl = kvm_vcpu_ioctl,
.mmap = kvm_vcpu_mmap,
@@ -4735,7 +4735,7 @@ static long kvm_vm_compat_ioctl(struct file *filp,
}
#endif
-static struct file_operations kvm_vm_fops = {
+static const struct file_operations kvm_vm_fops = {
.release = kvm_vm_release,
.unlocked_ioctl = kvm_vm_ioctl,
.llseek = noop_llseek,
@@ -5744,8 +5744,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
goto out_free_5;
kvm_chardev_ops.owner = module;
- kvm_vm_fops.owner = module;
- kvm_vcpu_fops.owner = module;
r = misc_register(&kvm_dev);
if (r) {
--
2.35.1.616.g0bdcbb4464-goog
next prev parent reply other threads:[~2022-03-03 18:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 18:33 [PATCH RESEND 0/2] KVM: Prevent module exit until all VMs are freed David Matlack
2022-03-03 18:33 ` [PATCH RESEND 1/2] " David Matlack
2022-03-08 21:40 ` Sean Christopherson
2022-03-08 22:28 ` David Matlack
2022-03-08 23:08 ` Sean Christopherson
2022-03-08 23:44 ` David Matlack
2022-03-08 23:43 ` David Matlack
2022-03-15 15:43 ` Murilo Opsfelder Araújo
2022-03-15 20:45 ` Paolo Bonzini
2022-03-03 18:33 ` David Matlack [this message]
2022-03-08 21:40 ` [PATCH RESEND 2/2] Revert "KVM: set owner of cpu and vm file operations" Sean Christopherson
2022-03-15 20:49 ` [PATCH RESEND 0/2] KVM: Prevent module exit until all VMs are freed 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=20220303183328.1499189-3-dmatlack@google.com \
--to=dmatlack@google.com \
--cc=bgardon@google.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=riel@redhat.com \
--cc=seanjc@google.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