Displaying 12 results from an estimated 12 matches for "kvm_context".
2009 May 11
0
[PATCH 2/2] qemu-kvm: use common code for assigned msix
...int ret = 0;
+ int ret;
DEBUG("e_phys=%08x r_virt=%p type=%d len=%08x region_num=%d \n",
e_phys, region->u.r_virtbase, type, e_size, region_num);
@@ -166,27 +166,17 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num,
kvm_destroy_phys_mem(kvm_context, old_ephys,
TARGET_PAGE_ALIGN(old_esize));
- if (e_size > 0) {
- /* deal with MSI-X MMIO page */
- if (real_region->base_addr <= r_dev->msix_table_addr &&
- real_region->base_addr + real_region->size >=
-...
2009 May 11
0
[PATCH 2/2] qemu-kvm: use common code for assigned msix
...int ret = 0;
+ int ret;
DEBUG("e_phys=%08x r_virt=%p type=%d len=%08x region_num=%d \n",
e_phys, region->u.r_virtbase, type, e_size, region_num);
@@ -166,27 +166,17 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num,
kvm_destroy_phys_mem(kvm_context, old_ephys,
TARGET_PAGE_ALIGN(old_esize));
- if (e_size > 0) {
- /* deal with MSI-X MMIO page */
- if (real_region->base_addr <= r_dev->msix_table_addr &&
- real_region->base_addr + real_region->size >=
-...
2009 May 20
0
[PATCHv2-RFC 2/2] qemu-kvm: use common code for assigned msix
...int ret = 0;
+ int ret;
DEBUG("e_phys=%08x r_virt=%p type=%d len=%08x region_num=%d \n",
e_phys, region->u.r_virtbase, type, e_size, region_num);
@@ -166,27 +166,17 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num,
kvm_destroy_phys_mem(kvm_context, old_ephys,
TARGET_PAGE_ALIGN(old_esize));
- if (e_size > 0) {
- /* deal with MSI-X MMIO page */
- if (real_region->base_addr <= r_dev->msix_table_addr &&
- real_region->base_addr + real_region->size >=
-...
2009 May 20
0
[PATCHv2-RFC 2/2] qemu-kvm: use common code for assigned msix
...int ret = 0;
+ int ret;
DEBUG("e_phys=%08x r_virt=%p type=%d len=%08x region_num=%d \n",
e_phys, region->u.r_virtbase, type, e_size, region_num);
@@ -166,27 +166,17 @@ static void assigned_dev_iomem_map(PCIDevice *pci_dev, int region_num,
kvm_destroy_phys_mem(kvm_context, old_ephys,
TARGET_PAGE_ALIGN(old_esize));
- if (e_size > 0) {
- /* deal with MSI-X MMIO page */
- if (real_region->base_addr <= r_dev->msix_table_addr &&
- real_region->base_addr + real_region->size >=
-...
2009 May 11
0
[PATCH 1/2] qemu-kvm: add MSI-X support
...v, PCI_CAP_ID_MSIX, PCI_CAPABILITY_CONFIG_MSIX_LENGTH);
+ return ret;
+}
+
+/* Clean up resources for the device. */
+void msix_uninit(PCIDevice *dev)
+{
+ if (!dev->cap.msix)
+ return;
+ msix_free_irq_entries(dev);
+ dev->msix_irq_entries_nr = 0;
+ kvm_commit_irq_routes(kvm_context);
+ cpu_unregister_io_memory(dev->msix_mmio_index);
+ qemu_free(dev->msix_table_page);
+ dev->msix_table_page = NULL;
+ qemu_free(dev->msix_entry_used);
+ dev->msix_entry_used = NULL;
+ qemu_free(dev->msix_irq_entries);
+ dev->msix_irq_entries = NULL;
+...
2009 May 11
0
[PATCH 1/2] qemu-kvm: add MSI-X support
...v, PCI_CAP_ID_MSIX, PCI_CAPABILITY_CONFIG_MSIX_LENGTH);
+ return ret;
+}
+
+/* Clean up resources for the device. */
+void msix_uninit(PCIDevice *dev)
+{
+ if (!dev->cap.msix)
+ return;
+ msix_free_irq_entries(dev);
+ dev->msix_irq_entries_nr = 0;
+ kvm_commit_irq_routes(kvm_context);
+ cpu_unregister_io_memory(dev->msix_mmio_index);
+ qemu_free(dev->msix_table_page);
+ dev->msix_table_page = NULL;
+ qemu_free(dev->msix_entry_used);
+ dev->msix_entry_used = NULL;
+ qemu_free(dev->msix_irq_entries);
+ dev->msix_irq_entries = NULL;
+...
2009 May 20
0
[PATCHv2-RFC 1/2] qemu-kvm: add MSI-X support
...ffset;
+ return 0;
+}
+
+static void msix_free_irq_entries(PCIDevice *dev)
+{
+ int vector, changed = 0;
+
+ /* TODO: handle errors */
+ for (vector = 0; vector < dev->msix_irq_entries_nr; ++vector)
+ if (dev->msix_entry_used[vector]) {
+ kvm_del_routing_entry(kvm_context, &dev->msix_irq_entries[vector]);
+ dev->msix_entry_used[vector] = 0;
+ changed = 1;
+ }
+ if (changed)
+ kvm_commit_irq_routes(kvm_context);
+}
+
+static void msix_enable(PCIDevice *dev)
+{
+ uint32_t ctrl, data;
+ int i;
+
+ if (!dev->m...
2009 May 20
0
[PATCHv2-RFC 1/2] qemu-kvm: add MSI-X support
...ffset;
+ return 0;
+}
+
+static void msix_free_irq_entries(PCIDevice *dev)
+{
+ int vector, changed = 0;
+
+ /* TODO: handle errors */
+ for (vector = 0; vector < dev->msix_irq_entries_nr; ++vector)
+ if (dev->msix_entry_used[vector]) {
+ kvm_del_routing_entry(kvm_context, &dev->msix_irq_entries[vector]);
+ dev->msix_entry_used[vector] = 0;
+ changed = 1;
+ }
+ if (changed)
+ kvm_commit_irq_routes(kvm_context);
+}
+
+static void msix_enable(PCIDevice *dev)
+{
+ uint32_t ctrl, data;
+ int i;
+
+ if (!dev->m...
2008 Jan 08
1
[PATCH] QEMU KVM balloon support
...kvm/libkvm.c
===================================================================
--- kvm-userspace.orig/libkvm/libkvm.c
+++ kvm-userspace/libkvm/libkvm.c
@@ -886,6 +886,17 @@ int kvm_is_ready_for_interrupt_injection
return run->ready_for_interrupt_injection;
}
+int kvm_sync_shadow_with_user(kvm_context_t kvm)
+{
+ int r = 0;
+#ifdef KVM_CAP_SYNC_SHADOW_WITH_USER
+ r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_SHADOW_WITH_USER);
+ if (r > 0)
+ r = ioctl(kvm->vm_fd, KVM_SYNC_SHADOW_WITH_USER);
+#endif
+ return r;
+}
+
int kvm_run(kvm_context_t kvm, int vcpu)...
2008 Jan 08
1
[PATCH] QEMU KVM balloon support
...kvm/libkvm.c
===================================================================
--- kvm-userspace.orig/libkvm/libkvm.c
+++ kvm-userspace/libkvm/libkvm.c
@@ -886,6 +886,17 @@ int kvm_is_ready_for_interrupt_injection
return run->ready_for_interrupt_injection;
}
+int kvm_sync_shadow_with_user(kvm_context_t kvm)
+{
+ int r = 0;
+#ifdef KVM_CAP_SYNC_SHADOW_WITH_USER
+ r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_SHADOW_WITH_USER);
+ if (r > 0)
+ r = ioctl(kvm->vm_fd, KVM_SYNC_SHADOW_WITH_USER);
+#endif
+ return r;
+}
+
int kvm_run(kvm_context_t kvm, int vcpu)...
2008 Jun 27
2
PCI device assignment to guests (userspace)
Userspace patches for the pci-passthrough functionality.
The major updates since the last post are:
- Loop to add passthrough devices in pc_init1
- Handle errors in read/write calls
- Allow invocation without irq number for in-kernel irqchip
Other than this, several small things were fixed according to review comments received last time.
2008 Jun 27
2
PCI device assignment to guests (userspace)
Userspace patches for the pci-passthrough functionality.
The major updates since the last post are:
- Loop to add passthrough devices in pc_init1
- Handle errors in read/write calls
- Allow invocation without irq number for in-kernel irqchip
Other than this, several small things were fixed according to review comments received last time.