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

Re: [PATCH v3 05/10] IOMMU: add common API for device reserved memory


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 4 Aug 2022 16:41:51 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=YfwZr4EZZzn06f7sL4MeDRRnzsJu3Md8kd84kfoW528=; b=hZKSdepwY/lC2WTgPM5SPfzdUF3Zs1FbMP1CgUcmucyyaSM21NyByQ/Cuprtxwq394Cb4JN6A8ebOhtu3sdcNS5YQqAUAAq1pnGPHxuKqZCdlRl7uFNDx+UDRQCYL419P7emm+Lpf2nLOAsiG7+AmUG9SeH1tviohayist6+WnRmC+S/vtKLoduIKaUQPwzB3jkMJk2ofR+id2PNXlH5ERQ1gnEDXjXmIcUQ3BXwYa8KH2LGtaxabdWpPL01xX2tpoRrsm760/KqmwQSpL6A7MMTXSBoXXJRBiUxbkm9Vwu6D/bj3mcsx3P/twb1PnEZVIbvYhPWCrh3R1uUkM+Iyg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2LKgEIAGm9ejo/vL8CUuHt76lLTkW1614tOEFoPPV9+iVwRSqA5zVhVIQKD+/4QtN2IMUV1MjM/wp+id0TXUGH/V6JkB7ZViN/v/YZlCA9/gbkiRbXyBx38y9yKT2eaMNfijtfqzpRwzdeBbk25gJRG0+PzTzes7AoiNC97njqzVX5gpPJZtYN4MXs1emN+jCWtZZGmX3bc08rxdr0hHPQtpsIFPaEoch95IJlSkxSvXyCf2eL+6OFBWUp0xavCp3yz/vzigvcgCHXZzIIbqK5PiC5hoLIztP/kyjqRAd0qVL9Fl4IweeQ90/37iO6Siy+4YICHUsBLZ4tL7q8yMA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 04 Aug 2022 14:41:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.08.2022 16:38, Marek Marczykowski-Górecki wrote:
> On Thu, Aug 04, 2022 at 04:25:38PM +0200, Jan Beulich wrote:
>> On 26.07.2022 05:23, Marek Marczykowski-Górecki wrote:
>>> --- a/xen/drivers/passthrough/iommu.c
>>> +++ b/xen/drivers/passthrough/iommu.c
>>> @@ -651,6 +651,51 @@ bool_t iommu_has_feature(struct domain *d, enum 
>>> iommu_feature feature)
>>>      return is_iommu_enabled(d) && test_bit(feature, 
>>> dom_iommu(d)->features);
>>>  }
>>>  
>>> +#define MAX_EXTRA_RESERVED_RANGES 20
>>> +struct extra_reserved_range {
>>> +    unsigned long start;
>>> +    unsigned long nr;
>>> +    uint32_t sbdf;
>>
>> It's not easy to judge why this isn't pci_sbdf_t when no callers
>> exist at this point.
> 
> I'm following here types used in the rest of IOMMU code. Especially,
> this field is later passed to iommu_grdm_t func, which is:
> 
> typedef int iommu_grdm_t(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctxt);
>                                                           ^^^^
> 
> I can probably use pci_sbdf_t here, but it will be cast to u32 later
> anyway...

No, rather than a cast you'd use the union's sbdf field. And yes, eventually
that function typedef you refer to will want switching to pci_sbdf_t as well.

Jan



 


Rackspace

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