From patchwork Thu Oct 25 01:27:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 149509 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp715460ljp; Wed, 24 Oct 2018 18:28:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5efYeJ/TsipYyw5UuS5iV+3k2f28tfrb5NFc2DGwZQ2ZvEeUyV00ITGn9eu6omul+57CXjc X-Received: by 2002:a62:6bc9:: with SMTP id g192-v6mr4836180pfc.232.1540430879941; Wed, 24 Oct 2018 18:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540430879; cv=none; d=google.com; s=arc-20160816; b=n8b/Ddg1Rt8uNk0u9LYfxytcdu+dgL0IplN6SL0NuNHhzZk76KYL8Y88AIaGv3S/7d ziyT9R6I0AOQ8C/IwdP1Ut4+S9Eh2uhC8dAhyx9FCQIzietoymOSeH/TQhReRkhsWicw zJ/a+jslUt6N0jR164CYGBWqDl/h7QhOjvTgaisNWF06WXH/pN4dfvFO+oqQ5OFmYdKF eu8nD1BwZ4wE2cEhD7ut4o8YKP+AS4iQLdu1PxoWdVFzGc8s2pXNhARuykNU3SyppyEg wtcuAYFwf8Z/G2sG9giMs6UXp/BkoZa2CSfyfXVo5KVtpuZgjJEsLkN4CnhTv/cgmKNI DUNA== 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=UNa/t9rRC91BV1dr6X2f7W55SSKjZ97xlXgIrbqUXUI=; b=nqFN0UVtukl94HCXqxnrTlKc00ONYCdHDSRUSeYJxe0ki+DzJf2SCh4jlsxvpzoeoO NKt9n0lkB1YddlrNukoVR80MhPrjZK15gh/0A7VhrpVMkDA6lFllQ33YTL/unmyZ+DlD LEKITmThUj+EsLmBXi6i1i7ZqHF5rAc5JjT9QDLCNmm7qIUzLjJMnWWLn3+bBj5tA5La OZbcgoe4oMK1AfiQEoX6p1rShJ6FpQfAYvDh819tnVaT3A2FTeMUriwZAvVszmWr7MMm iYfORTUqyh3cc9Hqx9FuKZviYJLVcpK2FsfbK1CFTBTIDP/cfxh7ve2+XxfWFHk6SlSz XjhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czusButT; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y21-v6si6402185pga.361.2018.10.24.18.27.59; Wed, 24 Oct 2018 18:27:59 -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=@linaro.org header.s=google header.b=czusButT; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727063AbeJYJ60 (ORCPT + 32 others); Thu, 25 Oct 2018 05:58:26 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43757 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbeJYJ6Z (ORCPT ); Thu, 25 Oct 2018 05:58:25 -0400 Received: by mail-qt1-f196.google.com with SMTP id q41-v6so7991416qtq.10 for ; Wed, 24 Oct 2018 18:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UNa/t9rRC91BV1dr6X2f7W55SSKjZ97xlXgIrbqUXUI=; b=czusButTMN/uNzZZ34Q/SnvIXJTZGsPDvsZkvMWCP06ciWNUUewL2u+Mk4gIEK+5pS Jl69asx44T/guF4j9st0f8xCtIaf2J2Zen6gezzkS9bNTT3KYA104atxfbmjv2KTPVpz AB79j5x8+322Hkx+uqUzAddml6RAuZkfiErss= 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=UNa/t9rRC91BV1dr6X2f7W55SSKjZ97xlXgIrbqUXUI=; b=WzHcXPvQCk9r9yo56dDJ8/WCbf8r5J+W4MmgMoMIGZIbTJgVRcrFNVNEodxUXERJRr h1s7CXbdQJXtnMyKl/PQ2ErPSgCKP42sbUeE2sW3DPX6s8DzKqq+DNJu2QCONaiSmRvK 5ZyY5c6DncU0ZX692cHpz6H/Jt/VHO73dcAq1ufEFfYRJwJAiu0UNO/e236jfCajpv0Q il/6EnNh+/ZgpkIYxBeenYXRnyyI0TjXWK788lpp25+dZSq9ZPTKPClojV1kqCzuMlR1 LG/g7r0AM9/0acE+YlkDu12fdBwPfo4yh2XoNzYaQopTEA/hhyNyTMYN0+ls0sZ4LBaA uFUg== X-Gm-Message-State: AGRZ1gL/kWpm6da7DqnUKh73t4A7BjZFbWU7gLr9s/saWbG5thkqVGLA HsQ6tix5UCSgg/S7ZwgFQHaIxdesuqMbwA== X-Received: by 2002:aed:2554:: with SMTP id w20-v6mr4736913qtc.183.1540430876020; Wed, 24 Oct 2018 18:27:56 -0700 (PDT) Received: from workstation.celeiro.br ([138.204.25.17]) by smtp.gmail.com with ESMTPSA id m6-v6sm5338994qta.50.2018.10.24.18.27.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 18:27:54 -0700 (PDT) From: Rafael David Tinoco To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Rafael David Tinoco , Russell King , Mark Brown , Sergey Senozhatsky , Nitin Gupta , Minchan Kim Subject: [PATCH 2/2] mm/zsmalloc.c: fix zsmalloc ARM LPAE support Date: Wed, 24 Oct 2018 22:27:45 -0300 Message-Id: <20181025012745.20884-2-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181025012745.20884-1-rafael.tinoco@linaro.org> References: <20181025012745.20884-1-rafael.tinoco@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 02390b87a945 ("mm/zsmalloc: Prepare to variable MAX_PHYSMEM_BITS"), an architecture has to define this value in order to guarantee that zsmalloc will be able to encode and decode the obj value properly. Similar to that change, this one sets the value for ARM LPAE, fixing a possible null-ptr-deref in zs_map_object() when using ARM LPAE and HIGHMEM pages located above the 4GB watermark. Link: https://bugs.linaro.org/show_bug.cgi?id=3765#c17 Signed-off-by: Rafael David Tinoco --- arch/arm/include/asm/pgtable-3level-types.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.19.1 diff --git a/arch/arm/include/asm/pgtable-3level-types.h b/arch/arm/include/asm/pgtable-3level-types.h index 921aa30259c4..bd4994f98700 100644 --- a/arch/arm/include/asm/pgtable-3level-types.h +++ b/arch/arm/include/asm/pgtable-3level-types.h @@ -67,4 +67,6 @@ typedef pteval_t pgprot_t; #endif /* STRICT_MM_TYPECHECKS */ +#define MAX_POSSIBLE_PHYSMEM_BITS 36 + #endif /* _ASM_PGTABLE_3LEVEL_TYPES_H */