Re: [PATCH v5 01/10] arm64: Provide a command line to disable spectre_v2 mitigation

2019-02-28 Thread Catalin Marinas
On Thu, Feb 28, 2019 at 06:14:34PM +, Suzuki K Poulose wrote: > On 27/02/2019 01:05, Jeremy Linton wrote: > > There are various reasons, including bencmarking, to disable spectrev2 > > mitigation on a machine. Provide a command-line to do so. > > > > Signed-off-by: Jeremy Linton > > Cc:

Re: [PATCH] lib/raid6: use vdupq_n_u8 to avoid endianness warnings

2019-02-28 Thread Catalin Marinas
On Mon, Feb 25, 2019 at 08:03:42PM -0800, ndesaulni...@google.com wrote: > Clang warns: vector initializers are not compatible with NEON intrinsics > in big endian mode [-Wnonportable-vector-initialization] > > While this is usually the case, it's not an issue for this case since > we're

Re: [PATCH v2 0/3] Ensure inX() is ordered wrt delay() routines

2019-02-28 Thread Catalin Marinas
On Fri, Feb 22, 2019 at 06:04:51PM +, Will Deacon wrote: > Will Deacon (3): > asm-generic/io: Pass result of I/O accessor to __io_[p]ar() > riscv: io: Update __io_[p]ar() macros to take an argument > arm64: io: Hook up __io_par() for inX() ordering Since we have the acks in place, I

Re: [PATCH v5] arm64: Add workaround for Fujitsu A64FX erratum 010001

2019-02-28 Thread Catalin Marinas
On Tue, Feb 26, 2019 at 06:43:41PM +, James Morse wrote: > From: Zhang Lei > > On the Fujitsu-A64FX cores ver(1.0, 1.1), memory access may cause > an undefined fault (Data abort, DFSC=0b11). This fault occurs under > a specific hardware condition when a load/store instruction performs an

Re: [PATCH v5 00/10] arm64: add system vulnerability sysfs entries

2019-02-28 Thread Catalin Marinas
Hi Jeremy, On Tue, Feb 26, 2019 at 07:05:34PM -0600, Jeremy Linton wrote: > Jeremy Linton (6): > arm64: Provide a command line to disable spectre_v2 mitigation > arm64: add sysfs vulnerability show for meltdown > arm64: Always enable spectrev2 vulnerability detection > arm64: add sysfs

Re: [PATCH v3] mm/page_ext: fix an imbalance with kmemleak

2019-02-27 Thread Catalin Marinas
() GS:8881f768() knlGS: > CS: 0010 DS: ES: CR0: 80050033 > CR2: 888453d0 CR3: 0001c4244003 CR4: 001606a0 > Kernel panic - not syncing: Fatal exception > Shutting down cpus with NMI > Kernel Offset: 0x24c0 from 0x8100 (relocation range: > 0x8000-0xbfff) > ---[ end Kernel panic - not syncing: Fatal exception ]--- > > Signed-off-by: Qian Cai Reviewed-by: Catalin Marinas

Re: [PATCH v2] mm/page_ext: fix an imbalance with kmemleak

2019-02-27 Thread Catalin Marinas
BUG_ON(PageReserved(page)); > free_pages_exact(addr, table_size); > + kmemleak_free(addr); Same comment as for v1, call kmemleak_free() before free_pages_exact(). With that: Reviewed-by: Catalin Marinas

Re: [PATCH] mm/page_ext: fix an imbalance with kmemleak

2019-02-27 Thread Catalin Marinas
On Wed, Feb 27, 2019 at 12:15:56PM -0500, Qian Cai wrote: > After offlined a memory block, kmemleak scan will trigger a crash, as it > encounters a page ext address that has already been freed during memory > offlining. At the beginning in alloc_page_ext(), it calls > kmemleak_alloc(), but it does

Re: [PATCH 3/3] arm64: Remove documentation about TIF_USEDFPU

2019-02-26 Thread Catalin Marinas
On Fri, Feb 08, 2019 at 05:04:25PM +, Julien Grall wrote: > TIF_USEDFPU is not defined as thread flags for Arm64. So drop it from > the documentation. > > Signed-off-by: Julien Grall > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-ker...@lists.infradead.org Q

Re: [PATCH] mm/cma: cma_declare_contiguous: correct err handling

2019-02-26 Thread Catalin Marinas
gt; As for the fixed==true path, memblock_reserve() does not register the area > with kmemleak, so there would be no object to free in memblock_free(). > AFAIU, kmemleak simply ignores this. Kmemleak is supposed to work with the memblock_{alloc,free} pair and it ignores the memblock_reserve() as a memblock_alloc() implementation detail. It is, however, tolerant to memblock_free() being called on a sub-range or just a different range from a previous memblock_alloc(). So the original patch looks fine to me. FWIW: Reviewed-by: Catalin Marinas

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

2019-02-25 Thread Catalin Marinas
Hi Szabolcs, Thanks for looking into this. Comments below. On Tue, Feb 19, 2019 at 06:38:31PM +, Szabolcs Nagy wrote: > i think these rules work for the cases i care about, a more > tricky question is when/how to check for the new syscall abi > and when/how the TCR_EL1.TBI0 setting may be

Re: [PATCH] Use flush tlb last level when change protection

