public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"kraxel@redhat.com" <kraxel@redhat.com>
Subject: Re: [edk2-devel] mmio mappings for runtime service
Date: Mon, 30 Aug 2021 13:01:33 +0000	[thread overview]
Message-ID: <PH0PR11MB4885C7B6EFEB605A9DC177DD8CCB9@PH0PR11MB4885.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210830102350.z6rhkeebav4mziu2@sirius.home.kraxel.org>

The BIOS driver must set EFI_RUNTIME_MEMORY attribute for the EfiGcdMemoryTypeMemoryMappedIo region with GCD service gDS->SetMemorySpaceAttributes().
Then DXE will report EfiMemoryMappedIO with EFI_RUNTIME_MEMORY attribute in UEFI memory map.
The OS will gBS->GetMemoryMap() and assign virtual address for the MMIO, and gRT->SetVirtualAddressMap() back to the BIOS.

Finally, the BIOS driver can gRT->ConvertPointer() the MMIO physical address to virtual address, then access it at runtime.

Thank you
Yao Jiewen

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd
> Hoffmann
> Sent: Monday, August 30, 2021 6:24 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] mmio mappings for runtime service
> 
>   Hi,
> 
> What is the correct way to make sure runtime services can access
> mmio registers, i.e. that there is a mapping in the page tables
> for the mmio page needed?
> 
> Is that the job of the firmware?
> Or should the OS calling the runtime service handle that?
> In case of the latter: How does the OS figure which pages are needed?
> 
> thanks,
>   Gerd
> 
> 
> 
> 
> 


  reply	other threads:[~2021-08-30 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 10:23 mmio mappings for runtime service Gerd Hoffmann
2021-08-30 13:01 ` Yao, Jiewen [this message]
2021-08-30 16:26   ` [edk2-devel] " Michael D Kinney

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=PH0PR11MB4885C7B6EFEB605A9DC177DD8CCB9@PH0PR11MB4885.namprd11.prod.outlook.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