From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48B8F1D2715 for ; Wed, 16 Oct 2024 22:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729117257; cv=none; b=RG0XK4lNo48HxAnDfqN1DPOJCq/pWKnM32YpUdWBORMsusEuUNwzCB/DOcNeMdYWO5gfiKVGYJpfxPlv9xjz+mCBDj9wN1ch7UU9XERTx0QUCqnNwdh8gJrT6HbjtV6WTTrnkyb6B+UB/o4KiLOlfMco/1Qi7HtrglcTQFnKl98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729117257; c=relaxed/simple; bh=rpAo2bq/X0bzymyXl7qBfRjhyv0bI95I2EG0AS8gNCw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p/U1eU24D8Pxl/zH9BnRWJD/RbfNCUok8Z27wvIZmwO8w4nuTl2RytupnUmVg6CNt8lhotd41zOA9kaK218jWGQuvs/utG2UM/f8LeNWYP0BlOjUEbgTw+ciy2bg87Uo66QzOpP5oeVzzRvORyOAfFMiVXKGjBcTYskRySDcEi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=pwHcwj1Z; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="pwHcwj1Z" Received: from DESKTOP-0403QTC. (unknown [20.236.11.29]) by linux.microsoft.com (Postfix) with ESMTPSA id EEE8A20E1A5A; Wed, 16 Oct 2024 15:20:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EEE8A20E1A5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1729117249; bh=WD3Ep8nGPeg1tM5YhegcRnyJhwTRJLT6LHrHFVSMVX8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Reply-To:From; b=pwHcwj1ZTCxfkG6lQVmO6XgXN3JVRw5injt7MQgSQIWed4KS7nLVgv3LYpB2TtL2r bs8lvZwXy0FT0M1o4at49XgSDJk0rNARIBhbp2cak03QSnsWqc89pKF/luci+cTBwG 5dAeCaQMoH3ZfG/Hd0bf3UA/zVrxxHpnB0UqU6mE= Date: Wed, 16 Oct 2024 15:20:47 -0700 From: Jacob Pan To: James Gowans Cc: , Jason Gunthorpe , Kevin Tian , "Joerg Roedel" , Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?= , Will Deacon , Robin Murphy , Mike Rapoport , "Madhavan T. Venkataraman" , , "Sean Christopherson" , Paolo Bonzini , , David Woodhouse , Lu Baolu , Alexander Graf , , , , "Saenz Julienne, Nicolas" , jacob.pan@linux.microsoft.com Subject: Re: [RFC PATCH 05/13] iommufd: Serialise persisted iommufds and ioas Message-ID: <20241016152047.2a604f08@DESKTOP-0403QTC.> In-Reply-To: <20240916113102.710522-6-jgowans@amazon.com> References: <20240916113102.710522-1-jgowans@amazon.com> <20240916113102.710522-6-jgowans@amazon.com> Reply-To: jacob.pan@linux.microsoft.com, Saurabh Sengar X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi James, On Mon, 16 Sep 2024 13:30:54 +0200 James Gowans wrote: > +static int serialise_iommufd(void *fdt, struct iommufd_ctx *ictx) > +{ > + int err = 0; > + char name[24]; > + struct iommufd_object *obj; > + unsigned long obj_idx; > + > + snprintf(name, sizeof(name), "%lu", ictx->persistent_id); > + err |= fdt_begin_node(fdt, name); > + err |= fdt_begin_node(fdt, "ioases"); > + xa_for_each(&ictx->objects, obj_idx, obj) { > + struct iommufd_ioas *ioas; > + struct iopt_area *area; > + int area_idx = 0; > + > + if (obj->type != IOMMUFD_OBJ_IOAS) > + continue; I was wondering how device state persistency is managed here. Is it correct to assume that all devices bound to an iommufd context should be persistent? If so, should we be serializing IOMMUFD_OBJ_DEVICE as well? I'm considering this from the perspective of user mode drivers, including those that use noiommu mode (need to be added to iommufd cdev). In this scenario, we only need to maintain the device states persistently without IOAS.