Skip to contentSkip to conversation

x86/boot: Fix PVH boot following the start of the MBI->BI conversion

PATCH In review Andrew Cooper 3 participants 5 messages Oct 19, 2024 – Oct 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/boot: Fix PVH boot following the start of the MBI->BI conversion

pvh_init() sets up the mbi pointer, but leaves mbi_p at 0. This isn't compatbile with multiboot_fill_boot_info() starting from the physical address, in order to remove the use of the mbi pointer.

Fixes 038826b61e85 ("x86/boot: move x86 boot module counting into a new boot_info struct")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Daniel P. Smith <[email protected]>

This is a testiment to how tangled the boot code really is.

---
 xen/arch/x86/setup.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/setup.c +1 -0
index 6746ed8cced6..bfede5064e8c 100644
@@ -1048,6 +1048,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         ASSERT(mbi_p == 0);
         pvh_init(&mbi, &mod);
+        mbi_p = __pa(mbi);
     }
     else
     {

base-commit: e9f227685e7204cb2293576ee5b745b828cb3cd7

Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Andrew Cooper

pvh_init() sets up the mbi pointer, but leaves mbi_p at 0. This isn't compatbile with multiboot_fill_boot_info() starting from the physical address, in order to remove the use of the mbi pointer.

Fixes 038826b61e85 ("x86/boot: move x86 boot module counting into a new boot_info struct")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Daniel P. Smith <[email protected]>

This is a testiment to how tangled the boot code really is.

---
  xen/arch/x86/setup.c | 1 +
  1 file changed, 1 insertion(+)
xen/arch/x86/setup.c +1 -0
index 6746ed8cced6..bfede5064e8c 100644
@@ -1048,6 +1048,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      {
          ASSERT(mbi_p == 0);
          pvh_init(&mbi, &mod);
+        mbi_p = __pa(mbi);
      }
      else
      {
Quoted 1 line

base-commit: e9f227685e7204cb2293576ee5b745b828cb3cd7

#2 lore raw
Quoted 33 lines · Daniel P. Smith
Quoted 32 lines · Andrew Cooper

pvh_init() sets up the mbi pointer, but leaves mbi_p at 0.  This isn't compatbile with multiboot_fill_boot_info() starting from the physical address,
in order to remove the use of the mbi pointer.

Fixes 038826b61e85 ("x86/boot: move x86 boot module counting into a

new boot_info struct")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Daniel P. Smith <[email protected]>

This is a testiment to how tangled the boot code really is.
---
  xen/arch/x86/setup.c | 1 +

  1 file changed, 1 insertion(+)
xen/arch/x86/setup.c +1 -0
index 6746ed8cced6..bfede5064e8c 100644
@@ -1048,6 +1048,7 @@ void asmlinkage __init noreturn
 __start_xen(unsigned long mbi_p)
       {
           ASSERT(mbi_p == 0);
           pvh_init(&mbi, &mod);
+        mbi_p = __pa(mbi);
       }

      else
      {

Quoted 3 lines
Quoted 1 line

base-commit: e9f227685e7204cb2293576ee5b745b828cb3cd7

Thanks.  I'll get this committed right away so OSSTest can start working on untangling itself.

~Andrew

#3 lore raw
In reply to Andrew Cooper
Quoted 4 lines · Andrew Cooper

pvh_init() sets up the mbi pointer, but leaves mbi_p at 0. This isn't compatbile with multiboot_fill_boot_info() starting from the physical address, in order to remove the use of the mbi pointer.

Quoted 8 lines
Fixes 038826b61e85 ("x86/boot: move x86 boot module counting into a new boot_info struct")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Daniel P. Smith <[email protected]>

This is a testiment to how tangled the boot code really is.

Did it causes crash in some boot configuration? If so, did some test tripped on this (from what I see, not a gitlab one)?

Quoted 22 lines
---
 xen/arch/x86/setup.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/setup.c +1 -0
index 6746ed8cced6..bfede5064e8c 100644
@@ -1048,6 +1048,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         ASSERT(mbi_p == 0);
         pvh_init(&mbi, &mod);
+        mbi_p = __pa(mbi);
     }
     else
     {

base-commit: e9f227685e7204cb2293576ee5b745b828cb3cd7

Signature · 1 line
2.39.5
Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
#4 lore raw
Quoted 12 lines · Marek Marczykowski-Górecki
Quoted 11 lines · Andrew Cooper

pvh_init() sets up the mbi pointer, but leaves mbi_p at 0. This isn't compatbile with multiboot_fill_boot_info() starting from the physical address, in order to remove the use of the mbi pointer.

Fixes 038826b61e85 ("x86/boot: move x86 boot module counting into a new boot_info struct")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Daniel P. Smith <[email protected]>

Quoted 3 lines
Quoted 1 line

This is a testiment to how tangled the boot code really is.

Did it causes crash in some boot configuration? If so, did some test tripped on this (from what I see, not a gitlab one)?

OSSTest found it.

[email protected]

I'm writing a PVSHIM test for Gitlab CI right now, seeing as OSSTest is going away imminently.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1505384944

~Andrew