[Intel-gfx] [PATCH v2 5/5] KVM: mmu: remove over-aggressive warnings

2021-06-25 Thread David Stevens
From: David Stevens Remove two warnings that require ref counts for pages to be non-zero, as mapped pfns from follow_pfn may not have an initialized ref count. Signed-off-by: David Stevens --- arch/x86/kvm/mmu/mmu.c | 7 --- virt/kvm/kvm_main.c| 2 +- 2 files changed, 1 insertion

[Intel-gfx] [PATCH v2 4/5] KVM: arm64/mmu: use gfn_to_pfn_page

2021-06-25 Thread David Stevens
From: David Stevens Covert usages of the deprecated gfn_to_pfn functions to the new gfn_to_pfn_page functions. Signed-off-by: David Stevens --- arch/arm64/kvm/mmu.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kvm/mmu.c b/arch

[Intel-gfx] [PATCH v2 3/5] KVM: x86/mmu: use gfn_to_pfn_page

2021-06-25 Thread David Stevens
From: David Stevens Covert usages of the deprecated gfn_to_pfn functions to the new gfn_to_pfn_page functions. Signed-off-by: David Stevens --- arch/x86/kvm/mmu/mmu.c | 43 - arch/x86/kvm/mmu/mmu_internal.h | 3 ++- arch/x86/kvm/mmu/paging_tmpl.h

[Intel-gfx] [PATCH v2 2/5] KVM: mmu: introduce new gfn_to_pfn_page functions

2021-06-25 Thread David Stevens
From: David Stevens Introduce new gfn_to_pfn_page functions that parallel existing gfn_to_pfn functions. The new functions are identical except they take an additional out parameter that is used to return the struct page if the hva was resolved by gup. This allows callers to differentiate the

[Intel-gfx] [PATCH v2 1/5] KVM: do not allow mapping valid but non-refcounted pages

2021-06-25 Thread David Stevens
From: Nicholas Piggin It's possible to create a region which maps valid but non-refcounted pages (e.g., tail pages of non-compound higher order allocations). These host pages can then be returned by gfn_to_page, gfn_to_pfn, etc., family of APIs, which take a reference to the page, which takes it

[Intel-gfx] [PATCH v2 0/5] Remove uses of struct page from x86 and arm64 MMU

2021-06-25 Thread David Stevens
ges to mmu_audit.c - Include Nicholas Piggin's patch to avoid corrupting refcount in the follow_pte case, and use it in depreciated gfn_to_pfn functions. - Rebase on kvm/next David Stevens (4): KVM: mmu: introduce new gfn_to_pfn_page functions KVM: x86/mmu: use gfn_to_pfn_page KVM: a

Re: [Intel-gfx] [PATCH 6/6] drm/i915/gvt: use gfn_to_pfn's page instead of pfn

2021-06-23 Thread David Stevens
Please ignore this last patch. It was put together as an afterthought and wasn't properly tested. -David On Thu, Jun 24, 2021 at 12:59 PM David Stevens wrote: > > Return struct page instead of pfn from gfn_to_mfn. This function is only > used to determine if the page is a transp

[Intel-gfx] [PATCH 6/6] drm/i915/gvt: use gfn_to_pfn's page instead of pfn

2021-06-23 Thread David Stevens
reference on the page returned by gfn_to_pfn. Signed-off-by: David Stevens --- drivers/gpu/drm/i915/gvt/gtt.c | 12 drivers/gpu/drm/i915/gvt/hypercall.h | 3 ++- drivers/gpu/drm/i915/gvt/kvmgt.c | 12 drivers/gpu/drm/i915/gvt/mpt.h | 8 4 files

[Intel-gfx] [PATCH 5/6] KVM: mmu: remove over-aggressive warnings

2021-06-23 Thread David Stevens
From: David Stevens Remove two warnings that require ref counts for pages to be non-zero, as mapped pfns from follow_pfn may not have an initialized ref count. Signed-off-by: David Stevens --- arch/x86/kvm/mmu/mmu.c | 7 --- virt/kvm/kvm_main.c| 2 +- 2 files changed, 1 insertion

[Intel-gfx] [PATCH 4/6] KVM: arm64/mmu: avoid struct page in MMU

2021-06-23 Thread David Stevens
From: David Stevens Avoid converting pfns returned by follow_fault_pfn to struct pages to transiently take a reference. The reference was originally taken to match the reference taken by gup. However, pfns returned by follow_fault_pfn may not have a struct page set up for reference counting

[Intel-gfx] [PATCH 3/6] KVM: x86/mmu: avoid struct page in MMU

2021-06-23 Thread David Stevens
From: David Stevens Avoid converting pfns returned by follow_fault_pfn to struct pages to transiently take a reference. The reference was originally taken to match the reference taken by gup. However, pfns returned by follow_fault_pfn may not have a struct page set up for reference counting

[Intel-gfx] [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn

2021-06-23 Thread David Stevens
From: David Stevens Return a struct kvm_pfn_page containing both a pfn and an optional struct page from the gfn_to_pfn family of functions. This differentiates the gup and follow_fault_pfn cases, which allows callers that only need a pfn to avoid touching the page struct in the latter case. For

[Intel-gfx] [PATCH 1/6] KVM: x86/mmu: release audited pfns

2021-06-23 Thread David Stevens
From: David Stevens Signed-off-by: David Stevens --- arch/x86/kvm/mmu/mmu_audit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/mmu/mmu_audit.c b/arch/x86/kvm/mmu/mmu_audit.c index cedc17b2f60e..97ff184084b4 100644 --- a/arch/x86/kvm/mmu/mmu_audit.c +++ b/arch/x86/kvm/mmu

[Intel-gfx] [PATCH 0/6] KVM: Remove uses of struct page from x86 and arm64 MMU

2021-06-23 Thread David Stevens
and arm64. David Stevens (6): KVM: x86/mmu: release audited pfns KVM: mmu: also return page from gfn_to_pfn KVM: x86/mmu: avoid struct page in MMU KVM: arm64/mmu: avoid struct page in MMU KVM: mmu: remove over-aggressive warnings drm/i915/gvt: use gfn_to_pfn's page instead of pfn