From patchwork Fri Dec 2 02:18:42 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: 13062077 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 978E2C4332F for ; Fri, 2 Dec 2022 02:19:54 +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=NrQBh7WvcF3rJoVx+JyvjSLl153lS3aeLmTqf6QxFhE=; b=j1IQVVHKQ8R3AZ ZQVk5Qp6KSJCV0367Bovqa++liW2/d7h4kRyO7NJ3gvVGQBrBnNsi3h9rIut4IE2AmxWarB1lVLr9 /7p+FW03bP6UQqmDM4Q4q5eSztEQeerTR41wMma03sE5g35YcvfDZCV69S0ePG+jS1b0IX96AVu0k gEubbzlaU7eSl24Rsservn+PSSvybB32uH6kGDamSvxxtrcvYYJey4QJesxtb61NiICXQUdZJcV/Y k50g27C1eGpj1AhboVd42fCF7tpepjl3hmK34TJz1SIcY0GTm4WMb8UMV/fj3qWW5mk4HCYNGW5k2 PBZ8J/aro3Us1vIWVCRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0vdd-00CYKl-PX; Fri, 02 Dec 2022 02:18:53 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0vda-00CYIm-5J for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 02:18:51 +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 ams.source.kernel.org (Postfix) with ESMTPS id 8DAB2B82032; Fri, 2 Dec 2022 02:18:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B914C433D6; Fri, 2 Dec 2022 02:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669947527; bh=l+zSv5Pd3wyhqUmwoKQIAVoeZtKtlu6AJ8Bvwt0QiX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zii/5dPf7Jv4cEPjUQA2jGVbRF1TX6Q20gJvpJPtsZ7BYH8G7nNgi7RcAYXTs9O2W 42eQmwYyhdB9miTrO9IVQve1gUnMi9vyD7xZOdQPsOPcbVIrcJRoXnsesxyGPjnSFR VMmi1WME5mYK5YaxnFORjAEp5hsm/FQ5rBBNylZaRq8BKDeXTzJ+ozojWnzpVn9ry/ OrmAQHUXvtvwo6mhuvCtoOQEt4s2qJ5ge36PdYyhOIpCJF3fG04uO9Ejhnw+V4KsI+ 6mrCVeNVyRTWq9wGLL7j5Z6SfHrLB7Csjq+ZfUFRWrWoLxtO5MiHURjGNZjoP85lkY pSGk+ZKaIAG9A== 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 v2 2/3] arm64: kprobes: Let arch do_page_fault() fix up page fault in user handler Date: Fri, 2 Dec 2022 11:18:42 +0900 Message-Id: <166994752269.439920.4801339965959400456.stgit@devnote3> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <166994750386.439920.1754385804350980158.stgit@devnote3> References: <166994750386.439920.1754385804350980158.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_181850_380298_859E1999 X-CRM114-Status: GOOD ( 12.37 ) 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; }