[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pci: fix pci_get_pdev() to always account for the segment


  • To: Rahul Singh <Rahul.Singh@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 18 May 2023 14:39:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hu38g2+g3pQBwkTaDfCdtR9hZvDiTh0J1xtKp9GaG6k=; b=KIj5WOegrrB/bxAJI8wjsvObdQseJZT4C60+hQ8/2s9G3oHJ+4csvVwSUmLueS1NrjA1m3PpHHMmKMhbDlKq5i5ejDBebH0UuJKUEoPX9ybdmkMe12g8vsOUFCXKFAIUGfYBnlF/Q/zEe8MtyW2sdj5aXNrD0Pt/taSjskb2NdscyMSqOzjm6OyQ6oLodgP98I+WtQea2S8g4moKagBb1f06e3r4h7Eml5GoqFvv6dp6+hTDRgp0rTL+O1FABOG/jc/cWgBqbboZFbZkjWwD9C+YdrYkAIOjrdwtRdqwXGxEgX8vMwSTcIb4MLJkbVGHzfv4MSZ5SXicbvXn1wQMNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YLJyq62kejDCQQm1Lps9l/fN6Dus+G3DFLA83dVlFya1yeHPE6o7plQHt4cLE77Enct7e/oHkHudLxMGZaiZHljknHbPDg+YQ5tR3aJunPMhtIbLANumIVJu5qFAjo67mSisg0z1XjRGZlYbBSO9ewzVP1g0byuZIbv9RVZalcCxIK6xTQHLMAj80Wy59STYPNoEslKQFd86X5PQmc4IjUxmI3MHvPchBbrRjyZzVSaQUdMY/3ahfNGtLIH0LQqfaLICsZtLsfpBcT677oCsIEFjui7R/CPwmTWUQU56/D4icNZNigWfoL+PapKVP0LhaGBWOD2HpDJ77GvUox9K9Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 18 May 2023 12:40:22 +0000
  • Ironport-data: A9a23:6EKYoaxWa2PjSr2RqOx6t+cIxyrEfRIJ4+MujC+fZmUNrF6WrkVRm mscUDqFa/iONmb1L4p3Oo61px9QvpfRmN5lTQRk/iAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw//F+UIHUMja4mtC5QRjPKAT5jcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KURy3 NVHcDMfVT+Ou7+IxLCQQ+ptpP12eaEHPKtH0p1h5RfwKK9/BLzmHeDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjeVlVMpuFTuGIO9ltiiX8Jak1zev mvb12/4HgsbJJqUzj/tHneE37aWzHymAtJPfFG+3tBqkGGJ70lNMzI1d2WF+/ykplOGQ/sKf iT4/QJr98De7neDdND9Qhn+m3+CsR40UsBVVeY97Wml2qfSpgqUGGUAZjpAc8A98t87QyQw0 V2ElM+vAiZg2JWXQ3+A8rafrRupJDMYa2QFYEcsVQIY5/HzrYd1iQjAJuuPC4awh9zxXD31n TaDqXFng61J1JFTkaKm4VrAnjSg4IDTSRI47RnWWWTj6R5lYImiZMqj7l2zAet8Ebt1h2Kp5 BAs8/VyJshXZX1RvERhmNkwIYw=
  • Ironport-hdrordr: A9a23:ZrC0XKlKBDeBsVKuGEpaiTT2l4fpDfOhimdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcIi7Sc+9qADnhOdICOgqTMGftWzd1FdAQ7sSibcKrweAJ8SczJ8V6U 4DSdkYNDSYNzET4qjHCWKDYrUdKay8gcWVbJDlvhVQpG9RC51I3kNcMEK2A0d2TA5JCd4SD5 yH/PdKoDKmZDA+ctm7LmNtZZmJm/T70LbdJTIWDR8u7weDyRmy7qThLhSe1hACFxtS3LYZ93 TfmQCR3NTojxj78G6Q64bg1eUYpDLT8KoMOCVKsLlVFtzYsHflWG2mYczDgNl6mpDt1L9gqq i1n/5pBbUJ15qWRBD8nfKl4Xib7B8i62XpzFeZhXf5u8rkXzg3YvAx+75xY1/X7VEts8p717 8O12WFt4BPBReFhyjl4cPUPisa43ZcjEBS4tL7tUYvI7c2eftUt8gS7UlVGJAPEGbz750mCv BnCIXZ6OxNeV2XYnjFti03qebcKUgbD1ODWAwPq8aV2z9ZkDRwyFYZ3tUWmjMF+IgmQ5dJ6u zYOuBjla1ITMURcaVhbd1xNfefGyjIW1bBIWiSKVPoGOUOPG/MsYf+5PEv6OSjaPUzvesPcV T6ISJlXEIJCj3T4Je1reB2Gzj2MRmAYQg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, May 18, 2023 at 12:14:46PM +0000, Rahul Singh wrote:
> Hi Roger,
> 
> > On 18 May 2023, at 11:57 am, Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:
> > 
> > When a domain parameter is provided to pci_get_pdev() the search
> > function would match against the bdf, without taking the segment into
> > account.
> > 
> > Fix this and also account for the passed segment.
> > 
> > Fixes: 8cf6e0738906 ('PCI: simplify (and thus correct) 
> > pci_get_pdev{,_by_domain}()')
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>  
> I think the correct fixes tag is:
> Fixes: a37f9ea7a651 ("PCI: fold pci_get_pdev{,_by_domain}()")

I don't think so, a37f9ea7a651 just changed:

         list_for_each_entry ( pdev, &d->pdev_list, domain_list )
-            if ( pdev->bus == bus && pdev->devfn == devfn )
+            if ( pdev->sbdf.bdf == sbdf.bdf )
                 return pdev;

That code was already wrong, a37f9ea7a651 simply switched it to use
the sbdf struct field.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.