x86/irq: fix calculation of max PV dom0 pIRQs

The current calculation of PV dom0 pIRQs uses:

n = min(fls(num_present_cpus()), dom0_max_vcpus());

The usage of fls() is wrong, as num_present_cpus() already returns the number
of present CPUs, not the bitmap mask of CPUs.

Fix by removing the usage of fls().

Fixes: 7e73a6e7f1 ('have architectures specify the number of PIRQs a hardware domain gets')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 5c56361c61
master date: 2024-11-25 11:33:06 +0100
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2024-11-27 12:19:48 +01:00
1 parent 6a0ef94a8f
commit 755b136aa4
1 file changed
+1 -1
+1 -1
View File
@@ -2727,7 +2727,7 @@ void __init ioapic_init(void)
unsigned int __hwdom_init arch_hwdom_irqs(const struct domain *d)
{
unsigned int n = fls(num_present_cpus());
unsigned int n = num_present_cpus();
/* Bounding by the domain pirq EOI bitmap capacity. */
const unsigned int max_irqs = min_t(unsigned int, nr_irqs,
PAGE_SIZE * BITS_PER_BYTE);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.