Received: by 10.213.65.68 with SMTP id h4csp1395018imn; Mon, 19 Mar 2018 03:01:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELsf7gJa+vATWw5cf+1WAjIwleP4nEvBrxDtoyOFF68pNrtcdDjX97Pdy9Ped8cXZJXPf6Gc X-Received: by 2002:a17:902:6b82:: with SMTP id p2-v6mr11954086plk.326.1521453689632; Mon, 19 Mar 2018 03:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521453689; cv=none; d=google.com; s=arc-20160816; b=PRW3dYqdHhWqwwDLTLTye3E+q2OZOUw3HOMqU60hU2hAIewnltWsXK3Zw8debSboLx dY2zut6O1yfXL8pN+lrn2TY66c+QkbohpEahyaLodF6argwVXiMoqoxoayrQx1OwjvgY 985PQqlbvJlJdIMzGlVkrG4ZOZytn0qs2sDO0C33mmNT1EVXk/vuP9LGQHtITgM5FEBU DbchztazXAl9S7HCAMzEh0iZ5zXRg61TIBdStiRkK4DrQpXVLO+Q+PR0xlzcpd0UTgj8 FzPXQeOBU3q1XfqAWenx0+zgTrZdJxZMbj1n5VFIIwWnPUCr2Gfb11w9Q+z+OtX7J+Hu guVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=+up2uHFT2IXotrhfuq1z8qPaQymThAw4fLLTYtn4cZg=; b=Lm0zIfmfncUnSW9hQJNi/YW2+YQAz0nfAR3iE5upuDY67Iw385KBoes4rrEvXXglVo 3dohWjDMuZ+3Q2HTvnknrdNDZHAOP1/uR66UpZq9tCWD7BShOpnHXzhZNymfqPshgUOs b033OO8hR+61um+yghRGApnxLpE8G2nePEOuq9ugXMajvZZqmowqPqTWGIrcR8uDTqNV FvYeuLVNY7HnRWq9VUb4gphcQlJRuowoSRHlBDY/8xTVC5MeFJ31yo2JfNk15QrIZ27X +eCQIRlQGtsJEWUq2dB2FU55q6L0iruF0oYC2Qge9bPJSkrS1p819IZRVqeBJsDJNetn z9kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=IHsdljFH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18-v6si2672079plp.619.2018.03.19.03.01.13; Mon, 19 Mar 2018 03:01:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=IHsdljFH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932505AbeCSJJP (ORCPT + 99 others); Mon, 19 Mar 2018 05:09:15 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:54861 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451AbeCSJJL (ORCPT ); Mon, 19 Mar 2018 05:09:11 -0400 Received: by mail-it0-f68.google.com with SMTP id w3-v6so9478913itc.4 for ; Mon, 19 Mar 2018 02:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+up2uHFT2IXotrhfuq1z8qPaQymThAw4fLLTYtn4cZg=; b=IHsdljFHBaJdNGLXM74sF3Ay2/StAPnQxRn2vwqV8EUNdblZEd8K0UW+3w0sFxKpmc VHbOarK6UG8b7v0Be4HInah5Ctpu+avXijV/oSzXx3ovo5EEieYZob0322nJXEKGdXsM JYGvcx5lvlgDsYcoi0LGUGlLbGnnw04DqkRz7fcsFN47FvdHAKgymV0MiKabb6looeUX gKvpcyg42DBpPSPNUfRvbwflGCiIKwiuVtBD+xnFEoGDuNysAHppaLeGpZAtDlfAaEAZ 0hZiFeF7s7wWF4Ywm13GBuqskj2gh2ZOBqpZc2eJzxhzQEuvMe98IFfHYCV4TOsidmVj 73LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+up2uHFT2IXotrhfuq1z8qPaQymThAw4fLLTYtn4cZg=; b=dVkMacYf69i6FWDL15/WqqAy4knsAjgKgqm/NtNLsLBLBPy6U9Rd2AthVPn8KUEtK7 soLxBwOE14Y22luTGCsCy7fzBGLPAmlf+EnsI4v05Q/9cY4HJERzTKOom4IjN0216dWl iWHyi/PdZ+JIhF0vpj7Ak1N0lJ5xTORFBpDR+TOc69xlskOfn1AjM0xJUr6sw4giximK K9x9Had8XsvxE+6Cd2uyOUpjH4lSKqRWhOm0s1qTW/O/i7Y4zhCw7rM0jktLmRFKn+bd aatZLtOuB0wVayyi1ppgg+B1ZBbWjW0TF7AS83SjvjghhDgxWic5OQyPTpl0/JRT0zlO 9JRg== X-Gm-Message-State: AElRT7G8PoCz9ddYWBaQYLMW7pasx/ow3qGsEJrzzSf4exEwXqsSOFZG j8WIdt4rZhN7vj5gO9c/ravPTg== X-Received: by 2002:a24:9ec2:: with SMTP id p185-v6mr11144214itd.77.1521450550804; Mon, 19 Mar 2018 02:09:10 -0700 (PDT) Received: from [10.61.2.175] ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id z85-v6sm181178ita.8.2018.03.19.02.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Mar 2018 02:09:10 -0700 (PDT) Subject: Re: [PATCH v2 0/3] vfio/pci: ioeventfd support To: Alex Williamson , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, qemu-devel@nongnu.org, peterx@redhat.com, eric.auger@redhat.com References: <20180315212634.15150.88094.stgit@gimli.home> From: Alexey Kardashevskiy Message-ID: <28b02805-fa03-7f7c-b603-fa8985b305aa@ozlabs.ru> Date: Mon, 19 Mar 2018 20:09:04 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <20180315212634.15150.88094.stgit@gimli.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/3/18 8:31 am, Alex Williamson wrote: > A vfio ioeventfd will perform the pre-specified device write on > triggering of an eventfd. When coupled with KVM ioeventfds, this > feature allows a VM to trap a device page for virtualization, while > also registering targeted ioeventfds to maintain performance of high > frequency register writes within the trapped range. Much like the > existing interrupt eventfd/irqfd coupling, such writes can be handled > entirely in the host kernel. > > The new VFIO device ioctl may be supported by any vfio bus driver, > including mdev drivers, but the implementation here only enables > vfio-pci. This is intended as an acceleration path, bus drivers > may choose which regions to support and userspace should always > intend to fall back to non-accelerated handling when unavailable. > > v1->v2: > * Peter & Eric Sign-offs on 1/3 > * mutex_destroy() in 3/3 > * Slight enhancement to uapi description > * sparse clean - Sparse didn't like that we dropped the __iomem > address space when calling iowriteXX, re-adding it via the opaque > and data pointers of the virq was crude, and that was not a 32-bit > friendly soluion anyway, so add the iomem address to our ioeventfd > struct, pass that, and use a more simple, common handler. > > RFC->v1: > * An arbitrary limit is added for the number of ioeventfds supported > per device. The intention is to set this high enough to allow any > reasonable use case, but limit malicious user behavior. > * Split patches, including adding a patch for endian neutral io reads > and writes. This should be a nop for little-endian and avoid > redundant swap on big-endian, and hopefully resolves Alexey's > comments regarding the endian nature of this interface. > * Rebase to v4.16-rc3 > > Thanks, > Alex > > --- > > Alex Williamson (3): > vfio/pci: Pull BAR mapping setup from read-write path > vfio/pci: Use endian neutral helpers > vfio/pci: Add ioeventfd support > > > drivers/vfio/pci/vfio_pci.c | 35 +++++++ > drivers/vfio/pci/vfio_pci_private.h | 19 ++++ > drivers/vfio/pci/vfio_pci_rdwr.c | 184 +++++++++++++++++++++++++++++++---- > include/uapi/linux/vfio.h | 27 +++++ > 4 files changed, 245 insertions(+), 20 deletions(-) > LGTM, I gave it a try to make sure 2/3 does not break and it does not in all combinations of le/be host <=> le/be guest but I did not try the actual feature - cannot make up a test quickly... Reviewed-by: Alexey Kardashevskiy -- Alexey