linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: maz@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
	qperret@google.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
	kernel-team@android.com
Subject: Re: [PATCH] KVM: arm64: Count pKVM stage-2 usage in secondary pagetable stats
Date: Tue, 4 Mar 2025 09:03:26 +0000	[thread overview]
Message-ID: <Z8bB3sr7X4RRV0CN@google.com> (raw)
In-Reply-To: <Z8Ycq3d7O8_3fozk@linux.dev>

On Mon, Mar 03, 2025 at 01:18:35PM -0800, Oliver Upton wrote:
> On Fri, Feb 28, 2025 at 12:13:55PM +0000, Vincent Donnefort wrote:
> > Count the pages used by pKVM for the guest stage-2 in memory stats under
> > secondary pagetable stats, similarly to what the VHE mode does.
> > 
> > Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> > 
> > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> > index 1f55b0c7b11d..c2e022c41313 100644
> > --- a/arch/arm64/kvm/mmu.c
> > +++ b/arch/arm64/kvm/mmu.c
> > @@ -1088,12 +1088,18 @@ void kvm_free_stage2_pgd(struct kvm_s2_mmu *mmu)
> >  
> >  static void hyp_mc_free_fn(void *addr, void *unused)
> >  {
> > +	kvm_account_pgtable_pages(addr, -1);
> >  	free_page((unsigned long)addr);
> >  }
> 
> Don't we drain more than just stage-2 page tables into the teardown_mc
> (e.g. vcpu structs)?

Sigh, yes we do. I've left behind some changes we have in our Android branches.
Let me respin a proper version :-\ 

> 
> Thanks,
> Oliver


      reply	other threads:[~2025-03-04  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 12:13 [PATCH] KVM: arm64: Count pKVM stage-2 usage in secondary pagetable stats Vincent Donnefort
2025-03-03 21:18 ` Oliver Upton
2025-03-04  9:03   ` Vincent Donnefort [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=Z8bB3sr7X4RRV0CN@google.com \
    --to=vdonnefort@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=qperret@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).