Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Donnefort <vdonnefort@google.com>
To: Fuad Tabba <fuad.tabba@linux.dev>
Cc: maz@kernel.org, oupton@kernel.org, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com,
	seiden@linux.ibm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
	kernel-team@android.com, qperret@google.com
Subject: Re: [PATCH v1 3/3] KVM: arm64: Add host_hvc hyp event
Date: Fri, 9 Oct 2026 14:20:25 +0100	[thread overview]
Message-ID: <asjqGQglerqNrMrG@google.com> (raw)
In-Reply-To: <CA+EHjTzdEXHxkMtSU3SybNxy+Fece339bsvyc6L6K_iySdRDfA@mail.gmail.com>

On Fri, Oct 09, 2026 at 01:26:22PM +0100, Fuad Tabba wrote:
> Hi Vincent,
> 
> On Fri, 09 Oct 2026 09:45:29 +0100, Vincent Donnefort
> <vdonnefort@google.com> wrote:
> 
> [...]
> > diff --git a/arch/arm64/include/asm/kvm_hypevents.h b/arch/arm64/include/asm/kvm_hypevents.h
> 
> [...]
> > +HYP_EVENT(host_hvc,
> > +        HE_PROTO(u8 id, u64 ret),
> > +        HE_STRUCT(
> > +                he_field(u8, id)
> > +                he_field(u64, ret)
> > +        ),
> > +        HE_ASSIGN(
> > +                __entry->id = id;
> > +                __entry->ret = ret;
> > +        ),
> > +        HE_PRINTK("id=%u ret=0x%llx", __entry->id, __entry->ret)
> > +);
> 
> id is the index into host_hcall[], so its value depends on that
> table's order. Could this log the SMCCC function ID instead, as
> guest_hvc does? The alignment issue from patch 2 applies here too: the
> format file puts ret at offset 3 instead of 8.

Ack. I thought this might be easier to get a simpler ID. I even contemplated to
stringify the list before convincing myself this wasn't really the hassle.

> 
> [...]
> > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c
> 
> [...]
> > @@ -996,6 +996,8 @@ static void handle_host_hcall(struct kvm_cpu_context *host_ctxt)
> >          cpu_reg(host_ctxt, 0) = SMCCC_RET_SUCCESS;
> >          hfn(host_ctxt);
> >
> > +        trace_host_hvc(id, cpu_reg(host_ctxt, 1));
> > +
> >          return;
> >  inval:
> >          cpu_reg(host_ctxt, 0) = SMCCC_RET_NOT_SUPPORTED;
> 
> Only some of the handlers write a return value to x1. For the others,
> x1 still holds the first argument, e.g. the mmu pointer for
> __kvm_tlb_flush_vmid, so host_hvc's ret field shows that instead.
> Could the field be called x1 rather than ret?

x1 it is. Perhaps I'll rename too for guest_hvc.

> 
> Cheers,
> /fuad

And as always, thanks for reviewing.

-- 
Vincent


  reply	other threads:[~2026-10-09 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  8:45 [PATCH v1 0/3] KVM: arm64: pkvm: Extend hypervisor entering tracing reasons Vincent Donnefort
2026-10-09  8:45 ` [PATCH v1 1/3] KVM: arm64: Add ESR class to the hyp_enter hyp event Vincent Donnefort
2026-10-09 11:30   ` Fuad Tabba
2026-10-09 13:02     ` Vincent Donnefort
2026-10-09 14:08       ` Fuad Tabba
2026-10-09  8:45 ` [PATCH v1 2/3] KVM: arm64: Add guest_hvc " Vincent Donnefort
2026-10-09 12:06   ` Fuad Tabba
2026-10-09 13:17     ` Vincent Donnefort
2026-10-09  8:45 ` [PATCH v1 3/3] KVM: arm64: Add host_hvc " Vincent Donnefort
2026-10-09 12:26   ` Fuad Tabba
2026-10-09 13:20     ` Vincent Donnefort [this message]
2026-10-09 13:50 ` [PATCH v1 0/3] KVM: arm64: pkvm: Extend hypervisor entering tracing reasons Marc Zyngier

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=asjqGQglerqNrMrG@google.com \
    --to=vdonnefort@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=qperret@google.com \
    --cc=seiden@linux.ibm.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