History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon: "Two important arm64 fixes ahead of the 6.16 release. The first fixes a regression introduced during the merge window where the KVM UUID (which is used to advertise KVM-specific hypercalls for things like time synchronisation in the guest) was corrupted thanks to an endianness bug introduced when converting the code to use the UUID_INIT() helper. The second fixes a stack-pointer corruption issue during context-switch which has been observed in the wild when taking a pseudo-NMI with shadow call stack enabled. Summary: - Fix broken UUID value for the KVM/arm64 hypervisor SMCCC interface - Fix stack corruption on context-switch, primarily seen on (but not limited to) configurations with both pNMI and SCS enabled" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/entry: Mask DAIF in cpu_switch_to(), call_on_irq_stack() arm64: kvm, smccc: Fix vendor uuid

Linus Torvalds committed 1 year ago

Commit cef6c8c2 parents 407c114 d42e6c23 files · +12 −1Browse files

Unified · Split

3 files
  1. arch/arm64/include/asm/assembler.h +5 −0
  2. arch/arm64/kernel/entry.S +6 −0
  3. include/linux/arm-smccc.h +1 −1
arch/arm64/include/asm/assembler.h+5−0
@@ -41,6 +41,11 @@ · 40 unmodified lines
41/*41/*
42 * Save/restore interrupts.42 * Save/restore interrupts.
43 */43 */
44 .macro save_and_disable_daif, flags
45 mrs \flags, daif
46 msr daifset, #0xf
47 .endm
48
44 .macro save_and_disable_irq, flags49 .macro save_and_disable_irq, flags
45 mrs \flags, daif50 mrs \flags, daif
46 msr daifset, #351 msr daifset, #3
arch/arm64/kernel/entry.S+6−0
@@ -825,6 +825,7 @@ SYM_CODE_END(__bp_harden_el1_vectors) · 824 unmodified lines
825 *825 *
826 */826 */
827SYM_FUNC_START(cpu_switch_to)827SYM_FUNC_START(cpu_switch_to)
828 save_and_disable_daif x11
828 mov x10, #THREAD_CPU_CONTEXT829 mov x10, #THREAD_CPU_CONTEXT
829 add x8, x0, x10830 add x8, x0, x10
830 mov x9, sp831 mov x9, sp
@@ -848,6 +849,7 @@ SYM_FUNC_START(cpu_switch_to) · 17 unmodified lines
848 ptrauth_keys_install_kernel x1, x8, x9, x10849 ptrauth_keys_install_kernel x1, x8, x9, x10
849 scs_save x0850 scs_save x0
850 scs_load_current851 scs_load_current
852 restore_irq x11
851 ret853 ret
852SYM_FUNC_END(cpu_switch_to)854SYM_FUNC_END(cpu_switch_to)
853NOKPROBE(cpu_switch_to)855NOKPROBE(cpu_switch_to)
@@ -874,6 +876,7 @@ NOKPROBE(ret_from_fork) · 20 unmodified lines
874 * Calls func(regs) using this CPU's irq stack and shadow irq stack.876 * Calls func(regs) using this CPU's irq stack and shadow irq stack.
875 */877 */
876SYM_FUNC_START(call_on_irq_stack)878SYM_FUNC_START(call_on_irq_stack)
879 save_and_disable_daif x9
877#ifdef CONFIG_SHADOW_CALL_STACK880#ifdef CONFIG_SHADOW_CALL_STACK
878 get_current_task x16881 get_current_task x16
879 scs_save x16882 scs_save x16
@@ -888,8 +891,10 @@ SYM_FUNC_START(call_on_irq_stack) · 8 unmodified lines
888 891
889 /* Move to the new stack and call the function there */892 /* Move to the new stack and call the function there */
890 add sp, x16, #IRQ_STACK_SIZE893 add sp, x16, #IRQ_STACK_SIZE
894 restore_irq x9
891 blr x1895 blr x1
892 896
897 save_and_disable_daif x9
893 /*898 /*
894 * Restore the SP from the FP, and restore the FP and LR from the frame899 * Restore the SP from the FP, and restore the FP and LR from the frame
895 * record.900 * record.
@@ -897,6 +902,7 @@ SYM_FUNC_START(call_on_irq_stack) · 1 unmodified line
897 mov sp, x29902 mov sp, x29
898 ldp x29, x30, [sp], #16903 ldp x29, x30, [sp], #16
899 scs_load_current904 scs_load_current
905 restore_irq x9
900 ret906 ret
901SYM_FUNC_END(call_on_irq_stack)907SYM_FUNC_END(call_on_irq_stack)
902NOKPROBE(call_on_irq_stack)908NOKPROBE(call_on_irq_stack)
include/linux/arm-smccc.h+1−1
@@ -113,7 +113,7 @@ · 112 unmodified lines
113 113
114/* KVM UID value: 28b46fb6-2ec5-11e9-a9ca-4b564d003a74 */114/* KVM UID value: 28b46fb6-2ec5-11e9-a9ca-4b564d003a74 */
115#define ARM_SMCCC_VENDOR_HYP_UID_KVM UUID_INIT(\115#define ARM_SMCCC_VENDOR_HYP_UID_KVM UUID_INIT(\
116 0xb66fb428, 0xc52e, 0xe911, \116 0x28b46fb6, 0x2ec5, 0x11e9, \
117 0xa9, 0xca, 0x4b, 0x56, \117 0xa9, 0xca, 0x4b, 0x56, \
118 0x4d, 0x00, 0x3a, 0x74)118 0x4d, 0x00, 0x3a, 0x74)
119 119

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t