Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3503313pxa; Wed, 26 Aug 2020 02:04:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT73b4Q1NOGUtp7C3Qp8uvDeyuwZAljLtEquC7ht+VqjlAXGrAWUFcK/GYS3eFvAiXAtLg X-Received: by 2002:a17:906:2a49:: with SMTP id k9mr15037806eje.117.1598432640557; Wed, 26 Aug 2020 02:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598432640; cv=none; d=google.com; s=arc-20160816; b=eDAHOzK8lYEY6QCO1R1m4TUdt6lUVripda8hMjEuEDE5AXm/2jMfRwy5dkLZHO4DZi M2BTzpY+MHt271af4LiTYQbbkreHzQCMWvxZiWtnUK8kX4Z1dadXFbfaqLJWNAl7yqg1 WgM/4d2TK/vkXpgkFDCuxE3ymJ3fimqh6iEI7xRFRqJhVgH2OxZjyCujDxkppbpOVoA5 FBxppP4iW2qOVOYOGHUW8+j9ycJ8iF6jovz07tJtDjKwPRTv7vX32Q/PKScqAJBYLTMn MtAsPLDvKXk3z0ucArkm2rGcjVvlxlpDwx5NYwrfSDbc0I4QK6TGJKPIHRKAZ/Guu/Ft 2hzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LWB8kupl2aQ0xANaNIkiPTanQ2SqGuz+Vpym63rGg1A=; b=ljE+fwh0TFqfO84HTc36Y430LPbonQamSrxZbciEJ9MvC3H46YyGXXgsOrauR7lgjm 0OF822uMgjStKGf7h1xfojSynUcMCXzZAWS+nCwheCwq8c7dT3odrsTGfQfupSb7uLip p84Mc3Jy3t4t0Cto7wPQNK02+YuKkS4KGw3zulpkXDqlT8WCojIjsRC/+YgCx8KeqAcx BjkRXwYt8yVNku3yEOAvHrGOjncYmpD40ifCf/fTAPZe3DZpcmcQzwZcYlwx7u8/Zkxw OpuhQxl8tQumJoMl4apZxQQMFthHcSkq3tuBVmi4+x3bH63oo1VSBUBJqwRN2oj874ML 8PIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=ocHhET+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si1110630ejd.365.2020.08.26.02.03.37; Wed, 26 Aug 2020 02:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=ocHhET+O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbgHZJBJ (ORCPT + 99 others); Wed, 26 Aug 2020 05:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbgHZJBI (ORCPT ); Wed, 26 Aug 2020 05:01:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4579AC061574 for ; Wed, 26 Aug 2020 02:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LWB8kupl2aQ0xANaNIkiPTanQ2SqGuz+Vpym63rGg1A=; b=ocHhET+OTpJXn3pM9znuAp/GOA YieMAdUpg28WEz+Ejj2hnPBJoLZ+a7uZZHyCnC25hQuBkq9VE8T3rHadPCUsZVTPhsJ5ToCXasFa2 AVtGuNUZN3AM4bOJq8VTikLN0LSxL/99P60FW/B6pyCW4Gnflc0MAxdXEba7UYX96pjv7jsemAiAN xMQUmJbwEHTv4lj5wU7gcjQXcEQutbi1kY361MYbCTAxm82U9a/Nj0q3tDI+NrR/NCmzUxFGzdS9X zqMlFd6TY/wuiNOOntoGdcr5gjvtwnqjcOI/dGsxOIfYMx6VdYh2xhpQT4+SsWqX71/ryHaZEaoxE EPIeL3FA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kArIl-0002rX-Mk; Wed, 26 Aug 2020 09:01:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8F28C303A02; Wed, 26 Aug 2020 11:01:02 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8016D2B79CD3F; Wed, 26 Aug 2020 11:01:02 +0200 (CEST) Date: Wed, 26 Aug 2020 11:01:02 +0200 From: peterz@infradead.org To: "Eddy_Wu@trendmicro.com" Cc: Masami Hiramatsu , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: x86/kprobes: kretprobe fails to triggered if kprobe at function entry is not optimized (trigger by int3 breakpoint) Message-ID: <20200826090102.GC1362448@hirez.programming.kicks-ass.net> References: <8816bdbbc55c4d2397e0b02aad2825d3@trendmicro.com> <20200825005426.f592075d13be740cb3c9aa77@kernel.org> <7396e7b2079644a6aafd9670a111232b@trendmicro.com> <20200825151538.f856d701a34f4e0561a64932@kernel.org> <20200825120911.GX1362448@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2020 at 07:07:09AM +0000, Eddy_Wu@trendmicro.com wrote: > llist operations require atomic cmpxchg, for some arch doesn't have > CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, in_nmi() check might still needed. > (HAVE_KRETPROBES && !CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG): arc, arm, > csky, mips > Look at the MIPS NMI handler, it's brilliant ;-) Anyway, I think that CONFIG could use a little help, the point was to opt-in to some code, and it was supposed to leave out known broken architectures. If your architecture has NMIs (not all of them do) or SMP, and doesn't have sane atomic ops (CAS or LL/SC), then it's broken crap and I don't care about it, full stop. Those architectures are known broken and limp along on pure luck, that CONFIG flag lets them disable some code that makes them crash faster. The same with non-coherent SMP, some archs tried to limp along, nobody cared about them, and I think we've since deleted them. I long for the day we get to delete the last of these broken atomic archs. Known broken archs include: Sparc32-SMP, PARISC, ARC-v1-SMP. There might be a few more, but I've forgotten.