Re: [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit

2018-12-07 Thread Will Deacon
On Thu, Dec 06, 2018 at 08:42:03PM +, Alexander Van Brunt wrote: > > > > If we roll a TLB invalidation routine without the trailing DSB, what > > > >sort of > > > > performance does that get you? > > > > > > It is not as good. In some cases, it is really bad. Skipping the > > > invalidate

Re: [PATCH 0/5] arm64: assorted fixes for dcache_by_line_op

2018-12-07 Thread Will Deacon
resulting from incorrect use > of conditional GAS directives. > > Patches #1 to #3 are groundwork for #4. > > Cc: Robin Murphy > Cc: Will Deacon > Cc: Catalin Marinas > Cc: Marc Zyngier > Cc: Suzuki Poulose > Cc: Dave Martin > > Ard Biesheuvel (5): >

Re: [PATCH 1/4] arm64: hyperv: Add core Hyper-V include files

2018-12-07 Thread Will Deacon
Hi all, On Thu, Nov 22, 2018 at 03:10:56AM +, k...@linuxonhyperv.com wrote: > From: Michael Kelley > > hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level > Functional Spec (TLFS). The TLFS is distinctly oriented to x86/x64, > and Hyper-V has not separated out the

Re: [PATCH 2/4] arm64: hyperv: Add support for Hyper-V as a hypervisor

2018-12-07 Thread Will Deacon
On Thu, Nov 22, 2018 at 03:10:57AM +, k...@linuxonhyperv.com wrote: > From: Michael Kelley > > Add ARM64-specific code to enable Hyper-V. This code includes: > * Detecting Hyper-V and initializing the guest/Hyper-V interface > * Setting up Hyper-V's synthetic clocks > * Making hypercalls

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

2018-12-07 Thread Will Deacon
On Fri, Dec 07, 2018 at 09:18:47AM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the arm64 tree got a conflict in: > > arch/arm64/kernel/cpu_errata.c > > between commit: > > ce8c80c536da ("arm64: Add workaround for Cortex-A76 erratum 1286807") > > from Linus'

Re: [PATCH v2 0/2] arm64: Only call into preempt_schedule() if need_resched()

2018-12-06 Thread Will Deacon
Hi Peter, On Thu, Dec 06, 2018 at 04:08:50PM +0100, Peter Zijlstra wrote: > On Fri, Nov 30, 2018 at 05:34:29PM +, Will Deacon wrote: > > This is version two of the patches I originally posted here: > > > > > > http://lkml.kernel.org/r/1543347902-21170-1-git-sen

Re: [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit

2018-12-06 Thread Will Deacon
Hi Alex, Thanks for running these tests and providing the in-depth analysis. On Mon, Dec 03, 2018 at 09:20:25PM +, Alexander Van Brunt wrote: > > If we roll a TLB invalidation routine without the trailing DSB, what sort of > > performance does that get you? > > It is not as good. In some

Re: [PATCH] ARM: dts: sunxi: Fix PMU compatible strings

2018-12-06 Thread Will Deacon
-a20.dtsi > @@ -199,7 +199,7 @@ > }; > > pmu { > - compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu"; > + compatible = "arm,cortex-a7-pmu"; > interrupts = , >; Acked-by: Will Deacon Will

[RESEND PATCH v4 0/5] Clean up huge vmap and ioremap code

2018-12-06 Thread Will Deacon
t;8 Will Deacon (5): ioremap: Rework pXd_free_pYd_page() API arm64: mmu: Drop pXd_present() checks from pXd_free_pYd_table() x86/pgtable: Drop pXd_none() checks from pXd_free_pYd_table() lib/ioremap: Ensure phys_addr actually corresponds to a physical address lib/ioremap: Ensure br

[RESEND PATCH v4 2/5] arm64: mmu: Drop pXd_present() checks from pXd_free_pYd_table()

2018-12-06 Thread Will Deacon
The core code already has a check for pXd_none(), so remove it from the architecture implementation. Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Signed-off-by: Will Deacon --- arch/arm64/mm/mmu.c | 8 ++-- 1 file changed, 2 insertions(+), 6

[RESEND PATCH v4 5/5] lib/ioremap: Ensure break-before-make is used for huge p4d mappings

2018-12-06 Thread Will Deacon
-by: Toshi Kani Signed-off-by: Will Deacon --- arch/arm64/mm/mmu.c | 5 + arch/x86/mm/pgtable.c | 8 include/asm-generic/pgtable.h | 5 + lib/ioremap.c | 27 +-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git

[RESEND PATCH v4 4/5] lib/ioremap: Ensure phys_addr actually corresponds to a physical address

2018-12-06 Thread Will Deacon
: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Cc: Sean Christopherson Tested-by: Sean Christopherson Reviewed-by: Sean Christopherson Signed-off-by: Will Deacon --- lib/ioremap.c | 28 1 file changed, 12 insertions(+), 16

[RESEND PATCH v4 3/5] x86/pgtable: Drop pXd_none() checks from pXd_free_pYd_table()

2018-12-06 Thread Will Deacon
The core code already has a check for pXd_none(), so remove it from the architecture implementation. Cc: Chintan Pandya Cc: Toshi Kani Cc: Michal Hocko Cc: Andrew Morton Acked-by: Thomas Gleixner Reviewed-by: Toshi Kani Signed-off-by: Will Deacon --- arch/x86/mm/pgtable.c | 6 -- 1

[RESEND PATCH v4 1/5] ioremap: Rework pXd_free_pYd_page() API

2018-12-06 Thread Will Deacon
. Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Suggested-by: Linus Torvalds Reviewed-by: Toshi Kani Signed-off-by: Will Deacon --- lib/ioremap.c | 56 ++-- 1 file changed, 42 insertions(+), 14

Re: [PATCH 2/2] arm64: ftrace: Set FTRACE_SCHEDULABLE before ftrace_modify_all_code()

2018-12-06 Thread Will Deacon
On Thu, Dec 06, 2018 at 10:59:14AM -0500, Steven Rostedt wrote: > On Thu, 6 Dec 2018 13:20:07 + > Will Deacon wrote: > > > On Wed, Dec 05, 2018 at 12:48:54PM -0500, Steven Rostedt wrote: > > > From: "Steven Rostedt (VMware)" > > > > > > I

Re: [PATCH] scripts/atomic: change 'fold' to 'grep'

2018-12-06 Thread Will Deacon
d of 'fold' to use a dependency that is > already used a lot in the kernel. > > Reported-by: Naresh Kamboju > Suggested-by: Will Deacon > Signed-off-by: Anders Roxell > --- > scripts/atomic/atomic-tbl.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > dif

Re: [for-next][PATCH 05/30] arm64: function_graph: Remove use of FTRACE_NOTRACE_DEPTH

2018-12-06 Thread Will Deacon
curr_ret_stack no longer needs to worry about checking for > this. curr_ret_stack is still initialized to -1, when there's not a shadow > stack allocated. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-ker...@lists.infradead.org > Reviewed-by: Joel Fernandes (Go

Re: [PATCH 2/2] arm64: ftrace: Set FTRACE_SCHEDULABLE before ftrace_modify_all_code()

2018-12-06 Thread Will Deacon
t; @@ -193,6 +193,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace > *rec, > > void arch_ftrace_update_code(int command) > { > + command |= FTRACE_SCHEDULABLE; > ftrace_modify_all_code(command); > } Bikeshed: I'd probably go for FTRACE_MAY_SLEEP, but I'm not going to die on that hill so... Acked-by: Will Deacon Thanks, Steve! Will

Re: [PATCH v2 1/7] arm64: capabilities: Merge entries for ARM64_WORKAROUND_CLEAN_CACHE

2018-12-06 Thread Will Deacon
On Wed, Dec 05, 2018 at 05:14:53PM +, Suzuki K Poulose wrote: > On 05/12/2018 15:02, Will Deacon wrote: > >On Fri, Nov 30, 2018 at 05:18:00PM +, Suzuki K Poulose wrote: > >>diff --git a/arch/arm64/include/asm/cputype.h > >>b/arch/arm64/include/asm/cputype.h

Re: [PATCH v2 1/7] arm64: capabilities: Merge entries for ARM64_WORKAROUND_CLEAN_CACHE

2018-12-05 Thread Will Deacon
erge these entries to avoid > duplicate entries for a single capability. Add a new Kconfig > entry to control the "capability" entry to make it easier > to handle combinations of the CONFIGs. > > Cc: Will Deacon > Cc: Andre Przywara > Cc: Mark Rutland > Signed-o

Re: [PATCH v2] tracing: add cond_resched to ftrace_replace_code()

2018-12-05 Thread Will Deacon
Hi Anders, Steve, On Tue, Dec 04, 2018 at 08:29:03PM +0100, Anders Roxell wrote: > When running in qemu on an kernel built with allmodconfig and debug > options (in particular kcov and ubsan) enabled, ftrace_replace_code > function call take minutes. The ftrace selftest calls >

Re: [PATCH v3] perf: tests: Disable breakpoint tests on ARM (32-bit)

2018-12-04 Thread Will Deacon
> ARM 32-bit platforms and update the comment above to explain these > limitations. > > Signed-off-by: Florian Fainelli > --- > Changes in v3: > > - directly incorporate Will's comment, Will can you add your > Signed-off-by? Of course: Co-developed-by: Will Deacon Signed-off-by: Will Deacon Will

Re: Linux-next: Build failed

2018-12-04 Thread Will Deacon
Hi Naresh, On Tue, Dec 04, 2018 at 05:56:09PM +0530, Naresh Kamboju wrote: > FYI, > > The Linux -next build failed due to below warnings/errors. > > include/asm-generic/bitops/atomic.h: In function 'set_bit': > include/asm-generic/bitops/atomic.h:17:2: error: implicit declaration > of function

Re: [PATCH 3/3] arm64: ftrace: add cond_resched() to func ftrace_make_(call|nop)

2018-12-04 Thread Will Deacon
Hi Steve, Arnd, On Tue, Dec 04, 2018 at 12:50:12AM -0500, Steven Rostedt wrote: > On Mon, 3 Dec 2018 22:51:52 +0100 > Arnd Bergmann wrote: > > On Mon, Dec 3, 2018 at 8:22 PM Will Deacon wrote: > > > On Fri, Nov 30, 2018 at 04:09:56PM +0100, Anders Roxell wrote: > >

Re: [PATCH 3/3] arm64: ftrace: add cond_resched() to func ftrace_make_(call|nop)

2018-12-03 Thread Will Deacon
Hi Anders, On Fri, Nov 30, 2018 at 04:09:56PM +0100, Anders Roxell wrote: > Both of those functions end up calling ftrace_modify_code(), which is > expensive because it changes the page tables and flush caches. > Microseconds add up because this is called in a loop for each dyn_ftrace > record,

Re: [RFT PATCH v1 3/4] cpu-topology: Move cpu topology code to common code.

2018-12-03 Thread Will Deacon
On Thu, Nov 29, 2018 at 03:28:19PM -0800, Atish Patra wrote: > Both RISC-V & ARM64 are using cpu-map device tree to describe > their cpu topology. It's better to move the relevant code to > a common place instead of duplicate code. > > Signed-off-by: Atish Patra > --- >

[PATCH v2 0/2] arm64: Only call into preempt_schedule() if need_resched()

2018-11-30 Thread Will Deacon
. This resolves the issue spotted by Peter, where an IRQ coming in during the decrement can cause a reschedule to be missed. Feedback welcome. Will --->8 Will Deacon (2): preempt: Move PREEMPT_NEED_RESCHED definition into arch code arm64: preempt: Provide our own implementation of asm/preempt.h a

[PATCH v2 1/2] preempt: Move PREEMPT_NEED_RESCHED definition into arch code

2018-11-30 Thread Will Deacon
-by: Will Deacon --- arch/s390/include/asm/preempt.h | 2 ++ arch/x86/include/asm/preempt.h | 3 +++ include/linux/preempt.h | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/s390/include/asm/preempt.h b/arch/s390/include/asm/preempt.h index 23a14d187fb1

[PATCH v2 2/2] arm64: preempt: Provide our own implementation of asm/preempt.h

2018-11-30 Thread Will Deacon
is only 32 bits wide, we can simply pack it next to the resched flag and load the whole thing in one go, so that a dec-and-test operation doesn't need to load twice. Signed-off-by: Will Deacon --- arch/arm64/include/asm/Kbuild| 1 - arch/arm64/include/asm/preempt.h | 88

Re: dcache_readdir NULL inode oops

2018-11-30 Thread Will Deacon
On Fri, Nov 30, 2018 at 04:08:52PM +, Al Viro wrote: > On Fri, Nov 30, 2018 at 09:16:49AM -0600, Eric W. Biederman wrote: > > >> > + inode_lock(parent->d_inode); > > >> > dentry->d_fsdata = NULL; > > >> > drop_nlink(dentry->d_inode); > > >> > d_delete(dentry); > >

Re: [RFC] locking/rwsem: Avoid issuing wakeup before setting the reader waiter to nil

2018-11-29 Thread Will Deacon
On Thu, Nov 29, 2018 at 01:26:34PM -0500, Waiman Long wrote: > On 11/29/2018 01:08 PM, Peter Zijlstra wrote: > > Hmm, I think we're missing a barrier in wake_q_add(); when cmpxchg() > > fails we still need an smp_mb(). > > > > Something like so. > > > > diff --git a/kernel/sched/core.c

Re: [PATCH v12 23/25] kasan, arm64: select HAVE_ARCH_KASAN_SW_TAGS

2018-11-29 Thread Will Deacon
On Tue, Nov 27, 2018 at 05:55:41PM +0100, Andrey Konovalov wrote: > Now, that all the necessary infrastructure code has been introduced, > select HAVE_ARCH_KASAN_SW_TAGS for arm64 to enable software tag-based > KASAN mode. > > Signed-off-by: Andrey Konovalov > --- > arch/arm64/Kconfig | 1 + >

Re: [PATCH v12 20/25] kasan, arm64: add brk handler for inline instrumentation

2018-11-29 Thread Will Deacon
On Tue, Nov 27, 2018 at 05:55:38PM +0100, Andrey Konovalov wrote: > Tag-based KASAN inline instrumentation mode (which embeds checks of shadow > memory into the generated code, instead of inserting a callback) generates > a brk instruction when a tag mismatch is detected. > > This commit adds a

Re: [PATCH] arm64: io: specify asm operand width for __iormb()

2018-11-29 Thread Will Deacon
On Thu, Nov 29, 2018 at 09:17:38AM -0700, Nathan Chancellor wrote: > On Thu, Nov 29, 2018 at 04:13:37PM +, Will Deacon wrote: > > On Thu, Nov 29, 2018 at 09:10:39AM -0700, Nathan Chancellor wrote: > > > This doesn't appear to work, I get this error: > > > >

Re: [PATCH] arm64: io: specify asm operand width for __iormb()

2018-11-29 Thread Will Deacon
On Thu, Nov 29, 2018 at 09:10:39AM -0700, Nathan Chancellor wrote: > On Thu, Nov 29, 2018 at 10:49:03AM +, Will Deacon wrote: > > On Thu, Nov 29, 2018 at 09:03:54AM +, Julien Thierry wrote: > > > On 29/11/18 04:19, Nick Desaulniers wrote: > > > > Fixes t

Re: [PATCH] perf: arm_spe: handle devm_kasprintf() failure

2018-11-29 Thread Will Deacon
On Thu, Nov 29, 2018 at 12:14:32PM +, Mark Rutland wrote: > On Wed, Nov 28, 2018 at 12:24:47PM +0100, Nicholas Mc Guire wrote: > > diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c > > index 54ec278..f1ea00c 100644 > > --- a/drivers/perf/arm_spe_pmu.c > > +++

Re: [PATCH] arm64: io: specify asm operand width for __iormb()

2018-11-29 Thread Will Deacon
On Thu, Nov 29, 2018 at 09:03:54AM +, Julien Thierry wrote: > > > On 29/11/18 04:19, Nick Desaulniers wrote: > > Fixes the warning produced from Clang: > > ./include/asm-generic/io.h:711:9: warning: value size does not match > > register size specified by the constraint and modifier > >

Re: dcache_readdir NULL inode oops

2018-11-28 Thread Will Deacon
I spent some more time looking at this today... On Fri, Nov 23, 2018 at 06:05:25PM +, Will Deacon wrote: > Doing some more debugging, it looks like the usual failure case is where > one CPU clears the inode field in the dentry via: > > devpts_pty_kill() >

Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-28 Thread Will Deacon
On Wed, Nov 28, 2018 at 09:22:23AM -0500, Steven Rostedt wrote: > On Wed, 28 Nov 2018 12:05:02 + > Will Deacon wrote: > > > Ok! Then please add a comment to arch_syscall_match_sym_name() along those > > lines, and you can add my ack: > > > > Acked-by: Wi

Re: [PATCH 0/2] arm64: Only call into preempt_schedule() if need_resched()

2018-11-28 Thread Will Deacon
On Wed, Nov 28, 2018 at 10:01:46AM +0100, Peter Zijlstra wrote: > On Wed, Nov 28, 2018 at 09:56:40AM +0100, Peter Zijlstra wrote: > > On Tue, Nov 27, 2018 at 07:45:00PM +0000, Will Deacon wrote: > > > This pair of patches improves our preempt_enable() implementation sligh

Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-28 Thread Will Deacon
Hi Masami, On Wed, Nov 28, 2018 at 08:55:55AM +0900, Masami Hiramatsu wrote: > On Tue, 27 Nov 2018 13:18:59 -0500 > Steven Rostedt wrote: > > > On Tue, 27 Nov 2018 16:58:49 + > > Will Deacon wrote: > > > > > This looks fine to me, but I'm cu

Re: [PATCH 0/2] Don’t leave executable TLB entries to freed pages

2018-11-28 Thread Will Deacon
On Tue, Nov 27, 2018 at 05:21:08PM -0800, Nadav Amit wrote: > > On Nov 27, 2018, at 5:06 PM, Nadav Amit wrote: > > > >> On Nov 27, 2018, at 4:07 PM, Rick Edgecombe > >> wrote: > >> > >> Sometimes when memory is freed via the module subsystem, an executable > >> permissioned TLB entry can

[PATCH 0/2] arm64: Only call into preempt_schedule() if need_resched()

2018-11-27 Thread Will Deacon
: d65f03c0ret Will --->8 Will Deacon (2): preempt: Move PREEMPT_NEED_RESCHED definition into arch code arm64: preempt: Provide our own implementation of asm/preempt.h arch/arm64/include/asm/Kbuild| 1 - arch/arm64/include/asm/preempt.h |

[PATCH 2/2] arm64: preempt: Provide our own implementation of asm/preempt.h

2018-11-27 Thread Will Deacon
is only 32 bits wide, we can simply pack it next to the resched flag and load the whole thing in one go, so that a dec-and-test operation doesn't need to load twice. Signed-off-by: Will Deacon --- arch/arm64/include/asm/Kbuild| 1 - arch/arm64/include/asm/preempt.h | 78

[PATCH 1/2] preempt: Move PREEMPT_NEED_RESCHED definition into arch code

2018-11-27 Thread Will Deacon
-by: Will Deacon --- arch/s390/include/asm/preempt.h | 2 ++ arch/x86/include/asm/preempt.h | 3 +++ include/linux/preempt.h | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/s390/include/asm/preempt.h b/arch/s390/include/asm/preempt.h index 23a14d187fb1

Re: [RFC][PATCH 03/14] arm64: function_graph: Remove use of FTRACE_NOTRACE_DEPTH

2018-11-27 Thread Will Deacon
> Remove the reference to it. Do you have a pointer to the commit that changed that behaviour? I just want to make sure we're not missing something in our unwind_frame() code. > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-ker...@lists.infradead.org > Signed-off-by: Steven

Re: [PATCH 1/7] arm64: capabilities: Merge entries for ARM64_WORKAROUND_CLEAN_CACHE

2018-11-27 Thread Will Deacon
On Mon, Nov 26, 2018 at 03:09:56PM +, Suzuki K Poulose wrote: > On Mon, Nov 26, 2018 at 02:06:04PM +, Will Deacon wrote: > > On Mon, Nov 05, 2018 at 11:55:11AM +, Suzuki K Poulose wrote: > > > We have two entries for ARM64_WORKAROUND_CLEAN_CACHE capability : > >

Re: [PATCH v2] perf: tests: Disable breakpoint tests on ARM (32-bit)

2018-11-27 Thread Will Deacon
On Mon, Nov 26, 2018 at 04:31:23PM -0800, Florian Fainelli wrote: > breakpoint tests on the ARM 32-bit kernel are broken in several ways. > > The breakpoint length requested does not necessarily match whether the > function address has the Thumb bit (bit 0) set or not, and this does > matter to

Re: [PATCH] arm64/bpf: use movn/movk/movk sequence to generate kernel addresses

2018-11-27 Thread Will Deacon
; This means we can generate an immediate jump address using a sequence > of one MOVN (move wide negated) and two MOVK instructions, where the > first one sets the lower 16 bits but also sets all top bits to 0x1. > > Signed-off-by: Ard Biesheuvel > --- Acked-by: Will Deacon Denial,

Re: [for-next][PATCH 04/18] arm64: function_graph: Simplify with function_graph_entry()

2018-11-27 Thread Will Deacon
he architecture dependent prepare_ftrace_return(). > > Have arm64 use the new code, and remove the shadow stack management as well as > having to set up the trace structure. > > This is needed to prepare for a fix of a design bug on how the curr_ret_stack > is used. > > Cc

Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64

2018-11-27 Thread Will Deacon
Hi Masami, On Wed, Nov 28, 2018 at 01:29:45AM +0900, Masami Hiramatsu wrote: > Since commit 4378a7d4be30 ("arm64: implement syscall wrappers") > introduced "__arm64_" prefix to all syscall wrapper symbols in > sys_call_table, syscall tracer can not find corresponding > metadata from syscall name.

Re: [PATCH v4 4/5] lib/ioremap: Ensure phys_addr actually corresponds to a physical address

2018-11-27 Thread Will Deacon
On Mon, Nov 26, 2018 at 11:00:10AM -0800, Sean Christopherson wrote: > On Mon, Nov 26, 2018 at 05:07:46PM +, Will Deacon wrote: > > The current ioremap() code uses a phys_addr variable at each level of > > page table, which is confusingly offset by subtracting the base virt

Re: [PATCH 3/4] Drivers: hv: vmbus: Add hooks for per-CPU IRQ

2018-11-27 Thread Will Deacon
On Tue, Nov 27, 2018 at 07:20:56AM +0100, Greg KH wrote: > On Mon, Nov 26, 2018 at 08:56:50PM +, Michael Kelley wrote: > > From: Greg KH Monday, November 26, 2018 11:57 > > AM > > > > > > > You created "null" hooks that do nothing, for no one in this patch > > > > > series, why? > > > > >

[PATCH v4 1/5] ioremap: Rework pXd_free_pYd_page() API

2018-11-26 Thread Will Deacon
. Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Suggested-by: Linus Torvalds Reviewed-by: Toshi Kani Signed-off-by: Will Deacon --- lib/ioremap.c | 56 ++-- 1 file changed, 42 insertions(+), 14

[PATCH v4 0/5] Clean up huge vmap and ioremap code

2018-11-26 Thread Will Deacon
-send-email-will.dea...@arm.com The only change since v3 is a rebase onto v4.20-rc3, which was automatic. I would appreciate a review of patch 4. Sean, please could you take a quick look? Thanks, Will --->8 Will Deacon (5): ioremap: Rework pXd_free_pYd_page() API arm64: mmu: D

[PATCH v4 4/5] lib/ioremap: Ensure phys_addr actually corresponds to a physical address

2018-11-26 Thread Will Deacon
: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Cc: Sean Christopherson Signed-off-by: Will Deacon --- lib/ioremap.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/ioremap.c b/lib/ioremap.c index

[PATCH v4 3/5] x86/pgtable: Drop pXd_none() checks from pXd_free_pYd_table()

2018-11-26 Thread Will Deacon
The core code already has a check for pXd_none(), so remove it from the architecture implementation. Cc: Chintan Pandya Cc: Toshi Kani Cc: Michal Hocko Cc: Andrew Morton Acked-by: Thomas Gleixner Reviewed-by: Toshi Kani Signed-off-by: Will Deacon --- arch/x86/mm/pgtable.c | 6 -- 1

[PATCH v4 2/5] arm64: mmu: Drop pXd_present() checks from pXd_free_pYd_table()

2018-11-26 Thread Will Deacon
The core code already has a check for pXd_none(), so remove it from the architecture implementation. Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Andrew Morton Signed-off-by: Will Deacon --- arch/arm64/mm/mmu.c | 8 ++-- 1 file changed, 2 insertions(+), 6

[PATCH v4 5/5] lib/ioremap: Ensure break-before-make is used for huge p4d mappings

2018-11-26 Thread Will Deacon
-by: Toshi Kani Signed-off-by: Will Deacon --- arch/arm64/mm/mmu.c | 5 + arch/x86/mm/pgtable.c | 8 include/asm-generic/pgtable.h | 5 + lib/ioremap.c | 27 +-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git

Re: [PATCH 1/7] arm64: capabilities: Merge entries for ARM64_WORKAROUND_CLEAN_CACHE

2018-11-26 Thread Will Deacon
erge these entries to avoid > duplicate entries for a single capability. > > Cc: Will Deacon > Cc: Andre Przywara > Cc: Mark Rutland > Signed-off-by: Suzuki K Poulose > --- > arch/arm64/kernel/cpu_errata.c | 19 +++ > 1 file changed, 7 insertions(+),

Re: [PATCH 1/2] scripts/decodecode: Set ARCH when running natively on arm/arm64

2018-11-23 Thread Will Deacon
ARM platform, > although that's even less popular. > > A simple workaround is to populate ARCH when it is not set and that we're > running on an arm/arm64 system. > > Signed-off-by: Marc Zyngier > --- > scripts/decodecode | 7 +++ > 1 file changed, 7 insertions(+) Acked-by: Will Deacon Will

Re: dcache_readdir NULL inode oops

2018-11-23 Thread Will Deacon
, Jan Glauber wrote: > On Tue, Nov 20, 2018 at 07:03:17PM +, Will Deacon wrote: > > On Tue, Nov 20, 2018 at 06:28:54PM +0000, Will Deacon wrote: > > > On Sat, Nov 10, 2018 at 11:17:03AM +, Jan Glauber wrote: > > > > On Fri, Nov 09, 2018 at 03:58:56PM +, Will

Re: [PATCH v2 1/1] arm64: Early boot time stamps

2018-11-21 Thread Will Deacon
Hi Pavel, On Tue, Nov 20, 2018 at 09:43:40AM -0500, Pavel Tatashin wrote: > Allow printk time stamps/sched_clock() to be available from the early > boot. > > Signed-off-by: Pavel Tatashin > --- > arch/arm64/kernel/setup.c| 25 + >

Re: [RESEND PATCH v17 5/5] iommu/arm-smmu: Add support for qcom,smmu-v2 variant

2018-11-21 Thread Will Deacon
[+Thor] On Fri, Nov 16, 2018 at 04:54:30PM +0530, Vivek Gautam wrote: > qcom,smmu-v2 is an arm,smmu-v2 implementation with specific > clock and power requirements. > On msm8996, multiple cores, viz. mdss, video, etc. use this > smmu. On sdm845, this smmu is used with gpu. > Add bindings for the

Re: [PATCH v4 0/2] Enable smmu support on sdm845

2018-11-21 Thread Will Deacon
Hi Vivek, On Thu, Oct 11, 2018 at 03:19:28PM +0530, Vivek Gautam wrote: > This series enables apps-smmu, the "arm,mmu-500" instance > on sdm845. > Series tested on SDM845 MTP device with related smmu patch series [1], > and necessary config change, besides one hack to keep LDO14 in LPM mode > to

Re: dcache_readdir NULL inode oops

2018-11-20 Thread Will Deacon
On Tue, Nov 20, 2018 at 06:28:54PM +, Will Deacon wrote: > On Sat, Nov 10, 2018 at 11:17:03AM +, Jan Glauber wrote: > > On Fri, Nov 09, 2018 at 03:58:56PM +0000, Will Deacon wrote: > > > On Fri, Nov 09, 2018 at 02:37:51PM +, Jan Glauber wrote: > > > >

Re: dcache_readdir NULL inode oops

2018-11-20 Thread Will Deacon
On Sat, Nov 10, 2018 at 11:17:03AM +, Jan Glauber wrote: > On Fri, Nov 09, 2018 at 03:58:56PM +, Will Deacon wrote: > > On Fri, Nov 09, 2018 at 02:37:51PM +, Jan Glauber wrote: > > > I'm seeing the following oops reproducible with upstream kernel on arm6

Re: [PATCH] perf: tests: Disable breakpoint tests on ARM (32-bit)

2018-11-20 Thread Will Deacon
On Fri, Nov 16, 2018 at 02:53:07PM -0800, Florian Fainelli wrote: > breakpoint tests on the ARM 32-bit kernel are broken in several ways. > > The breakpoint length requested does not necessarily match whether the > function address has the Thumb bit (bit 0) set or not, and this does > matter to

[PATCH] Documentation: Use "while" instead of "whilst"

2018-11-19 Thread Will Deacon
id Howells Cc: Liam Girdwood Cc: Chris Wilson Cc: Michael Halcrow Cc: Jonathan Corbet Reported-by: Linus Torvalds Signed-off-by: Will Deacon --- Documentation/admin-guide/kernel-parameters.txt| 2 +- Documentation/admin-guide/security-bugs.rst| 2 +- Documentation/arm/Booting

Re: [PATCH] arm64: Explicitly mark 64-bit constant as unsigned long

2018-11-16 Thread Will Deacon
Hi Olof, On Fri, Nov 16, 2018 at 05:54:56PM -0800, Olof Johansson wrote: > Makes sparse happy. Before: > > arch/arm64/include/asm/sysreg.h:471:42: warning: constant 0x > is so big it is unsigned long > arch/arm64/include/asm/sysreg.h:512:42: warning: constant 0x

Re: [PATCH v1] arch: arm64: add ARM64 specific fucntions required for ehci fsl driver

2018-11-15 Thread Will Deacon
On Thu, Nov 15, 2018 at 05:23:57PM +0800, Yinbo Zhu wrote: > From: Rajesh Bhagat > > Add set/clear bits functions for ARM platform which are used by ehci fsl > driver > > Signed-off-by: Rajesh Bhagat > Signed-off-by: Yinbo Zhu > --- > arch/arm64/include/asm/io.h | 29

Re: [PATCH v4 4/6] arm64: Utilize phys_initrd_start/phys_initrd_size

2018-11-15 Thread Will Deacon
etions(-) Looks ok to me: Acked-by: Will Deacon Will

Re: ARM builtin perf tests for breakpoint failures

2018-11-14 Thread Will Deacon
Hi Florian, On Wed, Nov 14, 2018 at 12:21:12PM -0800, Florian Fainelli wrote: > I have been trying to debug some perf builtin tests on ARM 32-bit and > found that "Breakpoint overflow signal handler" and "Breakpoint overflow > sampling" were failing, but there are a number of reasons for that and

Re: dcache_readdir NULL inode oops

2018-11-09 Thread Will Deacon
On Fri, Nov 09, 2018 at 02:37:51PM +, Jan Glauber wrote: > I'm seeing the following oops reproducible with upstream kernel on arm64 > (ThunderX2): [...] > It happens after 1-3 hours of running 'stress-ng --dev 128'. This testcase > does a scandir of /dev and then calls random stuff like

Re: [PATCH] of, numa: Validate some distance map rules

2018-11-07 Thread Will Deacon
STANCE)) { > + pr_err("Invalid distance[node%d -> node%d] = %d\n", > +nodea, nodeb, distance); > + return -EINVAL; > + } > + > numa_set_distance(nodea, nodeb, distance); > - pr_debug("distance[node%d -> node%d] = %d\n", > - nodea, nodeb, distance); Looks good to me, although I'm not sure which tree this should go through. Acked-by: Will Deacon Will

