Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp718499rwl; Wed, 12 Apr 2023 03:10:05 -0700 (PDT) X-Google-Smtp-Source: AKy350affJ7hhqE/xN4X33Mrawc5zS2uj1vhaTlakgBouVKtqmb3H7CJltHdG+meXbKrb9clquAL X-Received: by 2002:a05:6a20:63a6:b0:d4:c605:4512 with SMTP id m38-20020a056a2063a600b000d4c6054512mr14449680pzg.30.1681294205310; Wed, 12 Apr 2023 03:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681294205; cv=none; d=google.com; s=arc-20160816; b=V7RikXl0lHIX6wYxfWZ9fYdK1H9os5Eb6gd+8fGCBf6pBpLj11yMxDsEljBffHE9wa nBdSeslgMi69XTWtQYFIM/7FO2sor0WWS1I43BFUyV1eHrn/KKYm5j/PGUzm/HygBXk4 q000ZZYsTa+3CWBS+gQT3i3a5aoZ4YNSsMyc7ZL7YC2x1BIthYyfkdg27rZ5c8x626K+ 5txxrX9okEJVeje88LTzRE57YqBfjTYRCz65rhdxMDI+CK7Q9cX4IAODx7DluxRM1s0v 0LCwWLFGF4X3DqZNtdn7kxJWqVDaeeDrxar4ZLlG36UoaFvSgA3DMjRF8dSdSzDG+qnT brbg== 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=TdwJorOZyVNogP3yDxaSd0i5MoHf+SNgf0/3pLmx5ng=; b=hdUQ81vII2KyzEZPzWLJWLToUeyBMqIAI6NrmesSEJTKg0dN1GH7zniPVpij4OpEyt 0HJ2BjuzYjCjF7yec8oUVPheH/Nrv7XCsS35OmQHczP5agzSrsjdJKDO63amDcGdburg 5pTUpc/FOInTuh5nSkHsCGas3BM5hJEpNbaPAVMnbI2JzQbhIRR7kex9CuD25PoypTAZ /SZF5GtNWQ8tz/2ySNKQg/2+Gq+slJ8vq/iI+lddtEX2aGMEFOTkd8oz+A2T2dsdhynd eeb+GFthwns+zwfdzuyFJSWu6iYkdVTxMVSpeajqDSeN1DWxSpiZ+mQ+cxd2l/6Qg5yI SngQ== 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 m9-20020a654389000000b00519d69a2340si7890501pgp.862.2023.04.12.03.09.52; Wed, 12 Apr 2023 03:10:05 -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 S231281AbjDLKFZ (ORCPT + 99 others); Wed, 12 Apr 2023 06:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbjDLKFR (ORCPT ); Wed, 12 Apr 2023 06:05:17 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5D057D84 for ; Wed, 12 Apr 2023 03:05:08 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8CxhdhTgjZkqCwbAA--.42388S3; Wed, 12 Apr 2023 18:05:07 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxSL1SgjZke9wgAA--.34313S2; Wed, 12 Apr 2023 18:05:07 +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 v1 0/4] Add uprobes support for LoongArch Date: Wed, 12 Apr 2023 18:04:57 +0800 Message-Id: <1681293901-24918-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8DxSL1SgjZke9wgAA--.34313S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Jr45XF17XrWxAFWxCw4kWFg_yoW8JryrpF 9rurnxJF45G3s3Jr9xtas3ur1Fyr4xGrW2q3ZIy34rAr42vF15Jr18KrZrJF90k3y5KrW0 qF1rW3yYga4UJ3DanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b7xYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2AI xVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr41l4I8I3I 0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWU GVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI 0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0 rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r 4UYxBIdaVFxhVjvjDU0xZFpf9x07j1WlkUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 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.h 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 | 63 ++++++++++++++++ arch/loongarch/include/asm/kprobes.h | 2 +- arch/loongarch/include/asm/uprobes.h | 36 ++++++++++ arch/loongarch/kernel/Makefile | 1 + arch/loongarch/kernel/inst.c | 9 +++ arch/loongarch/kernel/kprobes.c | 67 ++--------------- arch/loongarch/kernel/traps.c | 9 ++- arch/loongarch/kernel/uprobes.c | 135 +++++++++++++++++++++++++++++++++++ 9 files changed, 259 insertions(+), 66 deletions(-) create mode 100644 arch/loongarch/include/asm/uprobes.h create mode 100644 arch/loongarch/kernel/uprobes.c -- 2.1.0