Re: Invalidation in SMMU v3

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

 



Hi Valmiki,

On 03/12/17 13:56, valmiki wrote:
> Hi Jean,
> 
> In PASID flow arm_smmu_atc_inv_master_all is called where size and iova 
> of arm_smmu_atc_inv_to_cmd are zero and  no address is being filled in 
> struct arm_smmu_cmdq_ent->atc.addr.
> So how will smmu hardware know if there are any ats translations 
> requested or not ?
> How invalidation are carried out in PASID flow w.r.t address and size?

arm_smmu_atc_inv_master_all() is used to invalidate the whole address
space, for example when unbinding a process address space from the master.

The encoding is a bit special: when addr and size are 0,
arm_smmu_atc_inv_to_cmd() sets cmd->atc.size to 52, which according to the
SMMUv3 spec corresponds to a 2^64 byte span, meaning invalidate all. The
SMMU then converts this command into a PCIe ATC invalidation (with bits
62:12 all 1b and bit 63 = 0b, according to the ATS spec 2.3.2)

Smaller invalidations will go via arm_smmu_atc_inv_domain(), and
arm_smmu_atc_inv_to_cmd() will compute the appropriate range that covers
the requested address and size.

In more details, when a range is unmapped from a process (with munmap()
for example), the MMU notifier calls our invalidate_range() callback,
which calls arm_smmu_atc_inv_domain() with the right PASID. When a process
exits or unbind() is called, we use arm_smmu_atc_inv_master_all() with its
PASID.

Thanks,
Jean



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux