Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2888579ybc; Thu, 14 Nov 2019 00:15:01 -0800 (PST) X-Google-Smtp-Source: APXvYqz7ycX+7G7D4MytP6JwyyQf0jTd2a7KoBR98O/f+yCeLzwyu2vLtQ9tXpVWPp1KiK7BgR2q X-Received: by 2002:a50:fa8a:: with SMTP id w10mr8457216edr.179.1573719300974; Thu, 14 Nov 2019 00:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573719300; cv=none; d=google.com; s=arc-20160816; b=0gPaO4xG7y4iXidX6RCcXaE04rCIq2O2zWS/w4azkDH6AIcRU7Fwj70QrB2ST4apW9 hxjGNOacerOFag0sYKb7STMvSlGE7fSz3tZQSJe9Yw0B5zK69qqqycpjruhPZLIGC9D3 fSTmEBdOmjTtk4DC5NuStyimV6h+GvWgHclYqLPSy0sZ/uJmmBnhcBq41lWAB6yjAi+F 1pSIdTvc6p8B9u2dtmZXz4JiRmH/Vyc6HEq5jKKozW2anvPnt904HXmJPX+8Jkm48ct/ /PrYG02JZeLcIZmxtw4CioUO6VSS3bXj9eLq/qVEBeAuOdOm9zm01pDhMNmD2dhRjCd2 h9Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=J5mNspYilHI0dHmYj9VI44lBNNVkeMCFTITS8HwKM3E=; b=cykPdgd36Ez+EzrHyp/V14rgTEODExvu1fAzLWt8kp3LZU5a6v29U1IDCRjRYFPGcp v08t8/6RE5MD77d4KEAw0XaobW3OlJaZdH7RJ4DXV/807PnRtIr3QtLbgDKbfNzOpCXa x3FpI1dPCmEyrZyXEU2Y3hlR+XSRDx+5wmxNYi9JBwMC1PXd/r5GFHrdXTTzrNPn2P9S 4AGGNq26PnpBMDd0ARpyYq2JhrMcQvszboIAWnbkg9E/8ETrLNa34k0oef97KaX2rh/1 zfjdN9zTc/QXE+UmI93ajBRJ+5wcpbrhcOsNyDWG/EPaTTHsWzxam7NHVAPK8KGKIMHS hebw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si3498176edb.303.2019.11.14.00.14.36; Thu, 14 Nov 2019 00:15:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbfKNILk (ORCPT + 99 others); Thu, 14 Nov 2019 03:11:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:63842 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725920AbfKNILk (ORCPT ); Thu, 14 Nov 2019 03:11:40 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xAE88FFK027488 for ; Thu, 14 Nov 2019 03:11:38 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2w91npjxtj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Nov 2019 03:11:38 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 14 Nov 2019 08:11:36 -0000 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 14 Nov 2019 08:11:34 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAE8AuTk36569358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2019 08:10:56 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EA95252051; Thu, 14 Nov 2019 08:11:32 +0000 (GMT) Received: from linux.ibm.com (unknown [9.148.207.103]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 5609A5204F; Thu, 14 Nov 2019 08:11:31 +0000 (GMT) Date: Thu, 14 Nov 2019 09:11:28 +0100 From: Mike Rapoport To: Max Filippov Cc: linux-xtensa@linux-xtensa.org, Chris Zankel , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] xtensa: use MEMBLOCK_ALLOC_ANYWHERE for KASAN shadow map References: <20191114010824.29540-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191114010824.29540-1-jcmvbkbc@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 19111408-0012-0000-0000-0000036383F2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19111408-0013-0000-0000-0000219EFBE0 Message-Id: <20191114081127.GB13537@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-14_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=831 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911140077 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 13, 2019 at 05:08:24PM -0800, Max Filippov wrote: > 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 Reviewed-by: Mike Rapoport > --- > 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 > -- Sincerely yours, Mike.