Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Will Deacon <will@kernel.org>
Cc: julien.thierry.kdev@gmail.com, maz@kernel.org, oupton@kernel.org,
	jean-philippe@linaro.org, andre.przywara@arm.com,
	suzuki.poulose@arm.com, kvm@vger.kernel.org
Subject: Re: [PATCH kvmtool 3/6] arm64: Initialise the PMU last
Date: Mon, 18 May 2026 10:53:48 +0100	[thread overview]
Message-ID: <agrhrBjythDfc9qY@raptor> (raw)
In-Reply-To: <agl9ZkPWVKSl2tsN@willie-the-truck>

Hi Will,

On Sun, May 17, 2026 at 09:33:42AM +0100, Will Deacon wrote:
> On Mon, Mar 23, 2026 at 03:02:18PM +0000, Alexandru Elisei wrote:
> > PMU initialisation is done in:
> > 
> > setup_fdt()
> >   vcpu->generate_fdt_nodes()
> >     pmu__generate_fdt_nodes()
> > 
> > The PMU ioctl KVM_ARM_VCPU_PMU_V3_INIT requires that the GIC has been
> > initialised, which is done in gic__init_gic().
> > 
> > gic__init_gic() and setup_fdt() are part of the same initialisation list.
> > The relative order on the list depends on the order of compilation: gic.c
> > is compiled after fdt.c and this places gic__init_gic() first on the
> > initialisation list.
> > 
> > If the compilation order changes and gic.c is compiled *before* fdt.c,
> > gic__init_gic() will be executed *after* setup_fdt() and PMU initialisation
> > will fail with an error message:
> > 
> > PMU KVM_SET_DEVICE_ATTR: No such device
> > 
> > This is fragile and hard to debug. Improve the situation by creating a new
> > init list, last_init(), execute it after late_init(), and move PMU
> > initialisation on that list.
> 
> Hmm, not a big fan of that. There's always _somebody_ who wants to be
> later/earlier than everybody else (see the CCA probing converstion!).

Sure.

> 
> If the PMU genuinely depends on the GIC, then perhaps we should just
> call the PMU init function from the GIC init function, along with a
> comment to explain the dependency? This is all arm64 code so I think
> that's fine.

Sounds good to me.

Thanks,
Alex

  reply	other threads:[~2026-05-18  9:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 15:02 [PATCH kvmtool 0/6] x86 compilation fixes and arm64 PMU improvements Alexandru Elisei
2026-03-23 15:02 ` [PATCH kvmtool 1/6] virtio: Do not modify const strings in virtio_9p_rootdir_parser() Alexandru Elisei
2026-03-23 15:02 ` [PATCH kvmtool 2/6] disk/core: Do not modify const strings in disk_img_name_parser() Alexandru Elisei
2026-05-17  8:29   ` Will Deacon
2026-05-18  9:51     ` Alexandru Elisei
2026-03-23 15:02 ` [PATCH kvmtool 3/6] arm64: Initialise the PMU last Alexandru Elisei
2026-05-17  8:33   ` Will Deacon
2026-05-18  9:53     ` Alexandru Elisei [this message]
2026-03-23 15:02 ` [PATCH kvmtool 4/6] util: Set exit status to errno in die_perror() Alexandru Elisei
2026-03-23 15:02 ` [PATCH kvmtool 5/6] util: Allow die_perror() to take a variable list of argument Alexandru Elisei
2026-05-17  8:44   ` Will Deacon
2026-05-18 10:12     ` Alexandru Elisei
2026-05-18 15:06       ` Will Deacon
2026-05-18 15:22         ` Alexandru Elisei
2026-03-23 15:02 ` [PATCH kvmtool 6/6] arm64: Improve KVM_ARM_VCPU_PMU_V3_CTRL diagnostics Alexandru Elisei

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=agrhrBjythDfc9qY@raptor \
    --to=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=suzuki.poulose@arm.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