All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Roger Pau Monné" <roger.pau@citrix.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:49:34 +0000	[thread overview]
Message-ID: <D8IL83OMY1GO.36Q84NOAJ55G0@cloud.com> (raw)
In-Reply-To: <Z9gWVThk_OFhlzW1@macbook.local>

On Mon Mar 17, 2025 at 12:32 PM GMT, Roger Pau Monné wrote:
> 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.

It's refcounting bugs that would scare me the most. Or something similar, like
having an expectation that a BAR is absent from a certain p2m when it's still
present.

Cheers,
Alejandro


  reply	other threads:[~2025-03-17 13:49 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é
2025-03-17 13:49         ` Alejandro Vallejo [this message]
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=D8IL83OMY1GO.36Q84NOAJ55G0@cloud.com \
    --to=alejandro.vallejo@cloud.com \
    --cc=roger.pau@citrix.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.