Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp355982yba; Fri, 12 Apr 2019 05:07:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFIzkHweR8yAlGBAnGKgCUoCSfU3XmzxbFZGQLT/XWPxKWM0hJpm2x+CnQCQmS5lop1KHH X-Received: by 2002:a62:1795:: with SMTP id 143mr57163807pfx.104.1555070861552; Fri, 12 Apr 2019 05:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555070861; cv=none; d=google.com; s=arc-20160816; b=TuBmpfvRvQgYFFnSKs8yib8RCFxGwAWQVuOpRgOQ633elWtddVJc+DsRWFyUlpn+Ig 8PqxS81YQhFFDrb7ob3j6YTqaYNch7aTSmrh0ZCpP43SMzipp7LFWDZtmhscL1VVSzEu 3Y60orjk37KOKnQ3ssA81YvytZZr1rH390p3HN2Ihb1M2ivP7AlpcYDIItXl7CgkxCEQ JRdqfXJ+PNrCcu3u8MQxLhm2mT3kg6X/DxT8rq7k3NznS4TwyfPRXPDFuUjbUUS/kYwI eqnab7GcHUEugJsnC2dCvRN7DRjkfNf4BknHuYqD/AFRUkAyy4nyM1GoReT8CGwJ4kiJ Obfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=lgflKmg3mKyNy8x5r1N6+8Vgi0nQj78KX72W8VQ6Fn0=; b=P64rNugEr3iI9yy1Rtjid7EaxU8m2KrF+POv5K91aZ8ngakU1s/+KiWeqzHtRvEIFb FKhmyanuWyDzQxQKaEf5J7A+twO1wz3+CyKgkFXZp1/9s/F5mvtsdnANK1zRtV2dhfur sL8yHVj8Cwe/c/zemwKORGQzC+a4A1SDgEB2MX/eA/AIkIIprf4+OaEUG2O3TB3u4P+E 9SEo/9WNJ+3Giq5yXzPaC0+ovnSyDC2muTY/E+JC2jkGP7t0U1T28FitheNacpQnoqo2 3h6cG/n8yr87OP2Wi+zJ0O2kRfowAqORc0WuUmrt+TA2fbVD0ggqSgBCvdf5Bb40SmqW PlLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si37890660pfc.276.2019.04.12.05.07.25; Fri, 12 Apr 2019 05:07:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727541AbfDLMGj (ORCPT + 99 others); Fri, 12 Apr 2019 08:06:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6176 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727122AbfDLMGf (ORCPT ); Fri, 12 Apr 2019 08:06:35 -0400 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: , , , , CC: , 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 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.12.4