<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/amd-iommu.h, branch v6.18.21</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.21'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-23T16:50:51+00:00</updated>
<entry>
<title>iommu/amd: KVM: SVM: Allow KVM to control need for GA log interrupts</title>
<updated>2025-06-23T16:50:51+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:46:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b9e53f9ff4a88f01b22524878c9a381a6c5f65ff'/>
<id>urn:sha1:b9e53f9ff4a88f01b22524878c9a381a6c5f65ff</id>
<content type='text'>
Add plumbing to the AMD IOMMU driver to allow KVM to control whether or
not an IRTE is configured to generate GA log interrupts.  KVM only needs a
notification if the target vCPU is blocking, so the vCPU can be awakened.
If a vCPU is preempted or exits to userspace, KVM clears is_run, but will
set the vCPU back to running when userspace does KVM_RUN and/or the vCPU
task is scheduled back in, i.e. KVM doesn't need a notification.

Unconditionally pass "true" in all KVM paths to isolate the IOMMU changes
from the KVM changes insofar as possible.

Opportunistically swap the ordering of parameters for amd_iommu_update_ga()
so that the match amd_iommu_activate_guest_mode().

Note, as of this writing, the AMD IOMMU manual doesn't list GALogIntr as
a non-cached field, but per AMD hardware architects, it's not cached and
can be safely updated without an invalidation.

Link: https://lore.kernel.org/all/b29b8c22-2fd4-4b5e-b755-9198874157c7@amd.com
Cc: Vasant Hegde &lt;vasant.hegde@amd.com&gt;
Cc: Joao Martins &lt;joao.m.martins@oracle.com&gt;
Link: https://lore.kernel.org/r/20250611224604.313496-62-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu/amd: KVM: SVM: Set pCPU info in IRTE when setting vCPU affinity</title>
<updated>2025-06-23T16:50:39+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:45:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f965255dc5033387ac7858787c6c792fd789ac34'/>
<id>urn:sha1:f965255dc5033387ac7858787c6c792fd789ac34</id>
<content type='text'>
Now that setting vCPU affinity is guarded with ir_list_lock, i.e. now that
avic_physical_id_entry can be safely accessed, set the pCPU info
straight-away when setting vCPU affinity.  Putting the IRTE into posted
mode, and then immediately updating the IRTE a second time if the target
vCPU is running is wasteful and confusing.

This also fixes a flaw where a posted IRQ that arrives between putting
the IRTE into guest_mode and setting the correct destination could cause
the IOMMU to ring the doorbell on the wrong pCPU.

Link: https://lore.kernel.org/r/20250611224604.313496-44-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu/amd: KVM: SVM: Infer IsRun from validity of pCPU destination</title>
<updated>2025-06-23T16:50:37+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:45:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08d9ccdd1a5c75d7aca7ac3af56f723d780dd6ac'/>
<id>urn:sha1:08d9ccdd1a5c75d7aca7ac3af56f723d780dd6ac</id>
<content type='text'>
Infer whether or not a vCPU should be marked running from the validity of
the pCPU on which it is running.  amd_iommu_update_ga() already skips the
IRTE update if the pCPU is invalid, i.e. passing %true for is_run with an
invalid pCPU would be a blatant and egregrious KVM bug.

Tested-by: Sairaj Kodilkar &lt;sarunkod@amd.com&gt;
Link: https://lore.kernel.org/r/20250611224604.313496-42-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu: KVM: Split "struct vcpu_data" into separate AMD vs. Intel structs</title>
<updated>2025-06-23T16:50:31+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53527ea1b70224d16d29edbd5c850456469f00ec'/>
<id>urn:sha1:53527ea1b70224d16d29edbd5c850456469f00ec</id>
<content type='text'>
Split the vcpu_data structure that serves as a handoff from KVM to IOMMU
drivers into vendor specific structures.  Overloading a single structure
makes the code hard to read and maintain, is *very* misleading as it
suggests that mixing vendors is actually supported, and bastardizing
Intel's posted interrupt descriptor address when AMD's IOMMU already has
its own structure is quite unnecessary.

Tested-by: Sairaj Kodilkar &lt;sarunkod@amd.com&gt;
Link: https://lore.kernel.org/r/20250611224604.313496-33-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu/amd: KVM: SVM: Use pi_desc_addr to derive ga_root_ptr</title>
<updated>2025-06-23T16:50:24+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:45:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4cdbaf9d81c8387da8b9b91567d4b0eb1b8a549'/>
<id>urn:sha1:c4cdbaf9d81c8387da8b9b91567d4b0eb1b8a549</id>
<content type='text'>
Use vcpu_data.pi_desc_addr instead of amd_iommu_pi_data.base to get the
GA root pointer.  KVM is the only source of amd_iommu_pi_data.base, and
KVM's one and only path for writing amd_iommu_pi_data.base computes the
exact same value for vcpu_data.pi_desc_addr and amd_iommu_pi_data.base,
and fills amd_iommu_pi_data.base if and only if vcpu_data.pi_desc_addr is
valid, i.e. amd_iommu_pi_data.base is fully redundant.

