]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/physdev: Return pirq that irq was already mapped to
authorJiqian Chen <Jiqian.Chen@amd.com>
Mon, 8 Jul 2024 08:04:56 +0000 (16:04 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 8 Jul 2024 13:46:12 +0000 (14:46 +0100)
commit0d2b87b5adfc19e87e9027d996db204c66a47f30
tree5b471d9118d8bce22e569b2feb69081c14d78cd0
parentc2a66d0b58b9661037cfed6bf3f8122b3363ca38
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@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/arch/x86/irq.c