Re: [PATCH v2 05/12] arm64: Basic Branch Target Identification support

2019-10-11 Thread Dave Martin
On Fri, Oct 11, 2019 at 04:10:29PM +0100, Mark Rutland wrote: > On Thu, Oct 10, 2019 at 07:44:33PM +0100, Dave Martin wrote: > > This patch adds the bare minimum required to expose the ARMv8.5 > > Branch Target Identification feature to userspace. > > > > By itself, th

Re: [PATCH] arm64: cpufeature: Don't expose ZFR0 to userspace when SVE is not enabled

2019-10-14 Thread Dave Martin
or in userspace. > > The kernel should not used the register when CONFIG_SVE is disabled. > Therefore, we only need to hidden them from the userspace. > > Signed-off-by: Julien Grall > Fixes: 06a916feca2b ('arm64: Expose SVE2 features for userspace') Reviewed-b

Re: [PATCH 1/3] arm64: cpufeature: Fix the type of no FP/SIMD capability

2019-10-14 Thread Dave Martin
On Fri, Oct 11, 2019 at 06:28:43PM +0100, Suzuki K Poulose wrote: > > > On 11/10/2019 15:21, Dave Martin wrote: > >On Fri, Oct 11, 2019 at 01:13:18PM +0100, Suzuki K Poulose wrote: > Hi Dave > >> > >>On 11/10/2019 12:36, Dave Martin wrote: > >>>On

Re: [PATCH] arm64: cpufeature: Don't expose ZFR0 to userspace when SVE is not enabled

2019-10-15 Thread Dave Martin
On Mon, Oct 14, 2019 at 06:20:17PM +0100, Will Deacon wrote: > On Mon, Oct 14, 2019 at 05:57:46PM +0100, Suzuki K Poulose wrote: > > On 14/10/2019 17:43, Will Deacon wrote: > > > On Mon, Oct 14, 2019 at 11:21:13AM +0100, Julien Grall wrote: > > > > The kernel may not support SVE if CONFIG_ARM64_SVE

Re: [PATCH 1/3] arm64: cpufeature: Fix the type of no FP/SIMD capability

2019-10-15 Thread Dave Martin
On Mon, Oct 14, 2019 at 06:57:30PM +0200, Ard Biesheuvel wrote: > On Mon, 14 Oct 2019 at 17:50, Dave P Martin wrote: > > > > On Mon, Oct 14, 2019 at 04:45:40PM +0100, Suzuki K Poulose wrote: > > > > > > > > > On 14/10/2019 15:52, Dave Martin wrote: > &

Re: [PATCH 1/3] arm64: cpufeature: Fix the type of no FP/SIMD capability

2019-10-15 Thread Dave Martin
On Tue, Oct 15, 2019 at 12:30:15PM +0200, Ard Biesheuvel wrote: > On Tue, 15 Oct 2019 at 12:25, Dave Martin wrote: > > > > On Mon, Oct 14, 2019 at 06:57:30PM +0200, Ard Biesheuvel wrote: [...] > > > All in-kernel NEON code checks whether the NEON is usable, so I'

Re: [PATCH v2 09/12] arm64: traps: Fix inconsistent faulting instruction skipping

2019-10-15 Thread Dave Martin
On Fri, Oct 11, 2019 at 04:24:53PM +0100, Mark Rutland wrote: > On Thu, Oct 10, 2019 at 07:44:37PM +0100, Dave Martin wrote: > > Correct skipping of an instruction on AArch32 works a bit > > differently from AArch64, mainly due to the different CPSR/PSTATE > > semantics. >

Re: [PATCH v2 09/12] arm64: traps: Fix inconsistent faulting instruction skipping

2019-10-15 Thread Dave Martin
On Tue, Oct 15, 2019 at 05:42:04PM +0100, Mark Rutland wrote: > On Tue, Oct 15, 2019 at 04:21:09PM +0100, Dave Martin wrote: > > On Fri, Oct 11, 2019 at 04:24:53PM +0100, Mark Rutland wrote: > > > On Thu, Oct 10, 2019 at 07:44:37PM +0100, Dave Martin wrote: > > &g

Re: [PATCH 2/3] arm64: nofpsmid: Clear TIF_FOREIGN_FPSTATE flag for early tasks

2019-10-17 Thread Dave Martin
On Thu, Oct 17, 2019 at 01:42:37PM +0100, Suzuki K Poulose wrote: > Hi Dave > > Thanks for the comments. > > On 11/10/2019 12:26, Dave Martin wrote: > >On Thu, Oct 10, 2019 at 06:15:16PM +0100, Suzuki K Poulose wrote: > >>We detect the absence of FP/SIMD after we

Re: [PATCH v2 05/12] arm64: Basic Branch Target Identification support

2019-10-18 Thread Dave Martin
On Fri, Oct 18, 2019 at 12:05:52PM +0100, Mark Rutland wrote: > On Fri, Oct 11, 2019 at 05:42:00PM +0100, Dave Martin wrote: > > On Fri, Oct 11, 2019 at 05:01:13PM +0100, Dave Martin wrote: > > > On Fri, Oct 11, 2019 at 04:44:45PM +0100, Dave Martin wrote: > > > >

Re: [PATCH v2 05/12] arm64: Basic Branch Target Identification support

2019-10-18 Thread Dave Martin
On Fri, Oct 18, 2019 at 12:10:03PM +0100, Mark Rutland wrote: > On Fri, Oct 11, 2019 at 06:20:15PM +0100, Dave Martin wrote: > > On Fri, Oct 11, 2019 at 04:10:29PM +0100, Mark Rutland wrote: > > > On Thu, Oct 10, 2019 at 07:44:33PM +0100, Dave Martin wrote: > > > > +

