From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaIFK-0003K8-MS for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:27:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaIFH-0003fY-H3 for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:27:58 -0500 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:35518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaIFG-0003ez-6P for qemu-devel@nongnu.org; Mon, 29 Feb 2016 02:27:55 -0500 Received: by mail-pf0-x22f.google.com with SMTP id w128so42509075pfb.2 for ; Sun, 28 Feb 2016 23:27:54 -0800 (PST) References: <1456729587-17229-1-git-send-email-david@gibson.dropbear.id.au> <1456729587-17229-2-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <56D3F2F4.2050204@ozlabs.ru> Date: Mon, 29 Feb 2016 18:27:48 +1100 MIME-Version: 1.0 In-Reply-To: <1456729587-17229-2-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 1/7] vfio: Start improving VFIO/EEH interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , alex.williamson@redhat.com Cc: qemu-ppc@nongnu.org, agraf@suse.de, gwshan@au1.ibm.com, qemu-devel@nongnu.org On 02/29/2016 06:06 PM, David Gibson wrote: > At present the code handling IBM's Enhanced Error Handling (EEH) interface > on VFIO devices operates by bypassing the usual VFIO logic with > vfio_container_ioctl(). That's a poorly designed interface with unclear > semantics about exactly what can be operated on. > > In particular it operates on a single vfio container internally (hence the > name), but takes an address space and group id, from which it deduces the > container in a rather roundabout way. groupids are something that code > outside vfio shouldn't even be aware of. > > This patch creates new interfaces for EEH operations. Internally we > have vfio_eeh_container_op() which takes a VFIOContainer object > directly. For external use we have vfio_eeh_as_ok() which determines > if an AddressSpace is usable for EEH (at present this means it has a > single container and at most a single group attached), and > vfio_eeh_as_op() which will perform an operation on an AddressSpace in > the unambiguous case, and otherwise returns an error. > > This interface still isn't great, but it's enough of an improvement to > allow a number of cleanups in other places. > > Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy -- Alexey