All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] [RFC] vpci: allow BAR write while mapped
Date: Mon, 17 Mar 2025 13:32:21 +0100	[thread overview]
Message-ID: <Z9gWVThk_OFhlzW1@macbook.local> (raw)
In-Reply-To: <D8FXALVEWMGZ.2C16ABCKLKQRY@cloud.com>

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.


  reply	other threads:[~2025-03-17 12:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 19:50 [PATCH] [RFC] vpci: allow BAR write while mapped Stewart Hildebrand
2025-03-13 15:14 ` Alejandro Vallejo
2025-03-13 17:43   ` Stewart Hildebrand
2025-03-14 10:39     ` Alejandro Vallejo
2025-03-17 12:32       ` Roger Pau Monné [this message]
2025-03-17 13:49         ` Alejandro Vallejo
2025-03-13 17:58   ` Roger Pau Monné
2025-03-13 17:48 ` Roger Pau Monné
2025-03-13 18:28   ` Stewart Hildebrand
2025-03-14  8:04   ` Jan Beulich
2025-03-14  8:21     ` Roger Pau Monné
2025-03-14  8:26       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9gWVThk_OFhlzW1@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=alejandro.vallejo@cloud.com \
    --cc=stewart.hildebrand@amd.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.