From patchwork Fri Sep 12 20:17:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 4897921 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 48AF19F430 for ; Fri, 12 Sep 2014 20:12:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10A0C20260 for ; Fri, 12 Sep 2014 20:17:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EF4C20266 for ; Fri, 12 Sep 2014 20:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbaILURb (ORCPT ); Fri, 12 Sep 2014 16:17:31 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:49896 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbaILURb (ORCPT ); Fri, 12 Sep 2014 16:17:31 -0400 Received: by mail-wg0-f46.google.com with SMTP id n12so1262220wgh.29 for ; Fri, 12 Sep 2014 13:17:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=H6+bgosjXpm1bTfJ8GRVGFGdSSubX0fmWl2UyXk1aCs=; b=mWlZWl7bL3w1Iee+0PpaDjIvSa/fJwqVa/a6/RjaiJLR26dxjxyozxZ54rfn+uYJuq PyIRR1R8HaoBNPf+J+dHH/EXcyhlt8NlTT0lrPc4E7At5am5Fn4hB5TEspXTaCMC6g0X sPnwmJjrUcWa4C7pqKWQm0/w0fofvSUA6GjGga/bHKAU6GCxBLSNdEGn6Ew2CDKi+hUt hp7y+77d30rHs10Zbvryw/Wa+Ixc1uvm4M4768h8/j908Y0SBEOwTJK6lISdK+twlF2Q YoaMvAaeCdWANEwiLNqN8kNM+aPZiEq+PLbgzWH0pp0chqXn/z8AKbW27fvLabhfvMdF c0JQ== X-Gm-Message-State: ALoCoQmLKDwz2oz+8dqBm9i+MmVGVvummvh2V4EvxwC7NCTwaJY9gGYxhdw2P/j4zoPp3U3BybU5 X-Received: by 10.194.61.99 with SMTP id o3mr13862626wjr.103.1410553047908; Fri, 12 Sep 2014 13:17:27 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id ny6sm1749257wic.22.2014.09.12.13.17.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 13:17:27 -0700 (PDT) From: Ard Biesheuvel To: kvm@vger.kernel.org, pbonzini@redhat.com, christoffer.dall@linaro.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, ralf@linux-mips.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, akpm@linux-foundation.org Cc: Ard Biesheuvel Subject: [PATCH] mm: export symbol dependencies of is_zero_pfn() Date: Fri, 12 Sep 2014 22:17:23 +0200 Message-Id: <1410553043-575-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to make the static inline function is_zero_pfn() callable by modules, export its symbol dependencies 'zero_pfn' and (for s390 and mips) 'zero_page_mask'. We need this for KVM, as CONFIG_KVM is a tristate for all supported architectures except ARM and arm64, and testing a pfn whether it refers to the zero page is required to correctly distinguish the zero page from other special RAM ranges that may also have the PG_reserved bit set, but need to be treated as MMIO memory. Signed-off-by: Ard Biesheuvel --- arch/mips/mm/init.c | 1 + arch/s390/mm/init.c | 1 + mm/memory.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 571aab064936..f42e35e42790 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -53,6 +53,7 @@ */ unsigned long empty_zero_page, zero_page_mask; EXPORT_SYMBOL_GPL(empty_zero_page); +EXPORT_SYMBOL(zero_page_mask); /* * Not static inline because used by IP27 special magic initialization code diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 0c1073ed1e84..c7235e01fd67 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -43,6 +43,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); unsigned long empty_zero_page, zero_page_mask; EXPORT_SYMBOL(empty_zero_page); +EXPORT_SYMBOL(zero_page_mask); static void __init setup_zero_pages(void) { diff --git a/mm/memory.c b/mm/memory.c index adeac306610f..d17f1bcd2a91 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -118,6 +118,8 @@ __setup("norandmaps", disable_randmaps); unsigned long zero_pfn __read_mostly; unsigned long highest_memmap_pfn __read_mostly; +EXPORT_SYMBOL(zero_pfn); + /* * CONFIG_MMU architectures set up ZERO_PAGE in their paging_init() */