2019-02-24 Thread Catalin Marinas
On Sat, Feb 23, 2019 at 02:47:27PM +0800, Xuefeng Wang wrote: > The protection attributes are only kept in last level tlb, so > protection changing only need invalidate last level tlb, exclude > the PWC entries. > > Signed-off-by: Xuefeng Wang > --- > mm/mprotect.c | 2 +- > 1 file changed, 1

Re: [PATCH v4 03/12] arm64: Remove the ability to build a kernel without ssbd

2019-02-15 Thread Catalin Marinas
On Wed, Jan 30, 2019 at 06:04:15PM +, Andre Przywara wrote: > On Fri, 25 Jan 2019 12:07:02 -0600 > Jeremy Linton wrote: > > Buried behind EXPERT is the ability to build a kernel without > > SSBD, this needlessly clutters up the code as well as creates > > the opportunity for bugs. It also

Re: [PATCH v3 0/4] arm64: kprobes: Update blacklist checking on arm64

2019-02-15 Thread Catalin Marinas
Hi Masami, On Wed, Feb 13, 2019 at 12:42:53AM +0900, Masami Hiramatsu wrote: > In v3, I rebased on the latest arm64 kernel which includes > James' KVM/HYP fixes for kprobes, and fix a reported bugs > in [4/4]. I will queue this patches at 5.1-rc1 since the arm64 for-next/core branch is currently

Re: [PATCH v2 3/5] kmemleak: account for tagged pointers when calculating pointer range

2019-02-15 Thread Catalin Marinas
gt; With tagged pointers this range will get bigger than it needs to be. > This patch makes kmemleak untag pointers before saving them to min_addr > and max_addr and when performing a lookup. > > Signed-off-by: Andrey Konovalov I reviewed the old series. This patch also looks fine: Acked-by: Catalin Marinas

Re: [PATCH 3/5] kmemleak: account for tagged pointers when calculating pointer range

2019-02-15 Thread Catalin Marinas
gt; With tagged pointers this range will get bigger than it needs to be. > This patch makes kmemleak untag pointers before saving them to min_addr > and max_addr and when performing a lookup. > > Signed-off-by: Andrey Konovalov Acked-by: Catalin Marinas

Re: [PATCH 6/8] initramfs: move the legacy keepinitrd parameter to core code

2019-02-14 Thread Catalin Marinas
initramfs.c | 9 + > 8 files changed, 28 insertions(+), 47 deletions(-) For arm64: Acked-by: Catalin Marinas

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

2019-02-12 Thread Catalin Marinas
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: > > > Really, the kernel should do the expected thing with all "non-weird" > > > memory. > > > > > > In lieu of a proper definition

Re: add config symbols for arch_{setup,teardown}_dma_ops

2019-02-11 Thread Catalin Marinas
On Mon, Feb 11, 2019 at 02:21:56PM +0100, Christoph Hellwig wrote: > Any chance to get a quick review on this small series? For arm64: Acked-by: Catalin Marinas

Re: [PATCH] arm64: use memblocks_present

2019-02-11 Thread Catalin Marinas
On Sun, Feb 10, 2019 at 09:28:43AM +, Peng Fan wrote: > arm64_memory_present is doing same thing as memblocks_present, so > let's use common code memblocks_present instead of platform > specific arm64_memory_present. > > Signed-off-by: Peng Fan I already merged a similar one (see commit

Re: [PATCH v9 0/8] arm64: untag user pointers passed to the kernel

