From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 D6B0D2F25F0 for ; Thu, 11 Jun 2026 18:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781202727; cv=none; b=JHM3z1/CdIdG9xKwA0cDl/xH35bj2fZB9pvfQ1ggzfvieUnZ5tYmgWJe0/4BdRcy81yQPJ7aLZAIczL7Tcklx3Oo8aD+ux3cs7KEJz+AV54+o4si8mQ3ly1C/qPp1ioR1WxjP5UPR2tufYwmJ6+eskXz1bIAsB+aDIEybyiPdSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781202727; c=relaxed/simple; bh=z9HCVPCLhqPWk/FUcvQBVGbl8gbtkxmDCDKSnY0RFaY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AkS66lRpslYJp66Ei7P7IQURvC0/7rp7uRk4qFapWLQFaze8SkzPtaNwk/SX60G7TlhLvQYWudpuAZRMV/C4tLPPfiR80nodDzuZBhNsKkOQFa1w+b15V64O7qbAYany8EWJgneW04GAriKtZclGRy7p5HjY9/Q6u06myefzxZI= 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=MmrO5fVP; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NnUm6jSO; arc=none smtp.client-ip=103.168.172.151 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="MmrO5fVP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NnUm6jSO" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id F3747EC018E; Thu, 11 Jun 2026 14:32:03 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Thu, 11 Jun 2026 14:32:04 -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=fm3; t=1781202723; x=1781289123; bh=RlqKt5CZ62rV4YN4vr/Ag3WJZOUKrkEvyJKuDAZJNfs=; b= MmrO5fVPDS/usi79W/1nA03/ENvrom7zYPwLI07qDG4zRq78mxYWb4DC4nQz1obg 2MLGFkCyDiv5Pl+qJExcnZQW7a2n1zqMEkg6TpyQTeH6YE6sEq3P11+fn0nsREZr i8szajTPiBEUKHCC57nKf2cNbEJxyNJ0iQWKJzNUKcFTgzX/SbkOAVfBqgTKmAT6 +VDuBU8VZPuvu/5WWUAYGcjAqViMWwpaQX1+ooOsOId573b5GtJvV66d+BGQNCrf pZ2Erjs0ickjxhMpTDGSNffyahnKG0OqB8JL8aY0pRrrIX9g5fo4hz8B/XwPsXcA zUonrGfIVL9JPiAGtkZ8sg== 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=fm1; t=1781202723; x=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b7cVmg+TaTIdO1vEYntXW6A/PJcEksgsrn649dl5l8isrEeun2eEYCsFWtw X-ME-Proxy: Feedback-ID: i03f14258:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jun 2026 14:32:01 -0400 (EDT) Date: Thu, 11 Jun 2026 12:32:00 -0600 From: Alex Williamson To: Guixin Liu Cc: Jason Gunthorpe , Kevin Tian , Pranjal Shrivastava , Brett Creeley , Leon Romanovsky , kvm@vger.kernel.org, xlpang@linux.alibaba.com, oliver.yang@linux.alibaba.com, alex@shazbot.org Subject: Re: [PATCH] vfio/pci: make nointxmask and disable_idle_d3 module params read-only Message-ID: <20260611123200.4765b9cb@shazbot.org> In-Reply-To: <20260610054734.3591169-1-kanie@linux.alibaba.com> References: <20260610054734.3591169-1-kanie@linux.alibaba.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: kvm@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 Wed, 10 Jun 2026 13:47:34 +0800 Guixin Liu wrote: > The nointxmask and disable_idle_d3 module parameters are registered with > S_IWUSR, exposing a writable node under /sys/module/vfio_pci/parameters/. > However, writing to them at runtime has no effect on driver behaviour: > > - Both values are copied into vfio-pci-core's own static variables via > vfio_pci_core_set_params(), which is only called once at module init > time. A later write to the vfio_pci front-end variable is never > propagated to the core. > > - disable_idle_d3 additionally gates paired runtime PM get/put calls > across the probe/remove (register/unregister) and open/close > (enable/disable) life cycles. Changing it at runtime would tear > these pairs apart and leak or underflow the runtime PM usage counter. > > - nointxmask is latched into per-device state (vdev->nointx / > vdev->pci_2_3) at device open time, so a later change can only affect > newly opened devices and yields inconsistent behaviour. > > These parameters are effectively load-time constants. Drop the write > permission so they match disable_vga, which is already read-only, and to > stop misleading users into thinking they are runtime tunable. > > Signed-off-by: Guixin Liu > --- > drivers/vfio/pci/vfio_pci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks for the patch, I think this actually highlights a broader problem. Making disable_idle_d3 a read-only module parameter in vfio-pci doesn't change that vfio-pci can be unload and reloaded with different parameter values, therefore the gap is not closed. We need to use per device setting, latched at device probe, which actually also returns some value to these parameters being runtime modified. This feature was inadvertently lost in the vfio-pci-core split. I've copied you on the broader fix: https://lore.kernel.org/kvm/20260611182528.4004073-1-alex.williamson@nvidia.com/T/#t Thanks, Alex