Re: [PATCH 4/4] s390/vfio-ap: Use AP_DOMAINS for adm_add bitmap size in vfio_ap_mdev_cfg_add()

Matthew Rosato <[email protected]>
Newsgroups org.kernel.vger.kvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-s390
Message-ID <[email protected]>
On 8/24/26 9:58 AM, Anthony Krowiak wrote:
> In vfio_ap_mdev_cfg_add(), the bitmap_and() call that computes
> the intersection of newly added control domains with those
> assigned to each matrix mdev passes AP_DEVICES as the bitmap
> size instead of AP_DOMAINS:
> 
>     bitmap_and(matrix_mdev->adm_add,
>                matrix_mdev->matrix.adm, adm_add, AP_DEVICES);
> 
> Control domains are indexed by AP queue index (APQI) and their
> bitmaps are sized by AP_DOMAINS, not AP_DEVICES. The two
> constants are both 256 today so there is no functional impact,
> but the wrong constant is inconsistent with the two bitmap_and()
> calls immediately above it and with every other operation on
> adm/aqm bitmaps in the file, all of which correctly use
> AP_DOMAINS.
> 
> Use AP_DOMAINS to keep the code consistent and correct in case
> the two constants ever diverge.
> 
> Signed-off-by: Anthony Krowiak <[email protected]>

Since this is not a functional bug today (constants are the same value)
I'm OK with no fixes tag here.

Reviewed-by: Matthew Rosato <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.