From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4F0843BE641; Tue, 21 Jul 2026 21:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784670495; cv=none; b=mzvXWb4kVpYhEoisf6GM95R+Zr4D4ljVs+/pkBk4YHUONUyuvN8S/hfzH9k21vQoe0xIhNq7gLA/TFwWcTmkxJENXFaFi1TX2ZKdXpmoNGl803QmIwsfnonZyNi21ugDM6yxiQhwwXfELkTrEy/4qieNweVxRfZ9YFFeynOxxDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784670495; c=relaxed/simple; bh=+Ccsc5XldVL1YOaHSZoq+t/xO/PKyMFIzH8+1kZirNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XlpHwBqeqpjpN8T5mnFLkP/mwuhKi5Dx26f9TcmZRs4/OL3PEfUcVXygmCZx7Wakn3LFW7fyWDpYoqfBh6NCqRJk9qj5b3YnJKd73qzA7C4P/XWtsf3vN0nq3keehXB8AU81w6ca25YujciVqo8cAKB3vcPQ4vyYxFIIqpkuD3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0lm/ypBm; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0lm/ypBm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA36C1F00A3E; Tue, 21 Jul 2026 21:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784670492; bh=l7lpcgM+vu7iFE5vBK9PZ1iRvV4HYsMcnsFuG/nsv5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=0lm/ypBmIxLMcbAt5ABm3qJuOLiSUk7wYz+PTMBdoq+MHJT2VQme8XhV5z50hC/Cy MwZrerdB5FYgNtfC4PW6yMfyjZsM0IbUb0YYP7+hOxqaPRj5f81JPRTZgzWVX5zPdW B9AcKxB2Wqa06BYdamXHm2UyffuJCC1fXs+BxIO0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jason Gunthorpe , Reinette Chatre , Kevin Tian , Thomas Gleixner , Alex Williamson , Sasha Levin Subject: [PATCH 6.1 0953/1067] vfio/pci: Use bitfield for struct vfio_pci_core_device flags Date: Tue, 21 Jul 2026 17:25:54 +0200 Message-ID: <20260721152445.859773751@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Reinette Chatre [ Upstream commit 9cd0f6d5cbb6fda09aa83beb8146c287a552017e ] struct vfio_pci_core_device contains eleven boolean flags. Boolean flags clearly indicate their usage but space usage starts to be a concern when there are many. An upcoming change adds another boolean flag to struct vfio_pci_core_device, thereby increasing the concern that the boolean flags are consuming unnecessary space. Transition the boolean flags to use bitfields. On a system that uses one byte per boolean this reduces the space consumed by existing flags from 11 bytes to 2 bytes with room for a few more flags without increasing the structure's size. Suggested-by: Jason Gunthorpe Signed-off-by: Reinette Chatre Reviewed-by: Kevin Tian Acked-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/cf34bf0499c889554a8105eeb18cc0ab673005be.1683740667.git.reinette.chatre@intel.com Signed-off-by: Alex Williamson Stable-dep-of: 40ef3edf151e ("vfio/pci: Use a private flag to prevent power state change with VFs") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/linux/vfio_pci_core.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h @@ -69,17 +69,17 @@ struct vfio_pci_core_device { u16 msix_size; u32 msix_offset; u32 rbar[7]; - bool pci_2_3; - bool virq_disabled; - bool reset_works; - bool extended_caps; - bool bardirty; - bool has_vga; - bool needs_reset; - bool nointx; - bool needs_pm_restore; - bool pm_intx_masked; - bool pm_runtime_engaged; + bool pci_2_3:1; + bool virq_disabled:1; + bool reset_works:1; + bool extended_caps:1; + bool bardirty:1; + bool has_vga:1; + bool needs_reset:1; + bool nointx:1; + bool needs_pm_restore:1; + bool pm_intx_masked:1; + bool pm_runtime_engaged:1; struct pci_saved_state *pci_saved_state; struct pci_saved_state *pm_save; int ioeventfds_nr;