From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d43; helo=mail-io1-xd43.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 61AB321197374 for ; Mon, 14 Jan 2019 10:46:25 -0800 (PST) Received: by mail-io1-xd43.google.com with SMTP id f4so61188ion.2 for ; Mon, 14 Jan 2019 10:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FNpjV3d+NhrrkZEqXLoUrHVaHSNG2AigzX7k+VJycpE=; b=apguKNxLZeMOCxZrT21zLm2Sha+RmE/Acl24lDufYMtmnU75vNzmb/hTuDp+G8qzuV yH01OxhpodxM8dE8uVwjU941SFI+0LTcLn7QXyv3C1tzmtqYAu6wAdRpXghsWz7DUgvA 218cYMz9YNcXE30yR6T4zkWhxzP/KnNCf+2QY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FNpjV3d+NhrrkZEqXLoUrHVaHSNG2AigzX7k+VJycpE=; b=W4U3eC/B8UqX0ZZBPFXv55Zgqpmbug3FguU0U17lFAs85RdqPD6LiJ6Jo8fTtyPIwJ X2P2gRoU/AY3ZxD+fbnlUySj6lahRGz4lUOUPf7EzKzMqsZwefmBZ2/bqajbUShJQIOL 4opVvixR0U75PYk06CbeFBNc/+1vNMEVNtOsQnr42wdsNnY1/lXOru47a95RBtBp69iE 4q0GajFqC6RbSTobpftE0DhLUDycc6wQAMcygL+vzwzZL/x/vcYRGbvz2B1HYA7/s5Qe avYNAAluMDzvwW1XbqFw1Y/BSn9J0pAgVmhVzhI+ZDOSqTUpk4iPv+0/CVNI9yJlEfO7 grXQ== X-Gm-Message-State: AJcUukeTLb9fsk4TfZrXetY112dhI3DdZVgNOysskoz3pSOC1E0NBjFM NrZ8t6b80oJVn3XbMf+tp7/q3JnziovtQac9NGvNtQ== X-Google-Smtp-Source: ALg8bN40iK+lqAsOg0sFhZs1qOqO4i5lQsMFbuA4SRgJW5Ho3dcQq6PU+qW/L5SUZyWnwfuu9wx3CjjLSGL7N1nTAtY= X-Received: by 2002:a5e:c206:: with SMTP id v6mr17864308iop.60.1547491584295; Mon, 14 Jan 2019 10:46:24 -0800 (PST) MIME-Version: 1.0 References: <20190107065649.2003-1-ard.biesheuvel@linaro.org> <20190114114310.wsp74zeomthf6ora@bivouac.eciton.net> In-Reply-To: <20190114114310.wsp74zeomthf6ora@bivouac.eciton.net> From: Ard Biesheuvel Date: Mon, 14 Jan 2019 19:46:13 +0100 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" 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 18:46:25 -0000 Content-Type: text/plain; charset="UTF-8" On Mon, 14 Jan 2019 at 12:43, Leif Lindholm wrote: > > 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 > Thanks Pushed as e695e44545b4..d08575759e5a > > --- > > 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 > >