Skip to contentSkip to conversation

arm64: xen_boot: Fix xen boot using Grub on AARCH64

PATCH In review Julien Grall 5 participants 17 messages Feb 19, 2016 – Nov 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: xen_boot: Fix xen boot using Grub on AARCH64

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
Signature · 1 line
1.9.1
Tested-by on v1 1/1
#1 lore raw

Hi Julien,

Quoted 21 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -2
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
--
Quoted 1 line

1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

Please correct me if I miss something.

Quoted 1 line
Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
Tested-by on v1 1/1
#2 lore raw
In reply to Julien Grall

Hi Julien,

Quoted 21 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -2
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
--
Quoted 1 line

1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

Please correct me if I miss something.

Quoted 1 line
Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#3 lore raw
Quoted 47 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.
---
 grub-core/loader/arm64/xen_boot.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));

   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");

Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' { xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2 xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
    xen_module /xsm
    devicetree /fvp-base-gicv2-psci.dtb
}
-----

Quoted 5 lines

Maybe we should update doc to  coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Fu Wei
Quoted 47 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.
---
 grub-core/loader/arm64/xen_boot.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));

   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");

Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' { xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2 xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
    xen_module /xsm
    devicetree /fvp-base-gicv2-psci.dtb
}
-----

Quoted 5 lines

Maybe we should update doc to  coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

Ian.

#5 lore raw

Hi Ian

Quoted 54 lines · Ian Campbell
Quoted 47 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Quoted 5 lines

Maybe we should update doc to coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

Quoted 6 lines

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

From the test result, it seems that the latest xen can NOT

automatically probe XSM module, even we load xsm as the third module.

the test branch is master branch. Please correct me if I tested it in wrong way.

Quoted 1 line

Ian.

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#6 lore raw
In reply to Ian Campbell

Hi Ian

Quoted 50 lines · Ian Campbell
Quoted 49 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

Quoted 8 lines
Quoted 3 lines

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

From the test result, it seems that the latest xen can NOT automatically probe XSM module, even we load xsm as the third module.

the test branch is master branch. Please correct me if I tested it in wrong way.

Quoted 1 line

Ian.

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#7 lore raw

23.02.2016 17:16, Fu Wei пишет:

Quoted 62 lines

Hi Ian

Quoted 50 lines · Ian Campbell
Quoted 49 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

Quoted 8 lines
Quoted 3 lines

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

Quoted 5 lines

From the test result, it seems that the latest xen can NOT automatically probe XSM module, even we load xsm as the third module.

the test branch is master branch. Please correct me if I tested it in wrong way.

That's exactly what code looks like. I.e. XSM is recognized only if bootloader provided xen,xsm-policy compatible property.

OTOH looking at xsm_dt_policy_init(), XSM module has defined magic and multiboot version actually detects module type based on this magic. So I think it makes sense to extend process_multiboot_node() to check for XSM magic in case of unknown modules. This will make ARM behavior compatible with x86. Otherwise we simply won't be able to load XSM on ARM at all, given current implementation in GRUB.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
In reply to Fu Wei

23.02.2016 17:16, Fu Wei пишет:

Quoted 62 lines

Hi Ian

Quoted 50 lines · Ian Campbell
Quoted 49 lines · Fu Wei

Hi Julien,

Quoted 24 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub- renamed from grub-core/loader/arm64/xen_boot.c +0 -0

core/loader/arm64/xen_boot.c
index a914eb8..8ae43d7 100644

grub-core/loader/arm64/xen_boot.c +1 -1
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

Quoted 8 lines
Quoted 3 lines

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

I must confess when Vlad proposed this change I thought Xen was able to automatically probe for whether a module was an XSM module. Perhaps it is either broken or that functionality never existed to start with?

Quoted 5 lines

From the test result, it seems that the latest xen can NOT automatically probe XSM module, even we load xsm as the third module.

the test branch is master branch. Please correct me if I tested it in wrong way.

That's exactly what code looks like. I.e. XSM is recognized only if bootloader provided xen,xsm-policy compatible property.

OTOH looking at xsm_dt_policy_init(), XSM module has defined magic and multiboot version actually detects module type based on this magic. So I think it makes sense to extend process_multiboot_node() to check for XSM magic in case of unknown modules. This will make ARM behavior compatible with x86. Otherwise we simply won't be able to load XSM on ARM at all, given current implementation in GRUB.

#9 lore raw
In reply to Fu Wei

