Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module


Florian Arnold
 

Hi everyone, 
I am having some trouble with the pre-launched VM and Zephyr in the hybrid scenario and I would be grateful for some advice.

Host Hardware: 
I attached the board configuration file 'my_board.xml'. Unfortunately, my board does not have a serial port. I'm using an m.2 to PCI-e adapter and a PCI-card with serial ports.
I added the TTYS_INFO in the board configuration file manually as I wasn't able to build ACRN without this information in the "my_board.xml" file.

Software Versions:
ACRN-Kernel: release_2.7
ACRN-HV: release_2.7
SOS: Ubuntu 18.04.6
I also tried to use version 2.6 of HV and Kernel but wasn't able to boot into the service VM.

Scenario
I use the default hybrid scenario. I attached the scenario file.

Problem description
When I start up my system I get a message "[21611179us][cpu=3][(null)][sev=3][seq=30]:failed to load VM 0 kernel module". Then the service VM boots. I attached the complete output of the ACRN-Shell.

Additional Information
I set up the bootloader as described in the documentation for the hybrid scenario. I attached both grub files "40_custom" and "grub". I also attached the "zephyr.elf" image. I tested the Zephyr image in a post-launched VM, so the Zephyr image shouldn't be the problem.

I really would appreciate any idea of what I can try to get the system running.

Thanks in advance

Best
Florian


Victor Sun
 

Hi Florian,

 

The log shows your GRUB put the module at HPA 0, which ACRN doesn’t support. Please try GRUB of Ubuntu 20.04, or rebuild a new GRUB by yourself.

 

[21602370us][cpu=3][(null)][sev=3][seq=27]:Unsupported module: start at HPA 0, size 0x7e998

 

You can refer source code at acrn-hypervisor/hypervisor/boot/guest/vboot_info.c:

              /* GRUB might put module at address 0 or under 1MB in the case that the module size is less then 1MB

              * ACRN will not support these cases

              */

              if ((mod != NULL) && (mod->start == NULL)) {

                             pr_err("Unsupported module: start at HPA 0, size 0x%x .", mod->size);

                             mod = NULL;

              }

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of florian.arnold@...
Sent: Thursday, December 16, 2021 11:15 PM
To: acrn-users@...
Subject: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi everyone, 
I am having some trouble with the pre-launched VM and Zephyr in the hybrid scenario and I would be grateful for some advice.

Host Hardware: 
I attached the board configuration file 'my_board.xml'. Unfortunately, my board does not have a serial port. I'm using an m.2 to PCI-e adapter and a PCI-card with serial ports.
I added the TTYS_INFO in the board configuration file manually as I wasn't able to build ACRN without this information in the "my_board.xml" file.

Software Versions:
ACRN-Kernel: release_2.7
ACRN-HV: release_2.7
SOS: Ubuntu 18.04.6
I also tried to use version 2.6 of HV and Kernel but wasn't able to boot into the service VM.

Scenario
I use the default hybrid scenario. I attached the scenario file.

Problem description
When I start up my system I get a message "[21611179us][cpu=3][(null)][sev=3][seq=30]:failed to load VM 0 kernel module". Then the service VM boots. I attached the complete output of the ACRN-Shell.

Additional Information
I set up the bootloader as described in the documentation for the hybrid scenario. I attached both grub files "40_custom" and "grub". I also attached the "zephyr.elf" image. I tested the Zephyr image in a post-launched VM, so the Zephyr image shouldn't be the problem.

I really would appreciate any idea of what I can try to get the system running.

Thanks in advance

Best
Florian


Liu, Fuzhong
 

Hi Florian,

As Victor mentioned; please refer following guide to rebuild grub:

https://projectacrn.github.io/latest/tutorials/using_grub.html#installing-self-built-grub

 

And make sure below commit is included:

2019-12-20

multiboot2: Set min address for mbi allocation to 0x1000

Lukasz Hawrylko

 

Thanks!

 

BR.

Fuzhong

From: acrn-users@... <acrn-users@...> On Behalf Of Victor Sun
Sent: Thursday, December 16, 2021 11:31 PM
To: acrn-users@...
Subject: Re: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi Florian,

 

The log shows your GRUB put the module at HPA 0, which ACRN doesn’t support. Please try GRUB of Ubuntu 20.04, or rebuild a new GRUB by yourself.

 

[21602370us][cpu=3][(null)][sev=3][seq=27]:Unsupported module: start at HPA 0, size 0x7e998

 

You can refer source code at acrn-hypervisor/hypervisor/boot/guest/vboot_info.c:

              /* GRUB might put module at address 0 or under 1MB in the case that the module size is less then 1MB

              * ACRN will not support these cases

              */

              if ((mod != NULL) && (mod->start == NULL)) {

                             pr_err("Unsupported module: start at HPA 0, size 0x%x .", mod->size);

                             mod = NULL;

              }

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of florian.arnold@...
Sent: Thursday, December 16, 2021 11:15 PM
To: acrn-users@...
Subject: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi everyone, 
I am having some trouble with the pre-launched VM and Zephyr in the hybrid scenario and I would be grateful for some advice.

Host Hardware: 
I attached the board configuration file 'my_board.xml'. Unfortunately, my board does not have a serial port. I'm using an m.2 to PCI-e adapter and a PCI-card with serial ports.
I added the TTYS_INFO in the board configuration file manually as I wasn't able to build ACRN without this information in the "my_board.xml" file.

Software Versions:
ACRN-Kernel: release_2.7
ACRN-HV: release_2.7
SOS: Ubuntu 18.04.6
I also tried to use version 2.6 of HV and Kernel but wasn't able to boot into the service VM.

Scenario
I use the default hybrid scenario. I attached the scenario file.

