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

Re: [PATCH v2] xen/pci: Refactor PCI MSI interrupts related code


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 14 Apr 2021 10:28:04 +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-SenderADCheck; bh=DHQa6crf7cGH4mh1WlCZfYVOL3ATOFCP7uJntZ8rqHs=; b=LpGgAm/aWWHBrJMWDcDaNXJMmoT/wK2DuLSxG4kTAhB/EjWMLYWJi4A01IUJKEPW7noiEFX2sEReh7l6H/XoABSycMt67YrlyZAm1M3PEr5RoAxNTEYpa6IqytO7YWka2PHwn/MAcO3d7r1anZ+h4EMDN10EhV2DItuE5KtWp/uvp0IVfXOKwFIomBsa8DSJE3uJuqMinyRsnIJcAn+zienxghTkXxML5skWnHmGImydV76c0hMYXT7lW5BI8aaxkmOkozJwKRB+qYQfbHsisdc/WOYIkuLST+QbZW7g3GnfGx2jO6o4aVXFPisXZUK/k5ZmH7/m7jZwUEhj/rZR2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YLj744lvqO0k7DCESA4MI4K02OvJyYQDDOoyF8ie3SPrV+JFrWVtbs/QC6KB6Slf/kRGNgGzFz/6yM9U+c/ERJmWRqiyBMCmpjQqLuMjq3+HqqdpwTFb4NcPIH7x2QZ/K0GxXqCk/kxnnKRwL83r7XV8/8ihX0Iv5HMo8WMqxOlxC8y5tOVBAUFQURS7R7fW1llpccgI/lniF3rOvZqcidgHfu+iySh+zP+DisS/bOJEbRU7M4+3WAe9CB/Su7NTQp/ROjXT1OWX0H4Tp1FvzY/L8pGFLv/tgI6I5V/dbJHE+maTOzPTKn+wZPRM7AEnCTM5dY7/2WnWxE/dmU+Htw==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Wei Liu" <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Paul Durrant" <paul@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>
  • Delivery-date: Wed, 14 Apr 2021 08:28:20 +0000
  • Ironport-hdrordr: A9a23:IL79HaibUIagDS1O9kZbu7lVpnBQX2hw3DAbvn1ZSRFFG/Gwv/ uF2NwGyB75jysQUnk8mdaGfJKNW2/Y6IQd2+csFJ+Ydk3DtHGzJI9vqbHjzTrpBjHk+odmup tIW5NVTOf9BV0St6rHySGlDtctx8SG+qi0heHYi0xgVx1udrsI1WdEIyywe3cGIjVuL5w/CZ aa+45rpyC4f24Wc8S8ARA+LpX+jvfMk4/rZgNDOgUu7xOAgSjtxLnxFRWZ2Rl2aUIy/Z4J92 /Znwvlopiyqv3T8G6n60b/zbRz3OHgxNxKGdCWhqEuSwnEpw60aO1aKti/lR8vpuXH0idPrP DtpFMaM913+zfteAiO0GTQ8i3B9Bpr1HP401+fhhLY0L/EbRY3EdBIi44cUjax0TtZgPhG3K hG332UuvNsZHuq9kmNhKmrJmRXv3G5rnY4nekYg2Y3a/pkVJZroZEC50QQKZ8cHUvBmfAaOd NzB8LR7us+SyLiU1nluABUsbuRd0V2NBKHTk8eg9eSwjhbkVtopnFotfA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EGXJpquh+8ioijjrDRO9dkQDnI VAMXUqUf4rsEhrsKQHlg6oSqL2pUo5k1xRpRFf/2SdpLSO0SP8BkFJMQrQn5NMeyJcW0L41f j4zQ==
  • Ironport-sdr: b4k2vgajPao5+jcBvWymnJ3hxYWxRvDiKAL1rtYZYq5ETVTT/d/mNFUBa7rkb9Fd141GfBIZyP j9V+U8CyMxx1gxKtfNlgGzN7QEoCjDIv8hP9UlHGjQ54dpHb43FHq4WLO5cqy1Ji5AKNhoesXv CBscc+v0QxQDYf7AHdV2pZxgPSSsqV2AnIDQy4O6fCTzCLlEgsMp84tOGVVAkMMe65P+Tm8yUd iVH31m7exVVxOzEU9tB17k/wMU6YOIZFxYAjkY3IMCDjCWnOirdYi1j+kKWufp1Hn4Uz6UFo9T 8/Q=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 14, 2021 at 09:08:53AM +0200, Jan Beulich wrote:
> On 13.04.2021 19:12, Julien Grall wrote:
> > On 12/04/2021 11:49, Roger Pau Monné wrote:
> >> On Fri, Apr 09, 2021 at 05:00:41PM +0100, Rahul Singh wrote:
> >>> --- a/xen/include/xen/vpci.h
> >>> +++ b/xen/include/xen/vpci.h
> >>> @@ -91,6 +91,7 @@ struct vpci {
> >>>           /* FIXME: currently there's no support for SR-IOV. */
> >>>       } header;
> >>>   
> >>> +#ifdef CONFIG_PCI_MSI_INTERCEPT
> >>>       /* MSI data. */
> >>>       struct vpci_msi {
> >>>         /* Address. */
> >>> @@ -136,6 +137,7 @@ struct vpci {
> >>>               struct vpci_arch_msix_entry arch;
> >>>           } entries[];
> >>>       } *msix;
> >>> +#endif /* CONFIG_PCI_MSI_INTERCEPT */
> >>
> >> Note that here you just remove two pointers from the struct, not that
> >> I'm opposed to it, but it's not that much space that's saved anyway.
> >> Ie: it might also be fine to just leave them as NULL unconditionally
> >> on Arm.
> > 
> > Can the two pointers be NULL on x86? If not, then I would prefer if they 
> > disappear on Arm so there is less chance to make any mistake (such as 
> > unconditionally accessing the pointer in common code).
> 
> Alternative proposal: How about making it effectively impossible to
> de-reference the pointer on Arm by leaving the field there, but having
> the struct definition available on non-Arm only?

We could place the struct definitions somewhere else protected by
CONFIG_PCI_MSI_INTERCEPT, but I'm not sure that would be much
different than the current proposal, and overall I think I prefer this
approach then, as we keep the definition and the usage closer
together.

Maybe we could slightly modify the current layout so that
the field is always present, but the struct definition is made
conditional to CONFIG_PCI_MSI_INTERCEPT?

Thanks, Roger.



 


Rackspace

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