All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 3/4] vpci: allow BAR map/unmap without affecting memory decoding bit
Date: Fri, 24 Apr 2026 10:38:05 +0200	[thread overview]
Message-ID: <aesr7YlOKjJsLTkk@macbook.local> (raw)
In-Reply-To: <20260406191203.97662-4-stewart.hildebrand@amd.com>

On Mon, Apr 06, 2026 at 03:11:57PM -0400, Stewart Hildebrand wrote:
> Introduce 'bool map' and allow invoking modify_bars() without changing
> the memory decoding bit. This will allow hardware domain to reposition
> BARs without affecting the memory decoding bit.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> This also lays some groundwork to allow domUs to toggle the guest view
> without affecting hardware, a step toward addressing the FIXME in [1].
> 
> [1] https://lore.kernel.org/xen-devel/20250814160358.95543-4-roger.pau@citrix.com/

The deferred toggling of the command register bits seems overly
complex IMO.  It would be much simpler if domUs simply don't get to
play with the real decoding bits.  For the hardware domain we could
toggle the decoding bits ahead of the mapping operations, so that we
don't have to defer the toggling after mappings have been sorted.

Long term we should aim to remove the cmd field from vpci_map_task
struct.

I don't mind if you want to pick the patch in [1] in your series, as
we could then drop the cmd field and possibly simplify some of the
logic in this patch by no longer requiring the deferred write to the
command register?

> v3->v4:
> * rebase on dynamically allocated map queue
> 
> v2->v3:
> * use bool
> * switch to task->map in more places
> 
> v1->v2:
> * new patch
> ---
>  xen/drivers/vpci/header.c | 43 +++++++++++++++++++++------------------
>  xen/include/xen/vpci.h    |  1 +
>  2 files changed, 24 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
> index 146915e28c50..20fe380552f4 100644
> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -117,11 +117,12 @@ static int cf_check map_range(
>   * BAR's enable bit has changed with the memory decoding bit already enabled.
>   * If rom_only is not set then it's the memory decoding bit that changed.
>   */
> -static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
> -                            bool rom_only)
> +static void modify_decoding(const struct pci_dev *pdev,
> +                            struct vpci_map_task *task)

task wants to be const here, unless further patches require modifying
task inside of modify_decoding().

Thanks, Roger.


  reply	other threads:[~2026-04-24  8:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06 19:11 [PATCH v4 0/4] vpci: allow 32-bit BAR writes with memory decoding enabled Stewart Hildebrand
2026-04-06 19:11 ` [PATCH v4 1/4] vpci: Use pervcpu ranges for BAR mapping Stewart Hildebrand
2026-04-16 14:26   ` Jan Beulich
2026-04-16 15:29   ` Jan Beulich
2026-04-24  7:49     ` Roger Pau Monné
2026-04-06 19:11 ` [PATCH v4 2/4] vpci: allow queueing of mapping operations Stewart Hildebrand
2026-04-09 15:17   ` Mykyta Poturai
2026-04-16 14:59   ` Jan Beulich
2026-04-06 19:11 ` [PATCH v4 3/4] vpci: allow BAR map/unmap without affecting memory decoding bit Stewart Hildebrand
2026-04-24  8:38   ` Roger Pau Monné [this message]
2026-04-06 19:11 ` [PATCH v4 4/4] vpci: allow 32-bit BAR writes with memory decoding enabled Stewart Hildebrand
2026-04-21 13:34   ` Jan Beulich
2026-04-24  8:50   ` Roger Pau Monné
2026-05-04  5:52     ` 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=aesr7YlOKjJsLTkk@macbook.local \
    --to=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.