Problem description
When I start up my system I get a message "[21611179us][cpu=3][(null)][sev=3][seq=30]:failed to load VM 0 kernel module". Then the service VM boots. I attached the complete output of the ACRN-Shell.

Additional Information
I set up the bootloader as described in the documentation for the hybrid scenario. I attached both grub files "40_custom" and "grub". I also attached the "zephyr.elf" image. I tested the Zephyr image in a post-launched VM, so the Zephyr image shouldn't be the problem.

I really would appreciate any idea of what I can try to get the system running.

Thanks in advance

Best
Florian


Victor Sun
 

Hi Florian,

Besides rebuilding GRUB, you also need padding your Zephyr elf file to 1MB as we don’t support pre-launched VM OS image less than 1MB.

You can use below method:

dd if=zephyr.elf ibs=1M count=1 of=zephyr_new.elf conv=sync

 

With the new GRUB and the new zephyr_new.elf, you should be able run Zephyr as pre-launched ACRN VM.

Please let us know your test result, thanks!

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of Liu, Fuzhong
Sent: Friday, December 17, 2021 9:56 AM
To: acrn-users@...
Subject: Re: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi Florian,

As Victor mentioned; please refer following guide to rebuild grub:

https://projectacrn.github.io/latest/tutorials/using_grub.html#installing-self-built-grub

 

And make sure below commit is included:

2019-12-20

multiboot2: Set min address for mbi allocation to 0x1000

Lukasz Hawrylko

 

Thanks!

 

BR.

Fuzhong

From: acrn-users@... <acrn-users@...> On Behalf Of Victor Sun
Sent: Thursday, December 16, 2021 11:31 PM
To: acrn-users@...
Subject: Re: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi Florian,

 

The log shows your GRUB put the module at HPA 0, which ACRN doesn’t support. Please try GRUB of Ubuntu 20.04, or rebuild a new GRUB by yourself.

 

[21602370us][cpu=3][(null)][sev=3][seq=27]:Unsupported module: start at HPA 0, size 0x7e998

 

You can refer source code at acrn-hypervisor/hypervisor/boot/guest/vboot_info.c:

              /* GRUB might put module at address 0 or under 1MB in the case that the module size is less then 1MB

              * ACRN will not support these cases

              */

              if ((mod != NULL) && (mod->start == NULL)) {

                             pr_err("Unsupported module: start at HPA 0, size 0x%x .", mod->size);

                             mod = NULL;

              }

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of florian.arnold@...
Sent: Thursday, December 16, 2021 11:15 PM
To: acrn-users@...
Subject: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi everyone, 
I am having some trouble with the pre-launched VM and Zephyr in the hybrid scenario and I would be grateful for some advice.

Host Hardware: 
I attached the board configuration file 'my_board.xml'. Unfortunately, my board does not have a serial port. I'm using an m.2 to PCI-e adapter and a PCI-card with serial ports.
I added the TTYS_INFO in the board configuration file manually as I wasn't able to build ACRN without this information in the "my_board.xml" file.

Software Versions:
ACRN-Kernel: release_2.7
ACRN-HV: release_2.7
SOS: Ubuntu 18.04.6
I also tried to use version 2.6 of HV and Kernel but wasn't able to boot into the service VM.

Scenario
I use the default hybrid scenario. I attached the scenario file.

Problem description
When I start up my system I get a message "[21611179us][cpu=3][(null)][sev=3][seq=30]:failed to load VM 0 kernel module". Then the service VM boots. I attached the complete output of the ACRN-Shell.

Additional Information
I set up the bootloader as described in the documentation for the hybrid scenario. I attached both grub files "40_custom" and "grub". I also attached the "zephyr.elf" image. I tested the Zephyr image in a post-launched VM, so the Zephyr image shouldn't be the problem.

I really would appreciate any idea of what I can try to get the system running.

Thanks in advance

Best
Florian


Florian Arnold
 

Hi Fuzhong,
Thanks for your quick response.
 
I rebuilt grub. I tested Version 2.06 and 2.11 but I got the same error as before for both versions. I checked that the mentioned commit is included in both versions. 
However, if I use a zephyr image that is larger than 1 MB I can boot without any problems. So for a real-world example that contains more code than 'Hello World' it shouldn't be an issue.

Best regards
Florian


Florian Arnold
 

Hi Victor, 
Thanks for your help.
With an image larger than 1 MB and Ubuntu 20.04 everything works fine. 

Best regards,
Florian 


Victor Sun
 

Good to know that.

 

BR,

Victor

 

From: acrn-users@... <acrn-users@...> On Behalf Of florian.arnold@...
Sent: Monday, December 20, 2021 10:26 PM
To: acrn-users@...
Subject: Re: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi Victor, 
Thanks for your help.
With an image larger than 1 MB and Ubuntu 20.04 everything works fine. 

Best regards,
Florian 


Kinder, David B
 

Thanks for your help with this issue Florian.

To confirm, by padding your Zephyr elf image you had no issue using the GRUB that came with Ubuntu 20.04?

I want to update the documentation about this but wanted to make sure the instructions we said to build your own GRUB were unnecessary if you just padded the image to 1MB.

 

Thanks.

-- david

 

From: acrn-users@... <acrn-users@...> On Behalf Of florian.arnold@...
Sent: Monday, December 20, 2021 6:26 AM
To: acrn-users@...
Subject: Re: [acrn-users] Hybrid-Scenario: Pre-launched Zephyr-VM failed to load kernel module

 

Hi Victor, 
Thanks for your help.
With an image larger than 1 MB and Ubuntu 20.04 everything works fine. 

Best regards,
Florian 


Florian Arnold
 

Hi David,
Yes, it works by padding the ELF image to 1 MB. I tested it yesterday with a clean Ubuntu 20.04 installation without updating GRUB.

Best regards
Florian