public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
To: edk2-devel@lists.01.org
Subject: Creating of a memory hole in System memory
Date: Wed, 10 May 2017 11:08:38 -0700	[thread overview]
Message-ID: <844bc68624ecf4bf1fc456189efbeb1f@mail.gmail.com> (raw)

Hello,

I need to reserve an area in the System memory, which should be
write-protected, so that neither UEFI nor Linux could write anything into
it.
If it matters, the platform is ARMv8 64-bit.
I have DDR RAM starting from 0x80000000 with size 0x80000000, and need to
carve out an area of 0x100000 at address 0x8f000000 which UEFI should not
touch.
What is the proper way of doing that? I tried creating of a reserved memory
HOB using this:
    BuildResourceDescriptorHob (
      MemType,
      ResourceAttributes,
      Address,
      MemSize);
Where ResourceAttributes are
    EFI_RESOURCE_ATTRIBUTE_PRESENT            | \
    EFI_RESOURCE_ATTRIBUTE_INITIALIZED        | \
    EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE        | \
    EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE  | \
    EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED    | \
    EFI_RESOURCE_ATTRIBUTE_TESTED

Before that, I declared System memory 0x80000000 with size 0x80000000 with
DDR_ATTRIBUTES_CACHED for ARM Virtual memory map.
MemoryInitPei (ArmPlatformPkg)  builds a Memory HOB for region 0x80000000,
with size 0x80000000.
Eventually in the DxeCore in CoreInitializeGcdService() I run into an
ASSERT:

ASSERT [DxeCore] /uefi/MdeModulePkg/Core/Dxe/Gcd/Gcd.c(2467):
(Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) ||
(Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable)

ASSERT ((Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) ||
            (Descriptor.GcdMemoryType == EfiGcdMemoryTypeMoreReliable));

with GcdMemoryType EfiGcdMemoryTypeNonExistent for Descriptor (BaseAddress:
0x8f100000, length 0x7f0f00000).

Please help me to figure out what I am doing wrong.

Thank you,
Vladimir


                 reply	other threads:[~2017-05-10 18:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=844bc68624ecf4bf1fc456189efbeb1f@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox