From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 5450A48A8A7; Tue, 4 Aug 2026 20:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785874231; cv=none; b=PRvjIotUTfuKcLiNXYVChZHi6MJ9yxyCFZaW+xJu1W9Tp+vnodNQkoeBj8U65XY2cwPnhzzm+BaZy1IiqI+Uqs4hfxq140WSHfCM7r5YGcAcb8IJc2wc31nOde+EuyNsZPDBBbQ73r5TUJ8prWFcptcih58S2Z3YFXq4HZem8HA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785874231; c=relaxed/simple; bh=AjmUzfY+vEbZcOw71ELjIqCFMK9wUupfH+b6ioJ/RAc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gdiMNEMrzaQn1VbA3FGuyGhLVI0tEpbjuivjjn01tJl0zxZ3SgIlG7Em6G2MZ35zsCXGxEtaZgTVuyZuUCx79w+8dQ6AYNc8pAFhvqK5FnK/HxkRQW344MX+HONIVLeuYNorJ2H5Yj+vgq8I575tyZAqd9uZ5F/7IRp68F1shu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org; spf=pass smtp.mailfrom=shazbot.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b=TvhqnR7m; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jV/BhCRP; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shazbot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shazbot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shazbot.org header.i=@shazbot.org header.b="TvhqnR7m"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jV/BhCRP" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 84DBE14000BB; Tue, 4 Aug 2026 16:10:28 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 04 Aug 2026 16:10:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shazbot.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1785874228; x=1785960628; bh=DGDpNHg7f9ztXGjzjzb4ybcoE+sIyQ0zmpGoEdgW4g4=; b= TvhqnR7mCECTjp74lUFk4G4kFKYnDIbC4XNAlIU5Z3FhZ2Yp14QvfA8I5Dge0rZj AVMK050Y2EXORNA+5w3npdI8mTHHzB7brHEtxkAfzizr7JwtFXQW0HIJ3EIz2p6c 7/CTBd2jrTNd0iFl1no3FMI1bBInZqbM/OTzKZ3o4TfdGCa5Aupf2SzrFTRaoyMO kjmBg+dMDXgWk8C0iBK1iM2kS3W9XglkkC3PRvzWgxNssG6QcpCpTzb16W3+ENOQ 7g5ub4ierd5E1KJ8szv3WolRxMN0056ctenE+S4CGBVwqWPu6MaLqyxvOmdR+Med nilmm1ADQQahAe58GZPN6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=f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99CfP3 9qz8+Pa8I7u1ZCvyG7/cRNwNrlZstfl1eghiC4Xf7kf4/9xmo7lVxdVSejNw X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Aug 2026 16:10:25 -0400 (EDT) Date: Tue, 4 Aug 2026 14:10:22 -0600 From: Alex Williamson To: Matt Evans Cc: Leon Romanovsky , Jason Gunthorpe , Alex Mastro , Christian =?UTF-8?B?S8O2bmln?= , Bjorn Helgaas , Logan Gunthorpe , Kevin Tian , Pranjal Shrivastava , Longfang Liu , Mahmoud Adam , David Matlack , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Sumit Semwal , Ankit Agrawal , Alistair Popple , Vivek Kasireddy , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kvm@vger.kernel.org, linux-pci@vger.kernel.org, alex@shazbot.org Subject: Re: [PATCH v5 7/9] vfio/pci: Clean up BAR zap and revocation Message-ID: <20260804141022.71b6429d@shazbot.org> In-Reply-To: <6a964960-722c-44b5-837d-9d582aeb0a3c@ozlabs.org> References: <20260715174737.15287-1-matt@ozlabs.org> <20260715174737.15287-8-matt@ozlabs.org> <20260729115204.2a9a50b2@shazbot.org> <6a964960-722c-44b5-837d-9d582aeb0a3c@ozlabs.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Thu, 30 Jul 2026 15:47:13 +0100 Matt Evans wrote: > Hi Alex, > > On 29/07/2026 18:52, Alex Williamson wrote: > > On Wed, 15 Jul 2026 18:47:30 +0100 > > Matt Evans wrote: > >> diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h > >> index 9a1674c152aa..e2b4252e7c3f 100644 > >> --- a/include/linux/vfio_pci_core.h > >> +++ b/include/linux/vfio_pci_core.h > >> @@ -134,6 +134,7 @@ struct vfio_pci_core_device { > >> bool pm_intx_masked; > >> bool pm_runtime_engaged; > >> bool sriov_active; > >> + bool zap_bars_on_revoke; > >> struct pci_saved_state *pci_saved_state; > >> struct pci_saved_state *pm_save; > >> int ioeventfds_nr; > > > > This should be in the bitfield usage group since it's only modified at > > init time. > > This was intentional, but happy to change it if you're certain ofc. Is > it inconceivable that a sub-driver could set it after init? I'd say > they _shouldn't_, but only review will stop them and this placement > intended to be cautious. It seemed a low cost way to avoid issues > around synchronisation on the bitfield. I'd agree with the statement that they shouldn't, it would be difficult to synchronize setting the flag once there are any active mappings of the BARs. Also, if we put it in the bitfield category under the comment that the value is only modified at setup/release, it documents the intentions, hopefully to the extent the author or reviewers notice. An argument can always be made to change it if there's a worthwhile use case. Thanks, Alex