Cc: Maxim Levitsky &lt;mlevitsk@redhat.com&gt;
Reviewed-by: Joao Martins &lt;joao.m.martins@oracle.com&gt;
Reviewed-by: Vasant Hegde &lt;vasant.hegde@amd.com&gt;
Tested-by: Sairaj Kodilkar &lt;sarunkod@amd.com&gt;
Link: https://lore.kernel.org/r/20250611224604.313496-23-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu/amd: KVM: SVM: Delete now-unused cached/previous GA tag fields</title>
<updated>2025-06-20T20:52:55+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2025-06-11T22:45:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1da19c5ce0533796179d9e1b55e64bf78478c4c1'/>
<id>urn:sha1:1da19c5ce0533796179d9e1b55e64bf78478c4c1</id>
<content type='text'>
Delete the amd_ir_data.prev_ga_tag field now that all usage is
superfluous.

Reviewed-by: Vasant Hegde &lt;vasant.hegde@amd.com&gt;
Tested-by: Sairaj Kodilkar &lt;sarunkod@amd.com&gt;
Link: https://lore.kernel.org/r/20250611224604.313496-8-seanjc@google.com
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
</content>
</entry>
<entry>
<title>iommu/amd: remove return value of amd_iommu_detect</title>
<updated>2025-01-06T11:42:00+00:00</updated>
<author>
<name>Gao Shiyuan</name>
<email>gaoshiyuan@baidu.com</email>
</author>
<published>2025-01-03T16:58:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5bb494d5cbb9a3403ba8b1c8bc145b42fc119078'/>
<id>urn:sha1:5bb494d5cbb9a3403ba8b1c8bc145b42fc119078</id>
<content type='text'>
The return value of amd_iommu_detect is not used, so remove it and
is consistent with other iommu detect functions.

Signed-off-by: Gao Shiyuan &lt;gaoshiyuan@baidu.com&gt;
Reviewed-by: Vasant Hegde &lt;vasant.hegde@amd.com&gt;
Link: https://lore.kernel.org/r/20250103165808.80939-1-gaoshiyuan@baidu.com
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/amd: Clean up RMP entries for IOMMU pages during SNP shutdown</title>
<updated>2024-01-29T19:34:18+00:00</updated>
<author>
<name>Ashish Kalra</name>
<email>ashish.kalra@amd.com</email>
</author>
<published>2024-01-26T04:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f'/>
<id>urn:sha1:f366a8dac1b8fef28a470d4e67b9843ebb8e2a1f</id>
<content type='text'>
Add a new IOMMU API interface amd_iommu_snp_disable() to transition
IOMMU pages to Hypervisor state from Reclaim state after SNP_SHUTDOWN_EX
command. Invoke this API from the CCP driver after SNP_SHUTDOWN_EX
command.

Signed-off-by: Ashish Kalra &lt;ashish.kalra@amd.com&gt;
Signed-off-by: Michael Roth &lt;michael.roth@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20240126041126.1927228-20-michael.roth@amd.com
</content>
</entry>
<entry>
<title>iommu/amd: Don't rely on external callers to enable IOMMU SNP support</title>
<updated>2024-01-29T16:19:28+00:00</updated>
<author>
<name>Ashish Kalra</name>
<email>ashish.kalra@amd.com</email>
</author>
<published>2024-01-26T04:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=04d65a9dbb33e20500005e151d720acead78c539'/>
<id>urn:sha1:04d65a9dbb33e20500005e151d720acead78c539</id>
<content type='text'>
Currently, the expectation is that the kernel will call
amd_iommu_snp_enable() to perform various checks and set the
amd_iommu_snp_en flag that the IOMMU uses to adjust its setup routines
to account for additional requirements on hosts where SNP is enabled.

This is somewhat fragile as it relies on this call being done prior to
IOMMU setup. It is more robust to just do this automatically as part of
IOMMU initialization, so rework the code accordingly.

There is still a need to export information about whether or not the
IOMMU is configured in a manner compatible with SNP, so relocate the
existing amd_iommu_snp_en flag so it can be used to convey that
information in place of the return code that was previously provided by
calls to amd_iommu_snp_enable().

While here, also adjust the kernel messages related to IOMMU SNP
enablement for consistency/grammar/clarity.

Suggested-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Signed-off-by: Ashish Kalra &lt;ashish.kalra@amd.com&gt;
Co-developed-by: Michael Roth &lt;michael.roth@amd.com&gt;
Signed-off-by: Michael Roth &lt;michael.roth@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Acked-by: Joerg Roedel &lt;jroedel@suse.de&gt;
Link: https://lore.kernel.org/r/20240126041126.1927228-4-michael.roth@amd.com
</content>
</entry>
<entry>
<title>iommu/amd: Remove amd_iommu_device_info()</title>
<updated>2023-10-06T14:01:54+00:00</updated>
<author>
<name>Vasant Hegde</name>
<email>vasant.hegde@amd.com</email>
</author>
<published>2023-10-06T09:57:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37b282fa04dd7b9bfa7c290fe07ef1730444debb'/>
<id>urn:sha1:37b282fa04dd7b9bfa7c290fe07ef1730444debb</id>
<content type='text'>
No one is using this function. Hence remove it. Also move PCI device
feature detection flags to amd_iommu_types.h as its only used inside
AMD IOMMU driver.

Signed-off-by: Vasant Hegde &lt;vasant.hegde@amd.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Reviewed-by: Jerry Snitselaar &lt;jsnitsel@redhat.com&gt;
Tested-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://lore.kernel.org/r/20231006095706.5694-4-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
</feed>