Re: [PATCH v2 05/12] arm64: Basic Branch Target Identification support

2019-10-18 Thread Dave Martin
On Fri, Oct 18, 2019 at 12:16:03PM +0100, Mark Rutland wrote: > [adding mm folk] > > On Fri, Oct 11, 2019 at 06:20:15PM +0100, Dave Martin wrote: > > On Fri, Oct 11, 2019 at 04:10:29PM +0100, Mark Rutland wrote: > > > On Thu, Oct 10, 2019 at 07:44:33PM +0100, Dave Martin

Re: [PATCH v2 11/12] arm64: BTI: Reset BTYPE when skipping emulated instructions

2019-10-18 Thread Dave Martin
On Fri, Oct 18, 2019 at 12:04:29PM +0100, Mark Rutland wrote: > On Fri, Oct 11, 2019 at 03:47:43PM +0100, Dave Martin wrote: > > On Fri, Oct 11, 2019 at 03:21:58PM +0100, Mark Rutland wrote: > > > On Thu, Oct 10, 2019 at 07:44:39PM +0100, Dave Martin wrote: > > > >

Re: [PATCH v2 09/12] arm64: traps: Fix inconsistent faulting instruction skipping

2019-10-18 Thread Dave Martin
On Tue, Oct 15, 2019 at 05:49:05PM +0100, Dave Martin wrote: > On Tue, Oct 15, 2019 at 05:42:04PM +0100, Mark Rutland wrote: > > On Tue, Oct 15, 2019 at 04:21:09PM +0100, Dave Martin wrote: > > > On Fri, Oct 11, 2019 at 04:24:53PM +0100, Mark Rutland wrote: > > > >

[PATCH v3 00/12] arm64: ARMv8.5-A: Branch Target Identification support

2019-10-18 Thread Dave Martin
/linux-abi/wiki/Linux-Extensions-to-gABI [3] Git branch: git://linux-arm.org/linux-dm.git arm64/bti/v3/head http://linux-arm.org/git?p=linux-dm.git;a=shortlog;h=refs/heads/arm64/bti/v3/head Dave Martin (12): ELF: UAPI and Kconfig additions for ELF program properties ELF: Add ELF program proper

[PATCH v3 05/12] arm64: Basic Branch Target Identification support

2019-10-18 Thread Dave Martin
as such, just like any other function. This blocks a relatively minor attack vector, but comforming userspace will have the annotations anyway, so we may as well enforce them. Signed-off-by: Dave Martin --- **NOTE** Currently the generic code does not validate user-supplied prot bits via

[PATCH v3 10/12] arm64: traps: Shuffle code to eliminate forward declarations

2019-10-18 Thread Dave Martin
Hoist the IT state handling code earlier in traps.c, to avoid accumulating forward declarations. No functional change. Signed-off-by: Dave Martin --- arch/arm64/kernel/traps.c | 101 ++ 1 file changed, 49 insertions(+), 52 deletions(-) diff --git a

[PATCH v3 08/12] arm64: BTI: Decode BYTPE bits when printing PSTATE

2019-10-18 Thread Dave Martin
[11:10]) and permitted classes of subsequent instruction are: -- (BTYPE=0b00): any insn jc (BTYPE=0b01): BTI jc, BTI j, BTI c, PACIxSP -c (BYTPE=0b10): BTI jc, BTI c, PACIxSP j- (BTYPE=0b11): BTI jc, BTI j Signed-off-by: Dave Martin --- Changes since v2: * Split out the

[PATCH v3 03/12] mm: Reserve asm-generic prot flag 0x10 for arch use

2019-10-18 Thread Dave Martin
-off-by: Dave Martin --- include/uapi/asm-generic/mman-common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index c160a53..81442d2 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm

[PATCH v3 04/12] arm64: docs: cpu-feature-registers: Document ID_AA64PFR1_EL1

2019-10-18 Thread Dave Martin
Commit d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise to userspace") exposes ID_AA64PFR1_EL1 to userspace, but didn't update the documentation to match. Add it. Signed-off-by: Dave Martin --- Note to maintainers: * This patch has been racing with various other

[PATCH v3 06/12] elf: Allow arch to tweak initial mmap prot flags

2019-10-18 Thread Dave Martin
. So that this can be done in a generic way, add a hook arch_elf_adjust_prot() to modify the prot flags as desired: arches can select CONFIG_HAVE_ELF_PROT and implement their own backend where necessary. By default, leave the prot flags unchanged. Signed-off-by: Dave Martin --- fs/Kconfig.binfmt

[PATCH v3 01/12] ELF: UAPI and Kconfig additions for ELF program properties

2019-10-18 Thread Dave Martin
Pull the basic ELF definitions relating to the NT_GNU_PROPERTY_TYPE_0 note from Yu-Cheng Yu's earlier x86 shstk series. Signed-off-by: Yu-cheng Yu Signed-off-by: Dave Martin --- fs/Kconfig.binfmt| 3 +++ include/linux/elf.h | 8 include/uapi/linux/elf.h | 1 + 3

[PATCH v3 09/12] arm64: traps: Fix inconsistent faulting instruction skipping

2019-10-18 Thread Dave Martin
ompat: Add condition code checks and IT advance") Fixes: 6436b572 ("arm64: Fix single stepping in kernel traps") Fixes: bd35a4adc413 ("arm64: Port SWP/SWPB emulation support from arm") Signed-off-by: Dave Martin --- **NOTE** Despite discussions on the v2 series to the

