From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C4DA36895D for ; Mon, 24 Aug 2026 12:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787574237; cv=none; b=Bv/14lPm8cmq7RV23i8BN44dMXv/XUZv7a5aX55EU0+U+ClvQ/saPNCcOU+0+GFGtUb/StV7fvBCAt+9dH52vloVgW3oSQPELsebdOwCJK77X+zLzzEFlt+TJDnXrRKH70ZwILYoFRn4KIgeR1RQCLcjpGI7MARt0IbwH6pd/JU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787574237; c=relaxed/simple; bh=QQ+BuMhlGjap9G/8niHShlE1MGJ4y7C/XEXcy/s8Xx0=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=l3pR61Lmm0/IgaUfjL1lMV+QgpEuglgLsh5DMWUMhml7XvsbYFTJckVoCJvC3P+M+1/1MxbGwYulwZJw2LsCz/4zgrOdGluJJ131/4BZLrfaSWZ45uVFqGE+XCRJg2/1my5YPrWzlL8sScpyI+0xlyUZO6jc+XxWzg3HklaQ5Q4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--praan.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ITBMgZIN; arc=none smtp.client-ip=209.85.215.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--praan.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ITBMgZIN" Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cbedf6e8a42so4200074a12.1 for ; Mon, 24 Aug 2026 05:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1787574235; x=1788179035; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:mime-version:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tUcMgUMCUzyieEAsi81dwAASFx0SSottK9MrWICMjZA=; b=ITBMgZINcRwx84/FmmHQdROwkYLlsscnX1CNp1aBIlGnak81seFaCCe5dxgHAPZgK4 lhisEEieq0xiP8VtRl6bKj78ydPvdq8pSoAIzGcvHBCLscu1kuMjP0i0UajyYYPeKZiJ n/eTF9Ug8BRw2M90ZNOtOrbsvTiucoXBRgkiKzLUcSgGwFZqpxok+6t+mjVBuhZPcI30 YIdVWVAYC5uwiTLmmyJtMGo2zUtouDyX8e2qRiloNQQwIWEsP5YXWht9inMbe1eBvimU xxnS9BO5NW6feISxJZIhxeCvnBvcIfIBJqoSTbx95QNMGVHO1yOA37P7snRFl+Kl55Nz bhTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787574235; x=1788179035; h=content-type:cc:to:from:subject:message-id:mime-version:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tUcMgUMCUzyieEAsi81dwAASFx0SSottK9MrWICMjZA=; b=H4h6NFuHE6Z+JT9IMVZ8kBPOXFsPe7455FE57HuBHkJYDHgf7HPBqnDZ24X/f2YoRZ ue7FBeAwlcDJKEconl3MbnLkHkmCo3FJPOrw5PV4qqZZZShRm40xCTzSSsjgZ1wfuaT4 TeOgpAuuZv8r6ZsAanumSei/SJjBvdPwEgl8RZIsOVnNo77OLp6IePl7bVIaTGwXJbP1 jaROeqW31J7ePPICOFTSwp07brnLYTk/8J2CEBDOF+krXtjnpefN9OxvvNZJqLfTW58K KPHkiJ1MrhfWWyC6USjWe2/Ngu0hxw16VvdiXigeSWlijCDohJ+JLkNjn9K1Blg8k0Qb L9MQ== X-Forwarded-Encrypted: i=1; AHgh+RqlQ/HAvfhx7AxFpSysG0vQFAex6qCJyscfQdNBINk+Yf0Z5Zruf21Q/0LFCf4LvXCmEWjz9jw5yHrgYBk=@vger.kernel.org X-Gm-Message-State: AFuF++k3UAESG/29XSxqAxhfdDvxCy7je8CKbaSzYI5PKxPgiekNm8XD RRJHkQaXx6ldUKWZuoHiy1kt6IbW0fIPRTzGRf7vX4k7dfmhgiwl9ow0lVwEs7OLjiBPWcMO5sa wvw== X-Received: from pfbfr20.prod.google.com ([2002:a05:6a00:8114:b0:845:b9e9:fcd1]) (user=praan job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:a110:b0:3c3:bbe6:95c9 with SMTP id adf61e73a8af0-3cd301795c8mr46911339637.16.1787574235313; Mon, 24 Aug 2026 05:23:55 -0700 (PDT) Date: Mon, 24 Aug 2026 12:23:42 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.55.0.766.g2966f0265a-goog Message-ID: <20260824122347.1588592-1-praan@google.com> Subject: [PATCH v3 0/5] iommu/amd: Refactors for ATS robustness From: Pranjal Shrivastava To: iommu@lists.linux.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joerg Roedel , Suravee Suthikulpanit , Vasant Hegde , Ankit Soni , Jason Gunthorpe , Bjorn Helgaas , Samiullah Khawaja , Pranjal Shrivastava Content-Type: text/plain; charset="UTF-8" This series forms the second half of the subsystem-wide ATS robustness updates. The first part (focusing on the core subsystem, Intel, and ARM SMMUv3) has already been merged upstream [1]. This half addresses the AMD IOMMU driver and standardizes the PCI ATS API. In v2, the series has been significantly restructured based on feedback on v1. [v3] - Collected Reviewed-by tags from Vasant. - Added a comment explaining why devices without DMA translation support are not ignored (to preserve interrupt remapping) per Vasant's feedback. - Renamed iommu_disable_device_dma() to iommu_disable_device() to accurately reflect that it disables both DMA and interrupt remapping. [v2] - https://lore.kernel.org/all/20260814015647.3370124-1-praan@google.com/ - Patch 1 Refctors the probe path, isolating capabilities into iommu_init_device_caps(). - Patch 2 renames iommu_ignore_device() to iommu_disable_device_dma(). Following Jason's suggestion, it invalidates the hardware DTE by clearing the Valid bit (lower 128 bits) followed by the upper 128 bits. - Patch 3 splits the probe error paths to ensure that devices with config failures (like PD_MODE_NONE or ATS mismatches) can preserve their rlookup_table entries, successfully keeping IRQ remapping functional for bypassed devices. - Patch 4 implements the "Fail Hard" pattern for ATS in the AMD driver, failing the probe and throwing a WARN_ON() upon ATS configuration or enablement failures. - Patch 5 enforces the checking of pci_ats_supported() prior to calling pci_prepare_ats() across the entire kernel PCI subsystem. [v1] - https://lore.kernel.org/all/20260601134204.2150602-1-praan@google.com/ Thanks, Praan [1] https://lore.kernel.org/all/20260615235037.259909-1-praan@google.com/ Pranjal Shrivastava (5): iommu/amd: Refactor device probe and capability initialization iommu/amd: Fix DTE clearing and rename iommu_ignore_device() iommu/amd: Split probe error paths to preserve IRQ remapping iommu/amd: Fail probe on ATS configuration failure PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats() drivers/iommu/amd/iommu.c | 199 +++++++++++++++++++++++--------------- drivers/pci/ats.c | 6 +- 2 files changed, 126 insertions(+), 79 deletions(-) -- 2.55.0.766.g2966f0265a-goog