Re: [PATCH v3 1/5] arm64: signal: Improve POR_EL0 handling to avoid uaccess failures

2024-10-31 Thread Will Deacon
Hi Jeff, Thanks for chiming in! On Wed, Oct 30, 2024 at 03:01:53PM -0700, Jeff Xu wrote: > On Tue, Oct 29, 2024 at 7:46 AM Kevin Brodsky wrote: > > > > TL;DR: reset POR_EL0 to "allow all" before writing the signal frame, > > preventing spurious uaccess failures. [...] > > @@ -924,12 +982,14 @@

Re: [PATCH v3 0/5] Improve arm64 pkeys handling in signal delivery

2024-10-29 Thread Will Deacon
On Tue, 29 Oct 2024 14:45:34 +, Kevin Brodsky wrote: > This series is a follow-up to Joey's Permission Overlay Extension (POE) > series [1] that recently landed on mainline. The goal is to improve the > way we handle the register that governs which pkeys/POIndex are > accessible (POR_EL0) durin

Re: [PATCH 0/5] Improve arm64 pkeys handling in signal delivery

2024-10-21 Thread Will Deacon
On Mon, Oct 21, 2024 at 04:30:04PM +0100, Catalin Marinas wrote: > On Mon, Oct 21, 2024 at 02:31:08PM +0100, Dave P Martin wrote: > > > > On Thu, Oct 17, 2024 at 02:39:04PM +0100, Kevin Brodsky wrote: > > > >> This series is a follow-up to Joey's Permission Overlay Extension (POE) > > > >> series [

Re: [PATCH v5 19/30] arm64: add POE signal support

2024-10-15 Thread Will Deacon
On Tue, Oct 15, 2024 at 10:59:11AM +0100, Joey Gouly wrote: > On Mon, Oct 14, 2024 at 06:10:23PM +0100, Will Deacon wrote: > > Kevin, Joey, > > > > On Wed, Oct 09, 2024 at 03:43:01PM +0100, Will Deacon wrote: > > > On Tue, Sep 24, 2024 at 01:27:58PM +0200, Kevin B

Re: [PATCH v2 5/6] iommu/arm-smmu-v3: Make smmuv3 set_dev_pasid() op support replace

2024-10-15 Thread Will Deacon
On Thu, Sep 12, 2024 at 06:04:26AM -0700, Yi Liu wrote: > From: Jason Gunthorpe > > set_dev_pasid() op is going to be enhanced to support domain replacement > of a pasid. This prepares for this op definition. > > Signed-off-by: Jason Gunthorpe > Signed-off-by: Yi Liu > --- > drivers/iommu/arm

Re: [PATCH v5 19/30] arm64: add POE signal support