[PATCH v3 02/12] ELF: Add ELF program property parsing support

2019-10-18 Thread Dave Martin
PT_PROGRAM_PROPERTY phdrs entry (if any), and notify each property to the arch code. For now, the added code is not used. Signed-off-by: Dave Martin --- fs/binfmt_elf.c | 127 +++ fs/compat_binfmt_elf.c | 4 ++ include/linux/elf.h | 19

[PATCH v3 12/12] KVM: arm64: BTI: Reset BTYPE when skipping emulated instructions

2019-10-18 Thread Dave Martin
Since normal execution of any non-branch instruction resets the PSTATE BTYPE field to 0, so do the same thing when emulating a trapped instruction. Branches don't trap directly, so we should never need to assign a non-zero value to BTYPE here. Signed-off-by: Dave Martin --- Changes sin

[PATCH v3 11/12] arm64: BTI: Reset BTYPE when skipping emulated instructions

2019-10-18 Thread Dave Martin
Since normal execution of any non-branch instruction resets the PSTATE BTYPE field to 0, so do the same thing when emulating a trapped instruction. Branches don't trap directly, so we should never need to assign a non-zero value to BTYPE here. Signed-off-by: Dave Martin --- Changes sin

[PATCH v3 07/12] arm64: elf: Enable BTI at exec based on ELF program properties

2019-10-18 Thread Dave Martin
sound to have the kernel do it instead. To this end, detect BTI support in the executable (or ELF interpreter, as appropriate), via the NT_GNU_PROGRAM_PROPERTY_TYPE_0 note, and tweak the initial prot flags for the process' executable pages to include PROT_BTI as appropriate. Signed-off-by: D

Re: [RFC PATCH] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-02-14 Thread Dave Martin
On Wed, Feb 13, 2019 at 05:52:27PM +0100, Sebastian Andrzej Siewior wrote: > On 2019-02-13 16:40:00 [+0100], Ard Biesheuvel wrote: > > > > This is equal what x86 is currently doing. The naming is slightly > > > > different, there is irq_fpu_usable(). > > > > > > Yes, I think it's basically the same

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-18 Thread Dave Martin
On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > Instead disabling interrupts by setting the PSR.I bit, use a priority > higher than the one used for interrupts to mask them via PMR. > > When using PMR to disable interrupts, the value of PMR will be used > instead of PSR.[DAIF] fo

Re: [Linux-eng] [RFC 0/3] Abstract empty functions with STUB_UNLESS macro

2019-01-18 Thread Dave Martin
On Fri, Jan 18, 2019 at 04:37:36PM +, Russell King - ARM Linux admin wrote: > On Fri, Jan 18, 2019 at 04:00:27PM +, Andrew Murray wrote: > > A common pattern found in header files is a function declaration dependent > > on a CONFIG_ option being enabled, followed by an empty function for wh

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-18 Thread Dave Martin
On Fri, Jan 18, 2019 at 05:27:29PM +, Julien Thierry wrote: > > > On 18/01/2019 16:35, Dave Martin wrote: > > On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > >> Instead disabling interrupts by setting the PSR.I bit, use a priority > >

Re: [PATCH v15 00/17] arm64: untag user pointers passed to the kernel

2019-05-22 Thread Dave Martin
On Tue, May 21, 2019 at 03:48:56PM -0300, Jason Gunthorpe wrote: > On Fri, May 17, 2019 at 03:49:31PM +0100, Catalin Marinas wrote: > > > The tagged pointers (whether hwasan or MTE) should ideally be a > > transparent feature for the application writer but I don't think we can > > solve it entirel

Re: [REVIEW][PATCH 03/26] signal/arm64: Use force_sig not force_sig_fault for SIGKILL

2019-05-23 Thread Dave Martin
uently provide a means to access post-mortem. I just dived in on this single patch, so I may be missing something more fundamental, or just being pedantic... Cheers ---Dave > Cc: sta...@vger.kernel.org > Cc: Dave Martin > Cc: James Morse > Cc: Will Deacon > Fixes: af40ff687b

[PATCH 0/8] arm64: ARMv8.5-A: Branch Target Identification support

2019-05-24 Thread Dave Martin
priate BTI landing pads. Dave Martin (7): mm: Reserve asm-generic prot flag 0x10 for arch use arm64: docs: cpu-feature-registers: Document ID_AA64PFR1_EL1 arm64: Basic Branch Target Identification support elf: Parse program properties before destroying the old process elf: Allow arc

[PATCH 3/8] arm64: docs: cpu-feature-registers: Document ID_AA64PFR1_EL1

2019-05-24 Thread Dave Martin
Commit d71be2b6c0e1 ("arm64: cpufeature: Detect SSBS and advertise to userspace") exposes ID_AA64PFR1_EL1 to userspace, but didn't update the documentation to match. Add it. Signed-off-by: Dave Martin --- Documentation/arm64/cpu-feature-registers.txt | 16 1 f

[PATCH 2/8] mm: Reserve asm-generic prot flag 0x10 for arch use

2019-05-24 Thread Dave Martin
-off-by: Dave Martin --- include/uapi/asm-generic/mman-common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index abd238d..ad3c6e5 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm

[PATCH 4/8] arm64: Basic Branch Target Identification support

2019-05-24 Thread Dave Martin
annotated as such, just like any other function. This blocks a relatively minor attack vector, but comforming userspace will have the annotations anyway, so we may as well enforce them. Signed-off-by: Dave Martin --- Notes: * An #ifdef CONFIG_ARM64_BTI controls the cpufeature field visibility

