From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 8CE14803B0 for ; Mon, 13 Mar 2017 03:00:38 -0700 (PDT) Received: by mail-io0-x22b.google.com with SMTP id f84so79376675ioj.0 for ; Mon, 13 Mar 2017 03:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tF0Aj/CZZa5+eI7+scN8CywWBr+1jQvPoS2G/uCylD4=; b=KhhhzqbM1mVkM6Hy/oBLbMRqLfu1jTD3xDZhYqNDDPWluNEDr8DveCwk+L4iR0OpSL N6DjLiMKXRBtZ//VhmQYWq/snkr2L13bkCPR3g7vcn4lfuPizFU650ZAnOIZk3IgKhkO hGnkNUUIn9IfT8uEpucyK7a5Fp3JrlRv5jumQ= 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:content-transfer-encoding; bh=tF0Aj/CZZa5+eI7+scN8CywWBr+1jQvPoS2G/uCylD4=; b=qCI8QeP48fBKbkvvN85Xnpjz5l1mqcuhP+IDKiBHml1TmUBaxah6ePfFwsuy+bSIVW dekw2yrvT2qec095YLQU4HSyB/G/pwc87mx2M7lYEHIejwbEugNvuG+bVrLhLf9KaJCK 1TJombMfOexdOvYTUxW1AaLidQDEccRMYO1OhPek3P4U9LltQGzIjRBkysz3oKHp/ViH cJn3TWZhTUCjjT/+Pe0McE4y76+BUQczBII2T/93Qd50abVOYWHSTTQkmy9R7+whRbCg TZt7bsajSAqhG5FGlcCy5Kd+5OIqWfpmZBNptHCmFy9aa99tZKKqOgGOW98WzVMfwRMK z/gg== X-Gm-Message-State: AMke39lYfmu1YAQGLC657++GlGixOv7n7rm0mxfv5ak2lw2BPmx2Ec2xHXE5Xf5PPj4kp91WT/y8FMe2zmuva8LR X-Received: by 10.107.13.130 with SMTP id 124mr24546647ion.83.1489399237847; Mon, 13 Mar 2017 03:00:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Mon, 13 Mar 2017 03:00:37 -0700 (PDT) In-Reply-To: References: <1489397296-23566-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Mon, 13 Mar 2017 10:00:37 +0000 Message-ID: To: Michael Zimmermann Cc: "edk2-devel@lists.01.org" , Leif Lindholm , Ryan Harkin , Laszlo Ersek Subject: Re: [PATCH] EmbeddedPkg/PrePiLib: allocate code pages for DxeCore 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, 13 Mar 2017 10:00:38 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 13 March 2017 at 09:55, Michael Zimmermann wr= ote: > I had to include because I was getting > this error: > EmbeddedPkg/Library/PrePiLib/PrePiLib.c: In function =E2=80=98AllocateCod= ePages=E2=80=99: > EmbeddedPkg/Library/PrePiLib/PrePiLib.c:59:3: error: implicit > declaration of function =E2=80=98FreePages=E2=80=99 > [-Werror=3Dimplicit-function-declaration] > FreePages (Alloc, Pages); > > Other than that it works great(you can take this as a Tested-By). Thanks! > Sry if it's a stupid question because I didn't look into all of the > protection code yet, but wouldn't this mark everything as > Code(including Data)? It will mark the entire DxeCore PE/COFF image read-write-execute. Later on, if the sections are sufficiently aligned, it will remove write permissions from the PE/COFF text section and remove executable permissions from the PE/COFF data section. If the sections are not sufficiently aligned, it will leave the entire region as RWX.