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

Re: [PATCH v1 20/21] hw/i386/kvm/xen_evtchn: Hold port_lock for whole of bind_pirq_op



On 24/11/2026 16:22, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>

The check for an existing binding read s->pirq[].port before taking
port_lock, and the allocation wrote it after. The BQL serialises the
writers in practice, but holding port_lock across the check and the
allocation is clearly correct and lets Coverity see it too.

The region now under the lock is pure port_table/pirq bookkeeping.
The MSI unmask and kvm_update_msi_routes_all() calls must remain
outside port_lock: they can re-enter via the MSI translate function,
which takes port_lock itself. The PIRQ→evtchn→GSI delivery paths have
further BQL/port_lock ordering constraints — see the comments in
xen_evtchn_set_callback_level() and xen_evtchn_set_gsi().

Resolves: Coverity CID 1527403
Fixes: 6096cf7877bc ("hw/xen: Support MSI mapping to PIRQ")
Reported-by: Peter Maydell <peter.maydell@xxxxxxxxxx>
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
  hw/i386/kvm/xen_evtchn.c | 25 +++++++++++--------------
  1 file changed, 11 insertions(+), 14 deletions(-)

Reviewed-by: Paul Durrant <paul@xxxxxxx>



 


Rackspace

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