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: 28412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp303268wrr; Thu, 1 Dec 2022 06:51:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CVkPXW3N6wztPSOWsZS765fmxz1ixgkBwwmVbO16zYogV3TE7GSoEWyBUxIsfUFi1p1xF X-Received: by 2002:a05:6402:691:b0:46b:c11:9f59 with SMTP id f17-20020a056402069100b0046b0c119f59mr20005229edy.407.1669906303057; Thu, 01 Dec 2022 06:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669906303; cv=none; d=google.com; s=arc-20160816; b=vW7r0CRe9LFaSEz9HtSp1aEqIY2FiWT+wxbChAA1VwfI2le61rGlKIvMZ+Li2u3ZBp 7FnLSpe8piFeEpjCs4DT0+hz/zOjlY6LLLO2EJdJtd6h+k0qIaG8uui82Th+jUvEdlF4 ml4bt5L8smaZqlYt1PfUpaGYsr4Ef6qHXTgmSAMOoIphNWD4mTwi2ABWLHxyuMNGOELl ZARrnJkzckraoXqiVvBRS2Q4r2N99QxTAcb8KjVAE2l6gSFzGp1gPJg6nvtE0/RUckOw szHDKoqrtyiSDuK3W02LHdJhjUrJpR6GDHJu7E0XXc821MoDihwnlaBCXZlywOO2U7AC 824w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LPh+J6ovMcRre+8qxZyrs4XIVbXmtNW1pczNetR674M=; b=LJc5ntsBARXXVvHOeXSZaB3MxEF10UIQLyNqfDYW1XqjEQwahycHJWSwW8G4s/uQBg BiAtYf5bbUhrC/Eh2D+Y2S1yxaXPZ8NubUDusfmJ0k3DH+TIEALBlyRZ/GkXMkkcDsqa O8rgEeLDS+3WQwFp8Bb1+d3xUjPWvR6hYgQQUr0j2KSWuDPS7N14Au6FtMq9YNkeMDub l78KUoa9BUM62su+iau3wFEg+gqHbd0h3asau3WG9WoADGjf6TFVvh9nGQlmqvTBarm0 ttuy6n3RAqFQ2rpn+xH7ZneNJJXt9FeD+orQECOBNirrkhW9qa5qbHDofPFAyS3ZJu6I 01rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oXecHXb0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ty12-20020a170907c70c00b007ae377adb6asi3559071ejc.628.2022.12.01.06.51.16; Thu, 01 Dec 2022 06:51:43 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oXecHXb0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbiLAOjU (ORCPT + 99 others); Thu, 1 Dec 2022 09:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbiLAOjR (ORCPT ); Thu, 1 Dec 2022 09:39:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4A1EA6CE5 for ; Thu, 1 Dec 2022 06:39:16 -0800 (PST) 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 743B962033 for ; 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751023671653996234?= X-GMAIL-MSGID: =?utf-8?q?1751023671653996234?= 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; }