public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: jon@solid-run.com
To: devel@edk2.groups.io
Subject: Question regarding MMIO address space exposed from GetMemoryMap
Date: Thu, 31 Oct 2019 09:32:40 +0100	[thread overview]
Message-ID: <CABdtJHv09tLVz_krQRthhOjw4eL3zKtqBWPbCmSKNnRABC-EoQ@mail.gmail.com> (raw)

I am working on sorting out a failure on test 605 of the SBSA test.
The test is "Where a memory access is to an unpopulated part of the
addressable memory space, accesses must be terminated in a manner that
is presented to the PE as either a precise Data Abort or that causes a
system error interrupt or an SPI or LPI interrupt to be delivered to
the GIC."  The issue is that the random test address that was chosen
0x04200000 falls directly in the middle of the Qoriq configuration,
control, and status register (CCSR) address space.  This is an area in
the memory space that provides CPU access to the device registers.

An entry is added for this region in the VirtualMemoryMap, and
registered with the attribute, ARM_MEMORY_REGION_ATTRIBUTE_DEVICE.
However only a handful of devices are being registered so only a
couple of ranges are showing up in memmap as MMIO.

The SBSA test in question gets the memorymap and starts at the address
mentioned above and looks for the first chunk of memory that is free
and then attempts to access the memory and is looking for a Data
Abort.  Of course a data abort is not generated because 0x04200000 is
a valid address.  If you offset this to 0x42000000 then a DA is
generated as expected and the test passes.

There is a very old thread started by Ard, "MMIO regions in
GetMemoryMap ()", in which he questions if all the MMIO regions should
be reported by GetMemoryMap() or only the ones being used by
initialized devices, which is what the current implementation does.
The end result of the thread was the current implementation is
correct.  That leaves me with the question, "What is the proper
solution for the current implementation that I am working with?"

To me it seems like I need a special Library that on boot goes through
and claims and maps every valid MMIO slot in this region, and then
have the drivers use this library for proxying requests to
gDS->AddMemorySpace (), gDS->SetMemorySpaceAttributes () etc.   If
there is a standardized way to deal with this configuration I would
much rather follow that.

Thanks for any input,
Jon

             reply	other threads:[~2019-10-31  8:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31  8:32 jon [this message]
2019-10-31 16:43 ` [edk2-devel] Question regarding MMIO address space exposed from GetMemoryMap Andrew Fish
2019-11-01  5:56   ` Jon Nettleton
     [not found]   ` <15D2F44E3D791472.7420@groups.io>
2019-11-01  8:40     ` Jon Nettleton

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=CABdtJHv09tLVz_krQRthhOjw4eL3zKtqBWPbCmSKNnRABC-EoQ@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