From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::344; helo=mail-wm1-x344.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 5381321BADAB2 for ; Mon, 14 Jan 2019 03:43:14 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id f188so8484643wmf.5 for ; Mon, 14 Jan 2019 03:43:14 -0800 (PST) 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=P4P9S7o7t482pGQjgpuCccD2Rdt2xEocqjQXNCyKEQY=; b=ZDr0gQFSb8v2nxMs3KZdV3hsa6W4gYpT1nOgJEB0leK6pa3SGCAYXb3dVMMlBNTvT0 OaFjZpGiXCp1nhTc5jhN8xZxyBnh7ReVFCv2y49UYGgeKV80r+pl0N1Cf1gPWkN0fvrt RJNWbdFRWTVopi/4UQvZcW2Mcal9rH5n0gNc0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=P4P9S7o7t482pGQjgpuCccD2Rdt2xEocqjQXNCyKEQY=; b=nlTVoq5NS3UQaxOg+pMe///PZ44e9agLuswRpdwt3UtBTfIen0g5xErwxfggnMwBOL WVeN8OkD/e5bcSW/xTwWp+X50QH762RWnOfK4OgI+JG/asFsDlSxxZvZxgvxQ5r7qffu x1ZPOrSE881haPf891s5q+cpYXtSOlOEOe3S5QrgKLgFqwMUF6LYhXRrhG5dvoKg9Aod VjTvs711dEIomIQMuldBz4aKd8Zp+uPEYZVfMoE+dOagJDXLrMeF+eGSXn7hKNoikXw4 BeQp3U1YZNdwBgsCXH2tQk4g2JCJkgwSA347QeVxmxEgD2+IulmLsPU9swdXbsFB9yHn sNWw== X-Gm-Message-State: AJcUukcrlWAwZcWJB44FWq4fLRv4EosPxYwi8ABAdEcVx6thYsb9GLZo pk9HRmpqWWy8X9unjUHiukWXhw== X-Google-Smtp-Source: ALg8bN64CVCRU5DphDdldGVCM0EndZyzRPnbU8xiU/nYscW2ENY0Qq/wSdhUweGKTN7hLO2G3GoX2g== X-Received: by 2002:a1c:b456:: with SMTP id d83mr11956097wmf.115.1547466192754; Mon, 14 Jan 2019 03:43:12 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 127sm44461125wmm.45.2019.01.14.03.43.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 03:43:12 -0800 (PST) Date: Mon, 14 Jan 2019 11:43:10 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20190114114310.wsp74zeomthf6ora@bivouac.eciton.net> References: <20190107065649.2003-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20190107065649.2003-1-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH] ArmPkg/ArmMmuLib ARM: disregard high memory when setting permissions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2019 11:43:14 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 07, 2019 at 07:56:49AM +0100, Ard Biesheuvel wrote: > Ignore calls to ArmSetMemoryAttributes () when the region described > is outside of the 32-bit addressable range. This memory is not > mapped in the first place, and the current code does not deal with > the high bits correctly, resulting in hangs. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > index 3b3b20aa9b78..bffab83d4fd0 100644 > --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > @@ -744,6 +744,10 @@ ArmSetMemoryAttributes ( > UINT64 ChunkLength; > BOOLEAN FlushTlbs; > > + if (BaseAddress > (UINT64)MAX_ADDRESS - Length + 1) { > + return EFI_UNSUPPORTED; > + } > + > if (Length == 0) { > return EFI_SUCCESS; > } > -- > 2.20.1 >