[tip:perf/urgent] tools headers barrier: Fix arm64 tools build failure wrt smp_load_{acquire,release}

2018-11-06 Thread tip-bot for Will Deacon
Commit-ID: 51f5fd2e4615dcdc25cd7f9d19b7b27eb9ecdac7 Gitweb: https://git.kernel.org/tip/51f5fd2e4615dcdc25cd7f9d19b7b27eb9ecdac7 Author: Will Deacon AuthorDate: Wed, 31 Oct 2018 17:44:08 + Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 1 Nov 2018 10:07:43 -0300 tools headers

Re: [PATCH] mm/thp: Correctly differentiate between mapped THP and PMD migration entry

2018-11-05 Thread Will Deacon
On Fri, Nov 02, 2018 at 11:45:00AM +0530, Anshuman Khandual wrote: > On 10/17/2018 07:39 AM, Andrea Arcangeli wrote: > > What we need to do during split is an invalidate of the huge TLB. > > There's no pmd_trans_splitting anymore, so we only clear the present > > bit in the PTE despite pmd_present

Re: [PATCH v2] bit_spinlock: introduce smp_cond_load_relaxed

2018-11-05 Thread Will Deacon
[+PeterZ -- please include him on stuff like this] Hi Gao, On Tue, Oct 30, 2018 at 02:04:41PM +0800, Gao Xiang wrote: > It is better to use wrapped smp_cond_load_relaxed > instead of open-coded busy waiting for bit_spinlock. > > Signed-off-by: Gao Xiang > --- > > change log v2: > - fix the