2024-10-14 Thread Will Deacon
Kevin, Joey, On Wed, Oct 09, 2024 at 03:43:01PM +0100, Will Deacon wrote: > On Tue, Sep 24, 2024 at 01:27:58PM +0200, Kevin Brodsky wrote: > > On 22/08/2024 17:11, Joey Gouly wrote: > > > @@ -1178,6 +1237,9 @@ static void setup_return(struct pt_regs *regs, > >

Re: [PATCH v5 19/30] arm64: add POE signal support

2024-10-09 Thread Will Deacon
Hi Kevin, On Tue, Sep 24, 2024 at 01:27:58PM +0200, Kevin Brodsky wrote: > On 22/08/2024 17:11, Joey Gouly wrote: > > @@ -1178,6 +1237,9 @@ static void setup_return(struct pt_regs *regs, struct > > k_sigaction *ka, > > sme_smstop(); > > } > > > > + if (system_supports_poe()) >

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-13 Thread Will Deacon
On Thu, Sep 12, 2024 at 01:48:35PM +0100, Joey Gouly wrote: > On Thu, Sep 12, 2024 at 11:50:18AM +0100, Will Deacon wrote: > > On Wed, Sep 11, 2024 at 08:33:54AM -0700, Dave Hansen wrote: > > > On 9/11/24 08:01, Kevin Brodsky wrote: > > > > On 22/08/2024 17:10, Joey G

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-12 Thread Will Deacon
Hi Dave, On Wed, Sep 11, 2024 at 08:33:54AM -0700, Dave Hansen wrote: > On 9/11/24 08:01, Kevin Brodsky wrote: > > On 22/08/2024 17:10, Joey Gouly wrote: > >> @@ -371,6 +382,9 @@ int copy_thread(struct task_struct *p, const struct > >> kernel_clone_args *args) > >>if (system_supports_

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Wed, Sep 04, 2024 at 01:55:03PM +0100, Joey Gouly wrote: > On Wed, Sep 04, 2024 at 12:43:02PM +0100, Will Deacon wrote: > > Right, there's quite a lot I need to do: > > > > - Uncorrupt your patches > > - Fix the conflict in the kvm selftests > > - Drop

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Wed, Sep 04, 2024 at 12:32:21PM +0100, Joey Gouly wrote: > On Wed, Sep 04, 2024 at 11:22:54AM +0100, Will Deacon wrote: > > On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > > > On Mon, Sep 02, 2024 at 08:08:08PM +0100, Catalin Marinas wrote: > > > >

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > On Mon, Sep 02, 2024 at 08:08:08PM +0100, Catalin Marinas wrote: > > On Tue, Aug 27, 2024 at 12:38:04PM +0100, Will Deacon wrote: > > > On Fri, Aug 23, 2024 at 07:40:52PM +0100, Catalin Marinas wrote: > > > &

Re: [PATCH] kselftest/arm64: Fix build warnings for ptrace

2024-08-30 Thread Will Deacon
On Fri, 30 Aug 2024 10:59:11 +0530, Dev Jain wrote: > A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly > introduced ksft_exit_fail_perror(). > > Applied to arm64 (for-next/selftests), thanks! [1/1] kselftest/arm64: Fix build warnings for ptrace https://git.kernel.org/arm6

Re: [PATCH] kselftest/arm64: Actually test SME vector length changes via sigreturn

2024-08-30 Thread Will Deacon
On Thu, 29 Aug 2024 18:20:09 +0100, Mark Brown wrote: > The test case for SME vector length changes via sigreturn use a bit too > much cut'n'paste and only actually changed the SVE vector length in the > test itself. Andre's recent factoring out of the initialisation code caused > this to be expose

Re: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_*

2024-08-30 Thread Will Deacon
er Upton > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_asm.h | 3 ++- > arch/arm64/kvm/hyp/include/hyp/fault.h | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) Acked-by: Will Deacon > diff --git arch

Re: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_*

2024-08-30 Thread Will Deacon
Hey Marc, On Fri, Aug 30, 2024 at 09:01:18AM +0100, Marc Zyngier wrote: > On Fri, 23 Aug 2024 14:48:11 +0100, > Will Deacon wrote: > > > > On Thu, Aug 22, 2024 at 04:10:51PM +0100, Joey Gouly wrote: > > > To allow using newer instructions that current assembl

Re: [PATCH] selftests/arm64: Fix build warnings for abi

2024-08-27 Thread Will Deacon
On Tue, Aug 27, 2024 at 10:48:51AM +0530, Dev Jain wrote: > A "%s" is missing in ksft_exit_fail_msg(); instead, use the newly > introduced ksft_exit_fail_perror(). Also, uint64_t corresponds to > unsigned 64-bit integer, so use %lx instead of %llx. What's wrong with using %llx for a uint64_t? I th

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-27 Thread Will Deacon
On Fri, Aug 23, 2024 at 07:40:52PM +0100, Catalin Marinas wrote: > On Fri, Aug 23, 2024 at 06:08:36PM +0100, Will Deacon wrote: > > On Fri, Aug 23, 2024 at 05:41:06PM +0100, Catalin Marinas wrote: > > > On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > > > &

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Will Deacon
On Fri, Aug 23, 2024 at 05:41:06PM +0100, Catalin Marinas wrote: > On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > > On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > > > +static void permission_overlay_switch(struct task_struct *next) &

Re: [PATCH v3] kselftest/arm64: signal: fix/refactor SVE vector length enumeration

2024-08-23 Thread Will Deacon
On Wed, 21 Aug 2024 17:44:01 +0100, Andre Przywara wrote: > Currently a number of SVE/SME related tests have almost identical > functions to enumerate all supported vector lengths. However over time > the copy&pasted code has diverged, allowing some bugs to creep in: > - fake_sigreturn_sme_change_v

Re: [PATCH rc 2/2] iommu: Do not return 0 from map_pages if it doesn't do anything

2024-08-23 Thread Will Deacon
ess, then nothing to do */ > if (!(iommu_prot & (IOMMU_READ | IOMMU_WRITE))) > - return 0; > + return -EINVAL; I think just removing this hunk altogether would get us the right semantics for stage-2 mappings, but it's esoteric and not used so -EINVAL is probably better: Acked-by: Will Deacon Will

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > POR_EL0 is a register that can be modified by userspace directly, > so it must be context switched. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Catalin Marinas > -

Re: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_*

2024-08-23 Thread Will Deacon
er Upton > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_asm.h | 3 ++- > arch/arm64/kvm/hyp/include/hyp/fault.h | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) Marc -- what would you like to do with this p

Re: [PATCH v5 04/30] arm64: disable trapping of POR_EL0 to EL2

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 04:10:47PM +0100, Joey Gouly wrote: > Allow EL0 or EL1 to access POR_EL0 without being trapped to EL2. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Acked-by: Catalin Marinas > Reviewed-by: Anshuman Khandual > --- &

