Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp560938ybl; Wed, 14 Aug 2019 02:23:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuROx5llaD7U09SspzpWBUr2eF0wm7RoijxD6O3hRpofPSdHs+bqzxo44n7JDNmOTi7OZc X-Received: by 2002:aa7:8488:: with SMTP id u8mr12740139pfn.229.1565774596730; Wed, 14 Aug 2019 02:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565774596; cv=none; d=google.com; s=arc-20160816; b=DPq4zKw4x0wKihcaLbtoPuz6cA6iJMmHEL41eISPPv/dFo5YpOo9IEcfVxf8/X9Jtn JtlzcOGb2C2uSKgInYMCSFzdltRk4RqxTN3Jhx62F/xFj5G63qK69ODM1IrEdKSjS/Oa PVr2mVI4LHjzYaKEWqYlMijW2dO02EYCEgiVlVFCAnrwgJaoCRM/g1NBTH5iKH/A2NK2 xn1OJUBFfA4ygubxpQMlgsRztm1YN2CH/WFPCmI5GuE0B0euyWvdjPQhE/61iYgCquzG VH+qEcyC+T084/eM6yujdHwLt9DB9azpSFYcerU4XrSokk6BycueBM+STr8LQzYZsGas 8bTQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=o5VgXZSr3CkOKGeSUVxEPdzuhdzMHUJ4B37bTJdSkiA=; b=nRMMM44CHxM+fadiScjK2o8JRBUn5pDSDDRc9wa3x1Tnhoi+CIzSEzVrlSymD+bVV1 YQvY2GUyKG0uVxbuJubzrgWtBIzks5eSlKPD4v2naSzh1Dw5h1eimzYMgSSNeJzakJSI iGzarOFtzTfQ4VpX32h5zPeEsqEK38Gz+vFMsZ+ORz6sos3P68hJC0gyAdy2HcAp8iAo xFWLvwfl6437yuBbevzWCEvlTYOMR5voR73CxdMyDStI7MwEIonoSjp8AJgiBoDIw/1P P9d8KkzUoxe02ECLn+QcTXY7MZSuS83vU7fKzIzml7XTKysN5ih8evFAAKpmUeM5NTzP gdsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pZV58FB9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 185si10904438pfg.261.2019.08.14.02.23.01; Wed, 14 Aug 2019 02:23:16 -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=@gmail.com header.s=20161025 header.b=pZV58FB9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbfHNJWJ (ORCPT + 99 others); Wed, 14 Aug 2019 05:22:09 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37395 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbfHNJWI (ORCPT ); Wed, 14 Aug 2019 05:22:08 -0400 Received: by mail-pf1-f193.google.com with SMTP id 129so6313535pfa.4 for ; Wed, 14 Aug 2019 02:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=o5VgXZSr3CkOKGeSUVxEPdzuhdzMHUJ4B37bTJdSkiA=; b=pZV58FB92yTQ58cFWIY0ZrR9WepwOaEZQCnUq50sbyNa7k9L6MBWPEX92IZuybhEq3 yI2BD/pDGWGYbOcUJUKBuRR23L845lxAbNW9j/cvj0I2bGcKq+iloz3i5e1P1EFfywR8 xBUgJjQFOml6qUhkad76CFVHSJB3NQU4WOA1+3keR8hFivk29EexKY90XVd542j6K5HL vkbqW8Eeqqmr1Kz5RXNU286kuc6Sl2khJfj1YV4mqSf+QScckN4ZP+65ynr99CtRr02A dEjNAsbk2KmaNPBYC73azwiMUeJU7JOtUK1ihuN4r+8k7r0oiIcyoy3ddEulEZE+McMC 3Dxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=o5VgXZSr3CkOKGeSUVxEPdzuhdzMHUJ4B37bTJdSkiA=; b=MklOMOcM/a315xwVx1LLkE80iZtvpJu+516RjSnQtxJOqg6NJ2M2HqDguJo0GyzYBk ueIjgmMYUqMp40Aw3CTMd6JJYRlDCkEkY2BIxakWAVRvbVbtTC+swEclgWzkqMbuSmka 6CvYfj/cfiT5hzI3y1UvyXlxbXTVooJvQcAUwgQoUkm1H31XxpQHtjpGVC6AAVlTpytV 2/5AvxUqemdCrxqpvRqJLGL9OMzV9YST4vdyVIjgG+j79WS00v1lRogxykZNysI3+dqu tQ9PXgwe56dMcCZirfCnUs8F/cTsCPK13RIqemaX0MSh5IScyh5aSNAgR2lTTKpvuizy kaog== X-Gm-Message-State: APjAAAXg5Q2NuoyO1x0KvZnYmXPiLLh/8Y2JHgYduwvGFiEN50Fwow3B HFyLinu6bo+hYzjjYdYnFX0= X-Received: by 2002:a17:90a:3465:: with SMTP id o92mr6113026pjb.20.1565774527842; Wed, 14 Aug 2019 02:22:07 -0700 (PDT) Received: from [192.168.68.119] (203-219-253-117.static.tpgi.com.au. [203.219.253.117]) by smtp.gmail.com with ESMTPSA id m6sm113712457pfb.151.2019.08.14.02.22.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Aug 2019 02:22:07 -0700 (PDT) Subject: Re: [PATCH v9 4/7] extable: Add function to search only kernel exception table To: Santosh Sivaraj , linuxppc-dev , Linux Kernel Cc: "Aneesh Kumar K.V" , Mahesh Salgaonkar , Reza Arbab , Chandan Rajendra , Michael Ellerman , Nicholas Piggin , christophe leroy , Thomas Gleixner , Ingo Molnar References: <20190812092236.16648-1-santosh@fossix.org> <20190812092236.16648-5-santosh@fossix.org> From: Balbir Singh Message-ID: <916d5741-a0bd-8860-4a38-7a5ef677214a@gmail.com> Date: Wed, 14 Aug 2019 19:22:00 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190812092236.16648-5-santosh@fossix.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/8/19 7:22 pm, Santosh Sivaraj wrote: > 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); > Can we find a better name search_kernel still sounds like all of the kernel. Can we rename it to search_kernel_linear_map_extable? > #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; >