Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2362074rdb; Mon, 5 Feb 2024 04:28:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmKYUqJEOOAbXrmH8rGLKEqrV2NiSGXP/cwPwCqh1WsmiYb9y6wqgT1JInuYNi8Nir+0dJ X-Received: by 2002:aa7:88d0:0:b0:6e0:520d:2ff4 with SMTP id k16-20020aa788d0000000b006e0520d2ff4mr252225pff.30.1707136085986; Mon, 05 Feb 2024 04:28:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707136085; cv=pass; d=google.com; s=arc-20160816; b=KvcjRCigzUNJMXQg5ljqW2BNbmakpkK3NV87yvRrja8ZCb22Qv4yjj/No8KmuQMb4d DQT76Uq2/HxpJCAqqQZjPD4wA4JuuiI32VcVDnHRX6elgkA4IVwYJv33kgt2vbw93tqg NyeKZh4HlGg+zFeWbN31nH3pxvgiRo6+Spk1gHoX/1zhyQdXuqqJHK1y0EDhzC5vRhqs Umm9dFQn8vXSI9Wsmdo5s5+sV2VqUyRsrS4TwK0UKE4F2jZUODhHHU417DhgyXHvmDJB oBGznNRMVs24v1/eqFiwDAv92brN4AALfop1v2Hanx5dEcxjGRvK1u6eELLmTBmb8U3m TKxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=J/26rYh9SEOln6y0M0icroO5+g+Mdt4aS3KBehgGFN8=; fh=gRSeUUzTNTDPKAgoj1wp2+9NvO5rMHaIRZnsWEMCztk=; b=ILQR0bz7n4kfaJ8RSJRQRsT/fY0aXqQX7+tTsCCSioS30deUSOZq9y+bA1MEQBWsvm UmIcPWguCogQ+feZAovWTiAV0UIvkOVIac13CWZW4LoWo7mC7f/c7LDH1vIhU4hvzxf8 DS3Yo8k2DDJrDb38GCEjDHXIVpXWvgHjefYvx1e1oCmU0DRv77axhXNXzlxSg29QjIV/ ydfRKWHVUjVsKts1RfL4P4NOwfkAgacATHDM7x6VfZuu475svdcEeUz3yetX7Z17vRxw 0flQsiBXKQcF1Do6SEHefiwPz5mNKKJMBqj4auIj9sAoIvSLUdj77YHH443uDgcUbahN 1yeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=jBgeXVbC; arc=pass (i=1 spf=pass spfdomain=amazon.com dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-52554-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52554-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com X-Forwarded-Encrypted: i=1; AJvYcCVklpK04KDVM448L9MkPIRdsx+QJam3HxIXXPuPGCK6xOSu23pUSQ43iTwzO3lwdzN10Wk5xPFlwIgtMbSW5g9xH9VePtQ0m5m9X5E6wA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j18-20020a635512000000b005ce0be7965esi6006091pgb.467.2024.02.05.04.28.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:28:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52554-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=jBgeXVbC; arc=pass (i=1 spf=pass spfdomain=amazon.com dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-52554-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52554-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 47791B22C34 for ; Mon, 5 Feb 2024 12:08:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 773941CF9B; Mon, 5 Feb 2024 12:04:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="jBgeXVbC" Received: from smtp-fw-80009.amazon.com (smtp-fw-80009.amazon.com [99.78.197.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47BFD1CD35; Mon, 5 Feb 2024 12:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=99.78.197.220 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134680; cv=none; b=YIByIh6zRP3VGUbzHnVFM8Am4kH8qnxo1ooVupDGwnn1jMtx6owrFatAyu2HgdLUZ1lQ+XDwtoIK9CPGNFGcp4owGqJm4JzrWyFm1Lsnru4k4XZzVAXvamk1QZbD5KyB4uO9ybm20nnHcPMJGd90mDSrPaL47/8hYhI/l62nvPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134680; c=relaxed/simple; bh=fscNGkpC5vVpP/8B8akCxtTGKONgvg1AB8vehQ7smFU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=X4Y+0NAqKIGDdiT48cXfR0058rHy9OxalbUwtpk2JcyO8NDI5pD6/nlSqOiVEAUOWnJ7J9z/xQ2twUgYvThevuQMi/hFDI99yugBujF6ufJvNoOBGIiIjp57Onh+GD8n6zla891IzS9hgJWWp0yshv5df7pE3+9LaTvmxBCxZmM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=jBgeXVbC; arc=none smtp.client-ip=99.78.197.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1707134680; x=1738670680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J/26rYh9SEOln6y0M0icroO5+g+Mdt4aS3KBehgGFN8=; b=jBgeXVbC7MQ7ZeIq302ImADqVc71l2YNCmbm/gxsDbKY2jZ4RtRubVSp BMrt66UyyL0Rk72Q8hIhiQAcndzT2dObMXoEZ8dAKfdA7IERIGzWm/p2L P8lNTmaiQmpbvrKZomnyha00s5pOWg0qd2QccLfBLKpD+5MDvaNB6k6aE c=; X-IronPort-AV: E=Sophos;i="6.05,245,1701129600"; d="scan'208";a="63724561" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-80009.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 12:04:38 +0000 Received: from EX19MTAEUA002.ant.amazon.com [10.0.43.254:15018] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.28.192:2525] with esmtp (Farcaster) id 82f5a304-b865-4a4d-9902-a5be57c26a04; Mon, 5 Feb 2024 12:04:36 +0000 (UTC) X-Farcaster-Flow-ID: 82f5a304-b865-4a4d-9902-a5be57c26a04 Received: from EX19D014EUC004.ant.amazon.com (10.252.51.182) by EX19MTAEUA002.ant.amazon.com (10.252.50.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 12:04:36 +0000 Received: from dev-dsk-jgowans-1a-a3faec1f.eu-west-1.amazon.com (172.19.112.191) by EX19D014EUC004.ant.amazon.com (10.252.51.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 12:04:30 +0000 From: James Gowans To: CC: Eric Biederman , , "Joerg Roedel" , Will Deacon , , Alexander Viro , "Christian Brauner" , , Paolo Bonzini , Sean Christopherson , , Andrew Morton , , Alexander Graf , David Woodhouse , "Jan H . Schoenherr" , Usama Arif , Anthony Yznaga , Stanislav Kinsburskii , , , Subject: [RFC 11/18] dma-iommu: Always enable deferred attaches for liveupdate Date: Mon, 5 Feb 2024 12:01:56 +0000 Message-ID: <20240205120203.60312-12-jgowans@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240205120203.60312-1-jgowans@amazon.com> References: <20240205120203.60312-1-jgowans@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D041UWA001.ant.amazon.com (10.13.139.124) To EX19D014EUC004.ant.amazon.com (10.252.51.182) Seeing as translations are pre-enabled, all devices will be set for deferred attach. The deferred attached actually has to be done when doing DMA mapping for devices to work. There may be a better way to do this be, for example, consulting the context entry table and only deferring attach if there is a persisted context table entry for this device. --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index e5d087bd6da1..76f916848f48 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1750,7 +1750,7 @@ void iommu_dma_compose_msi_msg(struct msi_desc *desc, struct msi_msg *msg) static int iommu_dma_init(void) { - if (is_kdump_kernel()) + if (is_kdump_kernel() || liveupdate) static_branch_enable(&iommu_deferred_attach_enabled); return iova_cache_get(); -- 2.40.1