From patchwork Fri Apr 12 12:04:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongfeng Wang X-Patchwork-Id: 10898079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D25114DB for ; Fri, 12 Apr 2019 12:07:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC01228E60 for ; Fri, 12 Apr 2019 12:07:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC5FD28E64; Fri, 12 Apr 2019 12:07:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A33D28E60 for ; Fri, 12 Apr 2019 12:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=N9CXfHEXfMsffJzJm4LVZZ/amEPXpn+v28g486P4YSE=; b=oxNYQkpfwA9LtX ARUYA+o/0idd/3t0LZCIxZ9t47q4r56lFuNBxFmxrWsjRPHgaNIE56pnTzwHW5nNFcyGDx6agiT1m bTvR1fdiap7boF2eBptwpHwduELZLSZdF3VI9Gf81SBVVrWXxtkTnOTZ8Gw4Ak6UPHDrn6SlCAfqi +d4LXoxB6FFQYhrVZABfctaiO2Ryl+DR8Gc1jLcdlSp3RFw/XiG9EzUvOcX4zajejOCC7q9p+tWra g2zRv2dqaLCdMkLTnjEdkZWR1Pn6SaT9JyUpkNl5Aqk79RYCCp1JjLfxcYIgB67hfVyfeVLISoMm9 LRNgKNxmyMCg5W7R4xiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEuxX-0006NH-O8; Fri, 12 Apr 2019 12:07:07 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEux5-0005PN-7f for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2019 12:06:44 +0000 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1E638CD7C9B354257391; Fri, 12 Apr 2019 20:06:30 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Fri, 12 Apr 2019 20:06:19 +0800 From: Xiongfeng Wang To: , , , , Subject: [RFC PATCH 0/3] Enable kprobe to monitor sdei event handler Date: Fri, 12 Apr 2019 20:04:56 +0800 Message-ID: <1555070699-3685-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_050639_733361_4994BC5F X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When I use kprobe to monitor a sdei event handler, the CPU will hang. It's because when I probe the event handler, the instruction will be replaced with brk instruction and brk exception is unmaskable. But 'vbar_el1' contains 'tramp_vectors' in '_sdei_handler' when SDEI events interrupt userspace, so we will go to the wrong place if brk exception happens. I notice that 'ghes_sdei_normal_callback' call several funtions that are not marked as 'nokprobe'. So I was wondering if we can enable kprobe in '_sdei_handler'. Xiongfeng Wang (3): Revert "arm64: debug: remove unused local_dbg_{enable, disable} macros" sdei: enable dbg in '_sdei_handler' stop_machine: mask sdei before running the callback arch/arm64/include/asm/debug-monitors.h | 1 + arch/arm64/include/asm/irqflags.h | 4 +++ arch/arm64/kernel/debug-monitors.c | 8 ++++++ arch/arm64/kernel/sdei.c | 43 ++++++++++++++++++++++++++------- kernel/stop_machine.c | 9 +++++++ 5 files changed, 56 insertions(+), 9 deletions(-)