From nobody Fri Nov 29 18:43:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1632383048; cv=none; d=zohomail.com; s=zohoarc; b=f0715BcrJnHIX76lWnnT2qX5kagle645O2WfdsRGMkD8HiJhHRI4cBvZBa7rXnzVKNrXUULIFP2GKr4U2mC6uITlia7jmmwpRYdeLTcc9opsdcSVCgUC39LSlpNp1nPnWdBCwSWtXdQd1viximD57ITM7+k/+47Nu2I22mOTyj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632383048; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=50WKWg0QVg2XKrZsOyYgqolyS73RGVick6G3Z4q2Xag=; b=c5/hQs7a96TUyF9Kx+j5wL7ngYlsVqmdsOs6UVlvD/5rxJJT183n8M2XBeYdONkaBbFBkWSd1ch8aHI9ogXWuShSrEkNCVYpTW29PpNiEkcsmk+bAhzxBJFuxRTSrYaqQS8+9t0sbZp3fQZQzieofNYoSlKdDISyaau8FU+6OJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1632383048067456.07652082931713; Thu, 23 Sep 2021 00:44:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.193445.344561 (Exim 4.92) (envelope-from ) id 1mTJOb-0004ny-Dc; Thu, 23 Sep 2021 07:43:53 +0000 Received: by outflank-mailman (output) from mailman id 193445.344561; Thu, 23 Sep 2021 07:43:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTJOb-0004np-AY; Thu, 23 Sep 2021 07:43:53 +0000 Received: by outflank-mailman (input) for mailman id 193445; Thu, 23 Sep 2021 07:43:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTJOa-0004n9-CZ for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 07:43:52 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id abdc063d-89e2-4baf-8c07-42e417cee739; Thu, 23 Sep 2021 07:43:51 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E807D61038; Thu, 23 Sep 2021 07:43:45 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: abdc063d-89e2-4baf-8c07-42e417cee739 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632383031; bh=ISUQEAeabD8TFuzFwCipkjqJm558AV8oII+raBjMcR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qp4PlSy1I2qLdHfiL+6LZq+DtUAW0BZNW8wWana91BkCU23YNyluYXPn3qRTLPtZv nKeiyUiksdKxzzSpxVSgam85AgBf4/Oi9IBa05SDCS8Vhd7zIdAhFgm+m6hDjh46y+ zgSAUfDAyTkvZojIS/HqTJ8bHsBPWFPJqCUkPfRiYtndeE5czEFfrL7O0vHSE7G8ps raokz57MNdzvGevCOJ7eHnUIMwrQwINX3LVGYRMX+O8ir8PikcZnvpGJvgoQZnchBJ rPqRejbi67XM5nP4AeGEbzjUVLZdJqRjdH9jyG3N+kSrB2M0hOUOUOmwRt0L5pnKJd hgPAAvvP+k1Gw== From: Mike Rapoport To: Linus Torvalds Cc: Andrew Morton , devicetree@vger.kernel.org, iommu@lists.linux-foundation.org, kasan-dev@googlegroups.com, kvm@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, Mike Rapoport Subject: [PATCH 1/3] arch_numa: simplify numa_distance allocation Date: Thu, 23 Sep 2021 10:43:33 +0300 Message-Id: <20210923074335.12583-2-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210923074335.12583-1-rppt@kernel.org> References: <20210923074335.12583-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1632383050435100001 Content-Type: text/plain; charset="utf-8" From: Mike Rapoport Memory allocation of numa_distance uses memblock_phys_alloc_range() without actual range limits, converts the returned physical address to virtual and then only uses the virtual address for further initialization. Simplify this by replacing memblock_phys_alloc_range() with memblock_alloc(). Signed-off-by: Mike Rapoport --- drivers/base/arch_numa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c index 00fb4120a5b3..f6d0efd01188 100644 --- a/drivers/base/arch_numa.c +++ b/drivers/base/arch_numa.c @@ -275,15 +275,13 @@ void __init numa_free_distance(void) static int __init numa_alloc_distance(void) { size_t size; - u64 phys; int i, j; =20 size =3D nr_node_ids * nr_node_ids * sizeof(numa_distance[0]); - phys =3D memblock_phys_alloc_range(size, PAGE_SIZE, 0, PFN_PHYS(max_pfn)); - if (WARN_ON(!phys)) + numa_distance =3D memblock_alloc(size, PAGE_SIZE); + if (WARN_ON(!numa_distance)) return -ENOMEM; =20 - numa_distance =3D __va(phys); numa_distance_cnt =3D nr_node_ids; =20 /* fill with the default distances */ --=20 2.28.0