Hi all

Quoted 23 lines · Fu Wei

Hi Julien,

Quoted 20 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
Quoted 5 lines
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

I guess this bugfix haven't been merged yet,
Hope this fix can be merged soon :-)

Quoted 38 lines

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

Please correct me if I miss something.

Quoted 1 line

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#10 lore raw
In reply to Fu Wei

Hi all

Quoted 23 lines · Fu Wei

Hi Julien,

Quoted 20 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
 grub-core/loader/arm64/xen_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
       grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
   retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
   if (retval)
     return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
Quoted 5 lines
Quoted 2 lines

--
1.9.1

I have tested it. yes, xen will crash without this patch.

I guess this bugfix haven't been merged yet,
Hope this fix can be merged soon :-)

Quoted 38 lines

BTW, since Vladimir has simplified the xen boot code , and Now Xen distinguishes modules by order.
------
menuentry 'Foundation Model Xen test with initramfs' {
xen_hypervisor /xen -- no-bootscrub console=dtuart conswitch=x
dtuart=serial0 dom0_mem=512M dom0_max_vcpus=2
xen_module /dom0_kernel_Image console=hvc0 root=/dev/ram0 ro xen_module /dom0_initramfs.cpio
xen_module /xsm
devicetree /fvp-base-gicv2-psci.dtb
}
-----

Maybe we should update doc to coordinate with this change.

And another problem is: How does XEN identify XSM? Test with the config file above, I got "(XEN) MODULE[3]:
00000008fabb4000 - 00000008fabb65e7 Unknown"

Please correct me if I miss something.

Quoted 1 line

--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021

Signature · 5 lines
Best regards,

Fu Wei
Software Engineer
Red Hat
#11 lore raw
In reply to Julien Grall

Hello,

Ping?

Regards,

Quoted 21 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
  grub-core/loader/arm64/xen_boot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
    if (retval)
      return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#12 lore raw
In reply to Julien Grall

Hello,

Ping?

Regards,

Quoted 21 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
  grub-core/loader/arm64/xen_boot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+			      MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE));
    if (retval)
      return grub_error (GRUB_ERR_IO, "failed to update FDT");
 
Signature · 1 line
Julien Grall
#13 lore raw

Hi Julien,

I have posted the v3 , please check
http://lists.xen.org/archives/html/xen-devel/2016-03/msg03564.html

And I hope GRUB patch can be merged :-)

Quoted 37 lines · Julien Grall

Hello,

Ping?

Regards,

Quoted 22 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
  grub-core/loader/arm64/xen_boot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
Quoted 4 lines
    if (retval)
      return grub_error (GRUB_ERR_IO, "failed to update FDT");

--
Julien Grall

Signature · 15 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#14 lore raw
In reply to Julien Grall

Hi Julien,

I have posted the v3 , please check
http://lists.xen.org/archives/html/xen-devel/2016-03/msg03564.html

And I hope GRUB patch can be merged :-)

Quoted 37 lines · Julien Grall

Hello,

Ping?

Regards,

Quoted 22 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

---
  grub-core/loader/arm64/xen_boot.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/arm64/xen_boot.c +1 -1
index a914eb8..8ae43d7 100644
@@ -156,7 +156,7 @@ prepare_xen_module_params (struct xen_boot_binary
 *module, void *xen_boot_fdt)
        grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name);
 
    retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible",
-                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE) - 1);
+                             MODULE_CUSTOM_COMPATIBLE,
 sizeof(MODULE_CUSTOM_COMPATIBLE));
Quoted 4 lines
    if (retval)
      return grub_error (GRUB_ERR_IO, "failed to update FDT");

--
Julien Grall

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#15 lore raw
In reply to Julien Grall
Quoted 3 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

Just two nitpicks. Could you change subject to "arm64/xen_boot: Fix xen boot using Grub on AARCH64" and add your SOB? You can also repost this patch with: Reviewed-by: Daniel Kiper <[email protected]>

Daniel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#16 lore raw
In reply to Julien Grall
Quoted 3 lines · Julien Grall

Xen is currently crashing because of malformed compatible property for the boot module. This is because the property string is not null-terminated as requested by the ePAR spec.

Just two nitpicks. Could you change subject to "arm64/xen_boot: Fix xen boot using Grub on AARCH64" and add your SOB? You can also repost this patch with: Reviewed-by: Daniel Kiper <[email protected]>

Daniel