From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-x22f.google.com (mail-ua0-x22f.google.com [IPv6:2607:f8b0:400c:c08::22f]) (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 861E5803BD for ; Mon, 20 Mar 2017 04:10:21 -0700 (PDT) Received: by mail-ua0-x22f.google.com with SMTP id 72so73602255uaf.3 for ; Mon, 20 Mar 2017 04:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+09hhwU5pzzrQK28SvTRwSsA/kRhIyeXF87obNHn2XI=; b=t5Sqza1r1I2BbYuQnVrzp4lI2PudqKwIKAkaElIq4zK6LyGmOfI8zEmo9LrMJYkcy0 I2ncrOuqat9klLTda1Pomy4cINbXnsMfPSNU7iqtLpiM8utJhQXmw+uJ6X/r7mIEfOy2 Y6gNvHXPkhvFGA9Z0NSRJKpSlELj5tz8JFcdisLVq82/Ts116a+VF/wrM11qGs2GueIV jiVxzHuXS3RYpUwfWoYJ6dGaFUb3yIWR34p164fyszb2K/DyDGNgypxP/adJQyvnuLVr vXApOymHvcLROINfAk5CJcwzlH8NriBneTiMmqtlU1PhWXLhxPZEPwr9MbEMiuStfc0L F/xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+09hhwU5pzzrQK28SvTRwSsA/kRhIyeXF87obNHn2XI=; b=tKvLn2RQqzUHUHSD8Y2AiErpxAQWPqXXmcJ6voCKZYk7OdBi98ltp0U0d2K4/YkgNe YWdtsY/NQW+quq8bVyUN6Mitt1oqffkmcxBwfS/NUWt7QT9WBq9pvX4daQQfL58mrDOH CHhfPO6KRalpPhdWDpQPjm19TwfFB9BwVASWubRpeyO9FsV+Omu+YJeUPDkkGS62foU5 gjYext2sITgXUsiMH0KxlBAZwXilgLYYigsnG4ZQVz3Gk/IzeGTvAM03brXXuawewmUT 3/5ibIr4PCwvt6DDd0sksQBnycp1+KLRt1jGwuRDAM3koS4oU3TgJXFzpoPTlH/5B83i K39g== X-Gm-Message-State: AFeK/H3nyl1x7SDvbCU8RGx1H3MD3dJqcmFikN63iK95Z48yVLZZrKF2HtSKDp9yN5l4MUZlr+fL1DQYj5/DJA== X-Received: by 10.176.84.13 with SMTP id n13mr1879725uaa.135.1490008220624; Mon, 20 Mar 2017 04:10:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.171.80 with HTTP; Mon, 20 Mar 2017 04:10:20 -0700 (PDT) In-Reply-To: References: From: Michael Zimmermann Date: Mon, 20 Mar 2017 12:10:20 +0100 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Ard Biesheuvel Subject: Re: SetMemorySpaceAttributes with EFI_MEMORY_XP X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2017 11:10:21 -0000 Content-Type: text/plain; charset=UTF-8 > but then (I think) the DXE_CORE must have set the same bit in the "supported" bitmask too, when the memory was added. that's the point, if my port behaves the same as ArmVirt, it doesn't. for all memory, capabilities are 8000000000000008 and attributes are 0000000000000000 for unused memory and 0000000000000008 for used memory. This seems to confirm what Ard said about the GCD not being altered for NX permissions. Thanks Michael On Mon, Mar 20, 2017 at 12:06 PM, Laszlo Ersek wrote: > On 03/20/17 11:32, Michael Zimmermann wrote: >> Hi, >> >> I didn't test ArmVirtQemuKernel but I'm trying to use some of the code >> for another platform. >> So does this call ever succeed with PcdDxeNxMemoryProtectionPolicy >> being enabled? >> https://github.com/tianocore/edk2/blob/76874be3d411bf8daac051718e20932e0bf97d70/ArmVirtPkg/HighMemDxe/HighMemDxe.c#L95 >> Status = gDS->SetMemorySpaceAttributes (CurBase, CurSize, Attributes); >> >> Neither the memory that was added by this Dxe nor the one added >> automatically by GCD has the EFI_MEMORY_XP capability which causes >> SetMemorySpaceAttributes to return EFI_UNSUPPORTED. > > See commit 413edd470932 ("ArmVirtPkg/HighMemDxe: preserve non-exec > permissions on newly added regions", 2017-02-28). EFI_MEMORY_XP is only > requested if EfiConventionalMemory's bit is set in > PcdDxeNxMemoryProtectionPolicy, but then (I think) the DXE_CORE must > have set the same bit in the "supported" bitmask too, when the memory > was added. > > Thanks > Laszlo >