linux/arch/arm64/include/asm
Mark Brown 861262ab86 KVM: arm64: Handle SME host state when running guests
While we don't currently support SME in guests we do currently support it
for the host system so we need to take care of SME's impact, including
the floating point register state, when running guests. Simiarly to SVE
we need to manage the traps in CPACR_RL1, what is new is the handling of
streaming mode and ZA.

Normally we defer any handling of the floating point register state until
the guest first uses it however if the system is in streaming mode FPSIMD
and SVE operations may generate SME traps which we would need to distinguish
from actual attempts by the guest to use SME. Rather than do this for the
time being if we are in streaming mode when entering the guest we force
the floating point state to be saved immediately and exit streaming mode,
meaning that the guest won't generate SME traps for supported operations.

We could handle ZA in the access trap similarly to the FPSIMD/SVE state
without the disruption caused by streaming mode but for simplicity
handle it the same way as streaming mode for now.

This will be revisited when we support SME for guests (hopefully before SME
hardware becomes available), for now it will only incur additional cost on
systems with SME and even there only if streaming mode or ZA are enabled.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220419112247.711548-27-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2022-04-22 18:51:23 +01:00
..
vdso arm64: vdso32: drop test for -march=armv8-a 2021-10-21 10:31:38 +01:00
xen
acenv.h
acpi.h Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
alternative-macros.h
alternative.h
apple_m1_pmu.h drivers/perf: Add Apple icestorm/firestorm CPU PMU driver 2022-03-08 13:32:48 +00:00
arch_gicv3.h irqchip/gic-v3: Workaround Marvell erratum 38545 when reading IAR 2022-03-07 21:45:02 +00:00
arch_timer.h arm64: Add CNT{P,V}CTSS_EL0 alternatives to cnt{p,v}ct_el0 2021-10-19 10:56:20 +01:00
archrandom.h arm64: random: implement arch_get_random_int/_long based on RNDR 2022-02-15 15:06:39 +00:00
arm_dsu_pmu.h
arm-cci.h
asm_pointer_auth.h arm64: Add support of PAuth QARMA3 architected algorithm 2022-02-25 13:38:52 +00:00
asm-bug.h
asm-extable.h arm64: extable: add load_unaligned_zeropad() handler 2021-10-21 10:45:22 +01:00
asm-offsets.h
asm-prototypes.h
asm-uaccess.h arm64: extable: consolidate definitions 2021-10-21 10:45:22 +01:00
assembler.h Merge branch 'for-next/spectre-bhb' into for-next/core 2022-03-14 19:08:31 +00:00
atomic_ll_sc.h arm64: atomics: format whitespace consistently 2021-12-14 13:00:23 +00:00
atomic_lse.h arm64: atomics: lse: Dereference matching size 2022-01-20 09:13:48 +00:00
atomic.h
barrier.h asm-generic: introduce io_stop_wc() and add implementation for ARM64 2021-12-22 10:44:53 +00:00
bitops.h include: move find.h from asm_generic to linux 2022-01-15 08:47:31 -08:00
bitrev.h
boot.h
brk-imm.h
bug.h
cache.h
cacheflush.h
checksum.h
clocksource.h
cmpxchg.h arm64: atomics: lse: Dereference matching size 2022-01-20 09:13:48 +00:00
compat.h arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
compiler.h
cpu_ops.h
cpu.h arm64/sme: Identify supported SME vector lengths at boot 2022-04-22 18:50:51 +01:00
cpufeature.h arm64/sme: Implement support for TPIDR2 2022-04-22 18:50:56 +01:00
cpuidle.h
cputype.h arm64: Add part number for Arm Cortex-A78AE 2022-04-08 11:46:46 +01:00
current.h
daifflags.h
dcc.h
debug-monitors.h arm64: move AARCH64_BREAK_FAULT into insn-def.h 2022-02-22 21:25:48 +00:00
device.h
dmi.h
efi.h efi: Move efifb_setup_from_dmi() prototype from arch headers 2021-12-13 15:07:16 +01:00
el2_setup.h arm64/sme: Early CPU setup for SME 2022-04-22 18:50:47 +01:00
elf.h
esr.h arm64/sme: Implement traps and syscall handling for SME 2022-04-22 18:51:05 +01:00
exception.h arm64/sme: Implement traps and syscall handling for SME 2022-04-22 18:51:05 +01:00
exec.h
extable.h arm64/bpf: Remove 128MB limit for BPF JIT programs 2021-11-08 22:16:26 +01:00
fb.h
fixmap.h arm64: entry: Allow the trampoline text to occupy multiple pages 2022-02-15 17:40:28 +00:00
fpsimd.h arm64/sme: Implement ptrace support for streaming mode SVE registers 2022-04-22 18:51:15 +01:00
fpsimdmacros.h arm64/sme: Implement ZA context switching 2022-04-22 18:51:02 +01:00
ftrace.h arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR 2021-11-16 09:47:54 +00:00
futex.h arm64: extable: add a dedicated uaccess handler 2021-10-21 10:45:22 +01:00
gpr-num.h arm64: gpr-num: support W registers 2021-10-21 10:45:22 +01:00
hardirq.h
hugetlb.h
hw_breakpoint.h
hwcap.h arm64/sme: Basic enumeration support 2022-04-22 18:50:49 +01:00
hyp_image.h
hyperv-tlfs.h PCI: hv: Add arm64 Hyper-V vPCI support 2022-01-12 08:24:29 -06:00
hypervisor.h
image.h
insn-def.h arm64: move AARCH64_BREAK_FAULT into insn-def.h 2022-02-22 21:25:48 +00:00
insn.h Merge branch 'for-next/spectre-bhb' into for-next/core 2022-03-14 19:08:31 +00:00
io.h
irq_work.h
irq.h
irqflags.h
jump_label.h
kasan.h
Kbuild parport_pc: Also enable driver for PCI systems 2022-03-18 14:01:41 +01:00
kernel-pgtable.h
kexec.h arm64: kexec: remove cpu-reset.h 2021-10-01 13:31:00 +01:00
kfence.h
kgdb.h
kprobes.h kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
kvm_arm.h arm64/sme: System register and exception syndrome definitions 2022-04-22 18:50:43 +01:00
kvm_asm.h KVM: arm64: Expose unshare hypercall to the host 2021-12-16 12:58:57 +00:00
kvm_emulate.h KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs 2022-04-06 12:29:45 +01:00
kvm_host.h KVM: arm64: Handle SME host state when running guests 2022-04-22 18:51:23 +01:00
kvm_hyp.h arm64: Add support of PAuth QARMA3 architected algorithm 2022-02-25 13:38:52 +00:00
kvm_mmu.h KVM: arm64: Align the VMID allocation with the arm64 ASID 2022-02-08 14:57:03 +00:00
kvm_mte.h
kvm_pgtable.h Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next 2022-01-04 17:16:15 +00:00
kvm_pkvm.h KVM: arm64: Move host EL1 code out of hyp/ directory 2021-12-06 08:37:03 +00:00
kvm_ptrauth.h
kvm_ras.h
kvm_types.h
linkage.h arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
lse.h arm64: atomics: remove redundant static branch 2022-02-15 17:54:08 +00:00
memory.h arm64/bpf: Remove 128MB limit for BPF JIT programs 2021-11-08 22:16:26 +01:00
mman.h
mmu_context.h arm64: hibernate: abstract ttrb0 setup function 2021-10-01 13:30:59 +01:00
mmu.h arm64: Add missing include of asm/cpufeature.h to asm/mmu.h 2021-12-06 08:37:03 +00:00
mmzone.h
module.h
module.lds.h arm64: module: remove (NOLOAD) from linker script 2022-02-25 14:06:50 +00:00
mshyperv.h
mte-def.h arm64: mte: Define the number of bytes for storing the tags in a page 2022-02-15 22:53:29 +00:00
mte-kasan.h arm64: kasan: fix include error in MTE functions 2022-03-09 15:27:21 +00:00
mte.h arm64: mte: avoid clearing PSTATE.TCO on entry unless necessary 2022-02-22 21:48:44 +00:00
neon-intrinsics.h
neon.h
numa.h
page-def.h
page.h arm64/mm: drop HAVE_ARCH_PFN_VALID 2021-10-01 14:54:45 +01:00
paravirt_api_clock.h sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
paravirt.h
patching.h
pci.h
percpu.h
perf_event.h arm64: perf: Consistently make all event numbers as 16-bits 2022-03-08 11:41:03 +00:00
pgalloc.h arm64: mm: Fix VM_BUG_ON(mm != &init_mm) for trans_pgd 2021-11-16 10:12:57 +00:00
pgtable-hwdef.h arm64/mm: Consolidate TCR_EL1 fields 2022-02-15 15:34:22 +00:00
pgtable-prot.h arm64: Ensure execute-only permissions are not allowed without EPAN 2022-03-08 10:03:51 +00:00
pgtable-types.h
pgtable.h arm64: Ensure execute-only permissions are not allowed without EPAN 2022-03-08 10:03:51 +00:00
pointer_auth.h
preempt.h arm64: Support PREEMPT_DYNAMIC 2022-02-19 11:11:09 +01:00
probes.h
proc-fns.h
processor.h arm64/sme: Implement streaming SVE signal handling 2022-04-22 18:51:10 +01:00
ptdump.h
ptrace.h
pvclock-abi.h
rwonce.h arm64: Do not include __READ_ONCE() block in assembly files 2022-03-09 21:56:50 +00:00
scs.h
sdei.h
seccomp.h
sections.h arm64: entry: Allow the trampoline text to occupy multiple pages 2022-02-15 17:40:28 +00:00
set_memory.h
setup.h arm64: asm: setup.h: export common variables 2021-10-12 09:22:33 +01:00
shmparam.h
signal.h
signal32.h
simd.h
smp_plat.h
smp.h
sparsemem.h
spectre.h Merge branch 'for-next/spectre-bhb' into for-next/core 2022-03-14 19:08:31 +00:00
spinlock_types.h locking: Allow to include asm/spinlock_types.h from linux/spinlock_types_raw.h 2021-12-07 15:14:12 +01:00
spinlock.h
stack_pointer.h
stackprotector.h
stacktrace.h arm64: Make some stacktrace functions private 2021-12-10 14:06:04 +00:00
stage2_pgtable.h
stat.h
string.h Revert "arm64: Mitigate MTE issues with str{n}cmp()" 2022-03-07 21:57:02 +00:00
suspend.h
sync_bitops.h
syscall_wrapper.h
syscall.h arch: remove unused function syscall_set_arguments() 2021-09-14 16:06:20 +02:00
sysreg.h arm64/sme: System register and exception syndrome definitions 2022-04-22 18:50:43 +01:00
system_misc.h
thread_info.h arm64/sme: Implement SVCR context switching 2022-04-22 18:50:58 +01:00
timex.h
tlb.h
tlbflush.h
topology.h arm64, topology: enable use of init_cpu_capacity_cppc() 2022-03-10 20:21:58 +01:00
trans_pgd.h arm64: trans_pgd: remove trans_pgd_map_page() 2021-10-01 13:31:01 +01:00
traps.h
uaccess.h uaccess: generalize access_ok() 2022-02-25 09:36:05 +01:00
unistd.h mm/mempolicy: wire up syscall set_mempolicy_home_node 2022-01-15 16:30:30 +02:00
unistd32.h mm/mempolicy: wire up syscall set_mempolicy_home_node 2022-01-15 16:30:30 +02:00
uprobes.h
vdso.h
vectors.h arm64: fix clang warning about TRAMP_VALIAS 2022-03-18 13:48:28 +00:00
vermagic.h
virt.h arm64: trans_pgd: hibernate: Add trans_pgd_copy_el2_vectors 2021-10-01 13:30:59 +01:00
vmalloc.h kasan, vmalloc, arm64: mark vmalloc mappings as pgprot_tagged 2022-03-24 19:06:47 -07:00
vmap_stack.h kasan, arm64: reset pointer tags of vmapped stacks 2022-03-24 19:06:47 -07:00
word-at-a-time.h arm64: extable: add load_unaligned_zeropad() handler 2021-10-21 10:45:22 +01:00
xor.h lib/xor: make xor prototypes more friendly to compiler vectorization 2022-02-11 20:39:39 +11:00