Skip to content

[PW_SID:1067293] Drivers: hv: Add ARM64 support in mshv_vtl#1622

Open
linux-riscv-bot wants to merge 12 commits intoworkflowfrom
pw1067293
Open

[PW_SID:1067293] Drivers: hv: Add ARM64 support in mshv_vtl#1622
linux-riscv-bot wants to merge 12 commits intoworkflowfrom
pw1067293

Conversation

@linux-riscv-bot
Copy link

PR for series 1067293 applied to workflow

Name: Drivers: hv: Add ARM64 support in mshv_vtl
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1067293
Version: 1

Linux RISC-V bot and others added 12 commits March 15, 2026 20:59
mshv_vtl_main.c calls smp_send_reschedule() which expands to
arch_smp_send_reschedule(). When CONFIG_MSHV_VTL=m, the module cannot
access this symbol since it is not exported on arm64.

smp_send_reschedule() is used in mshv_vtl_cancel() to interrupt a vCPU
thread running on another CPU. When a vCPU is looping in
mshv_vtl_ioctl_return_to_lower_vtl(), it checks a per-CPU cancel flag
before each VTL0 entry. Setting cancel=1 alone is not enough if the
target CPU thread is sleeping - the IPI from smp_send_reschedule() kicks
the remote CPU out of idle/sleep so it re-checks the cancel flag and
exits the loop promptly.

Other architectures (riscv, loongarch, powerpc) already export this
symbol. Add the same EXPORT_SYMBOL_GPL for arm64. This is required
for adding arm64 support in MSHV_VTL.

Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Move the logic to initialize and export hv_vp_assist_page from x86
architecture code to Hyper-V common code to allow it to be used for
upcoming arm64 support in MSHV_VTL driver.
Note: This change also improves error handling - if VP assist page
allocation fails, hyperv_init() now returns early instead of
continuing with partial initialization.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a wrapper function - hv_setup_percpu_vmbus_handler(), similar to
hv_setup_vmbus_handler() to allow setting up custom per-cpu VMBus
interrupt handler. This is required for arm64 support, to be added
in MSHV_VTL driver, where per-cpu VMBus interrupt handler will be
set to mshv_vtl_vmbus_isr() for VTL2 (Virtual Trust Level 2).

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Refactor MSHV_VTL driver to move some of the x86 specific code to arch
specific files, and add corresponding functions for arm64.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
vmbus_interrupt is used in mshv_vtl_main.c to set the SINT vector.
When CONFIG_MSHV_VTL=m and CONFIG_HYPERV_VMBUS=y (built-in), the module
cannot access vmbus_interrupt at load time since it is not exported.

Export it using EXPORT_SYMBOL_FOR_MODULES consistent with the existing
pattern used for vmbus_isr.

Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Generalize Synthetic interrupt source vector (sint) to use
vmbus_interrupt variable instead, which automatically takes care of
architectures where HYPERVISOR_CALLBACK_VECTOR is not present (arm64).

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add support for arm64 specific variant of mshv_vtl_return_call function
to be able to add support for arm64 in MSHV_VTL driver. This would
help enable the transition between Virtual Trust Levels (VTL) in
MSHV_VTL when the kernel acts as a paravisor.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Move mshv_vtl_configure_reg_page() implementation from
drivers/hv/mshv_vtl_main.c to arch-specific files:
- arch/x86/hyperv/hv_vtl.c: full implementation with register page setup
- arch/arm64/hyperv/hv_vtl.c: stub implementation (unsupported)

Move common type definitions to include/asm-generic/mshyperv.h:
- struct mshv_vtl_per_cpu
- union hv_synic_overlay_page_msr

Move hv_call_get_vp_registers() and hv_call_set_vp_registers()
declarations to include/asm-generic/mshyperv.h since these functions
are used by multiple modules.

While at it, remove the unnecessary stub implementations in #else
case for mshv_vtl_return* functions in arch/x86/include/asm/mshyperv.h.

This is essential for adding support for ARM64 in MSHV_VTL.

Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The kernel currently sets the VSM configuration register, thereby
imposing certain VSM configuration on the userspace (OpenVMM).

The userspace (OpenVMM) has the capability to configure this register,
and it is already doing it using the generic hypercall interface.
The configuration can vary based on the use case or architectures, so
let userspace take care of configuring it and remove this logic in the
kernel driver.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add necessary support to make MSHV_VTL work for arm64 architecture.
* Add stub implementation for mshv_vtl_return_call_init(): not required
  for arm64
* Remove fpu/legacy.h header inclusion, as this is not required
* handle HV_REGISTER_VSM_CODE_PAGE_OFFSETS register: not supported
  in arm64
* Configure custom percpu_vmbus_handler by using
  hv_setup_percpu_vmbus_handler()
* Handle hugepage functions by config checks

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Enable ARM64 support in MSHV_VTL Kconfig now that all the necessary
support is present.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1000.19 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1348.44 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[01/11] arch: arm64: Export arch_smp_send_reschedule for mshv_vtl module"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.20 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1044.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1410.76 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[02/11] Drivers: hv: Move hv_vp_assist_page to common files"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 9: "[09/11] Drivers: hv: mshv_vtl: Let userspace do VSM configuration"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 136.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1002.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1351.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 31.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 10: "[10/11] Drivers: hv: Add support for arm64 in MSHV_VTL"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.39 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1013.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1362.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.13 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.16 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.65 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.21 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 11: "[11/11] Drivers: hv: Kconfig: Add ARM64 support for MSHV_VTL"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow branch 5 times, most recently from da94c13 to 30bb016 Compare March 19, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant