Re: [RFC 13/20] iommu: Extend iommu_at[de]tach_device() for multiple devices group

2021-10-25 Thread Jason Gunthorpe via iommu
On Tue, Oct 26, 2021 at 12:16:43AM +1100, David Gibson wrote: > If you attach devices A and B (both in group X) to IOAS 1, then detach > device A, what happens? Do you detach both devices? Or do you have a > counter so you have to detach as many time as you attached? I would refcount it since

Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-10-25 Thread Jason Gunthorpe via iommu
On Fri, Oct 22, 2021 at 03:08:06AM +, Tian, Kevin wrote: > > I have no idea what security model makes sense for wbinvd, that is the > > major question you have to answer. > > wbinvd flushes the entire cache in local cpu. It's more a performance > isolation problem but nothing can prevent it

Re: [RFC 13/20] iommu: Extend iommu_at[de]tach_device() for multiple devices group

2021-10-25 Thread David Gibson
On Mon, Oct 25, 2021 at 09:14:10AM -0300, Jason Gunthorpe wrote: > On Mon, Oct 25, 2021 at 04:14:56PM +1100, David Gibson wrote: > > On Mon, Oct 18, 2021 at 01:32:38PM -0300, Jason Gunthorpe wrote: > > > On Mon, Oct 18, 2021 at 02:57:12PM +1100, David Gibson wrote: > > > > > > > The first user

Re: [RFC 10/20] iommu/iommufd: Add IOMMU_DEVICE_GET_INFO

2021-10-25 Thread Jason Gunthorpe via iommu
On Fri, Oct 22, 2021 at 08:49:03AM +0100, Jean-Philippe Brucker wrote: > On Thu, Oct 21, 2021 at 08:22:23PM -0300, Jason Gunthorpe wrote: > > On Thu, Oct 21, 2021 at 03:58:02PM +0100, Jean-Philippe Brucker wrote: > > > On Thu, Oct 21, 2021 at 02:26:00AM +, Tian, Kevin wrote: > > > > > I'll

Re: I got an IOMMU IO page fault. What to do now?

2021-10-25 Thread Christian König via iommu
Hi Robin, Am 25.10.21 um 18:01 schrieb Robin Murphy: On 2021-10-25 12:23, Christian König wrote: Hi Paul, not sure how the IOMMU gives out addresses, but the printed ones look suspicious to me. Something like we are using an invalid address like -1 or similar. FWIW those look like

Re: I got an IOMMU IO page fault. What to do now?

2021-10-25 Thread Robin Murphy
On 2021-10-25 12:23, Christian König wrote: Hi Paul, not sure how the IOMMU gives out addresses, but the printed ones look suspicious to me. Something like we are using an invalid address like -1 or similar. FWIW those look like believable DMA addresses to me, assuming that the DMA mapping

Re: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-25 Thread Jason Gunthorpe via iommu
On Mon, Oct 25, 2021 at 06:28:09AM +, Liu, Yi L wrote: >thanks for the guiding. will also refer to your vfio_group_cdev series. > >Need to double confirm here. Not quite following on the kfree. Is >this kfree to free the vfio_device structure? But now the >vfio_device pointer

Re: [RFC 13/20] iommu: Extend iommu_at[de]tach_device() for multiple devices group

2021-10-25 Thread Jason Gunthorpe via iommu
On Mon, Oct 25, 2021 at 04:14:56PM +1100, David Gibson wrote: > On Mon, Oct 18, 2021 at 01:32:38PM -0300, Jason Gunthorpe wrote: > > On Mon, Oct 18, 2021 at 02:57:12PM +1100, David Gibson wrote: > > > > > The first user might read this. Subsequent users are likely to just > > > copy paste

Re: I got an IOMMU IO page fault. What to do now?

2021-10-25 Thread Paul Menzel
Dear Christian, Thank you for your reply. On 25.10.21 13:23, Christian König wrote: not sure how the IOMMU gives out addresses, but the printed ones look suspicious to me. Something like we are using an invalid address like -1 or similar. Can you try that on an up to date kernel as well?

Re: I got an IOMMU IO page fault. What to do now?

2021-10-25 Thread Christian König
Hi Paul, not sure how the IOMMU gives out addresses, but the printed ones look suspicious to me. Something like we are using an invalid address like -1 or similar. Can you try that on an up to date kernel as well? E.g. ideally bleeding edge amd-staging-drm-next from Alex repository.

I got an IOMMU IO page fault. What to do now?

2021-10-25 Thread Paul Menzel
Dear Linux folks, On a Dell OptiPlex 5055, Linux 5.10.24 logged the IOMMU messages below. (GPU hang in amdgpu issue #1762 [1] might be related.) $ lspci -nn -s 05:00.0 05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Oland [Radeon HD 8570 / R7 240/340

RE: [RFC 02/20] vfio: Add device class for /dev/vfio/devices

2021-10-25 Thread Liu, Yi L
> From: Jason Gunthorpe mailto:j...@nvidia.com>> > Sent: Tuesday, September 21, 2021 11:57 PM > > On Sun, Sep 19, 2021 at 02:38:30PM +0800, Liu Yi L wrote: > > This patch introduces a new interface (/dev/vfio/devices/$DEVICE) for > > userspace to directly open a vfio device w/o relying on