Re: [PATCH v2 2/4] eventfd: simplify eventfd_signal()

2024-02-07 Thread Anthony Krowiak
For vfio_ap_ops.c Reviewed-by: Anthony Krowiak On 2/6/24 2:44 PM, Stefan Hajnoczi wrote: vhost and VIRTIO-related parts: Reviewed-by: Stefan Hajnoczi On Wed, 22 Nov 2023 at 07:50, Christian Brauner wrote: Ever since the evenfd type was introduced back in 2007 in commit e1ad7468c77d

Re: [Intel-gfx] [PATCH 1/2] eventfd: simplify eventfd_signal()

2023-07-13 Thread Anthony Krowiak
For vfio_ap_ops.c: Reviewed-by: Tony Krowiak On 7/13/23 6:05 AM, Christian Brauner wrote: Ever since the evenfd type was introduced back in 2007 in commit e1ad7468c77d ("signal/timer/event: eventfd core") the eventfd_signal() function only ever passed 1 as a value for @n. There's no point in ke

Re: [Intel-gfx] [PATCH v4 2/2] vfio: no need to pass kvm pointer during device open

2023-02-06 Thread Anthony Krowiak
Tested-by: Tony Krowiak On 2/3/23 4:50 PM, Matthew Rosato wrote: Nothing uses this value during vfio_device_open anymore so it's safe to remove it. Signed-off-by: Matthew Rosato --- drivers/vfio/group.c | 2 +- drivers/vfio/vfio.h | 3 +-- drivers/vfio/vfio_main.c | 7 +++ 3

Re: [Intel-gfx] [PATCH v4 1/2] vfio: fix deadlock between group lock and kvm lock

2023-02-06 Thread Anthony Krowiak
close for the device in question. Fixes: 51cdc8bc120e ("kvm/vfio: Fix potential deadlock on vfio group_lock") Reported-by: Anthony Krowiak Suggested-by: Jason Gunthorpe Signed-off-by: Matthew Rosato --- drivers/vfio/group.c | 44 +++- drivers/vfio/vfio.h

Re: [Intel-gfx] [PATCH] kvm/vfio: Fix potential deadlock on vfio group_lock

2023-01-31 Thread Anthony Krowiak
On 1/31/23 9:34 AM, Jason Gunthorpe wrote: On Tue, Jan 31, 2023 at 09:27:54AM -0500, Anthony Krowiak wrote: I encountered a lockdep splat while running some regression tests today (see below). I suspected it might be this patch so I reverted it, rebuilt the kernel and ran the regression tests

Re: [Intel-gfx] [PATCH] kvm/vfio: Fix potential deadlock on vfio group_lock

2023-01-31 Thread Anthony Krowiak
I encountered a lockdep splat while running some regression tests today (see below). I suspected it might be this patch so I reverted it, rebuilt the kernel and ran the regression tests again; this time, the test ran cleanly. It looks like this patch may not have fixed the problem for which it

Re: [Intel-gfx] [PATCH 1/4] vfio-mdev: allow building the samples into the kernel

2023-01-10 Thread Anthony Krowiak
On 1/10/23 10:27 AM, Christoph Hellwig wrote: On Tue, Jan 10, 2023 at 09:54:51AM -0500, Anthony Krowiak wrote: + tristate "Build VFIO mtty example mediated device sample code" + depends on VFIO_MDEV Admittedly, I'm not very fluent with Kconfig, but in pat

Re: [Intel-gfx] [PATCH 1/4] vfio-mdev: allow building the samples into the kernel

2023-01-10 Thread Anthony Krowiak
On 1/10/23 4:10 AM, Christoph Hellwig wrote: There is nothing in the vfio-mdev sample drivers that requires building them as modules, so remove that restriction. Signed-off-by: Christoph Hellwig --- samples/Kconfig | 16 1 file changed, 8 insertions(+), 8 deletions(-) dif

Re: [Intel-gfx] [PATCH 2/4] vfio-mdev: turn VFIO_MDEV into a selectable symbol

2023-01-10 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak On 1/10/23 4:10 AM, Christoph Hellwig wrote: VFIO_MDEV is just a library with helpers for the drivers. Stop making it a user choice and just select it by the drivers that use the helpers. Signed-off-by: Christoph Hellwig --- Documentation/s390/vfio-ap.rst| 1 -

Re: [Intel-gfx] [PATCH 4/4] vfio-mdev: remove an non-existing driver from vfio-mediated-device

2023-01-10 Thread Anthony Krowiak
LGTM Reviewed-by: Tony Krowiak On 1/10/23 4:10 AM, Christoph Hellwig wrote: The nvidia mdev driver does not actually exist anywhere in the tree. Signed-off-by: Christoph Hellwig --- Documentation/driver-api/vfio-mediated-device.rst | 8 +--- 1 file changed, 1 insertion(+), 7 deletions

Re: [Intel-gfx] [PATCH 1/2] KVM: async kvm_destroy_vm for vfio devices

2023-01-09 Thread Anthony Krowiak
LGTM Reviewed-by: Tony Krowiak On 1/9/23 3:10 PM, Matthew Rosato wrote: Currently it is possible that the final put of a KVM reference comes from vfio during its device close operation. This occurs while the vfio group lock is held; however, if the vfio device is still in the kvm device list,

Re: [Intel-gfx] [PATCH v2 7/7] vfio: Remove vfio_free_device

2022-11-04 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak : vfio_ap part On 11/2/22 11:01 AM, Eric Farman wrote: With the "mess" sorted out, we should be able to inline the vfio_free_device call introduced by commit cb9ff3f3b84c ("vfio: Add helpers for unifying vfio_device life cycle") and remove them from driver release call

Re: [Intel-gfx] [PATCH 09/15] vfio/ap: Use the new device life cycle helpers

2022-09-06 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak On 8/27/22 1:10 PM, Kevin Tian wrote: From: Yi Liu and manage available_instances inside @init/@release. Signed-off-by: Yi Liu Signed-off-by: Kevin Tian --- drivers/s390/crypto/vfio_ap_ops.c | 50 ++- 1 file changed, 29 insertions(+)

Re: [Intel-gfx] [PATCH 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-06 Thread Anthony Krowiak
On 8/30/22 11:10 AM, Jason Gunthorpe wrote: On Tue, Aug 30, 2022 at 09:42:42AM -0400, Anthony Krowiak wrote: +/* + * Alloc and initialize vfio_device so it can be registered to vfio + * core. + * + * Drivers should use the wrapper vfio_alloc_device() for allocation. + * @size is the size of

Re: [Intel-gfx] [PATCH 01/15] vfio: Add helpers for unifying vfio_device life cycle

2022-09-06 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak I have a couple of review comments, but nothing critical that would prevent my r-b. On 8/27/22 1:10 PM, Kevin Tian wrote: The idea is to let vfio core manage the vfio_device life cycle instead of duplicating the logic cross drivers. This is also a preparatory step f

Re: [Intel-gfx] [PATCH v3 05/10] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API

2022-07-20 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak On 7/8/22 6:44 PM, Nicolin Chen wrote: The vfio_pin/unpin_pages() so far accepted arrays of PFNs of user IOVA. Among all three callers, there was only one caller possibly passing in a non-contiguous PFN list, which is now ensured to have contiguous PFN inputs too. Pas

Re: [Intel-gfx] [PATCH v3 01/10] vfio: Make vfio_unpin_pages() return void

2022-07-20 Thread Anthony Krowiak
On 7/8/22 6:44 PM, Nicolin Chen wrote: There's only one caller that checks its return value with a WARN_ON_ONCE, while all other callers don't check the return value at all. Above that, an undo function should not fail. So, simplify the API to return void by embedding similar WARN_ONs. Also fo

Re: [Intel-gfx] [PATCH v3 06/10] vfio/ap: Change saved_pfn to saved_iova

2022-07-20 Thread Anthony Krowiak
Reviewed-by: Tony Krowiak On 7/8/22 6:44 PM, Nicolin Chen wrote: The vfio_ap_ops code maintains both nib address and its PFN, which is redundant, merely because vfio_pin/unpin_pages API wanted pfn. Since vfio_pin/unpin_pages() now accept "iova", change "saved_pfn" to "saved_iova" and remove pfn