Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3553354ybl; Mon, 12 Aug 2019 02:24:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZtXC9aRldK4iokCwpK4LfLLHM8tCgTAEPiUzN+T9VoQ4ELso+Z7/opoXA96KZSTNTsS0e X-Received: by 2002:a17:90a:1d0:: with SMTP id 16mr623216pjd.98.1565601865761; Mon, 12 Aug 2019 02:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565601865; cv=none; d=google.com; s=arc-20160816; b=E5bQQywE8hY46qB3K3MMzm0ikynlH2gDCUwyYuRfHsDTK0Z9b1QHY/7jVvJo9/Mvjc k1pHO38TFKptWrCXM8rwPxhGjVevOmg9U4JLeQiz1M3EZao+fc8rX7rworAGnOtVNmB4 Q7EfxfAqdSWW7mR7rrpBLw/QTHAMnCRVasB1vsdCvKsvL+x+ekfOs4WKj5dmsniboIKM nN/ZfJEcObXfLQQTfKXy6JUdDvOFfqtxqiYGypcCKmzLPn7cg9xv6yQqt/7PSp26rQ4C LI0qb535cfxR+qbewWQMmuoJiYJi2+Sl2LMtDxvqnL3xR/bo4PEwvuRzIwuJzzwGxan1 Rdbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NE1NaEdbx0Ad3W/X+QOOKHTKwGbGj5XSKxU/TTh8Rxs=; b=q1NGT93Apg61dLRoPaILDCHf1PGEgwoSUdhXhg5p6xWDg+/kI8Dd5cE3qei/Zmty+9 YIEIHJ8qZWv9varTUvYstBlglOUNc7N9VG4sY9RlKoU9hiiInA/5ddEeXLJ2RXX7FD3B jdtdST+rMdrUVBOkgXQ7uP8tZF+Hpw0krL0F4c4D4eheGzwChoIu5iavRuQZroAiT7OU ZxMxHzW3dWWyuov165V5HmBrFmpBZ3r8MHntpMefSqjPJkysdd58VknuRciVrBcWH/FE 0HHnnOuAIY062aHmhHVHJRV60h0M8S4yS/6aU+RzolwHwNavm8VZUfajk9hHIjf3jYCd mOIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=e0nDDZkG; 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 m7si61876467pls.110.2019.08.12.02.24.10; Mon, 12 Aug 2019 02:24:25 -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; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=e0nDDZkG; 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 S1727491AbfHLJXI (ORCPT + 99 others); Mon, 12 Aug 2019 05:23:08 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41195 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727369AbfHLJXH (ORCPT ); Mon, 12 Aug 2019 05:23:07 -0400 Received: by mail-pg1-f196.google.com with SMTP id x15so38830673pgg.8 for ; Mon, 12 Aug 2019 02:23:07 -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=NE1NaEdbx0Ad3W/X+QOOKHTKwGbGj5XSKxU/TTh8Rxs=; b=e0nDDZkGKhyiN7ucCz0CdI9M1/9R9UME8nCcYwuYHM2dvmt9pHIIz0kVBZQMlKczx+ p3/nBcij6anVq1eRVAuqtUNYvWmnL1/NASB4qEVMfVivaW2DcOm19s2dDP4t8XYxILom WYnMYtlAJJ03e8tE0K7CTnMFdrLOF+93r5ym689kXw1YjE+hEHlLCP2CNwRI6xIXV1oA v54rqtzCUCfYt92lnRiWkOJVstpX3BMkpuOWmMdef32vWeutbxfr2IM9+jJuO7pIG3bl z4OE7zB1kNIU4+MeCBps7LNBawhpNIo5j09tx6903NJlu69eLcYR4MUTcPZuhzc2SVX5 PVzg== 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=NE1NaEdbx0Ad3W/X+QOOKHTKwGbGj5XSKxU/TTh8Rxs=; b=VMiNBDT3mP2jj8N4CK9vpqvSzkd0KXqQ/lDiFyR86+m+/l6rmt6Nij89YnoLij8JdW 37LMuVnryDgHvzxAbyEq1ZRO4j6YMDychG7yptVQt1Jh1a6Zqn1HBE+DJ5Bu3zHypLqV bEYn6PkFYZucrPMQuUsx0H2UUCKLz9LyQtYFHiBhSELv5hTlUfv74G8JKr3Q4I565091 saDtbRKID7NzMSMb1xycExgzr39toWaHyh4KgOjaV//BEJB4pKCPAD398EFcuOVkFbkl /YShcT4h7QNcHIoXC3uIGJaZR/0easjmdVWEv97dfulr2Nztbyx9hoP4aZY3qEcCwE0i S2lQ== X-Gm-Message-State: APjAAAU4652lO4qpp7EhW5YyX25Bzr6gTNsNvnJqnDIJTDi0VPd/EY60 xbwFKmK/M2nKDHZFgljfMlU2d07baxpNvA== X-Received: by 2002:a63:e807:: with SMTP id s7mr28474428pgh.194.1565601786689; Mon, 12 Aug 2019 02:23:06 -0700 (PDT) Received: from santosiv.in.ibm.com ([129.41.84.75]) by smtp.gmail.com with ESMTPSA id y188sm10543517pfb.115.2019.08.12.02.23.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 02:23:06 -0700 (PDT) From: Santosh Sivaraj To: linuxppc-dev , Linux Kernel Cc: "Aneesh Kumar K.V" , Mahesh Salgaonkar , Reza Arbab , Balbir Singh , Chandan Rajendra , Michael Ellerman , Nicholas Piggin , christophe leroy , Thomas Gleixner , Ingo Molnar Subject: [PATCH v9 4/7] extable: Add function to search only kernel exception table Date: Mon, 12 Aug 2019 14:52:33 +0530 Message-Id: <20190812092236.16648-5-santosh@fossix.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190812092236.16648-1-santosh@fossix.org> References: <20190812092236.16648-1-santosh@fossix.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.21.0