From: Paul Mackerras <paulus@ozlabs.org>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH kernel v4] KVM: PPC: Allocate guest TCEs on demand too
Date: Tue, 30 Apr 2019 10:02:56 +0000 [thread overview]
Message-ID: <20190430100256.GE32205@blackberry> (raw)
On Fri, Mar 29, 2019 at 04:43:26PM +1100, Alexey Kardashevskiy wrote:
> We already allocate hardware TCE tables in multiple levels and skip
> intermediate levels when we can, now it is a turn of the KVM TCE tables.
> Thankfully these are allocated already in 2 levels.
>
> This moves the table's last level allocation from the creating helper to
> kvmppc_tce_put() and kvm_spapr_tce_fault(). Since such allocation cannot
> be done in real mode, this creates a virtual mode version of
> kvmppc_tce_put() which handles allocations.
>
> This adds kvmppc_rm_ioba_validate() to do an additional test if
> the consequent kvmppc_tce_put() needs a page which has not been allocated;
> if this is the case, we bail out to virtual mode handlers.
>
> The allocations are protected by a new mutex as kvm->lock is not suitable
> for the task because the fault handler is called with the mmap_sem held
> but kvmhv_setup_mmu() locks kvm->lock and mmap_sem in the reverse order.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Thanks, patch applied to my kvm-ppc-next tree.
Paul.
next reply other threads:[~2019-04-30 10:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 10:02 Paul Mackerras [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-03-29 5:43 [PATCH kernel v4] KVM: PPC: Allocate guest TCEs on demand too Alexey Kardashevskiy
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=20190430100256.GE32205@blackberry \
--to=paulus@ozlabs.org \
--cc=kvm-ppc@vger.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