From patchwork Fri Jan 15 13:03:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12022695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D68BC433E0 for ; Fri, 15 Jan 2021 13:03:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 09E2022473 for ; Fri, 15 Jan 2021 13:03:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09E2022473 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E2EB88D016C; Fri, 15 Jan 2021 08:03:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E09F18D016B; Fri, 15 Jan 2021 08:03:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCF1F8D016C; Fri, 15 Jan 2021 08:03:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id B3EE08D016B for ; Fri, 15 Jan 2021 08:03:51 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 74E21181AEF1A for ; Fri, 15 Jan 2021 13:03:51 +0000 (UTC) X-FDA: 77708026662.25.girl87_280e9b82752f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 0AED11804E3BE for ; Fri, 15 Jan 2021 13:03:50 +0000 (UTC) X-HE-Tag: girl87_280e9b82752f X-Filterd-Recvd-Size: 4751 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 13:03:50 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id w8so4134106wrv.18 for ; Fri, 15 Jan 2021 05:03:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=954/Z+Hv6LNpyU9utqCctaUUru/bs3BWptIPfUnFtmI=; b=pm4+xcjwk+Pr+UXPk5mF0s3bJV0j+KWfPkIsrbpPDRrSGfSXWBhGeKkX90a+jelTbP KobHEq/XLzDeNe8BVOYEBsHJt+9fd4Fe6SXeDxDdH8twkCSYLrd6w5n9kb5cNWd2An61 tGxF3QVINmmir4xsF/oOxOBZHJt6pgFg/Y/5XUxgAvDAH27gJb8dnxRW1eXv22rxVshe yiK42IHcUltxQuoaL3rkds8EwUjK149viM/GwhS7MDBL2Yv5nMWcUrRmeKkK/x6mUTSs TWyfFxXakDmtc0W2MI8DMYz5U3IuCtGiId61uFrkRxKcC/N8C8JsJAfp5Gp28rVv312K TOTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=954/Z+Hv6LNpyU9utqCctaUUru/bs3BWptIPfUnFtmI=; b=fLYhYWb+FKLHUSEDtg6871ICOEgrTFIy2OMhhkTcyfK5CkR7fUrVaIoK5UT3fJQQxI JQYxVPP+R2ZfoFqVSDSiuRqjMAadp8U8uW1GG82ju8Mo983QgZ90BBx28TJsdqnLzhoA iEtiBpS6rPK4gEuBcXgeDBZGEZ/epp6Lvj9ueU7MOx0KT2OcT+RtujZnts4lbGS4jSbB 8CqBsNdQp+1SY/a1PbdrTfS/e6yrYGzM9vfppnB4NJ0Qmnc9ZBKxs6rGsp0VFksMKrlf yG35r2punyMVU4wMuZUJSXl2w6fBvfLnd0FkY4b58bbBd8LKqoHLy+au/jg54VVM1zw5 bhLg== X-Gm-Message-State: AOAM533BeguqMgGmEccdsAXV5HTuAfYMgvy3suqf0EEla7/QxqorYS5R dMDwrXo83Oejzvq3W4VrwaPeo3E3wzY= X-Google-Smtp-Source: ABdhPJxtwFBxiD7OEYrh/qyl7LW2IZQ1kWN66X1jJsjmKqpZeYgm33eaNA3UEIbQL3cBZ7Drz1VxX8M5jug= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:f693:9fff:fef4:9ff]) (user=glider job=sendgmr) by 2002:a1c:2c89:: with SMTP id s131mr934969wms.0.1610715829142; Fri, 15 Jan 2021 05:03:49 -0800 (PST) Date: Fri, 15 Jan 2021 14:03:35 +0100 In-Reply-To: <20210115130336.2520663-1-glider@google.com> Message-Id: <20210115130336.2520663-5-glider@google.com> Mime-Version: 1.0 References: <20210115130336.2520663-1-glider@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH v2 4/5] kfence: use error_report_start and error_report_end tracepoints From: Alexander Potapenko To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: andreyknvl@google.com, dvyukov@google.com, mingo@redhat.com, elver@google.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, glider@google.com, linux-mm@kvack.org X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Make it possible to trace KFENCE error reporting (in particular, for compatibility with CONFIG_ERROR_REPORT_NOTIFY). Suggested-by: Marco Elver Cc: Andrew Morton Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Ingo Molnar Cc: Marco Elver Cc: Petr Mladek Cc: Steven Rostedt Cc: Sergey Senozhatsky Cc: linux-mm@kvack.org Signed-off-by: Alexander Potapenko --- v2: - change error_report_start and error_report_end prototypes to accept enum error_detector instead of char* (as suggested by Steven Rostedt) --- mm/kfence/report.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/kfence/report.c b/mm/kfence/report.c index 4dedc2ff8f28..bbe7dad5f249 100644 --- a/mm/kfence/report.c +++ b/mm/kfence/report.c @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -184,6 +185,7 @@ void kfence_report_error(unsigned long address, struct pt_regs *regs, lockdep_off(); pr_err("==================================================================\n"); + trace_error_report_start(ERROR_DETECTOR_KFENCE, address); /* Print report header. */ switch (type) { case KFENCE_ERROR_OOB: { @@ -232,6 +234,7 @@ void kfence_report_error(unsigned long address, struct pt_regs *regs, show_regs(regs); else dump_stack_print_info(KERN_ERR); + trace_error_report_end(ERROR_DETECTOR_KFENCE, address); pr_err("==================================================================\n"); lockdep_on();