Re: [PATCH v2] arm64/module: use plt section indices for relocations

2018-11-05 Thread Will Deacon
t; --- > > v2: > > - Do sechdrs[pltsec->plt_shndx].sh_addr instead of pointer math > > Note: Addressed Will's comment about the pltsec -> plt_info rename and > removed that change to reduce unnecessary code churn. I didn't include the > Ack's for this reason so let me know

Re: [PATCH] mailmap: Update email for Punit Agrawal

2018-11-02 Thread Will Deacon
nsertion(+) > > diff --git a/.mailmap b/.mailmap > index a76be45fef6c..28fecafa6506 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -159,6 +159,7 @@ Peter Oruba > Peter Oruba > Pratyush Anand > Praveen BP > +Punit Agrawal > Qais Yousef > Oleksij Rempel

[PATCH] mremap: properly flush TLB before releasing the page

2018-11-02 Thread Will Deacon
shed after somebody else has already done something to that page). This also makes the whole "need_flush" logic unnecessary, since we now always end up flushing the TLB for every valid entry. Reported-and-tested-by: Jann Horn Acked-by: Will Deacon Tested-by: Ingo Molnar Acked-by: P

Re: [PATCH] arm64: kdump: fix small typo

2018-11-01 Thread Will Deacon
On Thu, Nov 01, 2018 at 11:25:31AM -0400, Yangtao Li wrote: > Signed-off-by: Yangtao Li > --- > arch/arm64/kernel/crash_dump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/crash_dump.c b/arch/arm64/kernel/crash_dump.c > index

