[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.19] x86/irq: fix calculation of max PV dom0 pIRQs



commit 755b136aa4b93d5f00bef0b333ffaffca8580e9a
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Nov 27 12:19:48 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 27 12:19:48 2024 +0100

    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: 7e73a6e7f12a ('have architectures specify the number of PIRQs a 
hardware domain gets')
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 5c56361c618e5d05855fc73118c4655f998b8272
    master date: 2024-11-25 11:33:06 +0100
---
 xen/arch/x86/io_apic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 44bfb3de8e..a1c9566d0a 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.