[PATCH 3/5] arm64: Treat ESR_ELx as a 64bit register

2022-04-07 Thread Alexandru Elisei
In the initial release of the ARM Architecture Reference Manual for ARMv8-A, the ESR_ELx registers were defined as 32-bit registers. This changed in 2018 with version D.a (ARM DDI 0487D.a) of the architecture, when they became 64-bit registers, with bits [63:32] defined as RES0. In version G.a, a

[PATCH 5/5] KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high

2022-04-07 Thread Alexandru Elisei
When userspace is debugging a VM, the kvm_debug_exit_arch part of the kvm_run struct contains arm64 specific debug information: the ESR_EL2 value, encoded in the field "hsr", and the address of the instruction that caused the exception, encoded in the field "far". Linux has moved to treating

[PATCH 4/5] KVM: arm64: Treat ESR_EL2 as a 64-bit register

2022-04-07 Thread Alexandru Elisei
ESR_EL2 was defined as a 32-bit register in the initial release of the ARM Architecture Manual for Armv8-A, and was later extended to 64 bits, with bits [63:32] RES0. ARMv8.7 introduced FEAT_LS64, which makes use of bits [36:32]. KVM treats ESR_EL1 as a 64-bit register when saving and restoring

[PATCH 2/5] arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall

2022-04-07 Thread Alexandru Elisei
If a compat process tries to execute an unknown system call above the __ARM_NR_COMPAT_END number, the kernel sends a SIGILL signal to the offending process. Information about the error is printed to dmesg in compat_arm_syscall() -> arm64_notify_die() -> arm64_force_sig_fault() ->

[PATCH 1/5] arm64: Make ESR_ELx_xVC_IMM_MASK compatible with assembly

2022-04-07 Thread Alexandru Elisei
ESR_ELx_xVC_IMM_MASK is used as a mask for the immediate value for the HVC/SMC instructions. The header file is included by assembly files (like entry.S) and ESR_ELx_xVC_IMM_MASK is not conditioned on __ASSEMBLY__ being undefined. Use the UL() macro for defining the constant's size, as that is

[PATCH 0/5] arm64: Treat ESR_ELx as a 64-bit register

2022-04-07 Thread Alexandru Elisei
ESR_EL{1,2} were originally 32-bit register, then were extended to 64-bit with the upper 32 bits RES0, and in ARM DDI 0487H.a the FEAT_LS64 feature was added which makes use of the upper bits. This series aims to teach Linux to treat it consistently as a 64-bit register with the goal of making it

Re: [PATCH v12 06/40] arm64/sme: Provide ABI documentation for SME

2022-04-07 Thread Szabolcs Nagy
The 04/06/2022 19:50, Mark Brown wrote: > On Thu, Mar 31, 2022 at 04:05:38PM +, Szabolcs Nagy wrote: > > > i think it's slightly better to treat ZA like TPIDR2, > > so only clear if CLONE_SETTLS is set. > > > otherwise in principle the child can return to the frame > > where ZA was used and

Re: [PATCH v3 0/3] KVM: Fix use-after-free in debugfs

2022-04-07 Thread Marc Zyngier
On Wed, 6 Apr 2022 23:56:12 +, Oliver Upton wrote: > Funny enough, dirty_log_perf_test on arm64 highlights some issues around > the use of debugfs in KVM. The test leaks a GIC FD across test > iterations, and as such the associated VM is never destroyed. > Nonetheless, the VM FD is reused for

Re: [PATCH] KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3)

2022-04-07 Thread Marc Zyngier
On Wed, 16 Mar 2022 13:51:29 +0100, Andrew Jones wrote: > When testing a kernel with commit a5905d6af492 ("KVM: arm64: > Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated") > get-reg-list output > > vregs: Number blessed registers: 234 > vregs: Number registers: 238 > >

Re: [PATCH v5 02/10] KVM: arm64: Setup a framework for hypercall bitmap firmware registers

2022-04-07 Thread Marc Zyngier
Hi Raghavendra, On Thu, 07 Apr 2022 02:15:57 +0100, Raghavendra Rao Ananta wrote: > > KVM regularly introduces new hypercall services to the guests without > any consent from the userspace. This means, the guests can observe > hypercall services in and out as they migrate across various host >