From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 73A881A1DFF for ; Mon, 17 Oct 2016 01:33:36 -0700 (PDT) Received: by mail-qt0-x22e.google.com with SMTP id m5so108911414qtb.3 for ; Mon, 17 Oct 2016 01:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yAc3n2Hl4H8ASZqWtH53JcyJv7UBWz6es0l8hqcNykM=; b=fvNYfDe9VnXiuxQQOwHVheyWciojMYyu8uI1ecmRgrYr9RhD/BO61UnqMyXPjasf08 qFqgb2yR4r5NZ4amYrI/b0G1udTVeSBdL/8Bc9c2psSRvBh7e0UHmI7sDJfQMdHghRHQ 5u4W9cX317QVpIky/c/92llaivjzNJr6zKAns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yAc3n2Hl4H8ASZqWtH53JcyJv7UBWz6es0l8hqcNykM=; b=eujNjGUIDGptPBQKB9psE0Qal6vIbaqcvX3p4crHxwFblf8QiyNbPQ+PsZWkcNWOi+ ShMtbzDQIb/XXTlXueEwx2OoIa8wAzlSJo+8Ccz6/Gy7EgcTIeZPifKB8kTHuzu+hRbt zeyW58OYbT2jSMrmWiP5uiH6PA0awp9AWuwImJV3IW3r/GeHXQSRY6BaJqBR0nAp8QVm SRM7z+rRd1FWQaqHDAGawlTfd087WfBWSO68qg/T9pOWnsqkbfmv5Eea4mdKHDD8/a3I z0TjuD679/gr3VVEt2eReWzWWn54LPR0HPUldJMb7ZJIEW+Cje4zNbivoHlXxkY5Sn4L wXzA== X-Gm-Message-State: AA6/9RlYcph/I4WWPUNGwOmzJ/jkbaZBL4rrTFWBkp6HLU/DMpnPHwJj9qmJ+woAzUCdfkHq X-Received: by 10.28.167.214 with SMTP id q205mr7292134wme.21.1476693215564; Mon, 17 Oct 2016 01:33:35 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id v3sm51214827wjm.4.2016.10.17.01.33.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 01:33:34 -0700 (PDT) Date: Mon, 17 Oct 2016 09:33:33 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: Dennis Chen , edk2-devel-01 Message-ID: <20161017083333.GU3471@bivouac.eciton.net> References: <1476680593-4961-1-git-send-email-dennis.chen@arm.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH] ArmPkg ArmVirtPkg: fix the GIC base address variables as 64-bit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:33:36 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 17, 2016 at 08:28:50AM +0100, Ard Biesheuvel wrote: > > diff --git a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > > index 64afc4d..16683ef 100644 > > --- a/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > > +++ b/ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.c > > @@ -79,11 +79,11 @@ ArmVirtGicArchLibConstructor ( > > > > // RegProp[0..1] == { GICD base, GICD size } > > DistBase = SwapBytes64 (Reg[0]); > > - ASSERT (DistBase < MAX_UINT32); > > + ASSERT (DistBase < MAX_UINT64); > > > > This becomes equivalent to 'DistBase != MAX_UINT64' given that a > UINT64 cannot exceed MAX_UINT64. That is a nonsensical thing to > assert, so it is better to simply drop it Random thought: Could we keep the assert(s) and change the test to MAX_UINTN, to have a sanity test over whether a 32-bit plaform ends up with a duff address? / Leif > > // RegProp[2..3] == { GICR base, GICR size } > > RedistBase = SwapBytes64 (Reg[2]); > > - ASSERT (RedistBase < MAX_UINT32); > > + ASSERT (RedistBase < MAX_UINT64); > > > > Likewise > > > PcdSet64 (PcdGicDistributorBase, DistBase); > > PcdSet64 (PcdGicRedistributorsBase, RedistBase); > > @@ -117,8 +117,8 @@ ArmVirtGicArchLibConstructor ( > > > > DistBase = SwapBytes64 (Reg[0]); > > CpuBase = SwapBytes64 (Reg[2]); > > - ASSERT (DistBase < MAX_UINT32); > > - ASSERT (CpuBase < MAX_UINT32); > > + ASSERT (DistBase < MAX_UINT64); > > + ASSERT (CpuBase < MAX_UINT64); > > > > Likewise > > > PcdSet64 (PcdGicDistributorBase, DistBase); > > PcdSet64 (PcdGicInterruptInterfaceBase, CpuBase); > > -- > > 2.7.4 > >