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

[xen stable-4.17] x86/physdev: Return pirq that irq was already mapped to



commit c5c2ce0b7f892187e40ebc863648fbe1855c6cb8
Author:     Jiqian Chen <Jiqian.Chen@xxxxxxx>
AuthorDate: Thu Jul 25 16:22:15 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jul 25 16:22:15 2024 +0200

    x86/physdev: Return pirq that irq was already mapped to
    
    Fix bug introduced by 0762e2502f1f ("x86/physdev: factor out the code to 
allocate and
    map a pirq"). After that re-factoring, when pirq<0 and current_pirq>0, it 
means
    caller want to allocate a free pirq for irq but irq already has a mapped 
pirq, then
    it returns the negative pirq, so it fails. However, the logic before that
    re-factoring is different, it should return the current_pirq that irq was 
already
    mapped to and make the call success.
    
    Fixes: 0762e2502f1f ("x86/physdev: factor out the code to allocate and map 
a pirq")
    Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
    Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
    Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 0d2b87b5adfc19e87e9027d996db204c66a47f30
    master date: 2024-07-08 14:46:12 +0100
---
 xen/arch/x86/irq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 98654ba784..0ef3a2ca37 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2914,6 +2914,7 @@ static int allocate_pirq(struct domain *d, int index, int 
pirq, int irq,
                     d->domain_id, index, pirq, current_pirq);
             if ( current_pirq < 0 )
                 return -EBUSY;
+            pirq = current_pirq;
         }
         else if ( type == MAP_PIRQ_TYPE_MULTI_MSI )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

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