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

Re: [PATCH v3 2/3] xen/pci: Refactor PCI MSI intercept related code


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Thu, 29 Apr 2021 11:31:15 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=USL8mQT5el1o/fEf63MaGqw+KZW/W8Fc8WnR4UffJko=; b=BN4mRMAVo1djmEYFG1dsvz7oyJDwL07pRs4sr/P/vg8yL25j+AdVgJwokkjqrUjRTxXccAlY7NVPvi6d3Tj9Nv9AvVJ33qUNfW0QsJGJO6WQGta/PFykko0soR+SCBBVtSsR+uByDbbe0rSi8RnIq5noMTMYEydPzZRV9J4nlEcO3JZQgeUJOZoGqjZbMHoK7AiX3duBiYqhooyPUecZVrx60iOu8wbymIQ2ZtGLN3bxvz3x560RbbEfABz6eNWy5NLz9LV331TqBxHhsaizglE55J/VmZGrbaPHTxThq78XgN83u+cxLNLxF18Py7WlmynRBvLIrnwCpfqxb2UaEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L4Rx/1MoCgE5RARAY4ceKVo2GbEazUNhmyPQMsDVtCNiOzmmzvMX39rTSJmQ9bZbJjzBLAN0goJKe+YjFnfzStHsnR+nsRrwoP5h797NgKV147ijXLbhuhcrg6p2Zx9M/TvJ6qPDzz2v6ReVL5iT+/9bAY4SVRw6NuAj290DIsjNqEBzfSrnIJnZW/cqQk47BnD47p4Lcon5eZFzoeDeibxsgMOpP7UDAl2A4uiDojeODq4Or+dDK2+BtmFvN6xKjspAR45kMGRRedIgZj7qbJTV/J7iIOn38mO2mgS7rbmlVQVSGXsxpuOMtY4lCigfPgfNuWspoNM/ElIMNWQa5A==
  • Authentication-results-original: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  • Delivery-date: Thu, 29 Apr 2021 11:31:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXOrhr42FH3XtdSEulNtIMBWAh5arJ+c6AgAFnEwA=
  • Thread-topic: [PATCH v3 2/3] xen/pci: Refactor PCI MSI intercept related code

Hi Jan,

> On 28 Apr 2021, at 3:06 pm, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 26.04.2021 18:21, Rahul Singh wrote:
>> --- a/xen/xsm/flask/hooks.c
>> +++ b/xen/xsm/flask/hooks.c
>> @@ -21,7 +21,7 @@
>> #include <xen/guest_access.h>
>> #include <xen/xenoprof.h>
>> #include <xen/iommu.h>
>> -#ifdef CONFIG_HAS_PCI
>> +#ifdef CONFIG_PCI_MSI_INTERCEPT
>> #include <asm/msi.h>
>> #endif
>> #include <public/xen.h>
>> @@ -114,7 +114,7 @@ static int get_irq_sid(int irq, u32 *sid, struct 
>> avc_audit_data *ad)
>>         }
>>         return security_irq_sid(irq, sid);
>>     }
>> -#ifdef CONFIG_HAS_PCI
>> +#ifdef CONFIG_PCI_MSI_INTERCEPT
>>     {
>>         struct irq_desc *desc = irq_to_desc(irq);
>>         if ( desc->msi_desc && desc->msi_desc->dev ) {
>> @@ -874,7 +874,7 @@ static int flask_map_domain_pirq (struct domain *d)
>> static int flask_map_domain_msi (struct domain *d, int irq, const void *data,
>>                                  u32 *sid, struct avc_audit_data *ad)
>> {
>> -#ifdef CONFIG_HAS_PCI
>> +#ifdef CONFIG_PCI_MSI_INTERCEPT
>>     const struct msi_info *msi = data;
>>     u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
>> 
>> @@ -940,7 +940,7 @@ static int flask_unmap_domain_pirq (struct domain *d)
>> static int flask_unmap_domain_msi (struct domain *d, int irq, const void 
>> *data,
>>                                    u32 *sid, struct avc_audit_data *ad)
>> {
>> -#ifdef CONFIG_HAS_PCI
>> +#ifdef CONFIG_PCI_MSI_INTERCEPT
>>     const struct pci_dev *pdev = data;
>>     u32 machine_bdf = (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn;
>> 
> 
> Is all of this really related to MSI interception? Iirc the code here
> has been around for much longer, and hence is more related to MSI
> support in Xen in general (as required for PV guests in particular).

Yes I agree this code is not related to MSI interception but I decide to move 
the code 
under CONFIG_PCI_MSI_INTERCEPT flag to gate the code for ARM as to avoid an 
extra flag. We can modify this code once we have more data how MSI will be 
supported for other architecture.  

Regards,
Rahul
> 
> Jan




 


Rackspace

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