On 09.02.2024 09:25, Roger Pau Monné wrote:
> On Mon, Feb 05, 2024 at 02:57:12PM +0100, Jan Beulich wrote:
>> ..., thus allowing it and qinval_device_iotlb_sync() to become static.
>> There's nothing x86-specific about the function anyway. While moving,
>> adjust types to better match ./CODING_STYLE (albeit use of fixed-width
>> types for parameters is retained to limit the effective change).
>>
>> Signed-off-by: Jan Beulich <[email protected]>
> 
> Acked-by: Roger Pau Monné <[email protected]>

Thanks.

>> +static int dev_invalidate_iotlb(struct vtd_iommu *iommu, uint16_t did,
>> +                                paddr_t addr, unsigned int size_order,
>> +                                uint64_t type)
>> +{
>> +    struct pci_dev *pdev, *temp;
>> +    int ret = 0;
>> +
>> +    if ( !ecap_dev_iotlb(iommu->ecap) )
>> +        return ret;
>> +
>> +    list_for_each_entry_safe( pdev, temp, &iommu->ats_devices, ats.list )
>> +    {
>> +        bool sbit;
>> +        int rc = 0;
>> +
>> +        switch ( type )
>> +        {
>> +        case DMA_TLB_DSI_FLUSH:
>> +            if ( !device_in_domain(iommu, pdev, did) )
>> +                break;
>> +            /* fall through if DSI condition met */
>> +        case DMA_TLB_GLOBAL_FLUSH:
>> +            /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
>> +            sbit = 1;
>> +            addr = (~0UL << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
> 
> Given the MISRA stuff, won't it be better to append 'UL' here while
> moving?

Sure, done.

Jan

Reply via email to