From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (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 5BC0A3CB559 for ; Fri, 14 Aug 2026 01:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786672613; cv=none; b=ePxfhdXx2HyjLPftAuRJH6nDC/QUsYHkeRZDy0YdW9BYu7ej5hCJ1WDI1NwMo/oxlpbrYbp8BjM1qOes9VE7xlOqqwe8uG7TLZLu/BC5Vg1G3CS1lMKxsclp5ZnmkCs4WzJFBQDcvY6J3tR1rTXZ5exoVLb+/wbyzxKigikn6yA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786672613; c=relaxed/simple; bh=NCd+j7nYxNHdzjcZFSHtTXKm1kUiQw8psOs+qwO+fZQ=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=n5MLpLn2VbBW5o7667044DIyCiGhQabjjsARCbjs2kojYcjwCgTQ6zRUD55llt7tlMyqjAc2HzrUzfo4cKaNPi6/727q2det/GpRiJFTDQJdNl99va8Isrtt9jQaL8QoEKnpGRbuEcn+qo5otKWPLdVCtdNF5qWROPS0cC4H+pk= 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=s205sK3N; arc=none smtp.client-ip=209.85.215.198 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="s205sK3N" Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c89704da8c7so604651a12.0 for ; Thu, 13 Aug 2026 18:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786672611; x=1787277411; 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=OUkFjlhYb4V9G0SD2iUKbc3ig8CtlYc6GojhAFo6lwA=; b=s205sK3NX7/kVENySj7ID+5WZH/fBeTJ4e+PusmyYjP6zkOR89HadYuPDDPhh1U7of szlFfHBTHLkX3QqsJ3D/9nzj0N8NKs3ldV9Wiu1QuQyw5t2AdBiAwzB95y7jT7vYLJm0 DRKW1P+hUo7m1z/tuzroDwli+/AHI7WFVBlduEW/HQyEDGtG5bK9j37aUusW86fbHMYQ K/6kcZWKQPSEQjtHHLbrSoiEGZZHBKmzM5lt9fyY5wePYfcDaHG/meBqXO8qJuN4QbzH k3u1/FMJDnBd2Fgaan8uJtx0n94ad2XCq2FwWhbMVhiCoEJQeJg5Sz4QBdCWv6pfsfWq TPjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786672611; x=1787277411; 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=OUkFjlhYb4V9G0SD2iUKbc3ig8CtlYc6GojhAFo6lwA=; b=k46I4HfLBxfRYZmVf/B8IOx7Cjj8JIXxX/SiEDeTtfGLAzD2cCxedDfbFna3Rl5WPH McUPFvL+FClxMPDwA2oeUjDsj9HAz8F/v2Yf8sb5ihiaEpvhRNRetJFv/TWOhPhMIq47 T48Y2uxsmJYJwWxq/goWbZAtLe3gfmNLjKXHkkCzDsPVieJfdQ0cK1tZ+Mu0N9Mr+Lpj WY/crt23Hgr/Hz/rwbt0d7jDvmU3QQ3FQfTD5Cf1XROs0H69z5sLfbgFUa/tX2yMKo8W zaAHKFaaiKwxgKFNFQbCUQF8OZtVv2UTcigcS+ZJ4tdGHan4aIiJJw0fRE7zqSuEL1/w pppA== X-Forwarded-Encrypted: i=1; AHgh+RrGdlgqeTReCgWKj/VtHt0GLyejs7M9SkSHnFCoNm2vu+jp94IZLCYgUfMLl5npbmrGWDG/g9QMlPxTA4Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxzGWTvnBVqji0vjQZuksW9NNgpals4goBfydTh5zFKUP+7eQWD Vi8MpOOz7MUf1kpq/DsyNcE9RMK5Be4i3zOb1E9OwDWJEWZJ/x4vzqIXFQK5M/A8c8hddUQ1aY7 nEg== X-Received: from dybia9.prod.google.com ([2002:a05:7301:309:b0:314:f66b:be54]) (user=praan job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:7a86:b0:3c3:875d:705e with SMTP id adf61e73a8af0-3cc71d7a018mr2488543637.19.1786672610589; Thu, 13 Aug 2026 18:56:50 -0700 (PDT) Date: Fri, 14 Aug 2026 01:56: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.691.gc56d675ccc-goog Message-ID: <20260814015647.3370124-1-praan@google.com> Subject: [PATCH v2 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. [v2] - 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 | 196 +++++++++++++++++++++++--------------- drivers/pci/ats.c | 6 +- 2 files changed, 122 insertions(+), 80 deletions(-) -- 2.55.0.691.gc56d675ccc-goog