[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1371617970.21896.232.camel@pasglop>
Date: Wed, 19 Jun 2013 14:59:30 +1000
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: Alexey Kardashevskiy <aik@...abs.ru>,
linuxppc-dev@...ts.ozlabs.org,
David Gibson <david@...son.dropbear.id.au>,
Alexander Graf <agraf@...e.de>,
Paul Mackerras <paulus@...ba.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm-ppc@...r.kernel.org,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling
On Wed, 2013-06-19 at 13:05 +0930, Rusty Russell wrote:
> symbol_get() won't try to load a module; it'll just fail. This is what
> you want, since they must have vfio in the kernel to get a valid fd...
Ok, cool. I suppose what we want here Alexey is slightly higher level,
something like:
vfio_validate_iommu_id(file, iommu_id)
Which verifies that the file that was passed in is allowed to use
that iommu_id.
That's a simple and flexible interface (ie, it will work even if we
support multiple iommu IDs in the future for a vfio, for example
for DDW windows etc...), the logic to know about the ID remains
in qemu, this is strictly a validation call.
That way we also don't have to expose the containing vfio struct etc...
just that simple function.
Alex, any objection ?
Do we need to make it a get/put interface instead ?
vfio_validate_and_use_iommu(file, iommu_id);
vfio_release_iommu(file, iommu_id);
To ensure that the resource remains owned by the process until KVM
is closed as well ?
Or do we want to register with VFIO with a callback so that VFIO can
call us if it needs us to give it up ?
Cheers,
Ben.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists