From patchwork Thu Dec 1 14:39:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 13061391 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41254C43217 for ; Thu, 1 Dec 2022 14:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zMiodUa0XQG9E1FqCYxu1VMHe3f8KrRAZ5m95152x3o=; b=eO7qVFxWH0VrVa O8dDbfUJjIWC7+4B6dsKc8VPWVkBXtqUuwdBxfdSq4vwOqvjOmtr8uxhzolArc4+lpExk7nrH43wd 8xGC5dhHoRrIXUbiwnjfGb/djesRIL0qyl8ZNSMHZqAPJpV1CZI+itR71YMdaI10IplkxCoLa0yTT QurU+nyAMd6j/m1AMbDEsqDE/0wlArNjhdjeN/M9ksianUuV04xl8wQMPTghEoVb1Zhvi0FBEg9sw 2H0ztDTMyPgTMpwsPrwYLyb00DwcuMGxYU6GuKjLGTICV/kI7QFXLEDaCu1UG1NGk+uZ1niKs5KGb Os2YDRJIFBRCQs3/x1xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0kif-007yBR-Ma; Thu, 01 Dec 2022 14:39:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0kia-007y95-F3 for linux-arm-kernel@lists.infradead.org; Thu, 01 Dec 2022 14:39:18 +0000 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 15FDC62029; Thu, 1 Dec 2022 14:39:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2B80C433C1; Thu, 1 Dec 2022 14:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669905555; bh=0xKyH1g6a3IOZfst9FQ+WJoEUTNNFziSOx8E0KHTQaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oXecHXb04f/aEoCGGcNU1Jpa4NgqXjuULFzxWvcxe4DBU9YoPJ8PSDZhRIj/cEDL0 MKizi7jV7LHaQCIkNsekjbzQI4r2USzz/0zsChFeQjxBuOpmDFbZNLWpwMd1PO2h9N 09FqRkRqskUJD4YU4E5mjoNjItOSZh/kgj4BthWyrZuDJBd+5ChMOacc4y4K+S3kOM j5O7W1e7CPYZzHql7Fr3bfYIp3kTpwM779VVBUD+W8KXvUo4QJWrjpA2s8PypDd3MH ZGtCD91GQyNFRzZiW162WQH3NsqDbv3plhmdDcx9Jvxk3bDr9OV9IvwCgFvExIOuuG T/+LSDsl+4SIA== From: "Masami Hiramatsu (Google)" To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Mark Brown , Kalesh Singh , Masami Hiramatsu , Marc Zyngier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sandeepa Prabhu Subject: [PATCH 2/3] arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler Date: Thu, 1 Dec 2022 23:39:11 +0900 Message-Id: <166990555186.253128.6694458405311467597.stgit@devnote3> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <166990553243.253128.13594802750635478633.stgit@devnote3> References: <166990553243.253128.13594802750635478633.stgit@devnote3> User-Agent: StGit/0.19 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_063916_564630_E765B18B X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Masami Hiramatsu (Google) Since arm64's do_page_fault() can handle the page fault correctly than kprobe_fault_handler() according to the context, let it handle the page fault instead of simply call fixup_exception() in the kprobe_fault_handler(). Signed-off-by: Masami Hiramatsu (Google) Acked-by: Mark Rutland --- arch/arm64/kernel/probes/kprobes.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index c9e4d0720285..d2ae37f89774 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -294,14 +294,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) } break; - case KPROBE_HIT_ACTIVE: - case KPROBE_HIT_SSDONE: - /* - * In case the user-specified fault handler returned - * zero, try to fix up. - */ - if (fixup_exception(regs)) - return 1; } return 0; }