Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4825141pxu; Wed, 21 Oct 2020 06:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHHv+3MhVXnyG0kvLfLJULy+xx0E5fgjj47cEqYx63YAwwZXaeM9/gljXCellpyEE3+D54 X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr3086727edy.273.1603286558636; Wed, 21 Oct 2020 06:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603286558; cv=none; d=google.com; s=arc-20160816; b=mxBwfwWzMRKJqT3xpFCvtn9Z1hUWS46CFjAlUdnAyjQnclBjZQpbYY2DDhuqqKJEZn Tjez2ruCzXOu9K3P+a1OkQTRNMjoaJqIGIOozgNQ600uXSo+yh2BP/crczttZVJQkyH+ HLJ/GmjE2CbT4+dS9kRGgfhnZ1GK0zBu5Cl78lAS0Hmt321TgZ7GnKSH5gOFRtCdUpIM ZEh2PAPOv2eMB0JH5uaol6detp/U7ENT0whaL8fnlVeo7igKfdvey0cNZW7LYUBj+9kt z/hmswQwq2tJ1/F6TN14qB3g9AfpY4K+dhpw135sN/lP8hj+vsf07OhgnBkUUcmc5oVa 31Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:dkim-signature; bh=0uunYDarLOCJQZDPzFnBlNCfPwBebHlyjXfwWLNZ7OI=; b=kZiJli9BtZf5D5aWxgyhoJJaw0SoNTNF8uYk4f1FFGdlaCe+Y7qpxA0VSwDOpuketM YMsgQCFFfQjcauQxPjsZsboxK2RkDEq7aMe8xpXjbNsopCbW/aAAsPcP0OhPHu77satK FJJiZHo8cKFsKVqFtBh+jC5w+v5646Goj04UHCPeVcslLgN7eVnmRkDhvneh1Y+lufh5 F+0g7gkDbzKfvihnySsQ/0kzNgYwdOYUAZwOiX1YpPKgtvqSkVXA6hEkjXbdxhcpbuOQ eCvfhk7MhobqFOlzj1vKuLNvYU8BZVJeAFw8qcCXspMR0iPv/droVj/nYRsLrsiIiUbE z52g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=RW+g6QTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o21si1356519ejx.13.2020.10.21.06.22.16; Wed, 21 Oct 2020 06:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=RW+g6QTH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438418AbgJUJ6X (ORCPT + 99 others); Wed, 21 Oct 2020 05:58:23 -0400 Received: from smtp2.axis.com ([195.60.68.18]:2804 "EHLO smtp2.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438399AbgJUJ6W (ORCPT ); Wed, 21 Oct 2020 05:58:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; l=1614; q=dns/txt; s=axis-central1; t=1603274302; x=1634810302; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=0uunYDarLOCJQZDPzFnBlNCfPwBebHlyjXfwWLNZ7OI=; b=RW+g6QTHNS1SONtKPLNRev6bD/KX3Yh2Rld7xF59CtbjAYr9D2PHsIFR 6YtE8NrIwm9bHTy7tqAyUHoLnfdfIHdGo7UkuW15XLU/iTg5rFUve7+Pi gXrQ4d+j4MirRqA7kJPx5jfm0/tyco8zHr5xptGYJvRo8+rVD5UoXrj4j sTFXEx3O09wPYSBGnq99SaOL7f04TJDl5LBhGAnrkXQRIaQG2VasQSM9E GWaycAbxjg2grzOE3RtWJwnFC1ozIgEH9l1XB29PazpipTYvMVPjAYgUR e+X/8LwaMU8HB18w9p8CW6LvLGS1GlvbCSAFI50UapgqkwVUPKh9boKMa A==; IronPort-SDR: nYtZPDdCJr/zt644280jfPTyAlH8CnViDMCXXT1IT8lWHG3AWvXTfddGXf0rVQLU3z3r7xsjQI DNaOLhdKuW1NwONjVFoiv2OP817H6hij+lfZVsVDPYFr+koVodZtLvOwdQTTcdsmWFh3WQsWvi q1BxWLFgXIdjIEjtE5v7ONYbEGUaT359iTVgZ6tgLAOp+7QcuvnVqGnb0A+Fvvqf39fy2Xl7xz lRGa+efHe31sXwSZbrkCZEmuIqsEUi2wt15W9POCAjOppufLUI3QVLKeQm1n5XAI4pF2dV2p4b M8A= X-IronPort-AV: E=Sophos;i="5.77,401,1596492000"; d="scan'208";a="13744378" Date: Wed, 21 Oct 2020 11:58:20 +0200 From: Vincent Whitchurch To: Rob Herring CC: Frank Rowand , kernel , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] of: Fix reserved-memory overlap detection Message-ID: <20201021095820.fe2u5cecxtkupqko@axis.com> References: <20201020073558.3582-1-vincent.whitchurch@axis.com> <20201020134633.3vv7hyvodg4tbro2@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 04:17:27PM +0200, Rob Herring wrote: > On Tue, Oct 20, 2020 at 8:46 AM Vincent Whitchurch > wrote: > > On Tue, Oct 20, 2020 at 03:00:14PM +0200, Rob Herring wrote: > > > On Tue, Oct 20, 2020 at 2:36 AM Vincent Whitchurch > > > wrote: > > > > > > > > The reserved-memory overlap detection code fails to detect overlaps if > > > > either of the regions starts at address 0x0. For some reason the code > > > > explicitly checks for and ignores such regions, but this check looks > > > > invalid. Remove the check and fix this detection. > > > > > > Wouldn't 'base' be 0 for nodes that have a 'size' and no address? The > > > base in those cases isn't set until later when > > > __reserved_mem_alloc_size() is called. > > > > Ah, yes, I guess that's why the check was there. I see that those > > entries have both a zero address and a zero size, so this seems to work: > > Yes, I think it should work. Thanks, I've tested it a bit more and sent it out as a v2 now. > > diff --git a/arch/arm/boot/dts/vexpress-v2p-ca9.dts b/arch/arm/boot/dts/vexpress-v2p-ca9.dts > > index 623246f37448..6627e71c7283 100644 > > --- a/arch/arm/boot/dts/vexpress-v2p-ca9.dts > > +++ b/arch/arm/boot/dts/vexpress-v2p-ca9.dts > > @@ -81,6 +81,18 @@ vram: vram@4c000000 { > > reg = <0x4c000000 0x00800000>; > > no-map; > > }; > > + > > + foo@0 { > > + reg = <0x0 0x2000>; > > + }; > > + > > + bar@1000 { > > + reg = <0x0 0x1000>; > > 0x1000 base? I've corrected this in the example in the commit message for v2.