@samitouri / QOSamiQemu / commits / 695c5776dc

linux-headers: Update to Linux v7.1-rc4

Update headers to retrieve new IOMMUFD capabilities (ATS not-supported), VFIO migration flags (VFIO_PRECOPY_INFO_REINIT flag and VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2), KVM caps for LoongArch and more. Cc: Avihai Horon <avihaih@nvidia.com> Cc: Song Gao <gaosong@loongson.cn> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Cornelia Huck <cohuck@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Song Gao <gaosong@loongson.cn> Link: https://lore.kernel.org/qemu-devel/20260521081409.1843075-1-clg@redhat.com Signed-off-by: Cédric Le Goater <clg@redhat.com>

Cédric Le Goater committed May 21, 2026 at 10:14 UTC 695c5776dc2d6f6468386c7fec5f41822b60cc19
38 files changed +713 -493
include/standard-headers/drm/drm_fourcc.h
+22 -6
@@ -400,8 +400,8 @@ extern "C" {
400 * implementation can multiply the values by 2^6=64. For that reason the padding
401 * must only contain zeros.
402 * index 0 = Y plane, [15:0] z:Y [6:10] little endian
403 - * index 1 = Cr plane, [15:0] z:Cr [6:10] little endian
404 - * index 2 = Cb plane, [15:0] z:Cb [6:10] little endian
403 + * index 1 = Cb plane, [15:0] z:Cb [6:10] little endian
404 + * index 2 = Cr plane, [15:0] z:Cr [6:10] little endian
405 */
406 #define DRM_FORMAT_S010 fourcc_code('S', '0', '1', '0') /* 2x2 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
407 #define DRM_FORMAT_S210 fourcc_code('S', '2', '1', '0') /* 2x1 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
@@ -413,8 +413,8 @@ extern "C" {
413 * implementation can multiply the values by 2^4=16. For that reason the padding
414 * must only contain zeros.
415 * index 0 = Y plane, [15:0] z:Y [4:12] little endian
416 - * index 1 = Cr plane, [15:0] z:Cr [4:12] little endian
417 - * index 2 = Cb plane, [15:0] z:Cb [4:12] little endian
416 + * index 1 = Cb plane, [15:0] z:Cb [4:12] little endian
417 + * index 2 = Cr plane, [15:0] z:Cr [4:12] little endian
418 */
419 #define DRM_FORMAT_S012 fourcc_code('S', '0', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
420 #define DRM_FORMAT_S212 fourcc_code('S', '2', '1', '2') /* 2x1 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
@@ -423,8 +423,8 @@ extern "C" {
423 /*
424 * 3 plane YCbCr
425 * index 0 = Y plane, [15:0] Y little endian
426 - * index 1 = Cr plane, [15:0] Cr little endian
427 - * index 2 = Cb plane, [15:0] Cb little endian
426 + * index 1 = Cb plane, [15:0] Cb little endian
427 + * index 2 = Cr plane, [15:0] Cr little endian
428 */
429 #define DRM_FORMAT_S016 fourcc_code('S', '0', '1', '6') /* 2x2 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
430 #define DRM_FORMAT_S216 fourcc_code('S', '2', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
@@ -1421,6 +1421,22 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier)
1421 #define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \
1422 DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL)
1423
1424 +/*
1425 + * ARM 64k interleaved modifier
1426 + *
1427 + * This is used by ARM Mali v10+ GPUs. With this modifier, the plane is divided
1428 + * into 64k byte 1:1 or 2:1 -sided tiles. The 64k tiles are laid out linearly.
1429 + * Each 64k tile is divided into blocks of 16x16 texel blocks, which are
1430 + * themselves laid out linearly within a 64k tile. Then within each 16x16
1431 + * block, texel blocks are laid out according to U order, similar to
1432 + * 16X16_BLOCK_U_INTERLEAVED.
1433 + *
1434 + * Note that unlike 16X16_BLOCK_U_INTERLEAVED, the layout does not change
1435 + * depending on whether a format is compressed or not.
1436 + */
1437 +#define DRM_FORMAT_MOD_ARM_INTERLEAVED_64K \
1438 + DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 2ULL)
1439 +
1440 /*
1441 * Allwinner tiled modifier
1442 *
include/standard-headers/linux/const.h
+18
@@ -50,4 +50,22 @@
50
51 #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
52
53 +/*
54 + * Divide positive or negative dividend by positive or negative divisor
55 + * and round to closest integer. Result is undefined for negative
56 + * divisors if the dividend variable type is unsigned and for negative
57 + * dividends if the divisor variable type is unsigned.
58 + */
59 +#define __KERNEL_DIV_ROUND_CLOSEST(x, divisor) \
60 +({ \
61 + __typeof__(x) __x = x; \
62 + __typeof__(divisor) __d = divisor; \
63 + \
64 + (((__typeof__(x))-1) > 0 || \
65 + ((__typeof__(divisor))-1) > 0 || \
66 + (((__x) > 0) == ((__d) > 0))) ? \
67 + (((__x) + ((__d) / 2)) / (__d)) : \
68 + (((__x) - ((__d) / 2)) / (__d)); \
69 +})
70 +
71 #endif /* _LINUX_CONST_H */
include/standard-headers/linux/ethtool.h
+22 -6
@@ -17,11 +17,10 @@
17 #include "net/eth.h"
18
19 #include "standard-headers/linux/const.h"
20 +#include "standard-headers/linux/typelimits.h"
21 #include "standard-headers/linux/types.h"
22 #include "standard-headers/linux/if_ether.h"
23
23 -#include <limits.h> /* for INT_MAX */
24 -
24 /* All structures exposed to userland should be defined such that they
25 * have the same layout for 32-bit and 64-bit userland.
26 */
@@ -228,7 +227,7 @@ enum tunable_id {
227 ETHTOOL_ID_UNSPEC,
228 ETHTOOL_RX_COPYBREAK,
229 ETHTOOL_TX_COPYBREAK,
231 - ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
230 + ETHTOOL_PFC_PREVENTION_TOUT, /* both pause and pfc, see man ethtool */
231 ETHTOOL_TX_COPYBREAK_BUF_SIZE,
232 /*
233 * Add your fresh new tunable attribute above and remember to update
@@ -603,6 +602,8 @@ enum ethtool_link_ext_state {
602 ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED,
603 ETHTOOL_LINK_EXT_STATE_OVERHEAT,
604 ETHTOOL_LINK_EXT_STATE_MODULE,
605 + ETHTOOL_LINK_EXT_STATE_OTP_SPEED_VIOLATION,
606 + ETHTOOL_LINK_EXT_STATE_BMC_REQUEST_DOWN,
607 };
608
609 /* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */
@@ -1094,13 +1095,20 @@ enum ethtool_module_fw_flash_status {
1095 * struct ethtool_gstrings - string set for data tagging
1096 * @cmd: Command number = %ETHTOOL_GSTRINGS
1097 * @string_set: String set ID; one of &enum ethtool_stringset
1097 - * @len: On return, the number of strings in the string set
1098 + * @len: Number of strings in the string set
1099 * @data: Buffer for strings. Each string is null-padded to a size of
1100 * %ETH_GSTRING_LEN.
1101 *
1102 * Users must use %ETHTOOL_GSSET_INFO to find the number of strings in
1103 * the string set. They must allocate a buffer of the appropriate
1104 * size immediately following this structure.
1105 + *
1106 + * Setting @len on input is optional (though preferred), but must be zeroed
1107 + * otherwise.
1108 + * When set, @len will return the requested count if it matches the actual
1109 + * count; otherwise, it will be zero.
1110 + * This prevents issues when the number of strings is different than the
1111 + * userspace allocation.
1112 */
1113 struct ethtool_gstrings {
1114 uint32_t cmd;
@@ -1177,13 +1185,20 @@ struct ethtool_test {
1185 /**
1186 * struct ethtool_stats - device-specific statistics
1187 * @cmd: Command number = %ETHTOOL_GSTATS
1180 - * @n_stats: On return, the number of statistics
1188 + * @n_stats: Number of statistics
1189 * @data: Array of statistics
1190 *
1191 * Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
1192 * number of statistics that will be returned. They must allocate a
1193 * buffer of the appropriate size (8 * number of statistics)
1194 * immediately following this structure.
1195 + *
1196 + * Setting @n_stats on input is optional (though preferred), but must be zeroed
1197 + * otherwise.
1198 + * When set, @n_stats will return the requested count if it matches the actual
1199 + * count; otherwise, it will be zero.
1200 + * This prevents issues when the number of stats is different than the
1201 + * userspace allocation.
1202 */
1203 struct ethtool_stats {
1204 uint32_t cmd;
@@ -2190,6 +2205,7 @@ enum ethtool_link_mode_bit_indices {
2205 #define SPEED_40000 40000
2206 #define SPEED_50000 50000
2207 #define SPEED_56000 56000
2208 +#define SPEED_80000 80000
2209 #define SPEED_100000 100000
2210 #define SPEED_200000 200000
2211 #define SPEED_400000 400000
@@ -2200,7 +2216,7 @@ enum ethtool_link_mode_bit_indices {
2216
2217 static inline int ethtool_validate_speed(uint32_t speed)
2218 {
2203 - return speed <= INT_MAX || speed == (uint32_t)SPEED_UNKNOWN;
2219 + return speed <= __KERNEL_INT_MAX || speed == (uint32_t)SPEED_UNKNOWN;
2220 }
2221
2222 /* Duplex, half or full. */
include/standard-headers/linux/input-event-codes.h
+13
@@ -643,6 +643,10 @@
643 #define KEY_EPRIVACY_SCREEN_ON 0x252
644 #define KEY_EPRIVACY_SCREEN_OFF 0x253
645
646 +#define KEY_ACTION_ON_SELECTION 0x254 /* AL Action on Selection (HUTRR119) */
647 +#define KEY_CONTEXTUAL_INSERT 0x255 /* AL Contextual Insertion (HUTRR119) */
648 +#define KEY_CONTEXTUAL_QUERY 0x256 /* AL Contextual Query (HUTRR119) */
649 +
650 #define KEY_KBDINPUTASSIST_PREV 0x260
651 #define KEY_KBDINPUTASSIST_NEXT 0x261
652 #define KEY_KBDINPUTASSIST_PREVGROUP 0x262
@@ -891,6 +895,7 @@
895
896 #define ABS_VOLUME 0x20
897 #define ABS_PROFILE 0x21
898 +#define ABS_SND_PROFILE 0x22
899
900 #define ABS_MISC 0x28
901
@@ -1000,4 +1005,12 @@
1005 #define SND_MAX 0x07
1006 #define SND_CNT (SND_MAX+1)
1007
1008 +/*
1009 + * ABS_SND_PROFILE values
1010 + */
1011 +
1012 +#define SND_PROFILE_SILENT 0x00
1013 +#define SND_PROFILE_VIBRATE 0x01
1014 +#define SND_PROFILE_RING 0x02
1015 +
1016 #endif
include/standard-headers/linux/pci_regs.h
+65 -6
@@ -132,6 +132,11 @@
132 #define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
133 #define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
134 #define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
135 +/* Masks for dword-sized processing of Bus Number and Sec Latency Timer fields */
136 +#define PCI_PRIMARY_BUS_MASK 0x000000ff
137 +#define PCI_SECONDARY_BUS_MASK 0x0000ff00
138 +#define PCI_SUBORDINATE_BUS_MASK 0x00ff0000
139 +#define PCI_SEC_LATENCY_TIMER_MASK 0xff000000
140 #define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
141 #define PCI_IO_LIMIT 0x1d
142 #define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
@@ -707,7 +712,7 @@
712 #define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */
713 #define PCI_EXP_LNKSTA2 0x32 /* Link Status 2 */
714 #define PCI_EXP_LNKSTA2_FLIT 0x0400 /* Flit Mode Status */
710 -#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32 /* end of v2 EPs w/ link */
715 +#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x34 /* end of v2 EPs w/ link */
716 #define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities 2 */
717 #define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */
718 #define PCI_EXP_SLTCTL2 0x38 /* Slot Control 2 */
@@ -1253,11 +1258,6 @@
1258 #define PCI_DEV3_STA 0x0c /* Device 3 Status Register */
1259 #define PCI_DEV3_STA_SEGMENT 0x8 /* Segment Captured (end-to-end flit-mode detected) */
1260
1256 -/* Compute Express Link (CXL r3.1, sec 8.1.5) */
1257 -#define PCI_DVSEC_CXL_PORT 3
1258 -#define PCI_DVSEC_CXL_PORT_CTL 0x0c
1259 -#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001
1260 -
1261 /* Integrity and Data Encryption Extended Capability */
1262 #define PCI_IDE_CAP 0x04
1263 #define PCI_IDE_CAP_LINK 0x1 /* Link IDE Stream Supported */
@@ -1338,4 +1338,63 @@
1338 #define PCI_IDE_SEL_ADDR_3(x) (28 + (x) * PCI_IDE_SEL_ADDR_BLOCK_SIZE)
1339 #define PCI_IDE_SEL_BLOCK_SIZE(nr_assoc) (20 + PCI_IDE_SEL_ADDR_BLOCK_SIZE * (nr_assoc))
1340
1341 +/*
1342 + * Compute Express Link (CXL r4.0, sec 8.1)
1343 + *
1344 + * Note that CXL DVSEC id 3 and 7 to be ignored when the CXL link state
1345 + * is "disconnected" (CXL r4.0, sec 9.12.3). Re-enumerate these
1346 + * registers on downstream link-up events.
1347 + */
1348 +
1349 +/* CXL r4.0, 8.1.3: PCIe DVSEC for CXL Device */
1350 +#define PCI_DVSEC_CXL_DEVICE 0
1351 +#define PCI_DVSEC_CXL_CAP 0xA
1352 +#define PCI_DVSEC_CXL_MEM_CAPABLE _BITUL(2)
1353 +#define PCI_DVSEC_CXL_HDM_COUNT __GENMASK(5, 4)
1354 +#define PCI_DVSEC_CXL_CTRL 0xC
1355 +#define PCI_DVSEC_CXL_MEM_ENABLE _BITUL(2)
1356 +#define PCI_DVSEC_CXL_RANGE_SIZE_HIGH(i) (0x18 + (i * 0x10))
1357 +#define PCI_DVSEC_CXL_RANGE_SIZE_LOW(i) (0x1C + (i * 0x10))
1358 +#define PCI_DVSEC_CXL_MEM_INFO_VALID _BITUL(0)
1359 +#define PCI_DVSEC_CXL_MEM_ACTIVE _BITUL(1)
1360 +#define PCI_DVSEC_CXL_MEM_SIZE_LOW __GENMASK(31, 28)
1361 +#define PCI_DVSEC_CXL_RANGE_BASE_HIGH(i) (0x20 + (i * 0x10))
1362 +#define PCI_DVSEC_CXL_RANGE_BASE_LOW(i) (0x24 + (i * 0x10))
1363 +#define PCI_DVSEC_CXL_MEM_BASE_LOW __GENMASK(31, 28)
1364 +
1365 +#define CXL_DVSEC_RANGE_MAX 2
1366 +
1367 +/* CXL r4.0, 8.1.4: Non-CXL Function Map DVSEC */
1368 +#define PCI_DVSEC_CXL_FUNCTION_MAP 2
1369 +
1370 +/* CXL r4.0, 8.1.5: Extensions DVSEC for Ports */
1371 +#define PCI_DVSEC_CXL_PORT 3
1372 +#define PCI_DVSEC_CXL_PORT_CTL 0x0c
1373 +#define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001
1374 +
1375 +/* CXL r4.0, 8.1.6: GPF DVSEC for CXL Port */
1376 +#define PCI_DVSEC_CXL_PORT_GPF 4
1377 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_1_CONTROL 0x0C
1378 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_1_TMO_BASE __GENMASK(3, 0)
1379 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_1_TMO_SCALE __GENMASK(11, 8)
1380 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_2_CONTROL 0xE
1381 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_2_TMO_BASE __GENMASK(3, 0)
1382 +#define PCI_DVSEC_CXL_PORT_GPF_PHASE_2_TMO_SCALE __GENMASK(11, 8)
1383 +
1384 +/* CXL r4.0, 8.1.7: GPF DVSEC for CXL Device */
1385 +#define PCI_DVSEC_CXL_DEVICE_GPF 5
1386 +
1387 +/* CXL r4.0, 8.1.8: Flex Bus DVSEC */
1388 +#define PCI_DVSEC_CXL_FLEXBUS_PORT 7
1389 +#define PCI_DVSEC_CXL_FLEXBUS_PORT_STATUS 0xE
1390 +#define PCI_DVSEC_CXL_FLEXBUS_PORT_STATUS_CACHE _BITUL(0)
1391 +#define PCI_DVSEC_CXL_FLEXBUS_PORT_STATUS_MEM _BITUL(2)
1392 +
1393 +/* CXL r4.0, 8.1.9: Register Locator DVSEC */
1394 +#define PCI_DVSEC_CXL_REG_LOCATOR 8
1395 +#define PCI_DVSEC_CXL_REG_LOCATOR_BLOCK1 0xC
1396 +#define PCI_DVSEC_CXL_REG_LOCATOR_BIR __GENMASK(2, 0)
1397 +#define PCI_DVSEC_CXL_REG_LOCATOR_BLOCK_ID __GENMASK(15, 8)
1398 +#define PCI_DVSEC_CXL_REG_LOCATOR_BLOCK_OFF_LOW __GENMASK(31, 16)
1399 +
1400 #endif /* LINUX_PCI_REGS_H */
include/standard-headers/linux/typelimits.h new
+8
@@ -0,0 +1,8 @@
1 +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 +#ifndef _LINUX_TYPELIMITS_H
3 +#define _LINUX_TYPELIMITS_H
4 +
5 +#define __KERNEL_INT_MAX ((int)(~0U >> 1))
6 +#define __KERNEL_INT_MIN (-__KERNEL_INT_MAX - 1)
7 +
8 +#endif /* _LINUX_TYPELIMITS_H */
include/standard-headers/linux/virtio_ring.h
+3 -2
@@ -1,5 +1,7 @@
1 #ifndef _LINUX_VIRTIO_RING_H
2 #define _LINUX_VIRTIO_RING_H
3 +
4 +#define VIRTIO_RING_NO_LEGACY
5 /* An interface for efficient virtio implementation, currently for use by KVM,
6 * but hopefully others soon. Do NOT change this since it will
7 * break existing servers and clients.
@@ -31,7 +33,6 @@
33 * SUCH DAMAGE.
34 *
35 * Copyright Rusty Russell IBM Corporation 2007. */
34 -#include <stdint.h>
36 #include "standard-headers/linux/types.h"
37 #include "standard-headers/linux/virtio_types.h"
38
@@ -200,7 +201,7 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
201 vr->num = num;
202 vr->desc = p;
203 vr->avail = (struct vring_avail *)((char *)p + num * sizeof(struct vring_desc));
203 - vr->used = (void *)(((uintptr_t)&vr->avail->ring[num] + sizeof(__virtio16)
204 + vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__virtio16)
205 + align-1) & ~(align - 1));
206 }
207
include/standard-headers/linux/virtio_rtc.h new
+237
@@ -0,0 +1,237 @@
1 +/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2 +/*
3 + * Copyright (C) 2022-2024 OpenSynergy GmbH
4 + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
5 + */
6 +
7 +#ifndef _LINUX_VIRTIO_RTC_H
8 +#define _LINUX_VIRTIO_RTC_H
9 +
10 +#include "standard-headers/linux/types.h"
11 +
12 +/* alarm feature */
13 +#define VIRTIO_RTC_F_ALARM 0
14 +
15 +/* read request message types */
16 +
17 +#define VIRTIO_RTC_REQ_READ 0x0001
18 +#define VIRTIO_RTC_REQ_READ_CROSS 0x0002
19 +
20 +/* control request message types */
21 +
22 +#define VIRTIO_RTC_REQ_CFG 0x1000
23 +#define VIRTIO_RTC_REQ_CLOCK_CAP 0x1001
24 +#define VIRTIO_RTC_REQ_CROSS_CAP 0x1002
25 +#define VIRTIO_RTC_REQ_READ_ALARM 0x1003
26 +#define VIRTIO_RTC_REQ_SET_ALARM 0x1004
27 +#define VIRTIO_RTC_REQ_SET_ALARM_ENABLED 0x1005
28 +
29 +/* alarmq message types */
30 +
31 +#define VIRTIO_RTC_NOTIF_ALARM 0x2000
32 +
33 +/* Message headers */
34 +
35 +/** common request header */
36 +struct virtio_rtc_req_head {
37 + uint16_t msg_type;
38 + uint8_t reserved[6];
39 +};
40 +
41 +/** common response header */
42 +struct virtio_rtc_resp_head {
43 +#define VIRTIO_RTC_S_OK 0
44 +#define VIRTIO_RTC_S_EOPNOTSUPP 2
45 +#define VIRTIO_RTC_S_ENODEV 3
46 +#define VIRTIO_RTC_S_EINVAL 4
47 +#define VIRTIO_RTC_S_EIO 5
48 + uint8_t status;
49 + uint8_t reserved[7];
50 +};
51 +
52 +/** common notification header */
53 +struct virtio_rtc_notif_head {
54 + uint16_t msg_type;
55 + uint8_t reserved[6];
56 +};
57 +
58 +/* read requests */
59 +
60 +/* VIRTIO_RTC_REQ_READ message */
61 +
62 +struct virtio_rtc_req_read {
63 + struct virtio_rtc_req_head head;
64 + uint16_t clock_id;
65 + uint8_t reserved[6];
66 +};
67 +
68 +struct virtio_rtc_resp_read {
69 + struct virtio_rtc_resp_head head;
70 + uint64_t clock_reading;
71 +};
72 +
73 +/* VIRTIO_RTC_REQ_READ_CROSS message */
74 +
75 +struct virtio_rtc_req_read_cross {
76 + struct virtio_rtc_req_head head;
77 + uint16_t clock_id;
78 +/* Arm Generic Timer Counter-timer Virtual Count Register (CNTVCT_EL0) */
79 +#define VIRTIO_RTC_COUNTER_ARM_VCT 0
80 +/* x86 Time-Stamp Counter */
81 +#define VIRTIO_RTC_COUNTER_X86_TSC 1
82 +/* Invalid */
83 +#define VIRTIO_RTC_COUNTER_INVALID 0xFF
84 + uint8_t hw_counter;
85 + uint8_t reserved[5];
86 +};
87 +
88 +struct virtio_rtc_resp_read_cross {
89 + struct virtio_rtc_resp_head head;
90 + uint64_t clock_reading;
91 + uint64_t counter_cycles;
92 +};
93 +
94 +/* control requests */
95 +
96 +/* VIRTIO_RTC_REQ_CFG message */
97 +
98 +struct virtio_rtc_req_cfg {
99 + struct virtio_rtc_req_head head;
100 + /* no request params */
101 +};
102 +
103 +struct virtio_rtc_resp_cfg {
104 + struct virtio_rtc_resp_head head;
105 + /** # of clocks -> clock ids < num_clocks are valid */
106 + uint16_t num_clocks;
107 + uint8_t reserved[6];
108 +};
109 +
110 +/* VIRTIO_RTC_REQ_CLOCK_CAP message */
111 +
112 +struct virtio_rtc_req_clock_cap {
113 + struct virtio_rtc_req_head head;
114 + uint16_t clock_id;
115 + uint8_t reserved[6];
116 +};
117 +
118 +struct virtio_rtc_resp_clock_cap {
119 + struct virtio_rtc_resp_head head;
120 +#define VIRTIO_RTC_CLOCK_UTC 0
121 +#define VIRTIO_RTC_CLOCK_TAI 1
122 +#define VIRTIO_RTC_CLOCK_MONOTONIC 2
123 +#define VIRTIO_RTC_CLOCK_UTC_SMEARED 3
124 +#define VIRTIO_RTC_CLOCK_UTC_MAYBE_SMEARED 4
125 + uint8_t type;
126 +#define VIRTIO_RTC_SMEAR_UNSPECIFIED 0
127 +#define VIRTIO_RTC_SMEAR_NOON_LINEAR 1
128 +#define VIRTIO_RTC_SMEAR_UTC_SLS 2
129 + uint8_t leap_second_smearing;
130 +#define VIRTIO_RTC_FLAG_ALARM_CAP (1 << 0)
131 + uint8_t flags;
132 + uint8_t reserved[5];
133 +};
134 +
135 +/* VIRTIO_RTC_REQ_CROSS_CAP message */
136 +
137 +struct virtio_rtc_req_cross_cap {
138 + struct virtio_rtc_req_head head;
139 + uint16_t clock_id;
140 + uint8_t hw_counter;
141 + uint8_t reserved[5];
142 +};
143 +
144 +struct virtio_rtc_resp_cross_cap {
145 + struct virtio_rtc_resp_head head;
146 +#define VIRTIO_RTC_FLAG_CROSS_CAP (1 << 0)
147 + uint8_t flags;
148 + uint8_t reserved[7];
149 +};
150 +
151 +/* VIRTIO_RTC_REQ_READ_ALARM message */
152 +
153 +struct virtio_rtc_req_read_alarm {
154 + struct virtio_rtc_req_head head;
155 + uint16_t clock_id;
156 + uint8_t reserved[6];
157 +};
158 +
159 +struct virtio_rtc_resp_read_alarm {
160 + struct virtio_rtc_resp_head head;
161 + uint64_t alarm_time;
162 +#define VIRTIO_RTC_FLAG_ALARM_ENABLED (1 << 0)
163 + uint8_t flags;
164 + uint8_t reserved[7];
165 +};
166 +
167 +/* VIRTIO_RTC_REQ_SET_ALARM message */
168 +
169 +struct virtio_rtc_req_set_alarm {
170 + struct virtio_rtc_req_head head;
171 + uint64_t alarm_time;
172 + uint16_t clock_id;
173 + /* flag VIRTIO_RTC_FLAG_ALARM_ENABLED */
174 + uint8_t flags;
175 + uint8_t reserved[5];
176 +};
177 +
178 +struct virtio_rtc_resp_set_alarm {
179 + struct virtio_rtc_resp_head head;
180 + /* no response params */
181 +};
182 +
183 +/* VIRTIO_RTC_REQ_SET_ALARM_ENABLED message */
184 +
185 +struct virtio_rtc_req_set_alarm_enabled {
186 + struct virtio_rtc_req_head head;
187 + uint16_t clock_id;
188 + /* flag VIRTIO_RTC_ALARM_ENABLED */
189 + uint8_t flags;
190 + uint8_t reserved[5];
191 +};
192 +
193 +struct virtio_rtc_resp_set_alarm_enabled {
194 + struct virtio_rtc_resp_head head;
195 + /* no response params */
196 +};
197 +
198 +/** Union of request types for requestq */
199 +union virtio_rtc_req_requestq {
200 + struct virtio_rtc_req_read read;
201 + struct virtio_rtc_req_read_cross read_cross;
202 + struct virtio_rtc_req_cfg cfg;
203 + struct virtio_rtc_req_clock_cap clock_cap;
204 + struct virtio_rtc_req_cross_cap cross_cap;
205 + struct virtio_rtc_req_read_alarm read_alarm;
206 + struct virtio_rtc_req_set_alarm set_alarm;
207 + struct virtio_rtc_req_set_alarm_enabled set_alarm_enabled;
208 +};
209 +
210 +/** Union of response types for requestq */
211 +union virtio_rtc_resp_requestq {
212 + struct virtio_rtc_resp_read read;
213 + struct virtio_rtc_resp_read_cross read_cross;
214 + struct virtio_rtc_resp_cfg cfg;
215 + struct virtio_rtc_resp_clock_cap clock_cap;
216 + struct virtio_rtc_resp_cross_cap cross_cap;
217 + struct virtio_rtc_resp_read_alarm read_alarm;
218 + struct virtio_rtc_resp_set_alarm set_alarm;
219 + struct virtio_rtc_resp_set_alarm_enabled set_alarm_enabled;
220 +};
221 +
222 +/* alarmq notifications */
223 +
224 +/* VIRTIO_RTC_NOTIF_ALARM notification */
225 +
226 +struct virtio_rtc_notif_alarm {
227 + struct virtio_rtc_notif_head head;
228 + uint16_t clock_id;
229 + uint8_t reserved[6];
230 +};
231 +
232 +/** Union of notification types for alarmq */
233 +union virtio_rtc_notif_alarmq {
234 + struct virtio_rtc_notif_alarm alarm;
235 +};
236 +
237 +#endif /* _LINUX_VIRTIO_RTC_H */
include/standard-headers/linux/vmclock-abi.h
+20
@@ -115,6 +115,17 @@ struct vmclock_abi {
115 * bit again after the update, using the about-to-be-valid fields.
116 */
117 #define VMCLOCK_FLAG_TIME_MONOTONIC (1 << 7)
118 + /*
119 + * If the VM_GEN_COUNTER_PRESENT flag is set, the hypervisor will
120 + * bump the vm_generation_counter field every time the guest is
121 + * loaded from some save state (restored from a snapshot).
122 + */
123 +#define VMCLOCK_FLAG_VM_GEN_COUNTER_PRESENT (1 << 8)
124 + /*
125 + * If the NOTIFICATION_PRESENT flag is set, the hypervisor will send
126 + * a notification every time it updates seq_count to a new even number.
127 + */
128 +#define VMCLOCK_FLAG_NOTIFICATION_PRESENT (1 << 9)
129
130 uint8_t pad[2];
131 uint8_t clock_status;
@@ -177,6 +188,15 @@ struct vmclock_abi {
188 uint64_t time_frac_sec; /* Units of 1/2^64 of a second */
189 uint64_t time_esterror_nanosec;
190 uint64_t time_maxerror_nanosec;
191 +
192 + /*
193 + * This field changes to another non-repeating value when the guest
194 + * has been loaded from a snapshot. In addition to handling a
195 + * disruption in time (which will also be signalled through the
196 + * disruption_marker field), a guest may wish to discard UUIDs,
197 + * reset network connections, reseed entropy, etc.
198 + */
199 + uint64_t vm_generation_counter;
200 };
201
202 #endif /* __VMCLOCK_ABI_H__ */
linux-headers/asm-arm64/kvm.h
+1
@@ -416,6 +416,7 @@ enum {
416 #define KVM_DEV_ARM_ITS_RESTORE_TABLES 2
417 #define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3
418 #define KVM_DEV_ARM_ITS_CTRL_RESET 4
419 +#define KVM_DEV_ARM_VGIC_USERSPACE_PPIS 5
420
421 /* Device Control API on vcpu fd */
422 #define KVM_ARM_VCPU_PMU_V3_CTRL 0
linux-headers/asm-arm64/unistd_64.h
+1
@@ -327,6 +327,7 @@
327 #define __NR_file_getattr 468
328 #define __NR_file_setattr 469
329 #define __NR_listns 470
330 +#define __NR_rseq_slice_yield 471
331
332
333 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-generic/unistd.h
+4 -1
@@ -860,8 +860,11 @@ __SYSCALL(__NR_file_setattr, sys_file_setattr)
860 #define __NR_listns 470
861 __SYSCALL(__NR_listns, sys_listns)
862
863 +#define __NR_rseq_slice_yield 471
864 +__SYSCALL(__NR_rseq_slice_yield, sys_rseq_slice_yield)
865 +
866 #undef __NR_syscalls
864 -#define __NR_syscalls 471
867 +#define __NR_syscalls 472
868
869 /*
870 * 32 bit systems traditionally used different
linux-headers/asm-loongarch/kvm.h
+5
@@ -105,6 +105,7 @@ struct kvm_fpu {
105 #define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7
106 #define KVM_LOONGARCH_VM_FEAT_PTW 8
107 #define KVM_LOONGARCH_VM_FEAT_MSGINT 9
108 +#define KVM_LOONGARCH_VM_FEAT_PV_PREEMPT 10
109
110 /* Device Control API on vcpu fd */
111 #define KVM_LOONGARCH_VCPU_CPUCFG 0
@@ -154,4 +155,8 @@ struct kvm_iocsr_entry {
155 #define KVM_DEV_LOONGARCH_PCH_PIC_GRP_CTRL 0x40000006
156 #define KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT 0
157
158 +#define KVM_DEV_LOONGARCH_DMSINTC_GRP_CTRL 0x40000007
159 +#define KVM_DEV_LOONGARCH_DMSINTC_MSG_ADDR_BASE 0x0
160 +#define KVM_DEV_LOONGARCH_DMSINTC_MSG_ADDR_SIZE 0x1
161 +
162 #endif /* __UAPI_ASM_LOONGARCH_KVM_H */
linux-headers/asm-loongarch/kvm_para.h
+1
@@ -15,6 +15,7 @@
15 #define CPUCFG_KVM_FEATURE (CPUCFG_KVM_BASE + 4)
16 #define KVM_FEATURE_IPI 1
17 #define KVM_FEATURE_STEAL_TIME 2
18 +#define KVM_FEATURE_PREEMPT 3
19 /* BIT 24 - 31 are features configurable by user space vmm */
20 #define KVM_FEATURE_VIRT_EXTIOI 24
21 #define KVM_FEATURE_USER_HCALL 25
linux-headers/asm-loongarch/unistd_64.h
+2
@@ -300,6 +300,7 @@
300 #define __NR_landlock_create_ruleset 444
301 #define __NR_landlock_add_rule 445
302 #define __NR_landlock_restrict_self 446
303 +#define __NR_memfd_secret 447
304 #define __NR_process_mrelease 448
305 #define __NR_futex_waitv 449
306 #define __NR_set_mempolicy_home_node 450
@@ -323,6 +324,7 @@
324 #define __NR_file_getattr 468
325 #define __NR_file_setattr 469
326 #define __NR_listns 470
327 +#define __NR_rseq_slice_yield 471
328
329
330 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-mips/unistd_n32.h
+1
@@ -399,5 +399,6 @@
399 #define __NR_file_getattr (__NR_Linux + 468)
400 #define __NR_file_setattr (__NR_Linux + 469)
401 #define __NR_listns (__NR_Linux + 470)
402 +#define __NR_rseq_slice_yield (__NR_Linux + 471)
403
404 #endif /* _ASM_UNISTD_N32_H */
linux-headers/asm-mips/unistd_n64.h
+1
@@ -375,5 +375,6 @@
375 #define __NR_file_getattr (__NR_Linux + 468)
376 #define __NR_file_setattr (__NR_Linux + 469)
377 #define __NR_listns (__NR_Linux + 470)
378 +#define __NR_rseq_slice_yield (__NR_Linux + 471)
379
380 #endif /* _ASM_UNISTD_N64_H */
linux-headers/asm-mips/unistd_o32.h
+1
@@ -445,5 +445,6 @@
445 #define __NR_file_getattr (__NR_Linux + 468)
446 #define __NR_file_setattr (__NR_Linux + 469)
447 #define __NR_listns (__NR_Linux + 470)
448 +#define __NR_rseq_slice_yield (__NR_Linux + 471)
449
450 #endif /* _ASM_UNISTD_O32_H */
linux-headers/asm-powerpc/unistd_32.h
+1
@@ -452,6 +452,7 @@
452 #define __NR_file_getattr 468
453 #define __NR_file_setattr 469
454 #define __NR_listns 470
455 +#define __NR_rseq_slice_yield 471
456
457
458 #endif /* _ASM_UNISTD_32_H */
linux-headers/asm-powerpc/unistd_64.h
+1
@@ -424,6 +424,7 @@
424 #define __NR_file_getattr 468
425 #define __NR_file_setattr 469
426 #define __NR_listns 470
427 +#define __NR_rseq_slice_yield 471
428
429
430 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-riscv/kvm.h
+7 -4
@@ -110,6 +110,10 @@ struct kvm_riscv_timer {
110 __u64 state;
111 };
112
113 +/* Possible states for kvm_riscv_timer */
114 +#define KVM_RISCV_TIMER_STATE_OFF 0
115 +#define KVM_RISCV_TIMER_STATE_ON 1
116 +
117 /*
118 * ISA extension IDs specific to KVM. This is not the same as the host ISA
119 * extension IDs as that is internal to the host and should not be exposed
@@ -192,6 +196,9 @@ enum KVM_RISCV_ISA_EXT_ID {
196 KVM_RISCV_ISA_EXT_ZFBFMIN,
197 KVM_RISCV_ISA_EXT_ZVFBFMIN,
198 KVM_RISCV_ISA_EXT_ZVFBFWMA,
199 + KVM_RISCV_ISA_EXT_ZCLSD,
200 + KVM_RISCV_ISA_EXT_ZILSD,
201 + KVM_RISCV_ISA_EXT_ZALASR,
202 KVM_RISCV_ISA_EXT_MAX,
203 };
204
@@ -235,10 +242,6 @@ struct kvm_riscv_sbi_fwft {
242 struct kvm_riscv_sbi_fwft_feature pointer_masking;
243 };
244
238 -/* Possible states for kvm_riscv_timer */
239 -#define KVM_RISCV_TIMER_STATE_OFF 0
240 -#define KVM_RISCV_TIMER_STATE_ON 1
241 -
245 /* If you need to interpret the index values, here is the key: */
246 #define KVM_REG_RISCV_TYPE_MASK 0x00000000FF000000
247 #define KVM_REG_RISCV_TYPE_SHIFT 24
linux-headers/asm-riscv/ptrace.h
+37
@@ -9,6 +9,7 @@
9 #ifndef __ASSEMBLER__
10
11 #include <linux/types.h>
12 +#include <linux/const.h>
13
14 #define PTRACE_GETFDPIC 33
15
@@ -127,6 +128,42 @@ struct __riscv_v_regset_state {
128 */
129 #define RISCV_MAX_VLENB (8192)
130
131 +struct __sc_riscv_cfi_state {
132 + unsigned long ss_ptr; /* shadow stack pointer */
133 +};
134 +
135 +#define PTRACE_CFI_BRANCH_LANDING_PAD_EN_BIT 0
136 +#define PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_BIT 1
137 +#define PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_BIT 2
138 +#define PTRACE_CFI_SHADOW_STACK_EN_BIT 3
139 +#define PTRACE_CFI_SHADOW_STACK_LOCK_BIT 4
140 +#define PTRACE_CFI_SHADOW_STACK_PTR_BIT 5
141 +
142 +#define PTRACE_CFI_BRANCH_LANDING_PAD_EN_STATE _BITUL(PTRACE_CFI_BRANCH_LANDING_PAD_EN_BIT)
143 +#define PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_STATE \
144 + _BITUL(PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_BIT)
145 +#define PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_STATE \
146 + _BITUL(PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_BIT)
147 +#define PTRACE_CFI_SHADOW_STACK_EN_STATE _BITUL(PTRACE_CFI_SHADOW_STACK_EN_BIT)
148 +#define PTRACE_CFI_SHADOW_STACK_LOCK_STATE _BITUL(PTRACE_CFI_SHADOW_STACK_LOCK_BIT)
149 +#define PTRACE_CFI_SHADOW_STACK_PTR_STATE _BITUL(PTRACE_CFI_SHADOW_STACK_PTR_BIT)
150 +
151 +#define PTRACE_CFI_STATE_INVALID_MASK ~(PTRACE_CFI_BRANCH_LANDING_PAD_EN_STATE | \
152 + PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_STATE | \
153 + PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_STATE | \
154 + PTRACE_CFI_SHADOW_STACK_EN_STATE | \
155 + PTRACE_CFI_SHADOW_STACK_LOCK_STATE | \
156 + PTRACE_CFI_SHADOW_STACK_PTR_STATE)
157 +
158 +struct __cfi_status {
159 + __u64 cfi_state;
160 +};
161 +
162 +struct user_cfi_state {
163 + struct __cfi_status cfi_status;
164 + __u64 shstk_ptr;
165 +};
166 +
167 #endif /* __ASSEMBLER__ */
168
169 #endif /* _ASM_RISCV_PTRACE_H */
linux-headers/asm-riscv/unistd_32.h
+1
@@ -318,6 +318,7 @@
318 #define __NR_file_getattr 468
319 #define __NR_file_setattr 469
320 #define __NR_listns 470
321 +#define __NR_rseq_slice_yield 471
322
323
324 #endif /* _ASM_UNISTD_32_H */
linux-headers/asm-riscv/unistd_64.h
+1
@@ -328,6 +328,7 @@
328 #define __NR_file_getattr 468
329 #define __NR_file_setattr 469
330 #define __NR_listns 470
331 +#define __NR_rseq_slice_yield 471
332
333
334 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-s390/unistd_32.h deleted
-446
@@ -1,446 +0,0 @@
1 -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 -#ifndef _ASM_S390_UNISTD_32_H
3 -#define _ASM_S390_UNISTD_32_H
4 -
5 -#define __NR_exit 1
6 -#define __NR_fork 2
7 -#define __NR_read 3
8 -#define __NR_write 4
9 -#define __NR_open 5
10 -#define __NR_close 6
11 -#define __NR_restart_syscall 7
12 -#define __NR_creat 8
13 -#define __NR_link 9
14 -#define __NR_unlink 10
15 -#define __NR_execve 11
16 -#define __NR_chdir 12
17 -#define __NR_time 13
18 -#define __NR_mknod 14
19 -#define __NR_chmod 15
20 -#define __NR_lchown 16
21 -#define __NR_lseek 19
22 -#define __NR_getpid 20
23 -#define __NR_mount 21
24 -#define __NR_umount 22
25 -#define __NR_setuid 23
26 -#define __NR_getuid 24
27 -#define __NR_stime 25
28 -#define __NR_ptrace 26
29 -#define __NR_alarm 27
30 -#define __NR_pause 29
31 -#define __NR_utime 30
32 -#define __NR_access 33
33 -#define __NR_nice 34
34 -#define __NR_sync 36
35 -#define __NR_kill 37
36 -#define __NR_rename 38
37 -#define __NR_mkdir 39
38 -#define __NR_rmdir 40
39 -#define __NR_dup 41
40 -#define __NR_pipe 42
41 -#define __NR_times 43
42 -#define __NR_brk 45
43 -#define __NR_setgid 46
44 -#define __NR_getgid 47
45 -#define __NR_signal 48
46 -#define __NR_geteuid 49
47 -#define __NR_getegid 50
48 -#define __NR_acct 51
49 -#define __NR_umount2 52
50 -#define __NR_ioctl 54
51 -#define __NR_fcntl 55
52 -#define __NR_setpgid 57
53 -#define __NR_umask 60
54 -#define __NR_chroot 61
55 -#define __NR_ustat 62
56 -#define __NR_dup2 63
57 -#define __NR_getppid 64
58 -#define __NR_getpgrp 65
59 -#define __NR_setsid 66
60 -#define __NR_sigaction 67
61 -#define __NR_setreuid 70
62 -#define __NR_setregid 71
63 -#define __NR_sigsuspend 72
64 -#define __NR_sigpending 73
65 -#define __NR_sethostname 74
66 -#define __NR_setrlimit 75
67 -#define __NR_getrlimit 76
68 -#define __NR_getrusage 77
69 -#define __NR_gettimeofday 78
70 -#define __NR_settimeofday 79
71 -#define __NR_getgroups 80
72 -#define __NR_setgroups 81
73 -#define __NR_symlink 83
74 -#define __NR_readlink 85
75 -#define __NR_uselib 86
76 -#define __NR_swapon 87
77 -#define __NR_reboot 88
78 -#define __NR_readdir 89
79 -#define __NR_mmap 90
80 -#define __NR_munmap 91
81 -#define __NR_truncate 92
82 -#define __NR_ftruncate 93
83 -#define __NR_fchmod 94
84 -#define __NR_fchown 95
85 -#define __NR_getpriority 96
86 -#define __NR_setpriority 97
87 -#define __NR_statfs 99
88 -#define __NR_fstatfs 100
89 -#define __NR_ioperm 101
90 -#define __NR_socketcall 102
91 -#define __NR_syslog 103
92 -#define __NR_setitimer 104
93 -#define __NR_getitimer 105
94 -#define __NR_stat 106
95 -#define __NR_lstat 107
96 -#define __NR_fstat 108
97 -#define __NR_lookup_dcookie 110
98 -#define __NR_vhangup 111
99 -#define __NR_idle 112
100 -#define __NR_wait4 114
101 -#define __NR_swapoff 115
102 -#define __NR_sysinfo 116
103 -#define __NR_ipc 117
104 -#define __NR_fsync 118
105 -#define __NR_sigreturn 119
106 -#define __NR_clone 120
107 -#define __NR_setdomainname 121
108 -#define __NR_uname 122
109 -#define __NR_adjtimex 124
110 -#define __NR_mprotect 125
111 -#define __NR_sigprocmask 126
112 -#define __NR_create_module 127
113 -#define __NR_init_module 128
114 -#define __NR_delete_module 129
115 -#define __NR_get_kernel_syms 130
116 -#define __NR_quotactl 131
117 -#define __NR_getpgid 132
118 -#define __NR_fchdir 133
119 -#define __NR_bdflush 134
120 -#define __NR_sysfs 135
121 -#define __NR_personality 136
122 -#define __NR_afs_syscall 137
123 -#define __NR_setfsuid 138
124 -#define __NR_setfsgid 139
125 -#define __NR__llseek 140
126 -#define __NR_getdents 141
127 -#define __NR__newselect 142
128 -#define __NR_flock 143
129 -#define __NR_msync 144
130 -#define __NR_readv 145
131 -#define __NR_writev 146
132 -#define __NR_getsid 147
133 -#define __NR_fdatasync 148
134 -#define __NR__sysctl 149
135 -#define __NR_mlock 150
136 -#define __NR_munlock 151
137 -#define __NR_mlockall 152
138 -#define __NR_munlockall 153
139 -#define __NR_sched_setparam 154
140 -#define __NR_sched_getparam 155
141 -#define __NR_sched_setscheduler 156
142 -#define __NR_sched_getscheduler 157
143 -#define __NR_sched_yield 158
144 -#define __NR_sched_get_priority_max 159
145 -#define __NR_sched_get_priority_min 160
146 -#define __NR_sched_rr_get_interval 161
147 -#define __NR_nanosleep 162
148 -#define __NR_mremap 163
149 -#define __NR_setresuid 164
150 -#define __NR_getresuid 165
151 -#define __NR_query_module 167
152 -#define __NR_poll 168
153 -#define __NR_nfsservctl 169
154 -#define __NR_setresgid 170
155 -#define __NR_getresgid 171
156 -#define __NR_prctl 172
157 -#define __NR_rt_sigreturn 173
158 -#define __NR_rt_sigaction 174
159 -#define __NR_rt_sigprocmask 175
160 -#define __NR_rt_sigpending 176
161 -#define __NR_rt_sigtimedwait 177
162 -#define __NR_rt_sigqueueinfo 178
163 -#define __NR_rt_sigsuspend 179
164 -#define __NR_pread64 180
165 -#define __NR_pwrite64 181
166 -#define __NR_chown 182
167 -#define __NR_getcwd 183
168 -#define __NR_capget 184
169 -#define __NR_capset 185
170 -#define __NR_sigaltstack 186
171 -#define __NR_sendfile 187
172 -#define __NR_getpmsg 188
173 -#define __NR_putpmsg 189
174 -#define __NR_vfork 190
175 -#define __NR_ugetrlimit 191
176 -#define __NR_mmap2 192
177 -#define __NR_truncate64 193
178 -#define __NR_ftruncate64 194
179 -#define __NR_stat64 195
180 -#define __NR_lstat64 196
181 -#define __NR_fstat64 197
182 -#define __NR_lchown32 198
183 -#define __NR_getuid32 199
184 -#define __NR_getgid32 200
185 -#define __NR_geteuid32 201
186 -#define __NR_getegid32 202
187 -#define __NR_setreuid32 203
188 -#define __NR_setregid32 204
189 -#define __NR_getgroups32 205
190 -#define __NR_setgroups32 206
191 -#define __NR_fchown32 207
192 -#define __NR_setresuid32 208
193 -#define __NR_getresuid32 209
194 -#define __NR_setresgid32 210
195 -#define __NR_getresgid32 211
196 -#define __NR_chown32 212
197 -#define __NR_setuid32 213
198 -#define __NR_setgid32 214
199 -#define __NR_setfsuid32 215
200 -#define __NR_setfsgid32 216
201 -#define __NR_pivot_root 217
202 -#define __NR_mincore 218
203 -#define __NR_madvise 219
204 -#define __NR_getdents64 220
205 -#define __NR_fcntl64 221
206 -#define __NR_readahead 222
207 -#define __NR_sendfile64 223
208 -#define __NR_setxattr 224
209 -#define __NR_lsetxattr 225
210 -#define __NR_fsetxattr 226
211 -#define __NR_getxattr 227
212 -#define __NR_lgetxattr 228
213 -#define __NR_fgetxattr 229
214 -#define __NR_listxattr 230
215 -#define __NR_llistxattr 231
216 -#define __NR_flistxattr 232
217 -#define __NR_removexattr 233
218 -#define __NR_lremovexattr 234
219 -#define __NR_fremovexattr 235
220 -#define __NR_gettid 236
221 -#define __NR_tkill 237
222 -#define __NR_futex 238
223 -#define __NR_sched_setaffinity 239
224 -#define __NR_sched_getaffinity 240
225 -#define __NR_tgkill 241
226 -#define __NR_io_setup 243
227 -#define __NR_io_destroy 244
228 -#define __NR_io_getevents 245
229 -#define __NR_io_submit 246
230 -#define __NR_io_cancel 247
231 -#define __NR_exit_group 248
232 -#define __NR_epoll_create 249
233 -#define __NR_epoll_ctl 250
234 -#define __NR_epoll_wait 251
235 -#define __NR_set_tid_address 252
236 -#define __NR_fadvise64 253
237 -#define __NR_timer_create 254
238 -#define __NR_timer_settime 255
239 -#define __NR_timer_gettime 256
240 -#define __NR_timer_getoverrun 257
241 -#define __NR_timer_delete 258
242 -#define __NR_clock_settime 259
243 -#define __NR_clock_gettime 260
244 -#define __NR_clock_getres 261
245 -#define __NR_clock_nanosleep 262
246 -#define __NR_fadvise64_64 264
247 -#define __NR_statfs64 265
248 -#define __NR_fstatfs64 266
249 -#define __NR_remap_file_pages 267
250 -#define __NR_mbind 268
251 -#define __NR_get_mempolicy 269
252 -#define __NR_set_mempolicy 270
253 -#define __NR_mq_open 271
254 -#define __NR_mq_unlink 272
255 -#define __NR_mq_timedsend 273
256 -#define __NR_mq_timedreceive 274
257 -#define __NR_mq_notify 275
258 -#define __NR_mq_getsetattr 276
259 -#define __NR_kexec_load 277
260 -#define __NR_add_key 278
261 -#define __NR_request_key 279
262 -#define __NR_keyctl 280
263 -#define __NR_waitid 281
264 -#define __NR_ioprio_set 282
265 -#define __NR_ioprio_get 283
266 -#define __NR_inotify_init 284
267 -#define __NR_inotify_add_watch 285
268 -#define __NR_inotify_rm_watch 286
269 -#define __NR_migrate_pages 287
270 -#define __NR_openat 288
271 -#define __NR_mkdirat 289
272 -#define __NR_mknodat 290
273 -#define __NR_fchownat 291
274 -#define __NR_futimesat 292
275 -#define __NR_fstatat64 293
276 -#define __NR_unlinkat 294
277 -#define __NR_renameat 295
278 -#define __NR_linkat 296
279 -#define __NR_symlinkat 297
280 -#define __NR_readlinkat 298
281 -#define __NR_fchmodat 299
282 -#define __NR_faccessat 300
283 -#define __NR_pselect6 301
284 -#define __NR_ppoll 302
285 -#define __NR_unshare 303
286 -#define __NR_set_robust_list 304
287 -#define __NR_get_robust_list 305
288 -#define __NR_splice 306
289 -#define __NR_sync_file_range 307
290 -#define __NR_tee 308
291 -#define __NR_vmsplice 309
292 -#define __NR_move_pages 310
293 -#define __NR_getcpu 311
294 -#define __NR_epoll_pwait 312
295 -#define __NR_utimes 313
296 -#define __NR_fallocate 314
297 -#define __NR_utimensat 315
298 -#define __NR_signalfd 316
299 -#define __NR_timerfd 317
300 -#define __NR_eventfd 318
301 -#define __NR_timerfd_create 319
302 -#define __NR_timerfd_settime 320
303 -#define __NR_timerfd_gettime 321
304 -#define __NR_signalfd4 322
305 -#define __NR_eventfd2 323
306 -#define __NR_inotify_init1 324
307 -#define __NR_pipe2 325
308 -#define __NR_dup3 326
309 -#define __NR_epoll_create1 327
310 -#define __NR_preadv 328
311 -#define __NR_pwritev 329
312 -#define __NR_rt_tgsigqueueinfo 330
313 -#define __NR_perf_event_open 331
314 -#define __NR_fanotify_init 332
315 -#define __NR_fanotify_mark 333
316 -#define __NR_prlimit64 334
317 -#define __NR_name_to_handle_at 335
318 -#define __NR_open_by_handle_at 336
319 -#define __NR_clock_adjtime 337
320 -#define __NR_syncfs 338
321 -#define __NR_setns 339
322 -#define __NR_process_vm_readv 340
323 -#define __NR_process_vm_writev 341
324 -#define __NR_s390_runtime_instr 342
325 -#define __NR_kcmp 343
326 -#define __NR_finit_module 344
327 -#define __NR_sched_setattr 345
328 -#define __NR_sched_getattr 346
329 -#define __NR_renameat2 347
330 -#define __NR_seccomp 348
331 -#define __NR_getrandom 349
332 -#define __NR_memfd_create 350
333 -#define __NR_bpf 351
334 -#define __NR_s390_pci_mmio_write 352
335 -#define __NR_s390_pci_mmio_read 353
336 -#define __NR_execveat 354
337 -#define __NR_userfaultfd 355
338 -#define __NR_membarrier 356
339 -#define __NR_recvmmsg 357
340 -#define __NR_sendmmsg 358
341 -#define __NR_socket 359
342 -#define __NR_socketpair 360
343 -#define __NR_bind 361
344 -#define __NR_connect 362
345 -#define __NR_listen 363
346 -#define __NR_accept4 364
347 -#define __NR_getsockopt 365
348 -#define __NR_setsockopt 366
349 -#define __NR_getsockname 367
350 -#define __NR_getpeername 368
351 -#define __NR_sendto 369
352 -#define __NR_sendmsg 370
353 -#define __NR_recvfrom 371
354 -#define __NR_recvmsg 372
355 -#define __NR_shutdown 373
356 -#define __NR_mlock2 374
357 -#define __NR_copy_file_range 375
358 -#define __NR_preadv2 376
359 -#define __NR_pwritev2 377
360 -#define __NR_s390_guarded_storage 378
361 -#define __NR_statx 379
362 -#define __NR_s390_sthyi 380
363 -#define __NR_kexec_file_load 381
364 -#define __NR_io_pgetevents 382
365 -#define __NR_rseq 383
366 -#define __NR_pkey_mprotect 384
367 -#define __NR_pkey_alloc 385
368 -#define __NR_pkey_free 386
369 -#define __NR_semget 393
370 -#define __NR_semctl 394
371 -#define __NR_shmget 395
372 -#define __NR_shmctl 396
373 -#define __NR_shmat 397
374 -#define __NR_shmdt 398
375 -#define __NR_msgget 399
376 -#define __NR_msgsnd 400
377 -#define __NR_msgrcv 401
378 -#define __NR_msgctl 402
379 -#define __NR_clock_gettime64 403
380 -#define __NR_clock_settime64 404
381 -#define __NR_clock_adjtime64 405
382 -#define __NR_clock_getres_time64 406
383 -#define __NR_clock_nanosleep_time64 407
384 -#define __NR_timer_gettime64 408
385 -#define __NR_timer_settime64 409
386 -#define __NR_timerfd_gettime64 410
387 -#define __NR_timerfd_settime64 411
388 -#define __NR_utimensat_time64 412
389 -#define __NR_pselect6_time64 413
390 -#define __NR_ppoll_time64 414
391 -#define __NR_io_pgetevents_time64 416
392 -#define __NR_recvmmsg_time64 417
393 -#define __NR_mq_timedsend_time64 418
394 -#define __NR_mq_timedreceive_time64 419
395 -#define __NR_semtimedop_time64 420
396 -#define __NR_rt_sigtimedwait_time64 421
397 -#define __NR_futex_time64 422
398 -#define __NR_sched_rr_get_interval_time64 423
399 -#define __NR_pidfd_send_signal 424
400 -#define __NR_io_uring_setup 425
401 -#define __NR_io_uring_enter 426
402 -#define __NR_io_uring_register 427
403 -#define __NR_open_tree 428
404 -#define __NR_move_mount 429
405 -#define __NR_fsopen 430
406 -#define __NR_fsconfig 431
407 -#define __NR_fsmount 432
408 -#define __NR_fspick 433
409 -#define __NR_pidfd_open 434
410 -#define __NR_clone3 435
411 -#define __NR_close_range 436
412 -#define __NR_openat2 437
413 -#define __NR_pidfd_getfd 438
414 -#define __NR_faccessat2 439
415 -#define __NR_process_madvise 440
416 -#define __NR_epoll_pwait2 441
417 -#define __NR_mount_setattr 442
418 -#define __NR_quotactl_fd 443
419 -#define __NR_landlock_create_ruleset 444
420 -#define __NR_landlock_add_rule 445
421 -#define __NR_landlock_restrict_self 446
422 -#define __NR_memfd_secret 447
423 -#define __NR_process_mrelease 448
424 -#define __NR_futex_waitv 449
425 -#define __NR_set_mempolicy_home_node 450
426 -#define __NR_cachestat 451
427 -#define __NR_fchmodat2 452
428 -#define __NR_map_shadow_stack 453
429 -#define __NR_futex_wake 454
430 -#define __NR_futex_wait 455
431 -#define __NR_futex_requeue 456
432 -#define __NR_statmount 457
433 -#define __NR_listmount 458
434 -#define __NR_lsm_get_self_attr 459
435 -#define __NR_lsm_set_self_attr 460
436 -#define __NR_lsm_list_modules 461
437 -#define __NR_mseal 462
438 -#define __NR_setxattrat 463
439 -#define __NR_getxattrat 464
440 -#define __NR_listxattrat 465
441 -#define __NR_removexattrat 466
442 -#define __NR_open_tree_attr 467
443 -#define __NR_file_getattr 468
444 -#define __NR_file_setattr 469
445 -
446 -#endif /* _ASM_S390_UNISTD_32_H */
linux-headers/asm-s390/unistd_64.h
+1
@@ -390,6 +390,7 @@
390 #define __NR_file_getattr 468
391 #define __NR_file_setattr 469
392 #define __NR_listns 470
393 +#define __NR_rseq_slice_yield 471
394
395
396 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-x86/kvm.h
+13 -8
@@ -197,13 +197,13 @@ struct kvm_msrs {
197 __u32 nmsrs; /* number of msrs in entries */
198 __u32 pad;
199
200 - struct kvm_msr_entry entries[];
200 + __DECLARE_FLEX_ARRAY(struct kvm_msr_entry, entries);
201 };
202
203 /* for KVM_GET_MSR_INDEX_LIST */
204 struct kvm_msr_list {
205 __u32 nmsrs; /* number of msrs in entries */
206 - __u32 indices[];
206 + __DECLARE_FLEX_ARRAY(__u32, indices);
207 };
208
209 /* Maximum size of any access bitmap in bytes */
@@ -243,7 +243,7 @@ struct kvm_cpuid_entry {
243 struct kvm_cpuid {
244 __u32 nent;
245 __u32 padding;
246 - struct kvm_cpuid_entry entries[];
246 + __DECLARE_FLEX_ARRAY(struct kvm_cpuid_entry, entries);
247 };
248
249 struct kvm_cpuid_entry2 {
@@ -265,7 +265,7 @@ struct kvm_cpuid_entry2 {
265 struct kvm_cpuid2 {
266 __u32 nent;
267 __u32 padding;
268 - struct kvm_cpuid_entry2 entries[];
268 + __DECLARE_FLEX_ARRAY(struct kvm_cpuid_entry2, entries);
269 };
270
271 /* for KVM_GET_PIT and KVM_SET_PIT */
@@ -396,7 +396,7 @@ struct kvm_xsave {
396 * the contents of CPUID leaf 0xD on the host.
397 */
398 __u32 region[1024];
399 - __u32 extra[];
399 + __DECLARE_FLEX_ARRAY(__u32, extra);
400 };
401
402 #define KVM_MAX_XCRS 16
@@ -474,6 +474,7 @@ struct kvm_sync_regs {
474 #define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7)
475 #define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8)
476 #define KVM_X86_QUIRK_IGNORE_GUEST_PAT (1 << 9)
477 +#define KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM (1 << 10)
478
479 #define KVM_STATE_NESTED_FORMAT_VMX 0
480 #define KVM_STATE_NESTED_FORMAT_SVM 1
@@ -501,6 +502,7 @@ struct kvm_sync_regs {
502 #define KVM_X86_GRP_SEV 1
503 # define KVM_X86_SEV_VMSA_FEATURES 0
504 # define KVM_X86_SNP_POLICY_BITS 1
505 +# define KVM_X86_SEV_SNP_REQ_CERTS 2
506
507 struct kvm_vmx_nested_state_data {
508 __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
@@ -562,7 +564,7 @@ struct kvm_pmu_event_filter {
564 __u32 fixed_counter_bitmap;
565 __u32 flags;
566 __u32 pad[4];
565 - __u64 events[];
567 + __DECLARE_FLEX_ARRAY(__u64, events);
568 };
569
570 #define KVM_PMU_EVENT_ALLOW 0
@@ -741,6 +743,7 @@ enum sev_cmd_id {
743 KVM_SEV_SNP_LAUNCH_START = 100,
744 KVM_SEV_SNP_LAUNCH_UPDATE,
745 KVM_SEV_SNP_LAUNCH_FINISH,
746 + KVM_SEV_SNP_ENABLE_REQ_CERTS,
747
748 KVM_SEV_NR_MAX,
749 };
@@ -912,8 +915,10 @@ struct kvm_sev_snp_launch_finish {
915 __u64 pad1[4];
916 };
917
915 -#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
916 -#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
918 +#define KVM_X2APIC_API_USE_32BIT_IDS _BITULL(0)
919 +#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK _BITULL(1)
920 +#define KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST _BITULL(2)
921 +#define KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST _BITULL(3)
922
923 struct kvm_hyperv_eventfd {
924 __u32 conn_id;
linux-headers/asm-x86/unistd_32.h
+1
@@ -461,6 +461,7 @@
461 #define __NR_file_getattr 468
462 #define __NR_file_setattr 469
463 #define __NR_listns 470
464 +#define __NR_rseq_slice_yield 471
465
466
467 #endif /* _ASM_UNISTD_32_H */
linux-headers/asm-x86/unistd_64.h
+1
@@ -385,6 +385,7 @@
385 #define __NR_file_getattr 468
386 #define __NR_file_setattr 469
387 #define __NR_listns 470
388 +#define __NR_rseq_slice_yield 471
389
390
391 #endif /* _ASM_UNISTD_64_H */
linux-headers/asm-x86/unistd_x32.h
+1
@@ -338,6 +338,7 @@
338 #define __NR_file_getattr (__X32_SYSCALL_BIT + 468)
339 #define __NR_file_setattr (__X32_SYSCALL_BIT + 469)
340 #define __NR_listns (__X32_SYSCALL_BIT + 470)
341 +#define __NR_rseq_slice_yield (__X32_SYSCALL_BIT + 471)
342 #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512)
343 #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513)
344 #define __NR_ioctl (__X32_SYSCALL_BIT + 514)
linux-headers/linux/const.h
+18
@@ -50,4 +50,22 @@
50
51 #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
52
53 +/*
54 + * Divide positive or negative dividend by positive or negative divisor
55 + * and round to closest integer. Result is undefined for negative
56 + * divisors if the dividend variable type is unsigned and for negative
57 + * dividends if the divisor variable type is unsigned.
58 + */
59 +#define __KERNEL_DIV_ROUND_CLOSEST(x, divisor) \
60 +({ \
61 + __typeof__(x) __x = x; \
62 + __typeof__(divisor) __d = divisor; \
63 + \
64 + (((__typeof__(x))-1) > 0 || \
65 + ((__typeof__(divisor))-1) > 0 || \
66 + (((__x) > 0) == ((__d) > 0))) ? \
67 + (((__x) + ((__d) / 2)) / (__d)) : \
68 + (((__x) - ((__d) / 2)) / (__d)); \
69 +})
70 +
71 #endif /* _LINUX_CONST_H */
linux-headers/linux/iommufd.h
+48
@@ -465,16 +465,27 @@ struct iommu_hwpt_arm_smmuv3 {
465 __aligned_le64 ste[2];
466 };
467
468 +/**
469 + * struct iommu_hwpt_amd_guest - AMD IOMMU guest I/O page table data
470 + * (IOMMU_HWPT_DATA_AMD_GUEST)
471 + * @dte: Guest Device Table Entry (DTE)
472 + */
473 +struct iommu_hwpt_amd_guest {
474 + __aligned_u64 dte[4];
475 +};
476 +
477 /**
478 * enum iommu_hwpt_data_type - IOMMU HWPT Data Type
479 * @IOMMU_HWPT_DATA_NONE: no data
480 * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table
481 * @IOMMU_HWPT_DATA_ARM_SMMUV3: ARM SMMUv3 Context Descriptor Table
482 + * @IOMMU_HWPT_DATA_AMD_GUEST: AMD IOMMU guest page table
483 */
484 enum iommu_hwpt_data_type {
485 IOMMU_HWPT_DATA_NONE = 0,
486 IOMMU_HWPT_DATA_VTD_S1 = 1,
487 IOMMU_HWPT_DATA_ARM_SMMUV3 = 2,
488 + IOMMU_HWPT_DATA_AMD_GUEST = 3,
489 };
490
491 /**
@@ -623,6 +634,32 @@ struct iommu_hw_info_tegra241_cmdqv {
634 __u8 __reserved;
635 };
636
637 +/**
638 + * struct iommu_hw_info_amd - AMD IOMMU device info
639 + *
640 + * @efr : Value of AMD IOMMU Extended Feature Register (EFR)
641 + * @efr2: Value of AMD IOMMU Extended Feature 2 Register (EFR2)
642 + *
643 + * Please See description of these registers in the following sections of
644 + * the AMD I/O Virtualization Technology (IOMMU) Specification.
645 + * (https://docs.amd.com/v/u/en-US/48882_3.10_PUB)
646 + *
647 + * - MMIO Offset 0030h IOMMU Extended Feature Register
648 + * - MMIO Offset 01A0h IOMMU Extended Feature 2 Register
649 + *
650 + * Note: The EFR and EFR2 are raw values reported by hardware.
651 + * VMM is responsible to determine the appropriate flags to be exposed to
652 + * the VM since cetertain features are not currently supported by the kernel
653 + * for HW-vIOMMU.
654 + *
655 + * Current VMM-allowed list of feature flags are:
656 + * - EFR[GTSup, GASup, GioSup, PPRSup, EPHSup, GATS, GLX, PASmax]
657 + */
658 +struct iommu_hw_info_amd {
659 + __aligned_u64 efr;
660 + __aligned_u64 efr2;
661 +};
662 +
663 /**
664 * enum iommu_hw_info_type - IOMMU Hardware Info Types
665 * @IOMMU_HW_INFO_TYPE_NONE: Output by the drivers that do not report hardware
@@ -632,6 +669,7 @@ struct iommu_hw_info_tegra241_cmdqv {
669 * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type
670 * @IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV: NVIDIA Tegra241 CMDQV (extension for ARM
671 * SMMUv3) info type
672 + * @IOMMU_HW_INFO_TYPE_AMD: AMD IOMMU info type
673 */
674 enum iommu_hw_info_type {
675 IOMMU_HW_INFO_TYPE_NONE = 0,
@@ -639,6 +677,7 @@ enum iommu_hw_info_type {
677 IOMMU_HW_INFO_TYPE_INTEL_VTD = 1,
678 IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2,
679 IOMMU_HW_INFO_TYPE_TEGRA241_CMDQV = 3,
680 + IOMMU_HW_INFO_TYPE_AMD = 4,
681 };
682
683 /**
@@ -656,11 +695,15 @@ enum iommu_hw_info_type {
695 * @IOMMU_HW_CAP_PCI_PASID_PRIV: Privileged Mode Supported, user ignores it
696 * when the struct
697 * iommu_hw_info::out_max_pasid_log2 is zero.
698 + * @IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED: ATS is not supported or cannot be used
699 + * on this device (absence implies ATS
700 + * may be enabled)
701 */
702 enum iommufd_hw_capabilities {
703 IOMMU_HW_CAP_DIRTY_TRACKING = 1 << 0,
704 IOMMU_HW_CAP_PCI_PASID_EXEC = 1 << 1,
705 IOMMU_HW_CAP_PCI_PASID_PRIV = 1 << 2,
706 + IOMMU_HW_CAP_PCI_ATS_NOT_SUPPORTED = 1 << 3,
707 };
708
709 /**
@@ -1013,6 +1056,11 @@ struct iommu_fault_alloc {
1056 enum iommu_viommu_type {
1057 IOMMU_VIOMMU_TYPE_DEFAULT = 0,
1058 IOMMU_VIOMMU_TYPE_ARM_SMMUV3 = 1,
1059 + /*
1060 + * TEGRA241_CMDQV requirements (otherwise, VCMDQs will not work)
1061 + * - Kernel will allocate a VINTF (HYP_OWN=0) to back this VIOMMU. So,
1062 + * VMM must wire the HYP_OWN bit to 0 in guest VINTF_CONFIG register
1063 + */
1064 IOMMU_VIOMMU_TYPE_TEGRA241_CMDQV = 2,
1065 };
1066
linux-headers/linux/kvm.h
+40 -6
@@ -11,9 +11,11 @@
11 #include <linux/const.h>
12 #include <linux/types.h>
13
14 +#include <linux/stddef.h>
15 #include <linux/ioctl.h>
16 #include <asm/kvm.h>
17
18 +
19 #define KVM_API_VERSION 12
20
21 /*
@@ -135,6 +137,12 @@ struct kvm_xen_exit {
137 } u;
138 };
139
140 +struct kvm_exit_snp_req_certs {
141 + __u64 gpa;
142 + __u64 npages;
143 + __u64 ret;
144 +};
145 +
146 #define KVM_S390_GET_SKEYS_NONE 1
147 #define KVM_S390_SKEYS_MAX 1048576
148
@@ -180,6 +188,8 @@ struct kvm_xen_exit {
188 #define KVM_EXIT_MEMORY_FAULT 39
189 #define KVM_EXIT_TDX 40
190 #define KVM_EXIT_ARM_SEA 41
191 +#define KVM_EXIT_ARM_LDST64B 42
192 +#define KVM_EXIT_SNP_REQ_CERTS 43
193
194 /* For KVM_EXIT_INTERNAL_ERROR */
195 /* Emulate instruction failed. */
@@ -394,7 +404,7 @@ struct kvm_run {
404 } eoi;
405 /* KVM_EXIT_HYPERV */
406 struct kvm_hyperv_exit hyperv;
397 - /* KVM_EXIT_ARM_NISV */
407 + /* KVM_EXIT_ARM_NISV / KVM_EXIT_ARM_LDST64B */
408 struct {
409 __u64 esr_iss;
410 __u64 fault_ipa;
@@ -474,6 +484,8 @@ struct kvm_run {
484 __u64 gva;
485 __u64 gpa;
486 } arm_sea;
487 + /* KVM_EXIT_SNP_REQ_CERTS */
488 + struct kvm_exit_snp_req_certs snp_req_certs;
489 /* Fix the size of the union. */
490 char padding[256];
491 };
@@ -520,7 +532,7 @@ struct kvm_coalesced_mmio {
532
533 struct kvm_coalesced_mmio_ring {
534 __u32 first, last;
523 - struct kvm_coalesced_mmio coalesced_mmio[];
535 + __DECLARE_FLEX_ARRAY(struct kvm_coalesced_mmio, coalesced_mmio);
536 };
537
538 #define KVM_COALESCED_MMIO_MAX \
@@ -570,7 +582,7 @@ struct kvm_clear_dirty_log {
582 /* for KVM_SET_SIGNAL_MASK */
583 struct kvm_signal_mask {
584 __u32 len;
573 - __u8 sigset[];
585 + __DECLARE_FLEX_ARRAY(__u8, sigset);
586 };
587
588 /* for KVM_TPR_ACCESS_REPORTING */
@@ -681,6 +693,11 @@ struct kvm_enable_cap {
693 #define KVM_VM_TYPE_ARM_IPA_SIZE_MASK 0xffULL
694 #define KVM_VM_TYPE_ARM_IPA_SIZE(x) \
695 ((x) & KVM_VM_TYPE_ARM_IPA_SIZE_MASK)
696 +
697 +#define KVM_VM_TYPE_ARM_PROTECTED (1UL << 31)
698 +#define KVM_VM_TYPE_ARM_MASK (KVM_VM_TYPE_ARM_IPA_SIZE_MASK | \
699 + KVM_VM_TYPE_ARM_PROTECTED)
700 +
701 /*
702 * ioctls for /dev/kvm fds:
703 */
@@ -966,6 +983,8 @@ struct kvm_enable_cap {
983 #define KVM_CAP_GUEST_MEMFD_FLAGS 244
984 #define KVM_CAP_ARM_SEA_TO_USER 245
985 #define KVM_CAP_S390_USER_OPEREXEC 246
986 +#define KVM_CAP_S390_KEYOP 247
987 +#define KVM_CAP_S390_VSIE_ESAMODE 248
988
989 struct kvm_irq_routing_irqchip {
990 __u32 irqchip;
@@ -1028,7 +1047,7 @@ struct kvm_irq_routing_entry {
1047 struct kvm_irq_routing {
1048 __u32 nr;
1049 __u32 flags;
1031 - struct kvm_irq_routing_entry entries[];
1050 + __DECLARE_FLEX_ARRAY(struct kvm_irq_routing_entry, entries);
1051 };
1052
1053 #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0)
@@ -1119,7 +1138,7 @@ struct kvm_dirty_tlb {
1138
1139 struct kvm_reg_list {
1140 __u64 n; /* number of regs */
1122 - __u64 reg[];
1141 + __DECLARE_FLEX_ARRAY(__u64, reg);
1142 };
1143
1144 struct kvm_one_reg {
@@ -1201,6 +1220,10 @@ enum kvm_device_type {
1220 #define KVM_DEV_TYPE_LOONGARCH_EIOINTC KVM_DEV_TYPE_LOONGARCH_EIOINTC
1221 KVM_DEV_TYPE_LOONGARCH_PCHPIC,
1222 #define KVM_DEV_TYPE_LOONGARCH_PCHPIC KVM_DEV_TYPE_LOONGARCH_PCHPIC
1223 + KVM_DEV_TYPE_LOONGARCH_DMSINTC,
1224 +#define KVM_DEV_TYPE_LOONGARCH_DMSINTC KVM_DEV_TYPE_LOONGARCH_DMSINTC
1225 + KVM_DEV_TYPE_ARM_VGIC_V5,
1226 +#define KVM_DEV_TYPE_ARM_VGIC_V5 KVM_DEV_TYPE_ARM_VGIC_V5
1227
1228 KVM_DEV_TYPE_MAX,
1229
@@ -1211,6 +1234,16 @@ struct kvm_vfio_spapr_tce {
1234 __s32 tablefd;
1235 };
1236
1237 +#define KVM_S390_KEYOP_ISKE 0x01
1238 +#define KVM_S390_KEYOP_RRBE 0x02
1239 +#define KVM_S390_KEYOP_SSKE 0x03
1240 +struct kvm_s390_keyop {
1241 + __u64 guest_addr;
1242 + __u8 key;
1243 + __u8 operation;
1244 + __u8 pad[6];
1245 +};
1246 +
1247 /*
1248 * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
1249 * a vcpu fd.
@@ -1230,6 +1263,7 @@ struct kvm_vfio_spapr_tce {
1263 #define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
1264 #define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
1265 #define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
1266 +#define KVM_S390_KEYOP _IOWR(KVMIO, 0x53, struct kvm_s390_keyop)
1267
1268 /* Device model IOC */
1269 #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)
@@ -1571,7 +1605,7 @@ struct kvm_stats_desc {
1605 __u16 size;
1606 __u32 offset;
1607 __u32 bucket_size;
1574 - char name[];
1608 + __DECLARE_FLEX_ARRAY(char, name);
1609 };
1610
1611 #define KVM_GET_STATS_FD _IO(KVMIO, 0xce)
linux-headers/linux/mshv.h
+3 -1
@@ -27,6 +27,8 @@ enum {
27 MSHV_PT_BIT_X2APIC,
28 MSHV_PT_BIT_GPA_SUPER_PAGES,
29 MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
30 + MSHV_PT_BIT_NESTED_VIRTUALIZATION,
31 + MSHV_PT_BIT_SMT_ENABLED_GUEST,
32 MSHV_PT_BIT_COUNT,
33 };
34
@@ -355,7 +357,7 @@ struct mshv_vtl_sint_post_msg {
357
358 struct mshv_vtl_ram_disposition {
359 __u64 start_pfn;
358 - __u64 last_pfn;
360 + __u64 last_pfn; /* last_pfn is excluded from the range [start_pfn, last_pfn) */
361 };
362
363 struct mshv_vtl_set_poll_file {
linux-headers/linux/psp-sev.h
+1 -1
@@ -277,7 +277,7 @@ struct sev_user_data_snp_wrapped_vlek_hashstick {
277 * struct sev_issue_cmd - SEV ioctl parameters
278 *
279 * @cmd: SEV commands to execute
280 - * @opaque: pointer to the command structure
280 + * @data: pointer to the command structure
281 * @error: SEV FW return code on failure
282 */
283 struct sev_issue_cmd {
linux-headers/linux/stddef.h
+4
@@ -69,6 +69,10 @@
69 #define __counted_by_be(m)
70 #endif
71
72 +#ifndef __counted_by_ptr
73 +#define __counted_by_ptr(m)
74 +#endif
75 +
76 #define __kernel_nonstring
77
78 #endif /* _LINUX_STDDEF_H */
linux-headers/linux/vduse.h
+80 -5
@@ -10,6 +10,10 @@
10
11 #define VDUSE_API_VERSION 0
12
13 +/* VQ groups and ASID support */
14 +
15 +#define VDUSE_API_VERSION_1 1
16 +
17 /*
18 * Get the version of VDUSE API that kernel supported (VDUSE_API_VERSION).
19 * This is used for future extension.
@@ -27,6 +31,8 @@
31 * @features: virtio features
32 * @vq_num: the number of virtqueues
33 * @vq_align: the allocation alignment of virtqueue's metadata
34 + * @ngroups: number of vq groups that VDUSE device declares
35 + * @nas: number of address spaces that VDUSE device declares
36 * @reserved: for future use, needs to be initialized to zero
37 * @config_size: the size of the configuration space
38 * @config: the buffer of the configuration space
@@ -41,7 +47,9 @@ struct vduse_dev_config {
47 __u64 features;
48 __u32 vq_num;
49 __u32 vq_align;
44 - __u32 reserved[13];
50 + __u32 ngroups; /* if VDUSE_API_VERSION >= 1 */
51 + __u32 nas; /* if VDUSE_API_VERSION >= 1 */
52 + __u32 reserved[11];
53 __u32 config_size;
54 __u8 config[];
55 };
@@ -118,14 +126,18 @@ struct vduse_config_data {
126 * struct vduse_vq_config - basic configuration of a virtqueue
127 * @index: virtqueue index
128 * @max_size: the max size of virtqueue
121 - * @reserved: for future use, needs to be initialized to zero
129 + * @reserved1: for future use, needs to be initialized to zero
130 + * @group: virtqueue group
131 + * @reserved2: for future use, needs to be initialized to zero
132 *
133 * Structure used by VDUSE_VQ_SETUP ioctl to setup a virtqueue.
134 */
135 struct vduse_vq_config {
136 __u32 index;
137 __u16 max_size;
128 - __u16 reserved[13];
138 + __u16 reserved1;
139 + __u32 group;
140 + __u16 reserved2[10];
141 };
142
143 /*
@@ -156,6 +168,16 @@ struct vduse_vq_state_packed {
168 __u16 last_used_idx;
169 };
170
171 +/**
172 + * struct vduse_vq_group_asid - virtqueue group ASID
173 + * @group: Index of the virtqueue group
174 + * @asid: Address space ID of the group
175 + */
176 +struct vduse_vq_group_asid {
177 + __u32 group;
178 + __u32 asid;
179 +};
180 +
181 /**
182 * struct vduse_vq_info - information of a virtqueue
183 * @index: virtqueue index
@@ -215,6 +237,7 @@ struct vduse_vq_eventfd {
237 * @uaddr: start address of userspace memory, it must be aligned to page size
238 * @iova: start of the IOVA region
239 * @size: size of the IOVA region
240 + * @asid: Address space ID of the IOVA region
241 * @reserved: for future use, needs to be initialized to zero
242 *
243 * Structure used by VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM
@@ -224,7 +247,8 @@ struct vduse_iova_umem {
247 __u64 uaddr;
248 __u64 iova;
249 __u64 size;
227 - __u64 reserved[3];
250 + __u32 asid;
251 + __u32 reserved[5];
252 };
253
254 /* Register userspace memory for IOVA regions */
@@ -238,6 +262,7 @@ struct vduse_iova_umem {
262 * @start: start of the IOVA region
263 * @last: last of the IOVA region
264 * @capability: capability of the IOVA region
265 + * @asid: Address space ID of the IOVA region, only if device API version >= 1
266 * @reserved: for future use, needs to be initialized to zero
267 *
268 * Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of
@@ -248,7 +273,8 @@ struct vduse_iova_info {
273 __u64 last;
274 #define VDUSE_IOVA_CAP_UMEM (1 << 0)
275 __u64 capability;
251 - __u64 reserved[3];
276 + __u32 asid; /* Only if device API version >= 1 */
277 + __u32 reserved[5];
278 };
279
280 /*
@@ -257,6 +283,32 @@ struct vduse_iova_info {
283 */
284 #define VDUSE_IOTLB_GET_INFO _IOWR(VDUSE_BASE, 0x1a, struct vduse_iova_info)
285
286 +/**
287 + * struct vduse_iotlb_entry_v2 - entry of IOTLB to describe one IOVA region
288 + *
289 + * @v1: the original vduse_iotlb_entry
290 + * @asid: address space ID of the IOVA region
291 + * @reserved: for future use, needs to be initialized to zero
292 + *
293 + * Structure used by VDUSE_IOTLB_GET_FD2 ioctl to find an overlapped IOVA region.
294 + */
295 +struct vduse_iotlb_entry_v2 {
296 + __u64 offset;
297 + __u64 start;
298 + __u64 last;
299 + __u8 perm;
300 + __u8 padding[7];
301 + __u32 asid;
302 + __u32 reserved[11];
303 +};
304 +
305 +/*
306 + * Same as VDUSE_IOTLB_GET_FD but with vduse_iotlb_entry_v2 argument that
307 + * support extra fields.
308 + */
309 +#define VDUSE_IOTLB_GET_FD2 _IOWR(VDUSE_BASE, 0x1b, struct vduse_iotlb_entry_v2)
310 +
311 +
312 /* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
313
314 /**
@@ -265,11 +317,14 @@ struct vduse_iova_info {
317 * @VDUSE_SET_STATUS: set the device status
318 * @VDUSE_UPDATE_IOTLB: Notify userspace to update the memory mapping for
319 * specified IOVA range via VDUSE_IOTLB_GET_FD ioctl
320 + * @VDUSE_SET_VQ_GROUP_ASID: Notify userspace to update the address space of a
321 + * virtqueue group.
322 */
323 enum vduse_req_type {
324 VDUSE_GET_VQ_STATE,
325 VDUSE_SET_STATUS,
326 VDUSE_UPDATE_IOTLB,
327 + VDUSE_SET_VQ_GROUP_ASID,
328 };
329
330 /**
@@ -304,6 +359,19 @@ struct vduse_iova_range {
359 __u64 last;
360 };
361
362 +/**
363 + * struct vduse_iova_range_v2 - IOVA range [start, last] if API_VERSION >= 1
364 + * @start: start of the IOVA range
365 + * @last: last of the IOVA range
366 + * @asid: address space ID of the IOVA range
367 + */
368 +struct vduse_iova_range_v2 {
369 + __u64 start;
370 + __u64 last;
371 + __u32 asid;
372 + __u32 padding;
373 +};
374 +
375 /**
376 * struct vduse_dev_request - control request
377 * @type: request type
@@ -312,6 +380,8 @@ struct vduse_iova_range {
380 * @vq_state: virtqueue state, only index field is available
381 * @s: device status
382 * @iova: IOVA range for updating
383 + * @iova_v2: IOVA range for updating if API_VERSION >= 1
384 + * @vq_group_asid: ASID of a virtqueue group
385 * @padding: padding
386 *
387 * Structure used by read(2) on /dev/vduse/$NAME.
@@ -324,6 +394,11 @@ struct vduse_dev_request {
394 struct vduse_vq_state vq_state;
395 struct vduse_dev_status s;
396 struct vduse_iova_range iova;
397 + /* Following members but padding exist only if vduse api
398 + * version >= 1
399 + */
400 + struct vduse_iova_range_v2 iova_v2;
401 + struct vduse_vq_group_asid vq_group_asid;
402 __u32 padding[32];
403 };
404 };
linux-headers/linux/vfio.h
+29 -1
@@ -141,7 +141,7 @@ struct vfio_info_cap_header {
141 *
142 * Retrieve information about the group. Fills in provided
143 * struct vfio_group_info. Caller sets argsz.
144 - * Return: 0 on succes, -errno on failure.
144 + * Return: 0 on success, -errno on failure.
145 * Availability: Always
146 */
147 struct vfio_group_status {
@@ -964,6 +964,10 @@ struct vfio_device_bind_iommufd {
964 * hwpt corresponding to the given pt_id.
965 *
966 * Return: 0 on success, -errno on failure.
967 + *
968 + * When a device is resetting, -EBUSY will be returned to reject any concurrent
969 + * attachment to the resetting device itself or any sibling device in the IOMMU
970 + * group having the resetting device.
971 */
972 struct vfio_device_attach_iommufd_pt {
973 __u32 argsz;
@@ -1262,6 +1266,19 @@ enum vfio_device_mig_state {
1266 * The initial_bytes field indicates the amount of initial precopy
1267 * data available from the device. This field should have a non-zero initial
1268 * value and decrease as migration data is read from the device.
1269 + * The presence of the VFIO_PRECOPY_INFO_REINIT output flag indicates
1270 + * that new initial data is present on the stream.
1271 + * The new initial data may result, for example, from device reconfiguration
1272 + * during migration that requires additional initialization data.
1273 + * In that case initial_bytes may report a non-zero value irrespective of
1274 + * any previously reported values, which progresses towards zero as precopy
1275 + * data is read from the data stream. dirty_bytes is also reset
1276 + * to zero and represents the state change of the device relative to the new
1277 + * initial_bytes.
1278 + * VFIO_PRECOPY_INFO_REINIT can be reported only after userspace opts in to
1279 + * VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2. Without this opt-in, the flags field
1280 + * of struct vfio_precopy_info is reserved for bug-compatibility reasons.
1281 + *
1282 * It is recommended to leave PRE_COPY for STOP_COPY only after this field
1283 * reaches zero. Leaving PRE_COPY earlier might make things slower.
1284 *
@@ -1297,6 +1314,7 @@ enum vfio_device_mig_state {
1314 struct vfio_precopy_info {
1315 __u32 argsz;
1316 __u32 flags;
1317 +#define VFIO_PRECOPY_INFO_REINIT (1 << 0) /* output - new initial data is present */
1318 __aligned_u64 initial_bytes;
1319 __aligned_u64 dirty_bytes;
1320 };
@@ -1506,6 +1524,16 @@ struct vfio_device_feature_dma_buf {
1524 struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);
1525 };
1526
1527 +/*
1528 + * Enables the migration precopy_info_v2 behaviour.
1529 + *
1530 + * VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2.
1531 + *
1532 + * On SET, enables the v2 pre_copy_info behaviour, where the
1533 + * vfio_precopy_info.flags is a valid output field.
1534 + */
1535 +#define VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2 12
1536 +
1537 /* -------- API for Type1 VFIO IOMMU -------- */
1538
1539 /**