Re: [PATCH v2] arm64/module: use mod->klp_info section header information for livepatch modules

2018-11-01 Thread Will Deacon
Hello, Jessica, On Tue, Oct 30, 2018 at 02:19:10PM +0100, Jessica Yu wrote: > +++ Will Deacon [29/10/18 15:28 +]: > >On Fri, Oct 26, 2018 at 07:25:01PM +0200, Jessica Yu wrote: > >>diff --git a/arch/arm64/include/asm/module.h > >>b/arch/arm64/include/asm/modu

Re: [PATCH] arm64/numa: Add more vetting in numa_set_distance()

2018-11-01 Thread Will Deacon
[ Nit: Please wrap your lines when replying -- I've done it for you here ] On Tue, Oct 30, 2018 at 08:16:21AM +0530, Anshuman Khandual wrote: > On 10/29/2018 08:14 PM, John Garry wrote: > >  I think we should either factor out the sanity check > >> into a core helper or make the core code

Re: arch/x86/include/asm/rmwcc.h:23:17: error: jump into statement expression

2018-11-01 Thread Will Deacon
Peter, On Thu, Nov 01, 2018 at 09:11:52AM +0800, kbuild test robot wrote: > FYI, the error/warning still remains. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: 5b7449810ae6d652629c550d3974c8453836d229 > commit:

Re: arm64 tools build failure wrt smp_load_{acquire,release} expansion on gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)

