Commit 1da19c5c authored by Sean Christopherson's avatar Sean Christopherson
Browse files

iommu/amd: KVM: SVM: Delete now-unused cached/previous GA tag fields



Delete the amd_ir_data.prev_ga_tag field now that all usage is
superfluous.

Reviewed-by: default avatarVasant Hegde <vasant.hegde@amd.com>
Tested-by: default avatarSairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-8-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 0a917e9d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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);
	}
+0 −1
Original line number Diff line number Diff line
@@ -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;
+0 −10
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;