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

Re: [PATCH] [RFC] vpci: allow BAR write while mapped



On Fri, Mar 14, 2025 at 10:39:04AM +0000, Alejandro Vallejo wrote:
> On Thu Mar 13, 2025 at 5:43 PM GMT, Stewart Hildebrand wrote:
> > I think this just reinforces the need to rework the BAR mapping
> > machinery.
> 
> Right. The most delicate part is dealing with races with another vCPU when the
> unmap-then-map operation does not complete in a single taking of the vpci lock
> I'd say. And that much is unavoidable, I think, because either unmapping or
> mapping might take a while.

The original code was put together for dom0, I bet there are some
races that can lead to incomplete p2m mappings if the domain attempts
parallel manipulation of the BARs and memory decoding bits.  However
there should be no case where an unexpected mfn gets mapped into the
p2m as a result of such races.

It's fine for a domain to shot it's own foot if it attempts to do
concurrent PCI accesses to explicitly trigger races in the MMIO
mapping handling, as long as this doesn't cause issues to other
guests, and doesn't leak memory.

Regards, Roger.



 


Rackspace

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