2018-11-01 Thread Will Deacon
[apologies if you get this twice -- my GPU hung (!) whilst sending my previous response] On Wed, Oct 31, 2018 at 06:14:56PM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 31, 2018 at 07:08:29PM +0100, Daniel Borkmann escreveu: > > On 10/31/2018 06:44 PM, Will Deacon wrote: > &g

Re: arm64 tools build failure wrt smp_load_{acquire,release} expansion on gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)

2018-10-31 Thread Will Deacon
Hi Arnaldo, On Wed, Oct 31, 2018 at 12:45:50PM -0300, Arnaldo Carvalho de Melo wrote: > So I noticed the following build failure thare point to: > > commit 09d62154f61316f7e97eae3f31ef8770c7e4b386 > Author: Daniel Borkmann > Date: Fri Oct 19 15:51:02 2018 +0200 > > tools, perf: add and

Re: [PATCH 16/17] prmem: pratomic-long

2018-10-30 Thread Will Deacon
On Tue, Oct 30, 2018 at 04:58:41PM +0100, Peter Zijlstra wrote: > On Mon, Oct 29, 2018 at 11:17:14PM +0200, Igor Stoppa wrote: > > > > > > On 25/10/2018 01:13, Peter Zijlstra wrote: > > > On Wed, Oct 24, 2018 at 12:35:03AM +0300, Igor Stoppa wrote: > > > > +static __always_inline > > > > +bool