2019-02-11 Thread Catalin Marinas
Hi Dave, On Wed, Dec 12, 2018 at 05:01:12PM +, Dave P Martin wrote: > On Mon, Dec 10, 2018 at 01:50:57PM +0100, Andrey Konovalov wrote: > > arm64 has a feature called Top Byte Ignore, which allows to embed pointer > > tags into the top byte of each pointer. Userspace programs (such as > >

Re: [PATCH v10 12/25] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2019-02-08 Thread Catalin Marinas
On Fri, Feb 08, 2019 at 09:36:48AM +, Julien Thierry wrote: > From e839dec632bbf440efe8314751138ba46324078c Mon Sep 17 00:00:00 2001 > From: Julien Thierry > Date: Fri, 8 Feb 2019 09:21:58 + > Subject: [PATCH] arm64: irqflags: Fix clang build warnings > > Clang complains when passing asm

Re: [PATCH v10 00/25] arm64: provide pseudo NMI with GICv3

2019-02-06 Thread Catalin Marinas
Hi Julien, On Thu, Jan 31, 2019 at 02:58:38PM +, Julien Thierry wrote: > This series is a continuation of the work started by Daniel [1]. The goal > is to use GICv3 interrupt priorities to simulate an NMI. > > The patches depend on the core API for NMIs patches [2]. Both series can > be

Re: [PATCH -next] efi/arm64: return zero from ptdump_init()

2019-02-05 Thread Catalin Marinas
On Mon, Feb 04, 2019 at 04:01:01PM -0500, Qian Cai wrote: > The commit e2a2e56e4082 ("arm64: dump: no need to check return value of > debugfs_create functions") converted ptdump_debugfs_register() from > void, but forgot to fix the efi version of ptdump_init(). > >

Re: [RFC PATCH 1/3] arm64: entry: Remove unneeded need_resched() loop

2019-02-04 Thread Catalin Marinas
acon > Signed-off-by: Valentin Schneider > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Marc Zyngier > Cc: Julien Grall > Cc: Julien Thierry > Cc: Thomas Gleixner > Cc: linux-arm-ker...@lists.infradead.org Queued for 5.1. Thanks -- Catalin

Re: [PATCH v3 0/1] arm64: Add workaround for Fujitsu A64FX erratum 010001

2019-01-29 Thread Catalin Marinas
Hi, Could you please copy the whole description from the cover letter to the actual patch and only send one email (full description as in here together with the patch)? If we commit this to the kernel, it would be useful to have the information in the log for reference later on. More comments

Re: [PATCH 1/4] arm64: dump: no need to check return value of debugfs_create functions

2019-01-25 Thread Catalin Marinas
On Tue, Jan 22, 2019 at 03:41:11PM +0100, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: Catali

Re: [PATCH v2 1/1] arm64: Add workaround for Fujitsu A64FX erratum 010001

2019-01-25 Thread Catalin Marinas
On Tue, Jan 22, 2019 at 08:54:33AM +, Zhang, Lei wrote: > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > index efb7b2c..37e4f18 100644 > --- a/arch/arm64/mm/fault.c > +++ b/arch/arm64/mm/fault.c > @@ -666,6 +666,28 @@ static int do_sea(unsigned long addr, unsigned int esr, >

Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-25 Thread Catalin Marinas
On Mon, Jan 21, 2019 at 10:03:53AM +0200, Mike Rapoport wrote: > diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c > index ae34e3a..2c61ea4 100644 > --- a/arch/arm64/mm/numa.c > +++ b/arch/arm64/mm/numa.c > @@ -237,6 +237,10 @@ static void __init setup_node_data(int nid, u64 > start_pfn,

Re: [PATCH v2 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved

2019-01-25 Thread Catalin Marinas
y marking pages as PG_reserved is not necessary, they are > already in the desired state (otherwise they would have been handed over > to the buddy as free pages and bad things would happen). > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: James Morse > Cc: Bhupesh Sharma > Cc

Re: [PATCH v2 6/9] arm64: kexec: no need to ClearPageReserved()

2019-01-25 Thread Catalin Marinas
On Mon, Jan 14, 2019 at 01:59:00PM +0100, David Hildenbrand wrote: > This will be done by free_reserved_page(). > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Bhupesh Sharma > Cc: James Morse > Cc: Marc Zyngier > Cc: Dave Kleikamp > Cc: Mark Rutland > Cc: And

Re: [PATCH v2 29/29] y2038: add 64-bit time_t syscalls to all 32-bit architectures

2019-01-25 Thread Catalin Marinas
pass only counts elapsed time, not time since the epoch. They > will be dealt with later. > > Signed-off-by: Arnd Bergmann Acked-by: Catalin Marinas (as long as compat follows the arm32 syscall numbers)

Re: [PATCH v2 25/29] y2038: syscalls: rename y2038 compat syscalls

2019-01-25 Thread Catalin Marinas
ectures twice. > > Signed-off-by: Arnd Bergmann For arm64: Acked-by: Catalin Marinas

Re: [PATCH v2 07/29] ARM: add kexec_file_load system call number

2019-01-25 Thread Catalin Marinas
NR_migrate_pages 400 > __SYSCALL(__NR_migrate_pages, compat_sys_migrate_pages) > +#define __NR_kexec_file_load 401 > +__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load) For arm64: Acked-by: Catalin Marinas

Re: [PATCH v2 06/29] ARM: add migrate_pages() system call

2019-01-25 Thread Catalin Marinas
e on 64-bit kernels, so that argument is no > longer very strong. > > Assigning the number lets us use the system call on 64-bit kernels as well > as providing a more consistent set of syscalls across architectures. > > Signed-off-by: Arnd Bergmann For the arm64 part: Acked-by: Catalin Marinas

Re: [PATCH] arm64: Kconfig.platforms: fix warning unmet direct dependencies

2019-01-25 Thread Catalin Marinas
On Tue, Jan 15, 2019 at 08:18:39PM +0100, Anders Roxell wrote: > When ARCH_MXC get enabled, ARM64_ERRATUM_845719 will be selected and > this warning will happen when COMPAT isn't set. > > WARNING: unmet direct dependencies detected for ARM64_ERRATUM_845719 > Depends on [n]: COMPAT [=n] >

Re: [PATCH v3 0/4] uaccess: Add unsafe accessors for arm64

2019-01-25 Thread Catalin Marinas
Hi Julien, On Tue, Jan 15, 2019 at 01:58:25PM +, Julien Thierry wrote: > Julien Thierry (4): > arm64: uaccess: Cleanup get/put_user() > arm64: uaccess: Implement unsafe accessors > uaccess: Check no rescheduling function is called in unsafe region > arm64: uaccess: Implement

Re: [Qestion] Softlockup when send IPI to other CPUs

2019-01-24 Thread Catalin Marinas
Hi Shijith, On Thu, Jan 24, 2019 at 07:00:42AM +, Shijith Thotton wrote: > On 01/23/2019 11:45 PM, Catalin Marinas wrote: > > diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c > > index 30695a868107..5c9073bace83 100644 > > --- a/arch/arm64/mm/flush.c > >

Re: [Qestion] Softlockup when send IPI to other CPUs

2019-01-23 Thread Catalin Marinas
On Tue, Jan 22, 2019 at 05:44:02AM +, Will Deacon wrote: > On Mon, Jan 21, 2019 at 02:21:28PM +0000, Catalin Marinas wrote: > > arm64: Do not issue IPIs for user executable ptes > > > > From: Catalin Marinas > > > > Commit 3b8c9f1cdfc5 ("arm64: IPI e

Re: [PATCH v9 09/26] arm64: Unmask PMR before going idle

2019-01-22 Thread Catalin Marinas
WFI. > > Since the logic of cpu_do_idle is becoming a bit more complex than just > two instructions, lets turn it from ASM to C. > > Signed-off-by: Julien Thierry > Suggested-by: Daniel Thompson > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Catalin Marinas

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

2019-01-22 Thread Catalin Marinas
> + asm volatile(ALTERNATIVE( > + "mov%0, %1\n" > + "nop\n" > + "nop", > + "mrs_s %0, " __stringify(SYS_ICC_PMR_EL1) "\n" > + "ands %1, %1, " __stringify(PSR_I_BIT) "\n" > + "csel %0, %0, %2, eq", > + ARM64_HAS_IRQ_PRIO_MASKING) > + : "=" (flags), "+r" (daif_bits) > + : "r" (GIC_PRIO_IRQOFF) > : "memory"); > + > + return flags; > +} BTW, how's the code generated from the C version? It will have a branch but may not be too bad. Either way is fine by me. Reviewed-by: Catalin Marinas

Re: [PATCH 2/2] arm64: mm: make use of new memblocks_present() helper

2019-01-21 Thread Catalin Marinas
gt; similar to other arches. > >> > >> memblocks_present() is a direct replacement of arm64_memory_present() > >> > >> Signed-off-by: Logan Gunthorpe > >> Acked-by: Catalin Marinas > >> Cc: Will Deacon > >> --- > >> arch/arm64/mm/init.c | 20 +-

Re: kmemleak panic

2019-01-21 Thread Catalin Marinas
On Mon, Jan 21, 2019 at 07:35:11AM -0600, Rob Herring wrote: > On Mon, Jan 21, 2019 at 6:19 AM Robin Murphy wrote: > > > > On 21/01/2019 11:57, Marc Gonzalez wrote: > > [...] > > > # echo dump=0xffc021e0 > /sys/kernel/debug/kmemleak > > > kmemleak: Object 0xffc021e0 (size

Re: [Qestion] Softlockup when send IPI to other CPUs

2019-01-21 Thread Catalin Marinas
onsibility of the user to ensure cache maintenance (I can add more text to the patch below but need to get to the bottom of this first) -8<- arm64: Do not issue IPIs for user executable ptes From: Catalin Marinas Commit 3b8c9f1cdfc5 ("arm64: IPI each CPU after invalidatin

Re: kmemleak panic

2019-01-19 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 04:36:59PM +0100, Marc Gonzalez wrote: > mount -t debugfs nodev /sys/kernel/debug/ > echo scan > /sys/kernel/debug/kmemleak > > Unable to handle kernel paging request at virtual address ffc021e0 [...] > Call trace: > scan_block+0x70/0x190 >

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

2019-01-18 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 05:30:02PM +, Catalin Marinas wrote: > On Fri, Jan 18, 2019 at 04:57:32PM +, Julien Thierry wrote: > > On 18/01/2019 16:09, Catalin Marinas wrote: > > > On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > > >> +

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

2019-01-18 Thread Catalin Marinas
On Fri, Jan 18, 2019 at 04:57:32PM +, Julien Thierry wrote: > On 18/01/2019 16:09, Catalin Marinas wrote: > > On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > >> + asm volatile(ALTERNATIVE( > >> + "nop", > >>

Re: [PATCH v8 13/26] arm64: daifflags: Include PMR in daifflags restore operations

2019-01-18 Thread Catalin Marinas
interrupt enabling/disabling > goes through ICC_PMR_EL1. > > Signed-off-by: Julien Thierry > Cc: Catalin Marinas > Cc: Will Deacon > Cc: James Morse Reviewed-by: Catalin Marinas

Re: [PATCH v8 11/26] efi: Let architectures decide the flags that should be saved/restored

2019-01-18 Thread Catalin Marinas
on return from a runtime service. > This allows to check for flags that are not necesarly related to > irqflags. > > Signed-off-by: Julien Thierry Acked-by: Catalin Marinas

Re: [PATCH v8 10/26] arm64: kvm: Unmask PMR before entering guest

2019-01-18 Thread Catalin Marinas
e enter a guest. > > Signed-off-by: Julien Thierry > Cc: Christoffer Dall > Cc: Marc Zyngier > Cc: Catalin Marinas > Cc: Will Deacon > Cc: kvm...@lists.cs.columbia.edu Acked-by: Catalin Marinas

Re: [PATCH v8 09/26] arm64: Unmask PMR before going idle

2019-01-18 Thread Catalin Marinas
On Tue, Jan 08, 2019 at 02:07:27PM +, Julien Thierry wrote: > CPU does not received signals for interrupts with a priority masked by > ICC_PMR_EL1. This means the CPU might not come back from a WFI > instruction. > > Make sure ICC_PMR_EL1 does not mask interrupts when doing a WFI. > > Since

Re: [PATCH v8 08/26] arm64: Make PMR part of task context

2019-01-18 Thread Catalin Marinas
stores PSR.I bit in spsr_el1 for exceptions and ERET. > > Add PMR to the registers to save in the pt_regs struct upon kernel entry, > and restore it before ERET. Also, initialize it to a sane value when > creating new tasks. > > Signed-off-by: Julien Thierry > Cc: Catalin Marin

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

2019-01-18 Thread Catalin Marinas
Hi Julien, On Tue, Jan 08, 2019 at 02:07:30PM +, Julien Thierry wrote: > + * Having two ways to control interrupt status is a bit complicated. Some > + * locations like exception entries will have PSR.I bit set by the > architecture > + * while PMR is unmasked. > + * We need the irqflags to

Re: [PATCH v8 07/26] arm64: ptrace: Provide definitions for PMR values

2019-01-14 Thread Catalin Marinas
mask interrupts. > > Signed-off-by: Julien Thierry > Suggested-by: Daniel Thompson > Cc: Oleg Nesterov > Cc: Catalin Marinas > Cc: Will Deacon Acked-by: Catalin Marinas

Re: [PATCH v8 01/26] arm64: Fix HCR.TGE status for NMI contexts

2019-01-14 Thread Catalin Marinas
On Tue, Jan 08, 2019 at 02:07:19PM +, Julien Thierry wrote: > When using VHE, the host needs to clear HCR_EL2.TGE bit in order > to interract with guest TLBs, switching from EL2&0 translation regime > to EL1&0. > > However, some non-maskable asynchronous event could happen while TGE is >

Re: [PATCH] net/core/neighbour: tell kmemleak about hash tables

2019-01-11 Thread Catalin Marinas
On Fri, Jan 11, 2019 at 07:26:09AM +0300, Konstantin Khlebnikov wrote: > On Thu, Jan 10, 2019 at 11:45 PM Cong Wang wrote: > > On Tue, Jan 8, 2019 at 1:30 AM Konstantin Khlebnikov > > wrote: > > > @@ -443,12 +444,14 @@ static struct neigh_hash_table > > > *neigh_hash_alloc(unsigned int shift) >

Re: [PATCH] selinux: avc: mark avc node as not a leak

2019-01-09 Thread Catalin Marinas
Hi Prateek, On Wed, Jan 09, 2019 at 02:09:22PM +0530, Prateek Patel wrote: > From: Sri Krishna chowdary > > kmemleak detects allocated objects as leaks if not accessed for > default scan time. The memory allocated using avc_alloc_node > is freed using rcu mechanism when nodes are reclaimed or

Re: [PATCH v2] kmemleak: survive in a low-memory situation

2019-01-07 Thread Catalin Marinas
On Thu, Jan 03, 2019 at 06:07:35PM +0100, Michal Hocko wrote: > > > On Wed 02-01-19 13:06:19, Qian Cai wrote: > > > [...] > > >> diff --git a/mm/kmemleak.c b/mm/kmemleak.c > > >> index f9d9dc250428..9e1aa3b7df75 100644 > > >> --- a/mm/kmemleak.c > > >> +++ b/mm/kmemleak.c > > >> @@ -576,6 +576,16

Re: [PATCH] mm: kmemleak: Turn kmemleak_lock to spin lock and RCU primitives

2019-01-07 Thread Catalin Marinas
On Mon, Jan 07, 2019 at 03:31:18PM +0800, He Zhe wrote: > On 1/5/19 2:37 AM, Catalin Marinas wrote: > > On Fri, Jan 04, 2019 at 10:29:13PM +0800, zhe...@windriver.com wrote: > >> It's not necessary to keep consistency between readers and writers of > >> kmemle

Re: kmemleak: Cannot allocate a kmemleak_object structure - Kernel 4.19.13

2019-01-07 Thread Catalin Marinas
Hi Nathan, On Tue, Jan 01, 2019 at 01:17:06PM -0600, Nathan Royce wrote: > I had a leak somewhere and I was directed to look into SUnreclaim > which was 5.5 GB after an uptime of a little over 1 month on an 8 GB > system. kmalloc-2048 was a problem. > I just had enough and needed to find out the

Re: [PATCH] mm: kmemleak: Turn kmemleak_lock to spin lock and RCU primitives

2019-01-04 Thread Catalin Marinas
On Fri, Jan 04, 2019 at 10:29:13PM +0800, zhe...@windriver.com wrote: > It's not necessary to keep consistency between readers and writers of > kmemleak_lock. RCU is more proper for this case. And in order to gain better > performance, we turn the reader locks to RCU read locks and writer locks to

Re: [PATCH] kmemleak: survive in a low-memory situation

2019-01-02 Thread Catalin Marinas
Hi Qian, On Wed, Jan 02, 2019 at 11:08:49AM -0500, Qian Cai wrote: > Kmemleak could quickly fail to allocate an object structure and then > disable itself in a low-memory situation. For example, running a mmap() > workload triggering swapping and OOM [1]. > > First, it unnecessarily attempt to

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

2018-12-18 Thread Catalin Marinas
On Tue, Dec 18, 2018 at 04:03:38PM +0100, Andrey Konovalov wrote: > On Wed, Dec 12, 2018 at 4:02 PM Catalin Marinas > wrote: > > The summary of our internal discussions (mostly between kernel > > developers) is that we can't properly describe a user ABI that covers > > fu

Re: [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT

2018-12-18 Thread Catalin Marinas
gt; ksys_ioctl+0x67/0x90 > __x64_sys_ioctl+0x1a/0x20 > do_syscall_64+0x4d/0xf0 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > kmemleak is an error detecting feature. We would not expect as good > performance > as without it. As there is no raw rwlock defining helpers, we turn > kmemleak_lock > to a raw spinlock. > > Signed-off-by: He Zhe > Cc: catalin.mari...@arm.com > Cc: bige...@linutronix.de > Cc: t...@linutronix.de > Cc: rost...@goodmis.org As I replied already, I don't think this patch would increase the kmemleak latency (or performance), although I haven't actually tested it. FWIW: Acked-by: Catalin Marinas

Re: [PATCH v2] kmemleak: Turn kmemleak_lock to raw spinlock on RT

2018-12-18 Thread Catalin Marinas
On Tue, Dec 18, 2018 at 06:51:41PM +0800, He Zhe wrote: > On 2018/12/6 03:14, Sebastian Andrzej Siewior wrote: > > With raw locks you wouldn't have multiple readers at the same time. > > Maybe you wouldn't have recursion but since you can't have multiple > > readers you would add lock contention

Re: [PATCH v10 5/6] arm64: select ACPI PCI code only both features are enabled

2018-12-17 Thread Catalin Marinas
> + select PCI_ECAM if (ACPI && PCI) > > select POWER_RESET > > select POWER_SUPPLY > > select REFCOUNT_FULL > > > > I need a maintainer ACK here. Acked-by: Catalin Marinas

[GIT PULL] arm64 fixes for 4.20

2018-12-14 Thread Catalin Marinas
Hi Linus, Please pull the arm64 fix below. Thanks. The following changes since commit 40e020c129cfc991e8ab4736d2665351ffd1468d: Linux 4.20-rc6 (2018-12-09 15:31:00 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-fixes

Re: Can we drop upstream Linux x32 support?

2018-12-13 Thread Catalin Marinas
On Wed, Dec 12, 2018 at 10:03:30AM -0800, Andy Lutomirski wrote: > On Wed, Dec 12, 2018 at 8:52 AM Rich Felker wrote: > > On Wed, Dec 12, 2018 at 08:39:53AM -0800, Andy Lutomirski wrote: > > > I'm proposing another alternative. Given that x32 already proves that > > > the user bitness model

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

2018-12-12 Thread Catalin Marinas
Hi Andrey, On Wed, Dec 12, 2018 at 03:23:25PM +0100, Andrey Konovalov wrote: > On Mon, Dec 10, 2018 at 3:31 PM Vincenzo Frascino > wrote: > > On arm64 the TCR_EL1.TBI0 bit has been set since Linux 3.x hence > > the userspace (EL0) is allowed to set a non-zero value in the top > > byte but the

Re: [PATCH V2] kmemleak: Add config to select auto scan

2018-12-12 Thread Catalin Marinas
On Wed, Dec 12, 2018 at 12:14:29PM +0530, Prateek Patel wrote: > On 10/29/2018 4:13 PM, Catalin Marinas wrote: > > On Mon, Oct 22, 2018 at 11:38:43PM +0530, Prateek Patel wrote: > > > From: Sri Krishna chowdary > > > > > > Kmemleak scan can be cpu intensi

Re: Can we drop upstream Linux x32 support?

2018-12-11 Thread Catalin Marinas
On Tue, Dec 11, 2018 at 12:37:42PM +0100, Florian Weimer wrote: > * Catalin Marinas: > > On Tue, Dec 11, 2018 at 10:02:45AM +0100, Arnd Bergmann wrote: > >> On Tue, Dec 11, 2018 at 6:35 AM Andy Lutomirski wrote: > >> > I tried to understand what's going o

Re: Can we drop upstream Linux x32 support?

2018-12-11 Thread Catalin Marinas
On Tue, Dec 11, 2018 at 10:02:45AM +0100, Arnd Bergmann wrote: > On Tue, Dec 11, 2018 at 6:35 AM Andy Lutomirski wrote: > > I tried to understand what's going on. As far as I can tell, most of > > the magic is the fact that __kernel_long_t and __kernel_ulong_t are > > 64-bit as seen by x32 user

Re: linux-next: manual merge of the arm64 tree with Linus' tree

2018-12-11 Thread Catalin Marinas
On Tue, Dec 11, 2018 at 08:52:57AM +1100, Stephen Rothwell wrote: > Today's linux-next merge of the arm64 tree got conflicts in: > > Documentation/arm64/silicon-errata.txt > arch/arm64/Kconfig > > between commit: > > ce8c80c536da ("arm64: Add workaround for Cortex-A76 erratum 1286807") >

Re: [PATCH v6 08/13] arm64: expose user PAC bit positions via ptrace

2018-12-10 Thread Catalin Marinas
On Mon, Dec 10, 2018 at 02:29:45PM +, Will Deacon wrote: > On Mon, Dec 10, 2018 at 08:22:06AM -0600, Richard Henderson wrote: > > On 12/10/18 6:03 AM, Catalin Marinas wrote: > > >> However, it won't be too long before someone implements support for > > >> ARM

Re: [PATCH v2 2/2] arm64: uaccess: Implement unsafe accessors

2018-12-10 Thread Catalin Marinas
On Fri, Dec 07, 2018 at 08:38:11AM +, Julien Thierry wrote: > > > On 12/06/2018 06:25 PM, Catalin Marinas wrote: > > On Mon, Dec 03, 2018 at 01:55:18PM +, Julien Thierry wrote: > > > diff --git a/arch/arm64/include/asm/uaccess.h > > > b/arch/arm64/

Re: [PATCH v6 10/24] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2018-12-10 Thread Catalin Marinas
On Thu, Dec 06, 2018 at 09:50:18AM +, Julien Thierry wrote: > On 05/12/18 18:26, Catalin Marinas wrote: > > On Wed, Dec 05, 2018 at 04:55:54PM +, Julien Thierry wrote: > >> On 04/12/18 17:36, Catalin Marinas wrote: > >>> On Mon, Nov 12, 2018 at 11:57:01

Re: [REPOST PATCH v6 0/4] kgdb: Fix kgdb_roundup_cpus()

2018-12-10 Thread Catalin Marinas
Hi Doug, On Fri, Dec 07, 2018 at 10:40:24AM -0800, Doug Anderson wrote: > On Fri, Dec 7, 2018 at 9:42 AM Catalin Marinas > wrote: > > On Tue, Dec 04, 2018 at 07:38:24PM -0800, Douglas Anderson wrote: > > > Douglas Anderson (4): > > > kgdb: Remove irq flags

Re: [PATCH v6 08/13] arm64: expose user PAC bit positions via ptrace

2018-12-10 Thread Catalin Marinas
On Sun, Dec 09, 2018 at 09:41:31AM -0600, Richard Henderson wrote: > On 12/7/18 12:39 PM, Kristina Martsenko wrote: > > When pointer authentication is in use, data/instruction pointers have a > > number of PAC bits inserted into them. The number and position of these > > bits depends on the

[GIT PULL] arm64 fixes for 4.20-rc6

2018-12-07 Thread Catalin Marinas
Hi Linus, Please pull the arm64 fix below. Thanks. The following changes since commit 2595646791c319cadfdbf271563aac97d0843dc7: Linux 4.20-rc5 (2018-12-02 15:07:55 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-fixes

[GIT PULL] arm64 fixes for 4.20-rc6

2018-12-07 Thread Catalin Marinas
Hi Linus, Please pull the arm64 fix below. Thanks. The following changes since commit 2595646791c319cadfdbf271563aac97d0843dc7: Linux 4.20-rc5 (2018-12-02 15:07:55 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux tags/arm64-fixes

Re: [REPOST PATCH v6 0/4] kgdb: Fix kgdb_roundup_cpus()

2018-12-07 Thread Catalin Marinas
On Tue, Dec 04, 2018 at 07:38:24PM -0800, Douglas Anderson wrote: > Douglas Anderson (4): > kgdb: Remove irq flags from roundup > kgdb: Fix kgdb_roundup_cpus() for arches who used smp_call_function() > kgdb: Don't round up a CPU that failed rounding up before > kdb: Don't back trace on a

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Catalin Marinas
memleak_scan: > > # echo "scan" > /sys/kernel/debug/kmemleak > > before the patch: > > kmemleak: time spend: 41596 us > > after the patch: > > kmemleak: time spend: 34899 us > > Signed-off-by: Oscar Salvador Acked-by: Catalin Marinas

Re: [PATCH] mm, kmemleak: Little optimization while scanning

2018-12-07 Thread Catalin Marinas
memleak_scan: > > # echo "scan" > /sys/kernel/debug/kmemleak > > before the patch: > > kmemleak: time spend: 41596 us > > after the patch: > > kmemleak: time spend: 34899 us > > Signed-off-by: Oscar Salvador Acked-by: Catalin Marinas

Re: [PATCH v2 2/2] arm64: uaccess: Implement unsafe accessors

2018-12-06 Thread Catalin Marinas
On Mon, Dec 03, 2018 at 01:55:18PM +, Julien Thierry wrote: > diff --git a/arch/arm64/include/asm/uaccess.h > b/arch/arm64/include/asm/uaccess.h > index 07c3408..cabfcae 100644 > --- a/arch/arm64/include/asm/uaccess.h > +++ b/arch/arm64/include/asm/uaccess.h > @@ -233,6 +233,23 @@ static

Re: [PATCH v2 2/2] arm64: uaccess: Implement unsafe accessors

2018-12-06 Thread Catalin Marinas
On Mon, Dec 03, 2018 at 01:55:18PM +, Julien Thierry wrote: > diff --git a/arch/arm64/include/asm/uaccess.h > b/arch/arm64/include/asm/uaccess.h > index 07c3408..cabfcae 100644 > --- a/arch/arm64/include/asm/uaccess.h > +++ b/arch/arm64/include/asm/uaccess.h > @@ -233,6 +233,23 @@ static

Re: [RESEND PATCH] drivers/base: kmemleak ignore a known leak

2018-12-06 Thread Catalin Marinas
this leak has been existed for more than 8-year now and it does not > reference other part of the memory, let kmemleak ignore it, so users don't > need to waste time reporting this in the future. > > Signed-off-by: Qian Cai Acked-by: Catalin Marinas

Re: [RESEND PATCH] drivers/base: kmemleak ignore a known leak

2018-12-06 Thread Catalin Marinas
this leak has been existed for more than 8-year now and it does not > reference other part of the memory, let kmemleak ignore it, so users don't > need to waste time reporting this in the future. > > Signed-off-by: Qian Cai Acked-by: Catalin Marinas

Re: [RESEND PATCH] efi: let kmemleak ignore false positives

2018-12-06 Thread Catalin Marinas
= kmalloc(sizeof(*rsv), GFP_ATOMIC); > > Kmemleak has a known limitation that can only track pointers in the kernel > virtual space. Hence, it will report false positives due to "rsv" will only > reference to other physical addresses, > > rsv->next = efi_memreserve_root->next; > efi_memreserve_root->next = __pa(rsv); > > Signed-off-by: Qian Cai Acked-by: Catalin Marinas

Re: [PATCH] arm64: hugetlb: Register hugepages during arch init

2018-12-06 Thread Catalin Marinas
It seems that we somehow missed this patch. Cc'ing a few more people that touched hugetlbpage.c. Catalin On Tue, Oct 23, 2018 at 06:36:57AM +0530, Allen Pais wrote: > Add hstate for each supported hugepage size using arch initcall. > > * no hugepage parameters > > Without hugepage

Re: [PATCH] arm64: hugetlb: Register hugepages during arch init

2018-12-06 Thread Catalin Marinas
It seems that we somehow missed this patch. Cc'ing a few more people that touched hugetlbpage.c. Catalin On Tue, Oct 23, 2018 at 06:36:57AM +0530, Allen Pais wrote: > Add hstate for each supported hugepage size using arch initcall. > > * no hugepage parameters > > Without hugepage

Re: [PATCH v8 0/8] arm64: untag user pointers passed to the kernel

2018-12-06 Thread Catalin Marinas
On Thu, Dec 06, 2018 at 01:44:24PM +0100, Andrey Konovalov wrote: > On Thu, Nov 29, 2018 at 7:16 PM Catalin Marinas > wrote: > > On Thu, Nov 08, 2018 at 03:48:10PM +0100, Andrey Konovalov wrote: > > > On Thu, Nov 8, 2018 at 3:36 PM, Andrey Konovalov > > >

Re: [PATCH v6 10/24] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2018-12-05 Thread Catalin Marinas
On Wed, Dec 05, 2018 at 04:55:54PM +, Julien Thierry wrote: > On 04/12/18 17:36, Catalin Marinas wrote: > > On Mon, Nov 12, 2018 at 11:57:01AM +, Julien Thierry wrote: > >> diff --git a/arch/arm64/include/asm/irqflags.h > >> b/arch/arm64/include/asm/irqflags.h

Re: [PATCH v6 10/24] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2018-12-05 Thread Catalin Marinas
On Wed, Dec 05, 2018 at 04:55:54PM +, Julien Thierry wrote: > On 04/12/18 17:36, Catalin Marinas wrote: > > On Mon, Nov 12, 2018 at 11:57:01AM +, Julien Thierry wrote: > >> diff --git a/arch/arm64/include/asm/irqflags.h > >> b/arch/arm64/include/asm/irqflags.h

Re: [PATCH v6 21/24] arm64: Handle serror in NMI context

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:12AM +, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index 5f4d9ac..66344cd 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -897,13 +897,17 @@ bool arm64_is_fatal_ras_serror(struct

Re: [PATCH v6 21/24] arm64: Handle serror in NMI context

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:12AM +, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c > index 5f4d9ac..66344cd 100644 > --- a/arch/arm64/kernel/traps.c > +++ b/arch/arm64/kernel/traps.c > @@ -897,13 +897,17 @@ bool arm64_is_fatal_ras_serror(struct

Re: [PATCH v6 15/24] arm64: Switch to PMR masking when starting CPUs

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:06AM +, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index 8dc9dde..e495360 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include >

Re: [PATCH v6 15/24] arm64: Switch to PMR masking when starting CPUs

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:06AM +, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > index 8dc9dde..e495360 100644 > --- a/arch/arm64/kernel/smp.c > +++ b/arch/arm64/kernel/smp.c > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include >

Re: [PATCH v6 10/24] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:01AM +, Julien Thierry wrote: > diff --git a/arch/arm64/include/asm/irqflags.h > b/arch/arm64/include/asm/irqflags.h > index 24692ed..e0a32e4 100644 > --- a/arch/arm64/include/asm/irqflags.h > +++ b/arch/arm64/include/asm/irqflags.h > @@ -18,7 +18,27 @@ > >

Re: [PATCH v6 10/24] arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:57:01AM +, Julien Thierry wrote: > diff --git a/arch/arm64/include/asm/irqflags.h > b/arch/arm64/include/asm/irqflags.h > index 24692ed..e0a32e4 100644 > --- a/arch/arm64/include/asm/irqflags.h > +++ b/arch/arm64/include/asm/irqflags.h > @@ -18,7 +18,27 @@ > >

Re: [PATCH v6 07/24] arm64: Make PMR part of task context

2018-12-04 Thread Catalin Marinas
On Mon, Nov 12, 2018 at 11:56:58AM +, Julien Thierry wrote: > diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S > index 039144e..eb8120e 100644 > --- a/arch/arm64/kernel/entry.S > +++ b/arch/arm64/kernel/entry.S > @@ -249,6 +249,12 @@ alternative_else_nop_endif > msr

<    5   6   7   8   9   10   11   12   13   14   >