Re: [PATCH] KVM: x86/xen: Make number of event channels defines less magical

From: Sean Christopherson
Date: Wed Nov 23 2022 - 12:48:24 EST


On Tue, Nov 22, 2022, David Woodhouse wrote:
> On Tue, 2022-11-22 at 20:31 +0000, Sean Christopherson wrote:
> How's something like this? I did start typing that comment in the
> max_evtchn_port() function in xen.c but moved it over.
>
> Still not utterly convinced, as it's still somewhat circular — we now
> define NR_CHANNELS as (32*32) with a big comment explaining *why* that
> is, and the reason is basically "because that's the number of bits in
> an array of uint32_t[32]".

Agreed, probably not an improvement across the board. Consistency with how the
non-compat code declares the fields is also valuable, so unless someone changes
upstream Xen code, let's just leave things as-is.