Hello,

+Magnus, +Paolo

On 12/22/25 14:53, Shameer Kolothum wrote:
Mainly for adding support for VFIO DMABUF. While at it, update all
headers.

Signed-off-by: Shameer Kolothum <[email protected]>
---
I was getting this error from update-linux-headers script:

cp: cannot stat '/tmp/tmp.OfzanvZP6L/headers/include/asm/unistd_32.h':
  No such file or directory

I used the hunk below to fix it. This likely requires another patch,
though. If this is the right fix, I will include that in v2.

diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 844d9cb9f5..d09d8cf4c6 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -154,7 +154,6 @@ EOF
      mkdir -p "$output/include/standard-headers/asm-$arch"
      if [ $arch = s390 ]; then
          cp_portable "$hdrdir/include/asm/virtio-ccw.h" 
"$output/include/standard-headers/asm-s390/"
-        cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-s390/"
          cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-s390/"
      fi
      if [ $arch = arm64 ]; then

[ ... ]

diff --git a/linux-headers/linux/mshv.h b/linux-headers/linux/mshv.h
index 5bc83db6a3..acceeddc1c 100644
--- a/linux-headers/linux/mshv.h
+++ b/linux-headers/linux/mshv.h
@@ -26,6 +26,7 @@ enum {
        MSHV_PT_BIT_LAPIC,
        MSHV_PT_BIT_X2APIC,
        MSHV_PT_BIT_GPA_SUPER_PAGES,
+       MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
        MSHV_PT_BIT_COUNT,
  };
@@ -41,6 +42,8 @@ enum {
   * @pt_flags: Bitmask of 1 << MSHV_PT_BIT_*
   * @pt_isolation: MSHV_PT_ISOLATION_*
   *
+ * This is the initial/v1 version for backward compatibility.
+ *
   * Returns a file descriptor to act as a handle to a guest partition.
   * At this point the partition is not yet initialized in the hypervisor.
   * Some operations must be done with the partition in this state, e.g. setting
@@ -52,6 +55,37 @@ struct mshv_create_partition {
        __u64 pt_isolation;
  };
+#define MSHV_NUM_CPU_FEATURES_BANKS 2
+
+/**
+ * struct mshv_create_partition_v2
+ *
+ * This is extended version of the above initial MSHV_CREATE_PARTITION
+ * ioctl and allows for following additional parameters:
+ *
+ * @pt_num_cpu_fbanks: Must be set to MSHV_NUM_CPU_FEATURES_BANKS.
+ * @pt_cpu_fbanks: Disabled processor feature banks array.
+ * @pt_disabled_xsave: Disabled xsave feature bits.
+ *
+ * pt_cpu_fbanks and pt_disabled_xsave are passed through as-is to the create
+ * partition hypercall.
+ *
+ * Returns : same as above original mshv_create_partition
+ */
+struct mshv_create_partition_v2 {
+       __u64 pt_flags;
+       __u64 pt_isolation;
+       __u16 pt_num_cpu_fbanks;
+       __u8  pt_rsvd[6];               /* MBZ */
+       __u64 pt_cpu_fbanks[MSHV_NUM_CPU_FEATURES_BANKS];
+       __u64 pt_rsvd1[2];              /* MBZ */
+#if defined(__x86_64__)
+       __u64 pt_disabled_xsave;
+#else
+       __u64 pt_rsvd2;                 /* MBZ */
+#endif
+} __attribute__((packed));
+
  /* /dev/mshv */
  #define MSHV_CREATE_PARTITION _IOW(MSHV_IOCTL, 0x00, struct 
mshv_create_partition)
@@ -89,7 +123,7 @@ enum {
   * @rsvd: MBZ
   *
   * Map or unmap a region of userspace memory to Guest Physical Addresses 
(GPA).
- * Mappings can't overlap in GPA space or userspace.
+ * Mappings can't overlap in GPA space.
   * To unmap, these fields must match an existing mapping.
   */
  struct mshv_user_mem_region {
@@ -288,4 +322,84 @@ struct mshv_get_set_vp_state {
   * #define MSHV_ROOT_HVCALL                   _IOWR(MSHV_IOCTL, 0x07, struct 
mshv_root_hvcall)
   */
+/* Structure definitions, macros and IOCTLs for mshv_vtl */
+
+#define MSHV_CAP_CORE_API_STABLE        0x0
+#define MSHV_CAP_REGISTER_PAGE          0x1
+#define MSHV_CAP_VTL_RETURN_ACTION      0x2
+#define MSHV_CAP_DR6_SHARED             0x3
+#define MSHV_MAX_RUN_MSG_SIZE                256
+
+struct mshv_vp_registers {
+       __u32 count;    /* supports only 1 register at a time */
+       __u32 reserved; /* Reserved for alignment or future use */
+       __u64 regs_ptr; /* pointer to struct hv_register_assoc */
+};

I am seeing errors due to the redefinition of 'struct mshv_vp_registers',
already available in file : include/hw/hyperv/hvgdk_mini.h.


Does include/hw/hyperv/hvgdk_mini.h need some clean up first ?

Thanks,

C.


Reply via email to