Re: [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit

2018-10-30 Thread Will Deacon
[Sorry to be "that person" but please can you use plain text for your mail? This is getting really hard to follow.] On Tue, Oct 30, 2018 at 11:17:34AM +0530, Ashish Mhetre wrote: > On 29/10/18 4:25 PM, Will Deacon wrote: > On Mon, Oct 29, 2018 at 02:55:58PM +0530, Ash

Re: [PATCH v2] arm64: kprobe: make page to RO mode when allocate it

2018-10-30 Thread Will Deacon
k); > static void __kprobes > post_kprobe_handler(struct kprobe_ctlblk *, struct pt_regs *); > > +static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) > +{ > + void *addrs[1]; > + u32 insns[1]; > + > + addrs[0] = (void *)addr; > + insns[0] = (u32)opcode; I know they exist already, but I think you can drop these casts (Catalin can do it when he picks this up -- no need to respin). With that: Acked-by: Will Deacon Thanks for respinning so quickly. Will

Re: [PATCH v2 1/6] mm: Introduce common STRUCT_PAGE_MAX_SHIFT define

2018-10-29 Thread Will Deacon
efined properly instead of > set and checked with a build bug. This also allows us to use the same > define for riscv. > > Signed-off-by: Logan Gunthorpe > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Arnd Bergmann > Cc: Andrew Morton > Cc: Christoph Hellwig &g

Re: [PATCH] arm64: kprobe: make page to RO mode when allocate it

2018-10-29 Thread Will Deacon
On Mon, Oct 29, 2018 at 01:11:24PM +0100, Arnd Bergmann wrote: > On 10/29/18, Will Deacon wrote: > > On Mon, Oct 15, 2018 at 01:16:00PM +0200, Anders Roxell wrote: > > >> -static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) > >> +void *alloc_insn_p

Re: [PATCH v2] arm64/module: use mod->klp_info section header information for livepatch modules

2018-10-29 Thread Will Deacon
Hi Jessica, On Fri, Oct 26, 2018 at 07:25:01PM +0200, Jessica Yu wrote: > The arm64 module loader keeps a pointer into info->sechdrs to keep track > of section header information for .plt section(s). A pointer to the > relevent section header (struct elf64_shdr) in info->sechdrs is stored > in

Re: [PATCH] arm64/numa: Add more vetting in numa_set_distance()

2018-10-29 Thread Will Deacon
On Mon, Oct 29, 2018 at 06:15:42PM +0530, Anshuman Khandual wrote: > On 10/29/2018 06:02 PM, John Garry wrote: > > On 29/10/2018 12:16, Will Deacon wrote: > >> On Mon, Oct 29, 2018 at 12:14:09PM +, John Garry wrote: > >>> On 29/10/2018 11:25, Will Deacon wrot

Re: [PATCH] arm64/numa: Add more vetting in numa_set_distance()

2018-10-29 Thread Will Deacon
On Mon, Oct 29, 2018 at 12:14:09PM +, John Garry wrote: > On 29/10/2018 11:25, Will Deacon wrote: > >On Fri, Oct 26, 2018 at 09:57:47PM +0800, John Garry wrote: > >>Currently it is acceptable to set the distance between 2 separate nodes to > >>LOCA

Re: [PATCH] arm64: kprobe: make page to RO mode when allocate it

2018-10-29 Thread Will Deacon
Hi Anders, On Mon, Oct 15, 2018 at 01:16:00PM +0200, Anders Roxell wrote: > Commit 1404d6f13e47 ("arm64: dump: Add checking for writable and exectuable > pages") > has successfully identified code that leaves a page with W+X > permissions. > > [3.245140] arm64/mm: Found insecure W+X mapping

Re: [PATCH] arm64/numa: Add more vetting in numa_set_distance()

2018-10-29 Thread Will Deacon
Hi John, On Fri, Oct 26, 2018 at 09:57:47PM +0800, John Garry wrote: > Currently it is acceptable to set the distance between 2 separate nodes to > LOCAL_DISTANCE. > > Reject this as it is invalid. > > This change avoids a crash reported in [1]. > > [1]

Re: [PATCH v2 2/3] arm64: lib: use C string functions with KASAN enabled.

2018-10-29 Thread Will Deacon
Hi Andrey, Andrew, On Mon, Oct 29, 2018 at 11:16:15AM +, Andrey Ryabinin wrote: > On 10/29/2018 01:29 PM, Will Deacon wrote: > > On Thu, Sep 20, 2018 at 04:56:30PM +0300, Andrey Ryabinin wrote: > >> ARM64 has asm implementation of memchr(), memcmp(), str[r]chr(), > >

Re: [PATCH V3] arm64: Don't flush tlb while clearing the accessed bit

2018-10-29 Thread Will Deacon
On Mon, Oct 29, 2018 at 02:55:58PM +0530, Ashish Mhetre wrote: > From: Alex Van Brunt > > Accessed bit is used to age a page and in generic implementation there is > flush_tlb while clearing the accessed bit. > Flushing a TLB is overhead on ARM64 as access flag faults don't get > translation

Re: [PATCH v2 1/3] linkage.h: Align weak symbols.

2018-10-29 Thread Will Deacon
; > Signed-off-by: Andrey Ryabinin > --- > include/linux/linkage.h | 1 + > 1 file changed, 1 insertion(+) Looks sensible to me: Acked-by: Will Deacon Will > diff --git a/include/linux/linkage.h b/include/linux/linkage.h > index d7618c41f74c..7c47b1a471d4 100644 > -

  1   2   3   4   5   6   7   8   9   10   >