mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Dexuan Cui <DECUI@microsoft.com>
Cc: Kameron Carr <kameroncarr@linux.microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"wei.liu@kernel.org" <wei.liu@kernel.org>,
	"mhklinux@outlook.com" <mhklinux@outlook.com>,
	"will@kernel.org" <will@kernel.org>,
	"Mark.Rutland" <Mark.Rutland@arm.com>,
	"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
	"sudeep.holla@kernel.org" <sudeep.holla@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"thuth@redhat.com" <thuth@redhat.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Suzuki K Poulose <Suzuki.Poulose@arm.com>
Subject: Re: [EXTERNAL] Re: [PATCH v5 2/6] firmware: smccc: Detect hypervisor via RSI host call in CCA Realms
Date: Mon, 2 Nov 2026 11:57:41 +0000	[thread overview]
Message-ID: <auh6tWHyMU15QbRC@arm.com> (raw)
In-Reply-To: <CH4PPF0966F22FCAF3D8C6535743902930DBF6C2@CH4PPF0966F22FC.namprd21.prod.outlook.com>

Hi Dexuan,

On Sat, Oct 31, 2026 at 04:47:32AM +0000, Dexuan Cui wrote:
> > From: Catalin Marinas <catalin.marinas@arm.com>
> > Sent: Thursday, October 29, 2026 3:54 PM
> > > +#ifdef CONFIG_ARM64
> > > +	if (is_realm_world())
> > > +		arm_smccc_realm_get_hypervisor_uuid(&res);
> > > +	else
> > > +#endif
> > > + 	arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID,
> > > +				     &res);
> > 
> > Is this meant to be generic? I'm not sure the trick to pass
> > ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID in gprs[0] and forward it to
> > the host is a documented ABI. I think it even confuses other realm guests
> > that don't expect this (e.g. kvm_init_hyp_services()).
> 
> Regarding the concern about passing ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID
> In gprs and forwarding it to the host via an RSI Host Call: if I read the code correctly,
> this pattern actually aligns seamlessly with the current KVM host-side
> implementation for ARM CCA (e.g., in the v16 patchset [1]).

[...]

> Because KVM deliberately unpacks the RSI Host Call structure and pushes
> it down the traditional non-CVM HVC servicing pipeline, the guest passing
> standard SMCCC Function IDs inside the gprs array of an RSI Host Call is
> exactly how the host expects to handle hypervisor services. It shouldn't
> break or confuse other standard realm implementations since this exact
> emulation block translates the RSI exception back into a generic HVC
> abstraction for the hypervisor layer.

My point is not the RSI host call itself to query the UUID but what the
Realm does afterwards. kvm_init_hyp_services() gets a positive answer
for the KVM UUID and continues with an SMCCC 1.1 invocation to query the
supported KVM features. The latter is not an RSI host call but an
ordinary SMC call, to which the RMM responds with -1 in res.a0 (all
lower 32 bits set). So we end up treating KVM hyp services as available
in a Realm but their calls still use the SMC conduit and are rejected by
the RMM.

Supporting such hyp services (e.g. KVM PTP) in a Realm would need a
separate hypervisor-service conduit using RSI_HOST_CALL. Both discovery
and subsequent calls would use the same transport without adding
Realm-specific checks to each caller. Not sure how feasible this is.

-- 
Catalin

  parent reply	other threads:[~2026-11-02 11:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 21:57 [PATCH v5 0/6] arm64: hyperv: Add Realm support for Hyper-V Kameron Carr
2026-10-02 21:57 ` [PATCH v5 1/6] arm64: rsi: Add RSI host call structure and helper function Kameron Carr
2026-10-22  7:41   ` Wei Liu
2026-10-29 22:55   ` Catalin Marinas
2026-10-02 21:57 ` [PATCH v5 2/6] firmware: smccc: Detect hypervisor via RSI host call in CCA Realms Kameron Carr
2026-10-29 22:54   ` Catalin Marinas
2026-10-31  0:35     ` Kameron Carr
2026-10-31  4:47     ` [EXTERNAL] " Dexuan Cui
2026-10-31  8:42       ` Suzuki K Poulose
2026-11-02 11:57       ` Catalin Marinas [this message]
2026-11-02 19:28         ` Dexuan Cui
2026-10-02 21:57 ` [PATCH v5 3/6] arm64: hyperv: Add per-CPU RSI host call infrastructure for " Kameron Carr
2026-10-02 21:57 ` [PATCH v5 4/6] Drivers: hv: Mark shared memory as decrypted " Kameron Carr
2026-10-02 21:57 ` [PATCH v5 5/6] arm64: hyperv: Route hypercalls through RSI host call in " Kameron Carr
2026-10-02 21:57 ` [PATCH v5 6/6] arm64: hyperv: Implement hv_is_isolation_supported() for " Kameron Carr

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=auh6tWHyMU15QbRC@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=DECUI@microsoft.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Suzuki.Poulose@arm.com \
    --cc=arnd@arndb.de \
    --cc=haiyangz@microsoft.com \
    --cc=kameroncarr@linux.microsoft.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=sudeep.holla@kernel.org \
    --cc=thuth@redhat.com \
    --cc=wei.liu@kernel.org \
    --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

all inboxes | Powered by JetHome®