Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp444832rwd; Wed, 7 Jun 2023 02:03:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uX0tez5ldZQ2vYel3aP5xrBjqAgLpXN1Wd2MFOy4BE1J9tIVlBpHZrNOPCoUjHXNorTKO X-Received: by 2002:a05:6358:c608:b0:129:cd33:9d5f with SMTP id fd8-20020a056358c60800b00129cd339d5fmr2642134rwb.28.1686128620344; Wed, 07 Jun 2023 02:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686128620; cv=none; d=google.com; s=arc-20160816; b=jf+voEEdAyia5QdTEz4f2yt9mK+89diEaVO+3IM/QlIPjt7kJ0Lfen2TYLyXYeJuVv pLR3chvgMYgoF2G735MjBgXbBAh2Q4oCdw0zHGkJqT85Yi23xV017JeQ7/SWpAUnefv9 B/U3KDEj/LBYWOi9+iuyYeAJ/yVry0NUtVFzSFR3/T4Cc8EYrvhp1sQFaj36aWjDk9n2 hiIkdOhPAUiidnlj6GPWGj1bNxUSCY7p21RHhEUiXJlHb2pX+/9od5Erc5pCEWoRkjhE NiAjQOniQJbKSIrlmV6avyUwx9t3hbniXd140E46jQCf9+PUiJ+b9hVJ3FC/Pr0DlHqI 5FCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AYg1+ENLpUeU9CF42Lrth2700BUL+zQx+0AS37J1Eig=; b=zTvkaafd/qNaMnG1gvpbqp7xhjjp4ffaPthUI4iSZPfix8AwQjfKzVBWSjqz7PXgr7 9yVW4ZrvYvjlqyJitfxuQnUUR5+FKZmf/mA8yhkm0wukSRcLjD13npxfZPP2IWfkj9WI EQHMEFDHSlXxxHTh2i6CafxUr/9p2ID2nfJ3vnyScfmXBRoUkO5pr3taw52Iamb4KVGb pMzAMR4TwVYxmqBqJVIsslNR5pxaXaBj+DNz2P8R2qhAz5zITtN9yDp7XbBwCbiDJ6kt n3abHrP07e4+jzXJvqp9i5MnL/nxnb6j/TGKXl8xhSMg8P5P+aRv3AVDdGDAznvZI4rR ZM4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SH9hTd6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i25-20020a633c59000000b0053fb5df5561si3403158pgn.246.2023.06.07.02.03.27; Wed, 07 Jun 2023 02:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SH9hTd6M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239435AbjFGIzm (ORCPT + 99 others); Wed, 7 Jun 2023 04:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238922AbjFGIyX (ORCPT ); Wed, 7 Jun 2023 04:54:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E47091BC8 for ; Wed, 7 Jun 2023 01:53:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD53663C81 for ; Wed, 7 Jun 2023 08:52:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A8CAC4339B for ; Wed, 7 Jun 2023 08:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686127938; bh=y+Vn9zbMc2hWJvwt6pYFCnKNfmsXKCru69Eowq/2vyg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SH9hTd6Mbau3Gm7dVYVLFLwMQiv/GoLE0ZAvKr9Q/TvDt6zQC8nbigfjSenZSQFXX pWT0daQA/KSxbK7p0Nq8AtbI+VQYDferv3PVPniF+FnD+W0x9oWis4SgJ2R/M6e8SP nMk/DpWZBhi75Fbn0kFMXKa9rsfc2camhx33ENqKIv8Pv7iTNLlmONR88jS0Er6qAY SKL8cgln01o+B3TeT/xIzVkD23FyAadQd4Kl8lHR6N2ssynhHnFxEIyibjWaenT9cL KtA4/zNLsHjbpVAT2CbhD3dcH+4TB79FvRAljxpbVdAUhz/IC7GXokg+Bd0yCLCrW2 pL7M9ejtSl2pA== Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-9786c67ec32so295015666b.1 for ; Wed, 07 Jun 2023 01:52:18 -0700 (PDT) X-Gm-Message-State: AC+VfDzNpUTs3DUa6lUvJApf/7bKdh4+yCdvv+9jY9rFpzSymZuunvgY XoEH5QscoMIO8Z7WIwc56B8UgDzBdGefRk/gL6g= X-Received: by 2002:a17:907:6e22:b0:953:37eb:7727 with SMTP id sd34-20020a1709076e2200b0095337eb7727mr5584515ejc.43.1686127936329; Wed, 07 Jun 2023 01:52:16 -0700 (PDT) MIME-Version: 1.0 References: <1685947150-4949-1-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: <1685947150-4949-1-git-send-email-yangtiezhu@loongson.cn> From: Huacai Chen Date: Wed, 7 Jun 2023 16:52:05 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 0/6] Add uprobes support for LoongArch To: Tiezhu Yang , Jeff Xie Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jeff, I queued this series at https://github.com/chenhuacai/linux/commits/loongarch-next, could you please test it when you have time? Thanks. Huacai On Mon, Jun 5, 2023 at 2:39=E2=80=AFPM Tiezhu Yang = wrote: > > v5: > -- Rebased on 6.4rc5 > -- Like arm64, add user_enable_single_step() in arch_uprobe_pre_xol(), > add user_disable_single_step() in arch_uprobe_{post,abort}_xol(), > suggested by Jeff and Huacai offline > > v4: > -- Rebased on 6.4rc1 > -- Fix problem about "perf probe -x /lib64/libc.so.6 malloc" > > v3: > -- Check atomic instructions in insns_not_supported() > -- Remove five DIE_* definitions in kdebug.h > > v2: > -- Move the functions to inst.c in patch #1 > -- Pass around union for insns_not_supported(), > insns_need_simulation() and arch_simulate_insn() > > v1: > -- Split the RFC patch #2 into two patches > -- Use larch_insn_gen_break() to generate break insns > for kprobes and uprobes > -- Pass around instruction word instead of union for > insns_not_supported(), insns_need_simulation() and > arch_simulate_insn() to avoid type conversion for callers > -- Add a simple test case for uprobes in the commit message > > Tiezhu Yang (6): > LoongArch: Move three functions from kprobes.c to inst.c > LoongArch: Add larch_insn_gen_break() to generate break insns > LoongArch: Use larch_insn_gen_break() for kprobes > LoongArch: Add uprobes support > LoongArch: Check atomic instructions in insns_not_supported() > LoongArch: Remove five DIE_* definitions in kdebug.h > > arch/loongarch/Kconfig | 3 + > arch/loongarch/include/asm/inst.h | 42 ++++++++++ > arch/loongarch/include/asm/kdebug.h | 5 -- > arch/loongarch/include/asm/kprobes.h | 2 +- > arch/loongarch/include/asm/uprobes.h | 35 ++++++++ > arch/loongarch/kernel/Makefile | 1 + > arch/loongarch/kernel/inst.c | 54 +++++++++++++ > arch/loongarch/kernel/kprobes.c | 75 ++++------------- > arch/loongarch/kernel/traps.c | 9 +-- > arch/loongarch/kernel/uprobes.c | 152 +++++++++++++++++++++++++++++= ++++++ > 10 files changed, 306 insertions(+), 72 deletions(-) > create mode 100644 arch/loongarch/include/asm/uprobes.h > create mode 100644 arch/loongarch/kernel/uprobes.c > > -- > 2.1.0 >