All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Huang, Ray" <Ray.Huang@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	"Orzel, Michal" <Michal.Orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v8 2/8] vpci: Refactor REGISTER_VPCI_INIT
Date: Fri, 25 Jul 2025 10:08:11 +0200	[thread overview]
Message-ID: <aIM7a8fa0XT-nuUI@macbook.local> (raw)
In-Reply-To: <BL1PR12MB58494358468BFF892A892879E759A@BL1PR12MB5849.namprd12.prod.outlook.com>

On Fri, Jul 25, 2025 at 03:15:13AM +0000, Chen, Jiqian wrote:
> On 2025/7/24 22:28, Roger Pau Monné wrote:
> > On Thu, Jul 24, 2025 at 01:50:00PM +0800, Jiqian Chen wrote:
> >> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
> >> index 74211301ba10..eb3e7dcd1068 100644
> >> --- a/xen/drivers/vpci/msix.c
> >> +++ b/xen/drivers/vpci/msix.c
> >> @@ -703,9 +703,18 @@ static int cf_check init_msix(struct pci_dev *pdev)
> >>      pdev->vpci->msix = msix;
> >>      list_add(&msix->next, &d->arch.hvm.msix_tables);
> >>  
> >> -    return 0;
> >> +    /*
> >> +     * vPCI header initialization will have mapped the whole BAR into the
> >> +     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
> >> +     * the MSI-X table here, so that Xen can trap accesses.
> >> +     */
> >> +    spin_lock(&pdev->vpci->lock);
> >> +    rc = vpci_make_msix_hole(pdev);
> >> +    spin_unlock(&pdev->vpci->lock);
> > 
> > I should have asked in the last version, but why do you take the vPCI
> > lock here?
> > 
> > The path that ASSERTs the lock is held should never be taken when
> > called from init_msix().  Is there some path I'm missing in
> > vpci_make_msix_hole() that requires the vCPI lock to be held?
> > 
> > The rest LGTM.
> Sorry to forget to delete this.
> Feel free to change when submit.
> Or I will change by sending a new version.

Can you ensure it also works without the locking?  I think so, but I
haven't tested myself.

Thanks, Roger.


  reply	other threads:[~2025-07-25  8:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  5:49 [PATCH v8 0/8] Support hiding capability when its initialization fails Jiqian Chen
2025-07-24  5:49 ` [PATCH v8 1/8] vpci/header: Emulate extended capability list for dom0 Jiqian Chen
2025-07-24  8:09   ` Jan Beulich
2025-07-24 14:16     ` Roger Pau Monné
2025-07-24  5:50 ` [PATCH v8 2/8] vpci: Refactor REGISTER_VPCI_INIT Jiqian Chen
2025-07-24 14:28   ` Roger Pau Monné
2025-07-25  3:15     ` Chen, Jiqian
2025-07-25  8:08       ` Roger Pau Monné [this message]
2025-07-25  8:22         ` Chen, Jiqian
2025-07-24  5:50 ` [PATCH v8 3/8] vpci: Hide legacy capability when it fails to initialize Jiqian Chen
2025-07-24 14:47   ` Roger Pau Monné
2025-07-24  5:50 ` [PATCH v8 4/8] vpci: Hide extended " Jiqian Chen
2025-07-24  5:50 ` [PATCH v8 5/8] vpci: Refactor vpci_remove_register to remove matched registers Jiqian Chen
2025-07-24  5:50 ` [PATCH v8 6/8] vpci/rebar: Free Rebar resources when init_rebar() fails Jiqian Chen
2025-07-24  5:50 ` [PATCH v8 7/8] vpci/msi: Free MSI resources when init_msi() fails Jiqian Chen
2025-07-24 14:52   ` Roger Pau Monné
2025-07-24  5:50 ` [PATCH v8 8/8] vpci/msix: Free MSIX resources when init_msix() fails Jiqian Chen
2025-07-24 15:59   ` Roger Pau Monné
2025-07-25  2:50     ` Chen, Jiqian
2025-07-25  8:06       ` Roger Pau Monné

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=aIM7a8fa0XT-nuUI@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=Jiqian.Chen@amd.com \
    --cc=Michal.Orzel@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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.