aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-05-27 20:36:30 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-05-27 20:36:30 -0700
commit5cf5240991bcea3c0f38e36e65e1742d6db7912c (patch)
treeb32cd0491207f859eefaec3ce027b86927d6bb5d /arch
parentMerge tag 'dma-mapping-6.16-2025-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux (diff)
parentxen/arm: call uaccess_ttbr0_enable for dm_op hypercall (diff)
downloadwireguard-linux-5cf5240991bcea3c0f38e36e65e1742d6db7912c.tar.xz
wireguard-linux-5cf5240991bcea3c0f38e36e65e1742d6db7912c.zip
Merge tag 'for-linus-6.16-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen updates from Juergen Gross: - A fix for running as a Xen dom0 on the iMX8QXP Arm platform - An update of the xen.config adding XEN_UNPOPULATED_ALLOC for better support of PVH dom0 - A fix of the Xen balloon driver when running without CONFIG_XEN_UNPOPULATED_ALLOC - A fix of the dm_op Xen hypercall on Arm needed to pass user space buffers to the hypervisor in certain configurations * tag 'for-linus-6.16-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/arm: call uaccess_ttbr0_enable for dm_op hypercall xen/x86: fix initial memory balloon target xen: enable XEN_UNPOPULATED_ALLOC as part of xen.config xen: swiotlb: Wire up map_resource callback
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/xen/hypercall.S21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S
index 9d01361696a1..ae551b857137 100644
--- a/arch/arm64/xen/hypercall.S
+++ b/arch/arm64/xen/hypercall.S
@@ -83,7 +83,26 @@ HYPERCALL3(vcpu_op);
HYPERCALL1(platform_op_raw);
HYPERCALL2(multicall);
HYPERCALL2(vm_assist);
-HYPERCALL3(dm_op);
+
+SYM_FUNC_START(HYPERVISOR_dm_op)
+ mov x16, #__HYPERVISOR_dm_op; \
+ /*
+ * dm_op hypercalls are issued by the userspace. The kernel needs to
+ * enable access to TTBR0_EL1 as the hypervisor would issue stage 1
+ * translations to user memory via AT instructions. Since AT
+ * instructions are not affected by the PAN bit (ARMv8.1), we only
+ * need the explicit uaccess_enable/disable if the TTBR0 PAN emulation
+ * is enabled (it implies that hardware UAO and PAN disabled).
+ */
+ uaccess_ttbr0_enable x6, x7, x8
+ hvc XEN_IMM
+
+ /*
+ * Disable userspace access from kernel once the hyp call completed.
+ */
+ uaccess_ttbr0_disable x6, x7
+ ret
+SYM_FUNC_END(HYPERVISOR_dm_op);
SYM_FUNC_START(privcmd_call)
mov x16, x0