<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.openanolis.cn/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.openanolis.cn/"
          
          maintainer="service@openanolis.org"
>

    <bug>
          <bug_id>9443</bug_id>
          
          <creation_ts>2024-06-28 14:27:14 +0000</creation_ts>
          <short_desc>[devel-6.6] iommu/dma: Fix not fully traversing iova reservations issue</short_desc>
          <delta_ts>2024-06-28 14:29:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>ANCK</classification>
          <product>ANCK 6.6 Dev</product>
          <component>X86</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3-Medium</priority>
          <bug_severity>S3-normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="LeoLiu-oc">LeoLiu-oc</reporter>
          <assigned_to name="Guanjun">guanjun</assigned_to>
          <cc>artie.ding</cc>
    
    
    <cc>dy01893908</cc>
    
    
    <cc>renyu.zj</cc>
          
          <qa_contact name="shuming">qingming.su</qa_contact>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>29356</commentid>
    <comment_count>0</comment_count>
    <who name="LeoLiu-oc">LeoLiu-oc</who>
    <bug_when>2024-06-28 14:27:14 +0000</bug_when>
    <thetext>For multiple devices in the same iommu group, sorted later devices (based
on Bus:Dev.Func) have the RMRR.

Sorted earlier device (without RMRR) initialized the iova domain causing
the sorted later device goto done_unlock.

Then, the sorted later device (with RMRR) cannot execute the
iova_reserve_iommu_regions to reserve the RMRR in the group&apos;s iova domain,
and other devices (in the same group) alloc iova in RMRR are permitted.

DMA iova addresses conflict with RMRR in this case.

There is a need to make sure all devices of the same group execute reserve
iova.

Substitute iova_reserve_iommu_regions with iova_reserve_pci_regions
(reserved PCI window)and iova_reserve_iommu_regions(reserved resv-region,
like RMRR and msi range). And then, goto iova_reserve_iommu_regions could
avoid the problem when if (iovad-&gt;start_pfn) is true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29357</commentid>
    <comment_count>1</comment_count>
    <who name="小龙">yongchao</who>
    <bug_when>2024-06-28 14:29:33 +0000</bug_when>
    <thetext>The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/3442</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>