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

Re: [PATCH] iommu: add preemption support to iommu_{un,}map()


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 28 Jun 2022 15:58:36 +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=HjZFOURuPIESZfi6d8SlnLFqG4BLVKxR6BwdSzb4BBE=; b=Uc19MZe4LiKX7bd7U5CKgbHwxpzPoCVlTwRbCz9Ik9O+2LYoUhj5wPF/YG3WBd/VFRYcncZZnxFRcfJD5NoQrP+F+4GVxfIRkNMhSbtBd3tn7Ta/qkjIDHmG37K7sb8LeZZWA5GXCLxWcV90WRKdbDzNZ9WCnb3Vxs5ZoaUPUTN8LQw6h/108aqRJNP4o4vkBrOu5A+I+SDx7smyV86+FKsjwjpsyFhxHergc1UGwWPdSgvE/4lTyhyO89xg0SC2VdfoJNP/EJ3zaMPH5jq18Zku/SVzQVLkmq3GLzYGl21piUraJxn06rnW4b5rKv8Y+JQLzzNWUnQikfUF1Cokzw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UQsRSBnSKztSRaqxGxNp+msaGtSnB1LQs9+u2zxpYpq7BZYytXgMxM+xVmnGrEoe40MIPFiut+blTzX2p9QuF1t7z/KqaBMBGx9eFpFJy4CQrRQEx+OK0Ucik9KwJuHZ0Df6vSA++2vfUxRmXpEbQhJX53p/eLFrf9KXaes8FvigU3xhXV2GL1UpFVHwOjaNxnkyRLocHLR5gpP/4ul158sngYZmIaATUD0tnwfhGGserMwhxAAfvFlAtHkhO6raHloy7NGFvjh20cGi6e741XWwaczK6z98gyubkVgR4gWPqPYBblgcXq98FUyClq4TXHJdUdtlmiBhf2yFDy1wiw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 28 Jun 2022 13:58:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.06.2022 15:08, Roger Pau Monné wrote:
> On Thu, Jun 23, 2022 at 11:49:00AM +0200, Jan Beulich wrote:
>> On 10.06.2022 10:32, Roger Pau Monne wrote:
>>> --- a/xen/include/xen/iommu.h
>>> +++ b/xen/include/xen/iommu.h
>>> @@ -155,10 +155,10 @@ enum
>>>  
>>>  int __must_check iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
>>>                             unsigned long page_count, unsigned int flags,
>>> -                           unsigned int *flush_flags);
>>> +                           unsigned int *flush_flags, unsigned long *done);
>>>  int __must_check iommu_unmap(struct domain *d, dfn_t dfn,
>>>                               unsigned long page_count,
>>> -                             unsigned int *flush_flags);
>>> +                             unsigned int *flush_flags, unsigned long 
>>> *done);
>>
>> While I'm okay with adding a 6th parameter to iommu_unmap(), I'm afraid
>> I don't really like adding a 7th one to iommu_map(). I'd instead be
>> inclined to overload the return values of both functions, with positive
>> values indicating "partially done, this many completed".
> 
> We need to be careful then so that the returned value is not
> overflowed by the input count of pages, which is of type unsigned
> long.

Of course.

>> The 6th
>> parameter of iommu_unmap() would then be a "flags" one, with one bit
>> identifying whether preemption is to be checked for. Thoughts?
> 
> Seems fine, but we migth want to do the same for iommu_unmap() in
> order to keep a consistent interface between both?  Not strictly
> required, but it's always better in order to avoid mistakes.

That was the plan - both functions would then have a "flags" parameter,
replacing unmap()'s order one.

> Are you OK with doing the changes and incorporating into your series?

Of course. I was merely waiting with doing the integration until having
feedback from you on my questions / remarks. Thanks for that.

Jan



 


Rackspace

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