- 07 7月, 2015 4 次提交
-
-
由 Gabriel Laupre 提交于
Fix pba_offset initialization value for Chelsio T5 Virtual Function device. The T5 hardware has a bug in it where it reports a Pending Interrupt Bit Array Offset of 0x8000 for its SR-IOV Virtual Functions instead of the 0x1000 that the hardware actually uses internally. As the hardware doesn't return the correct pba_offset value, add a quirk to instead return a hardcoded value of 0x1000 when a Chelsio T5 VF device is detected. This bug has been fixed in the Chelsio's next chip series T6 but there are no plans to respin the T5 ASIC for this bug. It is just documented in the T5 Errata and left it at that. Signed-off-by: NGabriel Laupre <glaupre@chelsio.com> Reviewed-by: NBandan Das <bsd@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
Anticipating for the introduction of new add/remove functions taking a qemu_irq parameter, let's rename existing ones with a gsi suffix. Signed-off-by: NEric Auger <eric.auger@linaro.org> Tested-by: NVikram Sethi <vikrams@codeaurora.org> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Peter Crosthwaite 提交于
This is system level code, and should only depend on the host page size, not the target page size. Note that HOST_PAGE_SIZE is misleadingly lead and is really aligning to both host and target page size. Hence it's replacement with REAL_HOST_PAGE_SIZE. Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com> Tested-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Paolo Bonzini 提交于
size_t is an unsigned type, thus the error case is never reached in the below call to pread. If bytes is negative, it will be seen as a very high positive value. Spotted by Coverity. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 29 4月, 2015 3 次提交
-
-
由 Alex Williamson 提交于
Somehow these GPUs manage not to respond to a PCI bus reset, removing our primary mechanism for resetting graphics cards. The result is that these devices typically work well for a single VM boot. If the VM is rebooted or restarted, the guest driver is not able to init the card from the dirty state, resulting in a blue screen for Windows guests. The workaround is to use a device specific reset. This is not 100% reliable though since it depends on the incoming state of the device, but it substantially improves the usability of these devices in a VM. Credit to Alex Deucher <alexander.deucher@amd.com> for his guidance. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Alex Williamson 提交于
This is an impossible error path due to the fact that we're reading a kernel provided, rather than user provided link, which will certainly always fit in PATH_MAX. Currently it returns a fixed 26 char path plus %d group number, which typically maxes out at double digits. However, the caller of the initfn certainly expects a less-than zero return value on error, not just a non-zero value. Therefore we should correct the sign here. Reported-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Alex Williamson 提交于
In an analysis by Laszlo, the resulting type of our calculation for the end of the MSI-X table, and thus the start of memory after the table, is uint32_t. We're therefore not correctly preventing the corner case overflow that we intended to fix here where a BAR >=4G could place the MSI-X table to end exactly at the 4G boundary. The MSI-X table offset is defined by the hardware spec to 32bits, so we simply use a cast rather than changing data structure types. This scenario is purely theoretically, typically the MSI-X table is located at the front of the BAR. Reported-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 26 4月, 2015 1 次提交
-
-
由 Peter Maydell 提交于
Rather than retaining io_mem_read/write as simple wrappers around the memory_region_dispatch_read/write functions, make the latter public and change all the callers to use them, since we need to touch all the callsites anyway to add MemTxAttrs and MemTxResult support. Delete io_mem_read and io_mem_write entirely. (All the callers currently pass MEMTXATTRS_UNSPECIFIED and convert the return value back to bool or ignore it.) Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
-
- 03 3月, 2015 2 次提交
-
-
由 Alex Williamson 提交于
Linux v4.0-rc1 vfio-pci introduced a new virtual interrupt to allow the kernel to request a device from the user. When signaled, QEMU will by default attmempt to hot-unplug the device. This is a one- shot attempt with the expectation that the kernel will continue to poll for the device if it is not returned. Returning the device when requested is the expected standard model of cooperative usage, but we also add an option option to disable this feature. Initially this opt-out is set as an experimental option because we really should honor kernel requests for the device. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Samuel Pitoiset 提交于
Disabling MMAP support uses the slower read/write accesses but allows to trace all MMIO accesses, which is not good for performance, but very useful for reverse engineering PCI drivers. This option allows to disable MMAP per device without a compile-time change. Signed-off-by: NSamuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 11 2月, 2015 4 次提交
-
-
由 Alexey Kardashevskiy 提交于
This fixes a compiler error which occurs if DEBUG_VFIO is defined. Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Paolo Bonzini 提交于
In the case of VFIO, the unrealize callback is too early to munmap the BARs. The munmap must be delayed until memory accesses are complete. To do this, split vfio_unmap_bars in two. The removal step, now called vfio_unregister_bars, remains in vfio_exitfn. The reclamation step is vfio_unmap_bars and is moved to the instance_finalize callback. Similarly, quirk MemoryRegions have to be removed during vfio_unregister_bars, but freeing the data structure must be delayed to vfio_unmap_bars. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Paolo Bonzini 提交于
In order to enable out-of-BQL address space lookup, destruction of devices needs to be split in two phases. Unrealize is the first phase; once it complete no new accesses will be started, but there may still be pending memory accesses can still be completed. The second part is freeing the device, which only happens once all memory accesses are complete. At this point the reference count has dropped to zero, an RCU grace period must have completed (because the RCU-protected FlatViews hold a reference to the device via memory_region_ref). This is when instance_finalize is called. Freeing data belongs in an instance_finalize callback, because the dynamically allocated memory can still be used after unrealize by the pending memory accesses. This starts the process by creating an instance_finalize callback and freeing most of the dynamically-allocated data in instance_finalize. Because instance_finalize is also called on error paths or also when the device is actually not realized, the common code needs some changes to be ready for this. The error path in vfio_initfn can be simplified too. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Paolo Bonzini 提交于
Now that vfio_put_base_device is called unconditionally at instance_finalize time, it can be called twice if vfio_populate_device fails. This works but it is slightly harder to follow. Change vfio_get_device to not touch the vbasedev struct until it will definitely succeed, moving the vfio_populate_device call back to vfio-pci. This way, vfio_put_base_device will only be called once. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 05 2月, 2015 1 次提交
-
-
由 Alex Williamson 提交于
Commit d8d95814 added explicit object_unparent() calls for dynamically allocated MemoryRegions. The VFIOMSIXInfo structure also contains such a MemoryRegion, covering the mmap'd region of a PCI BAR above the MSI-X table. This structure is freed as part of the class exit function and therefore also needs an explicit object_unparent(). Failing to do this results in random segfaults due to fields within the structure, often the class pointer, being reclaimed and corrupted by the time object_finalize_child_property() is called for the object. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Cc: qemu-stable@nongnu.org # 2.2
-
- 09 1月, 2015 2 次提交
-
-
由 Alex Williamson 提交于
When disabling MSI/X interrupts the disable functions will leave the device in INTx mode (when available). This matches how hardware operates, INTx is enabled unless MSI/X is enabled (DisINTx is handled separately). Therefore when we really want to disable all interrupts, such as when removing the device, and we start with the device in MSI/X mode, we need to pass through INTx on our way to being completely quiesced. In well behaved situations, the guest driver will have shutdown the device and it will start vfio_exitfn() in INTx mode, producing the desired result. If hot-unplug causes the guest to crash, we may get the device in MSI/X state, which will leave QEMU with a bogus handler installed. Fix this by re-ordering our disable routine so that it should always finish in VFIO_INT_NONE state, which is what all callers expect. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Alex Williamson 提交于
We use an unsigned int when working with the PCI BAR size, which can obviously overflow if the BAR is 4GB or larger. This needs to change to a fixed length uint64_t. A similar issue is possible, though even more unlikely, when mapping the region above an MSI-X table. The start of the MSI-X vector table must be below 4GB, but the end, and therefore the start of the next mapping region, could still land at 4GB. Suggested-by: NNishank Trivedi <nishank.trivedi@netapp.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com> Reviewed-by: NDon Slutz <dslutz@verizon.com> Tested-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
-
- 23 12月, 2014 8 次提交
-
-
由 Alex Williamson 提交于
With the conversion to tracepoints, a couple previous DPRINTKs are now quite a bit more visible and are really just informational. Remove these and add a bit more description to another. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
A new common module is created. It implements all functions that have no device specificity (PCI, Platform). This patch only consists in move (no functional changes) Signed-off-by: NKim Phillips <kim.phillips@linaro.org> Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
better fit in the rest of the namespace Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
vfio_get_device now takes a VFIODevice as argument. The function is split into 2 parts: vfio_get_device which is generic and vfio_populate_device which is bus specific. 3 new fields are introduced in VFIODevice to store dev_info. vfio_put_base_device is created. Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
This structure is going to be shared by VFIOPCIDevice and VFIOPlatformDevice. VFIOBAR includes it. vfio_eoi becomes an ops of VFIODevice specialized by parent device. This makes possible to transform vfio_bar_write/read into generic vfio_region_write/read that will be used by VFIOPlatformDevice too. vfio_mmap_bar becomes vfio_map_region Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
Since we can potentially have both PCI and platform devices in the same VFIO group, this latter now owns a list of VFIODevices. A unified reset handler, vfio_reset_handler, is registered, looping through this VFIODevice list. 2 specialized operations are introduced (vfio_compute_needs_reset and vfio_hot_reset_multi): they allow to implement type specific behavior. also reset_works and needs_reset VFIOPCIDevice fields are moved into VFIODevice. Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
Add 3 new fields in the VFIODevice struct. Type is set to VFIO_DEVICE_TYPE_PCI. The type enum value will later be used to discriminate between VFIO PCI and platform devices. The name is set to domain:bus:slot:function. Currently used to test whether the device already is attached to the group. Later on, the name will be used to simplify all traces. The group is simply moved from VFIOPCIDevice to VFIODevice. Signed-off-by: NEric Auger <eric.auger@linaro.org> [Fix g_strdup_printf() usage] Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 20 12月, 2014 6 次提交
-
-
由 Eric Auger 提交于
Introduce a new base VFIODevice strcut that will be used by both PCI and Platform VFIO device. Move VFIOPCIDevice fd field there. Obviously other fields from VFIOPCIDevice will be moved there but this patch file is introduced to ease the review. Also vfio_mask_single_irqindex, vfio_unmask_single_irqindex, vfio_disable_irqindex now take a VFIODevice handle as argument. Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
To prepare for platform device introduction, rename vfio_mask_intx and vfio_unmask_intx into vfio_mask_single_irqindex and respectively unmask_single_irqindex. Also use a nex index parameter. With that name and prototype the function will be usable for other indexes than VFIO_PCI_INTX_IRQ_INDEX. Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
This prepares for the introduction of VFIOPlatformDevice Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Kim Phillips 提交于
This is done in preparation for the addition of VFIO platform device support. Signed-off-by: NKim Phillips <kim.phillips@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Frank Blaschka 提交于
Depending on the device, container->space->as contains the valid AddressSpace. Using address_space_memory breaks devices sitting behind an iommu (and using a separate address space). Signed-off-by: NFrank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Eric Auger 提交于
This patch removes all DPRINTF and replace them by trace points. A few DPRINTF used in error cases were transformed into error_report. Signed-off-by: NEric Auger <eric.auger@linaro.org> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 15 12月, 2014 1 次提交
-
-
由 Eric Auger 提交于
Use the kvm_resamplefds_enabled function Signed-off-by: NEric Auger <eric.auger@linaro.org> Acked-by: NAlex Williamson <alex.williamson@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 31 10月, 2014 1 次提交
-
-
由 Nikunj A Dadhania 提交于
The PCI MMIO might be disabled or the device in the reset state. Make sure we do not dump these memory regions. Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com> Acked-by: NAlex Williamson <alex.williamson@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 15 10月, 2014 2 次提交
-
-
由 Gonglei 提交于
On this way, we can assure the new bootindex take effect during vm rebooting. Signed-off-by: NGonglei <arei.gonglei@huawei.com> Reviewed-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gonglei 提交于
Remove bootindex form qdev property to qom, things will continue to work just fine, and we can use qom features which are not supported by qdev property. Signed-off-by: NGonglei <arei.gonglei@huawei.com> Reviewed-by: NGerd Hoffmann <kraxel@redhat.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 23 9月, 2014 2 次提交
-
-
由 Nikunj A Dadhania 提交于
All memory regions used by VFIO are LITTLE_ENDIAN and they already take care of endiannes when accessing real device BARs except ROM - it was broken on BE hosts. This fixes endiannes for ROM BARs the same way as it is done for other BARs. This has been tested on PPC64 BE/LE host/guest in all possible combinations including TCG. Signed-off-by: NNikunj A Dadhania <nikunj@linux.vnet.ibm.com> [aik: added commit log] Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
由 Alexey Kardashevskiy 提交于
This reverts commit c4070817. The resulting code wrongly assumed target and host endianness are the same which is not always the case for PPC64. [aw: or potentially any host supporting VFIO and TCG] Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 26 8月, 2014 1 次提交
-
-
由 Alex Williamson 提交于
If we make use of OVMF for the BIOS then we can use GPUs without VGA space access, but we still need this quirk. Disassociate it from the x-vga option and enable it on all NVIDIA VGA display class devices. Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
-
- 18 8月, 2014 2 次提交
-
-
由 Paolo Bonzini 提交于
The function is empty after the previous patch, so remove it. Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Explicitly call object_unparent in the few places where we will re-create the memory region. If the memory region is simply being destroyed as part of device teardown, let QOM handle it. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-