public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrew Fish" <afish@apple.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] 2nd OVMF question about why InitRootBridge does not set ResourceAssigned?
Date: Tue, 07 Jul 2020 16:08:01 -0700	[thread overview]
Message-ID: <C91C28B3-AFC7-4216-B6E0-8B330BE0CB40@apple.com> (raw)
In-Reply-To: <cd048fd3-ac8b-147b-b278-6f04fa25368a@redhat.com>

Laszlo,

Thanks for the background. 

Turns out I was chasing the wrong thing :(. In our tree all MMIO is marked NX and I was talking a page fault. When I tracked it down I realized it was an issue with the EFER MSR not getting the NXE (No-Execute Enable) bit set, so any page table with the NX bit set faults. 

I had a bug in my copy of the DXE IPL that was not calling EnableExecuteDisableBit() so NXE is never set, and that is why I got the page fault. 

Thanks,

Andrew Fish

> On Jul 7, 2020, at 1:21 PM, Laszlo Ersek <lersek@redhat.com> wrote:
> 
> On 07/07/20 21:59, Laszlo Ersek wrote:
> 
>> (Side note: where I say "synthetic", that does not mean "easy to change"
>> at all. Coming up with good 32-bit and 64-bit MMIO apertures for the
>> PciHostBridgeLib instance was an arduous task. Among other things, this
>> originates from the very quirky placement of the 32-bit address ranges
>> on i440fx and q35 that are usable for PCI MMIO. QEMU doesn't dictate the
>> apertures for the root bridges, but if you allocate an MMIO BAR from an
>> inappropriate address range, you're doomed.)
> 
> A key commit regarding the above is 49edde15230a ("OvmfPkg/PlatformPei:
> set 32-bit UC area at PciBase / PciExBarBase (pc/q35)", 2019-06-03).
> 
> It was very difficult to find a 32-bit PCI MMIO aperture, facing any
> random guest RAM size, such that we could mark the aperture in
> PlatformPei as UC with no more than the 8 variable MTRRs that QEMU provides.
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1814
> https://bugzilla.tianocore.org/show_bug.cgi?id=1859
> 
> Thanks
> Laszlo
> 


      reply	other threads:[~2020-07-07 23:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 17:22 2nd OVMF question about why InitRootBridge does not set ResourceAssigned? Andrew Fish
2020-07-07 19:59 ` [edk2-devel] " Laszlo Ersek
2020-07-07 20:21   ` Laszlo Ersek
2020-07-07 23:08     ` Andrew Fish [this message]

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=C91C28B3-AFC7-4216-B6E0-8B330BE0CB40@apple.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