From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754125AbcGTQ2n (ORCPT ); Wed, 20 Jul 2016 12:28:43 -0400 Received: from foss.arm.com ([217.140.101.70]:43408 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbcGTQ2g (ORCPT ); Wed, 20 Jul 2016 12:28:36 -0400 Date: Wed, 20 Jul 2016 17:28:28 +0100 From: Catalin Marinas To: Marc Zyngier Cc: David Long , Huang Shijie , James Morse , Pratyush Anand , Sandeepa Prabhu , Will Deacon , William Cohen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Steve Capper , Masami Hiramatsu , Li Bin , Jisheng Zhang , Mark Rutland , Daniel Thompson , Vladimir Murzin , Petr Mladek , Ard Biesheuvel , Jens Wiklander , Robin Murphy , Mark Brown , Suzuki K Poulose , Dave P Martin , Andrey Ryabinin , yalin wang , Yang Shi , Zi Shen Lim , John Blackwood , Andrew Morton , Alex =?iso-8859-1?Q?Benn=E9e?= , Adam Buchbinder , Christoffer Dall Subject: Re: [PATCH v15 04/10] arm64: Kprobes with single stepping support Message-ID: <20160720162827.GF25890@e104818-lin.cambridge.arm.com> References: <1467995754-32508-1-git-send-email-dave.long@linaro.org> <1467995754-32508-5-git-send-email-dave.long@linaro.org> <578FA238.3050206@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <578FA238.3050206@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2016 at 05:09:28PM +0100, Marc Zyngier wrote: > +static inline unsigned long min_stack_size(unsigned long addr) > +{ > + unsigned long size; > + struct kprobe_ctlblk *ctl; > + > + if (on_irq_stack(addr, raw_smp_processor_id())) > + size = IRQ_STACK_PTR(raw_smp_processor_id()) - addr; > + else > + size = (unsigned long)current_thread_info() + THREAD_START_SP - addr; > + > + return min(size, sizeof(ctl->jprobes_stack)); > +} We could drop the local ctl pointer: return min(size, sizeof(((struct kprobe_ctlblk *)0)->jprobes_stack)); If you add a log, I'll push the patch on top of the kprobes branch. Thanks. -- Catalin