All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] xen/x86: allow overlaps with non-RAM regions
@ 2025-04-04  1:01 Stefano Stabellini
  2025-04-04  8:07 ` Jan Beulich
  2025-04-04 10:28 ` Roger Pau Monné
  0 siblings, 2 replies; 25+ messages in thread
From: Stefano Stabellini @ 2025-04-04  1:01 UTC (permalink / raw)
  To: xen-devel
  Cc: sstabellini, Andrew Cooper, Jan Beulich, Roger Pau Monné,
	jason.andryuk, Xenia.Ragiadakou, Alejandro.GarciaVallejo

On one Sapphire AMD x86 board, I see this:


(XEN) [0000003943ca6ff2]  [00000000f0000000, 00000000f7ffffff] (reserved)
(XEN) [00000039460886d9]  [00000000fd000000, 00000000ffffffff] (reserved)
[...]
(XEN) [    4.612235] 0000:02:00.0: not mapping BAR [fea00, fea03] invalid position


Linux boots fine on this platform but Linux as Dom0 on Xen does not.
This is because the pci_check_bar->is_memory_hole check fails due to the
MMIO region overlapping with the EFI reserved region.

While I think ideally this should not happen, as you can imagine users
are never happy when Linux baremetal boots fine, and Linux on Xen does
not.

This patch fixes the boot issue by relaxing the is_memory_hole check.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b294497a14..afb54d6f0f 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -797,6 +797,9 @@ bool is_memory_hole(mfn_t start, mfn_t end)
         if ( !entry->size )
             continue;
 
+        if ( entry->type > 1 )
+            continue;
+
         /* Do not allow overlaps with any memory range. */
         if ( s <= PFN_DOWN(entry->addr + entry->size - 1) &&
              PFN_DOWN(entry->addr) <= e )


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-05-15 16:24 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04  1:01 [RFC] xen/x86: allow overlaps with non-RAM regions Stefano Stabellini
2025-04-04  8:07 ` Jan Beulich
2025-04-10 20:55   ` Jason Andryuk
2025-04-11  7:56     ` Jan Beulich
2025-04-04 10:28 ` Roger Pau Monné
2025-04-10 20:55   ` Jason Andryuk
2025-04-11  7:31     ` Roger Pau Monné
2025-04-11  8:07       ` Jan Beulich
2025-04-11 13:45       ` Jason Andryuk
2025-04-14  8:25         ` Roger Pau Monné
2025-04-23 23:51           ` Lira, Victor M
2025-04-24  7:59             ` Roger Pau Monné
2025-04-24 10:15               ` Marek Marczykowski-Górecki
2025-04-24 10:48                 ` Roger Pau Monné
2025-04-24 21:19                   ` Jason Andryuk
2025-04-24 21:38                     ` Lira, Victor M
2025-04-25  9:02                       ` Roger Pau Monné
2025-04-25  9:19                         ` Jan Beulich
2025-04-25 11:09                           ` Roger Pau Monné
2025-04-25 16:47                             ` Lira, Victor M
2025-05-12 16:16                               ` Roger Pau Monné
2025-05-12 17:55                                 ` Lira, Victor M
2025-05-15 10:19                                   ` Roger Pau Monné
2025-05-15 16:24                                     ` Lira, Victor M
2025-04-11  8:15     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.