From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 D3D832874E3 for ; Thu, 30 Apr 2026 20:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777582017; cv=none; b=Rvn25ARszDzZ8cAN4k5c/sQm/OrjKgTQ7BVSTvZNOlVKqF2JaqMpElIXXuwKqGuaa/lja7afxHLMsAzx9oh6QwtkoABQVGXmr+AjR9zpaSkhghoA1UgeXeQh+D5L+ARnybeLvcBnRSpWilBUFInMYHhVOuVyIrGPqYVPNarEjOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777582017; c=relaxed/simple; bh=HekgxlUpgzkukNvV+knf2tm+30reYYgWGhdylIgjWnk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ld3f7hnSUxp05zTBsTRv0FkFGk04+szAzLmCk/+B34gR+cU6a487A6s9Zrl2NaS1ufDJBiVOUiM2IHju2viEck13FHKh8n1sgyT9P4MS3TUUdta7NeUYl0O7VnCbC/wPjqAprmH1wkQhTYPxrTqHjl1fIB/ohRsXX4YeVBSA8zk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vkye+lyu; arc=none smtp.client-ip=209.85.210.170 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vkye+lyu" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-82f8b60e485so647105b3a.0 for ; Thu, 30 Apr 2026 13:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777582015; x=1778186815; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=jkf0FFUPX2DRAnC583F6L6pCpn6Z3D9oHd6oyEqtOrY=; b=vkye+lyu9+j32LP3KNqRNBAPXdsB5kRHTrHH7cabMbFfKb5OKZljuudgJAvRTUMXmF Md3XXFXxA0SYip1CBPyMRjuNYPAGodiYTFeNah8Zb5nbmKS6APOs16a9epM9w+TF2NTl h5SPbemdC2sPHeS42RMnXQLz0cLONy8q8VANLDqTOe8wdB3AZtYavZCFr9kr1u0Hkr4+ kEL1cUt/rdh60qKNQN/Cfd33CVxYGm412gWmbL8JxwGTSYZtFUR1a5pxnIiNSrF9gYQa MRD8iS4iDU2FotFk4gqhFwaQ317kMNI32LoXzpQfdFlECI/l71Xif5lE0Zs8BpGFqGad Y76w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777582015; x=1778186815; h=in-reply-to:content-transfer-encoding:content-disposition :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; bh=jkf0FFUPX2DRAnC583F6L6pCpn6Z3D9oHd6oyEqtOrY=; b=Q02v9KLI3ONVOQNlRwvh5CArxmTg54hYo+0I5GzS08idD8FS0HydzZCK5XlOf9YhKm uGIkDOo2iOTKqqtvFqsoJhw+S1xh/NCwWeWUJvNuOojCygJbHfQXq2Cfun6KxWnE8YVJ kF65bDmdJkrY0izdQaHe6HHLecG4tnHvMN/rea10P/Heg8ML9AMnv2yrer9BqhMQA717 Li3rKkOgJg/YM2o1a1uL4i9dZ+ajwtjdmCEkwvMZiUbPPxKSvnRZNu4V5nfcyDxrW5VR g/+kOaaG4/rH4NoMbJZCuAIyw+xWqQgJotHBi7LJLcYUS6uS2bI1ua48NndiY4dKOptd zHHw== X-Forwarded-Encrypted: i=1; AFNElJ+fLzP89oq26E/+Y+KkKZ4IaHPh3wv41J3JMq5jhHWc1cMWvOEGMIkT1nNoLxAnyYHrbkZPzG+CejXLGBQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yyp+z0BqlD9YscA/Scn7o4rt10w3R8U6Yiu/WGy0CTvvu3wqw8M qTz+dm5IPmzm24b3GgF1lCEe2DZuiunrIKsFHis65ZnZW8y0+TsdCSJ/GbxZwm3aiA== X-Gm-Gg: AeBDietXQQBC94FlM80xew9BeQX2P5U8adS4CaZQ574RcwEpso0S3L3sBo4JGgZ/Kil pqirHG0gLWDiq1E9et6SekVOlQE+gLTmUBFJVo9IIf+Ed/MsLhs24lIlYFf8Nk/pc/lvdtCVqqK StbxtcsGN+qQnoa3MSO5OK0ZOqxnA20lq2HWD+CqdoFw8ZM3duIWiyoBcMb4fNGPc4VM7WrW+yh nChFTpXipaBw5HuJSmyq9tzfwkVURbLIF2qKSqDAeHa2BeXfT+B4ylk0CGMvWHUvQAs4FvkYZVh MxrBv7h61NLQCfiRE1c6HC3EouMNYj7sT3l0fGlxRnvhypByzxb5kr/6wFii7Zrp43mp3BllgjP XpfuO6DyQ2Xax4wd0Z+J2wLLmhqeKIocE/FEBXAeYsmO8jR5NOzGdhdn/mVf1b0ghm4LdYwSFjN PdaCXx+6f24D1JizCDAawtKHjCpexty/6N4tYlVTYy8nvD9x2TUoeKame013UAYR81+PDA06k61 mC5SQ== X-Received: by 2002:a05:6a00:2384:b0:834:dfb5:6e73 with SMTP id d2e1a72fcca58-834fe061295mr5131011b3a.5.1777582014798; Thu, 30 Apr 2026 13:46:54 -0700 (PDT) Received: from google.com (76.9.127.34.bc.googleusercontent.com. [34.127.9.76]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83515ad8eb6sm491387b3a.37.2026.04.30.13.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 13:46:54 -0700 (PDT) Date: Thu, 30 Apr 2026 20:46:50 +0000 From: David Matlack To: Samiullah Khawaja Cc: Jason Gunthorpe , iommu@lists.linux.dev, kexec@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, Adithya Jayachandran , Alexander Graf , Alex Williamson , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Joerg Roedel , Jonathan Corbet , Josh Hilke , Leon Romanovsky , Lukas Wunner , Mike Rapoport , Parav Pandit , Pasha Tatashin , Pranjal Shrivastava , Pratyush Yadav , Robin Murphy , Saeed Mahameed , Shuah Khan , Will Deacon , William Tu , Yi Liu Subject: Re: [PATCH v4 08/11] PCI: liveupdate: Require preserved devices are in immutable singleton IOMMU groups Message-ID: References: <20260423212316.3431746-1-dmatlack@google.com> <20260423212316.3431746-9-dmatlack@google.com> <20260423225253.GA3444440@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2026-04-23 11:27 PM, Samiullah Khawaja wrote: > On Thu, Apr 23, 2026 at 04:09:01PM -0700, David Matlack wrote: > > On Thu, Apr 23, 2026 at 3:53 PM Jason Gunthorpe wrote: > > > > > > On Thu, Apr 23, 2026 at 03:10:55PM -0700, David Matlack wrote: > > > > On Thu, Apr 23, 2026 at 2:23 PM David Matlack wrote: > > > > > > > > > > Restrict support for preserving PCI devices across Live Update to > > > > > devices in immutable singleton IOMMU groups. A device's group is > > > > > considered immutable if all bridges upstream from the device up to the > > > > > root port have the required ACS features enabled. > > > > > > > > > > Since ACS flags are inherited across a Live Update for preserved devices > > > > > and all the way up to the root port, the preserved device should be in a > > > > > singleton IOMMU group after kexec in the new kernel. > > > > > > > > > > This change should still permit all the current use-cases for PCI device > > > > > preservation across Live Update, since it is intended to be used in > > > > > Cloud enviroments which should have the required ACS features enabled > > > > > for virtualization purposes. > > > > > > > > > > If a device is part of a multi-device IOMMU group, preserving it will > > > > > now fail with an error. This restriction may be lifted in the future if > > > > > support for preserving multi-device groups is desired. > > > > > > > > > > Signed-off-by: David Matlack > > > > > > > > Jason, do you think requiring singleton iommu groups is still > > > > necessary/useful now that this series preserves ACS flags on preserved > > > > devices and upstream bridges? > > > > > > I have forgotten why we introduced that? There are alot of funky > > > things about iommu groups that might be important upon restoration.. > > > > You had originally suggested it in this thread: > > > > https://lore.kernel.org/kvm/20260301192236.GQ5933@nvidia.com/ > > > > > Like if you preserve one group member but not the other what do you ? > > > > Yeah I imagine there could be some tricky cases there... > > > > I wonder if PCI core is the right layer to enforce this. Maybe this > > fits better into Sami's IOMMU core series since that is where all > > those tricky cases will be (I imagine?). > > +1 > > Also I think this should probably be checked by iommufd and invoked > through vfio cdev. Basically when vfio cdev calls into iommufd to > preserve IOMMU specific aspects of device (PASID table etc), iommufd can > check this and return error. Ok I will drop this patch from v5. The IOMMU core can check for it if it makes life simpler, but I can't think of anything in the PCI core that cares about this check.