From patchwork Thu Aug 17 07:16:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 9905103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AEC7C60386 for ; Thu, 17 Aug 2017 07:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A06ED28ABF for ; Thu, 17 Aug 2017 07:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94DD128AC1; Thu, 17 Aug 2017 07:17:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3DC8C28ABF for ; Thu, 17 Aug 2017 07:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+qw9mJfm3Z5Gq8xZijQke6yYoROmy7FyBD4XdgQ2nhk=; b=LpcETW9w5P6kYS z4aU/KrxGg9ASB/7skr53BRogHDOmUZUxySu+c+UHjaROJozlIEupL/ifxrZVb/SZnDeBHr7QQ+Rc HDOnNMb8RCU6IU8nf9wH5Lqw9pbv8FYaaeFQprwMDVWFFkntgA2c5SM3UG5l7kl/Vr+7cu8itW8mP raLUSzxwu5lrspWHxA+mhhslptwc7OGUF7z4gzxDibbyHUoVIBp12eZU/UvuA0ulow3xpUqxjIwM1 phAF7M0F0A3uTK6t59gil7jXeS1H2i534UllFEqVUVAB06cP1qNjmZ66SrKRdYc40kZJkZrW7naI0 drAUm/SwHFwaQICauU9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diF3i-00081U-SZ; Thu, 17 Aug 2017 07:17:38 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1diF3M-0007T9-Ga for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2017 07:17:22 +0000 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96C0B2170E; Thu, 17 Aug 2017 07:16:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96C0B2170E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org From: Masami Hiramatsu To: Ingo Molnar Subject: [PATCH -tip 3/4] arm64: Cleanup in_exception_text() and move it in asm/sections.h Date: Thu, 17 Aug 2017 16:16:06 +0900 Message-Id: <150295415599.14424.2567748523337189088.stgit@devbox> X-Mailer: git-send-email 2.13.4 In-Reply-To: <150295395797.14424.968407208436624832.stgit@devbox> References: <150295395797.14424.968407208436624832.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170817_001716_920462_79DF9C1F X-CRM114-Status: GOOD ( 11.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Arnd Bergmann , Peter Zijlstra , Catalin Marinas , x86@kernel.org, Will Deacon , Russell King , linux-kernel@vger.kernel.org, Ingo Molnar , Masami Hiramatsu , "H . Peter Anvin" , Thomas Gleixner , Thierry Reding , Andrew Morton , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Cleanup in_exception_text() using memory_contains() and move it in asm/sections.h from asm/trap.h because section symbols and memory_contains() are defined in asm/sections.h. Signed-off-by: Masami Hiramatsu --- arch/arm64/include/asm/sections.h | 16 ++++++++++++++++ arch/arm64/include/asm/traps.h | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/arm64/include/asm/sections.h b/arch/arm64/include/asm/sections.h index 941267caa39c..abaa8ac79eaf 100644 --- a/arch/arm64/include/asm/sections.h +++ b/arch/arm64/include/asm/sections.h @@ -29,4 +29,20 @@ extern char __inittext_begin[], __inittext_end[]; extern char __irqentry_text_start[], __irqentry_text_end[]; extern char __mmuoff_data_start[], __mmuoff_data_end[]; +/** + * in_exception_text - check if an address is in exception_text or + * irqentry_text + * @addr: virtual address to be checked + * + * Returns: true if the address specified by @addr is in the exception_text or + * irqentry_text, false otherwise. + */ +static inline bool in_exception_text(unsigned long addr) +{ + return memory_contains(__exception_text_start, __exception_text_end, + (void *)addr, 0) || + memory_contains(__irqentry_text_start, __irqentry_text_end, + (void *)addr, 0); +} + #endif /* __ASM_SECTIONS_H */ diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h index 47a9066f7c86..c3734c3e8115 100644 --- a/arch/arm64/include/asm/traps.h +++ b/arch/arm64/include/asm/traps.h @@ -37,20 +37,4 @@ void unregister_undef_hook(struct undef_hook *hook); void arm64_notify_segfault(struct pt_regs *regs, unsigned long addr); -static inline int __in_irqentry_text(unsigned long ptr) -{ - return ptr >= (unsigned long)&__irqentry_text_start && - ptr < (unsigned long)&__irqentry_text_end; -} - -static inline int in_exception_text(unsigned long ptr) -{ - int in; - - in = ptr >= (unsigned long)&__exception_text_start && - ptr < (unsigned long)&__exception_text_end; - - return in ? : __in_irqentry_text(ptr); -} - #endif