On 11.04.2024 17:24, Matthew Barnes wrote:
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -73,6 +73,7 @@ void getdomaininfo(struct domain *d, struct 
> xen_domctl_getdomaininfo *info)
>  
>      info->domain = d->domain_id;
>      info->max_vcpu_id = XEN_INVALID_MAX_VCPU_ID;
> +    info->highest_evtchn_port = read_atomic(&d->valid_evtchns);
>  
>      /*
>       * - domain is marked as blocked only if all its vcpus are blocked
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -145,7 +145,8 @@ struct xen_domctl_getdomaininfo {
>      xen_domain_handle_t handle;
>      uint32_t cpupool;
>      uint8_t gpaddr_bits; /* Guest physical address space size. */
> -    uint8_t pad2[7];
> +    uint8_t pad2[3];
> +    evtchn_port_t highest_evtchn_port; /* Highest allocated event channel 
> port. Used for enumeration */

While, as per my reply to patch 2, I don't think this is a viable route, I'd
still like to mention that the name of the new field is wrong, leading to an
off-by-1 in the consumer in patch 2. d->valid_evtchns is a count, not the
"maximum valid" port number.

Jan

Reply via email to