All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Singh <Rahul.Singh@arm.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Paul Durrant" <paul@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 1/3] PCI: simplify (and thus correct) pci_get_pdev{,_by_domain}()
Date: Thu, 11 Aug 2022 16:15:36 +0000	[thread overview]
Message-ID: <19F45D6B-45E6-4F10-B6F7-089796E0D5D4@arm.com> (raw)
In-Reply-To: <ad2d9405-9712-79bd-16d7-666ce79bcb3c@suse.com>

Hi Jan,

> On 11 Aug 2022, at 11:51 am, Jan Beulich <jbeulich@suse.com> wrote:
> 
> The last "wildcard" use of either function went away with f591755823a7
> ("IOMMU/PCI: don't let domain cleanup continue when device de-assignment
> failed"). Don't allow them to be called this way anymore. Besides
> simplifying the code this also fixes two bugs:
> 
> 1) When seg != -1, the outer loops should have been terminated after the
>   first iteration, or else a device with the same BDF but on another
>   segment could be found / returned.
> 
> Reported-by: Rahul Singh <rahul.singh@arm.com>
> 
> 2) When seg == -1 calling get_pseg() is bogus. The function (taking a
>   u16) would look for segment 0xffff, which might exist. If it exists,
>   we might then find / return a wrong device.
> 
> In pci_get_pdev_by_domain() also switch from using the per-segment list
> to using the per-domain one, with the exception of the hardware domain
> (see the code comment there).
> 
> While there also constify "pseg" and drop "pdev"'s already previously
> unnecessary initializer.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I tested the patch series on ARM  and it works as expected.

Reviewed-by: Rahul Singh <rahul.singh@arm.com>
Tested-by: Rahul Singh <rahul.singh@arm.com>

Regards,
Rahul
 


  parent reply	other threads:[~2022-08-11 16:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 10:50 [PATCH v2 0/3] PCI: re-work pci_get_pdev() and friends Jan Beulich
2022-08-11 10:51 ` [PATCH v2 1/3] PCI: simplify (and thus correct) pci_get_pdev{,_by_domain}() Jan Beulich
2022-08-11 13:11   ` Andrew Cooper
2022-08-11 13:21     ` Jan Beulich
2022-08-11 16:15   ` Rahul Singh [this message]
2022-08-11 10:52 ` [PATCH v2 2/3] PCI: fold pci_get_pdev{,_by_domain}() Jan Beulich
2022-08-11 13:21   ` Andrew Cooper
2022-08-11 13:26     ` Jan Beulich
2022-08-11 15:09       ` Andrew Cooper
2022-08-11 15:41         ` Jan Beulich
2022-08-11 16:17   ` Rahul Singh
2022-08-11 10:52 ` [PATCH v2 3/3] PCI: bring pci_get_real_pdev() in line with pci_get_pdev() Jan Beulich
2022-08-11 13:28   ` Andrew Cooper
2022-08-11 16:16   ` Rahul Singh
2022-08-11 16:37 ` [PATCH] x86/msi: Switch msi_info to using pci_sbdf_t Andrew Cooper
2022-08-12  6:45   ` Jan Beulich
2022-08-12 10:22     ` Andrew Cooper

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=19F45D6B-45E6-4F10-B6F7-089796E0D5D4@arm.com \
    --to=rahul.singh@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.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.