From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: kvmarm@lists.linux.dev, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Subject: Re: [PATCH 0/3] KVM: arm64: nv: Add EL2 PMU event filtering support
Date: Tue, 27 Aug 2024 08:59:20 +0100 [thread overview]
Message-ID: <86o75ewg4n.wl-maz@kernel.org> (raw)
In-Reply-To: <Zs15t5JVqcG6AYjF@linux.dev>
On Tue, 27 Aug 2024 08:01:11 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
>
> On Tue, Aug 27, 2024 at 07:35:15AM +0100, Marc Zyngier wrote:
> > > Thoughts?
> >
> > I see that you have already posted your proposed approach, but allow
> > me to say what I have in mind.
> >
> > We have three possibilities:
> >
> > - either we go with your approach, which has the advantage of not
> > requiring any new trap description, but breaks the (unwritten)
> > promise that we don't do any "local" handling at this stage
> >
> > - or we perform the handling where we normally do it (in sys_regs.c),
> > but we start littering the already overly complicated emulation code
> > for something that is barely a trap reinjection
>
> Hell no :)
>
> > - or (and this is my preferred option), we treat it as a "fast" trap,
> > which would match what we do for other things that we trap and that
> > behave differently when 'InHost' (ERET, TLBIs).
> >
> > This last option does require another bit of decoding, but has the
> > following advantages:
> >
> > - it follows the existing model for 'InHost' trap handling
> >
> > - it is close to optimal from a performance perspective
> >
> > - it doesn't change the existing behaviour of the xarray handling
> >
> > The way I think of it, this sort of EL0->EL2 trap reinjection is
> > simply the other side of the ERET coin, and I would very much like to
> > keep this symmetry, unless I have missed something obvious.
> >
> > What do you think?
>
> My primary concern about stuffing more things into the fast path is the
> limited debuggability since we can't use instrumentation in a
> not-quite-kernel context.
Yes and no. We can use *some* instrumentation (such as tracing, and
even - horror - printk). But it is the likes of WARN() that go south
because the VHE vectors are not handling BRK as the rest of the
kernel. This is definitely on my list of things to fix.
> I do generally agree with the intent of organizing it all similarly,
> just that the traps infrastructure is _really_ handy for doing the job.
Maybe there is a middle-ground here. We could, as you suggest, use the
xarray as the repository for trap routing information (including the
'InHost' aspect), and yet have the fast path. It shouldn't be too hard
to expose a lookup function and the relevant helpers to decode the
63bit control word.
> Let me take an accounting of how many other 'InHost' trap bits we have
> and get a feel for if we need a generalized solution or if I can do
> something PMU-specific here.
That'd be super useful indeed.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
prev parent reply other threads:[~2024-08-27 7:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-24 0:13 [PATCH 0/3] KVM: arm64: nv: Add EL2 PMU event filtering support Oliver Upton
2024-08-24 0:14 ` [PATCH 1/3] KVM: arm64: Add helpers to determine if PMC counts at a given EL Oliver Upton
2024-08-24 0:14 ` [PATCH 2/3] KVM: arm64: nv: Honor NSH filter when in hyp context Oliver Upton
2024-08-24 0:14 ` [PATCH 3/3] KVM: arm64: nv: Reprogram PMU events affected by nested transition Oliver Upton
2024-08-25 8:16 ` [PATCH 0/3] KVM: arm64: nv: Add EL2 PMU event filtering support Marc Zyngier
2024-08-26 17:26 ` Oliver Upton
2024-08-27 6:35 ` Marc Zyngier
2024-08-27 7:01 ` Oliver Upton
2024-08-27 7:59 ` Marc Zyngier [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=86o75ewg4n.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=gankulkarni@os.amperecomputing.com \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.