[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/5] Mini-OS: get own domid

  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Nov 2023 11:34:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fwso1ff1s3HdaJH8t7lb+fKDX8RR0AK6VBDhCoizYMU=; b=OUnO5bt9XxMQPULSBbZCohgvH0bqFIo0Mq+MMHntWL5o3phgwf2q4DIzqPzSZt2VbQBKhGBAzkq8AYHvnej5rRSP0/uBr251OpVgIdpYaPz+aRWj4FVGuKU25CbzYJbTJFiNBdIErl5u2rwT8tChf6SQm6KV6oA61yqbyw7p9OI/Wvc+TQ62h/xRT070kJftma5pv6HOwBheNjvMDizgZNa4exRNkoxaSAUPXd2py9/QvIlD3OWuA72ZaMEq1im/u5fc2OObOIZQfxq1zWrVrF0ok6QLhhbCZFyEeIERUd5Ct4fOeq3xqliXsF0N04x5Fi9W5oZitP965Qs3nte+/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nOQRAtuI0cWl67wM5Pcr/fAHLZ9nn/hF8vZ3ccyLSnIxemZHubYFPvLQo5oEwdmgLgAm65BEoopmed4F1yPUZMycQ04eqP6eh+vYt3sJXT0AwUKw8sH7gzIKJ3R1nyZCuVFOWMVnqrP5J9dBrQuK2tEM3gjDEVlnd0Nw6j5D9aWJte9sirjgKQn2PI/yWfRfm1Y/NlJspg3ic9T6DF/TR7q4qqt/lYsCoMIZhvGE+tj5PD50ORyVr/L8DN7ba23etfVBYJevni9slfQ4a+t+iCSKj6Dn7RvNYFDxzcUF0A9Z5EqysoMq2Kx+wf8z4FWsJMo8z/jRle33h13XTYgrqQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: minios-devel@xxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, samuel.thibault@xxxxxxxxxxxx, wl@xxxxxxx, Juergen Gross <jgross@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 13 Nov 2023 10:34:57 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

On 13.11.2023 11:20, Julien Grall wrote:
> Hi,
> On 13/11/2023 09:28, Jan Beulich wrote:
>> On 13.11.2023 10:12, Julien Grall wrote:
>>> On 13/11/2023 07:37, Jan Beulich wrote:
>>>> On 10.11.2023 18:38, Julien Grall wrote:
>>>>> Hi Jan,
>>>>> On 10/11/2023 12:44, Jan Beulich wrote:
>>>>>> On 10.11.2023 13:23, Roger Pau Monné wrote:
>>>>>>> On Fri, Nov 10, 2023 at 12:34:32PM +0100, Juergen Gross wrote:
>>>>>>>> Get the own domid via creation of a temporary event channel. There is
>>>>>>>> no "official" way to read the own domid in PV guests, so use the event
>>>>>>>> channel interface to get it:
>>>>>>>> - allocate an unbound event channel specifying DOMID_SELF for the
>>>>>>>>      other end
>>>>>>>> - read the event channel status which will contain the own domid in
>>>>>>>>      unbound.dom
>>>>>>>> - close the event channel
>>>>>>> Should we look into introducing a way to expose the domid, so that in
>>>>>>> the future we might not need to resort to this workarounds to get the
>>>>>>> domid?
>>>>>>> Maybe in the PV-specific cpuid leaf?  It's a shame we didn't put it in
>>>>>>> a non-HVM specific leaf when it was made available to HVM for pvshim
>>>>>>> reasons.
>>>>>> Couldn't we retroactively generalize the type-agnostic parts of that
>>>>>> leaf?
>>>>> This would only work for x86. I think we want to have a generic
>>>>> hypercalls so it can be used by all arch.
>>>> Hmm, yes, perhaps. Otoh it would seem desirable to me if arch-es also
>>>> provided some extension to an arch-natural way of feature detection
>>>> (which CPUID is on x86), without the need to invoke any hypercalls.
>>> For Arm, I can't really think of anything other than hvc/smc which are
>>> used for calls to the hypervisor/monitor (so basically hypercalls).
>>> Please suggest if you have a better idea.
>> I don't know enough Arm to properly suggest something. Arm64 has various
>> id_* system registers, so I would be wondering whether having a properly
>> virtual one reserved in system register space couldn't do the trick.
> AFAIK there are none available. But if such exists, then I don't see how 
> that would suit with my requests to have an arch-agnostic approach.
> Each architecture would need to have to provide a way to expose those 
> values.

Right. Just like hardware of each architecture also surfaces its
capabilities in architecture-specific ways.

> At which point, why not using hypercall? What's wrong with it?

There's nothing "wrong" with hypercalls, they're just less natural to use
in certain cases. Plus of course using them may require setup inside the

I'm tempted to ask a counter question: Do you consider it a mistake that
on x86 certain capability information is surfaced as CPUID data?




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.