From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EBCB8803BD for ; Mon, 20 Mar 2017 04:06:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63A096AADD; Mon, 20 Mar 2017 11:06:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 63A096AADD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 63A096AADD Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-55.phx2.redhat.com [10.3.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9583B5C88E; Mon, 20 Mar 2017 11:06:07 +0000 (UTC) To: Michael Zimmermann , edk2-devel-01 , Ard Biesheuvel References: From: Laszlo Ersek Message-ID: Date: Mon, 20 Mar 2017 12:06:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 20 Mar 2017 11:06:08 +0000 (UTC) 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:06:08 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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