[PATCH 1/8] binfmt_elf: Extract .note.gnu.property from an ELF file

2019-05-24 Thread Dave Martin
ntrol-flow Enforcement series; the original patch is here: https://lkml.org/lkml/2018/11/20/205. Dave Martin responded that ARM recently introduced new features to NT_GNU_PROPERTY_TYPE_0 with properties closely modelled on GNU_PROPERTY_X86_FEATURE_1_AND, and it is logical to split out the generic

[PATCH 5/8] elf: Parse program properties before destroying the old process

2019-05-24 Thread Dave Martin
re to stash information for later use. Signed-off-by: Dave Martin --- fs/binfmt_elf.c | 26 +- include/linux/elf.h | 15 +++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 18015fc..32c9c13 100644 ---

[PATCH 6/8] elf: Allow arch to tweak initial mmap prot flags

2019-05-24 Thread Dave Martin
ature). So that this can be done in a generic way, add a hook arch_elf_adjust_prot() to modify the prot flags as desired: arches can select CONFIG_HAVE_ELF_PROT and implement their own backend where necessary. By default, leave the prot flags unchanged. Signed-off-by: Dave Martin --

[PATCH 7/8] arm64: elf: Enable BTI at exec based on ELF program properties

2019-05-24 Thread Dave Martin
sound to have the kernel do it instead. To this end, detect BTI support in the executable (or ELF interpreter, as appropriate), via the NT_GNU_PROGRAM_PROPERTY_TYPE_0 note, and tweak the initial prot flags for the process' executable pages to include PROT_BTI_GUARDED as appropriate. Signed-of

[PATCH 8/8] arm64: BTI: Decode BYTPE bits when printing PSTATE

2019-05-24 Thread Dave Martin
[11:10]) and permitted classes of subsequent instruction are: -- (BTYPE=0b00): any insn jc (BTYPE=0b01): BTI jc, BTI j, BTI c, PACIxSP -c (BYTPE=0b10): BTI jc, BTI c, PACIxSP j- (BTYPE=0b11): BTI jc, BTI j Signed-off-by: Dave Martin --- arch/arm64/include/asm/ptrace.h | 4

Re: [PATCH 4/8] arm64: Basic Branch Target Identification support

2019-05-24 Thread Dave Martin
On Fri, May 24, 2019 at 02:02:17PM +0100, Mark Rutland wrote: > Hi Dave, > > This generally looks good, but I have a few comments below. > > On Fri, May 24, 2019 at 11:25:29AM +0100, Dave Martin wrote: > > +#define arch_calc_vm_prot_bits(prot, pkey) arm64_calc_vm_prot_b

Re: [PATCH 4/8] arm64: Basic Branch Target Identification support

2019-05-24 Thread Dave Martin
On Fri, May 24, 2019 at 04:38:48PM +0100, Mark Rutland wrote: > On Fri, May 24, 2019 at 03:53:06PM +0100, Dave Martin wrote: > > On Fri, May 24, 2019 at 02:02:17PM +0100, Mark Rutland wrote: > > > On Fri, May 24, 2019 at 11:25:29AM +0100, Dave Martin wrote: > > > > +

Re: [RFC PATCH] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-04 Thread Dave Martin
On Fri, Feb 08, 2019 at 04:55:13PM +, Julien Grall wrote: > When the kernel is compiled with CONFIG_KERNEL_MODE_NEON, some part of > the kernel may be able to use FPSIMD/SVE. This is for instance the case > for crypto code. > > Any use of FPSIMD/SVE in the kernel are clearly marked by using th

Re: [RFC PATCH] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-05 Thread Dave Martin
On Fri, Apr 05, 2019 at 10:02:45AM +0100, Julien Grall wrote: > Hi Dave, > > Thank you for the review. > > On 4/4/19 11:52 AM, Dave Martin wrote: > >On Fri, Feb 08, 2019 at 04:55:13PM +, Julien Grall wrote: > >>For RT-linux, it might be possible to use migra

