From 23c73bd3ca1bdbbfd80491f7b523935fab7592bf Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Mon, 6 Jan 2025 00:33:12 -0500 Subject: [PATCH] * Mon Jan 06 2025 Miroslav Rezanina - 9.1.0-9 - kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch [RHEL-32665] - kvm-s390x-cpumodel-add-msa10-subfunctions.patch [RHEL-32665] - kvm-s390x-cpumodel-add-msa11-subfunctions.patch [RHEL-32665] - kvm-s390x-cpumodel-add-msa12-changes.patch [RHEL-32665] - kvm-s390x-cpumodel-add-msa13-subfunctions.patch [RHEL-32665] - kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch [RHEL-32665] - kvm-linux-headers-Update-to-Linux-6.13-rc1.patch [RHEL-32665] - kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch [RHEL-32665] - kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch [RHEL-32665] - kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch [RHEL-32665] - kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch [RHEL-32665] - kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch [RHEL-32665] - kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch [RHEL-32665] - kvm-s390x-cpumodel-correct-PLO-feature-wording.patch [RHEL-32665] - kvm-s390x-cpumodel-Add-PLO-extension-facility.patch [RHEL-32665] - kvm-s390x-cpumodel-gen17-model.patch [RHEL-32665] - kvm-qga-skip-bind-mounts-in-fs-list.patch [RHEL-71939] - kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch [RHEL-67108] - Resolves: RHEL-32665 ([IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part) - Resolves: RHEL-71939 (qemu-ga cannot freeze filesystems with sentinelone) - Resolves: RHEL-67108 ([aarch64] [rhel-10.0] Backport some important post 9.1 qemu fixes) --- ...-Use-correct-masks-for-IBRD-and-FBRD.patch | 67 + ...nux-headers-Update-to-Linux-6.13-rc1.patch | 1099 +++++++ ...ux-headers-Update-to-Linux-v6.12-rc5.patch | 2559 +++++++++++++++++ kvm-qga-skip-bind-mounts-in-fs-list.patch | 94 + ...-cpumodel-Add-PLO-extension-facility.patch | 221 ++ ...dd-Sequential-Instruction-Fetching-f.patch | 43 + ...dd-ptff-Query-Time-Stamp-Event-QTSE-.patch | 90 + ...dd-Concurrent-functions-facility-sup.patch | 169 ++ ...dd-Ineffective-nonconstrained-transa.patch | 56 + ...dd-Miscellaneous-Instruction-Extensi.patch | 42 + ...l-add-Vector-Enhancements-facility-3.patch | 56 + ...dd-Vector-Packed-Decimal-Enhancement.patch | 56 + ...390x-cpumodel-add-msa10-subfunctions.patch | 133 + ...390x-cpumodel-add-msa11-subfunctions.patch | 148 + kvm-s390x-cpumodel-add-msa12-changes.patch | 88 + ...390x-cpumodel-add-msa13-subfunctions.patch | 200 ++ ...cpumodel-correct-PLO-feature-wording.patch | 69 + kvm-s390x-cpumodel-gen17-model.patch | 107 + qemu-kvm.spec | 64 +- 19 files changed, 5360 insertions(+), 1 deletion(-) create mode 100644 kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch create mode 100644 kvm-linux-headers-Update-to-Linux-6.13-rc1.patch create mode 100644 kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch create mode 100644 kvm-qga-skip-bind-mounts-in-fs-list.patch create mode 100644 kvm-s390x-cpumodel-Add-PLO-extension-facility.patch create mode 100644 kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch create mode 100644 kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch create mode 100644 kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch create mode 100644 kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch create mode 100644 kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch create mode 100644 kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch create mode 100644 kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch create mode 100644 kvm-s390x-cpumodel-add-msa10-subfunctions.patch create mode 100644 kvm-s390x-cpumodel-add-msa11-subfunctions.patch create mode 100644 kvm-s390x-cpumodel-add-msa12-changes.patch create mode 100644 kvm-s390x-cpumodel-add-msa13-subfunctions.patch create mode 100644 kvm-s390x-cpumodel-correct-PLO-feature-wording.patch create mode 100644 kvm-s390x-cpumodel-gen17-model.patch diff --git a/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch b/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch new file mode 100644 index 0000000..22d55ce --- /dev/null +++ b/kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch @@ -0,0 +1,67 @@ +From 133805a36691de83f0ca29165a2312d5ad4f0757 Mon Sep 17 00:00:00 2001 +From: Peter Maydell +Date: Mon, 14 Oct 2024 17:05:53 +0100 +Subject: [PATCH 18/18] hw/char/pl011: Use correct masks for IBRD and FBRD +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: sansshar +RH-MergeRequest: 311: hw/char/pl011: Use correct masks for IBRD and FBRD +RH-Jira: RHEL-67108 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] e615ca34db8ee95533eba8cd671d620112e80cfb (sansshar/qemu-kvm-centos) + +JIRA: RHEL-67108 +Brew build id: 5099404 + +In commit b88cfee90268cad we defined masks for the IBRD and FBRD +integer and fractional baud rate divider registers, to prevent the +guest from writing invalid values which could cause division-by-zero. +Unfortunately we got the mask values the wrong way around: the FBRD +register is six bits and the IBRD register is 16 bits, not +vice-versa. + +You would only run into this bug if you programmed the UART to a baud +rate of less than 9600, because for 9600 baud and above the IBRD +value will fit into 6 bits, as per the table in + https://developer.arm.com/documentation/ddi0183/g/programmers-model/register-descriptions/fractional-baud-rate-register--uartfbrd + +The only visible effects would be that the value read back from +the register by the guest would be truncated, and we would +print an incorrect baud rate in the debug logs. + +Cc: qemu-stable@nongnu.org +Fixes: b88cfee90268 ("hw/char/pl011: Avoid division-by-zero in pl011_get_baudrate()") +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2610 +Signed-off-by: Peter Maydell +Reviewed-by: Alex Bennée +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Gavin Shan +Message-id: 20241007144732.2491331-1-peter.maydell@linaro.org +(cherry picked from commit cd247eae16ab1b9ce97fd34c000c1b883feeda45) +Signed-off-by: Sana Sharma +--- + hw/char/pl011.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/char/pl011.c b/hw/char/pl011.c +index f8078aa216..949e9d0e0d 100644 +--- a/hw/char/pl011.c ++++ b/hw/char/pl011.c +@@ -88,10 +88,10 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr) + #define CR_LBE (1 << 7) + + /* Integer Baud Rate Divider, UARTIBRD */ +-#define IBRD_MASK 0x3f ++#define IBRD_MASK 0xffff + + /* Fractional Baud Rate Divider, UARTFBRD */ +-#define FBRD_MASK 0xffff ++#define FBRD_MASK 0x3f + + static const unsigned char pl011_id_arm[8] = + { 0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }; +-- +2.39.3 + diff --git a/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch b/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch new file mode 100644 index 0000000..f6f6574 --- /dev/null +++ b/kvm-linux-headers-Update-to-Linux-6.13-rc1.patch @@ -0,0 +1,1099 @@ +From 46aeae3bd6fad36c985dbd1a7cb2dde613fbc60b Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:42 +0100 +Subject: [PATCH 07/18] linux-headers: Update to Linux 6.13-rc1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [7/16] f729f38c4bcd5eb773d8387f45292a6f7aa26c5c (thuth/qemu-kvm-cs9) + +This linux headers update includes required changes for +the gen17 CPU model. + +Signed-off-by: Hendrik Brueckner +Suggested-by: Thomas Huth +Message-ID: <20241206122751.189721-7-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 44fe383c274174405da79f5fcb028e39fe688036) +--- + include/standard-headers/drm/drm_fourcc.h | 1 + + include/standard-headers/linux/ethtool.h | 5 + + include/standard-headers/linux/pci_regs.h | 38 ++- + .../standard-headers/linux/virtio_crypto.h | 1 + + include/standard-headers/linux/virtio_pci.h | 131 ++++++++++ + linux-headers/asm-arm64/kvm.h | 6 + + linux-headers/asm-arm64/unistd_64.h | 4 + + linux-headers/asm-generic/mman-common.h | 3 + + linux-headers/asm-generic/mman.h | 4 + + linux-headers/asm-generic/unistd.h | 11 +- + linux-headers/asm-loongarch/kvm.h | 20 ++ + linux-headers/asm-loongarch/unistd_64.h | 4 + + linux-headers/asm-mips/mman.h | 3 + + linux-headers/asm-mips/unistd_n32.h | 4 + + linux-headers/asm-mips/unistd_n64.h | 4 + + linux-headers/asm-mips/unistd_o32.h | 4 + + linux-headers/asm-powerpc/unistd_32.h | 4 + + linux-headers/asm-powerpc/unistd_64.h | 4 + + linux-headers/asm-riscv/kvm.h | 4 + + linux-headers/asm-riscv/unistd_32.h | 4 + + linux-headers/asm-riscv/unistd_64.h | 4 + + linux-headers/asm-s390/kvm.h | 3 +- + linux-headers/asm-s390/unistd_32.h | 4 + + linux-headers/asm-s390/unistd_64.h | 4 + + linux-headers/asm-x86/kvm.h | 1 + + linux-headers/asm-x86/mman.h | 3 - + linux-headers/asm-x86/unistd_32.h | 4 + + linux-headers/asm-x86/unistd_64.h | 4 + + linux-headers/asm-x86/unistd_x32.h | 4 + + linux-headers/linux/iommufd.h | 224 +++++++++++++++++- + linux-headers/linux/kvm.h | 8 + + linux-headers/linux/psci.h | 5 + + linux-headers/linux/vfio.h | 2 +- + 33 files changed, 506 insertions(+), 23 deletions(-) + +diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h +index d4a2231306..708647776f 100644 +--- a/include/standard-headers/drm/drm_fourcc.h ++++ b/include/standard-headers/drm/drm_fourcc.h +@@ -1515,6 +1515,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) + * 64K_D_2D on GFX12 is identical to 64K_D on GFX11. + */ + #define AMD_FMT_MOD_TILE_GFX9_64K_D 10 ++#define AMD_FMT_MOD_TILE_GFX9_4K_D_X 22 + #define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 + #define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 + #define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 +diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h +index b05e84825b..67c47912e5 100644 +--- a/include/standard-headers/linux/ethtool.h ++++ b/include/standard-headers/linux/ethtool.h +@@ -2526,6 +2526,11 @@ struct ethtool_link_settings { + uint8_t master_slave_state; + uint8_t rate_matching; + uint32_t reserved[7]; ++ /* Linux builds with -Wflex-array-member-not-at-end but does ++ * not use the "link_mode_masks" member. Leave it defined for ++ * userspace for now, and when userspace wants to start using ++ * -Wfamnae, we'll need a new solution. ++ */ + uint32_t link_mode_masks[]; + /* layout of link_mode_masks fields: + * uint32_t map_supported[link_mode_masks_nwords]; +diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h +index 12323b3334..1601c7ed5f 100644 +--- a/include/standard-headers/linux/pci_regs.h ++++ b/include/standard-headers/linux/pci_regs.h +@@ -340,7 +340,8 @@ + #define PCI_MSIX_ENTRY_UPPER_ADDR 0x4 /* Message Upper Address */ + #define PCI_MSIX_ENTRY_DATA 0x8 /* Message Data */ + #define PCI_MSIX_ENTRY_VECTOR_CTRL 0xc /* Vector Control */ +-#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 ++#define PCI_MSIX_ENTRY_CTRL_MASKBIT 0x00000001 /* Mask Bit */ ++#define PCI_MSIX_ENTRY_CTRL_ST 0xffff0000 /* Steering Tag */ + + /* CompactPCI Hotswap Register */ + +@@ -659,6 +660,7 @@ + #define PCI_EXP_DEVCAP2_ATOMIC_COMP64 0x00000100 /* 64b AtomicOp completion */ + #define PCI_EXP_DEVCAP2_ATOMIC_COMP128 0x00000200 /* 128b AtomicOp completion */ + #define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */ ++#define PCI_EXP_DEVCAP2_TPH_COMP_MASK 0x00003000 /* TPH completer support */ + #define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */ + #define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */ + #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ +@@ -678,6 +680,7 @@ + #define PCI_EXP_DEVSTA2 0x2a /* Device Status 2 */ + #define PCI_CAP_EXP_RC_ENDPOINT_SIZEOF_V2 0x2c /* end of v2 EPs w/o link */ + #define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities 2 */ ++#define PCI_EXP_LNKCAP2_SLS 0x000000fe /* Supported Link Speeds Vector */ + #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */ + #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */ + #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */ +@@ -1023,15 +1026,34 @@ + #define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */ + #define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */ + ++/* TPH Completer Support */ ++#define PCI_EXP_DEVCAP2_TPH_COMP_NONE 0x0 /* None */ ++#define PCI_EXP_DEVCAP2_TPH_COMP_TPH_ONLY 0x1 /* TPH only */ ++#define PCI_EXP_DEVCAP2_TPH_COMP_EXT_TPH 0x3 /* TPH and Extended TPH */ ++ + /* TPH Requester */ + #define PCI_TPH_CAP 4 /* capability register */ +-#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */ +-#define PCI_TPH_LOC_NONE 0x000 /* no location */ +-#define PCI_TPH_LOC_CAP 0x200 /* in capability */ +-#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */ +-#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST table mask */ +-#define PCI_TPH_CAP_ST_SHIFT 16 /* ST table shift */ +-#define PCI_TPH_BASE_SIZEOF 0xc /* size with no ST table */ ++#define PCI_TPH_CAP_ST_NS 0x00000001 /* No ST Mode Supported */ ++#define PCI_TPH_CAP_ST_IV 0x00000002 /* Interrupt Vector Mode Supported */ ++#define PCI_TPH_CAP_ST_DS 0x00000004 /* Device Specific Mode Supported */ ++#define PCI_TPH_CAP_EXT_TPH 0x00000100 /* Ext TPH Requester Supported */ ++#define PCI_TPH_CAP_LOC_MASK 0x00000600 /* ST Table Location */ ++#define PCI_TPH_LOC_NONE 0x00000000 /* Not present */ ++#define PCI_TPH_LOC_CAP 0x00000200 /* In capability */ ++#define PCI_TPH_LOC_MSIX 0x00000400 /* In MSI-X */ ++#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* ST Table Size */ ++#define PCI_TPH_CAP_ST_SHIFT 16 /* ST Table Size shift */ ++#define PCI_TPH_BASE_SIZEOF 0xc /* Size with no ST table */ ++ ++#define PCI_TPH_CTRL 8 /* control register */ ++#define PCI_TPH_CTRL_MODE_SEL_MASK 0x00000007 /* ST Mode Select */ ++#define PCI_TPH_ST_NS_MODE 0x0 /* No ST Mode */ ++#define PCI_TPH_ST_IV_MODE 0x1 /* Interrupt Vector Mode */ ++#define PCI_TPH_ST_DS_MODE 0x2 /* Device Specific Mode */ ++#define PCI_TPH_CTRL_REQ_EN_MASK 0x00000300 /* TPH Requester Enable */ ++#define PCI_TPH_REQ_DISABLE 0x0 /* No TPH requests allowed */ ++#define PCI_TPH_REQ_TPH_ONLY 0x1 /* TPH only requests allowed */ ++#define PCI_TPH_REQ_EXT_TPH 0x3 /* Extended TPH requests allowed */ + + /* Downstream Port Containment */ + #define PCI_EXP_DPC_CAP 0x04 /* DPC Capability */ +diff --git a/include/standard-headers/linux/virtio_crypto.h b/include/standard-headers/linux/virtio_crypto.h +index 68066dafb6..4d350ae595 100644 +--- a/include/standard-headers/linux/virtio_crypto.h ++++ b/include/standard-headers/linux/virtio_crypto.h +@@ -329,6 +329,7 @@ struct virtio_crypto_op_header { + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00) + #define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \ + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01) ++ /* akcipher sign/verify opcodes are deprecated */ + #define VIRTIO_CRYPTO_AKCIPHER_SIGN \ + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02) + #define VIRTIO_CRYPTO_AKCIPHER_VERIFY \ +diff --git a/include/standard-headers/linux/virtio_pci.h b/include/standard-headers/linux/virtio_pci.h +index 4010216103..b177ed8972 100644 +--- a/include/standard-headers/linux/virtio_pci.h ++++ b/include/standard-headers/linux/virtio_pci.h +@@ -40,6 +40,7 @@ + #define _LINUX_VIRTIO_PCI_H + + #include "standard-headers/linux/types.h" ++#include "standard-headers/linux/kernel.h" + + #ifndef VIRTIO_PCI_NO_LEGACY + +@@ -240,6 +241,17 @@ struct virtio_pci_cfg_cap { + #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 + #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 + ++/* Device parts access commands. */ ++#define VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY 0x7 ++#define VIRTIO_ADMIN_CMD_DEVICE_CAP_GET 0x8 ++#define VIRTIO_ADMIN_CMD_DRIVER_CAP_SET 0x9 ++#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_CREATE 0xa ++#define VIRTIO_ADMIN_CMD_RESOURCE_OBJ_DESTROY 0xd ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_GET 0xe ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET 0xf ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_SET 0x10 ++#define VIRTIO_ADMIN_CMD_DEV_MODE_SET 0x11 ++ + struct virtio_admin_cmd_hdr { + uint16_t opcode; + /* +@@ -286,4 +298,123 @@ struct virtio_admin_cmd_notify_info_result { + struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO]; + }; + ++#define VIRTIO_DEV_PARTS_CAP 0x0000 ++ ++struct virtio_dev_parts_cap { ++ uint8_t get_parts_resource_objects_limit; ++ uint8_t set_parts_resource_objects_limit; ++}; ++ ++#define MAX_CAP_ID __KERNEL_DIV_ROUND_UP(VIRTIO_DEV_PARTS_CAP + 1, 64) ++ ++struct virtio_admin_cmd_query_cap_id_result { ++ uint64_t supported_caps[MAX_CAP_ID]; ++}; ++ ++struct virtio_admin_cmd_cap_get_data { ++ uint16_t id; ++ uint8_t reserved[6]; ++}; ++ ++struct virtio_admin_cmd_cap_set_data { ++ uint16_t id; ++ uint8_t reserved[6]; ++ uint8_t cap_specific_data[]; ++}; ++ ++struct virtio_admin_cmd_resource_obj_cmd_hdr { ++ uint16_t type; ++ uint8_t reserved[2]; ++ uint32_t id; /* Indicates unique resource object id per resource object type */ ++}; ++ ++struct virtio_admin_cmd_resource_obj_create_data { ++ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; ++ uint64_t flags; ++ uint8_t resource_obj_specific_data[]; ++}; ++ ++#define VIRTIO_RESOURCE_OBJ_DEV_PARTS 0 ++ ++#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_GET 0 ++#define VIRTIO_RESOURCE_OBJ_DEV_PARTS_TYPE_SET 1 ++ ++struct virtio_resource_obj_dev_parts { ++ uint8_t type; ++ uint8_t reserved[7]; ++}; ++ ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_SIZE 0 ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_COUNT 1 ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_METADATA_TYPE_LIST 2 ++ ++struct virtio_admin_cmd_dev_parts_metadata_data { ++ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; ++ uint8_t type; ++ uint8_t reserved[7]; ++}; ++ ++#define VIRTIO_DEV_PART_F_OPTIONAL 0 ++ ++struct virtio_dev_part_hdr { ++ uint16_t part_type; ++ uint8_t flags; ++ uint8_t reserved; ++ union { ++ struct { ++ uint32_t offset; ++ uint32_t reserved; ++ } pci_common_cfg; ++ struct { ++ uint16_t index; ++ uint8_t reserved[6]; ++ } vq_index; ++ } selector; ++ uint32_t length; ++}; ++ ++struct virtio_dev_part { ++ struct virtio_dev_part_hdr hdr; ++ uint8_t value[]; ++}; ++ ++struct virtio_admin_cmd_dev_parts_metadata_result { ++ union { ++ struct { ++ uint32_t size; ++ uint32_t reserved; ++ } parts_size; ++ struct { ++ uint32_t count; ++ uint32_t reserved; ++ } hdr_list_count; ++ struct { ++ uint32_t count; ++ uint32_t reserved; ++ struct virtio_dev_part_hdr hdrs[]; ++ } hdr_list; ++ }; ++}; ++ ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_SELECTED 0 ++#define VIRTIO_ADMIN_CMD_DEV_PARTS_GET_TYPE_ALL 1 ++ ++struct virtio_admin_cmd_dev_parts_get_data { ++ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; ++ uint8_t type; ++ uint8_t reserved[7]; ++ struct virtio_dev_part_hdr hdr_list[]; ++}; ++ ++struct virtio_admin_cmd_dev_parts_set_data { ++ struct virtio_admin_cmd_resource_obj_cmd_hdr hdr; ++ struct virtio_dev_part parts[]; ++}; ++ ++#define VIRTIO_ADMIN_CMD_DEV_MODE_F_STOPPED 0 ++ ++struct virtio_admin_cmd_dev_mode_set_data { ++ uint8_t flags; ++}; ++ + #endif +diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h +index 2af9931ae9..dccd5d965f 100644 +--- a/linux-headers/asm-arm64/kvm.h ++++ b/linux-headers/asm-arm64/kvm.h +@@ -473,6 +473,12 @@ enum { + */ + #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2 (1ULL << 0) + ++/* ++ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call. ++ * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN. ++ */ ++#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2 (1ULL << 0) ++ + /* run->fail_entry.hardware_entry_failure_reason codes. */ + #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED (1ULL << 0) + +diff --git a/linux-headers/asm-arm64/unistd_64.h b/linux-headers/asm-arm64/unistd_64.h +index 99a1d70459..d4e90fff76 100644 +--- a/linux-headers/asm-arm64/unistd_64.h ++++ b/linux-headers/asm-arm64/unistd_64.h +@@ -319,6 +319,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-generic/mman-common.h b/linux-headers/asm-generic/mman-common.h +index 6ce1f1ceb4..1ea2c4c33b 100644 +--- a/linux-headers/asm-generic/mman-common.h ++++ b/linux-headers/asm-generic/mman-common.h +@@ -79,6 +79,9 @@ + + #define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */ + ++#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */ ++#define MADV_GUARD_REMOVE 103 /* unguard range */ ++ + /* compatibility flags */ + #define MAP_FILE 0 + +diff --git a/linux-headers/asm-generic/mman.h b/linux-headers/asm-generic/mman.h +index 57e8195d0b..5e3d61ddbd 100644 +--- a/linux-headers/asm-generic/mman.h ++++ b/linux-headers/asm-generic/mman.h +@@ -19,4 +19,8 @@ + #define MCL_FUTURE 2 /* lock all future mappings */ + #define MCL_ONFAULT 4 /* lock all pages that are faulted in */ + ++#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */ ++#define SHADOW_STACK_SET_MARKER (1ULL << 1) /* Set up a top of stack marker in the shadow stack */ ++ ++ + #endif /* __ASM_GENERIC_MMAN_H */ +diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h +index 5bf6148cac..88dc393c2b 100644 +--- a/linux-headers/asm-generic/unistd.h ++++ b/linux-headers/asm-generic/unistd.h +@@ -841,8 +841,17 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) + #define __NR_mseal 462 + __SYSCALL(__NR_mseal, sys_mseal) + ++#define __NR_setxattrat 463 ++__SYSCALL(__NR_setxattrat, sys_setxattrat) ++#define __NR_getxattrat 464 ++__SYSCALL(__NR_getxattrat, sys_getxattrat) ++#define __NR_listxattrat 465 ++__SYSCALL(__NR_listxattrat, sys_listxattrat) ++#define __NR_removexattrat 466 ++__SYSCALL(__NR_removexattrat, sys_removexattrat) ++ + #undef __NR_syscalls +-#define __NR_syscalls 463 ++#define __NR_syscalls 467 + + /* + * 32 bit systems traditionally used different +diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarch/kvm.h +index 70d89070bf..5f354f5c68 100644 +--- a/linux-headers/asm-loongarch/kvm.h ++++ b/linux-headers/asm-loongarch/kvm.h +@@ -8,6 +8,8 @@ + + #include + ++#define __KVM_HAVE_IRQ_LINE ++ + /* + * KVM LoongArch specific structures and definitions. + * +@@ -132,4 +134,22 @@ struct kvm_iocsr_entry { + #define KVM_IRQCHIP_NUM_PINS 64 + #define KVM_MAX_CORES 256 + ++#define KVM_DEV_LOONGARCH_IPI_GRP_REGS 0x40000001 ++ ++#define KVM_DEV_LOONGARCH_EXTIOI_GRP_REGS 0x40000002 ++ ++#define KVM_DEV_LOONGARCH_EXTIOI_GRP_SW_STATUS 0x40000003 ++#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_NUM_CPU 0x0 ++#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_FEATURE 0x1 ++#define KVM_DEV_LOONGARCH_EXTIOI_SW_STATUS_STATE 0x2 ++ ++#define KVM_DEV_LOONGARCH_EXTIOI_GRP_CTRL 0x40000004 ++#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_NUM_CPU 0x0 ++#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_INIT_FEATURE 0x1 ++#define KVM_DEV_LOONGARCH_EXTIOI_CTRL_LOAD_FINISHED 0x3 ++ ++#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_REGS 0x40000005 ++#define KVM_DEV_LOONGARCH_PCH_PIC_GRP_CTRL 0x40000006 ++#define KVM_DEV_LOONGARCH_PCH_PIC_CTRL_INIT 0 ++ + #endif /* __UAPI_ASM_LOONGARCH_KVM_H */ +diff --git a/linux-headers/asm-loongarch/unistd_64.h b/linux-headers/asm-loongarch/unistd_64.h +index 887ea50cca..23fb96a8a7 100644 +--- a/linux-headers/asm-loongarch/unistd_64.h ++++ b/linux-headers/asm-loongarch/unistd_64.h +@@ -315,6 +315,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-mips/mman.h b/linux-headers/asm-mips/mman.h +index 9c48d9a21a..b700dae28c 100644 +--- a/linux-headers/asm-mips/mman.h ++++ b/linux-headers/asm-mips/mman.h +@@ -105,6 +105,9 @@ + + #define MADV_COLLAPSE 25 /* Synchronous hugepage collapse */ + ++#define MADV_GUARD_INSTALL 102 /* fatal signal on access to range */ ++#define MADV_GUARD_REMOVE 103 /* unguard range */ ++ + /* compatibility flags */ + #define MAP_FILE 0 + +diff --git a/linux-headers/asm-mips/unistd_n32.h b/linux-headers/asm-mips/unistd_n32.h +index fc93b3be30..9a75719644 100644 +--- a/linux-headers/asm-mips/unistd_n32.h ++++ b/linux-headers/asm-mips/unistd_n32.h +@@ -391,5 +391,9 @@ + #define __NR_lsm_set_self_attr (__NR_Linux + 460) + #define __NR_lsm_list_modules (__NR_Linux + 461) + #define __NR_mseal (__NR_Linux + 462) ++#define __NR_setxattrat (__NR_Linux + 463) ++#define __NR_getxattrat (__NR_Linux + 464) ++#define __NR_listxattrat (__NR_Linux + 465) ++#define __NR_removexattrat (__NR_Linux + 466) + + #endif /* _ASM_UNISTD_N32_H */ +diff --git a/linux-headers/asm-mips/unistd_n64.h b/linux-headers/asm-mips/unistd_n64.h +index e72a3eb2c9..7086783b0c 100644 +--- a/linux-headers/asm-mips/unistd_n64.h ++++ b/linux-headers/asm-mips/unistd_n64.h +@@ -367,5 +367,9 @@ + #define __NR_lsm_set_self_attr (__NR_Linux + 460) + #define __NR_lsm_list_modules (__NR_Linux + 461) + #define __NR_mseal (__NR_Linux + 462) ++#define __NR_setxattrat (__NR_Linux + 463) ++#define __NR_getxattrat (__NR_Linux + 464) ++#define __NR_listxattrat (__NR_Linux + 465) ++#define __NR_removexattrat (__NR_Linux + 466) + + #endif /* _ASM_UNISTD_N64_H */ +diff --git a/linux-headers/asm-mips/unistd_o32.h b/linux-headers/asm-mips/unistd_o32.h +index b86eb0786c..b3825823e4 100644 +--- a/linux-headers/asm-mips/unistd_o32.h ++++ b/linux-headers/asm-mips/unistd_o32.h +@@ -437,5 +437,9 @@ + #define __NR_lsm_set_self_attr (__NR_Linux + 460) + #define __NR_lsm_list_modules (__NR_Linux + 461) + #define __NR_mseal (__NR_Linux + 462) ++#define __NR_setxattrat (__NR_Linux + 463) ++#define __NR_getxattrat (__NR_Linux + 464) ++#define __NR_listxattrat (__NR_Linux + 465) ++#define __NR_removexattrat (__NR_Linux + 466) + + #endif /* _ASM_UNISTD_O32_H */ +diff --git a/linux-headers/asm-powerpc/unistd_32.h b/linux-headers/asm-powerpc/unistd_32.h +index 28627b6546..38ee4dc35d 100644 +--- a/linux-headers/asm-powerpc/unistd_32.h ++++ b/linux-headers/asm-powerpc/unistd_32.h +@@ -444,6 +444,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_32_H */ +diff --git a/linux-headers/asm-powerpc/unistd_64.h b/linux-headers/asm-powerpc/unistd_64.h +index 1fc42a8300..5e5f156834 100644 +--- a/linux-headers/asm-powerpc/unistd_64.h ++++ b/linux-headers/asm-powerpc/unistd_64.h +@@ -416,6 +416,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h +index e97db32964..3482c9a73d 100644 +--- a/linux-headers/asm-riscv/kvm.h ++++ b/linux-headers/asm-riscv/kvm.h +@@ -175,6 +175,10 @@ enum KVM_RISCV_ISA_EXT_ID { + KVM_RISCV_ISA_EXT_ZCF, + KVM_RISCV_ISA_EXT_ZCMOP, + KVM_RISCV_ISA_EXT_ZAWRS, ++ KVM_RISCV_ISA_EXT_SMNPM, ++ KVM_RISCV_ISA_EXT_SSNPM, ++ KVM_RISCV_ISA_EXT_SVADE, ++ KVM_RISCV_ISA_EXT_SVADU, + KVM_RISCV_ISA_EXT_MAX, + }; + +diff --git a/linux-headers/asm-riscv/unistd_32.h b/linux-headers/asm-riscv/unistd_32.h +index 9625743dfd..74f6127aed 100644 +--- a/linux-headers/asm-riscv/unistd_32.h ++++ b/linux-headers/asm-riscv/unistd_32.h +@@ -310,6 +310,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_32_H */ +diff --git a/linux-headers/asm-riscv/unistd_64.h b/linux-headers/asm-riscv/unistd_64.h +index 95bca8ae81..bb6a15a2ec 100644 +--- a/linux-headers/asm-riscv/unistd_64.h ++++ b/linux-headers/asm-riscv/unistd_64.h +@@ -320,6 +320,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h +index 684c4e1205..ab5a6bce59 100644 +--- a/linux-headers/asm-s390/kvm.h ++++ b/linux-headers/asm-s390/kvm.h +@@ -469,7 +469,8 @@ struct kvm_s390_vm_cpu_subfunc { + __u8 kdsa[16]; /* with MSA9 */ + __u8 sortl[32]; /* with STFLE.150 */ + __u8 dfltcc[32]; /* with STFLE.151 */ +- __u8 reserved[1728]; ++ __u8 pfcr[16]; /* with STFLE.201 */ ++ __u8 reserved[1712]; + }; + + #define KVM_S390_VM_CPU_PROCESSOR_UV_FEAT_GUEST 6 +diff --git a/linux-headers/asm-s390/unistd_32.h b/linux-headers/asm-s390/unistd_32.h +index 7706c21b87..620201cb36 100644 +--- a/linux-headers/asm-s390/unistd_32.h ++++ b/linux-headers/asm-s390/unistd_32.h +@@ -435,5 +435,9 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + #endif /* _ASM_S390_UNISTD_32_H */ +diff --git a/linux-headers/asm-s390/unistd_64.h b/linux-headers/asm-s390/unistd_64.h +index 62082d592d..e7e4a10aaf 100644 +--- a/linux-headers/asm-s390/unistd_64.h ++++ b/linux-headers/asm-s390/unistd_64.h +@@ -383,5 +383,9 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + #endif /* _ASM_S390_UNISTD_64_H */ +diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h +index 4711ef2c3d..96589490c4 100644 +--- a/linux-headers/asm-x86/kvm.h ++++ b/linux-headers/asm-x86/kvm.h +@@ -438,6 +438,7 @@ struct kvm_sync_regs { + #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5) + #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) + #define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) ++#define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8) + + #define KVM_STATE_NESTED_FORMAT_VMX 0 + #define KVM_STATE_NESTED_FORMAT_SVM 1 +diff --git a/linux-headers/asm-x86/mman.h b/linux-headers/asm-x86/mman.h +index 46cdc941f9..ac1e627721 100644 +--- a/linux-headers/asm-x86/mman.h ++++ b/linux-headers/asm-x86/mman.h +@@ -5,9 +5,6 @@ + #define MAP_32BIT 0x40 /* only give out 32bit addresses */ + #define MAP_ABOVE4G 0x80 /* only map above 4GB */ + +-/* Flags for map_shadow_stack(2) */ +-#define SHADOW_STACK_SET_TOKEN (1ULL << 0) /* Set up a restore token in the shadow stack */ +- + #include + + #endif /* _ASM_X86_MMAN_H */ +diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h +index fb7b8b169b..a2eb492a75 100644 +--- a/linux-headers/asm-x86/unistd_32.h ++++ b/linux-headers/asm-x86/unistd_32.h +@@ -453,6 +453,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_32_H */ +diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h +index 24c979be54..2f5fc400f5 100644 +--- a/linux-headers/asm-x86/unistd_64.h ++++ b/linux-headers/asm-x86/unistd_64.h +@@ -376,6 +376,10 @@ + #define __NR_lsm_set_self_attr 460 + #define __NR_lsm_list_modules 461 + #define __NR_mseal 462 ++#define __NR_setxattrat 463 ++#define __NR_getxattrat 464 ++#define __NR_listxattrat 465 ++#define __NR_removexattrat 466 + + + #endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h +index c23dd21a2d..fecd832e7f 100644 +--- a/linux-headers/asm-x86/unistd_x32.h ++++ b/linux-headers/asm-x86/unistd_x32.h +@@ -329,6 +329,10 @@ + #define __NR_lsm_set_self_attr (__X32_SYSCALL_BIT + 460) + #define __NR_lsm_list_modules (__X32_SYSCALL_BIT + 461) + #define __NR_mseal (__X32_SYSCALL_BIT + 462) ++#define __NR_setxattrat (__X32_SYSCALL_BIT + 463) ++#define __NR_getxattrat (__X32_SYSCALL_BIT + 464) ++#define __NR_listxattrat (__X32_SYSCALL_BIT + 465) ++#define __NR_removexattrat (__X32_SYSCALL_BIT + 466) + #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) + #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) + #define __NR_ioctl (__X32_SYSCALL_BIT + 514) +diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h +index 782baf477f..37aae16502 100644 +--- a/linux-headers/linux/iommufd.h ++++ b/linux-headers/linux/iommufd.h +@@ -51,6 +51,10 @@ enum { + IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c, + IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d, + IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e, ++ IOMMUFD_CMD_IOAS_MAP_FILE = 0x8f, ++ IOMMUFD_CMD_VIOMMU_ALLOC = 0x90, ++ IOMMUFD_CMD_VDEVICE_ALLOC = 0x91, ++ IOMMUFD_CMD_IOAS_CHANGE_PROCESS = 0x92, + }; + + /** +@@ -213,6 +217,30 @@ struct iommu_ioas_map { + }; + #define IOMMU_IOAS_MAP _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP) + ++/** ++ * struct iommu_ioas_map_file - ioctl(IOMMU_IOAS_MAP_FILE) ++ * @size: sizeof(struct iommu_ioas_map_file) ++ * @flags: same as for iommu_ioas_map ++ * @ioas_id: same as for iommu_ioas_map ++ * @fd: the memfd to map ++ * @start: byte offset from start of file to map from ++ * @length: same as for iommu_ioas_map ++ * @iova: same as for iommu_ioas_map ++ * ++ * Set an IOVA mapping from a memfd file. All other arguments and semantics ++ * match those of IOMMU_IOAS_MAP. ++ */ ++struct iommu_ioas_map_file { ++ __u32 size; ++ __u32 flags; ++ __u32 ioas_id; ++ __s32 fd; ++ __aligned_u64 start; ++ __aligned_u64 length; ++ __aligned_u64 iova; ++}; ++#define IOMMU_IOAS_MAP_FILE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_MAP_FILE) ++ + /** + * struct iommu_ioas_copy - ioctl(IOMMU_IOAS_COPY) + * @size: sizeof(struct iommu_ioas_copy) +@@ -359,11 +387,19 @@ struct iommu_vfio_ioas { + * enforced on device attachment + * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is + * valid. ++ * @IOMMU_HWPT_ALLOC_PASID: Requests a domain that can be used with PASID. The ++ * domain can be attached to any PASID on the device. ++ * Any domain attached to the non-PASID part of the ++ * device must also be flaged, otherwise attaching a ++ * PASID will blocked. ++ * If IOMMU does not support PASID it will return ++ * error (-EOPNOTSUPP). + */ + enum iommufd_hwpt_alloc_flags { + IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0, + IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1, + IOMMU_HWPT_FAULT_ID_VALID = 1 << 2, ++ IOMMU_HWPT_ALLOC_PASID = 1 << 3, + }; + + /** +@@ -394,14 +430,36 @@ struct iommu_hwpt_vtd_s1 { + __u32 __reserved; + }; + ++/** ++ * struct iommu_hwpt_arm_smmuv3 - ARM SMMUv3 nested STE ++ * (IOMMU_HWPT_DATA_ARM_SMMUV3) ++ * ++ * @ste: The first two double words of the user space Stream Table Entry for ++ * the translation. Must be little-endian. ++ * Allowed fields: (Refer to "5.2 Stream Table Entry" in SMMUv3 HW Spec) ++ * - word-0: V, Cfg, S1Fmt, S1ContextPtr, S1CDMax ++ * - word-1: EATS, S1DSS, S1CIR, S1COR, S1CSH, S1STALLD ++ * ++ * -EIO will be returned if @ste is not legal or contains any non-allowed field. ++ * Cfg can be used to select a S1, Bypass or Abort configuration. A Bypass ++ * nested domain will translate the same as the nesting parent. The S1 will ++ * install a Context Descriptor Table pointing at userspace memory translated ++ * by the nesting parent. ++ */ ++struct iommu_hwpt_arm_smmuv3 { ++ __aligned_le64 ste[2]; ++}; ++ + /** + * enum iommu_hwpt_data_type - IOMMU HWPT Data Type + * @IOMMU_HWPT_DATA_NONE: no data + * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table ++ * @IOMMU_HWPT_DATA_ARM_SMMUV3: ARM SMMUv3 Context Descriptor Table + */ + enum iommu_hwpt_data_type { + IOMMU_HWPT_DATA_NONE = 0, + IOMMU_HWPT_DATA_VTD_S1 = 1, ++ IOMMU_HWPT_DATA_ARM_SMMUV3 = 2, + }; + + /** +@@ -409,7 +467,7 @@ enum iommu_hwpt_data_type { + * @size: sizeof(struct iommu_hwpt_alloc) + * @flags: Combination of enum iommufd_hwpt_alloc_flags + * @dev_id: The device to allocate this HWPT for +- * @pt_id: The IOAS or HWPT to connect this HWPT to ++ * @pt_id: The IOAS or HWPT or vIOMMU to connect this HWPT to + * @out_hwpt_id: The ID of the new HWPT + * @__reserved: Must be 0 + * @data_type: One of enum iommu_hwpt_data_type +@@ -428,11 +486,13 @@ enum iommu_hwpt_data_type { + * IOMMU_HWPT_DATA_NONE. The HWPT can be allocated as a parent HWPT for a + * nesting configuration by passing IOMMU_HWPT_ALLOC_NEST_PARENT via @flags. + * +- * A user-managed nested HWPT will be created from a given parent HWPT via +- * @pt_id, in which the parent HWPT must be allocated previously via the +- * same ioctl from a given IOAS (@pt_id). In this case, the @data_type +- * must be set to a pre-defined type corresponding to an I/O page table +- * type supported by the underlying IOMMU hardware. ++ * A user-managed nested HWPT will be created from a given vIOMMU (wrapping a ++ * parent HWPT) or a parent HWPT via @pt_id, in which the parent HWPT must be ++ * allocated previously via the same ioctl from a given IOAS (@pt_id). In this ++ * case, the @data_type must be set to a pre-defined type corresponding to an ++ * I/O page table type supported by the underlying IOMMU hardware. The device ++ * via @dev_id and the vIOMMU via @pt_id must be associated to the same IOMMU ++ * instance. + * + * If the @data_type is set to IOMMU_HWPT_DATA_NONE, @data_len and + * @data_uptr should be zero. Otherwise, both @data_len and @data_uptr +@@ -484,15 +544,50 @@ struct iommu_hw_info_vtd { + __aligned_u64 ecap_reg; + }; + ++/** ++ * struct iommu_hw_info_arm_smmuv3 - ARM SMMUv3 hardware information ++ * (IOMMU_HW_INFO_TYPE_ARM_SMMUV3) ++ * ++ * @flags: Must be set to 0 ++ * @__reserved: Must be 0 ++ * @idr: Implemented features for ARM SMMU Non-secure programming interface ++ * @iidr: Information about the implementation and implementer of ARM SMMU, ++ * and architecture version supported ++ * @aidr: ARM SMMU architecture version ++ * ++ * For the details of @idr, @iidr and @aidr, please refer to the chapters ++ * from 6.3.1 to 6.3.6 in the SMMUv3 Spec. ++ * ++ * User space should read the underlying ARM SMMUv3 hardware information for ++ * the list of supported features. ++ * ++ * Note that these values reflect the raw HW capability, without any insight if ++ * any required kernel driver support is present. Bits may be set indicating the ++ * HW has functionality that is lacking kernel software support, such as BTM. If ++ * a VMM is using this information to construct emulated copies of these ++ * registers it should only forward bits that it knows it can support. ++ * ++ * In future, presence of required kernel support will be indicated in flags. ++ */ ++struct iommu_hw_info_arm_smmuv3 { ++ __u32 flags; ++ __u32 __reserved; ++ __u32 idr[6]; ++ __u32 iidr; ++ __u32 aidr; ++}; ++ + /** + * enum iommu_hw_info_type - IOMMU Hardware Info Types + * @IOMMU_HW_INFO_TYPE_NONE: Used by the drivers that do not report hardware + * info + * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type ++ * @IOMMU_HW_INFO_TYPE_ARM_SMMUV3: ARM SMMUv3 iommu info type + */ + enum iommu_hw_info_type { + IOMMU_HW_INFO_TYPE_NONE = 0, + IOMMU_HW_INFO_TYPE_INTEL_VTD = 1, ++ IOMMU_HW_INFO_TYPE_ARM_SMMUV3 = 2, + }; + + /** +@@ -627,9 +722,11 @@ struct iommu_hwpt_get_dirty_bitmap { + * enum iommu_hwpt_invalidate_data_type - IOMMU HWPT Cache Invalidation + * Data Type + * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1 ++ * @IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3: Invalidation data for ARM SMMUv3 + */ + enum iommu_hwpt_invalidate_data_type { + IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0, ++ IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3 = 1, + }; + + /** +@@ -668,10 +765,32 @@ struct iommu_hwpt_vtd_s1_invalidate { + __u32 __reserved; + }; + ++/** ++ * struct iommu_viommu_arm_smmuv3_invalidate - ARM SMMUv3 cahce invalidation ++ * (IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3) ++ * @cmd: 128-bit cache invalidation command that runs in SMMU CMDQ. ++ * Must be little-endian. ++ * ++ * Supported command list only when passing in a vIOMMU via @hwpt_id: ++ * CMDQ_OP_TLBI_NSNH_ALL ++ * CMDQ_OP_TLBI_NH_VA ++ * CMDQ_OP_TLBI_NH_VAA ++ * CMDQ_OP_TLBI_NH_ALL ++ * CMDQ_OP_TLBI_NH_ASID ++ * CMDQ_OP_ATC_INV ++ * CMDQ_OP_CFGI_CD ++ * CMDQ_OP_CFGI_CD_ALL ++ * ++ * -EIO will be returned if the command is not supported. ++ */ ++struct iommu_viommu_arm_smmuv3_invalidate { ++ __aligned_le64 cmd[2]; ++}; ++ + /** + * struct iommu_hwpt_invalidate - ioctl(IOMMU_HWPT_INVALIDATE) + * @size: sizeof(struct iommu_hwpt_invalidate) +- * @hwpt_id: ID of a nested HWPT for cache invalidation ++ * @hwpt_id: ID of a nested HWPT or a vIOMMU, for cache invalidation + * @data_uptr: User pointer to an array of driver-specific cache invalidation + * data. + * @data_type: One of enum iommu_hwpt_invalidate_data_type, defining the data +@@ -682,8 +801,11 @@ struct iommu_hwpt_vtd_s1_invalidate { + * Output the number of requests successfully handled by kernel. + * @__reserved: Must be 0. + * +- * Invalidate the iommu cache for user-managed page table. Modifications on a +- * user-managed page table should be followed by this operation to sync cache. ++ * Invalidate iommu cache for user-managed page table or vIOMMU. Modifications ++ * on a user-managed page table should be followed by this operation, if a HWPT ++ * is passed in via @hwpt_id. Other caches, such as device cache or descriptor ++ * cache can be flushed if a vIOMMU is passed in via the @hwpt_id field. ++ * + * Each ioctl can support one or more cache invalidation requests in the array + * that has a total size of @entry_len * @entry_num. + * +@@ -797,4 +919,88 @@ struct iommu_fault_alloc { + __u32 out_fault_fd; + }; + #define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC) ++ ++/** ++ * enum iommu_viommu_type - Virtual IOMMU Type ++ * @IOMMU_VIOMMU_TYPE_DEFAULT: Reserved for future use ++ * @IOMMU_VIOMMU_TYPE_ARM_SMMUV3: ARM SMMUv3 driver specific type ++ */ ++enum iommu_viommu_type { ++ IOMMU_VIOMMU_TYPE_DEFAULT = 0, ++ IOMMU_VIOMMU_TYPE_ARM_SMMUV3 = 1, ++}; ++ ++/** ++ * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC) ++ * @size: sizeof(struct iommu_viommu_alloc) ++ * @flags: Must be 0 ++ * @type: Type of the virtual IOMMU. Must be defined in enum iommu_viommu_type ++ * @dev_id: The device's physical IOMMU will be used to back the virtual IOMMU ++ * @hwpt_id: ID of a nesting parent HWPT to associate to ++ * @out_viommu_id: Output virtual IOMMU ID for the allocated object ++ * ++ * Allocate a virtual IOMMU object, representing the underlying physical IOMMU's ++ * virtualization support that is a security-isolated slice of the real IOMMU HW ++ * that is unique to a specific VM. Operations global to the IOMMU are connected ++ * to the vIOMMU, such as: ++ * - Security namespace for guest owned ID, e.g. guest-controlled cache tags ++ * - Non-device-affiliated event reporting, e.g. invalidation queue errors ++ * - Access to a sharable nesting parent pagetable across physical IOMMUs ++ * - Virtualization of various platforms IDs, e.g. RIDs and others ++ * - Delivery of paravirtualized invalidation ++ * - Direct assigned invalidation queues ++ * - Direct assigned interrupts ++ */ ++struct iommu_viommu_alloc { ++ __u32 size; ++ __u32 flags; ++ __u32 type; ++ __u32 dev_id; ++ __u32 hwpt_id; ++ __u32 out_viommu_id; ++}; ++#define IOMMU_VIOMMU_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_ALLOC) ++ ++/** ++ * struct iommu_vdevice_alloc - ioctl(IOMMU_VDEVICE_ALLOC) ++ * @size: sizeof(struct iommu_vdevice_alloc) ++ * @viommu_id: vIOMMU ID to associate with the virtual device ++ * @dev_id: The physical device to allocate a virtual instance on the vIOMMU ++ * @out_vdevice_id: Object handle for the vDevice. Pass to IOMMU_DESTORY ++ * @virt_id: Virtual device ID per vIOMMU, e.g. vSID of ARM SMMUv3, vDeviceID ++ * of AMD IOMMU, and vRID of a nested Intel VT-d to a Context Table ++ * ++ * Allocate a virtual device instance (for a physical device) against a vIOMMU. ++ * This instance holds the device's information (related to its vIOMMU) in a VM. ++ */ ++struct iommu_vdevice_alloc { ++ __u32 size; ++ __u32 viommu_id; ++ __u32 dev_id; ++ __u32 out_vdevice_id; ++ __aligned_u64 virt_id; ++}; ++#define IOMMU_VDEVICE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VDEVICE_ALLOC) ++ ++/** ++ * struct iommu_ioas_change_process - ioctl(VFIO_IOAS_CHANGE_PROCESS) ++ * @size: sizeof(struct iommu_ioas_change_process) ++ * @__reserved: Must be 0 ++ * ++ * This transfers pinned memory counts for every memory map in every IOAS ++ * in the context to the current process. This only supports maps created ++ * with IOMMU_IOAS_MAP_FILE, and returns EINVAL if other maps are present. ++ * If the ioctl returns a failure status, then nothing is changed. ++ * ++ * This API is useful for transferring operation of a device from one process ++ * to another, such as during userland live update. ++ */ ++struct iommu_ioas_change_process { ++ __u32 size; ++ __u32 __reserved; ++}; ++ ++#define IOMMU_IOAS_CHANGE_PROCESS \ ++ _IO(IOMMUFD_TYPE, IOMMUFD_CMD_IOAS_CHANGE_PROCESS) ++ + #endif +diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h +index 49dd1b30ce..3bcd4eabe3 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -1150,7 +1150,15 @@ enum kvm_device_type { + #define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME + KVM_DEV_TYPE_RISCV_AIA, + #define KVM_DEV_TYPE_RISCV_AIA KVM_DEV_TYPE_RISCV_AIA ++ KVM_DEV_TYPE_LOONGARCH_IPI, ++#define KVM_DEV_TYPE_LOONGARCH_IPI KVM_DEV_TYPE_LOONGARCH_IPI ++ KVM_DEV_TYPE_LOONGARCH_EIOINTC, ++#define KVM_DEV_TYPE_LOONGARCH_EIOINTC KVM_DEV_TYPE_LOONGARCH_EIOINTC ++ KVM_DEV_TYPE_LOONGARCH_PCHPIC, ++#define KVM_DEV_TYPE_LOONGARCH_PCHPIC KVM_DEV_TYPE_LOONGARCH_PCHPIC ++ + KVM_DEV_TYPE_MAX, ++ + }; + + struct kvm_vfio_spapr_tce { +diff --git a/linux-headers/linux/psci.h b/linux-headers/linux/psci.h +index 74f3cb5007..a982afd498 100644 +--- a/linux-headers/linux/psci.h ++++ b/linux-headers/linux/psci.h +@@ -59,6 +59,7 @@ + #define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18) + #define PSCI_1_1_FN_MEM_PROTECT PSCI_0_2_FN(19) + #define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN(20) ++#define PSCI_1_3_FN_SYSTEM_OFF2 PSCI_0_2_FN(21) + + #define PSCI_1_0_FN64_CPU_DEFAULT_SUSPEND PSCI_0_2_FN64(12) + #define PSCI_1_0_FN64_NODE_HW_STATE PSCI_0_2_FN64(13) +@@ -68,6 +69,7 @@ + + #define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18) + #define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE PSCI_0_2_FN64(20) ++#define PSCI_1_3_FN64_SYSTEM_OFF2 PSCI_0_2_FN64(21) + + /* PSCI v0.2 power state encoding for CPU_SUSPEND function */ + #define PSCI_0_2_POWER_STATE_ID_MASK 0xffff +@@ -100,6 +102,9 @@ + #define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET 0 + #define PSCI_1_1_RESET_TYPE_VENDOR_START 0x80000000U + ++/* PSCI v1.3 hibernate type for SYSTEM_OFF2 */ ++#define PSCI_1_3_OFF_TYPE_HIBERNATE_OFF BIT(0) ++ + /* PSCI version decoding (independent of PSCI version) */ + #define PSCI_VERSION_MAJOR_SHIFT 16 + #define PSCI_VERSION_MINOR_MASK \ +diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h +index b4be37b225..1b5e254d6a 100644 +--- a/linux-headers/linux/vfio.h ++++ b/linux-headers/linux/vfio.h +@@ -35,7 +35,7 @@ + #define VFIO_EEH 5 + + /* Two-stage IOMMU */ +-#define VFIO_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ ++#define __VFIO_RESERVED_TYPE1_NESTING_IOMMU 6 /* Implies v2 */ + + #define VFIO_SPAPR_TCE_v2_IOMMU 7 + +-- +2.39.3 + diff --git a/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch b/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch new file mode 100644 index 0000000..b548ab3 --- /dev/null +++ b/kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch @@ -0,0 +1,2559 @@ +From d49c6a77649755fac29dce957795338942f58ac4 Mon Sep 17 00:00:00 2001 +From: Bibo Mao +Date: Mon, 28 Oct 2024 10:38:09 +0800 +Subject: [PATCH 01/18] linux-headers: Update to Linux v6.12-rc5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [1/16] b28ecec9551a4850d48d48522088ef4eef6f30ad (thuth/qemu-kvm-cs9) + +update linux-headers to v6.12-rc5. Pass to compile on aarch64, arm, +loongarch64, x86_64, i386, riscv64,riscv32 softmmu and linux-user. + +Signed-off-by: Bibo Mao +Acked-by: Song Gao +Message-Id: <20241028023809.1554405-4-maobibo@loongson.cn> +Signed-off-by: Song Gao +(cherry picked from commit 0d2eeef77a33315187df8519491a900bde4a3d83) +Signed-off-by: Thomas Huth +--- + include/standard-headers/drm/drm_fourcc.h | 43 +++ + include/standard-headers/linux/const.h | 17 + + include/standard-headers/linux/ethtool.h | 226 ++++++++++++ + include/standard-headers/linux/fuse.h | 22 +- + .../linux/input-event-codes.h | 2 + + include/standard-headers/linux/pci_regs.h | 41 ++- + .../standard-headers/linux/virtio_balloon.h | 16 +- + include/standard-headers/linux/virtio_gpu.h | 1 + + linux-headers/asm-arm64/mman.h | 9 + + linux-headers/asm-arm64/unistd.h | 25 +- + linux-headers/asm-arm64/unistd_64.h | 324 +++++++++++++++++ + linux-headers/asm-generic/unistd.h | 6 +- + linux-headers/asm-loongarch/kvm.h | 24 ++ + linux-headers/asm-loongarch/kvm_para.h | 21 ++ + linux-headers/asm-loongarch/unistd.h | 4 +- + linux-headers/asm-loongarch/unistd_64.h | 320 +++++++++++++++++ + linux-headers/asm-riscv/kvm.h | 7 + + linux-headers/asm-riscv/unistd.h | 41 +-- + linux-headers/asm-riscv/unistd_32.h | 315 +++++++++++++++++ + linux-headers/asm-riscv/unistd_64.h | 325 ++++++++++++++++++ + linux-headers/asm-x86/kvm.h | 2 + + linux-headers/asm-x86/unistd_64.h | 1 + + linux-headers/asm-x86/unistd_x32.h | 1 + + linux-headers/linux/bits.h | 3 + + linux-headers/linux/const.h | 17 + + linux-headers/linux/iommufd.h | 143 +++++++- + linux-headers/linux/kvm.h | 23 +- + linux-headers/linux/mman.h | 1 + + linux-headers/linux/psp-sev.h | 28 ++ + 29 files changed, 1915 insertions(+), 93 deletions(-) + create mode 100644 linux-headers/asm-arm64/unistd_64.h + create mode 100644 linux-headers/asm-loongarch/kvm_para.h + create mode 100644 linux-headers/asm-loongarch/unistd_64.h + create mode 100644 linux-headers/asm-riscv/unistd_32.h + create mode 100644 linux-headers/asm-riscv/unistd_64.h + +diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h +index b72917073d..d4a2231306 100644 +--- a/include/standard-headers/drm/drm_fourcc.h ++++ b/include/standard-headers/drm/drm_fourcc.h +@@ -701,6 +701,31 @@ extern "C" { + */ + #define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15) + ++/* ++ * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression ++ * on integrated graphics ++ * ++ * The main surface is Tile 4 and at plane index 0. For semi-planar formats ++ * like NV12, the Y and UV planes are Tile 4 and are located at plane indices ++ * 0 and 1, respectively. The CCS for all planes are stored outside of the ++ * GEM object in a reserved memory area dedicated for the storage of the ++ * CCS data for all compressible GEM objects. ++ */ ++#define I915_FORMAT_MOD_4_TILED_LNL_CCS fourcc_mod_code(INTEL, 16) ++ ++/* ++ * Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression ++ * on discrete graphics ++ * ++ * The main surface is Tile 4 and at plane index 0. For semi-planar formats ++ * like NV12, the Y and UV planes are Tile 4 and are located at plane indices ++ * 0 and 1, respectively. The CCS for all planes are stored outside of the ++ * GEM object in a reserved memory area dedicated for the storage of the ++ * CCS data for all compressible GEM objects. The GEM object must be stored in ++ * contiguous memory with a size aligned to 64KB ++ */ ++#define I915_FORMAT_MOD_4_TILED_BMG_CCS fourcc_mod_code(INTEL, 17) ++ + /* + * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks + * +@@ -1475,6 +1500,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) + #define AMD_FMT_MOD_TILE_VER_GFX10 2 + #define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 + #define AMD_FMT_MOD_TILE_VER_GFX11 4 ++#define AMD_FMT_MOD_TILE_VER_GFX12 5 + + /* + * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical +@@ -1485,6 +1511,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) + /* + * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has + * GFX9 as canonical version. ++ * ++ * 64K_D_2D on GFX12 is identical to 64K_D on GFX11. + */ + #define AMD_FMT_MOD_TILE_GFX9_64K_D 10 + #define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 +@@ -1492,6 +1520,21 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) + #define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 + #define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31 + ++/* Gfx12 swizzle modes: ++ * 0 - LINEAR ++ * 1 - 256B_2D - 2D block dimensions ++ * 2 - 4KB_2D ++ * 3 - 64KB_2D ++ * 4 - 256KB_2D ++ * 5 - 4KB_3D - 3D block dimensions ++ * 6 - 64KB_3D ++ * 7 - 256KB_3D ++ */ ++#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1 ++#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2 ++#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3 ++#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4 ++ + #define AMD_FMT_MOD_DCC_BLOCK_64B 0 + #define AMD_FMT_MOD_DCC_BLOCK_128B 1 + #define AMD_FMT_MOD_DCC_BLOCK_256B 2 +diff --git a/include/standard-headers/linux/const.h b/include/standard-headers/linux/const.h +index 1eb84b5087..2122610de7 100644 +--- a/include/standard-headers/linux/const.h ++++ b/include/standard-headers/linux/const.h +@@ -28,6 +28,23 @@ + #define _BITUL(x) (_UL(1) << (x)) + #define _BITULL(x) (_ULL(1) << (x)) + ++#if !defined(__ASSEMBLY__) ++/* ++ * Missing __asm__ support ++ * ++ * __BIT128() would not work in the __asm__ code, as it shifts an ++ * 'unsigned __init128' data type as direct representation of ++ * 128 bit constants is not supported in the gcc compiler, as ++ * they get silently truncated. ++ * ++ * TODO: Please revisit this implementation when gcc compiler ++ * starts representing 128 bit constants directly like long ++ * and unsigned long etc. Subsequently drop the comment for ++ * GENMASK_U128() which would then start supporting __asm__ code. ++ */ ++#define _BIT128(x) ((unsigned __int128)(1) << (x)) ++#endif ++ + #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) + #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + +diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h +index b0b4b68410..b05e84825b 100644 +--- a/include/standard-headers/linux/ethtool.h ++++ b/include/standard-headers/linux/ethtool.h +@@ -752,6 +752,197 @@ enum ethtool_module_power_mode { + ETHTOOL_MODULE_POWER_MODE_HIGH, + }; + ++/** ++ * enum ethtool_c33_pse_ext_state - groups of PSE extended states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION: Group of error_condition states ++ * @ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID: Group of mr_mps_valid states ++ * @ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE: Group of mr_pse_enable states ++ * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED: Group of option_detect_ted ++ * states ++ * @ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM: Group of option_vport_lim states ++ * @ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED: Group of ovld_detected states ++ * @ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE: Group of pd_dll_power_type ++ * states ++ * @ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE: Group of power_not_available ++ * states ++ * @ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED: Group of short_detected states ++ */ ++enum ethtool_c33_pse_ext_state { ++ ETHTOOL_C33_PSE_EXT_STATE_ERROR_CONDITION = 1, ++ ETHTOOL_C33_PSE_EXT_STATE_MR_MPS_VALID, ++ ETHTOOL_C33_PSE_EXT_STATE_MR_PSE_ENABLE, ++ ETHTOOL_C33_PSE_EXT_STATE_OPTION_DETECT_TED, ++ ETHTOOL_C33_PSE_EXT_STATE_OPTION_VPORT_LIM, ++ ETHTOOL_C33_PSE_EXT_STATE_OVLD_DETECTED, ++ ETHTOOL_C33_PSE_EXT_STATE_PD_DLL_POWER_TYPE, ++ ETHTOOL_C33_PSE_EXT_STATE_POWER_NOT_AVAILABLE, ++ ETHTOOL_C33_PSE_EXT_STATE_SHORT_DETECTED, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_mr_mps_valid - mr_mps_valid states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD: Underload ++ * state ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN: Port is not ++ * connected ++ * ++ * The PSE monitors either the DC or AC Maintain Power Signature ++ * (MPS, see 33.2.9.1). This variable indicates the presence or absence of ++ * a valid MPS. ++ */ ++enum ethtool_c33_pse_ext_substate_mr_mps_valid { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_DETECTED_UNDERLOAD = 1, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_MPS_VALID_CONNECTION_OPEN, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_error_condition - error_condition states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT: Non-existing ++ * port number ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT: Undefined port ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT: Internal ++ * hardware fault ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON: ++ * Communication error after force on ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS: Unknown ++ * port status ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF: Host ++ * crash turn off ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN: ++ * Host crash force shutdown ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE: Configuration ++ * change ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP: Over ++ * temperature detected ++ * ++ * error_condition is a variable indicating the status of ++ * implementation-specific fault conditions or optionally other system faults ++ * that prevent the PSE from meeting the specifications in Table 33–11 and that ++ * require the PSE not to source power. These error conditions are different ++ * from those monitored by the state diagrams in Figure 33–10. ++ */ ++enum ethtool_c33_pse_ext_substate_error_condition { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_NON_EXISTING_PORT = 1, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNDEFINED_PORT, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_INTERNAL_HW_FAULT, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_COMM_ERROR_AFTER_FORCE_ON, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_UNKNOWN_PORT_STATUS, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_TURN_OFF, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_HOST_CRASH_FORCE_SHUTDOWN, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_CONFIG_CHANGE, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_ERROR_CONDITION_DETECTED_OVER_TEMP, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_mr_pse_enable - mr_pse_enable states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE: Disable ++ * pin active ++ * ++ * mr_pse_enable is control variable that selects PSE operation and test ++ * functions. ++ */ ++enum ethtool_c33_pse_ext_substate_mr_pse_enable { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_MR_PSE_ENABLE_DISABLE_PIN_ACTIVE = 1, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_option_detect_ted - option_detect_ted ++ * states functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS: Detection ++ * in process ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR: ++ * Connection check error ++ * ++ * option_detect_ted is a variable indicating if detection can be performed ++ * by the PSE during the ted_timer interval. ++ */ ++enum ethtool_c33_pse_ext_substate_option_detect_ted { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_DET_IN_PROCESS = 1, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_DETECT_TED_CONNECTION_CHECK_ERROR, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_option_vport_lim - option_vport_lim states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE: Main supply ++ * voltage is high ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE: Main supply ++ * voltage is low ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION: Voltage ++ * injection into the port ++ * ++ * option_vport_lim is an optional variable indicates if VPSE is out of the ++ * operating range during normal operating state. ++ */ ++enum ethtool_c33_pse_ext_substate_option_vport_lim { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_HIGH_VOLTAGE = 1, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_LOW_VOLTAGE, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OPTION_VPORT_LIM_VOLTAGE_INJECTION, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_ovld_detected - ovld_detected states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD: Overload state ++ * ++ * ovld_detected is a variable indicating if the PSE output current has been ++ * in an overload condition (see 33.2.7.6) for at least TCUT of a one-second ++ * sliding time. ++ */ ++enum ethtool_c33_pse_ext_substate_ovld_detected { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_OVLD_DETECTED_OVERLOAD = 1, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_power_not_available - power_not_available ++ * states functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED: Power ++ * budget exceeded for the controller ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET: ++ * Configured port power limit exceeded controller power budget ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT: ++ * Power request from PD exceeds port limit ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT: Power ++ * denied due to Hardware power limit ++ * ++ * power_not_available is a variable that is asserted in an ++ * implementation-dependent manner when the PSE is no longer capable of ++ * sourcing sufficient power to support the attached PD. Sufficient power ++ * is defined by classification; see 33.2.6. ++ */ ++enum ethtool_c33_pse_ext_substate_power_not_available { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_BUDGET_EXCEEDED = 1, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PORT_PW_LIMIT_EXCEEDS_CONTROLLER_BUDGET, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_PD_REQUEST_EXCEEDS_PORT_LIMIT, ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_POWER_NOT_AVAILABLE_HW_PW_LIMIT, ++}; ++ ++/** ++ * enum ethtool_c33_pse_ext_substate_short_detected - short_detected states ++ * functions. IEEE 802.3-2022 33.2.4.4 Variables ++ * ++ * @ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION: Short ++ * condition was detected ++ * ++ * short_detected is a variable indicating if the PSE output current has been ++ * in a short circuit condition for TLIM within a sliding window (see 33.2.7.7). ++ */ ++enum ethtool_c33_pse_ext_substate_short_detected { ++ ETHTOOL_C33_PSE_EXT_SUBSTATE_SHORT_DETECTED_SHORT_CONDITION = 1, ++}; ++ + /** + * enum ethtool_pse_types - Types of PSE controller. + * @ETHTOOL_PSE_UNKNOWN: Type of PSE controller is unknown +@@ -877,6 +1068,24 @@ enum ethtool_mm_verify_status { + ETHTOOL_MM_VERIFY_STATUS_DISABLED, + }; + ++/** ++ * enum ethtool_module_fw_flash_status - plug-in module firmware flashing status ++ * @ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED: The firmware flashing process has ++ * started. ++ * @ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS: The firmware flashing process ++ * is in progress. ++ * @ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED: The firmware flashing process was ++ * completed successfully. ++ * @ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR: The firmware flashing process was ++ * stopped due to an error. ++ */ ++enum ethtool_module_fw_flash_status { ++ ETHTOOL_MODULE_FW_FLASH_STATUS_STARTED = 1, ++ ETHTOOL_MODULE_FW_FLASH_STATUS_IN_PROGRESS, ++ ETHTOOL_MODULE_FW_FLASH_STATUS_COMPLETED, ++ ETHTOOL_MODULE_FW_FLASH_STATUS_ERROR, ++}; ++ + /** + * struct ethtool_gstrings - string set for data tagging + * @cmd: Command number = %ETHTOOL_GSTRINGS +@@ -1845,6 +2054,7 @@ enum ethtool_link_mode_bit_indices { + ETHTOOL_LINK_MODE_10baseT1S_Full_BIT = 99, + ETHTOOL_LINK_MODE_10baseT1S_Half_BIT = 100, + ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT = 101, ++ ETHTOOL_LINK_MODE_10baseT1BRR_Full_BIT = 102, + + /* must be last entry */ + __ETHTOOL_LINK_MODE_MASK_NBITS +@@ -2323,4 +2533,20 @@ struct ethtool_link_settings { + * uint32_t map_lp_advertising[link_mode_masks_nwords]; + */ + }; ++ ++/** ++ * enum phy_upstream - Represents the upstream component a given PHY device ++ * is connected to, as in what is on the other end of the MII bus. Most PHYs ++ * will be attached to an Ethernet MAC controller, but in some cases, there's ++ * an intermediate PHY used as a media-converter, which will driver another ++ * MII interface as its output. ++ * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port, ++ * or ethernet controller) ++ * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter) ++ */ ++enum phy_upstream { ++ PHY_UPSTREAM_MAC, ++ PHY_UPSTREAM_PHY, ++}; ++ + #endif /* _LINUX_ETHTOOL_H */ +diff --git a/include/standard-headers/linux/fuse.h b/include/standard-headers/linux/fuse.h +index bac9dbc49f..889e12ad15 100644 +--- a/include/standard-headers/linux/fuse.h ++++ b/include/standard-headers/linux/fuse.h +@@ -217,6 +217,9 @@ + * - add backing_id to fuse_open_out, add FOPEN_PASSTHROUGH open flag + * - add FUSE_NO_EXPORT_SUPPORT init flag + * - add FUSE_NOTIFY_RESEND, add FUSE_HAS_RESEND init flag ++ * ++ * 7.41 ++ * - add FUSE_ALLOW_IDMAP + */ + + #ifndef _LINUX_FUSE_H +@@ -248,7 +251,7 @@ + #define FUSE_KERNEL_VERSION 7 + + /** Minor version number of this interface */ +-#define FUSE_KERNEL_MINOR_VERSION 40 ++#define FUSE_KERNEL_MINOR_VERSION 41 + + /** The node ID of the root inode */ + #define FUSE_ROOT_ID 1 +@@ -417,6 +420,7 @@ struct fuse_file_lock { + * FUSE_NO_EXPORT_SUPPORT: explicitly disable export support + * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit + * of the request ID indicates resend requests ++ * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts + */ + #define FUSE_ASYNC_READ (1 << 0) + #define FUSE_POSIX_LOCKS (1 << 1) +@@ -462,6 +466,7 @@ struct fuse_file_lock { + + /* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */ + #define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP ++#define FUSE_ALLOW_IDMAP (1ULL << 40) + + /** + * CUSE INIT request/reply flags +@@ -980,6 +985,21 @@ struct fuse_fallocate_in { + */ + #define FUSE_UNIQUE_RESEND (1ULL << 63) + ++/** ++ * This value will be set by the kernel to ++ * (struct fuse_in_header).{uid,gid} fields in ++ * case when: ++ * - fuse daemon enabled FUSE_ALLOW_IDMAP ++ * - idmapping information is not available and uid/gid ++ * can not be mapped in accordance with an idmapping. ++ * ++ * Note: an idmapping information always available ++ * for inode creation operations like: ++ * FUSE_MKNOD, FUSE_SYMLINK, FUSE_MKDIR, FUSE_TMPFILE, ++ * FUSE_CREATE and FUSE_RENAME2 (with RENAME_WHITEOUT). ++ */ ++#define FUSE_INVALID_UIDGID ((uint32_t)(-1)) ++ + struct fuse_in_header { + uint32_t len; + uint32_t opcode; +diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h +index 2221b0c383..50b2b7497e 100644 +--- a/include/standard-headers/linux/input-event-codes.h ++++ b/include/standard-headers/linux/input-event-codes.h +@@ -618,6 +618,8 @@ + #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ + #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ + #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ ++#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */ ++#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/ + + #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ + #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ +diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h +index 94c00996e6..12323b3334 100644 +--- a/include/standard-headers/linux/pci_regs.h ++++ b/include/standard-headers/linux/pci_regs.h +@@ -634,9 +634,11 @@ + #define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ + #define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ + #define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ +-#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */ ++#define PCI_EXP_RTCTL_RRS_SVE 0x0010 /* Config RRS Software Visibility Enable */ ++#define PCI_EXP_RTCTL_CRSSVE PCI_EXP_RTCTL_RRS_SVE /* compatibility */ + #define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ +-#define PCI_EXP_RTCAP_CRSVIS 0x0001 /* CRS Software Visibility capability */ ++#define PCI_EXP_RTCAP_RRS_SV 0x0001 /* Config RRS Software Visibility */ ++#define PCI_EXP_RTCAP_CRSVIS PCI_EXP_RTCAP_RRS_SV /* compatibility */ + #define PCI_EXP_RTSTA 0x20 /* Root Status */ + #define PCI_EXP_RTSTA_PME_RQ_ID 0x0000ffff /* PME Requester ID */ + #define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */ +@@ -740,6 +742,7 @@ + #define PCI_EXT_CAP_ID_DVSEC 0x23 /* Designated Vendor-Specific */ + #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ + #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ ++#define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ + #define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */ + #define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */ + #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE +@@ -1121,6 +1124,40 @@ + #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 + #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 + ++/* Native PCIe Enclosure Management */ ++#define PCI_NPEM_CAP 0x04 /* NPEM capability register */ ++#define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */ ++ ++#define PCI_NPEM_CTRL 0x08 /* NPEM control register */ ++#define PCI_NPEM_CTRL_ENABLE 0x00000001 /* NPEM Enable */ ++ ++/* ++ * Native PCIe Enclosure Management indication bits and Reset command bit ++ * are corresponding for capability and control registers. ++ */ ++#define PCI_NPEM_CMD_RESET 0x00000002 /* Reset Command */ ++#define PCI_NPEM_IND_OK 0x00000004 /* OK */ ++#define PCI_NPEM_IND_LOCATE 0x00000008 /* Locate */ ++#define PCI_NPEM_IND_FAIL 0x00000010 /* Fail */ ++#define PCI_NPEM_IND_REBUILD 0x00000020 /* Rebuild */ ++#define PCI_NPEM_IND_PFA 0x00000040 /* Predicted Failure Analysis */ ++#define PCI_NPEM_IND_HOTSPARE 0x00000080 /* Hot Spare */ ++#define PCI_NPEM_IND_ICA 0x00000100 /* In Critical Array */ ++#define PCI_NPEM_IND_IFA 0x00000200 /* In Failed Array */ ++#define PCI_NPEM_IND_IDT 0x00000400 /* Device Type */ ++#define PCI_NPEM_IND_DISABLED 0x00000800 /* Disabled */ ++#define PCI_NPEM_IND_SPEC_0 0x01000000 ++#define PCI_NPEM_IND_SPEC_1 0x02000000 ++#define PCI_NPEM_IND_SPEC_2 0x04000000 ++#define PCI_NPEM_IND_SPEC_3 0x08000000 ++#define PCI_NPEM_IND_SPEC_4 0x10000000 ++#define PCI_NPEM_IND_SPEC_5 0x20000000 ++#define PCI_NPEM_IND_SPEC_6 0x40000000 ++#define PCI_NPEM_IND_SPEC_7 0x80000000 ++ ++#define PCI_NPEM_STATUS 0x0c /* NPEM status register */ ++#define PCI_NPEM_STATUS_CC 0x00000001 /* Command Completed */ ++ + /* Data Object Exchange */ + #define PCI_DOE_CAP 0x04 /* DOE Capabilities Register */ + #define PCI_DOE_CAP_INT_SUP 0x00000001 /* Interrupt Support */ +diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h +index f343bfefd8..3121cd2e0e 100644 +--- a/include/standard-headers/linux/virtio_balloon.h ++++ b/include/standard-headers/linux/virtio_balloon.h +@@ -71,7 +71,13 @@ struct virtio_balloon_config { + #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ + #define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ + #define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failures */ +-#define VIRTIO_BALLOON_S_NR 10 ++#define VIRTIO_BALLOON_S_OOM_KILL 10 /* OOM killer invocations */ ++#define VIRTIO_BALLOON_S_ALLOC_STALL 11 /* Stall count of memory allocatoin */ ++#define VIRTIO_BALLOON_S_ASYNC_SCAN 12 /* Amount of memory scanned asynchronously */ ++#define VIRTIO_BALLOON_S_DIRECT_SCAN 13 /* Amount of memory scanned directly */ ++#define VIRTIO_BALLOON_S_ASYNC_RECLAIM 14 /* Amount of memory reclaimed asynchronously */ ++#define VIRTIO_BALLOON_S_DIRECT_RECLAIM 15 /* Amount of memory reclaimed directly */ ++#define VIRTIO_BALLOON_S_NR 16 + + #define VIRTIO_BALLOON_S_NAMES_WITH_PREFIX(VIRTIO_BALLOON_S_NAMES_prefix) { \ + VIRTIO_BALLOON_S_NAMES_prefix "swap-in", \ +@@ -83,7 +89,13 @@ struct virtio_balloon_config { + VIRTIO_BALLOON_S_NAMES_prefix "available-memory", \ + VIRTIO_BALLOON_S_NAMES_prefix "disk-caches", \ + VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-allocations", \ +- VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures" \ ++ VIRTIO_BALLOON_S_NAMES_prefix "hugetlb-failures", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "oom-kills", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "alloc-stalls", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "async-scans", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "direct-scans", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "async-reclaims", \ ++ VIRTIO_BALLOON_S_NAMES_prefix "direct-reclaims" \ + } + + #define VIRTIO_BALLOON_S_NAMES VIRTIO_BALLOON_S_NAMES_WITH_PREFIX("") +diff --git a/include/standard-headers/linux/virtio_gpu.h b/include/standard-headers/linux/virtio_gpu.h +index 2db643ed8f..6459fdb9fb 100644 +--- a/include/standard-headers/linux/virtio_gpu.h ++++ b/include/standard-headers/linux/virtio_gpu.h +@@ -311,6 +311,7 @@ struct virtio_gpu_cmd_submit { + #define VIRTIO_GPU_CAPSET_VIRGL2 2 + /* 3 is reserved for gfxstream */ + #define VIRTIO_GPU_CAPSET_VENUS 4 ++#define VIRTIO_GPU_CAPSET_DRM 6 + + /* VIRTIO_GPU_CMD_GET_CAPSET_INFO */ + struct virtio_gpu_get_capset_info { +diff --git a/linux-headers/asm-arm64/mman.h b/linux-headers/asm-arm64/mman.h +index d0dbfe9587..7b500a3a7b 100644 +--- a/linux-headers/asm-arm64/mman.h ++++ b/linux-headers/asm-arm64/mman.h +@@ -7,4 +7,13 @@ + #define PROT_BTI 0x10 /* BTI guarded page */ + #define PROT_MTE 0x20 /* Normal Tagged mapping */ + ++/* Override any generic PKEY permission defines */ ++#define PKEY_DISABLE_EXECUTE 0x4 ++#define PKEY_DISABLE_READ 0x8 ++#undef PKEY_ACCESS_MASK ++#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\ ++ PKEY_DISABLE_WRITE |\ ++ PKEY_DISABLE_READ |\ ++ PKEY_DISABLE_EXECUTE) ++ + #endif /* ! _UAPI__ASM_MMAN_H */ +diff --git a/linux-headers/asm-arm64/unistd.h b/linux-headers/asm-arm64/unistd.h +index ce2ee8f1e3..df36f23876 100644 +--- a/linux-headers/asm-arm64/unistd.h ++++ b/linux-headers/asm-arm64/unistd.h +@@ -1,25 +1,2 @@ + /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +-/* +- * Copyright (C) 2012 ARM Ltd. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License version 2 as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see . +- */ +- +-#define __ARCH_WANT_RENAMEAT +-#define __ARCH_WANT_NEW_STAT +-#define __ARCH_WANT_SET_GET_RLIMIT +-#define __ARCH_WANT_TIME32_SYSCALLS +-#define __ARCH_WANT_SYS_CLONE3 +-#define __ARCH_WANT_MEMFD_SECRET +- +-#include ++#include +diff --git a/linux-headers/asm-arm64/unistd_64.h b/linux-headers/asm-arm64/unistd_64.h +new file mode 100644 +index 0000000000..99a1d70459 +--- /dev/null ++++ b/linux-headers/asm-arm64/unistd_64.h +@@ -0,0 +1,324 @@ ++#ifndef _ASM_UNISTD_64_H ++#define _ASM_UNISTD_64_H ++ ++#define __NR_io_setup 0 ++#define __NR_io_destroy 1 ++#define __NR_io_submit 2 ++#define __NR_io_cancel 3 ++#define __NR_io_getevents 4 ++#define __NR_setxattr 5 ++#define __NR_lsetxattr 6 ++#define __NR_fsetxattr 7 ++#define __NR_getxattr 8 ++#define __NR_lgetxattr 9 ++#define __NR_fgetxattr 10 ++#define __NR_listxattr 11 ++#define __NR_llistxattr 12 ++#define __NR_flistxattr 13 ++#define __NR_removexattr 14 ++#define __NR_lremovexattr 15 ++#define __NR_fremovexattr 16 ++#define __NR_getcwd 17 ++#define __NR_lookup_dcookie 18 ++#define __NR_eventfd2 19 ++#define __NR_epoll_create1 20 ++#define __NR_epoll_ctl 21 ++#define __NR_epoll_pwait 22 ++#define __NR_dup 23 ++#define __NR_dup3 24 ++#define __NR_fcntl 25 ++#define __NR_inotify_init1 26 ++#define __NR_inotify_add_watch 27 ++#define __NR_inotify_rm_watch 28 ++#define __NR_ioctl 29 ++#define __NR_ioprio_set 30 ++#define __NR_ioprio_get 31 ++#define __NR_flock 32 ++#define __NR_mknodat 33 ++#define __NR_mkdirat 34 ++#define __NR_unlinkat 35 ++#define __NR_symlinkat 36 ++#define __NR_linkat 37 ++#define __NR_renameat 38 ++#define __NR_umount2 39 ++#define __NR_mount 40 ++#define __NR_pivot_root 41 ++#define __NR_nfsservctl 42 ++#define __NR_statfs 43 ++#define __NR_fstatfs 44 ++#define __NR_truncate 45 ++#define __NR_ftruncate 46 ++#define __NR_fallocate 47 ++#define __NR_faccessat 48 ++#define __NR_chdir 49 ++#define __NR_fchdir 50 ++#define __NR_chroot 51 ++#define __NR_fchmod 52 ++#define __NR_fchmodat 53 ++#define __NR_fchownat 54 ++#define __NR_fchown 55 ++#define __NR_openat 56 ++#define __NR_close 57 ++#define __NR_vhangup 58 ++#define __NR_pipe2 59 ++#define __NR_quotactl 60 ++#define __NR_getdents64 61 ++#define __NR_lseek 62 ++#define __NR_read 63 ++#define __NR_write 64 ++#define __NR_readv 65 ++#define __NR_writev 66 ++#define __NR_pread64 67 ++#define __NR_pwrite64 68 ++#define __NR_preadv 69 ++#define __NR_pwritev 70 ++#define __NR_sendfile 71 ++#define __NR_pselect6 72 ++#define __NR_ppoll 73 ++#define __NR_signalfd4 74 ++#define __NR_vmsplice 75 ++#define __NR_splice 76 ++#define __NR_tee 77 ++#define __NR_readlinkat 78 ++#define __NR_newfstatat 79 ++#define __NR_fstat 80 ++#define __NR_sync 81 ++#define __NR_fsync 82 ++#define __NR_fdatasync 83 ++#define __NR_sync_file_range 84 ++#define __NR_timerfd_create 85 ++#define __NR_timerfd_settime 86 ++#define __NR_timerfd_gettime 87 ++#define __NR_utimensat 88 ++#define __NR_acct 89 ++#define __NR_capget 90 ++#define __NR_capset 91 ++#define __NR_personality 92 ++#define __NR_exit 93 ++#define __NR_exit_group 94 ++#define __NR_waitid 95 ++#define __NR_set_tid_address 96 ++#define __NR_unshare 97 ++#define __NR_futex 98 ++#define __NR_set_robust_list 99 ++#define __NR_get_robust_list 100 ++#define __NR_nanosleep 101 ++#define __NR_getitimer 102 ++#define __NR_setitimer 103 ++#define __NR_kexec_load 104 ++#define __NR_init_module 105 ++#define __NR_delete_module 106 ++#define __NR_timer_create 107 ++#define __NR_timer_gettime 108 ++#define __NR_timer_getoverrun 109 ++#define __NR_timer_settime 110 ++#define __NR_timer_delete 111 ++#define __NR_clock_settime 112 ++#define __NR_clock_gettime 113 ++#define __NR_clock_getres 114 ++#define __NR_clock_nanosleep 115 ++#define __NR_syslog 116 ++#define __NR_ptrace 117 ++#define __NR_sched_setparam 118 ++#define __NR_sched_setscheduler 119 ++#define __NR_sched_getscheduler 120 ++#define __NR_sched_getparam 121 ++#define __NR_sched_setaffinity 122 ++#define __NR_sched_getaffinity 123 ++#define __NR_sched_yield 124 ++#define __NR_sched_get_priority_max 125 ++#define __NR_sched_get_priority_min 126 ++#define __NR_sched_rr_get_interval 127 ++#define __NR_restart_syscall 128 ++#define __NR_kill 129 ++#define __NR_tkill 130 ++#define __NR_tgkill 131 ++#define __NR_sigaltstack 132 ++#define __NR_rt_sigsuspend 133 ++#define __NR_rt_sigaction 134 ++#define __NR_rt_sigprocmask 135 ++#define __NR_rt_sigpending 136 ++#define __NR_rt_sigtimedwait 137 ++#define __NR_rt_sigqueueinfo 138 ++#define __NR_rt_sigreturn 139 ++#define __NR_setpriority 140 ++#define __NR_getpriority 141 ++#define __NR_reboot 142 ++#define __NR_setregid 143 ++#define __NR_setgid 144 ++#define __NR_setreuid 145 ++#define __NR_setuid 146 ++#define __NR_setresuid 147 ++#define __NR_getresuid 148 ++#define __NR_setresgid 149 ++#define __NR_getresgid 150 ++#define __NR_setfsuid 151 ++#define __NR_setfsgid 152 ++#define __NR_times 153 ++#define __NR_setpgid 154 ++#define __NR_getpgid 155 ++#define __NR_getsid 156 ++#define __NR_setsid 157 ++#define __NR_getgroups 158 ++#define __NR_setgroups 159 ++#define __NR_uname 160 ++#define __NR_sethostname 161 ++#define __NR_setdomainname 162 ++#define __NR_getrlimit 163 ++#define __NR_setrlimit 164 ++#define __NR_getrusage 165 ++#define __NR_umask 166 ++#define __NR_prctl 167 ++#define __NR_getcpu 168 ++#define __NR_gettimeofday 169 ++#define __NR_settimeofday 170 ++#define __NR_adjtimex 171 ++#define __NR_getpid 172 ++#define __NR_getppid 173 ++#define __NR_getuid 174 ++#define __NR_geteuid 175 ++#define __NR_getgid 176 ++#define __NR_getegid 177 ++#define __NR_gettid 178 ++#define __NR_sysinfo 179 ++#define __NR_mq_open 180 ++#define __NR_mq_unlink 181 ++#define __NR_mq_timedsend 182 ++#define __NR_mq_timedreceive 183 ++#define __NR_mq_notify 184 ++#define __NR_mq_getsetattr 185 ++#define __NR_msgget 186 ++#define __NR_msgctl 187 ++#define __NR_msgrcv 188 ++#define __NR_msgsnd 189 ++#define __NR_semget 190 ++#define __NR_semctl 191 ++#define __NR_semtimedop 192 ++#define __NR_semop 193 ++#define __NR_shmget 194 ++#define __NR_shmctl 195 ++#define __NR_shmat 196 ++#define __NR_shmdt 197 ++#define __NR_socket 198 ++#define __NR_socketpair 199 ++#define __NR_bind 200 ++#define __NR_listen 201 ++#define __NR_accept 202 ++#define __NR_connect 203 ++#define __NR_getsockname 204 ++#define __NR_getpeername 205 ++#define __NR_sendto 206 ++#define __NR_recvfrom 207 ++#define __NR_setsockopt 208 ++#define __NR_getsockopt 209 ++#define __NR_shutdown 210 ++#define __NR_sendmsg 211 ++#define __NR_recvmsg 212 ++#define __NR_readahead 213 ++#define __NR_brk 214 ++#define __NR_munmap 215 ++#define __NR_mremap 216 ++#define __NR_add_key 217 ++#define __NR_request_key 218 ++#define __NR_keyctl 219 ++#define __NR_clone 220 ++#define __NR_execve 221 ++#define __NR_mmap 222 ++#define __NR_fadvise64 223 ++#define __NR_swapon 224 ++#define __NR_swapoff 225 ++#define __NR_mprotect 226 ++#define __NR_msync 227 ++#define __NR_mlock 228 ++#define __NR_munlock 229 ++#define __NR_mlockall 230 ++#define __NR_munlockall 231 ++#define __NR_mincore 232 ++#define __NR_madvise 233 ++#define __NR_remap_file_pages 234 ++#define __NR_mbind 235 ++#define __NR_get_mempolicy 236 ++#define __NR_set_mempolicy 237 ++#define __NR_migrate_pages 238 ++#define __NR_move_pages 239 ++#define __NR_rt_tgsigqueueinfo 240 ++#define __NR_perf_event_open 241 ++#define __NR_accept4 242 ++#define __NR_recvmmsg 243 ++#define __NR_wait4 260 ++#define __NR_prlimit64 261 ++#define __NR_fanotify_init 262 ++#define __NR_fanotify_mark 263 ++#define __NR_name_to_handle_at 264 ++#define __NR_open_by_handle_at 265 ++#define __NR_clock_adjtime 266 ++#define __NR_syncfs 267 ++#define __NR_setns 268 ++#define __NR_sendmmsg 269 ++#define __NR_process_vm_readv 270 ++#define __NR_process_vm_writev 271 ++#define __NR_kcmp 272 ++#define __NR_finit_module 273 ++#define __NR_sched_setattr 274 ++#define __NR_sched_getattr 275 ++#define __NR_renameat2 276 ++#define __NR_seccomp 277 ++#define __NR_getrandom 278 ++#define __NR_memfd_create 279 ++#define __NR_bpf 280 ++#define __NR_execveat 281 ++#define __NR_userfaultfd 282 ++#define __NR_membarrier 283 ++#define __NR_mlock2 284 ++#define __NR_copy_file_range 285 ++#define __NR_preadv2 286 ++#define __NR_pwritev2 287 ++#define __NR_pkey_mprotect 288 ++#define __NR_pkey_alloc 289 ++#define __NR_pkey_free 290 ++#define __NR_statx 291 ++#define __NR_io_pgetevents 292 ++#define __NR_rseq 293 ++#define __NR_kexec_file_load 294 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_quotactl_fd 443 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 ++#define __NR_memfd_secret 447 ++#define __NR_process_mrelease 448 ++#define __NR_futex_waitv 449 ++#define __NR_set_mempolicy_home_node 450 ++#define __NR_cachestat 451 ++#define __NR_fchmodat2 452 ++#define __NR_map_shadow_stack 453 ++#define __NR_futex_wake 454 ++#define __NR_futex_wait 455 ++#define __NR_futex_requeue 456 ++#define __NR_statmount 457 ++#define __NR_listmount 458 ++#define __NR_lsm_get_self_attr 459 ++#define __NR_lsm_set_self_attr 460 ++#define __NR_lsm_list_modules 461 ++#define __NR_mseal 462 ++ ++ ++#endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h +index d983c48a3b..5bf6148cac 100644 +--- a/linux-headers/asm-generic/unistd.h ++++ b/linux-headers/asm-generic/unistd.h +@@ -737,7 +737,7 @@ __SC_COMP(__NR_pselect6_time64, sys_pselect6, compat_sys_pselect6_time64) + #define __NR_ppoll_time64 414 + __SC_COMP(__NR_ppoll_time64, sys_ppoll, compat_sys_ppoll_time64) + #define __NR_io_pgetevents_time64 416 +-__SYSCALL(__NR_io_pgetevents_time64, sys_io_pgetevents) ++__SC_COMP(__NR_io_pgetevents_time64, sys_io_pgetevents, compat_sys_io_pgetevents_time64) + #define __NR_recvmmsg_time64 417 + __SC_COMP(__NR_recvmmsg_time64, sys_recvmmsg, compat_sys_recvmmsg_time64) + #define __NR_mq_timedsend_time64 418 +@@ -776,12 +776,8 @@ __SYSCALL(__NR_fsmount, sys_fsmount) + __SYSCALL(__NR_fspick, sys_fspick) + #define __NR_pidfd_open 434 + __SYSCALL(__NR_pidfd_open, sys_pidfd_open) +- +-#ifdef __ARCH_WANT_SYS_CLONE3 + #define __NR_clone3 435 + __SYSCALL(__NR_clone3, sys_clone3) +-#endif +- + #define __NR_close_range 436 + __SYSCALL(__NR_close_range, sys_close_range) + #define __NR_openat2 437 +diff --git a/linux-headers/asm-loongarch/kvm.h b/linux-headers/asm-loongarch/kvm.h +index f9abef3823..70d89070bf 100644 +--- a/linux-headers/asm-loongarch/kvm.h ++++ b/linux-headers/asm-loongarch/kvm.h +@@ -64,6 +64,7 @@ struct kvm_fpu { + #define KVM_REG_LOONGARCH_KVM (KVM_REG_LOONGARCH | 0x20000ULL) + #define KVM_REG_LOONGARCH_FPSIMD (KVM_REG_LOONGARCH | 0x30000ULL) + #define KVM_REG_LOONGARCH_CPUCFG (KVM_REG_LOONGARCH | 0x40000ULL) ++#define KVM_REG_LOONGARCH_LBT (KVM_REG_LOONGARCH | 0x50000ULL) + #define KVM_REG_LOONGARCH_MASK (KVM_REG_LOONGARCH | 0x70000ULL) + #define KVM_CSR_IDX_MASK 0x7fff + #define KVM_CPUCFG_IDX_MASK 0x7fff +@@ -77,11 +78,34 @@ struct kvm_fpu { + /* Debugging: Special instruction for software breakpoint */ + #define KVM_REG_LOONGARCH_DEBUG_INST (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3) + ++/* LBT registers */ ++#define KVM_REG_LOONGARCH_LBT_SCR0 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 1) ++#define KVM_REG_LOONGARCH_LBT_SCR1 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 2) ++#define KVM_REG_LOONGARCH_LBT_SCR2 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 3) ++#define KVM_REG_LOONGARCH_LBT_SCR3 (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 4) ++#define KVM_REG_LOONGARCH_LBT_EFLAGS (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 5) ++#define KVM_REG_LOONGARCH_LBT_FTOP (KVM_REG_LOONGARCH_LBT | KVM_REG_SIZE_U64 | 6) ++ + #define LOONGARCH_REG_SHIFT 3 + #define LOONGARCH_REG_64(TYPE, REG) (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT)) + #define KVM_IOC_CSRID(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG) + #define KVM_IOC_CPUCFG(REG) LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG) ++ ++/* Device Control API on vm fd */ ++#define KVM_LOONGARCH_VM_FEAT_CTRL 0 ++#define KVM_LOONGARCH_VM_FEAT_LSX 0 ++#define KVM_LOONGARCH_VM_FEAT_LASX 1 ++#define KVM_LOONGARCH_VM_FEAT_X86BT 2 ++#define KVM_LOONGARCH_VM_FEAT_ARMBT 3 ++#define KVM_LOONGARCH_VM_FEAT_MIPSBT 4 ++#define KVM_LOONGARCH_VM_FEAT_PMU 5 ++#define KVM_LOONGARCH_VM_FEAT_PV_IPI 6 ++#define KVM_LOONGARCH_VM_FEAT_PV_STEALTIME 7 ++ ++/* Device Control API on vcpu fd */ + #define KVM_LOONGARCH_VCPU_CPUCFG 0 ++#define KVM_LOONGARCH_VCPU_PVTIME_CTRL 1 ++#define KVM_LOONGARCH_VCPU_PVTIME_GPA 0 + + struct kvm_debug_exit_arch { + }; +diff --git a/linux-headers/asm-loongarch/kvm_para.h b/linux-headers/asm-loongarch/kvm_para.h +new file mode 100644 +index 0000000000..4ba4ad8db1 +--- /dev/null ++++ b/linux-headers/asm-loongarch/kvm_para.h +@@ -0,0 +1,21 @@ ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++#ifndef _ASM_KVM_PARA_H ++#define _ASM_KVM_PARA_H ++ ++#include ++ ++/* ++ * CPUCFG index area: 0x40000000 -- 0x400000ff ++ * SW emulation for KVM hypervirsor ++ */ ++#define CPUCFG_KVM_BASE 0x40000000 ++#define CPUCFG_KVM_SIZE 0x100 ++#define CPUCFG_KVM_SIG (CPUCFG_KVM_BASE + 0) ++#define KVM_SIGNATURE "KVM\0" ++#define CPUCFG_KVM_FEATURE (CPUCFG_KVM_BASE + 4) ++#define KVM_FEATURE_IPI 1 ++#define KVM_FEATURE_STEAL_TIME 2 ++/* BIT 24 - 31 are features configurable by user space vmm */ ++#define KVM_FEATURE_VIRT_EXTIOI 24 ++ ++#endif /* _ASM_KVM_PARA_H */ +diff --git a/linux-headers/asm-loongarch/unistd.h b/linux-headers/asm-loongarch/unistd.h +index fcb668984f..1f01980f9c 100644 +--- a/linux-headers/asm-loongarch/unistd.h ++++ b/linux-headers/asm-loongarch/unistd.h +@@ -1,5 +1,3 @@ + /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +-#define __ARCH_WANT_SYS_CLONE +-#define __ARCH_WANT_SYS_CLONE3 + +-#include ++#include +diff --git a/linux-headers/asm-loongarch/unistd_64.h b/linux-headers/asm-loongarch/unistd_64.h +new file mode 100644 +index 0000000000..887ea50cca +--- /dev/null ++++ b/linux-headers/asm-loongarch/unistd_64.h +@@ -0,0 +1,320 @@ ++#ifndef _ASM_UNISTD_64_H ++#define _ASM_UNISTD_64_H ++ ++#define __NR_io_setup 0 ++#define __NR_io_destroy 1 ++#define __NR_io_submit 2 ++#define __NR_io_cancel 3 ++#define __NR_io_getevents 4 ++#define __NR_setxattr 5 ++#define __NR_lsetxattr 6 ++#define __NR_fsetxattr 7 ++#define __NR_getxattr 8 ++#define __NR_lgetxattr 9 ++#define __NR_fgetxattr 10 ++#define __NR_listxattr 11 ++#define __NR_llistxattr 12 ++#define __NR_flistxattr 13 ++#define __NR_removexattr 14 ++#define __NR_lremovexattr 15 ++#define __NR_fremovexattr 16 ++#define __NR_getcwd 17 ++#define __NR_lookup_dcookie 18 ++#define __NR_eventfd2 19 ++#define __NR_epoll_create1 20 ++#define __NR_epoll_ctl 21 ++#define __NR_epoll_pwait 22 ++#define __NR_dup 23 ++#define __NR_dup3 24 ++#define __NR_fcntl 25 ++#define __NR_inotify_init1 26 ++#define __NR_inotify_add_watch 27 ++#define __NR_inotify_rm_watch 28 ++#define __NR_ioctl 29 ++#define __NR_ioprio_set 30 ++#define __NR_ioprio_get 31 ++#define __NR_flock 32 ++#define __NR_mknodat 33 ++#define __NR_mkdirat 34 ++#define __NR_unlinkat 35 ++#define __NR_symlinkat 36 ++#define __NR_linkat 37 ++#define __NR_umount2 39 ++#define __NR_mount 40 ++#define __NR_pivot_root 41 ++#define __NR_nfsservctl 42 ++#define __NR_statfs 43 ++#define __NR_fstatfs 44 ++#define __NR_truncate 45 ++#define __NR_ftruncate 46 ++#define __NR_fallocate 47 ++#define __NR_faccessat 48 ++#define __NR_chdir 49 ++#define __NR_fchdir 50 ++#define __NR_chroot 51 ++#define __NR_fchmod 52 ++#define __NR_fchmodat 53 ++#define __NR_fchownat 54 ++#define __NR_fchown 55 ++#define __NR_openat 56 ++#define __NR_close 57 ++#define __NR_vhangup 58 ++#define __NR_pipe2 59 ++#define __NR_quotactl 60 ++#define __NR_getdents64 61 ++#define __NR_lseek 62 ++#define __NR_read 63 ++#define __NR_write 64 ++#define __NR_readv 65 ++#define __NR_writev 66 ++#define __NR_pread64 67 ++#define __NR_pwrite64 68 ++#define __NR_preadv 69 ++#define __NR_pwritev 70 ++#define __NR_sendfile 71 ++#define __NR_pselect6 72 ++#define __NR_ppoll 73 ++#define __NR_signalfd4 74 ++#define __NR_vmsplice 75 ++#define __NR_splice 76 ++#define __NR_tee 77 ++#define __NR_readlinkat 78 ++#define __NR_newfstatat 79 ++#define __NR_fstat 80 ++#define __NR_sync 81 ++#define __NR_fsync 82 ++#define __NR_fdatasync 83 ++#define __NR_sync_file_range 84 ++#define __NR_timerfd_create 85 ++#define __NR_timerfd_settime 86 ++#define __NR_timerfd_gettime 87 ++#define __NR_utimensat 88 ++#define __NR_acct 89 ++#define __NR_capget 90 ++#define __NR_capset 91 ++#define __NR_personality 92 ++#define __NR_exit 93 ++#define __NR_exit_group 94 ++#define __NR_waitid 95 ++#define __NR_set_tid_address 96 ++#define __NR_unshare 97 ++#define __NR_futex 98 ++#define __NR_set_robust_list 99 ++#define __NR_get_robust_list 100 ++#define __NR_nanosleep 101 ++#define __NR_getitimer 102 ++#define __NR_setitimer 103 ++#define __NR_kexec_load 104 ++#define __NR_init_module 105 ++#define __NR_delete_module 106 ++#define __NR_timer_create 107 ++#define __NR_timer_gettime 108 ++#define __NR_timer_getoverrun 109 ++#define __NR_timer_settime 110 ++#define __NR_timer_delete 111 ++#define __NR_clock_settime 112 ++#define __NR_clock_gettime 113 ++#define __NR_clock_getres 114 ++#define __NR_clock_nanosleep 115 ++#define __NR_syslog 116 ++#define __NR_ptrace 117 ++#define __NR_sched_setparam 118 ++#define __NR_sched_setscheduler 119 ++#define __NR_sched_getscheduler 120 ++#define __NR_sched_getparam 121 ++#define __NR_sched_setaffinity 122 ++#define __NR_sched_getaffinity 123 ++#define __NR_sched_yield 124 ++#define __NR_sched_get_priority_max 125 ++#define __NR_sched_get_priority_min 126 ++#define __NR_sched_rr_get_interval 127 ++#define __NR_restart_syscall 128 ++#define __NR_kill 129 ++#define __NR_tkill 130 ++#define __NR_tgkill 131 ++#define __NR_sigaltstack 132 ++#define __NR_rt_sigsuspend 133 ++#define __NR_rt_sigaction 134 ++#define __NR_rt_sigprocmask 135 ++#define __NR_rt_sigpending 136 ++#define __NR_rt_sigtimedwait 137 ++#define __NR_rt_sigqueueinfo 138 ++#define __NR_rt_sigreturn 139 ++#define __NR_setpriority 140 ++#define __NR_getpriority 141 ++#define __NR_reboot 142 ++#define __NR_setregid 143 ++#define __NR_setgid 144 ++#define __NR_setreuid 145 ++#define __NR_setuid 146 ++#define __NR_setresuid 147 ++#define __NR_getresuid 148 ++#define __NR_setresgid 149 ++#define __NR_getresgid 150 ++#define __NR_setfsuid 151 ++#define __NR_setfsgid 152 ++#define __NR_times 153 ++#define __NR_setpgid 154 ++#define __NR_getpgid 155 ++#define __NR_getsid 156 ++#define __NR_setsid 157 ++#define __NR_getgroups 158 ++#define __NR_setgroups 159 ++#define __NR_uname 160 ++#define __NR_sethostname 161 ++#define __NR_setdomainname 162 ++#define __NR_getrusage 165 ++#define __NR_umask 166 ++#define __NR_prctl 167 ++#define __NR_getcpu 168 ++#define __NR_gettimeofday 169 ++#define __NR_settimeofday 170 ++#define __NR_adjtimex 171 ++#define __NR_getpid 172 ++#define __NR_getppid 173 ++#define __NR_getuid 174 ++#define __NR_geteuid 175 ++#define __NR_getgid 176 ++#define __NR_getegid 177 ++#define __NR_gettid 178 ++#define __NR_sysinfo 179 ++#define __NR_mq_open 180 ++#define __NR_mq_unlink 181 ++#define __NR_mq_timedsend 182 ++#define __NR_mq_timedreceive 183 ++#define __NR_mq_notify 184 ++#define __NR_mq_getsetattr 185 ++#define __NR_msgget 186 ++#define __NR_msgctl 187 ++#define __NR_msgrcv 188 ++#define __NR_msgsnd 189 ++#define __NR_semget 190 ++#define __NR_semctl 191 ++#define __NR_semtimedop 192 ++#define __NR_semop 193 ++#define __NR_shmget 194 ++#define __NR_shmctl 195 ++#define __NR_shmat 196 ++#define __NR_shmdt 197 ++#define __NR_socket 198 ++#define __NR_socketpair 199 ++#define __NR_bind 200 ++#define __NR_listen 201 ++#define __NR_accept 202 ++#define __NR_connect 203 ++#define __NR_getsockname 204 ++#define __NR_getpeername 205 ++#define __NR_sendto 206 ++#define __NR_recvfrom 207 ++#define __NR_setsockopt 208 ++#define __NR_getsockopt 209 ++#define __NR_shutdown 210 ++#define __NR_sendmsg 211 ++#define __NR_recvmsg 212 ++#define __NR_readahead 213 ++#define __NR_brk 214 ++#define __NR_munmap 215 ++#define __NR_mremap 216 ++#define __NR_add_key 217 ++#define __NR_request_key 218 ++#define __NR_keyctl 219 ++#define __NR_clone 220 ++#define __NR_execve 221 ++#define __NR_mmap 222 ++#define __NR_fadvise64 223 ++#define __NR_swapon 224 ++#define __NR_swapoff 225 ++#define __NR_mprotect 226 ++#define __NR_msync 227 ++#define __NR_mlock 228 ++#define __NR_munlock 229 ++#define __NR_mlockall 230 ++#define __NR_munlockall 231 ++#define __NR_mincore 232 ++#define __NR_madvise 233 ++#define __NR_remap_file_pages 234 ++#define __NR_mbind 235 ++#define __NR_get_mempolicy 236 ++#define __NR_set_mempolicy 237 ++#define __NR_migrate_pages 238 ++#define __NR_move_pages 239 ++#define __NR_rt_tgsigqueueinfo 240 ++#define __NR_perf_event_open 241 ++#define __NR_accept4 242 ++#define __NR_recvmmsg 243 ++#define __NR_wait4 260 ++#define __NR_prlimit64 261 ++#define __NR_fanotify_init 262 ++#define __NR_fanotify_mark 263 ++#define __NR_name_to_handle_at 264 ++#define __NR_open_by_handle_at 265 ++#define __NR_clock_adjtime 266 ++#define __NR_syncfs 267 ++#define __NR_setns 268 ++#define __NR_sendmmsg 269 ++#define __NR_process_vm_readv 270 ++#define __NR_process_vm_writev 271 ++#define __NR_kcmp 272 ++#define __NR_finit_module 273 ++#define __NR_sched_setattr 274 ++#define __NR_sched_getattr 275 ++#define __NR_renameat2 276 ++#define __NR_seccomp 277 ++#define __NR_getrandom 278 ++#define __NR_memfd_create 279 ++#define __NR_bpf 280 ++#define __NR_execveat 281 ++#define __NR_userfaultfd 282 ++#define __NR_membarrier 283 ++#define __NR_mlock2 284 ++#define __NR_copy_file_range 285 ++#define __NR_preadv2 286 ++#define __NR_pwritev2 287 ++#define __NR_pkey_mprotect 288 ++#define __NR_pkey_alloc 289 ++#define __NR_pkey_free 290 ++#define __NR_statx 291 ++#define __NR_io_pgetevents 292 ++#define __NR_rseq 293 ++#define __NR_kexec_file_load 294 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_quotactl_fd 443 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 ++#define __NR_process_mrelease 448 ++#define __NR_futex_waitv 449 ++#define __NR_set_mempolicy_home_node 450 ++#define __NR_cachestat 451 ++#define __NR_fchmodat2 452 ++#define __NR_map_shadow_stack 453 ++#define __NR_futex_wake 454 ++#define __NR_futex_wait 455 ++#define __NR_futex_requeue 456 ++#define __NR_statmount 457 ++#define __NR_listmount 458 ++#define __NR_lsm_get_self_attr 459 ++#define __NR_lsm_set_self_attr 460 ++#define __NR_lsm_list_modules 461 ++#define __NR_mseal 462 ++ ++ ++#endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h +index e878e7cc39..e97db32964 100644 +--- a/linux-headers/asm-riscv/kvm.h ++++ b/linux-headers/asm-riscv/kvm.h +@@ -168,6 +168,13 @@ enum KVM_RISCV_ISA_EXT_ID { + KVM_RISCV_ISA_EXT_ZTSO, + KVM_RISCV_ISA_EXT_ZACAS, + KVM_RISCV_ISA_EXT_SSCOFPMF, ++ KVM_RISCV_ISA_EXT_ZIMOP, ++ KVM_RISCV_ISA_EXT_ZCA, ++ KVM_RISCV_ISA_EXT_ZCB, ++ KVM_RISCV_ISA_EXT_ZCD, ++ KVM_RISCV_ISA_EXT_ZCF, ++ KVM_RISCV_ISA_EXT_ZCMOP, ++ KVM_RISCV_ISA_EXT_ZAWRS, + KVM_RISCV_ISA_EXT_MAX, + }; + +diff --git a/linux-headers/asm-riscv/unistd.h b/linux-headers/asm-riscv/unistd.h +index 950ab3fd44..81896bbbf7 100644 +--- a/linux-headers/asm-riscv/unistd.h ++++ b/linux-headers/asm-riscv/unistd.h +@@ -14,41 +14,10 @@ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ ++#include + +-#if defined(__LP64__) && !defined(__SYSCALL_COMPAT) +-#define __ARCH_WANT_NEW_STAT +-#define __ARCH_WANT_SET_GET_RLIMIT +-#endif /* __LP64__ */ +- +-#define __ARCH_WANT_SYS_CLONE3 +-#define __ARCH_WANT_MEMFD_SECRET +- +-#include +- +-/* +- * Allows the instruction cache to be flushed from userspace. Despite RISC-V +- * having a direct 'fence.i' instruction available to userspace (which we +- * can't trap!), that's not actually viable when running on Linux because the +- * kernel might schedule a process on another hart. There is no way for +- * userspace to handle this without invoking the kernel (as it doesn't know the +- * thread->hart mappings), so we've defined a RISC-V specific system call to +- * flush the instruction cache. +- * +- * __NR_riscv_flush_icache is defined to flush the instruction cache over an +- * address range, with the flush applying to either all threads or just the +- * caller. We don't currently do anything with the address range, that's just +- * in there for forwards compatibility. +- */ +-#ifndef __NR_riscv_flush_icache +-#define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) +-#endif +-__SYSCALL(__NR_riscv_flush_icache, sys_riscv_flush_icache) +- +-/* +- * Allows userspace to query the kernel for CPU architecture and +- * microarchitecture details across a given set of CPUs. +- */ +-#ifndef __NR_riscv_hwprobe +-#define __NR_riscv_hwprobe (__NR_arch_specific_syscall + 14) ++#if __BITS_PER_LONG == 64 ++#include ++#else ++#include + #endif +-__SYSCALL(__NR_riscv_hwprobe, sys_riscv_hwprobe) +diff --git a/linux-headers/asm-riscv/unistd_32.h b/linux-headers/asm-riscv/unistd_32.h +new file mode 100644 +index 0000000000..9625743dfd +--- /dev/null ++++ b/linux-headers/asm-riscv/unistd_32.h +@@ -0,0 +1,315 @@ ++#ifndef _ASM_UNISTD_32_H ++#define _ASM_UNISTD_32_H ++ ++#define __NR_io_setup 0 ++#define __NR_io_destroy 1 ++#define __NR_io_submit 2 ++#define __NR_io_cancel 3 ++#define __NR_setxattr 5 ++#define __NR_lsetxattr 6 ++#define __NR_fsetxattr 7 ++#define __NR_getxattr 8 ++#define __NR_lgetxattr 9 ++#define __NR_fgetxattr 10 ++#define __NR_listxattr 11 ++#define __NR_llistxattr 12 ++#define __NR_flistxattr 13 ++#define __NR_removexattr 14 ++#define __NR_lremovexattr 15 ++#define __NR_fremovexattr 16 ++#define __NR_getcwd 17 ++#define __NR_lookup_dcookie 18 ++#define __NR_eventfd2 19 ++#define __NR_epoll_create1 20 ++#define __NR_epoll_ctl 21 ++#define __NR_epoll_pwait 22 ++#define __NR_dup 23 ++#define __NR_dup3 24 ++#define __NR_fcntl64 25 ++#define __NR_inotify_init1 26 ++#define __NR_inotify_add_watch 27 ++#define __NR_inotify_rm_watch 28 ++#define __NR_ioctl 29 ++#define __NR_ioprio_set 30 ++#define __NR_ioprio_get 31 ++#define __NR_flock 32 ++#define __NR_mknodat 33 ++#define __NR_mkdirat 34 ++#define __NR_unlinkat 35 ++#define __NR_symlinkat 36 ++#define __NR_linkat 37 ++#define __NR_umount2 39 ++#define __NR_mount 40 ++#define __NR_pivot_root 41 ++#define __NR_nfsservctl 42 ++#define __NR_statfs64 43 ++#define __NR_fstatfs64 44 ++#define __NR_truncate64 45 ++#define __NR_ftruncate64 46 ++#define __NR_fallocate 47 ++#define __NR_faccessat 48 ++#define __NR_chdir 49 ++#define __NR_fchdir 50 ++#define __NR_chroot 51 ++#define __NR_fchmod 52 ++#define __NR_fchmodat 53 ++#define __NR_fchownat 54 ++#define __NR_fchown 55 ++#define __NR_openat 56 ++#define __NR_close 57 ++#define __NR_vhangup 58 ++#define __NR_pipe2 59 ++#define __NR_quotactl 60 ++#define __NR_getdents64 61 ++#define __NR_llseek 62 ++#define __NR_read 63 ++#define __NR_write 64 ++#define __NR_readv 65 ++#define __NR_writev 66 ++#define __NR_pread64 67 ++#define __NR_pwrite64 68 ++#define __NR_preadv 69 ++#define __NR_pwritev 70 ++#define __NR_sendfile64 71 ++#define __NR_signalfd4 74 ++#define __NR_vmsplice 75 ++#define __NR_splice 76 ++#define __NR_tee 77 ++#define __NR_readlinkat 78 ++#define __NR_sync 81 ++#define __NR_fsync 82 ++#define __NR_fdatasync 83 ++#define __NR_sync_file_range 84 ++#define __NR_timerfd_create 85 ++#define __NR_acct 89 ++#define __NR_capget 90 ++#define __NR_capset 91 ++#define __NR_personality 92 ++#define __NR_exit 93 ++#define __NR_exit_group 94 ++#define __NR_waitid 95 ++#define __NR_set_tid_address 96 ++#define __NR_unshare 97 ++#define __NR_set_robust_list 99 ++#define __NR_get_robust_list 100 ++#define __NR_getitimer 102 ++#define __NR_setitimer 103 ++#define __NR_kexec_load 104 ++#define __NR_init_module 105 ++#define __NR_delete_module 106 ++#define __NR_timer_create 107 ++#define __NR_timer_getoverrun 109 ++#define __NR_timer_delete 111 ++#define __NR_syslog 116 ++#define __NR_ptrace 117 ++#define __NR_sched_setparam 118 ++#define __NR_sched_setscheduler 119 ++#define __NR_sched_getscheduler 120 ++#define __NR_sched_getparam 121 ++#define __NR_sched_setaffinity 122 ++#define __NR_sched_getaffinity 123 ++#define __NR_sched_yield 124 ++#define __NR_sched_get_priority_max 125 ++#define __NR_sched_get_priority_min 126 ++#define __NR_restart_syscall 128 ++#define __NR_kill 129 ++#define __NR_tkill 130 ++#define __NR_tgkill 131 ++#define __NR_sigaltstack 132 ++#define __NR_rt_sigsuspend 133 ++#define __NR_rt_sigaction 134 ++#define __NR_rt_sigprocmask 135 ++#define __NR_rt_sigpending 136 ++#define __NR_rt_sigqueueinfo 138 ++#define __NR_rt_sigreturn 139 ++#define __NR_setpriority 140 ++#define __NR_getpriority 141 ++#define __NR_reboot 142 ++#define __NR_setregid 143 ++#define __NR_setgid 144 ++#define __NR_setreuid 145 ++#define __NR_setuid 146 ++#define __NR_setresuid 147 ++#define __NR_getresuid 148 ++#define __NR_setresgid 149 ++#define __NR_getresgid 150 ++#define __NR_setfsuid 151 ++#define __NR_setfsgid 152 ++#define __NR_times 153 ++#define __NR_setpgid 154 ++#define __NR_getpgid 155 ++#define __NR_getsid 156 ++#define __NR_setsid 157 ++#define __NR_getgroups 158 ++#define __NR_setgroups 159 ++#define __NR_uname 160 ++#define __NR_sethostname 161 ++#define __NR_setdomainname 162 ++#define __NR_getrusage 165 ++#define __NR_umask 166 ++#define __NR_prctl 167 ++#define __NR_getcpu 168 ++#define __NR_getpid 172 ++#define __NR_getppid 173 ++#define __NR_getuid 174 ++#define __NR_geteuid 175 ++#define __NR_getgid 176 ++#define __NR_getegid 177 ++#define __NR_gettid 178 ++#define __NR_sysinfo 179 ++#define __NR_mq_open 180 ++#define __NR_mq_unlink 181 ++#define __NR_mq_notify 184 ++#define __NR_mq_getsetattr 185 ++#define __NR_msgget 186 ++#define __NR_msgctl 187 ++#define __NR_msgrcv 188 ++#define __NR_msgsnd 189 ++#define __NR_semget 190 ++#define __NR_semctl 191 ++#define __NR_semop 193 ++#define __NR_shmget 194 ++#define __NR_shmctl 195 ++#define __NR_shmat 196 ++#define __NR_shmdt 197 ++#define __NR_socket 198 ++#define __NR_socketpair 199 ++#define __NR_bind 200 ++#define __NR_listen 201 ++#define __NR_accept 202 ++#define __NR_connect 203 ++#define __NR_getsockname 204 ++#define __NR_getpeername 205 ++#define __NR_sendto 206 ++#define __NR_recvfrom 207 ++#define __NR_setsockopt 208 ++#define __NR_getsockopt 209 ++#define __NR_shutdown 210 ++#define __NR_sendmsg 211 ++#define __NR_recvmsg 212 ++#define __NR_readahead 213 ++#define __NR_brk 214 ++#define __NR_munmap 215 ++#define __NR_mremap 216 ++#define __NR_add_key 217 ++#define __NR_request_key 218 ++#define __NR_keyctl 219 ++#define __NR_clone 220 ++#define __NR_execve 221 ++#define __NR_mmap2 222 ++#define __NR_fadvise64_64 223 ++#define __NR_swapon 224 ++#define __NR_swapoff 225 ++#define __NR_mprotect 226 ++#define __NR_msync 227 ++#define __NR_mlock 228 ++#define __NR_munlock 229 ++#define __NR_mlockall 230 ++#define __NR_munlockall 231 ++#define __NR_mincore 232 ++#define __NR_madvise 233 ++#define __NR_remap_file_pages 234 ++#define __NR_mbind 235 ++#define __NR_get_mempolicy 236 ++#define __NR_set_mempolicy 237 ++#define __NR_migrate_pages 238 ++#define __NR_move_pages 239 ++#define __NR_rt_tgsigqueueinfo 240 ++#define __NR_perf_event_open 241 ++#define __NR_accept4 242 ++#define __NR_riscv_hwprobe 258 ++#define __NR_riscv_flush_icache 259 ++#define __NR_prlimit64 261 ++#define __NR_fanotify_init 262 ++#define __NR_fanotify_mark 263 ++#define __NR_name_to_handle_at 264 ++#define __NR_open_by_handle_at 265 ++#define __NR_syncfs 267 ++#define __NR_setns 268 ++#define __NR_sendmmsg 269 ++#define __NR_process_vm_readv 270 ++#define __NR_process_vm_writev 271 ++#define __NR_kcmp 272 ++#define __NR_finit_module 273 ++#define __NR_sched_setattr 274 ++#define __NR_sched_getattr 275 ++#define __NR_renameat2 276 ++#define __NR_seccomp 277 ++#define __NR_getrandom 278 ++#define __NR_memfd_create 279 ++#define __NR_bpf 280 ++#define __NR_execveat 281 ++#define __NR_userfaultfd 282 ++#define __NR_membarrier 283 ++#define __NR_mlock2 284 ++#define __NR_copy_file_range 285 ++#define __NR_preadv2 286 ++#define __NR_pwritev2 287 ++#define __NR_pkey_mprotect 288 ++#define __NR_pkey_alloc 289 ++#define __NR_pkey_free 290 ++#define __NR_statx 291 ++#define __NR_rseq 293 ++#define __NR_kexec_file_load 294 ++#define __NR_clock_gettime64 403 ++#define __NR_clock_settime64 404 ++#define __NR_clock_adjtime64 405 ++#define __NR_clock_getres_time64 406 ++#define __NR_clock_nanosleep_time64 407 ++#define __NR_timer_gettime64 408 ++#define __NR_timer_settime64 409 ++#define __NR_timerfd_gettime64 410 ++#define __NR_timerfd_settime64 411 ++#define __NR_utimensat_time64 412 ++#define __NR_pselect6_time64 413 ++#define __NR_ppoll_time64 414 ++#define __NR_io_pgetevents_time64 416 ++#define __NR_recvmmsg_time64 417 ++#define __NR_mq_timedsend_time64 418 ++#define __NR_mq_timedreceive_time64 419 ++#define __NR_semtimedop_time64 420 ++#define __NR_rt_sigtimedwait_time64 421 ++#define __NR_futex_time64 422 ++#define __NR_sched_rr_get_interval_time64 423 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_quotactl_fd 443 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 ++#define __NR_memfd_secret 447 ++#define __NR_process_mrelease 448 ++#define __NR_futex_waitv 449 ++#define __NR_set_mempolicy_home_node 450 ++#define __NR_cachestat 451 ++#define __NR_fchmodat2 452 ++#define __NR_map_shadow_stack 453 ++#define __NR_futex_wake 454 ++#define __NR_futex_wait 455 ++#define __NR_futex_requeue 456 ++#define __NR_statmount 457 ++#define __NR_listmount 458 ++#define __NR_lsm_get_self_attr 459 ++#define __NR_lsm_set_self_attr 460 ++#define __NR_lsm_list_modules 461 ++#define __NR_mseal 462 ++ ++ ++#endif /* _ASM_UNISTD_32_H */ +diff --git a/linux-headers/asm-riscv/unistd_64.h b/linux-headers/asm-riscv/unistd_64.h +new file mode 100644 +index 0000000000..95bca8ae81 +--- /dev/null ++++ b/linux-headers/asm-riscv/unistd_64.h +@@ -0,0 +1,325 @@ ++#ifndef _ASM_UNISTD_64_H ++#define _ASM_UNISTD_64_H ++ ++#define __NR_io_setup 0 ++#define __NR_io_destroy 1 ++#define __NR_io_submit 2 ++#define __NR_io_cancel 3 ++#define __NR_io_getevents 4 ++#define __NR_setxattr 5 ++#define __NR_lsetxattr 6 ++#define __NR_fsetxattr 7 ++#define __NR_getxattr 8 ++#define __NR_lgetxattr 9 ++#define __NR_fgetxattr 10 ++#define __NR_listxattr 11 ++#define __NR_llistxattr 12 ++#define __NR_flistxattr 13 ++#define __NR_removexattr 14 ++#define __NR_lremovexattr 15 ++#define __NR_fremovexattr 16 ++#define __NR_getcwd 17 ++#define __NR_lookup_dcookie 18 ++#define __NR_eventfd2 19 ++#define __NR_epoll_create1 20 ++#define __NR_epoll_ctl 21 ++#define __NR_epoll_pwait 22 ++#define __NR_dup 23 ++#define __NR_dup3 24 ++#define __NR_fcntl 25 ++#define __NR_inotify_init1 26 ++#define __NR_inotify_add_watch 27 ++#define __NR_inotify_rm_watch 28 ++#define __NR_ioctl 29 ++#define __NR_ioprio_set 30 ++#define __NR_ioprio_get 31 ++#define __NR_flock 32 ++#define __NR_mknodat 33 ++#define __NR_mkdirat 34 ++#define __NR_unlinkat 35 ++#define __NR_symlinkat 36 ++#define __NR_linkat 37 ++#define __NR_umount2 39 ++#define __NR_mount 40 ++#define __NR_pivot_root 41 ++#define __NR_nfsservctl 42 ++#define __NR_statfs 43 ++#define __NR_fstatfs 44 ++#define __NR_truncate 45 ++#define __NR_ftruncate 46 ++#define __NR_fallocate 47 ++#define __NR_faccessat 48 ++#define __NR_chdir 49 ++#define __NR_fchdir 50 ++#define __NR_chroot 51 ++#define __NR_fchmod 52 ++#define __NR_fchmodat 53 ++#define __NR_fchownat 54 ++#define __NR_fchown 55 ++#define __NR_openat 56 ++#define __NR_close 57 ++#define __NR_vhangup 58 ++#define __NR_pipe2 59 ++#define __NR_quotactl 60 ++#define __NR_getdents64 61 ++#define __NR_lseek 62 ++#define __NR_read 63 ++#define __NR_write 64 ++#define __NR_readv 65 ++#define __NR_writev 66 ++#define __NR_pread64 67 ++#define __NR_pwrite64 68 ++#define __NR_preadv 69 ++#define __NR_pwritev 70 ++#define __NR_sendfile 71 ++#define __NR_pselect6 72 ++#define __NR_ppoll 73 ++#define __NR_signalfd4 74 ++#define __NR_vmsplice 75 ++#define __NR_splice 76 ++#define __NR_tee 77 ++#define __NR_readlinkat 78 ++#define __NR_newfstatat 79 ++#define __NR_fstat 80 ++#define __NR_sync 81 ++#define __NR_fsync 82 ++#define __NR_fdatasync 83 ++#define __NR_sync_file_range 84 ++#define __NR_timerfd_create 85 ++#define __NR_timerfd_settime 86 ++#define __NR_timerfd_gettime 87 ++#define __NR_utimensat 88 ++#define __NR_acct 89 ++#define __NR_capget 90 ++#define __NR_capset 91 ++#define __NR_personality 92 ++#define __NR_exit 93 ++#define __NR_exit_group 94 ++#define __NR_waitid 95 ++#define __NR_set_tid_address 96 ++#define __NR_unshare 97 ++#define __NR_futex 98 ++#define __NR_set_robust_list 99 ++#define __NR_get_robust_list 100 ++#define __NR_nanosleep 101 ++#define __NR_getitimer 102 ++#define __NR_setitimer 103 ++#define __NR_kexec_load 104 ++#define __NR_init_module 105 ++#define __NR_delete_module 106 ++#define __NR_timer_create 107 ++#define __NR_timer_gettime 108 ++#define __NR_timer_getoverrun 109 ++#define __NR_timer_settime 110 ++#define __NR_timer_delete 111 ++#define __NR_clock_settime 112 ++#define __NR_clock_gettime 113 ++#define __NR_clock_getres 114 ++#define __NR_clock_nanosleep 115 ++#define __NR_syslog 116 ++#define __NR_ptrace 117 ++#define __NR_sched_setparam 118 ++#define __NR_sched_setscheduler 119 ++#define __NR_sched_getscheduler 120 ++#define __NR_sched_getparam 121 ++#define __NR_sched_setaffinity 122 ++#define __NR_sched_getaffinity 123 ++#define __NR_sched_yield 124 ++#define __NR_sched_get_priority_max 125 ++#define __NR_sched_get_priority_min 126 ++#define __NR_sched_rr_get_interval 127 ++#define __NR_restart_syscall 128 ++#define __NR_kill 129 ++#define __NR_tkill 130 ++#define __NR_tgkill 131 ++#define __NR_sigaltstack 132 ++#define __NR_rt_sigsuspend 133 ++#define __NR_rt_sigaction 134 ++#define __NR_rt_sigprocmask 135 ++#define __NR_rt_sigpending 136 ++#define __NR_rt_sigtimedwait 137 ++#define __NR_rt_sigqueueinfo 138 ++#define __NR_rt_sigreturn 139 ++#define __NR_setpriority 140 ++#define __NR_getpriority 141 ++#define __NR_reboot 142 ++#define __NR_setregid 143 ++#define __NR_setgid 144 ++#define __NR_setreuid 145 ++#define __NR_setuid 146 ++#define __NR_setresuid 147 ++#define __NR_getresuid 148 ++#define __NR_setresgid 149 ++#define __NR_getresgid 150 ++#define __NR_setfsuid 151 ++#define __NR_setfsgid 152 ++#define __NR_times 153 ++#define __NR_setpgid 154 ++#define __NR_getpgid 155 ++#define __NR_getsid 156 ++#define __NR_setsid 157 ++#define __NR_getgroups 158 ++#define __NR_setgroups 159 ++#define __NR_uname 160 ++#define __NR_sethostname 161 ++#define __NR_setdomainname 162 ++#define __NR_getrlimit 163 ++#define __NR_setrlimit 164 ++#define __NR_getrusage 165 ++#define __NR_umask 166 ++#define __NR_prctl 167 ++#define __NR_getcpu 168 ++#define __NR_gettimeofday 169 ++#define __NR_settimeofday 170 ++#define __NR_adjtimex 171 ++#define __NR_getpid 172 ++#define __NR_getppid 173 ++#define __NR_getuid 174 ++#define __NR_geteuid 175 ++#define __NR_getgid 176 ++#define __NR_getegid 177 ++#define __NR_gettid 178 ++#define __NR_sysinfo 179 ++#define __NR_mq_open 180 ++#define __NR_mq_unlink 181 ++#define __NR_mq_timedsend 182 ++#define __NR_mq_timedreceive 183 ++#define __NR_mq_notify 184 ++#define __NR_mq_getsetattr 185 ++#define __NR_msgget 186 ++#define __NR_msgctl 187 ++#define __NR_msgrcv 188 ++#define __NR_msgsnd 189 ++#define __NR_semget 190 ++#define __NR_semctl 191 ++#define __NR_semtimedop 192 ++#define __NR_semop 193 ++#define __NR_shmget 194 ++#define __NR_shmctl 195 ++#define __NR_shmat 196 ++#define __NR_shmdt 197 ++#define __NR_socket 198 ++#define __NR_socketpair 199 ++#define __NR_bind 200 ++#define __NR_listen 201 ++#define __NR_accept 202 ++#define __NR_connect 203 ++#define __NR_getsockname 204 ++#define __NR_getpeername 205 ++#define __NR_sendto 206 ++#define __NR_recvfrom 207 ++#define __NR_setsockopt 208 ++#define __NR_getsockopt 209 ++#define __NR_shutdown 210 ++#define __NR_sendmsg 211 ++#define __NR_recvmsg 212 ++#define __NR_readahead 213 ++#define __NR_brk 214 ++#define __NR_munmap 215 ++#define __NR_mremap 216 ++#define __NR_add_key 217 ++#define __NR_request_key 218 ++#define __NR_keyctl 219 ++#define __NR_clone 220 ++#define __NR_execve 221 ++#define __NR_mmap 222 ++#define __NR_fadvise64 223 ++#define __NR_swapon 224 ++#define __NR_swapoff 225 ++#define __NR_mprotect 226 ++#define __NR_msync 227 ++#define __NR_mlock 228 ++#define __NR_munlock 229 ++#define __NR_mlockall 230 ++#define __NR_munlockall 231 ++#define __NR_mincore 232 ++#define __NR_madvise 233 ++#define __NR_remap_file_pages 234 ++#define __NR_mbind 235 ++#define __NR_get_mempolicy 236 ++#define __NR_set_mempolicy 237 ++#define __NR_migrate_pages 238 ++#define __NR_move_pages 239 ++#define __NR_rt_tgsigqueueinfo 240 ++#define __NR_perf_event_open 241 ++#define __NR_accept4 242 ++#define __NR_recvmmsg 243 ++#define __NR_riscv_hwprobe 258 ++#define __NR_riscv_flush_icache 259 ++#define __NR_wait4 260 ++#define __NR_prlimit64 261 ++#define __NR_fanotify_init 262 ++#define __NR_fanotify_mark 263 ++#define __NR_name_to_handle_at 264 ++#define __NR_open_by_handle_at 265 ++#define __NR_clock_adjtime 266 ++#define __NR_syncfs 267 ++#define __NR_setns 268 ++#define __NR_sendmmsg 269 ++#define __NR_process_vm_readv 270 ++#define __NR_process_vm_writev 271 ++#define __NR_kcmp 272 ++#define __NR_finit_module 273 ++#define __NR_sched_setattr 274 ++#define __NR_sched_getattr 275 ++#define __NR_renameat2 276 ++#define __NR_seccomp 277 ++#define __NR_getrandom 278 ++#define __NR_memfd_create 279 ++#define __NR_bpf 280 ++#define __NR_execveat 281 ++#define __NR_userfaultfd 282 ++#define __NR_membarrier 283 ++#define __NR_mlock2 284 ++#define __NR_copy_file_range 285 ++#define __NR_preadv2 286 ++#define __NR_pwritev2 287 ++#define __NR_pkey_mprotect 288 ++#define __NR_pkey_alloc 289 ++#define __NR_pkey_free 290 ++#define __NR_statx 291 ++#define __NR_io_pgetevents 292 ++#define __NR_rseq 293 ++#define __NR_kexec_file_load 294 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_quotactl_fd 443 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 ++#define __NR_memfd_secret 447 ++#define __NR_process_mrelease 448 ++#define __NR_futex_waitv 449 ++#define __NR_set_mempolicy_home_node 450 ++#define __NR_cachestat 451 ++#define __NR_fchmodat2 452 ++#define __NR_map_shadow_stack 453 ++#define __NR_futex_wake 454 ++#define __NR_futex_wait 455 ++#define __NR_futex_requeue 456 ++#define __NR_statmount 457 ++#define __NR_listmount 458 ++#define __NR_lsm_get_self_attr 459 ++#define __NR_lsm_set_self_attr 460 ++#define __NR_lsm_list_modules 461 ++#define __NR_mseal 462 ++ ++ ++#endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h +index 1c8f918234..4711ef2c3d 100644 +--- a/linux-headers/asm-x86/kvm.h ++++ b/linux-headers/asm-x86/kvm.h +@@ -106,6 +106,7 @@ struct kvm_ioapic_state { + + #define KVM_RUN_X86_SMM (1 << 0) + #define KVM_RUN_X86_BUS_LOCK (1 << 1) ++#define KVM_RUN_X86_GUEST_MODE (1 << 2) + + /* for KVM_GET_REGS and KVM_SET_REGS */ + struct kvm_regs { +@@ -436,6 +437,7 @@ struct kvm_sync_regs { + #define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4) + #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5) + #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) ++#define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) + + #define KVM_STATE_NESTED_FORMAT_VMX 0 + #define KVM_STATE_NESTED_FORMAT_SVM 1 +diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h +index da439afee1..24c979be54 100644 +--- a/linux-headers/asm-x86/unistd_64.h ++++ b/linux-headers/asm-x86/unistd_64.h +@@ -336,6 +336,7 @@ + #define __NR_statx 332 + #define __NR_io_pgetevents 333 + #define __NR_rseq 334 ++#define __NR_uretprobe 335 + #define __NR_pidfd_send_signal 424 + #define __NR_io_uring_setup 425 + #define __NR_io_uring_enter 426 +diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h +index 4fcb607c72..c23dd21a2d 100644 +--- a/linux-headers/asm-x86/unistd_x32.h ++++ b/linux-headers/asm-x86/unistd_x32.h +@@ -289,6 +289,7 @@ + #define __NR_statx (__X32_SYSCALL_BIT + 332) + #define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333) + #define __NR_rseq (__X32_SYSCALL_BIT + 334) ++#define __NR_uretprobe (__X32_SYSCALL_BIT + 335) + #define __NR_pidfd_send_signal (__X32_SYSCALL_BIT + 424) + #define __NR_io_uring_setup (__X32_SYSCALL_BIT + 425) + #define __NR_io_uring_enter (__X32_SYSCALL_BIT + 426) +diff --git a/linux-headers/linux/bits.h b/linux-headers/linux/bits.h +index d9897771be..c0d00c0a98 100644 +--- a/linux-headers/linux/bits.h ++++ b/linux-headers/linux/bits.h +@@ -12,4 +12,7 @@ + (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \ + (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h)))) + ++#define __GENMASK_U128(h, l) \ ++ ((_BIT128((h)) << 1) - (_BIT128(l))) ++ + #endif /* _LINUX_BITS_H */ +diff --git a/linux-headers/linux/const.h b/linux-headers/linux/const.h +index 1eb84b5087..2122610de7 100644 +--- a/linux-headers/linux/const.h ++++ b/linux-headers/linux/const.h +@@ -28,6 +28,23 @@ + #define _BITUL(x) (_UL(1) << (x)) + #define _BITULL(x) (_ULL(1) << (x)) + ++#if !defined(__ASSEMBLY__) ++/* ++ * Missing __asm__ support ++ * ++ * __BIT128() would not work in the __asm__ code, as it shifts an ++ * 'unsigned __init128' data type as direct representation of ++ * 128 bit constants is not supported in the gcc compiler, as ++ * they get silently truncated. ++ * ++ * TODO: Please revisit this implementation when gcc compiler ++ * starts representing 128 bit constants directly like long ++ * and unsigned long etc. Subsequently drop the comment for ++ * GENMASK_U128() which would then start supporting __asm__ code. ++ */ ++#define _BIT128(x) ((unsigned __int128)(1) << (x)) ++#endif ++ + #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) + #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + +diff --git a/linux-headers/linux/iommufd.h b/linux-headers/linux/iommufd.h +index 72e8f4b9dd..782baf477f 100644 +--- a/linux-headers/linux/iommufd.h ++++ b/linux-headers/linux/iommufd.h +@@ -4,8 +4,8 @@ + #ifndef _IOMMUFD_H + #define _IOMMUFD_H + +-#include + #include ++#include + + #define IOMMUFD_TYPE (';') + +@@ -37,19 +37,20 @@ + enum { + IOMMUFD_CMD_BASE = 0x80, + IOMMUFD_CMD_DESTROY = IOMMUFD_CMD_BASE, +- IOMMUFD_CMD_IOAS_ALLOC, +- IOMMUFD_CMD_IOAS_ALLOW_IOVAS, +- IOMMUFD_CMD_IOAS_COPY, +- IOMMUFD_CMD_IOAS_IOVA_RANGES, +- IOMMUFD_CMD_IOAS_MAP, +- IOMMUFD_CMD_IOAS_UNMAP, +- IOMMUFD_CMD_OPTION, +- IOMMUFD_CMD_VFIO_IOAS, +- IOMMUFD_CMD_HWPT_ALLOC, +- IOMMUFD_CMD_GET_HW_INFO, +- IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING, +- IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP, +- IOMMUFD_CMD_HWPT_INVALIDATE, ++ IOMMUFD_CMD_IOAS_ALLOC = 0x81, ++ IOMMUFD_CMD_IOAS_ALLOW_IOVAS = 0x82, ++ IOMMUFD_CMD_IOAS_COPY = 0x83, ++ IOMMUFD_CMD_IOAS_IOVA_RANGES = 0x84, ++ IOMMUFD_CMD_IOAS_MAP = 0x85, ++ IOMMUFD_CMD_IOAS_UNMAP = 0x86, ++ IOMMUFD_CMD_OPTION = 0x87, ++ IOMMUFD_CMD_VFIO_IOAS = 0x88, ++ IOMMUFD_CMD_HWPT_ALLOC = 0x89, ++ IOMMUFD_CMD_GET_HW_INFO = 0x8a, ++ IOMMUFD_CMD_HWPT_SET_DIRTY_TRACKING = 0x8b, ++ IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP = 0x8c, ++ IOMMUFD_CMD_HWPT_INVALIDATE = 0x8d, ++ IOMMUFD_CMD_FAULT_QUEUE_ALLOC = 0x8e, + }; + + /** +@@ -356,10 +357,13 @@ struct iommu_vfio_ioas { + * the parent HWPT in a nesting configuration. + * @IOMMU_HWPT_ALLOC_DIRTY_TRACKING: Dirty tracking support for device IOMMU is + * enforced on device attachment ++ * @IOMMU_HWPT_FAULT_ID_VALID: The fault_id field of hwpt allocation data is ++ * valid. + */ + enum iommufd_hwpt_alloc_flags { + IOMMU_HWPT_ALLOC_NEST_PARENT = 1 << 0, + IOMMU_HWPT_ALLOC_DIRTY_TRACKING = 1 << 1, ++ IOMMU_HWPT_FAULT_ID_VALID = 1 << 2, + }; + + /** +@@ -396,8 +400,8 @@ struct iommu_hwpt_vtd_s1 { + * @IOMMU_HWPT_DATA_VTD_S1: Intel VT-d stage-1 page table + */ + enum iommu_hwpt_data_type { +- IOMMU_HWPT_DATA_NONE, +- IOMMU_HWPT_DATA_VTD_S1, ++ IOMMU_HWPT_DATA_NONE = 0, ++ IOMMU_HWPT_DATA_VTD_S1 = 1, + }; + + /** +@@ -411,6 +415,9 @@ enum iommu_hwpt_data_type { + * @data_type: One of enum iommu_hwpt_data_type + * @data_len: Length of the type specific data + * @data_uptr: User pointer to the type specific data ++ * @fault_id: The ID of IOMMUFD_FAULT object. Valid only if flags field of ++ * IOMMU_HWPT_FAULT_ID_VALID is set. ++ * @__reserved2: Padding to 64-bit alignment. Must be 0. + * + * Explicitly allocate a hardware page table object. This is the same object + * type that is returned by iommufd_device_attach() and represents the +@@ -441,6 +448,8 @@ struct iommu_hwpt_alloc { + __u32 data_type; + __u32 data_len; + __aligned_u64 data_uptr; ++ __u32 fault_id; ++ __u32 __reserved2; + }; + #define IOMMU_HWPT_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_ALLOC) + +@@ -482,8 +491,8 @@ struct iommu_hw_info_vtd { + * @IOMMU_HW_INFO_TYPE_INTEL_VTD: Intel VT-d iommu info type + */ + enum iommu_hw_info_type { +- IOMMU_HW_INFO_TYPE_NONE, +- IOMMU_HW_INFO_TYPE_INTEL_VTD, ++ IOMMU_HW_INFO_TYPE_NONE = 0, ++ IOMMU_HW_INFO_TYPE_INTEL_VTD = 1, + }; + + /** +@@ -620,7 +629,7 @@ struct iommu_hwpt_get_dirty_bitmap { + * @IOMMU_HWPT_INVALIDATE_DATA_VTD_S1: Invalidation data for VTD_S1 + */ + enum iommu_hwpt_invalidate_data_type { +- IOMMU_HWPT_INVALIDATE_DATA_VTD_S1, ++ IOMMU_HWPT_INVALIDATE_DATA_VTD_S1 = 0, + }; + + /** +@@ -692,4 +701,100 @@ struct iommu_hwpt_invalidate { + __u32 __reserved; + }; + #define IOMMU_HWPT_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_HWPT_INVALIDATE) ++ ++/** ++ * enum iommu_hwpt_pgfault_flags - flags for struct iommu_hwpt_pgfault ++ * @IOMMU_PGFAULT_FLAGS_PASID_VALID: The pasid field of the fault data is ++ * valid. ++ * @IOMMU_PGFAULT_FLAGS_LAST_PAGE: It's the last fault of a fault group. ++ */ ++enum iommu_hwpt_pgfault_flags { ++ IOMMU_PGFAULT_FLAGS_PASID_VALID = (1 << 0), ++ IOMMU_PGFAULT_FLAGS_LAST_PAGE = (1 << 1), ++}; ++ ++/** ++ * enum iommu_hwpt_pgfault_perm - perm bits for struct iommu_hwpt_pgfault ++ * @IOMMU_PGFAULT_PERM_READ: request for read permission ++ * @IOMMU_PGFAULT_PERM_WRITE: request for write permission ++ * @IOMMU_PGFAULT_PERM_EXEC: (PCIE 10.4.1) request with a PASID that has the ++ * Execute Requested bit set in PASID TLP Prefix. ++ * @IOMMU_PGFAULT_PERM_PRIV: (PCIE 10.4.1) request with a PASID that has the ++ * Privileged Mode Requested bit set in PASID TLP ++ * Prefix. ++ */ ++enum iommu_hwpt_pgfault_perm { ++ IOMMU_PGFAULT_PERM_READ = (1 << 0), ++ IOMMU_PGFAULT_PERM_WRITE = (1 << 1), ++ IOMMU_PGFAULT_PERM_EXEC = (1 << 2), ++ IOMMU_PGFAULT_PERM_PRIV = (1 << 3), ++}; ++ ++/** ++ * struct iommu_hwpt_pgfault - iommu page fault data ++ * @flags: Combination of enum iommu_hwpt_pgfault_flags ++ * @dev_id: id of the originated device ++ * @pasid: Process Address Space ID ++ * @grpid: Page Request Group Index ++ * @perm: Combination of enum iommu_hwpt_pgfault_perm ++ * @addr: Fault address ++ * @length: a hint of how much data the requestor is expecting to fetch. For ++ * example, if the PRI initiator knows it is going to do a 10MB ++ * transfer, it could fill in 10MB and the OS could pre-fault in ++ * 10MB of IOVA. It's default to 0 if there's no such hint. ++ * @cookie: kernel-managed cookie identifying a group of fault messages. The ++ * cookie number encoded in the last page fault of the group should ++ * be echoed back in the response message. ++ */ ++struct iommu_hwpt_pgfault { ++ __u32 flags; ++ __u32 dev_id; ++ __u32 pasid; ++ __u32 grpid; ++ __u32 perm; ++ __u64 addr; ++ __u32 length; ++ __u32 cookie; ++}; ++ ++/** ++ * enum iommufd_page_response_code - Return status of fault handlers ++ * @IOMMUFD_PAGE_RESP_SUCCESS: Fault has been handled and the page tables ++ * populated, retry the access. This is the ++ * "Success" defined in PCI 10.4.2.1. ++ * @IOMMUFD_PAGE_RESP_INVALID: Could not handle this fault, don't retry the ++ * access. This is the "Invalid Request" in PCI ++ * 10.4.2.1. ++ */ ++enum iommufd_page_response_code { ++ IOMMUFD_PAGE_RESP_SUCCESS = 0, ++ IOMMUFD_PAGE_RESP_INVALID = 1, ++}; ++ ++/** ++ * struct iommu_hwpt_page_response - IOMMU page fault response ++ * @cookie: The kernel-managed cookie reported in the fault message. ++ * @code: One of response code in enum iommufd_page_response_code. ++ */ ++struct iommu_hwpt_page_response { ++ __u32 cookie; ++ __u32 code; ++}; ++ ++/** ++ * struct iommu_fault_alloc - ioctl(IOMMU_FAULT_QUEUE_ALLOC) ++ * @size: sizeof(struct iommu_fault_alloc) ++ * @flags: Must be 0 ++ * @out_fault_id: The ID of the new FAULT ++ * @out_fault_fd: The fd of the new FAULT ++ * ++ * Explicitly allocate a fault handling object. ++ */ ++struct iommu_fault_alloc { ++ __u32 size; ++ __u32 flags; ++ __u32 out_fault_id; ++ __u32 out_fault_fd; ++}; ++#define IOMMU_FAULT_QUEUE_ALLOC _IO(IOMMUFD_TYPE, IOMMUFD_CMD_FAULT_QUEUE_ALLOC) + #endif +diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h +index c93876ca0b..49dd1b30ce 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -192,11 +192,20 @@ struct kvm_xen_exit { + /* Flags that describe what fields in emulation_failure hold valid data. */ + #define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0) + ++/* ++ * struct kvm_run can be modified by userspace at any time, so KVM must be ++ * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM() ++ * renames fields in struct kvm_run from to __unsafe when ++ * compiled into the kernel, ensuring that any use within KVM is obvious and ++ * gets extra scrutiny. ++ */ ++#define HINT_UNSAFE_IN_KVM(_symbol) _symbol ++ + /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ + struct kvm_run { + /* in */ + __u8 request_interrupt_window; +- __u8 immediate_exit; ++ __u8 HINT_UNSAFE_IN_KVM(immediate_exit); + __u8 padding1[6]; + + /* out */ +@@ -913,6 +922,9 @@ struct kvm_enable_cap { + #define KVM_CAP_MEMORY_ATTRIBUTES 233 + #define KVM_CAP_GUEST_MEMFD 234 + #define KVM_CAP_VM_TYPES 235 ++#define KVM_CAP_PRE_FAULT_MEMORY 236 ++#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 ++#define KVM_CAP_X86_GUEST_MODE 238 + + struct kvm_irq_routing_irqchip { + __u32 irqchip; +@@ -1544,4 +1556,13 @@ struct kvm_create_guest_memfd { + __u64 reserved[6]; + }; + ++#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory) ++ ++struct kvm_pre_fault_memory { ++ __u64 gpa; ++ __u64 size; ++ __u64 flags; ++ __u64 padding[5]; ++}; ++ + #endif /* __LINUX_KVM_H */ +diff --git a/linux-headers/linux/mman.h b/linux-headers/linux/mman.h +index 4e8cb60780..2b83059586 100644 +--- a/linux-headers/linux/mman.h ++++ b/linux-headers/linux/mman.h +@@ -17,6 +17,7 @@ + #define MAP_SHARED 0x01 /* Share changes */ + #define MAP_PRIVATE 0x02 /* Changes are private */ + #define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */ ++#define MAP_DROPPABLE 0x08 /* Zero memory under memory pressure. */ + + /* + * Huge page size encoding when MAP_HUGETLB is specified, and a huge page +diff --git a/linux-headers/linux/psp-sev.h b/linux-headers/linux/psp-sev.h +index c3046c6bff..17bf191573 100644 +--- a/linux-headers/linux/psp-sev.h ++++ b/linux-headers/linux/psp-sev.h +@@ -31,6 +31,7 @@ enum { + SNP_PLATFORM_STATUS, + SNP_COMMIT, + SNP_SET_CONFIG, ++ SNP_VLEK_LOAD, + + SEV_MAX, + }; +@@ -50,6 +51,7 @@ typedef enum { + SEV_RET_INVALID_PLATFORM_STATE, + SEV_RET_INVALID_GUEST_STATE, + SEV_RET_INAVLID_CONFIG, ++ SEV_RET_INVALID_CONFIG = SEV_RET_INAVLID_CONFIG, + SEV_RET_INVALID_LEN, + SEV_RET_ALREADY_OWNED, + SEV_RET_INVALID_CERTIFICATE, +@@ -214,6 +216,32 @@ struct sev_user_data_snp_config { + __u8 rsvd1[52]; + } __attribute__((packed)); + ++/** ++ * struct sev_data_snp_vlek_load - SNP_VLEK_LOAD structure ++ * ++ * @len: length of the command buffer read by the PSP ++ * @vlek_wrapped_version: version of wrapped VLEK hashstick (Must be 0h) ++ * @rsvd: reserved ++ * @vlek_wrapped_address: address of a wrapped VLEK hashstick ++ * (struct sev_user_data_snp_wrapped_vlek_hashstick) ++ */ ++struct sev_user_data_snp_vlek_load { ++ __u32 len; /* In */ ++ __u8 vlek_wrapped_version; /* In */ ++ __u8 rsvd[3]; /* In */ ++ __u64 vlek_wrapped_address; /* In */ ++} __attribute__((packed)); ++ ++/** ++ * struct sev_user_data_snp_vlek_wrapped_vlek_hashstick - Wrapped VLEK data ++ * ++ * @data: Opaque data provided by AMD KDS (as described in SEV-SNP Firmware ABI ++ * 1.54, SNP_VLEK_LOAD) ++ */ ++struct sev_user_data_snp_wrapped_vlek_hashstick { ++ __u8 data[432]; /* In */ ++} __attribute__((packed)); ++ + /** + * struct sev_issue_cmd - SEV ioctl parameters + * +-- +2.39.3 + diff --git a/kvm-qga-skip-bind-mounts-in-fs-list.patch b/kvm-qga-skip-bind-mounts-in-fs-list.patch new file mode 100644 index 0000000..e7bddde --- /dev/null +++ b/kvm-qga-skip-bind-mounts-in-fs-list.patch @@ -0,0 +1,94 @@ +From 5aec8bc4d0458e6011f5e0242a8f18bdba835af8 Mon Sep 17 00:00:00 2001 +From: Jean-Louis Dupond +Date: Wed, 2 Oct 2024 12:06:35 +0200 +Subject: [PATCH 17/18] qga: skip bind mounts in fs list + +RH-Author: Konstantin Kostiuk +RH-MergeRequest: 307: qga: skip bind mounts in fs list +RH-Jira: RHEL-71939 +RH-Acked-by: yvugenfi +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] 787cdc9477275959892800418ea37b76fce28ac3 (kkostiuk/redhat-centos-stream-src-qemu-kvm) + +The filesystem list in build_fs_mount_list should skip bind mounts. +This because we end up in locking situations when doing fsFreeze. Like +mentioned in [1] and [2]. + +Next to that, the build_fs_mount_list call did a fallback via +build_fs_mount_list_from_mtab if mountinfo did not exist. +There it skipped bind mounts, but this is broken for newer OS. +This as mounts does not return the path of the bind mount but the +underlying dev/partition, so S_ISDIR will never return true in +dev_major_minor call. + +This patch simply checks the existing devmajor:devminor tuple in the +mounts, and if it already exists, this means we have the same devices +mounted again, a bind mount. So skip this. + +Same approach is used in open-vm-tools [3]. + +[1]: https://gitlab.com/qemu-project/qemu/-/issues/592 +[2]: https://gitlab.com/qemu-project/qemu/-/issues/520 +[3]: https://github.com/vmware/open-vm-tools/commit/d58847b497e212737007958c945af1df22a8ab58 + +Signed-off-by: Jean-Louis Dupond +Reviewed-by: Konstantin Kostiuk +Link: https://lore.kernel.org/r/20241002100634.162499-2-jean-louis@dupond.be +Signed-off-by: Konstantin Kostiuk +--- + qga/commands-linux.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/qga/commands-linux.c b/qga/commands-linux.c +index 51d5e3d927..426b040ab8 100644 +--- a/qga/commands-linux.c ++++ b/qga/commands-linux.c +@@ -59,6 +59,22 @@ static int dev_major_minor(const char *devpath, + return -1; + } + ++/* ++ * Check if we already have the devmajor:devminor in the mounts ++ * If thats the case return true. ++ */ ++static bool dev_exists(FsMountList *mounts, unsigned int devmajor, unsigned int devminor) ++{ ++ FsMount *mount; ++ ++ QTAILQ_FOREACH(mount, mounts, next) { ++ if (mount->devmajor == devmajor && mount->devminor == devminor) { ++ return true; ++ } ++ } ++ return false; ++} ++ + static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp) + { + struct mntent *ment; +@@ -89,6 +105,10 @@ static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp) + /* Skip bind mounts */ + continue; + } ++ if (dev_exists(mounts, devmajor, devminor)) { ++ /* Skip already existing devices (bind mounts) */ ++ continue; ++ } + + mount = g_new0(FsMount, 1); + mount->dirname = g_strdup(ment->mnt_dir); +@@ -172,6 +192,11 @@ bool build_fs_mount_list(FsMountList *mounts, Error **errp) + } + } + ++ if (dev_exists(mounts, devmajor, devminor)) { ++ /* Skip already existing devices (bind mounts) */ ++ continue; ++ } ++ + mount = g_new0(FsMount, 1); + mount->dirname = g_strdup(line + dir_s); + mount->devtype = g_strdup(dash + type_s); +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch b/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch new file mode 100644 index 0000000..1134828 --- /dev/null +++ b/kvm-s390x-cpumodel-Add-PLO-extension-facility.patch @@ -0,0 +1,221 @@ +From e4bdbc368426bc9aeb6dbfeeb2de46de1256861d Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:50 +0100 +Subject: [PATCH 15/18] s390x/cpumodel: Add PLO-extension facility +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [15/16] 6e8bb7b1f0e8c84ba0c3cd7e7714d22642402513 (thuth/qemu-kvm-cs9) + +The PLO-extension facility introduces numerous locking related +subfunctions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-15-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 393c835e341e8921d1d6ae45da308e85176c4f00) +--- + target/s390x/cpu_features.c | 1 + + target/s390x/cpu_features_def.h.inc | 39 +++++++++++++++++++++++++ + target/s390x/cpu_models.c | 38 ++++++++++++++++++++++++ + target/s390x/gen-features.c | 45 +++++++++++++++++++++++++++++ + 4 files changed, 123 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index 5f8b02f12c..4b5be6798e 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -240,6 +240,7 @@ void s390_get_deprecated_features(S390FeatBitmap features) + /* indexed by feature group number for easy lookup */ + static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"), ++ FEAT_GROUP_INIT("plo_ext", PLO_EXT, "PLO-extension facility"), + FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"), + FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"), + FEAT_GROUP_INIT("gen17ptff", GEN17_PTFF, "PTFF enhancements introduced with gen17"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index fe7e1bd19c..e23e603a79 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -93,6 +93,7 @@ DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") + DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") + DEF_FEAT(SIF, "sif", STFL, 85, "Sequential-instruction-fetching facility") + DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") ++DEF_FEAT(PLO_EXT, "plo-ext", STFL, 87, "PLO-extension facility") + DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") + DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") + DEF_FEAT(SIDE_EFFECT_ACCESS_ESOP2, "sea_esop2", STFL, 131, "Side-effect-access facility and Enhanced-suppression-on-protection facility 2") +@@ -180,6 +181,44 @@ DEF_FEAT(PLO_CSTST, "plo-cstst", PLO, 20, "PLO Compare and swap and triple store + DEF_FEAT(PLO_CSTSTG, "plo-cststg", PLO, 21, "PLO Compare and swap and triple store (64 bit in parameter list)") + DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (64 bit in general registers)") + DEF_FEAT(PLO_CSTSTX, "plo-cststx", PLO, 23, "PLO Compare and swap and triple store (128 bit in parameter list)") ++DEF_FEAT(PLO_CLO, "plo-clo", PLO, 24, "PLO Compare and load (256 bit in parameter list)") ++DEF_FEAT(PLO_CSO, "plo-cso", PLO, 25, "PLO Compare and swap (256 bit in parameter list)") ++DEF_FEAT(PLO_DCSO, "plo-dcso", PLO, 26, "PLO Double compare and swap (256 bit in parameter list)") ++DEF_FEAT(PLO_CSSTO, "plo-cssto", PLO, 27, "PLO Compare and swap and store (256 bit in parameter list)") ++DEF_FEAT(PLO_CSDSTO, "plo-csdsto", PLO, 28, "PLO Compare and swap and double store (256 bit in parameter list)") ++DEF_FEAT(PLO_CSTSTO, "plo-cststo", PLO, 29, "PLO Compare and swap and trible store (256 bit in parameter list)") ++DEF_FEAT(PLO_TCS, "plo-tcs", PLO, 30, "Triple compare and swap (32 bit in parameter list)") ++DEF_FEAT(PLO_TCSG, "plo-tcsg", PLO, 31, "Triple compare and swap (64 bit in parameter list)") ++DEF_FEAT(PLO_TCSX, "plo-tcsx", PLO, 32, "Triple compare and swap (128 bit in parameter list)") ++DEF_FEAT(PLO_TCSO, "plo-tcso", PLO, 33, "Triple compare and swap (256 bit in parameter list)") ++DEF_FEAT(PLO_QCS, "plo-qcs", PLO, 34, "Quadruple compare and swap (32 bit in parameter list)") ++DEF_FEAT(PLO_QCSG, "plo-qcsg", PLO, 35, "Quadruple compare and swap (64 bit in parameter list)") ++DEF_FEAT(PLO_QCSX, "plo-qcsx", PLO, 36, "Quadruple compare and swap (128 bit in parameter list)") ++DEF_FEAT(PLO_QCSO, "plo-qcso", PLO, 37, "Quadruple compare and swap (256 bit in parameter list)") ++DEF_FEAT(PLO_LO, "plo-lo", PLO, 38, "Load (256 bit in parameter list)") ++DEF_FEAT(PLO_DLX, "plo-dlx", PLO, 39, "Double load (128 bit in parameter list)") ++DEF_FEAT(PLO_DLO, "plo-dlo", PLO, 40, "Double load (256 bit in parameter list)") ++DEF_FEAT(PLO_TL, "plo-tl", PLO, 41, "Triple load (32 bit in parameter list)") ++DEF_FEAT(PLO_TLG, "plo-tlg", PLO, 42, "Triple load (64 bit in parameter list)") ++DEF_FEAT(PLO_TLX, "plo-tlx", PLO, 43, "Triple load (128 bit in parameter list)") ++DEF_FEAT(PLO_TLO, "plo-tlo", PLO, 44, "Triple load (256 bit in parameter list)") ++DEF_FEAT(PLO_QL, "plo-ql", PLO, 45, "Quadruple load (32 bit in parameter list)") ++DEF_FEAT(PLO_QLG, "plo-qlg", PLO, 46, "Quadruple load (64 bit in parameter list)") ++DEF_FEAT(PLO_QLX, "plo-qlx", PLO, 47, "Quadruple load (128 bit in parameter list)") ++DEF_FEAT(PLO_QLO, "plo-qlo", PLO, 48, "Quadruple load (256 bit in parameter list)") ++DEF_FEAT(PLO_STO, "plo-sto", PLO, 49, "Store (256 bit in parameter list)") ++DEF_FEAT(PLO_DST, "plo-dst", PLO, 50, "Double store (32 bit in parameter list)") ++DEF_FEAT(PLO_DSTG, "plo-dstg", PLO, 51, "Double store (64 bit in parameter list)") ++DEF_FEAT(PLO_DSTX, "plo-dstx", PLO, 52, "Double store (128 bit in parameter list)") ++DEF_FEAT(PLO_DSTO, "plo-dsto", PLO, 53, "Double store (256 bit in parameter list)") ++DEF_FEAT(PLO_TST, "plo-tst", PLO, 54, "Triple store (32 bit in parameter list)") ++DEF_FEAT(PLO_TSTG, "plo-tstg", PLO, 55, "Triple store (64 bit in parameter list)") ++DEF_FEAT(PLO_TSTX, "plo-tstx", PLO, 56, "Triple store (128 bit in parameter list)") ++DEF_FEAT(PLO_TSTO, "plo-tsto", PLO, 57, "Triple store (256 bit in parameter list)") ++DEF_FEAT(PLO_QST, "plo-qst", PLO, 58, "Quadruple store (32 bit in parameter list)") ++DEF_FEAT(PLO_QSTG, "plo-qstg", PLO, 59, "Quadruple store (64 bit in parameter list)") ++DEF_FEAT(PLO_QSTX, "plo-qstx", PLO, 60, "Quadruple store (128 bit in parameter list)") ++DEF_FEAT(PLO_QSTO, "plo-qsto", PLO, 61, "Quadruple store (256 bit in parameter list)") + + /* Features exposed via the PTFF instruction. */ + DEF_FEAT(PTFF_QTO, "ptff-qto", PTFF, 1, "PTFF Query TOD Offset") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 9e9f6dae07..3fb5b0980e 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -516,6 +516,44 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, + { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, + { S390_FEAT_INEFF_NC_TX, S390_FEAT_TRANSACTIONAL_EXE }, ++ { S390_FEAT_PLO_CLO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_CSO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DCSO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_CSSTO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_CSDSTO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_CSTSTO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TCS, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TCSG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TCSX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TCSO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QCS, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QCSG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QCSX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QCSO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_LO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DLX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DLO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TL, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TLG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TLX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TLO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QL, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QLG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QLX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QLO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_STO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DST, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DSTG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DSTX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_DSTO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TST, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TSTG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TSTX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_TSTO, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QST, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QSTG, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QSTX, S390_FEAT_PLO_EXT }, ++ { S390_FEAT_PLO_QSTO, S390_FEAT_PLO_EXT }, + }; + int i; + +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 6d00ffcda7..680d45d303 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -46,6 +46,47 @@ + S390_FEAT_PLO_CSTSTGR, \ + S390_FEAT_PLO_CSTSTX + ++#define S390_FEAT_GROUP_PLO_EXT \ ++ S390_FEAT_PLO_EXT, \ ++ S390_FEAT_PLO_CLO, \ ++ S390_FEAT_PLO_CSO, \ ++ S390_FEAT_PLO_DCSO, \ ++ S390_FEAT_PLO_CSSTO, \ ++ S390_FEAT_PLO_CSDSTO, \ ++ S390_FEAT_PLO_CSTSTO, \ ++ S390_FEAT_PLO_TCS, \ ++ S390_FEAT_PLO_TCSG, \ ++ S390_FEAT_PLO_TCSX, \ ++ S390_FEAT_PLO_TCSO, \ ++ S390_FEAT_PLO_QCS, \ ++ S390_FEAT_PLO_QCSG, \ ++ S390_FEAT_PLO_QCSX, \ ++ S390_FEAT_PLO_QCSO, \ ++ S390_FEAT_PLO_LO, \ ++ S390_FEAT_PLO_DLX, \ ++ S390_FEAT_PLO_DLO, \ ++ S390_FEAT_PLO_TL, \ ++ S390_FEAT_PLO_TLG, \ ++ S390_FEAT_PLO_TLX, \ ++ S390_FEAT_PLO_TLO, \ ++ S390_FEAT_PLO_QL, \ ++ S390_FEAT_PLO_QLG, \ ++ S390_FEAT_PLO_QLX, \ ++ S390_FEAT_PLO_QLO, \ ++ S390_FEAT_PLO_STO, \ ++ S390_FEAT_PLO_DST, \ ++ S390_FEAT_PLO_DSTG, \ ++ S390_FEAT_PLO_DSTX, \ ++ S390_FEAT_PLO_DSTO, \ ++ S390_FEAT_PLO_TST, \ ++ S390_FEAT_PLO_TSTG, \ ++ S390_FEAT_PLO_TSTX, \ ++ S390_FEAT_PLO_TSTO, \ ++ S390_FEAT_PLO_QST, \ ++ S390_FEAT_PLO_QSTG, \ ++ S390_FEAT_PLO_QSTX, \ ++ S390_FEAT_PLO_QSTO ++ + #define S390_FEAT_GROUP_TOD_CLOCK_STEERING \ + S390_FEAT_TOD_CLOCK_STEERING, \ + S390_FEAT_PTFF_QTO, \ +@@ -320,6 +361,9 @@ + static uint16_t group_PLO[] = { + S390_FEAT_GROUP_PLO, + }; ++static uint16_t group_PLO_EXT[] = { ++ S390_FEAT_GROUP_PLO_EXT, ++}; + static uint16_t group_TOD_CLOCK_STEERING[] = { + S390_FEAT_GROUP_TOD_CLOCK_STEERING, + }; +@@ -936,6 +980,7 @@ typedef struct { + *******************************/ + static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(PLO), ++ FEAT_GROUP_INITIALIZER(PLO_EXT), + FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING), + FEAT_GROUP_INITIALIZER(GEN13_PTFF), + FEAT_GROUP_INITIALIZER(GEN17_PTFF), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch b/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch new file mode 100644 index 0000000..05dece7 --- /dev/null +++ b/kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch @@ -0,0 +1,43 @@ +From dcfaf859fa755f9c75b1e848f1b61b293b500d0d Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:48 +0100 +Subject: [PATCH 13/18] s390x/cpumodel: Add Sequential-Instruction-Fetching + facility +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [13/16] 5f8facceda9ecad3b417ed3da2d360fdd480f6d4 (thuth/qemu-kvm-cs9) + +The sequential instruction fetching facility provides few guarantees, +for example, to avoid stop machine calls on enabling/disabling kprobes. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-13-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit a5fa8bee72847406bfc32e15c8e41c0a2a0812e1) +--- + target/s390x/cpu_features_def.h.inc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 2c1d1cd98a..09a80844a7 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -91,6 +91,7 @@ DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packe + DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") + DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") + DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") ++DEF_FEAT(SIF, "sif", STFL, 85, "Sequential-instruction-fetching facility") + DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") + DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") + DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch b/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch new file mode 100644 index 0000000..9a0c5de --- /dev/null +++ b/kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch @@ -0,0 +1,90 @@ +From d1313d94cb0a2b69b18cf7e7531945cb131c23c2 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:41 +0100 +Subject: [PATCH 06/18] s390x/cpumodel: Add ptff Query Time-Stamp Event (QTSE) + support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [6/16] f5642cffc8deb0caf96d59da72e82db435e28205 (thuth/qemu-kvm-cs9) + +Introduce a new PTFF subfunction to query-stamp events. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-6-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit eba6f49128fbcf75d19acb6aef250d0664d03e9e) +--- + target/s390x/cpu_features.c | 1 + + target/s390x/cpu_features_def.h.inc | 1 + + target/s390x/gen-features.c | 9 +++++++++ + 3 files changed, 11 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index 9ba127e386..385a2ff860 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -241,6 +241,7 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"), + FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"), + FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"), ++ FEAT_GROUP_INIT("gen17ptff", GEN17_PTFF, "PTFF enhancements introduced with gen17"), + FEAT_GROUP_INIT("msa", MSA, "Message-security-assist facility"), + FEAT_GROUP_INIT("msa1", MSA_EXT_1, "Message-security-assist-extension 1 facility"), + FEAT_GROUP_INIT("msa2", MSA_EXT_2, "Message-security-assist-extension 2 facility"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 2132837ffe..f96cb5a7d8 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -181,6 +181,7 @@ DEF_FEAT(PTFF_QSI, "ptff-qsi", PTFF, 2, "PTFF Query Steering Information") + DEF_FEAT(PTFF_QPT, "ptff-qpc", PTFF, 3, "PTFF Query Physical Clock") + DEF_FEAT(PTFF_QUI, "ptff-qui", PTFF, 4, "PTFF Query UTC Information") + DEF_FEAT(PTFF_QTOU, "ptff-qtou", PTFF, 5, "PTFF Query TOD Offset User") ++DEF_FEAT(PTFF_QTSE, "ptff-qtse", PTFF, 6, "PTFF Query Time-Stamp Event") + DEF_FEAT(PTFF_QSIE, "ptff-qsie", PTFF, 10, "PTFF Query Steering Information Extended") + DEF_FEAT(PTFF_QTOUE, "ptff-qtoue", PTFF, 13, "PTFF Query TOD Offset User Extended") + DEF_FEAT(PTFF_STO, "ptff-sto", PTFF, 65, "PTFF Set TOD Offset") +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 3326e7df43..302b653214 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -64,6 +64,9 @@ + S390_FEAT_PTFF_STOE, \ + S390_FEAT_PTFF_STOUE + ++#define S390_FEAT_GROUP_GEN17_PTFF \ ++ S390_FEAT_PTFF_QTSE ++ + #define S390_FEAT_GROUP_MSA \ + S390_FEAT_MSA, \ + S390_FEAT_KMAC_DEA, \ +@@ -318,6 +321,11 @@ static uint16_t group_GEN13_PTFF[] = { + static uint16_t group_MULTIPLE_EPOCH_PTFF[] = { + S390_FEAT_GROUP_MULTIPLE_EPOCH_PTFF, + }; ++ ++static uint16_t group_GEN17_PTFF[] = { ++ S390_FEAT_GROUP_GEN17_PTFF, ++}; ++ + static uint16_t group_MSA[] = { + S390_FEAT_GROUP_MSA, + }; +@@ -918,6 +926,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(PLO), + FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING), + FEAT_GROUP_INITIALIZER(GEN13_PTFF), ++ FEAT_GROUP_INITIALIZER(GEN17_PTFF), + FEAT_GROUP_INITIALIZER(MSA), + FEAT_GROUP_INITIALIZER(MSA_EXT_1), + FEAT_GROUP_INITIALIZER(MSA_EXT_2), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch b/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch new file mode 100644 index 0000000..bb5c4c5 --- /dev/null +++ b/kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch @@ -0,0 +1,169 @@ +From 66725d6be2ad779432d3b02a0ad20a415bd37f1f Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:43 +0100 +Subject: [PATCH 08/18] s390x/cpumodel: add Concurrent-functions facility + support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [8/16] 891c3efec3d7dbce03e01f0fcb61cca9669570eb (thuth/qemu-kvm-cs9) + +The Concurrent-functions facility introduces the new instruction +Perform Functions with Concurrent Results (PFCR) with few subfunctions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-8-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit c9ea365dce32bc114dacd7cfca7c478a82459b47) +--- + target/s390x/cpu_features.c | 2 ++ + target/s390x/cpu_features.h | 1 + + target/s390x/cpu_features_def.h.inc | 8 ++++++++ + target/s390x/cpu_models.c | 5 +++++ + target/s390x/gen-features.c | 13 +++++++++++++ + target/s390x/kvm/kvm.c | 6 ++++++ + 6 files changed, 35 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index 385a2ff860..5f8b02f12c 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -93,6 +93,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type, + case S390_FEAT_TYPE_KDSA: + case S390_FEAT_TYPE_SORTL: + case S390_FEAT_TYPE_DFLTCC: ++ case S390_FEAT_TYPE_PFCR: + set_be_bit(0, data); /* query is always available */ + break; + default: +@@ -263,6 +264,7 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), ++ FEAT_GROUP_INIT("ccf", CONCURRENT_FUNCTIONS, "Concurrent-functions facility"), + }; + + const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group) +diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h +index 661a8cd6db..5635839d03 100644 +--- a/target/s390x/cpu_features.h ++++ b/target/s390x/cpu_features.h +@@ -44,6 +44,7 @@ typedef enum { + S390_FEAT_TYPE_SORTL, + S390_FEAT_TYPE_DFLTCC, + S390_FEAT_TYPE_UV_FEAT_GUEST, ++ S390_FEAT_TYPE_PFCR, + } S390FeatType; + + /* Definition of a CPU feature */ +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index f96cb5a7d8..09872ab3d8 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -116,6 +116,7 @@ DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") + DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") + DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") + DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") ++DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") + + /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ + DEF_FEAT(SIE_GSLS, "gsls", SCLP_CONF_CHAR, 40, "SIE: Guest-storage-limit-suppression facility") +@@ -413,3 +414,10 @@ DEF_FEAT(DEFLATE_F0, "dfltcc-f0", DFLTCC, 192, "DFLTCC format 0 parameter-block" + /* Features exposed via the UV-CALL instruction */ + DEF_FEAT(UV_FEAT_AP, "appv", UV_FEAT_GUEST, 4, "AP instructions installed for secure guests") + DEF_FEAT(UV_FEAT_AP_INTR, "appvi", UV_FEAT_GUEST, 5, "AP instructions interruption support for secure guests") ++ ++/* Features exposed via the PFCR instruction (concurrent-functions facility). */ ++DEF_FEAT(PFCR_QAF, "pfcr-qaf", PFCR, 0, "PFCR Query-Available-Functions") ++DEF_FEAT(PFCR_CSDST, "pfcr-csdst", PFCR, 1, "PFCR Compare-and-Swap-and-Double-Store (32)") ++DEF_FEAT(PFCR_CSDSTG, "pfcr-csdstg", PFCR, 2, "PFCR Compare-and-Swap-and-Double-Store (64)") ++DEF_FEAT(PFCR_CSTST, "pfcr-cstst", PFCR, 3, "PFCR Compare-and-Swap-and-Triple-Store (32)") ++DEF_FEAT(PFCR_CSTSTG, "pfcr-cststg", PFCR, 4, "PFCR Compare-and-Swap-and-Triple-Store (64)") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index da441b7b10..cb45911ac0 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -507,6 +507,11 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_RDP, S390_FEAT_LOCAL_TLB_CLEARING }, + { S390_FEAT_UV_FEAT_AP, S390_FEAT_AP }, + { S390_FEAT_UV_FEAT_AP_INTR, S390_FEAT_UV_FEAT_AP }, ++ { S390_FEAT_PFCR_QAF, S390_FEAT_CCF_BASE }, ++ { S390_FEAT_PFCR_CSDST, S390_FEAT_CCF_BASE }, ++ { S390_FEAT_PFCR_CSDSTG, S390_FEAT_CCF_BASE }, ++ { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, ++ { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, + }; + int i; + +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 302b653214..6d00ffcda7 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -308,6 +308,14 @@ + S390_FEAT_DEFLATE_XPND, \ + S390_FEAT_DEFLATE_F0 + ++#define S390_FEAT_GROUP_CONCURRENT_FUNCTIONS \ ++ S390_FEAT_CCF_BASE, \ ++ S390_FEAT_PFCR_QAF, \ ++ S390_FEAT_PFCR_CSDST, \ ++ S390_FEAT_PFCR_CSDSTG, \ ++ S390_FEAT_PFCR_CSTST, \ ++ S390_FEAT_PFCR_CSTSTG ++ + /* cpu feature groups */ + static uint16_t group_PLO[] = { + S390_FEAT_GROUP_PLO, +@@ -398,6 +406,10 @@ static uint16_t group_DEFLATE_CONVERSION[] = { + S390_FEAT_GROUP_DEFLATE_CONVERSION, + }; + ++static uint16_t group_CONCURRENT_FUNCTIONS[] = { ++ S390_FEAT_GROUP_CONCURRENT_FUNCTIONS, ++}; ++ + /* Base features (in order of release) + * Only non-hypervisor managed features belong here. + * Base feature sets are static meaning they do not change in future QEMU +@@ -948,6 +960,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), + FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), ++ FEAT_GROUP_INITIALIZER(CONCURRENT_FUNCTIONS), + }; + + #define QEMU_FEAT_INITIALIZER(_name) \ +diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c +index 8ffe0159d8..dd0322c43a 100644 +--- a/target/s390x/kvm/kvm.c ++++ b/target/s390x/kvm/kvm.c +@@ -2195,6 +2195,9 @@ static int query_cpu_subfunc(S390FeatBitmap features) + if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { + s390_add_from_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); + } ++ if (test_bit(S390_FEAT_CCF_BASE, features)) { ++ s390_add_from_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr); ++ } + return 0; + } + +@@ -2248,6 +2251,9 @@ static int configure_cpu_subfunc(const S390FeatBitmap features) + if (test_bit(S390_FEAT_DEFLATE_BASE, features)) { + s390_fill_feat_block(features, S390_FEAT_TYPE_DFLTCC, prop.dfltcc); + } ++ if (test_bit(S390_FEAT_CCF_BASE, features)) { ++ s390_fill_feat_block(features, S390_FEAT_TYPE_PFCR, prop.pfcr); ++ } + return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr); + } + +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch b/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch new file mode 100644 index 0000000..45cacc4 --- /dev/null +++ b/kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch @@ -0,0 +1,56 @@ +From e54ca265e81453305c96adce3e521d543ac124a6 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:47 +0100 +Subject: [PATCH 12/18] s390x/cpumodel: add + Ineffective-nonconstrained-transaction facility +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [12/16] 1a5530bb0a42f5771a46bb21934b77035d26aa54 (thuth/qemu-kvm-cs9) + +This facility indicates reduced support for noncontrained +transactional-execution. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-12-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 12417b713c1fffc26c680e99e3429f055eb9af2e) +--- + target/s390x/cpu_features_def.h.inc | 1 + + target/s390x/cpu_models.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index df154d145f..2c1d1cd98a 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -112,6 +112,7 @@ DEF_FEAT(MSA_EXT_9, "msa9-base", STFL, 155, "Message-security-assist-extension-9 + DEF_FEAT(ETOKEN, "etoken", STFL, 156, "Etoken facility") + DEF_FEAT(UNPACK, "unpack", STFL, 161, "Unpack facility") + DEF_FEAT(NNPA, "nnpa", STFL, 165, "NNPA facility") ++DEF_FEAT(INEFF_NC_TX, "ineff_nc_tx", STFL, 170, "Ineffective-nonconstrained-transaction facility") + DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH2, "vxpdeh2", STFL, 192, "Vector-Packed-Decimal-Enhancement facility 2") + DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") + DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 94cc6a0f3e..9e9f6dae07 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -515,6 +515,7 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_PFCR_CSDSTG, S390_FEAT_CCF_BASE }, + { S390_FEAT_PFCR_CSTST, S390_FEAT_CCF_BASE }, + { S390_FEAT_PFCR_CSTSTG, S390_FEAT_CCF_BASE }, ++ { S390_FEAT_INEFF_NC_TX, S390_FEAT_TRANSACTIONAL_EXE }, + }; + int i; + +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch b/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch new file mode 100644 index 0000000..645294c --- /dev/null +++ b/kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch @@ -0,0 +1,42 @@ +From f836a70baeebc6cfff87f3b8cf39bc82225cd88f Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:45 +0100 +Subject: [PATCH 10/18] s390x/cpumodel: add + Miscellaneous-Instruction-Extensions Facility 4 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [10/16] 375acf46d9a9950c939e0bf95c6512f6df3b3b3d (thuth/qemu-kvm-cs9) + +This facility introduces few new instructions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-10-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit e68e5ea6fe87c0177ea6421045c1d46f223a861e) +--- + target/s390x/cpu_features_def.h.inc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 0b7be0e6e9..8be2e0e46d 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -90,6 +90,7 @@ DEF_FEAT(EDAT_2, "edat2", STFL, 78, "Enhanced-DAT facility 2") + DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packed-conversion facility") + DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") + DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") ++DEF_FEAT(MISC_INSTRUCTION_EXT4, "minste4", STFL, 84, "Miscellaneous-Instruction-Extensions Facility 4") + DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") + DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") + DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch b/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch new file mode 100644 index 0000000..fe6327e --- /dev/null +++ b/kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch @@ -0,0 +1,56 @@ +From 38d15311c53d6f973ad6bcffe5a851fed58d82cf Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:44 +0100 +Subject: [PATCH 09/18] s390x/cpumodel: add Vector Enhancements facility 3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [9/16] 0e28c1a3a458b035a165e6d0f6e65290efce4cf0 (thuth/qemu-kvm-cs9) + +The Vector Enhancements facility 3 introduces new instructions and +extends support for doubleword/quadword elements. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-9-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 0b2c66a3fa5ccecf26ea011d97d65a986b42b4d8) +--- + target/s390x/cpu_features_def.h.inc | 1 + + target/s390x/cpu_models.c | 2 ++ + 2 files changed, 3 insertions(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 09872ab3d8..0b7be0e6e9 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -116,6 +116,7 @@ DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") + DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") + DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") + DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") ++DEF_FEAT(VECTOR_ENH3, "vxeh3", STFL, 198, "Vector Enhancements facility 3") + DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") + + /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index cb45911ac0..5fb5c6f38e 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -461,6 +461,8 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH, S390_FEAT_VECTOR_PACKED_DECIMAL }, + { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH }, + { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR }, ++ { S390_FEAT_VECTOR_ENH2, S390_FEAT_VECTOR_ENH }, ++ { S390_FEAT_VECTOR_ENH3, S390_FEAT_VECTOR_ENH2 }, + { S390_FEAT_INSTRUCTION_EXEC_PROT, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2 }, + { S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2, S390_FEAT_ESOP }, + { S390_FEAT_CMM_NT, S390_FEAT_CMM }, +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch b/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch new file mode 100644 index 0000000..4dd3499 --- /dev/null +++ b/kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch @@ -0,0 +1,56 @@ +From 846d00e369c2ff33201c4a7ae4a303f4feb82c8f Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:46 +0100 +Subject: [PATCH 11/18] s390x/cpumodel: add Vector-Packed-Decimal-Enhancement + facility 3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [11/16] 4ab6618fe8fda8277fc92d0de6505df034f8c9fe (thuth/qemu-kvm-cs9) + +This facility introduces new capabilities for the signed-pack-decimal +format. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-11-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit db4c208abde53a7ed16d566bf63a3520894bba8d) +--- + target/s390x/cpu_features_def.h.inc | 1 + + target/s390x/cpu_models.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 8be2e0e46d..df154d145f 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -118,6 +118,7 @@ DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") + DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") + DEF_FEAT(PAIE, "paie", STFL, 197, "Processor-Activity-Instrumentation extension-1") + DEF_FEAT(VECTOR_ENH3, "vxeh3", STFL, 198, "Vector Enhancements facility 3") ++DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH3, "vxpdeh3", STFL, 199, "Vector-Packed-Decimal-Enhancement facility 3") + DEF_FEAT(CCF_BASE, "ccf-base", STFL, 201, "Concurrent-Functions facility") + + /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 5fb5c6f38e..94cc6a0f3e 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -460,6 +460,7 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_VECTOR_PACKED_DECIMAL, S390_FEAT_VECTOR }, + { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH, S390_FEAT_VECTOR_PACKED_DECIMAL }, + { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH }, ++ { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2 }, + { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR }, + { S390_FEAT_VECTOR_ENH2, S390_FEAT_VECTOR_ENH }, + { S390_FEAT_VECTOR_ENH3, S390_FEAT_VECTOR_ENH2 }, +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-msa10-subfunctions.patch b/kvm-s390x-cpumodel-add-msa10-subfunctions.patch new file mode 100644 index 0000000..c0a15bc --- /dev/null +++ b/kvm-s390x-cpumodel-add-msa10-subfunctions.patch @@ -0,0 +1,133 @@ +From be8c87d33304948258dad5e46582c588ff795344 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:37 +0100 +Subject: [PATCH 02/18] s390x/cpumodel: add msa10 subfunctions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [2/16] 967e78e0d496cf5241bfcee7b96b0308b5cedbda (thuth/qemu-kvm-cs9) + +MSA10 introduces new AES XTS subfunctions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Christian Borntraeger +Message-ID: <20241206122751.189721-2-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 1029cd5b9827ba6aa7f5e02eed1928a928e2fa5e) +--- + target/s390x/cpu_features.c | 2 ++ + target/s390x/cpu_features_def.h.inc | 6 ++++++ + target/s390x/cpu_models.c | 4 ++++ + target/s390x/gen-features.c | 20 ++++++++++++++++++++ + 4 files changed, 32 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index cb4e2b8920..a3c239595a 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -252,6 +252,8 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("msa8", MSA_EXT_8, "Message-security-assist-extension 8 facility"), + FEAT_GROUP_INIT("msa9", MSA_EXT_9, "Message-security-assist-extension 9 facility"), + FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), ++ FEAT_GROUP_INIT("msa10", MSA_EXT_10, "Message-security-assist-extension 10 facility"), ++ FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), + FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index c53ac13352..104d186c3f 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -233,6 +233,10 @@ DEF_FEAT(KM_XTS_AES_128, "km-xts-aes-128", KM, 50, "KM XTS-AES-128") + DEF_FEAT(KM_XTS_AES_256, "km-xts-aes-256", KM, 52, "KM XTS-AES-256") + DEF_FEAT(KM_XTS_EAES_128, "km-xts-eaes-128", KM, 58, "KM XTS-Encrypted-AES-128") + DEF_FEAT(KM_XTS_EAES_256, "km-xts-eaes-256", KM, 60, "KM XTS-Encrypted-AES-256") ++DEF_FEAT(KM_FULL_XTS_AES_128, "km-full-xts-aes-128", KM, 82, "KM Full-XTS-AES-128") ++DEF_FEAT(KM_FULL_XTS_AES_256, "km-full-xts-aes-256", KM, 84, "KM Full-XTS-AES-256") ++DEF_FEAT(KM_FULL_XTS_EAES_128, "km-full-xts-eaes-128", KM, 90, "KM Full-XTS-Encrypted-AES-128") ++DEF_FEAT(KM_FULL_XTS_EAES_256, "km-full-xts-eaes-256", KM, 92, "KM Full-XTS-Encrypted-AES-256") + + /* Features exposed via the KIMD instruction. */ + DEF_FEAT(KIMD_SHA_1, "kimd-sha-1", KIMD, 1, "KIMD SHA-1") +@@ -264,6 +268,8 @@ DEF_FEAT(PCKMO_ETDEA_256, "pckmo-etdea-192", PCKMO, 3, "PCKMO Encrypted-TDEA-192 + DEF_FEAT(PCKMO_AES_128, "pckmo-aes-128", PCKMO, 18, "PCKMO Encrypted-AES-128-Key") + DEF_FEAT(PCKMO_AES_192, "pckmo-aes-192", PCKMO, 19, "PCKMO Encrypted-AES-192-Key") + DEF_FEAT(PCKMO_AES_256, "pckmo-aes-256", PCKMO, 20, "PCKMO Encrypted-AES-256-Key") ++DEF_FEAT(PCKMO_AES_XTS_128_DK, "pckmo-aes-xts-128-dk", PCKMO, 21, "PCKMO Encrypt-AES-XTS-128-Double-Key") ++DEF_FEAT(PCKMO_AES_XTS_256_DK, "pckmo-aes-xts-256-dk", PCKMO, 22, "PCKMO Encrypt-AES-XTS-256-Double-Key") + DEF_FEAT(PCKMO_ECC_P256, "pckmo-ecc-p256", PCKMO, 32, "PCKMO Encrypt-ECC-P256-Key") + DEF_FEAT(PCKMO_ECC_P384, "pckmo-ecc-p384", PCKMO, 33, "PCKMO Encrypt-ECC-P384-Key") + DEF_FEAT(PCKMO_ECC_P521, "pckmo-ecc-p521", PCKMO, 34, "PCKMO Encrypt-ECC-P521-Key") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 8afa9af1a5..e71c445379 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -480,6 +480,10 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_KLMD_SHA3_512, S390_FEAT_MSA }, + { S390_FEAT_KLMD_SHAKE_128, S390_FEAT_MSA }, + { S390_FEAT_KLMD_SHAKE_256, S390_FEAT_MSA }, ++ { S390_FEAT_KM_FULL_XTS_AES_128, S390_FEAT_MSA_EXT_4 }, ++ { S390_FEAT_KM_FULL_XTS_AES_256, S390_FEAT_MSA_EXT_4 }, ++ { S390_FEAT_KM_FULL_XTS_EAES_128, S390_FEAT_MSA_EXT_4 }, ++ { S390_FEAT_KM_FULL_XTS_EAES_256, S390_FEAT_MSA_EXT_4 }, + { S390_FEAT_PRNO_TRNG_QRTCR, S390_FEAT_MSA_EXT_5 }, + { S390_FEAT_PRNO_TRNG, S390_FEAT_MSA_EXT_5 }, + { S390_FEAT_SIE_KSS, S390_FEAT_SIE_F2 }, +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 2b2bfc3736..06c3bf64f3 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -246,6 +246,16 @@ + S390_FEAT_PCKMO_ECC_ED25519, \ + S390_FEAT_PCKMO_ECC_ED448 + ++#define S390_FEAT_GROUP_MSA_EXT_10 \ ++ S390_FEAT_KM_FULL_XTS_AES_128, \ ++ S390_FEAT_KM_FULL_XTS_AES_256, \ ++ S390_FEAT_KM_FULL_XTS_EAES_128, \ ++ S390_FEAT_KM_FULL_XTS_EAES_256 ++ ++#define S390_FEAT_GROUP_MSA_EXT_10_PCKMO \ ++ S390_FEAT_PCKMO_AES_XTS_128_DK, \ ++ S390_FEAT_PCKMO_AES_XTS_256_DK ++ + #define S390_FEAT_GROUP_ENH_SORT \ + S390_FEAT_ESORT_BASE, \ + S390_FEAT_SORTL_SFLR, \ +@@ -307,10 +317,18 @@ static uint16_t group_MSA_EXT_9[] = { + S390_FEAT_GROUP_MSA_EXT_9, + }; + ++static uint16_t group_MSA_EXT_10[] = { ++ S390_FEAT_GROUP_MSA_EXT_10, ++}; ++ + static uint16_t group_MSA_EXT_9_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_9_PCKMO, + }; + ++static uint16_t group_MSA_EXT_10_PCKMO[] = { ++ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, ++}; ++ + static uint16_t group_ENH_SORT[] = { + S390_FEAT_GROUP_ENH_SORT, + }; +@@ -858,6 +876,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(MSA_EXT_8), + FEAT_GROUP_INITIALIZER(MSA_EXT_9), + FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_10), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), + FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), + FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-msa11-subfunctions.patch b/kvm-s390x-cpumodel-add-msa11-subfunctions.patch new file mode 100644 index 0000000..59d7369 --- /dev/null +++ b/kvm-s390x-cpumodel-add-msa11-subfunctions.patch @@ -0,0 +1,148 @@ +From 328b55dd31fce9e849d8dd10124cda47013d3035 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:38 +0100 +Subject: [PATCH 03/18] s390x/cpumodel: add msa11 subfunctions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [3/16] 8b4158361a17d973fa30a7bcb9d911a2c5a42b14 (thuth/qemu-kvm-cs9) + +MSA11 introduces new HMAC subfunctions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Christian Borntraeger +Message-ID: <20241206122751.189721-3-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 11dc9020824c81552b021fbe0e2910e0348e7f8e) +--- + target/s390x/cpu_features.c | 2 ++ + target/s390x/cpu_features_def.h.inc | 10 ++++++++++ + target/s390x/cpu_models.c | 8 ++++++++ + target/s390x/gen-features.c | 24 ++++++++++++++++++++++++ + 4 files changed, 44 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index a3c239595a..36930feccd 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -254,6 +254,8 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("msa9_pckmo", MSA_EXT_9_PCKMO, "Message-security-assist-extension 9 PCKMO subfunctions"), + FEAT_GROUP_INIT("msa10", MSA_EXT_10, "Message-security-assist-extension 10 facility"), + FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), ++ FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), ++ FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), + FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 104d186c3f..15ea51fc54 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -200,6 +200,14 @@ DEF_FEAT(KMAC_AES_256, "kmac-aes-256", KMAC, 20, "KMAC AES-256") + DEF_FEAT(KMAC_EAES_128, "kmac-eaes-128", KMAC, 26, "KMAC Encrypted-AES-128") + DEF_FEAT(KMAC_EAES_192, "kmac-eaes-192", KMAC, 27, "KMAC Encrypted-AES-192") + DEF_FEAT(KMAC_EAES_256, "kmac-eaes-256", KMAC, 28, "KMAC Encrypted-AES-256") ++DEF_FEAT(KMAC_HMAC_SHA_224, "kmac-hmac-sha-224", KMAC, 112, "KMAC HMAC-SHA-224") ++DEF_FEAT(KMAC_HMAC_SHA_256, "kmac-hmac-sha-246", KMAC, 113, "KMAC HMAC-SHA-256") ++DEF_FEAT(KMAC_HMAC_SHA_384, "kmac-hmac-sha-384", KMAC, 114, "KMAC HMAC-SHA-384") ++DEF_FEAT(KMAC_HMAC_SHA_512, "kmac-hmac-sha-512", KMAC, 115, "KMAC HMAC-SHA-512") ++DEF_FEAT(KMAC_HMAC_ESHA_224, "kmac-hmac-esha-224", KMAC, 120, "KMAC HMAC-Encrypted-SHA-224") ++DEF_FEAT(KMAC_HMAC_ESHA_256, "kmac-hmac-esha-246", KMAC, 121, "KMAC HMAC-Encrypted-SHA-256") ++DEF_FEAT(KMAC_HMAC_ESHA_384, "kmac-hmac-esha-384", KMAC, 122, "KMAC HMAC-Encrypted-SHA-384") ++DEF_FEAT(KMAC_HMAC_ESHA_512, "kmac-hmac-esha-512", KMAC, 123, "KMAC HMAC-Encrypted-SHA-512") + + /* Features exposed via the KMC instruction. */ + DEF_FEAT(KMC_DEA, "kmc-dea", KMC, 1, "KMC DEA") +@@ -275,6 +283,8 @@ DEF_FEAT(PCKMO_ECC_P384, "pckmo-ecc-p384", PCKMO, 33, "PCKMO Encrypt-ECC-P384-Ke + DEF_FEAT(PCKMO_ECC_P521, "pckmo-ecc-p521", PCKMO, 34, "PCKMO Encrypt-ECC-P521-Key") + DEF_FEAT(PCKMO_ECC_ED25519, "pckmo-ecc-ed25519", PCKMO, 40 , "PCKMO Encrypt-ECC-Ed25519-Key") + DEF_FEAT(PCKMO_ECC_ED448, "pckmo-ecc-ed448", PCKMO, 41 , "PCKMO Encrypt-ECC-Ed448-Key") ++DEF_FEAT(PCKMO_HMAC_512, "pckmo-hmac-512", PCKMO, 118, "PCKMO Encrypt-HMAC-512-Key") ++DEF_FEAT(PCKMO_HMAC_1024, "pckmo-hmac-1024", PCKMO, 122, "PCKMO Encrypt-HMAC-1024-Key") + + /* Features exposed via the KMCTR instruction. */ + DEF_FEAT(KMCTR_DEA, "kmctr-dea", KMCTR, 1, "KMCTR DEA") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index e71c445379..da441b7b10 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -480,6 +480,14 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_KLMD_SHA3_512, S390_FEAT_MSA }, + { S390_FEAT_KLMD_SHAKE_128, S390_FEAT_MSA }, + { S390_FEAT_KLMD_SHAKE_256, S390_FEAT_MSA }, ++ { S390_FEAT_KMAC_HMAC_SHA_224, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_SHA_256, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_SHA_384, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_SHA_512, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_ESHA_224, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_ESHA_256, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_ESHA_384, S390_FEAT_MSA_EXT_3 }, ++ { S390_FEAT_KMAC_HMAC_ESHA_512, S390_FEAT_MSA_EXT_3 }, + { S390_FEAT_KM_FULL_XTS_AES_128, S390_FEAT_MSA_EXT_4 }, + { S390_FEAT_KM_FULL_XTS_AES_256, S390_FEAT_MSA_EXT_4 }, + { S390_FEAT_KM_FULL_XTS_EAES_128, S390_FEAT_MSA_EXT_4 }, +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 06c3bf64f3..d6305f945a 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -256,6 +256,20 @@ + S390_FEAT_PCKMO_AES_XTS_128_DK, \ + S390_FEAT_PCKMO_AES_XTS_256_DK + ++#define S390_FEAT_GROUP_MSA_EXT_11 \ ++ S390_FEAT_KMAC_HMAC_SHA_224, \ ++ S390_FEAT_KMAC_HMAC_SHA_256, \ ++ S390_FEAT_KMAC_HMAC_SHA_384, \ ++ S390_FEAT_KMAC_HMAC_SHA_512, \ ++ S390_FEAT_KMAC_HMAC_ESHA_224, \ ++ S390_FEAT_KMAC_HMAC_ESHA_256, \ ++ S390_FEAT_KMAC_HMAC_ESHA_384, \ ++ S390_FEAT_KMAC_HMAC_ESHA_512 ++ ++#define S390_FEAT_GROUP_MSA_EXT_11_PCKMO \ ++ S390_FEAT_PCKMO_HMAC_512, \ ++ S390_FEAT_PCKMO_HMAC_1024 ++ + #define S390_FEAT_GROUP_ENH_SORT \ + S390_FEAT_ESORT_BASE, \ + S390_FEAT_SORTL_SFLR, \ +@@ -321,6 +335,10 @@ static uint16_t group_MSA_EXT_10[] = { + S390_FEAT_GROUP_MSA_EXT_10, + }; + ++static uint16_t group_MSA_EXT_11[] = { ++ S390_FEAT_GROUP_MSA_EXT_11, ++}; ++ + static uint16_t group_MSA_EXT_9_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_9_PCKMO, + }; +@@ -329,6 +347,10 @@ static uint16_t group_MSA_EXT_10_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_10_PCKMO, + }; + ++static uint16_t group_MSA_EXT_11_PCKMO[] = { ++ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, ++}; ++ + static uint16_t group_ENH_SORT[] = { + S390_FEAT_GROUP_ENH_SORT, + }; +@@ -878,6 +900,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(MSA_EXT_9_PCKMO), + FEAT_GROUP_INITIALIZER(MSA_EXT_10), + FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_11), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), + FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), + FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-msa12-changes.patch b/kvm-s390x-cpumodel-add-msa12-changes.patch new file mode 100644 index 0000000..44a1bef --- /dev/null +++ b/kvm-s390x-cpumodel-add-msa12-changes.patch @@ -0,0 +1,88 @@ +From 2016aa4ba5c5aecae350ce6ea81462c9ab5956c3 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:39 +0100 +Subject: [PATCH 04/18] s390x/cpumodel: add msa12 changes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [4/16] c878296ee5c4f99f67f1c68172536b521be60e04 (thuth/qemu-kvm-cs9) + +MSA12 changes the KIMD/KLMD instruction format for SHA3/SHAKE. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Christian Borntraeger +Message-ID: <20241206122751.189721-4-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 496fc02e0e532f8917fa96e45fa531231e821c31) +--- + target/s390x/cpu_features.c | 1 + + target/s390x/cpu_features_def.h.inc | 1 + + target/s390x/gen-features.c | 8 ++++++++ + 3 files changed, 10 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index 36930feccd..0e0b37ab95 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -256,6 +256,7 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("msa10_pckmo", MSA_EXT_10_PCKMO, "Message-security-assist-extension 10 PCKMO subfunctions"), + FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), + FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), ++ FEAT_GROUP_INIT("msa12", MSA_EXT_12, "Message-security-assist-extension 12 facility"), + FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 15ea51fc54..2e5dc96984 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -90,6 +90,7 @@ DEF_FEAT(EDAT_2, "edat2", STFL, 78, "Enhanced-DAT facility 2") + DEF_FEAT(DFP_PACKED_CONVERSION, "dfppc", STFL, 80, "Decimal-floating-point packed-conversion facility") + DEF_FEAT(PPA15, "ppa15", STFL, 81, "PPA15 is installed") + DEF_FEAT(BPB, "bpb", STFL, 82, "Branch prediction blocking") ++DEF_FEAT(MSA_EXT_12, "msa12-base", STFL, 86, "Message-security-assist-extension-12 facility (excluding subfunctions)") + DEF_FEAT(VECTOR, "vx", STFL, 129, "Vector facility") + DEF_FEAT(INSTRUCTION_EXEC_PROT, "iep", STFL, 130, "Instruction-execution-protection facility") + DEF_FEAT(SIDE_EFFECT_ACCESS_ESOP2, "sea_esop2", STFL, 131, "Side-effect-access facility and Enhanced-suppression-on-protection facility 2") +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index d6305f945a..ab9ad51d5e 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -270,6 +270,9 @@ + S390_FEAT_PCKMO_HMAC_512, \ + S390_FEAT_PCKMO_HMAC_1024 + ++#define S390_FEAT_GROUP_MSA_EXT_12 \ ++ S390_FEAT_MSA_EXT_12 ++ + #define S390_FEAT_GROUP_ENH_SORT \ + S390_FEAT_ESORT_BASE, \ + S390_FEAT_SORTL_SFLR, \ +@@ -339,6 +342,10 @@ static uint16_t group_MSA_EXT_11[] = { + S390_FEAT_GROUP_MSA_EXT_11, + }; + ++static uint16_t group_MSA_EXT_12[] = { ++ S390_FEAT_GROUP_MSA_EXT_12, ++}; ++ + static uint16_t group_MSA_EXT_9_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_9_PCKMO, + }; +@@ -902,6 +909,7 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(MSA_EXT_10_PCKMO), + FEAT_GROUP_INITIALIZER(MSA_EXT_11), + FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_12), + FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), + FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-add-msa13-subfunctions.patch b/kvm-s390x-cpumodel-add-msa13-subfunctions.patch new file mode 100644 index 0000000..98d9932 --- /dev/null +++ b/kvm-s390x-cpumodel-add-msa13-subfunctions.patch @@ -0,0 +1,200 @@ +From 003efbebc77300d3004f4613255e04058165ff33 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:40 +0100 +Subject: [PATCH 05/18] s390x/cpumodel: add msa13 subfunctions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [5/16] b3f42a4a831bc0582e3c14da6387d7db440c3c41 (thuth/qemu-kvm-cs9) + +MSA13 introduces query authentication information (QAI) subfunctions. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-5-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit ba4614fdacc2ea55060ddb48bdb2ebd21d0c3464) +--- + target/s390x/cpu_features.c | 2 ++ + target/s390x/cpu_features_def.h.inc | 12 ++++++++++++ + target/s390x/gen-features.c | 26 ++++++++++++++++++++++++++ + 3 files changed, 40 insertions(+) + +diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c +index 0e0b37ab95..9ba127e386 100644 +--- a/target/s390x/cpu_features.c ++++ b/target/s390x/cpu_features.c +@@ -257,6 +257,8 @@ static S390FeatGroupDef s390_feature_groups[] = { + FEAT_GROUP_INIT("msa11", MSA_EXT_11, "Message-security-assist-extension 11 facility"), + FEAT_GROUP_INIT("msa11_pckmo", MSA_EXT_11_PCKMO, "Message-security-assist-extension 11 PCKMO subfunctions"), + FEAT_GROUP_INIT("msa12", MSA_EXT_12, "Message-security-assist-extension 12 facility"), ++ FEAT_GROUP_INIT("msa13", MSA_EXT_13, "Message-security-assist-extension 13 facility"), ++ FEAT_GROUP_INIT("msa13_pckmo", MSA_EXT_13_PCKMO, "Message-security-assist-extension 13 PCKMO subfunctions"), + FEAT_GROUP_INIT("mepochptff", MULTIPLE_EPOCH_PTFF, "PTFF enhancements introduced with Multiple-epoch facility"), + FEAT_GROUP_INIT("esort", ENH_SORT, "Enhanced-sort facility"), + FEAT_GROUP_INIT("deflate", DEFLATE_CONVERSION, "Deflate-conversion facility"), +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 2e5dc96984..2132837ffe 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -209,6 +209,7 @@ DEF_FEAT(KMAC_HMAC_ESHA_224, "kmac-hmac-esha-224", KMAC, 120, "KMAC HMAC-Encrypt + DEF_FEAT(KMAC_HMAC_ESHA_256, "kmac-hmac-esha-246", KMAC, 121, "KMAC HMAC-Encrypted-SHA-256") + DEF_FEAT(KMAC_HMAC_ESHA_384, "kmac-hmac-esha-384", KMAC, 122, "KMAC HMAC-Encrypted-SHA-384") + DEF_FEAT(KMAC_HMAC_ESHA_512, "kmac-hmac-esha-512", KMAC, 123, "KMAC HMAC-Encrypted-SHA-512") ++DEF_FEAT(KMAC_QAI, "kmac-qai", KMAC, 127, "KMAC Query-Authentication-Information") + + /* Features exposed via the KMC instruction. */ + DEF_FEAT(KMC_DEA, "kmc-dea", KMC, 1, "KMC DEA") +@@ -246,6 +247,7 @@ DEF_FEAT(KM_FULL_XTS_AES_128, "km-full-xts-aes-128", KM, 82, "KM Full-XTS-AES-12 + DEF_FEAT(KM_FULL_XTS_AES_256, "km-full-xts-aes-256", KM, 84, "KM Full-XTS-AES-256") + DEF_FEAT(KM_FULL_XTS_EAES_128, "km-full-xts-eaes-128", KM, 90, "KM Full-XTS-Encrypted-AES-128") + DEF_FEAT(KM_FULL_XTS_EAES_256, "km-full-xts-eaes-256", KM, 92, "KM Full-XTS-Encrypted-AES-256") ++DEF_FEAT(KM_QAI, "km-qai", KM, 127, "KM Query-Authentication-Information") + + /* Features exposed via the KIMD instruction. */ + DEF_FEAT(KIMD_SHA_1, "kimd-sha-1", KIMD, 1, "KIMD SHA-1") +@@ -258,6 +260,7 @@ DEF_FEAT(KIMD_SHA3_512, "kimd-sha3-512", KIMD, 35, "KIMD SHA3-512") + DEF_FEAT(KIMD_SHAKE_128, "kimd-shake-128", KIMD, 36, "KIMD SHAKE-128") + DEF_FEAT(KIMD_SHAKE_256, "kimd-shake-256", KIMD, 37, "KIMD SHAKE-256") + DEF_FEAT(KIMD_GHASH, "kimd-ghash", KIMD, 65, "KIMD GHASH") ++DEF_FEAT(KIMD_QAI, "kimd-qai", KIMD, 127, "KIMD Query-Authentication-Information") + + /* Features exposed via the KLMD instruction. */ + DEF_FEAT(KLMD_SHA_1, "klmd-sha-1", KLMD, 1, "KLMD SHA-1") +@@ -269,6 +272,7 @@ DEF_FEAT(KLMD_SHA3_384, "klmd-sha3-384", KLMD, 34, "KLMD SHA3-384") + DEF_FEAT(KLMD_SHA3_512, "klmd-sha3-512", KLMD, 35, "KLMD SHA3-512") + DEF_FEAT(KLMD_SHAKE_128, "klmd-shake-128", KLMD, 36, "KLMD SHAKE-128") + DEF_FEAT(KLMD_SHAKE_256, "klmd-shake-256", KLMD, 37, "KLMD SHAKE-256") ++DEF_FEAT(KLMD_QAI, "klmd-qai", KLMD, 127, "KLMD Query-Authentication-Information") + + /* Features exposed via the PCKMO instruction. */ + DEF_FEAT(PCKMO_EDEA, "pckmo-edea", PCKMO, 1, "PCKMO Encrypted-DEA-Key") +@@ -286,6 +290,7 @@ DEF_FEAT(PCKMO_ECC_ED25519, "pckmo-ecc-ed25519", PCKMO, 40 , "PCKMO Encrypt-ECC- + DEF_FEAT(PCKMO_ECC_ED448, "pckmo-ecc-ed448", PCKMO, 41 , "PCKMO Encrypt-ECC-Ed448-Key") + DEF_FEAT(PCKMO_HMAC_512, "pckmo-hmac-512", PCKMO, 118, "PCKMO Encrypt-HMAC-512-Key") + DEF_FEAT(PCKMO_HMAC_1024, "pckmo-hmac-1024", PCKMO, 122, "PCKMO Encrypt-HMAC-1024-Key") ++DEF_FEAT(PCKMO_QAI, "pckmo-qai", PCKMO, 127, "PCKMO Query-Authentication-Information") + + /* Features exposed via the KMCTR instruction. */ + DEF_FEAT(KMCTR_DEA, "kmctr-dea", KMCTR, 1, "KMCTR DEA") +@@ -300,6 +305,7 @@ DEF_FEAT(KMCTR_AES_256, "kmctr-aes-256", KMCTR, 20, "KMCTR AES-256") + DEF_FEAT(KMCTR_EAES_128, "kmctr-eaes-128", KMCTR, 26, "KMCTR Encrypted-AES-128") + DEF_FEAT(KMCTR_EAES_192, "kmctr-eaes-192", KMCTR, 27, "KMCTR Encrypted-AES-192") + DEF_FEAT(KMCTR_EAES_256, "kmctr-eaes-256", KMCTR, 28, "KMCTR Encrypted-AES-256") ++DEF_FEAT(KMCTR_QAI, "kmctr-qai", KMCTR, 127, "KMCTR Query-Authentication-Information") + + /* Features exposed via the KMF instruction. */ + DEF_FEAT(KMF_DEA, "kmf-dea", KMF, 1, "KMF DEA") +@@ -314,6 +320,7 @@ DEF_FEAT(KMF_AES_256, "kmf-aes-256", KMF, 20, "KMF AES-256") + DEF_FEAT(KMF_EAES_128, "kmf-eaes-128", KMF, 26, "KMF Encrypted-AES-128") + DEF_FEAT(KMF_EAES_192, "kmf-eaes-192", KMF, 27, "KMF Encrypted-AES-192") + DEF_FEAT(KMF_EAES_256, "kmf-eaes-256", KMF, 28, "KMF Encrypted-AES-256") ++DEF_FEAT(KMF_QAI, "kmf-qai", KMF, 127, "KMF Query-Authentication-Information") + + /* Features exposed via the KMO instruction. */ + DEF_FEAT(KMO_DEA, "kmo-dea", KMO, 1, "KMO DEA") +@@ -328,6 +335,7 @@ DEF_FEAT(KMO_AES_256, "kmo-aes-256", KMO, 20, "KMO AES-256") + DEF_FEAT(KMO_EAES_128, "kmo-eaes-128", KMO, 26, "KMO Encrypted-AES-128") + DEF_FEAT(KMO_EAES_192, "kmo-eaes-192", KMO, 27, "KMO Encrypted-AES-192") + DEF_FEAT(KMO_EAES_256, "kmo-eaes-256", KMO, 28, "KMO Encrypted-AES-256") ++DEF_FEAT(KMO_QAI, "kmo-qai", KMO, 127, "KMO Query-Authentication-Information") + + /* Features exposed via the PCC instruction. */ + DEF_FEAT(PCC_CMAC_DEA, "pcc-cmac-dea", PCC, 1, "PCC Compute-Last-Block-CMAC-Using-DEA") +@@ -353,11 +361,13 @@ DEF_FEAT(PCC_SCALAR_MULT_ED25519, "pcc-scalar-mult-ed25519", PCC, 72, "PCC Scala + DEF_FEAT(PCC_SCALAR_MULT_ED448, "pcc-scalar-mult-ed448", PCC, 73, "PCC Scalar-Multiply-Ed448") + DEF_FEAT(PCC_SCALAR_MULT_X25519, "pcc-scalar-mult-x25519", PCC, 80, "PCC Scalar-Multiply-X25519") + DEF_FEAT(PCC_SCALAR_MULT_X448, "pcc-scalar-mult-x448", PCC, 81, "PCC Scalar-Multiply-X448") ++DEF_FEAT(PCC_QAI, "pcc-qai", PCC, 127, "PCC Query-Authentication-Information") + + /* Features exposed via the PPNO/PRNO instruction. */ + DEF_FEAT(PPNO_SHA_512_DRNG, "ppno-sha-512-drng", PPNO, 3, "PPNO SHA-512-DRNG") + DEF_FEAT(PRNO_TRNG_QRTCR, "prno-trng-qrtcr", PPNO, 112, "PRNO TRNG-Query-Raw-to-Conditioned-Ratio") + DEF_FEAT(PRNO_TRNG, "prno-trng", PPNO, 114, "PRNO TRNG") ++DEF_FEAT(PRNO_QAI, "prno-qai", PPNO, 127, "PRNO Query-Authentication-Information") + + /* Features exposed via the KMA instruction. */ + DEF_FEAT(KMA_GCM_AES_128, "kma-gcm-aes-128", KMA, 18, "KMA GCM-AES-128") +@@ -366,6 +376,7 @@ DEF_FEAT(KMA_GCM_AES_256, "kma-gcm-aes-256", KMA, 20, "KMA GCM-AES-256") + DEF_FEAT(KMA_GCM_EAES_128, "kma-gcm-eaes-128", KMA, 26, "KMA GCM-Encrypted-AES-128") + DEF_FEAT(KMA_GCM_EAES_192, "kma-gcm-eaes-192", KMA, 27, "KMA GCM-Encrypted-AES-192") + DEF_FEAT(KMA_GCM_EAES_256, "kma-gcm-eaes-256", KMA, 28, "KMA GCM-Encrypted-AES-256") ++DEF_FEAT(KMA_QAI, "kma-qai", KMA, 127, "KMA Query-Authentication-Information") + + /* Features exposed via the KDSA instruction. */ + DEF_FEAT(KDSA_ECDSA_VERIFY_P256, "kdsa-ecdsa-verify-p256", KDSA, 1, "KDSA ECDSA-Verify-P256") +@@ -383,6 +394,7 @@ DEF_FEAT(KDSA_EDDSA_SIGN_ED25519, "kdsa-eddsa-sign-ed25519", KDSA, 40, "KDSA EdD + DEF_FEAT(KDSA_EDDSA_SIGN_ED448, "kdsa-eddsa-sign-ed448", KDSA, 44, "KDSA EdDSA-Sign-Ed448") + DEF_FEAT(KDSA_EEDDSA_SIGN_ED25519, "kdsa-eeddsa-sign-ed25519", KDSA, 48, "KDSA Encrypted-EdDSA-Sign-Ed25519") + DEF_FEAT(KDSA_EEDDSA_SIGN_ED448, "kdsa-eeddsa-sign-ed448", KDSA, 52, "KDSA Encrypted-EdDSA-Sign-Ed448") ++DEF_FEAT(KDSA_QAI, "kdsa-qai", KDSA, 127, "KDSA Query-Authentication-Information") + + /* Features exposed via the SORTL instruction. */ + DEF_FEAT(SORTL_SFLR, "sortl-sflr", SORTL, 1, "SORTL SFLR") +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index ab9ad51d5e..3326e7df43 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -273,6 +273,22 @@ + #define S390_FEAT_GROUP_MSA_EXT_12 \ + S390_FEAT_MSA_EXT_12 + ++#define S390_FEAT_GROUP_MSA_EXT_13 \ ++ S390_FEAT_KDSA_QAI, \ ++ S390_FEAT_KIMD_QAI, \ ++ S390_FEAT_KLMD_QAI, \ ++ S390_FEAT_KMAC_QAI, \ ++ S390_FEAT_KMA_QAI, \ ++ S390_FEAT_KMCTR_QAI, \ ++ S390_FEAT_KMF_QAI, \ ++ S390_FEAT_KMO_QAI, \ ++ S390_FEAT_KM_QAI, \ ++ S390_FEAT_PCC_QAI, \ ++ S390_FEAT_PRNO_QAI ++ ++#define S390_FEAT_GROUP_MSA_EXT_13_PCKMO \ ++ S390_FEAT_PCKMO_QAI ++ + #define S390_FEAT_GROUP_ENH_SORT \ + S390_FEAT_ESORT_BASE, \ + S390_FEAT_SORTL_SFLR, \ +@@ -346,6 +362,10 @@ static uint16_t group_MSA_EXT_12[] = { + S390_FEAT_GROUP_MSA_EXT_12, + }; + ++static uint16_t group_MSA_EXT_13[] = { ++ S390_FEAT_GROUP_MSA_EXT_13, ++}; ++ + static uint16_t group_MSA_EXT_9_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_9_PCKMO, + }; +@@ -358,6 +378,10 @@ static uint16_t group_MSA_EXT_11_PCKMO[] = { + S390_FEAT_GROUP_MSA_EXT_11_PCKMO, + }; + ++static uint16_t group_MSA_EXT_13_PCKMO[] = { ++ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, ++}; ++ + static uint16_t group_ENH_SORT[] = { + S390_FEAT_GROUP_ENH_SORT, + }; +@@ -910,6 +934,8 @@ static FeatGroupDefSpec FeatGroupDef[] = { + FEAT_GROUP_INITIALIZER(MSA_EXT_11), + FEAT_GROUP_INITIALIZER(MSA_EXT_11_PCKMO), + FEAT_GROUP_INITIALIZER(MSA_EXT_12), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_13), ++ FEAT_GROUP_INITIALIZER(MSA_EXT_13_PCKMO), + FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF), + FEAT_GROUP_INITIALIZER(ENH_SORT), + FEAT_GROUP_INITIALIZER(DEFLATE_CONVERSION), +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch b/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch new file mode 100644 index 0000000..da0855a --- /dev/null +++ b/kvm-s390x-cpumodel-correct-PLO-feature-wording.patch @@ -0,0 +1,69 @@ +From bec777b1ca5107cea4f4104c58cdd0c5d9613e33 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:49 +0100 +Subject: [PATCH 14/18] s390x/cpumodel: correct PLO feature wording +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [14/16] 346fd03bd68222125b0b04113a432ae739af84f1 (thuth/qemu-kvm-cs9) + +The PLO functions 0, 4, 8, 12, 16, and 20 use 32-bit registers +values. The plo-*gr variants use 64-bit instead and, thus, correct +the wording. + +Signed-off-by: Hendrik Brueckner +Reviewed-by: Janosch Frank +Message-ID: <20241206122751.189721-14-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 5a0a136df71b858d01f346af4a30ae1da23e8b3c) +--- + target/s390x/cpu_features_def.h.inc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 09a80844a7..fe7e1bd19c 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -158,27 +158,27 @@ DEF_FEAT(AP, "ap", MISC, 0, "AP instructions installed") + /* Features exposed via the PLO instruction. */ + DEF_FEAT(PLO_CL, "plo-cl", PLO, 0, "PLO Compare and load (32 bit in general registers)") + DEF_FEAT(PLO_CLG, "plo-clg", PLO, 1, "PLO Compare and load (64 bit in parameter list)") +-DEF_FEAT(PLO_CLGR, "plo-clgr", PLO, 2, "PLO Compare and load (32 bit in general registers)") ++DEF_FEAT(PLO_CLGR, "plo-clgr", PLO, 2, "PLO Compare and load (64 bit in general registers)") + DEF_FEAT(PLO_CLX, "plo-clx", PLO, 3, "PLO Compare and load (128 bit in parameter list)") + DEF_FEAT(PLO_CS, "plo-cs", PLO, 4, "PLO Compare and swap (32 bit in general registers)") + DEF_FEAT(PLO_CSG, "plo-csg", PLO, 5, "PLO Compare and swap (64 bit in parameter list)") +-DEF_FEAT(PLO_CSGR, "plo-csgr", PLO, 6, "PLO Compare and swap (32 bit in general registers)") ++DEF_FEAT(PLO_CSGR, "plo-csgr", PLO, 6, "PLO Compare and swap (64 bit in general registers)") + DEF_FEAT(PLO_CSX, "plo-csx", PLO, 7, "PLO Compare and swap (128 bit in parameter list)") + DEF_FEAT(PLO_DCS, "plo-dcs", PLO, 8, "PLO Double compare and swap (32 bit in general registers)") + DEF_FEAT(PLO_DCSG, "plo-dcsg", PLO, 9, "PLO Double compare and swap (64 bit in parameter list)") +-DEF_FEAT(PLO_DCSGR, "plo-dcsgr", PLO, 10, "PLO Double compare and swap (32 bit in general registers)") ++DEF_FEAT(PLO_DCSGR, "plo-dcsgr", PLO, 10, "PLO Double compare and swap (64 bit in general registers)") + DEF_FEAT(PLO_DCSX, "plo-dcsx", PLO, 11, "PLO Double compare and swap (128 bit in parameter list)") + DEF_FEAT(PLO_CSST, "plo-csst", PLO, 12, "PLO Compare and swap and store (32 bit in general registers)") + DEF_FEAT(PLO_CSSTG, "plo-csstg", PLO, 13, "PLO Compare and swap and store (64 bit in parameter list)") +-DEF_FEAT(PLO_CSSTGR, "plo-csstgr", PLO, 14, "PLO Compare and swap and store (32 bit in general registers)") ++DEF_FEAT(PLO_CSSTGR, "plo-csstgr", PLO, 14, "PLO Compare and swap and store (64 bit in general registers)") + DEF_FEAT(PLO_CSSTX, "plo-csstx", PLO, 15, "PLO Compare and swap and store (128 bit in parameter list)") + DEF_FEAT(PLO_CSDST, "plo-csdst", PLO, 16, "PLO Compare and swap and double store (32 bit in general registers)") + DEF_FEAT(PLO_CSDSTG, "plo-csdstg", PLO, 17, "PLO Compare and swap and double store (64 bit in parameter list)") +-DEF_FEAT(PLO_CSDSTGR, "plo-csdstgr", PLO, 18, "PLO Compare and swap and double store (32 bit in general registers)") ++DEF_FEAT(PLO_CSDSTGR, "plo-csdstgr", PLO, 18, "PLO Compare and swap and double store (64 bit in general registers)") + DEF_FEAT(PLO_CSDSTX, "plo-csdstx", PLO, 19, "PLO Compare and swap and double store (128 bit in parameter list)") + DEF_FEAT(PLO_CSTST, "plo-cstst", PLO, 20, "PLO Compare and swap and triple store (32 bit in general registers)") + DEF_FEAT(PLO_CSTSTG, "plo-cststg", PLO, 21, "PLO Compare and swap and triple store (64 bit in parameter list)") +-DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (32 bit in general registers)") ++DEF_FEAT(PLO_CSTSTGR, "plo-cststgr", PLO, 22, "PLO Compare and swap and triple store (64 bit in general registers)") + DEF_FEAT(PLO_CSTSTX, "plo-cststx", PLO, 23, "PLO Compare and swap and triple store (128 bit in parameter list)") + + /* Features exposed via the PTFF instruction. */ +-- +2.39.3 + diff --git a/kvm-s390x-cpumodel-gen17-model.patch b/kvm-s390x-cpumodel-gen17-model.patch new file mode 100644 index 0000000..7fc91ae --- /dev/null +++ b/kvm-s390x-cpumodel-gen17-model.patch @@ -0,0 +1,107 @@ +From bf9dd3db72e0e8cde010f649fbe484fdd929ac96 Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Fri, 6 Dec 2024 13:27:51 +0100 +Subject: [PATCH 16/18] s390x/cpumodel: gen17 model +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 305: CPU model for new IBM Z gen17 hardware +RH-Jira: RHEL-32665 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Cédric Le Goater +RH-Commit: [16/16] 97b19706656f5510d1aab760f01e501c1c332bc4 (thuth/qemu-kvm-cs9) + +This commit introduces the definition of the gen17a/gen17b CPU model. + +Signed-off-by: Hendrik Brueckner +Message-ID: <20241206122751.189721-16-brueckner@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit 21b8db229901a51f16aebe342c0508f588ea5006) +--- + target/s390x/cpu_models.c | 2 ++ + target/s390x/gen-features.c | 33 +++++++++++++++++++++++++++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 3fb5b0980e..c326a71237 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -97,6 +97,8 @@ static S390CPUDef s390_cpu_defs[] = { + CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM z15 T02 GA1"), + CPUDEF_INIT(0x3931, 16, 1, 47, 0x08000000U, "gen16a", "IBM 3931 GA1"), + CPUDEF_INIT(0x3932, 16, 1, 47, 0x08000000U, "gen16b", "IBM 3932 GA1"), ++ CPUDEF_INIT(0x9175, 17, 1, 47, 0x08000000U, "gen17a", "IBM 9175 GA1"), ++ CPUDEF_INIT(0x9176, 17, 1, 47, 0x08000000U, "gen17b", "IBM 9176 GA1"), + }; + + #define QEMU_MAX_CPU_TYPE 0x8561 +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index 680d45d303..41840677ce 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -561,6 +561,13 @@ static uint16_t base_GEN15_GA1[] = { + + #define base_GEN16_GA1 EmptyFeat + ++static uint16_t base_GEN17_GA1[] = { ++ S390_FEAT_MISC_INSTRUCTION_EXT4, ++ S390_FEAT_SIF, ++ S390_FEAT_GROUP_MSA_EXT_12, ++ S390_FEAT_GROUP_PLO_EXT, ++}; ++ + /* Full features (in order of release) + * Automatically includes corresponding base features. + * Full features are all features this hardware supports even if kvm/QEMU do not +@@ -715,6 +722,20 @@ static uint16_t full_GEN16_GA1[] = { + S390_FEAT_UV_FEAT_AP_INTR, + }; + ++static uint16_t full_GEN17_GA1[] = { ++ S390_FEAT_VECTOR_ENH3, ++ S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, ++ S390_FEAT_INEFF_NC_TX, ++ S390_FEAT_GROUP_GEN17_PTFF, ++ S390_FEAT_GROUP_MSA_EXT_10, ++ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, ++ S390_FEAT_GROUP_MSA_EXT_11, ++ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, ++ S390_FEAT_GROUP_MSA_EXT_13, ++ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, ++ S390_FEAT_GROUP_CONCURRENT_FUNCTIONS, ++}; ++ + + /* Default features (in order of release) + * Automatically includes corresponding base features. +@@ -810,6 +831,17 @@ static uint16_t default_GEN16_GA1[] = { + S390_FEAT_PAIE, + }; + ++static uint16_t default_GEN17_GA1[] = { ++ S390_FEAT_VECTOR_ENH3, ++ S390_FEAT_VECTOR_PACKED_DECIMAL_ENH3, ++ S390_FEAT_GROUP_MSA_EXT_10, ++ S390_FEAT_GROUP_MSA_EXT_10_PCKMO, ++ S390_FEAT_GROUP_MSA_EXT_11, ++ S390_FEAT_GROUP_MSA_EXT_11_PCKMO, ++ S390_FEAT_GROUP_MSA_EXT_13, ++ S390_FEAT_GROUP_MSA_EXT_13_PCKMO, ++}; ++ + /* QEMU (CPU model) features */ + + static uint16_t qemu_V2_11[] = { +@@ -958,6 +990,7 @@ static CpuFeatDefSpec CpuFeatDef[] = { + CPU_FEAT_INITIALIZER(GEN14_GA2), + CPU_FEAT_INITIALIZER(GEN15_GA1), + CPU_FEAT_INITIALIZER(GEN16_GA1), ++ CPU_FEAT_INITIALIZER(GEN17_GA1), + }; + + #define FEAT_GROUP_INITIALIZER(_name) \ +-- +2.39.3 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index 1f20488..441a247 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -143,7 +143,7 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 9.1.0 -Release: 8%{?rcrel}%{?dist}%{?cc_suffix} +Release: 9%{?rcrel}%{?dist}%{?cc_suffix} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped # Epoch 15 used for RHEL 8 # Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) @@ -360,6 +360,42 @@ Patch91: kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch Patch92: kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch # For RHEL-69047 - warning: fd: migration to a file is deprecated when create or revert a snapshot Patch93: kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch94: kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch95: kvm-s390x-cpumodel-add-msa10-subfunctions.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch96: kvm-s390x-cpumodel-add-msa11-subfunctions.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch97: kvm-s390x-cpumodel-add-msa12-changes.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch98: kvm-s390x-cpumodel-add-msa13-subfunctions.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch99: kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch100: kvm-linux-headers-Update-to-Linux-6.13-rc1.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch101: kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch102: kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch103: kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch104: kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch105: kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch106: kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch107: kvm-s390x-cpumodel-correct-PLO-feature-wording.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch108: kvm-s390x-cpumodel-Add-PLO-extension-facility.patch +# For RHEL-32665 - [IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part +Patch109: kvm-s390x-cpumodel-gen17-model.patch +# For RHEL-71939 - qemu-ga cannot freeze filesystems with sentinelone +Patch110: kvm-qga-skip-bind-mounts-in-fs-list.patch +# For RHEL-67108 - [aarch64] [rhel-10.0] Backport some important post 9.1 qemu fixes +Patch111: kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch %if %{have_clang} BuildRequires: clang @@ -1426,6 +1462,32 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog +* Mon Jan 06 2025 Miroslav Rezanina - 9.1.0-9 +- kvm-linux-headers-Update-to-Linux-v6.12-rc5.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-msa10-subfunctions.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-msa11-subfunctions.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-msa12-changes.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-msa13-subfunctions.patch [RHEL-32665] +- kvm-s390x-cpumodel-Add-ptff-Query-Time-Stamp-Event-QTSE-.patch [RHEL-32665] +- kvm-linux-headers-Update-to-Linux-6.13-rc1.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-Concurrent-functions-facility-sup.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-Vector-Enhancements-facility-3.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-Miscellaneous-Instruction-Extensi.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-Vector-Packed-Decimal-Enhancement.patch [RHEL-32665] +- kvm-s390x-cpumodel-add-Ineffective-nonconstrained-transa.patch [RHEL-32665] +- kvm-s390x-cpumodel-Add-Sequential-Instruction-Fetching-f.patch [RHEL-32665] +- kvm-s390x-cpumodel-correct-PLO-feature-wording.patch [RHEL-32665] +- kvm-s390x-cpumodel-Add-PLO-extension-facility.patch [RHEL-32665] +- kvm-s390x-cpumodel-gen17-model.patch [RHEL-32665] +- kvm-qga-skip-bind-mounts-in-fs-list.patch [RHEL-71939] +- kvm-hw-char-pl011-Use-correct-masks-for-IBRD-and-FBRD.patch [RHEL-67108] +- Resolves: RHEL-32665 + ([IBM 10.0 FEAT] KVM: CPU model for new IBM Z HW - qemu-kvm part) +- Resolves: RHEL-71939 + (qemu-ga cannot freeze filesystems with sentinelone) +- Resolves: RHEL-67108 + ([aarch64] [rhel-10.0] Backport some important post 9.1 qemu fixes) + * Fri Dec 13 2024 Miroslav Rezanina - 9.1.0-8 - kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch [RHEL-69047] - Resolves: RHEL-69047