]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iommu/amd: KVM: SVM: Delete now-unused cached/previous GA tag fields
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:09 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:52:55 +0000 (13:52 -0700)
Delete the amd_ir_data.prev_ga_tag field now that all usage is
superfluous.

Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/iommu.c
include/linux/amd-iommu.h

index 7f7af8ff627d12893377b7a92c6f664534a4841f..38cdfb052a3a9727ee1376aaea887dd70d15123b 100644 (file)
@@ -939,9 +939,7 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
                /**
                 * Here, pi is used to:
                 * - Tell IOMMU to use legacy mode for this interrupt.
-                * - Retrieve ga_tag of prior interrupt remapping data.
                 */
-               pi.prev_ga_tag = 0;
                pi.is_guest_mode = false;
                ret = irq_set_vcpu_affinity(host_irq, &pi);
        }
index ccbab3a4811adfb4038caeac2ad0627f431d7c2a..053a0f05768c3e6dd13a87aa93cd08f31642ba9e 100644 (file)
@@ -1054,7 +1054,6 @@ struct irq_2_irte {
 };
 
 struct amd_ir_data {
-       u32 cached_ga_tag;
        struct amd_iommu *iommu;
        struct irq_2_irte irq_2_irte;
        struct msi_msg msi_entry;
index 3117d99cf83d0d8cc46b0c4f13b2c6c1d497c4f4..ed96050d4933b7055bdda051ffd0518257222542 100644 (file)
@@ -3887,23 +3887,13 @@ static int amd_ir_set_vcpu_affinity(struct irq_data *data, void *vcpu_info)
        ir_data->cfg = irqd_cfg(data);
        pi_data->ir_data = ir_data;
 
-       pi_data->prev_ga_tag = ir_data->cached_ga_tag;
        if (pi_data->is_guest_mode) {
                ir_data->ga_root_ptr = (pi_data->base >> 12);
                ir_data->ga_vector = vcpu_pi_info->vector;
                ir_data->ga_tag = pi_data->ga_tag;
                ret = amd_iommu_activate_guest_mode(ir_data);
-               if (!ret)
-                       ir_data->cached_ga_tag = pi_data->ga_tag;
        } else {
                ret = amd_iommu_deactivate_guest_mode(ir_data);
-
-               /*
-                * This communicates the ga_tag back to the caller
-                * so that it can do all the necessary clean up.
-                */
-               if (!ret)
-                       ir_data->cached_ga_tag = 0;
        }
 
        return ret;
index 062fbd4c9b772b3c0443f99f58be1ed579cf22f8..1f9b13d803c5d559705c2a6ad42110721cc68f96 100644 (file)
@@ -19,8 +19,8 @@ struct amd_iommu;
  */
 struct amd_iommu_pi_data {
        u32 ga_tag;
-       u32 prev_ga_tag;
        u64 base;
+
        bool is_guest_mode;
        struct vcpu_data *vcpu_data;
        void *ir_data;