From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 980E639CD04 for ; Thu, 20 Aug 2026 23:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787269047; cv=none; b=fEDBikeOnwADtYt7XA2dTjEkC13DZ4W+jX6JHiCO9p5xu7I3dUMVDkQJNDbOPcxeHaH1P05+HBTKiHl3vGrHiPgkCvjW5dcogBKuKhHkvA9sDQd7O/3U71GrktN/KuKzURnssM5nWnvDv1U7YakUHpjPfcIdV08Oo3ZphAeqs5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787269047; c=relaxed/simple; bh=InEVFTLgsWT02bOUOgnGmif6wey2/aq2SBg+dMmvUA4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ekbZD5bkW8evrNFxv3u7LNMNOoJwrWRPe4aIetrfje0VmmPGDfVcMNSn06BYIer/dAEQcNQo9jhC0IiUlVzZmk9Nn9B8w/P5NBcmaExnUwXm8z17FEV5J+Cib0WWcwNBP3iWzU15ECsm3Cve+Eun0I1w5cabJygdZkEoOpcjh+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=Rp4mxmyL; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Rp4mxmyL" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-92e6c4a867cso29572485a.0 for ; Thu, 20 Aug 2026 16:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1787269044; x=1787873844; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=TwdiO/ha14aqZZoymZaYgDW2JuO6Qn7ZG4BkebgqYts=; b=Rp4mxmyLxFKM3khPtQnv8AQNN+TEFnE41PS0VIjGaV5W1aPoO3cAYN0Zm4cFMNXlaW cOWbKwlFuJtWm7Lrts2mNnBVwene3Hqj2/+7g29b+B+3rfpI0d7JON4VFym8HylqNm+s KrE8J8mwrv00W1nK5sjv0bPJT/RijsGmZ6290PKsCsDm27w4ZdSCXseD4dttw/ljNbmO 1nRdTeFFm3yeCv9Pmz/rWKbWsEOcvltPbbM+itkCH+/mERWqEeH62YuJ2wqgqUELiZtd kRPKvvOBX8HueIOfrXUf4QuW3ok8bP2+oKdacGBfr+hazhqYnw/Cm/RFrt3DHPxFCgr2 vpVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787269044; x=1787873844; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=TwdiO/ha14aqZZoymZaYgDW2JuO6Qn7ZG4BkebgqYts=; b=aTq928Y+hJiJw+C2f7LkTyxElk7iVCbrXAYtH9TXCwCJjQGP9z8zuyRUDWzKUqIRGh vdMZ9KZJDKK17/a3neL6hUqMODgbyjp/QmWFMsCql/579ty6zEayyRjegCO4sG2r6kFq /0axP6He5kMQOT+soRw448EzJ5+SGkbeaBbbNPHyz8c1uMkEWLfl9svTyATcW0DiuSMu /JRv0T3x9sr2UAVcqtDVN88cm2yD/UHhA6+K8rOR48eYW2hU+bZAGBMVv8WlQPWldc6H cpWemxOqfLx3X0AXLU559CsQ9nPtvZR1UnbFXP1dpvcamFEq6IAZAXwxzD6sYQEiNuQJ BZnA== X-Forwarded-Encrypted: i=1; AHgh+Rrr2ISBbbk2Gm0cjNQR341cMKwKYALEUZ0FM3fr3TjYFNQEmMe/4siwgU8zHYjFRg5wt7LE8FmAHN5QjoE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx42xZoDx5GHImL3NCJ20ChGEAakjSWYZz7uYVdHlnAurSzMWly s5Wy6hLtxQ0qNl02VA/AkA7Bmm9LxJPY5a4Gdd6bjhUM7WJ2bUwMV5KQ5wP/ik8cNKk= X-Gm-Gg: AR+sD10mieZBrPxiQjQzKAo0Vg2hNXA4LA+FfDQMipn1YupwcKb+z3txbPa4WcZFyu6 FWmIm8oI2YOzBdrNRi1Gv8Vei2rzh55j0apN6NI5ICbiJDaBGA2BvwEmqbzLLXoswmzwjbfUp+T LpzeH6yLLVKmLYq50ZEyrmSPpyHfZw7KQznwEaAKXpmq4BnDbttbvbT/71g9J3beVssx5rVFrc4 K5yHOe9qelWjeCDF7PSW08yRWP1NDDD2c9c20d0Q0N3oAEFt4Ks/k8lAkdQftq2CNs2bpy9E2Ol cJ3kNU37a3wZ7Q5CCk/lOzVA95e4caH/miH92RBOTcuoWUp4HZ4SFn/UdEblX8JUtXOXxIkjvU0 224gNULjfzRD59eNp91MDJ5vNY/efaG4hQkD2FGyYWs9nYa1paZ+ckPzW+u7eJHk6JAu/qM/pnc CvbfmoX+8+Q6bnwRCS7XgYiB768Ir0y2sCADwNzk0XkX9rk9QnM6ZkFtxK+ZirWR5qA2EK3rdJv sAkn/AqteYnFJo5dozn9D7ljznbexAW6R5RKpP3AYk3giE= X-Received: by 2002:a05:620a:2910:b0:937:1e9b:be6c with SMTP id af79cd13be357-9373942b0e3mr192488885a.10.1787269044209; Thu, 20 Aug 2026 16:37:24 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93720586ea5sm470176585a.38.2026.08.20.16.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 16:37:23 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wxCK2-00000004fvf-3PzW; Thu, 20 Aug 2026 20:37:22 -0300 Date: Thu, 20 Aug 2026 20:37:22 -0300 From: Jason Gunthorpe To: Samiullah Khawaja , Nicolin Chen Cc: Alex Williamson , "Tian, Kevin" , kvm , Alex Williamson , Bjorn Helgaas , linux-kernel , linux-pci , iommu@lists.linux.dev Subject: Re: [RFC PATCH 1/5] PCI: Refuse function reset of an SR-IOV PF with enabled VFs Message-ID: <20260820233722.GA1110819@ziepe.ca> References: <20260812045325.2733631-1-alex.williamson@nvidia.com> <20260812045325.2733631-2-alex.williamson@nvidia.com> <20260814083737.66bb83fb@nvidia.com> <20260817121810.GC933791@ziepe.ca> <20260818140304.GC5482@ziepe.ca> <20260818143906.1f58aecb@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Aug 20, 2026 at 10:38:07PM +0000, Samiullah Khawaja wrote: > > The blocking domain operation looks like it might be simplest to > > implement in the IOMMU core. We can set a flag for a default blocking > > domain on the IOMMU group when we take_dma_ownership of the group. Then > > release_dma_ownership picks the blocking rather than default domain. > > > > This is then unwound in use_default_domain, called via dma_configure, > > attaching the device to the default domain in probe of the next driver. > > Therefore until probe by another driver, a device used by vfio would > > remain in a blocking domain even while unused and unbound. > > The devices are expected to be attached to the default_domain even when > these are unbound and the use_default_domain assumes that, and it only > checks the ownership and doesn't switch the domain to default_domain. I > guess we should add a WARN in use_default_domain() if that is not true. > I will probably send out a patch for that separately. > > I think we can move the device back to default_domain after reset after > unbind, maybe it can be done in pci_dma_cleanup() based on > driver_managed_dma? This blocking domain stuff sounds very similar to what Nicolin implemented for the per-function ATS issue? Broadly we must setup a blocking domain in the iommu if ATS is available across reset or you get these ATS related issues. I think at the time he looked at doing SRIOV as well but it was tricky.. Jason