From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 25AF6C0650F for ; Mon, 5 Aug 2019 06:33:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 984562070D for ; Mon, 5 Aug 2019 06:33:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=fossix-org.20150623.gappssmtp.com header.i=@fossix-org.20150623.gappssmtp.com header.b="Eho+brQh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 984562070D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4627J52B8gzDqdc for ; Mon, 5 Aug 2019 16:33:25 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=fossix.org (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=santosh@fossix.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=fossix.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=fossix-org.20150623.gappssmtp.com header.i=@fossix-org.20150623.gappssmtp.com header.b="Eho+brQh"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46273w1s5yzDqYd for ; Mon, 5 Aug 2019 16:22:52 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id i18so39159515pgl.11 for ; Sun, 04 Aug 2019 23:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WwFeAlQ6IuYgXIVYtx8CQnkRCdX32iDrGGlWM20HRkk=; b=Eho+brQhzJydpVnUPuw9YbBLL4VaxwgoHLETt98sxch+Lo919BKFoGXOfsq8ftacph m4HcYoA5BQSimaMSd4rHOIIzt/ezpm/gpX0EAuy065a445CUrmQRXkRCw7AzTNpFymvX UfMlO5B7riL8iZYXfvoFAIEhkLmvqkPM3Uybsib5fyUqfd0shKRvhUnABa2eFP44dKzh 6PdWuYXvzdk1P1vMY51blSUCw8TA4H42xCg9ws9uSMg7FhHjUQ3L5ywLHCWvv4gwG2To giDz7Lw8OUQhx1BMQ5E7wU4/UvUv2MuFfSArRKiU+vKgeAq8xYRpoIqPJ2xuNC9x340G 09Jw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WwFeAlQ6IuYgXIVYtx8CQnkRCdX32iDrGGlWM20HRkk=; b=dYedEpNhn2qo4El+trz8Z22S/r3Lv54RW9uV75TYbvsAjc9X2ITL1fMbkctOe64tKA aWytbW+2atORmHafeinxlN/D33Jm/zhd3nz3dJ49Y99oebffst4drtM6A05MljGQnvH0 HJAHLIsoRCBqDI1FDQ3OsVi5MlfKJjKv8YWMUuhqaHa0tyu8ArAHhDXws+PsH7xbLKPk Umsow4Oq70VlaF37M4lWOqZyNucfjZuvDSh25xGShjVWSIlNJGUMGm4n+9Y8OY6LrHxm G9AZ4r8m/uEerGD2nlFs4PnAFGG1Pwo6AASEbmD2pY53MSXxpD9Z0cEcHYxP0CxweT9A 5VpQ== X-Gm-Message-State: APjAAAXaC2vxxQaElFDzV6q8vJ9tqsHub9fEPQYrgzoElZ7dDxAgFzpD wnLWCHBp/eIIAkvV9WdW3PPhFqgDw9s= X-Google-Smtp-Source: APXvYqx7K+ONyEzdf0Lqszdy5CwUdI5/P0s0j8L1dhasXmKvbPzGbzeYcM4vVZlMnCnJpuYA3ucrxQ== X-Received: by 2002:aa7:8102:: with SMTP id b2mr30531102pfi.105.1564986169679; Sun, 04 Aug 2019 23:22:49 -0700 (PDT) Received: from santosiv.in.ibm.com ([129.41.84.66]) by smtp.gmail.com with ESMTPSA id i14sm124680082pfk.0.2019.08.04.23.22.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 23:22:49 -0700 (PDT) From: Santosh Sivaraj To: linuxppc-dev , linux-kernel@vger.kernel.org Subject: [PATCH v7 4/7] extable: Add function to search only kernel exception table Date: Mon, 5 Aug 2019 11:52:22 +0530 Message-Id: <20190805062225.4354-5-santosh@fossix.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190805062225.4354-1-santosh@fossix.org> References: <20190805062225.4354-1-santosh@fossix.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Aneesh Kumar K.V" , Mahesh Salgaonkar , Nicholas Piggin , Chandan Rajendra , Thomas Gleixner , Reza Arbab , Ingo Molnar Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Certain architecture specific operating modes (e.g., in powerpc machine check handler that is unable to access vmalloc memory), the search_exception_tables cannot be called because it also searches the module exception tables if entry is not found in the kernel exception table. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Nicholas Piggin Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- include/linux/extable.h | 2 ++ kernel/extable.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/extable.h b/include/linux/extable.h index 41c5b3a25f67..81ecfaa83ad3 100644 --- a/include/linux/extable.h +++ b/include/linux/extable.h @@ -19,6 +19,8 @@ void trim_init_extable(struct module *m); /* Given an address, look for it in the exception tables */ const struct exception_table_entry *search_exception_tables(unsigned long add); +const struct exception_table_entry * +search_kernel_exception_table(unsigned long addr); #ifdef CONFIG_MODULES /* For extable.c to search modules' exception tables. */ diff --git a/kernel/extable.c b/kernel/extable.c index e23cce6e6092..f6c9406eec7d 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -40,13 +40,20 @@ void __init sort_main_extable(void) } } +/* Given an address, look for it in the kernel exception table */ +const +struct exception_table_entry *search_kernel_exception_table(unsigned long addr) +{ + return search_extable(__start___ex_table, + __stop___ex_table - __start___ex_table, addr); +} + /* Given an address, look for it in the exception tables. */ const struct exception_table_entry *search_exception_tables(unsigned long addr) { const struct exception_table_entry *e; - e = search_extable(__start___ex_table, - __stop___ex_table - __start___ex_table, addr); + e = search_kernel_exception_table(addr); if (!e) e = search_module_extables(addr); return e; -- 2.20.1