Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-08 Thread Sean Christopherson
On Sat, May 06, 2023, Yan Zhao wrote: > On Sat, May 06, 2023 at 02:35:41PM +0800, Yan Zhao wrote: > > > > Maybe the checking of PageTransHuge(cur_page) and bailing out is not > > > > necessary. > > > > If a page is not transparent huge, but there are 512 contigous 4K > > > > pages, I think it's

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-06 Thread Yan Zhao
On Sat, May 06, 2023 at 02:35:41PM +0800, Yan Zhao wrote: > > > Maybe the checking of PageTransHuge(cur_page) and bailing out is not > > > necessary. > > > If a page is not transparent huge, but there are 512 contigous 4K > > > pages, I think it's still good to map them in IOMMU in 2M. > > > See

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-06 Thread Yan Zhao
> > Maybe the checking of PageTransHuge(cur_page) and bailing out is not > > necessary. > > If a page is not transparent huge, but there are 512 contigous 4K > > pages, I think it's still good to map them in IOMMU in 2M. > > See vfio_pin_map_dma() who does similar things. > > I agree that

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-04 Thread Sean Christopherson
On Fri, Mar 17, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:36PM -0800, Sean Christopherson wrote: > > When shadowing a GTT entry with a 2M page, explicitly verify that the > > first page pinned by VFIO is a transparent hugepage instead of assuming > > that page observed by

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-03-16 Thread Yan Zhao
On Fri, Mar 10, 2023 at 04:22:36PM -0800, Sean Christopherson wrote: > When shadowing a GTT entry with a 2M page, explicitly verify that the > first page pinned by VFIO is a transparent hugepage instead of assuming > that page observed by is_2MB_gtt_possible() is the same page pinned by >

[Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-03-10 Thread Sean Christopherson
When shadowing a GTT entry with a 2M page, explicitly verify that the first page pinned by VFIO is a transparent hugepage instead of assuming that page observed by is_2MB_gtt_possible() is the same page pinned by vfio_pin_pages(). E.g. if userspace is doing something funky with the guest's