Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3631590rwb; Fri, 16 Dec 2022 19:01:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tqEpsRaUJ5aBp7AB5v6iD9zOCvHHe3yJ8uNJ5QhzXNRL8o0E1irYQhCwWlvlJO2bRdcsx X-Received: by 2002:a17:906:355a:b0:7c1:524d:2bec with SMTP id s26-20020a170906355a00b007c1524d2becmr22559962eja.39.1671246063968; Fri, 16 Dec 2022 19:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671246063; cv=none; d=google.com; s=arc-20160816; b=le88YwaXss908ko1hIIACCL1PQOm0P5Jfbw6yR+xh1eUzRA5DU/O3taRgRUSc5G9ke R7Mt4/NfOxyTv3Xw0mXGyML3qSsK7d9W+7rHcp7i5+jAPjeAm3TX+Z81kPQcdHrlZIIe jtQf+mNPQHYl2J4odcrRWkF/7MoK2/AN+Q6og8KcV74QxH0ovIybqKacVVcSKEQepv9X S0pQgTbFemZdI3SHSRbFMbtFbzq53FdvsBTRFHi63twpA685zP0DzrTK/GFB6m9Sgb40 Mm7nVatsq7IOopVSnGxbWaxqraoZSyDpyyzWzTOmcQXEBu18lBqZIxHmxAQb6iuUWAP0 Mexg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Um6bATq02T9zW5VuXG0AiDIBcoI8XNRQAk182EO1iww=; b=AF26O7a0XjTMLNGj2lwHd35Zkfe6TjbjaTBYldl79iv7auMJPjX9fTEVHHYki2NLTy LktZMH6ktWget1thd5kr8z59xfHKxSrTcHY01VLjml2LX5PLOw+FnWJbXJmm6m5/BS3E tkaYIxZjEuNR308Gv9WAMmqFGXCHoC9nJa9BsuZjPD6bd7kpPthrTKNBKzDG8VcVQ1eu ki4UBhVbGkymSh/FO8H4nAdYpo4Od0/Af1IpuEmTDtsaDXf4lofyoJVXIGoUyDk95cQJ 7V0jEKg7BwnhYDVu8nQX18sOvIIc1awhedRITgtrnJoPKsHI/7+MvC13Dr3gpVN+noZN vawg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a2pVefvn; 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 b13-20020a056402350d00b004617facf124si4673165edd.253.2022.12.16.19.00.43; Fri, 16 Dec 2022 19:01:03 -0800 (PST) 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=a2pVefvn; 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 S229995AbiLQCJO (ORCPT + 68 others); Fri, 16 Dec 2022 21:09:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiLQCJK (ORCPT ); Fri, 16 Dec 2022 21:09:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FF3627CE7 for ; Fri, 16 Dec 2022 18:09:09 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 3199EB81E78 for ; Sat, 17 Dec 2022 02:09:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE8ADC433F0 for ; Sat, 17 Dec 2022 02:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671242946; bh=2c/K1FLzSlsGs90CqSv0s2cU3Pb0DF8Hg/Ru7aZ4sws=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a2pVefvnYxx0QNpWstRNpARXRHN6NMoz6pP5QSaqjTxijI5eFakPGLWTPrTtga0qg 04e2MCbO7mE85N/NOiZbmTwrS9jXI+VehwJ6236EzMf5PbTBhBZsOI4AXAAfRY1UUZ 44X3I2PPvbWhIjE4rv4lcTutNLCiU/KGHf3EvjWkS9zL7UGjYFoTfbGxrTHTL19Rbm 9K6xxn33Pnx8YoX8GOjd5bGQ8+mu7Qsn3I5yLoxEjdwBNZXYYMv69e+zmLJgReDj9C Nax4HPIfO8skdMihZ1xz2NLCkpJPwbOjgrk/3QAljv/w130WQ1PgReuL8XYCAvIWnv eStkkzwztimLg== Received: by mail-ej1-f50.google.com with SMTP id t17so10174884eju.1 for ; Fri, 16 Dec 2022 18:09:06 -0800 (PST) X-Gm-Message-State: ANoB5pm5GiuelcrweCMRxfniPVuqq2L415eNi9zk6ddqp75NSymVRKG1 HjpsBabbzeqTNjQ6U4l29utVkx3ycJWGWIZ6gUI= X-Received: by 2002:a17:907:37a:b0:7c0:e4b6:132e with SMTP id rs26-20020a170907037a00b007c0e4b6132emr19078943ejb.224.1671242945036; Fri, 16 Dec 2022 18:09:05 -0800 (PST) MIME-Version: 1.0 References: <1670575981-14389-1-git-send-email-yangtiezhu@loongson.cn> <1670575981-14389-3-git-send-email-yangtiezhu@loongson.cn> <20221214162847.1f9481fd2cf5212657a0fd58@kernel.org> <0a135b50-ca96-8ee1-6f33-29efcdb256ed@loongson.cn> In-Reply-To: <0a135b50-ca96-8ee1-6f33-29efcdb256ed@loongson.cn> From: Huacai Chen Date: Sat, 17 Dec 2022 10:08:57 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10 2/4] LoongArch: Add kprobe support To: Tiezhu Yang Cc: "Masami Hiramatsu (Google)" , WANG Xuerui , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, all, This series seems have too many problems, so I will drop it. So Tiezhu please export the latest patches from https://github.com/loongson/linux/commits/loongarch-next, and do modifications on top of them. Huacai On Fri, Dec 16, 2022 at 5:33 PM Tiezhu Yang wrote: > > > > On 12/14/2022 03:28 PM, Masami Hiramatsu (Google) wrote: > > Hi, > > > > On Fri, 9 Dec 2022 16:52:59 +0800 > > Tiezhu Yang wrote: > > > >> Kprobes allows you to trap at almost any kernel address and > >> execute a callback function, this commit adds kprobe support > >> for LoongArch. > > ... > > >> + case KPROBE_HIT_ACTIVE: > >> + case KPROBE_HIT_SSDONE: > > > > Recently, I removed these cases because this page fault will be finally > > handled by the generic pagefault handler. > > > > Hi Masami, > > I have addressed all your comments on my local machine, the code logic > looks much more clear now, thank you very much. > > When I test kprobe_example.ko with a C function like "kernel_clone", > it works well, but the kernel hangs [1] when test with an assembler > function like "__memset_fast" [2]. > > Just did some quick research and it seems the bug is related with > kallsyms_lookup_name(), I'm looking for a solution. > > [1] > https://lore.kernel.org/loongarch/CAEr6+EC2wPAtK8zb3=e1mUiya3gv0UhqF9J_ySYx9p_96pB+tg@mail.gmail.com/ > [2] > https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/tree/arch/loongarch/lib/memset.S?h=loongarch-next#n56 > > Thanks, > Tiezhu > >