lkml.org 
[lkml]   [2023]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 04/10] iommufd/device: Wrap IOMMUFD_OBJ_HWPT_PAGING-only configurations
From
On 2023/10/25 14:46, Tian, Kevin wrote:
>> From: Liu, Yi L <yi.l.liu@intel.com>
>> Sent: Tuesday, October 24, 2023 11:06 PM
>> +
>> +static int iommufd_group_do_replace_paging(struct iommufd_group
>> *igroup,
>> + struct iommufd_hw_pagetable
>> *hwpt)
>> +{
>> + struct iommufd_hw_pagetable *old_hwpt = igroup->hwpt;
>> + struct iommufd_device *cur;
>> + int rc;
>> +
>> + lockdep_assert_held(&igroup->lock);
>> +
>> + if (hwpt_is_paging(old_hwpt) && hwpt->ioas != old_hwpt->ioas) {
>> + list_for_each_entry(cur, &igroup->device_list, group_item) {
>> + rc = iopt_table_enforce_dev_resv_regions(
>> + &hwpt->ioas->iopt, cur->dev, NULL);
>> + if (rc)
>> + goto err_unresv;
>> + }
>
> should be:
>
> if (!hwpt_is_paging(old_hwpt) || hwpt->ioas != old_hwpt->ioas) {
> ...

oh, yes. The original logic is to add resv region when the ioas are
different between new and old hwpts. But now, if the old hwpt is not
paging, then it's already needed to add resv regions in the ioas.

Regards,
Yi Liu

\
 
 \ /
  Last update: 2023-10-25 12:02    [W:0.090 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site