From patchwork Sun Apr 23 01:38:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 13221150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3142C77B76 for ; Sun, 23 Apr 2023 01:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjDWBiL (ORCPT ); Sat, 22 Apr 2023 21:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjDWBiL (ORCPT ); Sat, 22 Apr 2023 21:38:11 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B665A10FD; Sat, 22 Apr 2023 18:38:08 -0700 (PDT) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8BxYU_8i0RkotEgAA--.51512S3; Sun, 23 Apr 2023 09:38:05 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxsrT8i0RkiPk1AA--.7506S2; Sun, 23 Apr 2023 09:38:04 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: [PATCH] MIPS: uprobes: Restore thread.trap_nr Date: Sun, 23 Apr 2023 09:38:03 +0800 Message-Id: <1682213883-3654-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8DxsrT8i0RkiPk1AA--.7506S2 X-CM-SenderInfo: p1dqw3xl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evJa73UjIFyTuYvjxUwmhFDUUUU Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org thread.trap_nr is saved in arch_uprobe_pre_xol(), it should be restored in arch_uprobe_{post,abort}_xol() accordingly, actually it was only done in the post function, just do it in the abort function too, this change is similar with x86 and powerpc. Signed-off-by: Tiezhu Yang --- arch/mips/kernel/uprobes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c index 6b630ed..401b148 100644 --- a/arch/mips/kernel/uprobes.c +++ b/arch/mips/kernel/uprobes.c @@ -191,6 +191,7 @@ void arch_uprobe_abort_xol(struct arch_uprobe *aup, { struct uprobe_task *utask = current->utask; + current->thread.trap_nr = utask->autask.saved_trap_nr; instruction_pointer_set(regs, utask->vaddr); }