Commit b1fe7f2c authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files
parent 0a0a6800
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -175,18 +175,14 @@ static int modify_irte(struct irq_2_iommu *irq_iommu,
	irte = &iommu->ir_table->base[index];

	if ((irte->pst == 1) || (irte_modified->pst == 1)) {
		bool ret;

		ret = cmpxchg_double(&irte->low, &irte->high,
				     irte->low, irte->high,
				     irte_modified->low, irte_modified->high);
		/*
		 * We use cmpxchg16 to atomically update the 128-bit IRTE,
		 * and it cannot be updated by the hardware or other processors
		 * behind us, so the return value of cmpxchg16 should be the
		 * same as the old value.
		 */
		WARN_ON(!ret);
		u128 old = irte->irte;
		WARN_ON(!try_cmpxchg128(&irte->irte, &old, irte_modified->irte));
	} else {
		WRITE_ONCE(irte->low, irte_modified->low);
		WRITE_ONCE(irte->high, irte_modified->high);
+66 −59
Original line number Diff line number Diff line
@@ -201,6 +201,8 @@ static inline void detect_intel_iommu(void)
#endif /* CONFIG_DMAR_TABLE */

struct irte {
	union {
		struct {
			union {
				/* Shared between remapped and posted mode*/
				struct {
@@ -265,6 +267,11 @@ struct irte {
				__u64 high;
			};
		};
#ifdef CONFIG_IRQ_REMAP
		__u128 irte;
#endif
	};
};

static inline void dmar_copy_shared_irte(struct irte *dst, struct irte *src)
{