Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp274427rwe; Fri, 14 Apr 2023 02:33:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Y68n2IYdlNCiDkawvhJF48wK2mqTFwL6P0ym+EHEhsJFSXuTjlHoKBjafMJNguoY9ch7za X-Received: by 2002:a05:6a20:4c24:b0:da:318a:981f with SMTP id fm36-20020a056a204c2400b000da318a981fmr4490825pzb.42.1681464835009; Fri, 14 Apr 2023 02:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681464834; cv=none; d=google.com; s=arc-20160816; b=RxNk/m8ZwvYeON0SSNmfs2SLxn2kCMMuUcpez4Zv48JUv475ev3VHxOWY82YU+dZ98 Oia+1v+lHj5cat3vErqjxKwHuIrUKExzzHDG1yz3eaIJoILo/we+5CVTpzTfa6I9MprS grp5N03ZBhuCJtRCggcRu1P87XFvUwf2hEHXDWXP670PJi8lLP3rnAzhVgx9b0qk/qbA WRTF4RYpLSfc1OwtkGMQQEBD4IjuEF4BH7FaVxPDysf6aor9o5kszGJowppZv2as8sEf H/rpXIHDtJJwIxHriNVfwgQzncLTbRHg59igORmz8rrEroi/3qPzlGvs13dC7ilDmX2a Y8sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=9n8iWmQoLo1pP9qD5jtqgBQlgFnXcmIT9eYLs40mi4I=; b=0MJHABUc8lEBj2YYXH2K8u+DUQDyPhACrxnHaCAw8EXu+qdRIUwFYFHZxVsutNiJ0a p+eDilyK5iH7SdmMPzDr0/GLlzMhJ25yQJzGeG53RAEIc15Ed39cuDktyvG1BNzr9wL6 5IkAFFIs34dv7Y9wLmnDgvPyn6dTl2RVNxGYfEn5PO/NpM267Uz++B4XDjjnAaYuXNz1 OsGSzN6PH0WdfuMh8yOb0mmt/+d1yWXNlh2BnE52/9NFdL8qESKvwXWQK/7gkTK0N1pk qhovnrm0tF+yYV/fmIggtonutd6SbbA8miC1XIzS+21toUmUD09Zpx9kUh5MY6EJvG2J 43GA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z34-20020a631922000000b005132342a587si4196430pgl.610.2023.04.14.02.33.44; Fri, 14 Apr 2023 02:33:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbjDNJdL (ORCPT + 99 others); Fri, 14 Apr 2023 05:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjDNJdK (ORCPT ); Fri, 14 Apr 2023 05:33:10 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9526D5244 for ; Fri, 14 Apr 2023 02:33:08 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Axkk7THTlkkGIcAA--.43782S3; Fri, 14 Apr 2023 17:33:07 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dxjb7SHTlkpYkkAA--.885S2; Fri, 14 Apr 2023 17:33:06 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , WANG Xuerui Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH v2 0/4] Add uprobes support for LoongArch Date: Fri, 14 Apr 2023 17:32:57 +0800 Message-Id: <1681464781-4428-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8Dxjb7SHTlkpYkkAA--.885S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tF4kWFyxXr15ZFy3Zw1DJrb_yoW8GF1fpF nrursxGr4rG3s3Jr9xtas3ur1rtr4xGrZFqFnxt3yrAr4Iqr15Jr18KrZ8JF90y3y5KrW0 qF1rG3yYga1UA37anT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2 IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r1j6r4U McvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr 0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8r9N3UUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 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 (4): 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 arch/loongarch/Kconfig | 3 + arch/loongarch/include/asm/inst.h | 16 ++++ arch/loongarch/include/asm/kprobes.h | 2 +- arch/loongarch/include/asm/uprobes.h | 36 +++++++++ arch/loongarch/kernel/Makefile | 1 + arch/loongarch/kernel/inst.c | 48 ++++++++++++ arch/loongarch/kernel/kprobes.c | 75 ++++-------------- arch/loongarch/kernel/traps.c | 9 +-- arch/loongarch/kernel/uprobes.c | 142 +++++++++++++++++++++++++++++++++++ 9 files changed, 265 insertions(+), 67 deletions(-) create mode 100644 arch/loongarch/include/asm/uprobes.h create mode 100644 arch/loongarch/kernel/uprobes.c -- 2.1.0