Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-09-09 Thread Kai-Heng Feng
On Wed, Jul 14, 2021 at 6:25 PM Joerg Roedel wrote: > > On Tue, Jul 13, 2021 at 07:57:40PM -0400, Konrad Rzeszutek Wilk wrote: > > The SWIOTLB does have support to do late initialization (xen-pcifront > > does that for example - so if you add devices that can't do 64-bit it > > will allocate

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-14 Thread Joerg Roedel
On Tue, Jul 13, 2021 at 07:57:40PM -0400, Konrad Rzeszutek Wilk wrote: > The SWIOTLB does have support to do late initialization (xen-pcifront > does that for example - so if you add devices that can't do 64-bit it > will allocate something like 4MB). That sounds like a way to evaluate. I suggest

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-13 Thread Kai-Heng Feng
On Wed, Jul 14, 2021 at 7:57 AM Konrad Rzeszutek Wilk wrote: > > On Thu, Jul 08, 2021 at 03:43:42PM +0100, Robin Murphy wrote: > > On 2021-07-08 14:57, Kai-Heng Feng wrote: > > > On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: > > > > > > > > On 2021-07-08 10:28, Joerg Roedel wrote: > > > > >

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-13 Thread Konrad Rzeszutek Wilk
On Thu, Jul 08, 2021 at 03:43:42PM +0100, Robin Murphy wrote: > On 2021-07-08 14:57, Kai-Heng Feng wrote: > > On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: > > > > > > On 2021-07-08 10:28, Joerg Roedel wrote: > > > > On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: > > > > >

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Robin Murphy
On 2021-07-08 14:57, Kai-Heng Feng wrote: On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: On 2021-07-08 10:28, Joerg Roedel wrote: On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: @@ -344,6 +344,9 @@ static int iommu_init_device(struct device *dev) iommu =

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Kai-Heng Feng
On Thu, Jul 8, 2021 at 6:18 PM Robin Murphy wrote: > > On 2021-07-08 10:28, Joerg Roedel wrote: > > On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: > >> @@ -344,6 +344,9 @@ static int iommu_init_device(struct device *dev) > >> > >> iommu =

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Robin Murphy
On 2021-07-08 10:28, Joerg Roedel wrote: On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: @@ -344,6 +344,9 @@ static int iommu_init_device(struct device *dev) iommu = amd_iommu_rlookup_table[dev_data->devid]; dev_data->iommu_v2 = iommu->is_iommu_v2; + +

Re: [PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Joerg Roedel
On Thu, Jul 08, 2021 at 03:42:32PM +0800, Kai-Heng Feng wrote: > @@ -344,6 +344,9 @@ static int iommu_init_device(struct device *dev) > > iommu = amd_iommu_rlookup_table[dev_data->devid]; > dev_data->iommu_v2 = iommu->is_iommu_v2; > + > + if

[PATCH] iommu/amd: Enable swiotlb if any device supports iommu v2 and uses identity mapping

2021-07-08 Thread Kai-Heng Feng
We are seeing kernel panic on rtw88 probe routine because swiotlb isn't set: [ 252.036773] rtw_8821ce :06:00.0: enabling device ( -> 0003) [ 252.037084] Kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer [