Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2355172ybh; Sun, 4 Aug 2019 23:24:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxereg62UcEcfjecnn1Ua2faNRT/+xoaZLcwXIu10Ry+EJWM6Y8QyPflamgtKjhvxrivJZk X-Received: by 2002:a17:902:7d86:: with SMTP id a6mr142750572plm.199.1564986282081; Sun, 04 Aug 2019 23:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564986282; cv=none; d=google.com; s=arc-20160816; b=JdMjEZT/7GSoL3YT/GQyL1daZPduScyh6lDM3eCO6d5ZXHa09mSOflHdbgYFxnv7qu eZGIkeSq1uk7hQ09I48/AIvO7vGVHlyJK50QC92nlGLTQYurLM9L6TIiy/A+lRUqPGNW vmzmYVeYnfdYc2s9JlAJq2xG1Tj/t28DtPeP7KFaydI9JBop8TTKtaY/XVa7HEh4RbHO Cy4IAz7qQkDDbEKtAxLmJNJE3EbN1Ureluwyo2ryVY58xBC6dm6So/SkeJoe297ZJ2Gk nYpgtqvrKDY+qOZq2wJ3v7OEWTY1H8c3Gn1U64P7Q8ZhHv0DULuk3DT0l/1Fq6k3q5Vb FApA== 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=WwFeAlQ6IuYgXIVYtx8CQnkRCdX32iDrGGlWM20HRkk=; b=q61Zb3stYkSyvSfGO6os7MwoyWxais0fKZBz+j+sMFTf0WG/spk5hFboIoDAADvGqb nP8oS2hlKwzDM/dPzUA9ETkU0xTT60J0E93H5yrihmPKMC9Nns299QG2haMRWPXXX8Kl SbDSPTTJw8MTDxrFQal0P8C6QWcPpjnLB06IF2g21VAuaFuqZlUMa/eQWl/pcGC45WYh rlrEogVzILk33CkRp8oitU/9aFiUzgwf9M7oAmAYnqSW1gGdQ8CgIJG6S3JzhRs03yOl NIBqnP8nMx8obv2yh5JjsYlOa0Ne2ErDv80wckiFv7nfsbTKjc6TfYNPKVSquJIysE+D SEvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=Eho+brQh; 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 a33si44534914pgl.436.2019.08.04.23.24.26; Sun, 04 Aug 2019 23:24:42 -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=Eho+brQh; 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 S1727430AbfHEGWv (ORCPT + 99 others); Mon, 5 Aug 2019 02:22:51 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40224 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbfHEGWu (ORCPT ); Mon, 5 Aug 2019 02:22:50 -0400 Received: by mail-pg1-f196.google.com with SMTP id w10so39159044pgj.7 for ; Sun, 04 Aug 2019 23:22:49 -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=LHN6hn+GWyWFadSz1G0f3y8dmPOUvROZGJvB8+fBTw1MW7ca4Ve6mSAIQkm1QnAu17 kdyQ0snbo0ki8zELVo6bZdkk5NdOCufswAJqpJd8c3UebFtSLMK/NOtQDezK9HTHSBfl hcbF5lxsC2kiAKS4xHxkMOo0L/ypzTlEyl0ceecAJZgfbzDQ4NY85WrTf/ACxHSn4uDF 6qAzC0yiTdNez8Q6df2rW3bEhjMUXscgIMy5DJIVtlqiW8nIcEa09dggoZlray+fdNkG OfolSTedx6QCI1B7SgZlBCIjIoBDGoyKId1hgsaFYxBA3wywX6LrNeLzEkyiK69f2bAW +B5A== X-Gm-Message-State: APjAAAUFyEqtIYxagPWkMHVRxbaaii4e3cnIpVUXKME1Otof16z3rhJH S2ai9TyiIiwl8WxePqCwMA0= 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 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 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 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.20.1