From patchwork Tue Jul 16 11:12:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11045855 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 D8FF41510 for ; Tue, 16 Jul 2019 11:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C335228564 for ; Tue, 16 Jul 2019 11:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B634B2856F; Tue, 16 Jul 2019 11:13:24 +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 528C028564 for ; Tue, 16 Jul 2019 11:13:24 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=dxU+eWo2CIGrtCofZLKchJlOsmSwZ88TH5faQIp5ODE=; b=XeV Vvf0BVMV85badFus0bZM35xo7X9mTy6EHAYXwEs2LumAnH0R7F3/y2a7WbJLVAYuJMJxZwu92Rs9L ZUBWH8nWfIdLcGAkODwfqBoJZFMsVHMzwKUYSvsKuoVTUYTsXVf13O2gwf73R6fYWfYWr6e+JOr+s THENBvE05wcZm2U+60ZJ3kVS5YzoYs3bONzSTulr4wRUQLT3kBqWNkskNyrh6LH7s5oAo5CKqa3vM IjlNdKXtY5MLqQLOYRY6NspEywVwgZwFFnayw0HhPF1G9dHlAjC6sTPwK0rlmjFy/wlitmojkSh6u 1iDGzVlMEyqI0NHWBevZFu1Ln9gSI2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hnLOc-0000OY-Vb; Tue, 16 Jul 2019 11:13:22 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hnLOa-0000Nj-Dd for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2019 11:13:21 +0000 Received: by mail-pf1-x443.google.com with SMTP id r1so8939417pfq.12 for ; Tue, 16 Jul 2019 04:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=l8lUDijBiyY5cnjhjm2bVu88mH5lRLrGchTwxKmKfRM=; b=n+WcafFy/24JXY2LfhO+hw1ngbjN1W/bcJu99Sy2jNXlHMVIp+hq+Kw0Z8D3nCpVu3 p615sFT47ypPa/pyRofK9aC5YX4c9pUMTqeia6e2T3YfaHhYc+/Qt/zfpomkHJCaqUIs Wa3K+jFwzvvLdB4h0f0p454uZScZX3rew/arPvBW6/L4VybGE25GvXdNvixCxHe4AZIL b0bAxU83fAlmu7KERFHiUOtHyA3bG7H+ByV4pFA9tuojhnFXGGBzvpkK7kPhO+KCbAEm 5fcmvjoiCZmwESd8VfOcMHf0txSN7uCQOGKcgWmHgCdDKMFNNj5ed8K2ZlMvVyPzifGd Fkbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l8lUDijBiyY5cnjhjm2bVu88mH5lRLrGchTwxKmKfRM=; b=gT0sKSH5TaYSDgSj1sUQ1M+pnQjW5vyQCphczDuYHYGwWY5NZAdts+rnhNFN08XTD2 +o9MFQyP/TBupNwgsazke/ew1j6CygGyHzTaWYhAWnYPRCnRu+uVKQfnMoK9lknPbV4b vPdhmLaDciuvP/P8HZlXeW9ZrLzppZDwiHHoQ6k6YllJZrHR8Th1lp/0YPlrpHRFF+35 gPKENr+2V3zEeFdlDzlzpk0hcKBzW126B5GAFssftOMmCpH06A2i1AiE/2JZ5/opDiWR Vd0KdmGivZS5tccAKoqjxFI1vK/z440aXGrmyhA9TKFWEpJGEVO0bk+gCDHhtjNxIK4F PT/w== X-Gm-Message-State: APjAAAWEKJgLhG+TWjYK+nt5KjtSATxwLcjEY2w91qHjJDDDZuGdjcij +JXeqNEsWCxVjADVDh4Uslvedw== X-Google-Smtp-Source: APXvYqx2luVpK2SH0RmMNrxXQpvln9vKdfadl33zXwjMdrs+FXh/PcBB7WUo0CD3twBTUWfaiHb80g== X-Received: by 2002:a63:e356:: with SMTP id o22mr32978109pgj.150.1563275599407; Tue, 16 Jul 2019 04:13:19 -0700 (PDT) Received: from localhost.localdomain (li1433-81.members.linode.com. [45.33.106.81]) by smtp.gmail.com with ESMTPSA id 21sm19324907pjh.25.2019.07.16.04.13.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:13:18 -0700 (PDT) From: Leo Yan To: Russell King , Oleg Nesterov , Catalin Marinas , Will Deacon , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Masami Hiramatsu , Justin He Subject: [PATCH 0/2] arm/arm64: Add support for function error injection Date: Tue, 16 Jul 2019 19:12:59 +0800 Message-Id: <20190716111301.1855-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190716_041320_467100_853BD587 X-CRM114-Status: GOOD ( 12.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 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 This small patch set is to add support for function error injection; this can be used to eanble more advanced debugging feature, e.g. CONFIG_BPF_KPROBE_OVERRIDE. I only tested the first patch on arm64 platform Juno-r2 with below steps; the second patch is for arm arch, but I absent the platform for the testing so only pass compilation. - Enable kernel configuration: CONFIG_BPF_KPROBE_OVERRIDE CONFIG_BTRFS_FS CONFIG_BPF_EVENTS=y CONFIG_KPROBES=y CONFIG_KPROBE_EVENTS=y CONFIG_BPF_KPROBE_OVERRIDE=y - Build samples/bpf on Juno-r2 board with Debian rootFS: # cd $kernel # make headers_install # make samples/bpf/ LLC=llc-7 CLANG=clang-7 - Run the sample tracex7: # ./tracex7 /dev/sdb1 [ 1975.211781] BTRFS error (device (efault)): open_ctree failed mount: /mnt/linux-kernel/linux-cs-dev/samples/bpf/tmpmnt: mount(2) system call failed: Cannot allocate memory. Leo Yan (2): arm64: Add support for function error injection arm: Add support for function error injection arch/arm/Kconfig | 1 + arch/arm/include/asm/error-injection.h | 13 +++++++++++++ arch/arm/include/asm/ptrace.h | 5 +++++ arch/arm/lib/Makefile | 2 ++ arch/arm/lib/error-inject.c | 19 +++++++++++++++++++ arch/arm64/Kconfig | 1 + arch/arm64/include/asm/error-injection.h | 13 +++++++++++++ arch/arm64/include/asm/ptrace.h | 5 +++++ arch/arm64/lib/Makefile | 2 ++ arch/arm64/lib/error-inject.c | 19 +++++++++++++++++++ 10 files changed, 80 insertions(+) create mode 100644 arch/arm/include/asm/error-injection.h create mode 100644 arch/arm/lib/error-inject.c create mode 100644 arch/arm64/include/asm/error-injection.h create mode 100644 arch/arm64/lib/error-inject.c Reviewed-by: Masami Hiramatsu