From patchwork Thu Nov 14 19:37:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 3184961 Return-Path: X-Original-To: patchwork-linux-arm@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 A432D9F3AE for ; Thu, 14 Nov 2013 19:41:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFABD20938 for ; Thu, 14 Nov 2013 19:41:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0F0D206B6 for ; Thu, 14 Nov 2013 19:41:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vh2lk-0007Ki-SK; Thu, 14 Nov 2013 19:40:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vh2l8-0002aw-EG; Thu, 14 Nov 2013 19:39:22 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vh2kO-0002VF-1G for linux-arm-kernel@lists.infradead.org; Thu, 14 Nov 2013 19:38:38 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAEJbqsB026928; Thu, 14 Nov 2013 13:37:52 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAEJbq6D022476; Thu, 14 Nov 2013 13:37:52 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Thu, 14 Nov 2013 13:37:52 -0600 Received: from ula0393909.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAEJblpv012468; Thu, 14 Nov 2013 13:37:51 -0600 From: Santosh Shilimkar To: Subject: [PATCH 3/6] ARM: mm: Drop the lowmem watermark check from virt_addr_valid() Date: Thu, 14 Nov 2013 14:37:43 -0500 Message-ID: <1384457866-16135-4-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1384457866-16135-1-git-send-email-santosh.shilimkar@ti.com> References: <1384457866-16135-1-git-send-email-santosh.shilimkar@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131114_143836_362341_AF41090C X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -6.9 (------) Cc: Russell King , Marc Zyngier , Catalin Marinas , Will Deacon , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Slab allocator can allocate memory beyond the lowmem watermark which can lead to false failure of virt_addr_valid(). So drop the check. The issue was seen with percpu_alloc() in KVM code which was allocating memory beyond lowmem watermark. Am not completly sure whether this is the right fix and if it could impact any other user of virt_addr_valid(). Without this fix as pointed out the KVM init was failing in my testing. Cc: Christoffer Dall Cc: Marc Zyngier Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Santosh Shilimkar --- arch/arm/include/asm/memory.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 4dd2145..412da47 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -343,8 +343,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x) #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) - +#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET) #endif #include