Re: [PATCH] kselftest: missing arg in ptrace.c

2024-07-23 Thread Will Deacon
On Fri, 12 Jul 2024 23:17:30 +, Remington Brasga wrote: > The string passed to ksft_test_result_skip is missing the `type_name` > > Applied to arm64 (for-next/core), thanks! [1/1] kselftest: missing arg in ptrace.c https://git.kernel.org/arm64/c/0c35e3bd412a Cheers, -- Will https:/

Re: [PATCH] kselftest: missing arg in ptrace.c

2024-07-23 Thread Will Deacon
On Thu, Jul 18, 2024 at 04:34:10PM +0100, Will Deacon wrote: > On Tue, Jul 16, 2024 at 09:49:12AM +0530, Dev Jain wrote: > > > > On 7/13/24 04:47, Remington Brasga wrote: > > > The string passed to ksft_test_result_skip is missing the `type_name` > > > >

Re: [PATCH] kselftest: missing arg in ptrace.c

2024-07-18 Thread Will Deacon
On Tue, Jul 16, 2024 at 09:49:12AM +0530, Dev Jain wrote: > > On 7/13/24 04:47, Remington Brasga wrote: > > The string passed to ksft_test_result_skip is missing the `type_name` > > > > Signed-off-by: Remington Brasga > > --- > > clang-tidy reported clang-diagnostic-format-insufficient-args warn

Re: [PATCH] selftests:arm64: Test PR_SVE_VL_INHERIT after a double fork

2024-04-30 Thread Will Deacon
On Mon, Apr 29, 2024 at 04:40:12AM +, Dorine Tipo wrote: > Add a new test, double_fork_test() to check the inheritance of the SVE > vector length after a double fork. > The `EXPECTED_TESTS` macro has been updated to account for this additional > test. > This patch addresses task 7 on the TODO l

Re: [PATCH] kselftest: arm64: Add a null pointer check

2024-04-28 Thread Will Deacon
On Tue, 23 Apr 2024 16:21:02 +0800, Kunwu Chan wrote: > There is a 'malloc' call, which can be unsuccessful. > This patch will add the malloc failure checking > to avoid possible null dereference and give more information > about test fail reasons. > > Applied to arm64 (for-next/selftests), than

Re: [PATCH v2 0/4] A new selftests/ directory for arm compatibility testing

2024-04-22 Thread Will Deacon
On Mon, Apr 22, 2024 at 12:37:13PM +0530, Dev Jain wrote: > This series introduces the selftests/arm directory, which tests 32 and 64-bit > kernel compatibility with 32-bit ELFs running on the Aarch platform. > The need for this bucket of tests is that 32 bit applications built on legacy > ARM arch

Re: [PATCH v4 5/7] arm64: Unconditionally call unflatten_device_tree()

2024-02-23 Thread Will Deacon
systems, > > of_kexec_alloc_and_setup_fdt() will ignore the live DT (the empty root > > one) and copy the 'initial_boot_params' data. > > > > Cc: Rob Herring > > Cc: Frank Rowand > > Cc: Catalin Marinas > > Cc: Will Deacon > > Cc: Mar

Re: [PATCH] kselftest/arm64: Don't probe the current VL for unsupported vector types

2023-12-19 Thread Will Deacon
On Mon, 18 Dec 2023 23:39:32 +, Mark Brown wrote: > The vec-syscfg selftest verifies that setting the VL of the currently > tested vector type does not disrupt the VL of the other vector type. To do > this it records the current vector length for each type but neglects to > guard this with a ch

Re: [PATCH v7 00/11] arm64: perf: Add support for event counting threshold

2023-12-12 Thread Will Deacon
On Mon, 11 Dec 2023 16:13:12 +, James Clark wrote: > Changes since v6: > > * Remove inlines from arm_pmuv3.c > * Use format attribute mechanism from SPE > * Re-arrange attributes so that threshold comes last and can > potentially be extended > * Emit an error if the max threshold i

Re: [PATCH] kselftest/arm64: Log SVCR when the SME tests barf

2023-12-11 Thread Will Deacon
On Tue, 05 Dec 2023 14:24:44 +, Mark Brown wrote: > On failure we log the actual and expected value of the register we detect > a mismatch in. For SME one obvious potential source of corruption would be > if we had corrupted SVCR since changes in streaming mode will reset the > register values,

Re: [PATCH] kselftest/arm64: Improve output for skipped TPIDR2 ABI test

2023-12-11 Thread Will Deacon
On Fri, 24 Nov 2023 15:22:21 +, Mark Brown wrote: > When TPIDR2 is not supported the tpidr2 ABI test prints the same message > for each skipped test: > > ok 1 skipped, TPIDR2 not supported > > which isn't ideal for test automation software since it tracks kselftest > results based on the st