Re: [RFC PATCH 2/5] iommu/vt-d: Add generic IO page table support

2023-11-08 Thread Jason Gunthorpe
On Thu, Nov 09, 2023 at 12:10:59AM +, Zhang, Tina wrote:

> > If this is going to happen can we also convert vt-d to actually use the io 
> > page
> > table stuff directly and shuffle the code around so it is structured like 
> > the rest of
> > the io page table implementations?

> Converting VT-d driver to use io page table involves much code
> change. I made a local version of it, and it didn't prove much
> benefit.

Well, it structures the code in a similar way to all the other
drivers, though I admit to having not looked closely at the io page
table stuff.
 
> VT-d only supports one 1st-stage IO pgtable format and one 2nd-stage
> IO pgtable format. So, the current IO pgtable handling operations
> seems more efficient comparing to adding another layer callbacks in
> them.

I would like to de-virtualize those callbacks, is is completely
pointless when we have per-format iommu_domain ops now.

Jason



RE: [RFC PATCH 2/5] iommu/vt-d: Add generic IO page table support

2023-11-08 Thread Zhang, Tina
Hi Jason,

> -Original Message-
> From: Jason Gunthorpe 
> Sent: Tuesday, November 7, 2023 3:32 AM
> To: Zhang, Tina 
> Cc: Jean-Philippe Brucker ; Tian, Kevin
> ; Lu Baolu ; j...@8bytes.org;
> w...@kernel.org; Liu, Yi L ; virtualization@lists.linux-
> foundation.org; io...@lists.linux.dev; linux-ker...@vger.kernel.org
> Subject: Re: [RFC PATCH 2/5] iommu/vt-d: Add generic IO page table support
> 
> On Mon, Nov 06, 2023 at 02:12:23AM -0500, Tina Zhang wrote:
> > Add basic hook up code to implement generic IO page table framework.
> >
> > Signed-off-by: Tina Zhang 
> > ---
> >  drivers/iommu/intel/Kconfig |  1 +
> >  drivers/iommu/intel/iommu.c | 94
> > +
> >  drivers/iommu/intel/iommu.h |  7 +++
> >  drivers/iommu/io-pgtable.c  |  3 ++
> >  include/linux/io-pgtable.h  |  2 +
> >  5 files changed, 107 insertions(+)
> 
> If this is going to happen can we also convert vt-d to actually use the io 
> page
> table stuff directly and shuffle the code around so it is structured like the 
> rest of
> the io page table implementations?
Converting VT-d driver to use io page table involves much code change. I made a 
local version of it, and it didn't prove much benefit.

VT-d only supports one 1st-stage IO pgtable format and one 2nd-stage IO pgtable 
format. So, the current IO pgtable handling operations seems more efficient 
comparing to adding another layer callbacks in them.

We have a plan to add a new io_pgtable.c file under VT-d driver directory and 
use that file to collect IO pgtable related functions. But we want to hold on 
converting VT-d to use the IO page table directly unless we can see some 
benefits.

Regards,
-Tina
> 
> Jason



Re: [RFC PATCH 2/5] iommu/vt-d: Add generic IO page table support

2023-11-06 Thread Jason Gunthorpe
On Mon, Nov 06, 2023 at 02:12:23AM -0500, Tina Zhang wrote:
> Add basic hook up code to implement generic IO page table framework.
> 
> Signed-off-by: Tina Zhang 
> ---
>  drivers/iommu/intel/Kconfig |  1 +
>  drivers/iommu/intel/iommu.c | 94 +
>  drivers/iommu/intel/iommu.h |  7 +++
>  drivers/iommu/io-pgtable.c  |  3 ++
>  include/linux/io-pgtable.h  |  2 +
>  5 files changed, 107 insertions(+)

If this is going to happen can we also convert vt-d to actually use
the io page table stuff directly and shuffle the code around so it is
structured like the rest of the io page table implementations?

Jason
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization