Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3863280rdb; Mon, 11 Dec 2023 02:06:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+AZ7b5p+hXGCDYKoLTgJJ8KKkXzJbwTG74q2Us4x1TQ0ysmraP1R7UfXU+QxsjlqfWKlZ X-Received: by 2002:a05:6358:419d:b0:16e:12e:e232 with SMTP id w29-20020a056358419d00b0016e012ee232mr1947117rwc.6.1702289164206; Mon, 11 Dec 2023 02:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702289164; cv=none; d=google.com; s=arc-20160816; b=FPWneSmX3AO3WQBacgn8vfs+AwawT45vx4APsmz3A+FBJvTGjbBhvzmskb3es2cTMf qJsHEjeVojg7f+AceJaZ9YMSJ1gd0L8ztksYutaalaDzyMEWiEAV0TKj0eIUat/ZtyJ5 bsPZ02PaJp6BYpMfmSSBVp2HB+m87C6+yUfMITgZOpWNbSQsKJxx6MIp1POr2yg/1oEt Xk67DUq8B7TvPpo/lXtdTX2eMBWHqHl/v6gUwtS70hEN/QcLIwQdfbBg9Au5seOTety4 eHTpSpKM/zGdEXKFKY56Gh2xoxwTxu6LaNelvP5FbYgi8WEdhkV1tZ1wCip9JBhrhbVR 4vzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=rlfqbyyd+AtkXsEpEv1WncfhVdk1Vp9VajzWq/dwkls=; fh=iZS5NMQVjP5nKAWO/Owllm4EelelpJ2mHLOE1ITpKKU=; b=jqbhp0G5s3y8XokWC53G8Q9w6BLrDjiUN+etX19La9yx2ijvoTMbI8yLmlm11paKnv bgLOjO/H3oyEStnzoBDHnIm0zZaa4Ri/aqeDy9yF2I+nD5EwkGNm0BgPzYl5Ab1GxkyU 59U92HB2UalokKRL3toDZVs8o/rvvtUeD4rkV1zGLwYW7iMFTAD+TgHIMbMXII8RfznJ 0Ce6QGBjtjmxa08ycpXU5sWYSAjhC24bTfC/e85yMQayQbQN9IktCQ9oF1wgOLgLdBc3 QM+23/FmFNKusuCR0YmtCDhpPnqD4G/yCwF36HzE2CfY83Gd4703w45fn6K9Bn0lsWdZ 2HkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ACbBRqCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ca20-20020a056a00419400b006ce7ff29435si5893809pfb.174.2023.12.11.02.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 02:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ACbBRqCH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D8B37807528D; Mon, 11 Dec 2023 02:06:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234675AbjLKKFj (ORCPT + 99 others); Mon, 11 Dec 2023 05:05:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234469AbjLKKFh (ORCPT ); Mon, 11 Dec 2023 05:05:37 -0500 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55AFC107 for ; Mon, 11 Dec 2023 02:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1702289137; bh=rlfqbyyd+AtkXsEpEv1WncfhVdk1Vp9VajzWq/dwkls=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ACbBRqCHBrv36OFbZ0Rd6BYgudHg0So7dfIkRI+ALi69BnOELtAhdoiOVsG0fBI22 uNZPrm0xDtQ1g7ImuCCHtLZ6DqUqzp1r/nBx0XHJPUom0BHo5EI6qpYKvuFylgaYP3 e49sJ8Kv3jUs6ZpqOAR2Vey5GOTun+AwdHzBhR0voeQN5xfTvTzu6X5nRDTYV3wit4 4xyOCC45hLG9bAVIteG5T7J9El3W11TYm01YgfqKhIGUMzBl6sPUR5+qvXZi0BA8cQ MrX4nGOg/2CXUVZwOeHdk4Ms82Pd00wVbDyM20JmVnKNxsXjaviTUJ1xMt0Y5CzjwW tGVcnbeVDM5TA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4SpcnY1yL4z4wdD; Mon, 11 Dec 2023 21:05:36 +1100 (AEDT) From: Michael Ellerman To: Luming Yu , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: luming.yu@gmail.com, ke.zhao@shingroup.cn, dawei.li@shingroup.cn, shenghui.qu@shingroup.cn, Luming Yu Subject: Re: [PATCH 1/1] powerpc/debug: implement HAVE_USER_RETURN_NOTIFIER In-Reply-To: <475A60AEEAA99F6C+20231211025054.885-1-luming.yu@shingroup.cn> References: <475A60AEEAA99F6C+20231211025054.885-1-luming.yu@shingroup.cn> Date: Mon, 11 Dec 2023 21:05:32 +1100 Message-ID: <87plzddpg3.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 02:06:02 -0800 (PST) Luming Yu writes: > The support for user return notifier infrastructure > is hooked into powerpc architecture. > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/entry-common.h | 16 ++++++++++++++++ > arch/powerpc/include/asm/thread_info.h | 2 ++ > arch/powerpc/kernel/process.c | 2 ++ > 4 files changed, 21 insertions(+) > create mode 100644 arch/powerpc/include/asm/entry-common.h > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index c10229c0243c..b968068cc04a 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -277,6 +277,7 @@ config PPC > select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) > select HAVE_STATIC_CALL if PPC32 > select HAVE_SYSCALL_TRACEPOINTS > + select HAVE_USER_RETURN_NOTIFIER > select HAVE_VIRT_CPU_ACCOUNTING > select HAVE_VIRT_CPU_ACCOUNTING_GEN > select HOTPLUG_SMT if HOTPLUG_CPU > diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h > new file mode 100644 > index 000000000000..51f1eb767696 > --- /dev/null > +++ b/arch/powerpc/include/asm/entry-common.h > @@ -0,0 +1,16 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef ARCH_POWERPC_ENTRY_COMMON_H > +#define ARCH_POWERPC_ENTRY_COMMON_H > + > +#include > + > +static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs, > + unsigned long ti_work) > +{ > + if (ti_work & _TIF_USER_RETURN_NOTIFY) > + fire_user_return_notifiers(); > +} > + > +#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare AFAICS this is never called because we don't use CONFIG_GENERIC_ENTRY ? cheers