History

KVM: Introduce a 'release' method for KVM devices

When a P9 sPAPR VM boots, the CAS negotiation process determines which interrupt mode to use (XICS legacy or XIVE native) and invokes a machine reset to activate the chosen mode. To be able to switch from one interrupt mode to another, we introduce the capability to release a KVM device without destroying the VM. The KVM device interface is extended with a new 'release' method which is called when the file descriptor of the device is closed. Once 'release' is called, the 'destroy' method will not be called anymore as the device is removed from the device list of the VM.

Cédric Le Goater committed 7 years ago

Commit 2bde9b31 parent 3fab2d12 files · +22 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/kvm_host.h+9−0
@@ -1240,6 +1240,15 @@ struct kvm_device_ops { · 1239 unmodified lines
12401240 */
12411241 void (*destroy)(struct kvm_device *dev);
12421242
1243+ /*
1244+ * Release is an alternative method to free the device. It is
1245+ * called when the device file descriptor is closed. Once
1246+ * release is called, the destroy method will not be called
1247+ * anymore as the device is removed from the device list of
1248+ * the VM. kvm->lock is held.
1249+ */
1250+ void (*release)(struct kvm_device *dev);
1251+
12431252 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12441253 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12451254 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t