Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2575518ybc; Wed, 13 Nov 2019 17:12:11 -0800 (PST) X-Google-Smtp-Source: APXvYqybPOtDm0H2zTK/KIUcx1P0qjfjEfNoyv5LjfacWFiCnqh2NTpa5oOENzeszBEn7hNIQ6OQ X-Received: by 2002:a50:fc1a:: with SMTP id i26mr7327470edr.9.1573693931144; Wed, 13 Nov 2019 17:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573693931; cv=none; d=google.com; s=arc-20160816; b=YRgUKEWHXE+WcuWEuQ/ru+YCJOYOxEWdvGRXWGKazjFxKjV2cYJZkEyHa0GqOqsUfY O5Qk0ZfV/sq7afx4MEBvowkizzb1NgbHt6DFGnNsxRBk6oxr5X+5XBlDVy+eMMKiEDgo 5NOdcq4OX18OYRFeADW/x6JXgr5cwPgI+KBEkvh3XGarxIbKVqyDtSk42B5ByRJ2F5oZ 0TruuGU1YJSMUaaxvDmbQuQ9ma8pfoCUnWMxDgHBOO35lmTW9EX24JPq7Xm0JDbQXikJ P8H4TPXU3ONzooBeDhfMQxP7kqCCqYueLMZgZl7GKj58VYpNlUq8FhOXvDFhfzUeaMFS 2msA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=wBQHB2EzlG/RSRWYzzXHGHn7Pgw3gzypxOnIpXuT5fc=; b=ijW6v1KFyvPeYiV2aPHdnuoak/n+FJAda8vToKKH5WiwMisbNsqaRV0rTlIJ7n1U2U mV+5yC/FqNxbK/Yjf59X01DvS6NcmuyD59a7NBLCTDHLWx0GVde4D6QlqLc18Q4Su4Bt dzvYU4PLYVTSxqq6zHtBVTuYGvRXNZrZw1JvRrMK7OYLDT+r7lRQzLjwNTk9Ff286HGz MsN/psQYuQ1uKXUOcYX/Ae07kqZaDDzHP34bd+1wVZgOK2IDQBsm6OJCsy5oQLOeQBnN AKM+uOM3d/r9+9nvJ8HUIHX4sKkD3SJ7HJ4ncVtyxkyHKDkDD7BINRwr/tPktQVIN5j9 N6Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dLdhF2Pz; 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 ci3si2083896ejb.37.2019.11.13.17.11.45; Wed, 13 Nov 2019 17:12:11 -0800 (PST) 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=dLdhF2Pz; 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 S1726597AbfKNBIq (ORCPT + 99 others); Wed, 13 Nov 2019 20:08:46 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:44604 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbfKNBIq (ORCPT ); Wed, 13 Nov 2019 20:08:46 -0500 Received: by mail-lf1-f66.google.com with SMTP id z188so3516960lfa.11; Wed, 13 Nov 2019 17:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wBQHB2EzlG/RSRWYzzXHGHn7Pgw3gzypxOnIpXuT5fc=; b=dLdhF2PzyQ/jFoL4zrJ4qhDA2R7hCREOwWVwawyuVHALBhJHtbEXnCQz1uUxkzTNLq wCyutaWHNPjDEhXkiQn8T65OcpDyFgntNJWyA9noEO11ZSotKuO8nD+93Q+0PS/BMbYD JF+fT85rjf2Z0MQfsES+fuUDd5zXynLC9SCN8gKCYXwzdfNUnQRZNJLTgOch7duW1qyU 6X31e2ITWOiWXpzgnOrTxuO9KfNtX7z6XWxKSt17khUaC/c68B05BjDz5rhqOdIUuXHy ZOY9HXj8XNP4Ox8HFRpuAZaoE/ALG4L6YOVT7bqNFoE0bxAJ/IiJeUggbYcKtM4roz5S pw2A== 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:mime-version :content-transfer-encoding; bh=wBQHB2EzlG/RSRWYzzXHGHn7Pgw3gzypxOnIpXuT5fc=; b=pEQ9AsWrOo5q89uX/8rtrqgwemvp8sPJhOgO5NX8XvhVrBUlUEJXB33SDX0ixVH4dY Vv27gFxURPeWV9o4JXhYf69arYGRrMtf4z7E9osULssEyd3mHyBBy623NE3LTp1X/VCr kT6xXHQAb7J3wecFfaaY+FCwG8PhZAMcYkMVGyISXE/RSkS0I7WxJlllriGPjBe6TPl+ +coKehksw7DGhaoZTxTqp1ytODRyFtotiFhSuhkf7ELzXFK1u6yaNE0wmW6PYwhmaIAv sdzE4ltObhsuka2Pl/1rjVAetkbwXzRuX+esqkaPONhI01s1/uPbvK8EtktbxcCPn7l8 yUHw== X-Gm-Message-State: APjAAAU1DcTJW71IssO3gVJ5NMUzCEspRRd6mLAI85Ze1Phu5TAOefgR kIE0uD8Z1QSfzZ6yHGa/pEY= X-Received: by 2002:a19:ee17:: with SMTP id g23mr4590004lfb.121.1573693723677; Wed, 13 Nov 2019 17:08:43 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id b14sm1726678lfa.14.2019.11.13.17.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 17:08:43 -0800 (PST) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , Mike Rapoport , linux-kernel@vger.kernel.org, Max Filippov , stable@vger.kernel.org Subject: [PATCH] xtensa: use MEMBLOCK_ALLOC_ANYWHERE for KASAN shadow map Date: Wed, 13 Nov 2019 17:08:24 -0800 Message-Id: <20191114010824.29540-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KASAN shadow map doesn't need to be accessible through the linear kernel mapping, allocate its pages with MEMBLOCK_ALLOC_ANYWHERE so that high memory can be used. This frees up to ~100MB of low memory on xtensa configurations with KASAN and high memory. Cc: stable@vger.kernel.org # v5.1+ Fixes: f240ec09bb8a ("memblock: replace memblock_alloc_base(ANYWHERE) with memblock_phys_alloc") Signed-off-by: Max Filippov --- arch/xtensa/mm/kasan_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/mm/kasan_init.c b/arch/xtensa/mm/kasan_init.c index 9c957791bb33..e3baa21ff24c 100644 --- a/arch/xtensa/mm/kasan_init.c +++ b/arch/xtensa/mm/kasan_init.c @@ -60,7 +60,9 @@ static void __init populate(void *start, void *end) for (k = 0; k < PTRS_PER_PTE; ++k, ++j) { phys_addr_t phys = - memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE); + memblock_phys_alloc_range(PAGE_SIZE, PAGE_SIZE, + 0, + MEMBLOCK_ALLOC_ANYWHERE); if (!phys) panic("Failed to allocate page table page\n"); -- 2.20.1