Re: [PATCH 4/4] s390/vfio-ap: Use AP_DOMAINS for adm_add bitmap size in vfio_ap_mdev_cfg_add()
From: Matthew Rosato
Date: Mon Aug 24 2026 - 13:07:18 EST
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 <akrowiak@xxxxxxxxxxxxx>
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 <mjrosato@xxxxxxxxxxxxx>