MdeModulePkg: PciHostBridgeDxe Map MMIO NX#12874
Conversation
72aaa6f to
0fcc401
Compare
|
PR #12878 needs to complete. Ovmf was adding memory space without XP capabilities. |
I think this can be handled more robustly by adding the capability here before setting it. I thought that was already in the downstream commit, but perhaps not. |
If you are suggesting checking the capabilities, adding the capabilities and then setting the attributes, I think that is bleeding responsibility from the mmio producer into this driver. In my ideal world, the entity that is adding mmio would correctly report the capabilities in the first place. Attempting to patch it after the fact moves the responsibility too far from the mmio owner, and it sets a precedent that any driver can go modify capabilities. Additionally there were multiple drivers in ovmf that were correctly reporting XP. This was the only place that was not reporting the capability. |
Yes, but I don't think MMIO producers are doing this correctly, like in OVMF. I think the right path is for the resc desc HOB to be correct. But, when they are not, this will produce the same failure. This driver already adds the capabilities when it adds the memory space. This then is the case where it doesn't add the memory space because it already exists. I think it is reasonable for it to either add the capability or don't set attributes for this range and expect the driver that added the space to have set it up correctly. |
0fcc401 to
09bc6d7
Compare
Updated to add the capabilities, per your suggestion |
Update PciHostBridgeDxe to map MMIO as NX, in addition to existing UC attribute. During the IntersectMemoryDescriptor call, verify that the capabilities contain NX, and update the capabilities if they do not. Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
09bc6d7 to
7b66845
Compare
Description
Update PciHostBridgeDxe to map MMIO as NX, in addition to existing UC attribute.
How This Was Tested
Tested on physical systems when Mmio Nx is expected.
Performed page audit test to verify MMIO regions are nx protected
Integration Instructions
No integration necessary