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

Re: [PATCH v1 2/4] xen/pci: Introduce new CONFIG_HAS_PCI_ATS flag for PCI ATS functionality.



On 28.10.2020 00:55, Stefano Stabellini wrote:
> On Mon, 26 Oct 2020, Rahul Singh wrote:
>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -20,6 +20,7 @@ config X86
>>      select HAS_NS16550
>>      select HAS_PASSTHROUGH
>>      select HAS_PCI
>> +    select HAS_PCI_ATS

>From an abstract perspective - is there a way to have a PCI
subsystem where it is impossible for an ATS-capable devices to
be present? I think this shouldn't be a HAS_* option, but an
ordinary user selectable one. We may then even want to consider
having it off by default on x86 (the command line option
defaults to off as well, after all).

>> @@ -48,5 +50,27 @@ static inline int pci_ats_device(int seg, int bus, int 
>> devfn)
>>      return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
>>  }
>>  
>> +#else
>> +
>> +static inline int enable_ats_device(struct pci_dev *pdev,
>> +                                    struct list_head *ats_list)
>> +{
>> +    return -ENODEV;
>> +}
>> +
>> +static inline void disable_ats_device(struct pci_dev *pdev) { }
>> +
>> +static inline int pci_ats_enabled(int seg, int bus, int devfn)
>> +{
>> +    return -ENODEV;
>> +}
> 
> pci_ats_enabled returns 0 when ATS is not enabled
> 
> 
>> +static inline int pci_ats_device(int seg, int bus, int devfn)
>> +{
>> +    return -ENODEV;
> 
> also returns 0 when ATS is not enabled

And really both ought to be returning bool.

Jan



 


Rackspace

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