On 10.11.23 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 channelShould 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.
I'm in favor of an "official" way to get the domid. As this might be needed on other architectures, too, I guess this will most likely require a (stable) hypercall. As soon as this is available, I'd be happy to change Mini-OS again to use the new hypercall. In order not to block my Xenstore-stubdom series, I'd like to use the hack of this patch until then. Maybe I should rename the function to get_own_domid() in order to avoid having to change the user(s). Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