Re: [PATCH v2 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-23 Thread Dave Martin
On Tue, Apr 23, 2019 at 11:59:44AM +0100, Julien Grall wrote: > Hi Dave, > > On 4/17/19 3:01 PM, Dave Martin wrote: > >On Wed, Apr 17, 2019 at 12:37:57PM +0100, Julien Grall wrote: > >>Hi Dave, > >> > >>On 16/04/2019 13:30, Dave Martin wrote: > >&g

Re: [kvmtool PATCH v10 5/5] KVM: arm/arm64: Add a vcpu feature for pointer authentication

2019-04-23 Thread Dave Martin
ros defined in the headers are not in sync and should be replaced > from the upstream. > > Signed-off-by: Amit Daniel Kachhap > --- > > Changes since v9: > * Added a error check for both enable-ptrauth and disable-ptrauth > option. > * Make the error explicit when en

Re: [PATCH v3 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-26 Thread Dave Martin
On Thu, Apr 25, 2019 at 06:12:59PM +0100, Julien Grall wrote: > Hi Dave, > > On 25/04/2019 17:39, Dave Martin wrote: > >On Thu, Apr 25, 2019 at 04:57:26PM +0100, Julien Grall wrote: > >>Hi Dave, > >> > >>On 24/04/2019 14:17, Dave Martin wrote: > >&g

Re: [PATCH v4 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-26 Thread Dave Martin
On Fri, Apr 26, 2019 at 03:37:40PM +0100, Julien Grall wrote: > When the kernel is compiled with CONFIG_KERNEL_MODE_NEON, some part of > the kernel may be able to use FPSIMD/SVE. This is for instance the case > for crypto code. > > Any use of FPSIMD/SVE in the kernel are clearly marked by using th

Re: [PATCH v4 3/3] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-04-26 Thread Dave Martin
On Fri, Apr 26, 2019 at 04:06:02PM +0100, Julien Grall wrote: > Hi, > > On 26/04/2019 15:52, Dave Martin wrote: > >On Fri, Apr 26, 2019 at 03:37:40PM +0100, Julien Grall wrote: > >>When the kernel is compiled with CONFIG_KERNEL_MODE_NEON, some part of > >>the ker

Re: linux-next: manual merge of the kvm-ppc tree with the kvm-arm tree

2019-05-01 Thread Dave Martin
On Wed, May 01, 2019 at 04:09:02PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the kvm-ppc tree got a conflict in: > > include/uapi/linux/kvm.h > > between commits: > > 555f3d03e7fb ("KVM: arm64: Add a capability to advertise SVE support") > a243c16d18be ("KVM

Re: [PATCH] tty: amba-pl011: Make TX optimisation conditional

2019-07-12 Thread Dave Martin
On Thu, Jul 11, 2019 at 02:45:32PM +0100, Phil Elwell wrote: > pl011_tx_chars takes a "from_irq" parameter to reduce the number of > register accesses. When from_irq is true the function assumes that the > FIFO is half empty and writes up to half a FIFO's worth of bytes > without polling the FIFO s

Re: [PATCH] tty: amba-pl011: Make TX optimisation conditional

2019-07-12 Thread Dave Martin
On Fri, Jul 12, 2019 at 01:20:42PM +0100, Phil Elwell wrote: > Hi Rogier, > > On 12/07/2019 13:10, Rogier Wolff wrote: > > On Fri, Jul 12, 2019 at 12:21:05PM +0100, Dave Martin wrote: > >> diff --git a/drivers/tty/serial/amba-pl011.c > >> b/drivers/tty/seria

Re: [RFC PATCH] ARM: UNWINDER_FRAME_POINTER implementation for Clang

2019-08-05 Thread Dave Martin
On Fri, Aug 02, 2019 at 10:27:30AM -0700, Nathan Huckleberry wrote: > You're right. Would pushing an extra register be an adequate fix? Would forcing CONFIG_ARM_UNWIND=y for clang work as an alternative to this? Assuming clang supports -funwind-tables or equivalent, this may just work. [...] Ch

Re: [RFC PATCH] ARM: UNWINDER_FRAME_POINTER implementation for Clang

2019-08-07 Thread Dave Martin
On Tue, Aug 06, 2019 at 02:29:16PM -0700, Nathan Huckleberry wrote: > I'm not sure that we should disable a broken feature instead of > attempting a fix. > > CONFIG_FUNCTION_GRAPH_TRACER is dependent on CONFIG_FRAME_POINTER and > there have been reports by MediaTek that the frame pointer unwinder

Re: [PATCH] arm64/ptrace: Fix typoes in sve_set() comment

2019-08-07 Thread Dave Martin
out; > > /* > - * Apart from PT_SVE_REGS_MASK, all PT_SVE_* flags are consumed by > + * Apart from SVE_PT_REGS_MASK, all SVE_PT_* flags are consumed by >* sve_set_vector_length(), which will also validate them for us: > */ Thanks for spotting that. Reviewed-by: Dave Martin Cheers ---Dave

Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file

2019-06-18 Thread Dave Martin
On Mon, Jun 17, 2019 at 02:20:40PM +0200, Thomas Gleixner wrote: > On Mon, 17 Jun 2019, Florian Weimer wrote: > > * Dave Martin: > > > On Tue, Jun 11, 2019 at 12:31:34PM -0700, Yu-cheng Yu wrote: > > >> We can probably check PT_GNU_PROPERTY first, and fallb

Re: [PATCH v2] arm64/sve: should not depend on

2019-06-18 Thread Dave Martin
- made a bit more explicit that we copied defined symbols, in commit >and code. > - Use Fixes: tag in commit message > > Thanks to Dave Martin and Will Deacon for the review. > > --- > arch/arm64/include/uapi/asm/ptrace.h | 8 +++- > 1 file changed, 3 insertions

Re: [PATCH v7 04/25] arm64: Substitute gettimeofday with C implementation

2019-06-25 Thread Dave Martin
On Fri, Jun 21, 2019 at 10:52:31AM +0100, Vincenzo Frascino wrote: > To take advantage of the commonly defined vdso interface for > gettimeofday the architectural code requires an adaptation. > > Re-implement the gettimeofday vdso in C in order to use lib/vdso. > > With the new implementation arm

Re: [PATCH v7 04/25] arm64: Substitute gettimeofday with C implementation

2019-06-26 Thread Dave Martin
On Wed, Jun 26, 2019 at 02:27:59PM +0100, Vincenzo Frascino wrote: > Hi Dave, > > On 25/06/2019 16:33, Dave Martin wrote: > > On Fri, Jun 21, 2019 at 10:52:31AM +0100, Vincenzo Frascino wrote: > >> To take advantage of the commonly defined vdso interface for > >&g

Re: [PATCH v7 04/25] arm64: Substitute gettimeofday with C implementation

2019-06-27 Thread Dave Martin
On Wed, Jun 26, 2019 at 08:01:58PM +0100, Vincenzo Frascino wrote: [...] > On 6/26/19 5:14 PM, Dave Martin wrote: > > On Wed, Jun 26, 2019 at 02:27:59PM +0100, Vincenzo Frascino wrote: > >> Hi Dave, > >> > >> On 25/06/2019 16:33, Dave Martin wrote: > >&

Re: [PATCH v7 04/25] arm64: Substitute gettimeofday with C implementation

2019-06-27 Thread Dave Martin
On Thu, Jun 27, 2019 at 11:57:36AM +0100, Vincenzo Frascino wrote: > Hi Dave, > > Overall, I want to thank you for bringing out the topic. It helped me to > question some decisions and make sure that we have no holes left in > the approach. Fair enough. This is really just a nasty compiler corne

Re: [PATCH v7 04/25] arm64: Substitute gettimeofday with C implementation

2019-06-27 Thread Dave Martin
On Thu, Jun 27, 2019 at 12:59:07PM +0100, Vincenzo Frascino wrote: > On 6/27/19 12:27 PM, Dave Martin wrote: > > On Thu, Jun 27, 2019 at 11:57:36AM +0100, Vincenzo Frascino wrote: [...] > >> Disassembly of section .text: > >> show_it: > >>

Re: [RFC PATCH] binfmt_elf: Extract .note.gnu.property from an ELF file

2019-07-02 Thread Dave Martin
On Fri, Jun 28, 2019 at 10:22:03AM -0700, Yu-cheng Yu wrote: > This patch was part of the Intel Control-flow Enforcement (CET) series at: > > https://lkml.org/lkml/2019/6/6/1014. > > In the discussion, we decided to look at only an ELF header's > PT_GNU_PROPERTY, which is a shortcut pointing

Re: [PATCH 4/8] arm64: Basic Branch Target Identification support

2019-06-06 Thread Dave Martin
On Thu, Jun 06, 2019 at 06:11:56PM +0100, Catalin Marinas wrote: > On Fri, May 24, 2019 at 03:53:06PM +0100, Dave P Martin wrote: > > On Fri, May 24, 2019 at 02:02:17PM +0100, Mark Rutland wrote: > > > On Fri, May 24, 2019 at 11:25:29AM +0100, Dave Martin wrot

Re: [PATCH 4/8] arm64: Basic Branch Target Identification support

2019-06-06 Thread Dave Martin
On Thu, Jun 06, 2019 at 10:34:22AM -0700, Yu-cheng Yu wrote: > On Thu, 2019-06-06 at 18:23 +0100, Dave Martin wrote: > > On Thu, Jun 06, 2019 at 06:11:56PM +0100, Catalin Marinas wrote: > > > On Fri, May 24, 2019 at 03:53:06PM +0100, Dave P Martin wrote: > > > > On F

Re: "arm64: Silence gcc warnings about arch ABI drift" breaks clang

2019-06-07 Thread Dave Martin
On Fri, Jun 07, 2019 at 08:40:10AM -0700, Nathan Chancellor wrote: > On Fri, Jun 07, 2019 at 11:26:11AM -0400, Qian Cai wrote: > > On Fri, 2019-06-07 at 16:25 +0100, Will Deacon wrote: > > > On Fri, Jun 07, 2019 at 11:22:45AM -0400, Qian Cai wrote: > > > > The linux-next commit "arm64: Silence gcc

Re: [PATCH] arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS

2019-06-07 Thread Dave Martin
for Clang. > > Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift") > Link: https://github.com/ClangBuiltLinux/linux/issues/511 > Reported-by: Qian Cai > Signed-off-by: Nathan Chancellor FWIW, Acked-by: Dave Martin Cheers ---Dave > --- > arch

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-08 Thread Dave Martin
On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > Instead disabling interrupts by setting the PSR.I bit, use a priority > higher than the one used for interrupts to mask them via PMR. > > When using PMR to disable interrupts, the value of PMR will be used > instead of PSR.[DAIF] fo

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-08 Thread Dave Martin
On Tue, Jan 08, 2019 at 03:51:18PM +, Marc Zyngier wrote: > On 08/01/2019 15:40, Dave Martin wrote: > > On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > >> Instead disabling interrupts by setting the PSR.I bit, use a priority > >> higher than the

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-08 Thread Dave Martin
On Tue, Jan 08, 2019 at 05:16:43PM +, Marc Zyngier wrote: > On 08/01/2019 16:45, Dave Martin wrote: > > On Tue, Jan 08, 2019 at 03:51:18PM +, Marc Zyngier wrote: > >> On 08/01/2019 15:40, Dave Martin wrote: > >>> On Tue, Jan 08, 2019 at 02:07:30

Re: [PATCH v8 12/26] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-01-08 Thread Dave Martin
On Tue, Jan 08, 2019 at 05:58:59PM +, Julien Thierry wrote: > > > On 08/01/2019 16:45, Dave Martin wrote: > > On Tue, Jan 08, 2019 at 03:51:18PM +, Marc Zyngier wrote: > >> On 08/01/2019 15:40, Dave Martin wrote: > >>> On Tue, Jan 08, 2019 at 02

Re: [RFC][PATCH 0/3] arm64 relaxed ABI

2019-02-13 Thread Dave Martin
On Tue, Feb 12, 2019 at 06:02:24PM +, Catalin Marinas wrote: > On Mon, Feb 11, 2019 at 12:32:55PM -0800, Evgenii Stepanov wrote: > > On Mon, Feb 11, 2019 at 9:28 AM Kevin Brodsky wrote: > > > On 19/12/2018 12:52, Dave Martin wrote: [...] > > > > * A sing

Re: [RFC PATCH] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-02-13 Thread Dave Martin
On Wed, Feb 13, 2019 at 03:30:29PM +0100, Sebastian Andrzej Siewior wrote: > On 2019-02-08 16:55:13 [+], Julien Grall wrote: > > When the kernel is compiled with CONFIG_KERNEL_MODE_NEON, some part of > > the kernel may be able to use FPSIMD/SVE. This is for instance the case > > for crypto code

Re: [RFC PATCH] arm64/fpsimd: Don't disable softirq when touching FPSIMD/SVE state

2019-02-13 Thread Dave Martin
On Wed, Feb 13, 2019 at 04:40:00PM +0100, Ard Biesheuvel wrote: > On Wed, 13 Feb 2019 at 16:36, Dave Martin wrote: > > > > On Wed, Feb 13, 2019 at 03:30:29PM +0100, Sebastian Andrzej Siewior wrote: > > > On 2019-02-08 16:55:13 [+], Julien Grall wrote: > > > &

Re: [RFC][PATCH 0/3] arm64 relaxed ABI

2019-02-13 Thread Dave Martin
On Wed, Feb 13, 2019 at 04:42:11PM +, Kevin Brodsky wrote: > (+Cc other people with MTE experience: Branislav, Ruben) [...] > >I'm wondering whether we can piggy-back on existing concepts. > > > >We could say that recolouring memory is safe when and only when > >unmapping of the page or remov

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-21 Thread Dave Martin
On Thu, Feb 21, 2019 at 12:29:42PM +, Mark Rutland wrote: > On Tue, Feb 19, 2019 at 02:54:28PM +0530, Amit Daniel Kachhap wrote: > > From: Mark Rutland > > > > When pointer authentication is supported, a guest may wish to use it. > > This patch adds the necessary KVM infrastructure for this t

Re: [PATCH v6 1/6] arm64/kvm: preserve host HCR_EL2 value

2019-02-21 Thread Dave Martin
On Tue, Feb 19, 2019 at 02:54:26PM +0530, Amit Daniel Kachhap wrote: > From: Mark Rutland > > When restoring HCR_EL2 for the host, KVM uses HCR_HOST_VHE_FLAGS, which > is a constant value. This works today, as the host HCR_EL2 value is > always the same, but this will get in the way of supporting

Re: [PATCH v6 2/6] arm64/kvm: preserve host MDCR_EL2 value

2019-02-21 Thread Dave Martin
On Tue, Feb 19, 2019 at 02:54:27PM +0530, Amit Daniel Kachhap wrote: > Save host MDCR_EL2 value during kvm HYP initialisation and restore > after every switch from host to guest. There should not be any > change in functionality due to this. > > The value of mdcr_el2 is now stored in struct kvm_cp

Re: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-02-21 Thread Dave Martin
On Tue, Feb 19, 2019 at 02:54:31PM +0530, Amit Daniel Kachhap wrote: > This is a runtime capabality for KVM tool to enable Armv8.3 Pointer > Authentication in guest kernel. A command line option --ptrauth is > required for this. > > Signed-off-by: Amit Daniel Kachhap > --- > arm/aarch32/include/

Re: [PATCH v6 4/6] arm64/kvm: add a userspace option to enable pointer authentication

2019-02-21 Thread Dave Martin
On Tue, Feb 19, 2019 at 02:54:29PM +0530, Amit Daniel Kachhap wrote: > This feature will allow the KVM guest to allow the handling of > pointer authentication instructions or to treat them as undefined > if not set. It uses the existing vcpu API KVM_ARM_VCPU_INIT to > supply this parameter instead

Re: [PATCH v6 5/6] arm64/kvm: control accessibility of ptrauth key registers

2019-02-21 Thread Dave Martin
ters to default values but they are > left like that as they are conditionally accessible (set/get). > > Signed-off-by: Amit Daniel Kachhap > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvm...@lists.cs.columbia.edu > --- > This patch needs patch [1]

Re: [PATCH v6 3/6] arm64/kvm: context-switch ptrauth registers

2019-02-21 Thread Dave Martin
On Tue, Feb 19, 2019 at 02:54:28PM +0530, Amit Daniel Kachhap wrote: > From: Mark Rutland > > When pointer authentication is supported, a guest may wish to use it. > This patch adds the necessary KVM infrastructure for this to work, with > a semi-lazy context switch of the pointer auth state. >

Re: [kvmtool PATCH v6 6/6] arm/kvm: arm64: Add a vcpu feature for pointer authentication

2019-03-05 Thread Dave Martin
On Mon, Mar 04, 2019 at 04:38:18PM +0530, Amit Daniel Kachhap wrote: > > Hi Dave, > > On 3/1/19 4:54 PM, Dave P Martin wrote: > >On Fri, Mar 01, 2019 at 10:37:54AM +, Amit Daniel Kachhap wrote: > >>Hi, > >> > >>On 2/21/19 9:24 PM, Dave Martin w

Re: [PATCH 2/2] ARM: futex: make futex_detect_cmpxchg more reliable

2019-03-08 Thread Dave Martin
gt; > > > > > "that prevents it from overlapping any other input or output." > > > > > > > > > > > > > > > > but then withdrawn as the warning was determined to be > > > > > > > > harmless, and it > >

[PATCH v9 00/16] KVM: arm64: Optimise FPSIMD context switching

2018-05-21 Thread Dave Martin
5] [PULL v8] KVM: arm64: Optimise FPSIMD context switching http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/579353.html Christoffer Dall (1): KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change Dave Martin (15): thread_info: Add update_thread_flag() helpers arm64: Use update{,_

[PATCH v5 01/14] thread_info: Add update_thread_flag() helpers

2018-05-04 Thread Dave Martin
, cond) which do the equivalent of: if (cond) set*_thread_flag([...,] flag); else clear*_thread_flag([...,] flag); Signed-off-by: Dave Martin Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Oleg Nesterov --- include/linux/sched.h

[PATCH v5 00/14] KVM: arm64: Optimise FPSIMD context switching

2018-05-04 Thread Dave Martin
oduce kvm_arch_vcpu_run_pid_change Dave Martin (13): thread_info: Add update_thread_flag() helpers arm64: Use update{,_tsk}_thread_flag() KVM: arm64: Convert lazy FPSIMD context switch trap to C arm64: fpsimd: Generalise context saving for non-task contexts KVM: arm64: Optimise FPSIMD handli

Re: [PATCH] arm64: avoid potential infinity loop in dump_backtrace

2018-04-20 Thread Dave Martin
On Fri, Apr 20, 2018 at 01:38:33PM +0800, Ji Zhang wrote: > When we dump the backtrace of some tasks there is a potential infinity > loop if the content of the stack changed, no matter the change is > because the task is running or other unexpected cases. > > This patch add stronger check on frame

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-13 Thread Dave Martin
On Fri, Apr 13, 2018 at 09:33:17AM -0700, Linus Torvalds wrote: > On Fri, Apr 13, 2018 at 2:42 AM, Russell King - ARM Linux > wrote: > > > > Yes, it does solve the problem at hand with strace - the exact patch I > > tested against 4.16 is below. > > Ok, good. > > > However, FPE_FLTUNK is not def

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-13 Thread Dave Martin
On Fri, Apr 13, 2018 at 06:54:08PM +0100, Russell King - ARM Linux wrote: > On Fri, Apr 13, 2018 at 06:08:28PM +0100, Dave Martin wrote: > > On Fri, Apr 13, 2018 at 09:33:17AM -0700, Linus Torvalds wrote: > > > On Fri, Apr 13, 2018 at 2:42 AM, Russell King - ARM

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-13 Thread Dave Martin
On Fri, Apr 13, 2018 at 11:23:36AM -0700, Linus Torvalds wrote: > On Fri, Apr 13, 2018 at 10:54 AM, Russell King - ARM Linux > wrote: > > > > FPE_FLTINV means "floating point invalid operation". Does it really > > cover the case where hardware has failed, or is it intended to cover > > the case w

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-13 Thread Dave Martin
On Fri, Apr 13, 2018 at 07:50:17PM +0100, Russell King - ARM Linux wrote: > On Fri, Apr 13, 2018 at 07:35:38PM +0100, Dave Martin wrote: > > If that's the case though, I don't see how a userspace testsuite is > > hitting this code path. Maybe I've misunderstood

Re: [RFC PATCH 1/3] signal: Ensure every siginfo we send has all bits initialized

2018-04-17 Thread Dave Martin
On Sun, Apr 15, 2018 at 10:57:33AM -0500, Eric W. Biederman wrote: > > Call clear_siginfo to ensure every stack allocated siginfo is properly > initialized before being passed to the signal sending functions. > > Note: It is not safe to depend on C initializers to initialize struct > siginfo on t

[PATCH v7 00/16] KVM: arm64: Optimise FPSIMD context switching

2018-05-09 Thread Dave Martin
ernel/2018-May/thread.html Christoffer Dall (1): KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change Dave Martin (15): thread_info: Add update_thread_flag() helpers arm64: Use update{,_tsk}_thread_flag() KVM: arm64: Convert lazy FPSIMD context switch trap to C arm64: fpsimd: Gener

[PATCH v6 00/15] KVM: arm64: Optimise FPSIMD context switching

2018-05-08 Thread Dave Martin
l [2] [RFC PATCH 0/6] Simplify setting thread flags to a particular value https://lkml.org/lkml/2018/4/19/225 [3] linux-arm-kernel archive http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/thread.html Christoffer Dall (1): KVM: arm/arm64: Introduce kvm_arch_vcpu_run_pid_change

Re: [RFC PATCH 1/3] signal: Ensure every siginfo we send has all bits initialized

2018-04-18 Thread Dave Martin
On Tue, Apr 17, 2018 at 02:37:38PM -0500, Eric W. Biederman wrote: > Dave Martin writes: > > > Hmmm > > > > memset()/clear_siginfo() may ensure that there are no uninitialised > > explicit fields except for those in inactive union members, but I'm not > >

Re: [RFC PATCH 1/3] signal: Ensure every siginfo we send has all bits initialized

2018-04-19 Thread Dave Martin
On Wed, Apr 18, 2018 at 09:22:09AM -0500, Eric W. Biederman wrote: > Dave Martin writes: > > > On Tue, Apr 17, 2018 at 02:37:38PM -0500, Eric W. Biederman wrote: [...] > >> My intention is to leave 0 instances of clear_siginfo in the > >> architecture specific

Re: [RFC PATCH 0/3] Dealing with the aliases of SI_USER

2018-04-19 Thread Dave Martin
On Sun, Apr 15, 2018 at 11:16:04AM -0700, Linus Torvalds wrote: [...] > The other thing we should do is to get rid of the stupid padding. > Right now "struct siginfo" is pointlessly padded to 128 bytes. That is > completely insane, when it's always just zero in the kernel. Agreed, inside the ker

<    1   2   3   4   5   6   7   >