Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: David Stevens <stevensd@chromium.org>, Marc Zyngier <maz@kernel.org>
Cc: Wanpeng Li <wanpengli@tencent.com>,
	kvm@vger.kernel.org, Will Deacon <will@kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org,
	Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH v3 0/4] KVM: allow mapping non-refcounted pages
Date: Tue, 28 Sep 2021 19:40:31 +0200	[thread overview]
Message-ID: <c3db653e-4ea2-3e99-aed6-c6e8a76e2ece@redhat.com> (raw)
In-Reply-To: <20210825025009.2081060-1-stevensd@google.com>

On 25/08/21 04:50, David Stevens wrote:
> From: David Stevens <stevensd@chromium.org>
> 
> This patch series adds support for mapping non-refcount VM_IO and
> VM_PFNMAP memory into the guest.
> 
> Currently, the gfn_to_pfn functions require being able to pin the target
> pfn, so they will fail if the pfn returned by follow_pte isn't a
> ref-counted page.  However, the KVM secondary MMUs do not require that
> the pfn be pinned, since they are integrated with the mmu notifier API.
> This series adds a new set of gfn_to_pfn_page functions which parallel
> the gfn_to_pfn functions but do not pin the pfn. The new functions
> return the page from gup if it was present, so callers can use it and
> call put_page when done.
> 
> The gfn_to_pfn functions should be depreciated, since as they are unsafe
> due to relying on trying to obtain a struct page from a pfn returned by
> follow_pte. I added new functions instead of simply adding another
> optional parameter to the existing functions to make it easier to track
> down users of the deprecated functions.
> 
> This series updates x86 and arm64 secondary MMUs to the new API.
> 
> v2 -> v3:
>   - rebase on kvm next branch

Hi David,

this needs a rebase.  I have pushed my current queue, but note that 
parts of it are still untested.

A bigger question here is the gfn_to_pfn caches and how to properly 
invalidate them.  However your patch doesn't make things worse (only a 
bit inconsistent because pointing certain MSRs to a VM_PFNMAP|VM_IO page 
can fail).

Paolo

> v1 -> v2:
>   - Introduce new gfn_to_pfn_page functions instead of modifying the
>     behavior of existing gfn_to_pfn functions, to make the change less
>     invasive.
>   - Drop changes 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: arm64/mmu: use gfn_to_pfn_page
>    KVM: mmu: remove over-aggressive warnings
> 
>   arch/arm64/kvm/mmu.c            |  26 +++--
>   arch/x86/kvm/mmu/mmu.c          |  50 +++++----
>   arch/x86/kvm/mmu/mmu_internal.h |   3 +-
>   arch/x86/kvm/mmu/paging_tmpl.h  |  23 ++--
>   arch/x86/kvm/mmu/tdp_mmu.c      |   6 +-
>   arch/x86/kvm/mmu/tdp_mmu.h      |   4 +-
>   arch/x86/kvm/x86.c              |   6 +-
>   include/linux/kvm_host.h        |  17 +++
>   virt/kvm/kvm_main.c             | 188 +++++++++++++++++++++++---------
>   9 files changed, 220 insertions(+), 103 deletions(-)
> 

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

      parent reply	other threads:[~2021-09-28 17:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  2:50 [PATCH v3 0/4] KVM: allow mapping non-refcounted pages David Stevens
2021-08-25  2:50 ` [PATCH v3 1/4] KVM: mmu: introduce new gfn_to_pfn_page functions David Stevens
2021-08-25  2:50 ` [PATCH v3 2/4] KVM: x86/mmu: use gfn_to_pfn_page David Stevens
2021-08-25  2:50 ` [PATCH v3 3/4] KVM: arm64/mmu: " David Stevens
2021-08-25  2:50 ` [PATCH v3 4/4] KVM: mmu: remove over-aggressive warnings David Stevens
2021-09-21  6:27 ` [PATCH v3 0/4] KVM: allow mapping non-refcounted pages David Stevens
2021-09-21 10:27   ` Paolo Bonzini
2021-09-28 17:40 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3db653e-4ea2-3e99-aed6-c6e8a76e2ece@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=stevensd@chromium.org \
    --cc=wanpengli@tencent.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox