thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
7f1c5b
From cbe35c6a4794107ea1ddecf0b381ba4b1c8799f5 Mon Sep 17 00:00:00 2001
7f1c5b
From: Peter Xu <peterx@redhat.com>
7f1c5b
Date: Tue, 7 Feb 2023 15:57:10 -0500
7f1c5b
Subject: [PATCH 3/8] linux-headers: Update to v6.1
7f1c5b
7f1c5b
RH-Author: Peter Xu <peterx@redhat.com>
7f1c5b
RH-MergeRequest: 149: Support /dev/userfaultfd
7f1c5b
RH-Bugzilla: 2158704
7f1c5b
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7f1c5b
RH-Acked-by: quintela1 <quintela@redhat.com>
7f1c5b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7f1c5b
RH-Commit: [1/3] 15d97026e802a0f01b5f80f81fb4414dc69b2b2d (peterx/qemu-kvm)
7f1c5b
7f1c5b
Signed-off-by: Peter Xu <peterx@redhat.com>
7f1c5b
Reviewed-by: Juan Quintela <quintela@redhat.com>
7f1c5b
Acked-by: Cornelia Huck <cohuck@redhat.com>
7f1c5b
Signed-off-by: Juan Quintela <quintela@redhat.com>
7f1c5b
(cherry picked from commit 93e0932b7be2498024cd6ba8446a0fa2cb1769bc)
7f1c5b
Signed-off-by: Peter Xu <peterx@redhat.com>
7f1c5b
---
7f1c5b
 include/standard-headers/drm/drm_fourcc.h     |  34 ++++-
7f1c5b
 include/standard-headers/linux/ethtool.h      |  63 +++++++-
7f1c5b
 include/standard-headers/linux/fuse.h         |   6 +-
7f1c5b
 .../linux/input-event-codes.h                 |   1 +
7f1c5b
 include/standard-headers/linux/virtio_blk.h   |  19 +++
7f1c5b
 linux-headers/asm-generic/hugetlb_encode.h    |  26 ++--
7f1c5b
 linux-headers/asm-generic/mman-common.h       |   2 +
7f1c5b
 linux-headers/asm-mips/mman.h                 |   2 +
7f1c5b
 linux-headers/asm-riscv/kvm.h                 |   4 +
7f1c5b
 linux-headers/linux/kvm.h                     |   1 +
7f1c5b
 linux-headers/linux/psci.h                    |  14 ++
7f1c5b
 linux-headers/linux/userfaultfd.h             |   4 +
7f1c5b
 linux-headers/linux/vfio.h                    | 142 ++++++++++++++++++
7f1c5b
 13 files changed, 298 insertions(+), 20 deletions(-)
7f1c5b
7f1c5b
diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h
7f1c5b
index 48b620cbef..b868488f93 100644
7f1c5b
--- a/include/standard-headers/drm/drm_fourcc.h
7f1c5b
+++ b/include/standard-headers/drm/drm_fourcc.h
7f1c5b
@@ -98,18 +98,42 @@ extern "C" {
7f1c5b
 #define DRM_FORMAT_INVALID	0
7f1c5b
 
7f1c5b
 /* color index */
7f1c5b
+#define DRM_FORMAT_C1		fourcc_code('C', '1', ' ', ' ') /* [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte */
7f1c5b
+#define DRM_FORMAT_C2		fourcc_code('C', '2', ' ', ' ') /* [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte */
7f1c5b
+#define DRM_FORMAT_C4		fourcc_code('C', '4', ' ', ' ') /* [7:0] C0:C1 4:4 two pixels/byte */
7f1c5b
 #define DRM_FORMAT_C8		fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
7f1c5b
 
7f1c5b
-/* 8 bpp Red */
7f1c5b
+/* 1 bpp Darkness (inverse relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_D1		fourcc_code('D', '1', ' ', ' ') /* [7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte */
7f1c5b
+
7f1c5b
+/* 2 bpp Darkness (inverse relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_D2		fourcc_code('D', '2', ' ', ' ') /* [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte */
7f1c5b
+
7f1c5b
+/* 4 bpp Darkness (inverse relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_D4		fourcc_code('D', '4', ' ', ' ') /* [7:0] D0:D1 4:4 two pixels/byte */
7f1c5b
+
7f1c5b
+/* 8 bpp Darkness (inverse relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_D8		fourcc_code('D', '8', ' ', ' ') /* [7:0] D */
7f1c5b
+
7f1c5b
+/* 1 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_R1		fourcc_code('R', '1', ' ', ' ') /* [7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte */
7f1c5b
+
7f1c5b
+/* 2 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_R2		fourcc_code('R', '2', ' ', ' ') /* [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte */
7f1c5b
+
7f1c5b
+/* 4 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
+#define DRM_FORMAT_R4		fourcc_code('R', '4', ' ', ' ') /* [7:0] R0:R1 4:4 two pixels/byte */
7f1c5b
+
7f1c5b
+/* 8 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
 #define DRM_FORMAT_R8		fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
7f1c5b
 
7f1c5b
-/* 10 bpp Red */
7f1c5b
+/* 10 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
 #define DRM_FORMAT_R10		fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */
7f1c5b
 
7f1c5b
-/* 12 bpp Red */
7f1c5b
+/* 12 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
 #define DRM_FORMAT_R12		fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */
7f1c5b
 
7f1c5b
-/* 16 bpp Red */
7f1c5b
+/* 16 bpp Red (direct relationship between channel value and brightness) */
7f1c5b
 #define DRM_FORMAT_R16		fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
7f1c5b
 
7f1c5b
 /* 16 bpp RG */
7f1c5b
@@ -204,7 +228,9 @@ extern "C" {
7f1c5b
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
7f1c5b
 
7f1c5b
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
7f1c5b
+#define DRM_FORMAT_AVUY8888	fourcc_code('A', 'V', 'U', 'Y') /* [31:0] A:Cr:Cb:Y 8:8:8:8 little endian */
7f1c5b
 #define DRM_FORMAT_XYUV8888	fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
7f1c5b
+#define DRM_FORMAT_XVUY8888	fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
7f1c5b
 #define DRM_FORMAT_VUY888	fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
7f1c5b
 #define DRM_FORMAT_VUY101010	fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
7f1c5b
 
7f1c5b
diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h
7f1c5b
index 4537da20cc..1dc56cdc0a 100644
7f1c5b
--- a/include/standard-headers/linux/ethtool.h
7f1c5b
+++ b/include/standard-headers/linux/ethtool.h
7f1c5b
@@ -736,6 +736,51 @@ enum ethtool_module_power_mode {
7f1c5b
 	ETHTOOL_MODULE_POWER_MODE_HIGH,
7f1c5b
 };
7f1c5b
 
7f1c5b
+/**
7f1c5b
+ * enum ethtool_podl_pse_admin_state - operational state of the PoDL PSE
7f1c5b
+ *	functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState
7f1c5b
+ * @ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN: state of PoDL PSE functions are
7f1c5b
+ * 	unknown
7f1c5b
+ * @ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED: PoDL PSE functions are disabled
7f1c5b
+ * @ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED: PoDL PSE functions are enabled
7f1c5b
+ */
7f1c5b
+enum ethtool_podl_pse_admin_state {
7f1c5b
+	ETHTOOL_PODL_PSE_ADMIN_STATE_UNKNOWN = 1,
7f1c5b
+	ETHTOOL_PODL_PSE_ADMIN_STATE_DISABLED,
7f1c5b
+	ETHTOOL_PODL_PSE_ADMIN_STATE_ENABLED,
7f1c5b
+};
7f1c5b
+
7f1c5b
+/**
7f1c5b
+ * enum ethtool_podl_pse_pw_d_status - power detection status of the PoDL PSE.
7f1c5b
+ *	IEEE 802.3-2018 30.15.1.1.3 aPoDLPSEPowerDetectionStatus:
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN: PoDL PSE
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED: "The enumeration “disabled” is
7f1c5b
+ *	asserted true when the PoDL PSE state diagram variable mr_pse_enable is
7f1c5b
+ *	false"
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING: "The enumeration “searching” is
7f1c5b
+ *	asserted true when either of the PSE state diagram variables
7f1c5b
+ *	pi_detecting or pi_classifying is true."
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING: "The enumeration “deliveringPower”
7f1c5b
+ *	is asserted true when the PoDL PSE state diagram variable pi_powered is
7f1c5b
+ *	true."
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP: "The enumeration “sleep” is asserted
7f1c5b
+ *	true when the PoDL PSE state diagram variable pi_sleeping is true."
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE: "The enumeration “idle” is asserted true
7f1c5b
+ *	when the logical combination of the PoDL PSE state diagram variables
7f1c5b
+ *	pi_prebiased*!pi_sleeping is true."
7f1c5b
+ * @ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR: "The enumeration “error” is asserted
7f1c5b
+ *	true when the PoDL PSE state diagram variable overload_held is true."
7f1c5b
+ */
7f1c5b
+enum ethtool_podl_pse_pw_d_status {
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_UNKNOWN = 1,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_DISABLED,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_SEARCHING,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_DELIVERING,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_SLEEP,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_IDLE,
7f1c5b
+	ETHTOOL_PODL_PSE_PW_D_STATUS_ERROR,
7f1c5b
+};
7f1c5b
+
7f1c5b
 /**
7f1c5b
  * struct ethtool_gstrings - string set for data tagging
7f1c5b
  * @cmd: Command number = %ETHTOOL_GSTRINGS
7f1c5b
@@ -1840,6 +1885,20 @@ static inline int ethtool_validate_duplex(uint8_t duplex)
7f1c5b
 #define MASTER_SLAVE_STATE_SLAVE		3
7f1c5b
 #define MASTER_SLAVE_STATE_ERR			4
7f1c5b
 
7f1c5b
+/* These are used to throttle the rate of data on the phy interface when the
7f1c5b
+ * native speed of the interface is higher than the link speed. These should
7f1c5b
+ * not be used for phy interfaces which natively support multiple speeds (e.g.
7f1c5b
+ * MII or SGMII).
7f1c5b
+ */
7f1c5b
+/* No rate matching performed. */
7f1c5b
+#define RATE_MATCH_NONE		0
7f1c5b
+/* The phy sends pause frames to throttle the MAC. */
7f1c5b
+#define RATE_MATCH_PAUSE	1
7f1c5b
+/* The phy asserts CRS to prevent the MAC from transmitting. */
7f1c5b
+#define RATE_MATCH_CRS		2
7f1c5b
+/* The MAC is programmed with a sufficiently-large IPG. */
7f1c5b
+#define RATE_MATCH_OPEN_LOOP	3
7f1c5b
+
7f1c5b
 /* Which connector port. */
7f1c5b
 #define PORT_TP			0x00
7f1c5b
 #define PORT_AUI		0x01
7f1c5b
@@ -2033,8 +2092,8 @@ enum ethtool_reset_flags {
7f1c5b
  *	reported consistently by PHYLIB.  Read-only.
7f1c5b
  * @master_slave_cfg: Master/slave port mode.
7f1c5b
  * @master_slave_state: Master/slave port state.
7f1c5b
+ * @rate_matching: Rate adaptation performed by the PHY
7f1c5b
  * @reserved: Reserved for future use; see the note on reserved space.
7f1c5b
- * @reserved1: Reserved for future use; see the note on reserved space.
7f1c5b
  * @link_mode_masks: Variable length bitmaps.
7f1c5b
  *
7f1c5b
  * If autonegotiation is disabled, the speed and @duplex represent the
7f1c5b
@@ -2085,7 +2144,7 @@ struct ethtool_link_settings {
7f1c5b
 	uint8_t	transceiver;
7f1c5b
 	uint8_t	master_slave_cfg;
7f1c5b
 	uint8_t	master_slave_state;
7f1c5b
-	uint8_t	reserved1[1];
7f1c5b
+	uint8_t	rate_matching;
7f1c5b
 	uint32_t	reserved[7];
7f1c5b
 	uint32_t	link_mode_masks[];
7f1c5b
 	/* layout of link_mode_masks fields:
7f1c5b
diff --git a/include/standard-headers/linux/fuse.h b/include/standard-headers/linux/fuse.h
7f1c5b
index bda06258be..713d259768 100644
7f1c5b
--- a/include/standard-headers/linux/fuse.h
7f1c5b
+++ b/include/standard-headers/linux/fuse.h
7f1c5b
@@ -194,6 +194,9 @@
7f1c5b
  *  - add FUSE_SECURITY_CTX init flag
7f1c5b
  *  - add security context to create, mkdir, symlink, and mknod requests
7f1c5b
  *  - add FUSE_HAS_INODE_DAX, FUSE_ATTR_DAX
7f1c5b
+ *
7f1c5b
+ *  7.37
7f1c5b
+ *  - add FUSE_TMPFILE
7f1c5b
  */
7f1c5b
 
7f1c5b
 #ifndef _LINUX_FUSE_H
7f1c5b
@@ -225,7 +228,7 @@
7f1c5b
 #define FUSE_KERNEL_VERSION 7
7f1c5b
 
7f1c5b
 /** Minor version number of this interface */
7f1c5b
-#define FUSE_KERNEL_MINOR_VERSION 36
7f1c5b
+#define FUSE_KERNEL_MINOR_VERSION 37
7f1c5b
 
7f1c5b
 /** The node ID of the root inode */
7f1c5b
 #define FUSE_ROOT_ID 1
7f1c5b
@@ -533,6 +536,7 @@ enum fuse_opcode {
7f1c5b
 	FUSE_SETUPMAPPING	= 48,
7f1c5b
 	FUSE_REMOVEMAPPING	= 49,
7f1c5b
 	FUSE_SYNCFS		= 50,
7f1c5b
+	FUSE_TMPFILE		= 51,
7f1c5b
 
7f1c5b
 	/* CUSE specific operations */
7f1c5b
 	CUSE_INIT		= 4096,
7f1c5b
diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h
7f1c5b
index 50790aee5a..815f7a1dff 100644
7f1c5b
--- a/include/standard-headers/linux/input-event-codes.h
7f1c5b
+++ b/include/standard-headers/linux/input-event-codes.h
7f1c5b
@@ -862,6 +862,7 @@
7f1c5b
 #define ABS_TOOL_WIDTH		0x1c
7f1c5b
 
7f1c5b
 #define ABS_VOLUME		0x20
7f1c5b
+#define ABS_PROFILE		0x21
7f1c5b
 
7f1c5b
 #define ABS_MISC		0x28
7f1c5b
 
7f1c5b
diff --git a/include/standard-headers/linux/virtio_blk.h b/include/standard-headers/linux/virtio_blk.h
7f1c5b
index 2dcc90826a..e81715cd70 100644
7f1c5b
--- a/include/standard-headers/linux/virtio_blk.h
7f1c5b
+++ b/include/standard-headers/linux/virtio_blk.h
7f1c5b
@@ -40,6 +40,7 @@
7f1c5b
 #define VIRTIO_BLK_F_MQ		12	/* support more than one vq */
7f1c5b
 #define VIRTIO_BLK_F_DISCARD	13	/* DISCARD is supported */
7f1c5b
 #define VIRTIO_BLK_F_WRITE_ZEROES	14	/* WRITE ZEROES is supported */
7f1c5b
+#define VIRTIO_BLK_F_SECURE_ERASE	16 /* Secure Erase is supported */
7f1c5b
 
7f1c5b
 /* Legacy feature bits */
7f1c5b
 #ifndef VIRTIO_BLK_NO_LEGACY
7f1c5b
@@ -119,6 +120,21 @@ struct virtio_blk_config {
7f1c5b
 	uint8_t write_zeroes_may_unmap;
7f1c5b
 
7f1c5b
 	uint8_t unused1[3];
7f1c5b
+
7f1c5b
+	/* the next 3 entries are guarded by VIRTIO_BLK_F_SECURE_ERASE */
7f1c5b
+	/*
7f1c5b
+	 * The maximum secure erase sectors (in 512-byte sectors) for
7f1c5b
+	 * one segment.
7f1c5b
+	 */
7f1c5b
+	__virtio32 max_secure_erase_sectors;
7f1c5b
+	/*
7f1c5b
+	 * The maximum number of secure erase segments in a
7f1c5b
+	 * secure erase command.
7f1c5b
+	 */
7f1c5b
+	__virtio32 max_secure_erase_seg;
7f1c5b
+	/* Secure erase commands must be aligned to this number of sectors. */
7f1c5b
+	__virtio32 secure_erase_sector_alignment;
7f1c5b
+
7f1c5b
 } QEMU_PACKED;
7f1c5b
 
7f1c5b
 /*
7f1c5b
@@ -153,6 +169,9 @@ struct virtio_blk_config {
7f1c5b
 /* Write zeroes command */
7f1c5b
 #define VIRTIO_BLK_T_WRITE_ZEROES	13
7f1c5b
 
7f1c5b
+/* Secure erase command */
7f1c5b
+#define VIRTIO_BLK_T_SECURE_ERASE	14
7f1c5b
+
7f1c5b
 #ifndef VIRTIO_BLK_NO_LEGACY
7f1c5b
 /* Barrier before this op. */
7f1c5b
 #define VIRTIO_BLK_T_BARRIER	0x80000000
7f1c5b
diff --git a/linux-headers/asm-generic/hugetlb_encode.h b/linux-headers/asm-generic/hugetlb_encode.h
7f1c5b
index 4f3d5aaa11..de687009bf 100644
7f1c5b
--- a/linux-headers/asm-generic/hugetlb_encode.h
7f1c5b
+++ b/linux-headers/asm-generic/hugetlb_encode.h
7f1c5b
@@ -20,18 +20,18 @@
7f1c5b
 #define HUGETLB_FLAG_ENCODE_SHIFT	26
7f1c5b
 #define HUGETLB_FLAG_ENCODE_MASK	0x3f
7f1c5b
 
7f1c5b
-#define HUGETLB_FLAG_ENCODE_16KB	(14 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_64KB	(16 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_512KB	(19 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_1MB		(20 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_2MB		(21 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_8MB		(23 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_16MB	(24 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_32MB	(25 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_256MB	(28 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_512MB	(29 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_1GB		(30 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_2GB		(31 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
-#define HUGETLB_FLAG_ENCODE_16GB	(34 << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_16KB	(14U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_64KB	(16U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_512KB	(19U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_1MB		(20U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_2MB		(21U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_8MB		(23U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_16MB	(24U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_32MB	(25U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_256MB	(28U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_512MB	(29U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_1GB		(30U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_2GB		(31U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
+#define HUGETLB_FLAG_ENCODE_16GB	(34U << HUGETLB_FLAG_ENCODE_SHIFT)
7f1c5b
 
7f1c5b
 #endif /* _ASM_GENERIC_HUGETLB_ENCODE_H_ */
7f1c5b
diff --git a/linux-headers/asm-generic/mman-common.h b/linux-headers/asm-generic/mman-common.h
7f1c5b
index 6c1aa92a92..6ce1f1ceb4 100644
7f1c5b
--- a/linux-headers/asm-generic/mman-common.h
7f1c5b
+++ b/linux-headers/asm-generic/mman-common.h
7f1c5b
@@ -77,6 +77,8 @@
7f1c5b
 
7f1c5b
 #define MADV_DONTNEED_LOCKED	24	/* like DONTNEED, but drop locked pages too */
7f1c5b
 
7f1c5b
+#define MADV_COLLAPSE	25		/* Synchronous hugepage collapse */
7f1c5b
+
7f1c5b
 /* compatibility flags */
7f1c5b
 #define MAP_FILE	0
7f1c5b
 
7f1c5b
diff --git a/linux-headers/asm-mips/mman.h b/linux-headers/asm-mips/mman.h
7f1c5b
index 1be428663c..c6e1fc77c9 100644
7f1c5b
--- a/linux-headers/asm-mips/mman.h
7f1c5b
+++ b/linux-headers/asm-mips/mman.h
7f1c5b
@@ -103,6 +103,8 @@
7f1c5b
 
7f1c5b
 #define MADV_DONTNEED_LOCKED	24	/* like DONTNEED, but drop locked pages too */
7f1c5b
 
7f1c5b
+#define MADV_COLLAPSE	25		/* Synchronous hugepage collapse */
7f1c5b
+
7f1c5b
 /* compatibility flags */
7f1c5b
 #define MAP_FILE	0
7f1c5b
 
7f1c5b
diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h
7f1c5b
index 7351417afd..8985ff234c 100644
7f1c5b
--- a/linux-headers/asm-riscv/kvm.h
7f1c5b
+++ b/linux-headers/asm-riscv/kvm.h
7f1c5b
@@ -48,6 +48,7 @@ struct kvm_sregs {
7f1c5b
 /* CONFIG registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
7f1c5b
 struct kvm_riscv_config {
7f1c5b
 	unsigned long isa;
7f1c5b
+	unsigned long zicbom_block_size;
7f1c5b
 };
7f1c5b
 
7f1c5b
 /* CORE registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
7f1c5b
@@ -98,6 +99,9 @@ enum KVM_RISCV_ISA_EXT_ID {
7f1c5b
 	KVM_RISCV_ISA_EXT_M,
7f1c5b
 	KVM_RISCV_ISA_EXT_SVPBMT,
7f1c5b
 	KVM_RISCV_ISA_EXT_SSTC,
7f1c5b
+	KVM_RISCV_ISA_EXT_SVINVAL,
7f1c5b
+	KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
7f1c5b
+	KVM_RISCV_ISA_EXT_ZICBOM,
7f1c5b
 	KVM_RISCV_ISA_EXT_MAX,
7f1c5b
 };
7f1c5b
 
7f1c5b
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
7f1c5b
index ebdafa576d..b2783c5202 100644
7f1c5b
--- a/linux-headers/linux/kvm.h
7f1c5b
+++ b/linux-headers/linux/kvm.h
7f1c5b
@@ -1175,6 +1175,7 @@ struct kvm_ppc_resize_hpt {
7f1c5b
 #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
7f1c5b
 #define KVM_CAP_S390_ZPCI_OP 221
7f1c5b
 #define KVM_CAP_S390_CPU_TOPOLOGY 222
7f1c5b
+#define KVM_CAP_DIRTY_LOG_RING_ACQ_REL 223
7f1c5b
 
7f1c5b
 #ifdef KVM_CAP_IRQ_ROUTING
7f1c5b
 
7f1c5b
diff --git a/linux-headers/linux/psci.h b/linux-headers/linux/psci.h
7f1c5b
index 213b2a0f70..e60dfd8907 100644
7f1c5b
--- a/linux-headers/linux/psci.h
7f1c5b
+++ b/linux-headers/linux/psci.h
7f1c5b
@@ -48,12 +48,26 @@
7f1c5b
 #define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU	PSCI_0_2_FN64(7)
7f1c5b
 
7f1c5b
 #define PSCI_1_0_FN_PSCI_FEATURES		PSCI_0_2_FN(10)
7f1c5b
+#define PSCI_1_0_FN_CPU_FREEZE			PSCI_0_2_FN(11)
7f1c5b
+#define PSCI_1_0_FN_CPU_DEFAULT_SUSPEND		PSCI_0_2_FN(12)
7f1c5b
+#define PSCI_1_0_FN_NODE_HW_STATE		PSCI_0_2_FN(13)
7f1c5b
 #define PSCI_1_0_FN_SYSTEM_SUSPEND		PSCI_0_2_FN(14)
7f1c5b
 #define PSCI_1_0_FN_SET_SUSPEND_MODE		PSCI_0_2_FN(15)
7f1c5b
+#define PSCI_1_0_FN_STAT_RESIDENCY		PSCI_0_2_FN(16)
7f1c5b
+#define PSCI_1_0_FN_STAT_COUNT			PSCI_0_2_FN(17)
7f1c5b
+
7f1c5b
 #define PSCI_1_1_FN_SYSTEM_RESET2		PSCI_0_2_FN(18)
7f1c5b
+#define PSCI_1_1_FN_MEM_PROTECT			PSCI_0_2_FN(19)
7f1c5b
+#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE	PSCI_0_2_FN(19)
7f1c5b
 
7f1c5b
+#define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND	PSCI_0_2_FN64(12)
7f1c5b
+#define PSCI_1_0_FN64_NODE_HW_STATE		PSCI_0_2_FN64(13)
7f1c5b
 #define PSCI_1_0_FN64_SYSTEM_SUSPEND		PSCI_0_2_FN64(14)
7f1c5b
+#define PSCI_1_0_FN64_STAT_RESIDENCY		PSCI_0_2_FN64(16)
7f1c5b
+#define PSCI_1_0_FN64_STAT_COUNT		PSCI_0_2_FN64(17)
7f1c5b
+
7f1c5b
 #define PSCI_1_1_FN64_SYSTEM_RESET2		PSCI_0_2_FN64(18)
7f1c5b
+#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE	PSCI_0_2_FN64(19)
7f1c5b
 
7f1c5b
 /* PSCI v0.2 power state encoding for CPU_SUSPEND function */
7f1c5b
 #define PSCI_0_2_POWER_STATE_ID_MASK		0xffff
7f1c5b
diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h
7f1c5b
index a3a377cd44..ba5d0df52f 100644
7f1c5b
--- a/linux-headers/linux/userfaultfd.h
7f1c5b
+++ b/linux-headers/linux/userfaultfd.h
7f1c5b
@@ -12,6 +12,10 @@
7f1c5b
 
7f1c5b
 #include <linux/types.h>
7f1c5b
 
7f1c5b
+/* ioctls for /dev/userfaultfd */
7f1c5b
+#define USERFAULTFD_IOC 0xAA
7f1c5b
+#define USERFAULTFD_IOC_NEW _IO(USERFAULTFD_IOC, 0x00)
7f1c5b
+
7f1c5b
 /*
7f1c5b
  * If the UFFDIO_API is upgraded someday, the UFFDIO_UNREGISTER and
7f1c5b
  * UFFDIO_WAKE ioctls should be defined as _IOW and not as _IOR.  In
7f1c5b
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
7f1c5b
index ede44b5572..bee7e42198 100644
7f1c5b
--- a/linux-headers/linux/vfio.h
7f1c5b
+++ b/linux-headers/linux/vfio.h
7f1c5b
@@ -986,6 +986,148 @@ enum vfio_device_mig_state {
7f1c5b
 	VFIO_DEVICE_STATE_RUNNING_P2P = 5,
7f1c5b
 };
7f1c5b
 
7f1c5b
+/*
7f1c5b
+ * Upon VFIO_DEVICE_FEATURE_SET, allow the device to be moved into a low power
7f1c5b
+ * state with the platform-based power management.  Device use of lower power
7f1c5b
+ * states depends on factors managed by the runtime power management core,
7f1c5b
+ * including system level support and coordinating support among dependent
7f1c5b
+ * devices.  Enabling device low power entry does not guarantee lower power
7f1c5b
+ * usage by the device, nor is a mechanism provided through this feature to
7f1c5b
+ * know the current power state of the device.  If any device access happens
7f1c5b
+ * (either from the host or through the vfio uAPI) when the device is in the
7f1c5b
+ * low power state, then the host will move the device out of the low power
7f1c5b
+ * state as necessary prior to the access.  Once the access is completed, the
7f1c5b
+ * device may re-enter the low power state.  For single shot low power support
7f1c5b
+ * with wake-up notification, see
7f1c5b
+ * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP below.  Access to mmap'd
7f1c5b
+ * device regions is disabled on LOW_POWER_ENTRY and may only be resumed after
7f1c5b
+ * calling LOW_POWER_EXIT.
7f1c5b
+ */
7f1c5b
+#define VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY 3
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * This device feature has the same behavior as
7f1c5b
+ * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY with the exception that the user
7f1c5b
+ * provides an eventfd for wake-up notification.  When the device moves out of
7f1c5b
+ * the low power state for the wake-up, the host will not allow the device to
7f1c5b
+ * re-enter a low power state without a subsequent user call to one of the low
7f1c5b
+ * power entry device feature IOCTLs.  Access to mmap'd device regions is
7f1c5b
+ * disabled on LOW_POWER_ENTRY_WITH_WAKEUP and may only be resumed after the
7f1c5b
+ * low power exit.  The low power exit can happen either through LOW_POWER_EXIT
7f1c5b
+ * or through any other access (where the wake-up notification has been
7f1c5b
+ * generated).  The access to mmap'd device regions will not trigger low power
7f1c5b
+ * exit.
7f1c5b
+ *
7f1c5b
+ * The notification through the provided eventfd will be generated only when
7f1c5b
+ * the device has entered and is resumed from a low power state after
7f1c5b
+ * calling this device feature IOCTL.  A device that has not entered low power
7f1c5b
+ * state, as managed through the runtime power management core, will not
7f1c5b
+ * generate a notification through the provided eventfd on access.  Calling the
7f1c5b
+ * LOW_POWER_EXIT feature is optional in the case where notification has been
7f1c5b
+ * signaled on the provided eventfd that a resume from low power has occurred.
7f1c5b
+ */
7f1c5b
+struct vfio_device_low_power_entry_with_wakeup {
7f1c5b
+	__s32 wakeup_eventfd;
7f1c5b
+	__u32 reserved;
7f1c5b
+};
7f1c5b
+
7f1c5b
+#define VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP 4
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Upon VFIO_DEVICE_FEATURE_SET, disallow use of device low power states as
7f1c5b
+ * previously enabled via VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY or
7f1c5b
+ * VFIO_DEVICE_FEATURE_LOW_POWER_ENTRY_WITH_WAKEUP device features.
7f1c5b
+ * This device feature IOCTL may itself generate a wakeup eventfd notification
7f1c5b
+ * in the latter case if the device had previously entered a low power state.
7f1c5b
+ */
7f1c5b
+#define VFIO_DEVICE_FEATURE_LOW_POWER_EXIT 5
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Upon VFIO_DEVICE_FEATURE_SET start/stop device DMA logging.
7f1c5b
+ * VFIO_DEVICE_FEATURE_PROBE can be used to detect if the device supports
7f1c5b
+ * DMA logging.
7f1c5b
+ *
7f1c5b
+ * DMA logging allows a device to internally record what DMAs the device is
7f1c5b
+ * initiating and report them back to userspace. It is part of the VFIO
7f1c5b
+ * migration infrastructure that allows implementing dirty page tracking
7f1c5b
+ * during the pre copy phase of live migration. Only DMA WRITEs are logged,
7f1c5b
+ * and this API is not connected to VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE.
7f1c5b
+ *
7f1c5b
+ * When DMA logging is started a range of IOVAs to monitor is provided and the
7f1c5b
+ * device can optimize its logging to cover only the IOVA range given. Each
7f1c5b
+ * DMA that the device initiates inside the range will be logged by the device
7f1c5b
+ * for later retrieval.
7f1c5b
+ *
7f1c5b
+ * page_size is an input that hints what tracking granularity the device
7f1c5b
+ * should try to achieve. If the device cannot do the hinted page size then
7f1c5b
+ * it's the driver choice which page size to pick based on its support.
7f1c5b
+ * On output the device will return the page size it selected.
7f1c5b
+ *
7f1c5b
+ * ranges is a pointer to an array of
7f1c5b
+ * struct vfio_device_feature_dma_logging_range.
7f1c5b
+ *
7f1c5b
+ * The core kernel code guarantees to support by minimum num_ranges that fit
7f1c5b
+ * into a single kernel page. User space can try higher values but should give
7f1c5b
+ * up if the above can't be achieved as of some driver limitations.
7f1c5b
+ *
7f1c5b
+ * A single call to start device DMA logging can be issued and a matching stop
7f1c5b
+ * should follow at the end. Another start is not allowed in the meantime.
7f1c5b
+ */
7f1c5b
+struct vfio_device_feature_dma_logging_control {
7f1c5b
+	__aligned_u64 page_size;
7f1c5b
+	__u32 num_ranges;
7f1c5b
+	__u32 __reserved;
7f1c5b
+	__aligned_u64 ranges;
7f1c5b
+};
7f1c5b
+
7f1c5b
+struct vfio_device_feature_dma_logging_range {
7f1c5b
+	__aligned_u64 iova;
7f1c5b
+	__aligned_u64 length;
7f1c5b
+};
7f1c5b
+
7f1c5b
+#define VFIO_DEVICE_FEATURE_DMA_LOGGING_START 6
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Upon VFIO_DEVICE_FEATURE_SET stop device DMA logging that was started
7f1c5b
+ * by VFIO_DEVICE_FEATURE_DMA_LOGGING_START
7f1c5b
+ */
7f1c5b
+#define VFIO_DEVICE_FEATURE_DMA_LOGGING_STOP 7
7f1c5b
+
7f1c5b
+/*
7f1c5b
+ * Upon VFIO_DEVICE_FEATURE_GET read back and clear the device DMA log
7f1c5b
+ *
7f1c5b
+ * Query the device's DMA log for written pages within the given IOVA range.
7f1c5b
+ * During querying the log is cleared for the IOVA range.
7f1c5b
+ *
7f1c5b
+ * bitmap is a pointer to an array of u64s that will hold the output bitmap
7f1c5b
+ * with 1 bit reporting a page_size unit of IOVA. The mapping of IOVA to bits
7f1c5b
+ * is given by:
7f1c5b
+ *  bitmap[(addr - iova)/page_size] & (1ULL << (addr % 64))
7f1c5b
+ *
7f1c5b
+ * The input page_size can be any power of two value and does not have to
7f1c5b
+ * match the value given to VFIO_DEVICE_FEATURE_DMA_LOGGING_START. The driver
7f1c5b
+ * will format its internal logging to match the reporting page size, possibly
7f1c5b
+ * by replicating bits if the internal page size is lower than requested.
7f1c5b
+ *
7f1c5b
+ * The LOGGING_REPORT will only set bits in the bitmap and never clear or
7f1c5b
+ * perform any initialization of the user provided bitmap.
7f1c5b
+ *
7f1c5b
+ * If any error is returned userspace should assume that the dirty log is
7f1c5b
+ * corrupted. Error recovery is to consider all memory dirty and try to
7f1c5b
+ * restart the dirty tracking, or to abort/restart the whole migration.
7f1c5b
+ *
7f1c5b
+ * If DMA logging is not enabled, an error will be returned.
7f1c5b
+ *
7f1c5b
+ */
7f1c5b
+struct vfio_device_feature_dma_logging_report {
7f1c5b
+	__aligned_u64 iova;
7f1c5b
+	__aligned_u64 length;
7f1c5b
+	__aligned_u64 page_size;
7f1c5b
+	__aligned_u64 bitmap;
7f1c5b
+};
7f1c5b
+
7f1c5b
+#define VFIO_DEVICE_FEATURE_DMA_LOGGING_REPORT 8
7f1c5b
+
7f1c5b
 /* -------- API for Type1 VFIO IOMMU -------- */
7f1c5b
 
7f1c5b
 /**
7f1c5b
-- 
7f1c5b
2.31.1
7f1c5b