Date   

Re: Using perf to access hardware events in pre-launched VM

Minggui Cao
 

Following is an example from my side:

 

 

./perf stat -C 1 -e  mem_load_retired.l2_hit,mem_load_retired.l2_miss,mem_load_retired.l3_hit,mem_load_retired.l3_miss  ./pmu_mem -a 1 -p 80 -l 1 -m 12

 

Performance counter stats for 'CPU(s) 1':

 

             30260      mem_load_retired.l2_hit

              7718      mem_load_retired.l2_miss

              2587      mem_load_retired.l3_hit

              4240      mem_load_retired.l3_miss

 

 

From: acrn-users@... <acrn-users@...> On Behalf Of Minggui Cao
Sent: Saturday, March 26, 2022 8:57 AM
To: acrn-users@...
Subject: Re: [acrn-users] Using perf to access hardware events in pre-launched VM

 

Hi, Paolo,

                If you can read 0x186, it means, you can read PMU MSRs, it shall work for perf to sample some events, like LLC misses.

 

You can also check by: dmesg | grep -i pmu

To check PMU driver is probed.

 

You don’t need modify the scenario file.

 

 

Minggui

 

 

 

 

From: acrn-users@... <acrn-users@...> On Behalf Of Paolo Crotti
Sent: Friday, March 25, 2022 7:08 PM
To: acrn-users@...
Subject: Re: [acrn-users] Using perf to access hardware events in pre-launched VM

 

Hi Minggui,

Thanks for the quick answer. With my original scenario, I tried rdmsr 0x186 and it returned rdmsr(0x186):0x0. Is it ok?

Then I modified the scenario and i get a lot of errors:

First I changed the <vm_type> PRE_STD_VM to RTVM, then run make hypervisor and I got this error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Traceback (most recent call last):

  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 137, in <module>

    err_dic = main(ARGS)

  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 95, in main

    err_dic = board_info_h.generate_file(config)

  File "/home/paoloc/acrn-work/acrn-hypervisor/misc/config_tools/board_config/board_info_h.py", line 96, in generate_file

    scenario_cfg_lib.VM_DB[common.VM_TYPES[0]]['load_type'] == "PRE_LAUNCHED_VM"

KeyError: 'RTVM'

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


Then if I add this line <load_order>PRE_LAUNCHED_VM</load_order>, I get a different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Board configurations for my_board is generated successfully.

Error: Scenario xml file validation failed:

Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd0629775e0>

Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd06297b6d0>

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


And if I add <lapic_passthrough>y</lapic_passthrough>, I get another different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Board configurations for my_board is generated successfully.

Error: Scenario xml file validation failed:

Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a05e0>

Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a4770>

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


Do you have any idea what the problem could be?

P.S. Attached my original scenario and the modified one.


Re: Using perf to access hardware events in pre-launched VM

Minggui Cao
 

Hi, Paolo,

                If you can read 0x186, it means, you can read PMU MSRs, it shall work for perf to sample some events, like LLC misses.

 

You can also check by: dmesg | grep -i pmu

To check PMU driver is probed.

 

You don’t need modify the scenario file.

 

 

Minggui

 

 

 

 

From: acrn-users@... <acrn-users@...> On Behalf Of Paolo Crotti
Sent: Friday, March 25, 2022 7:08 PM
To: acrn-users@...
Subject: Re: [acrn-users] Using perf to access hardware events in pre-launched VM

 

Hi Minggui,

Thanks for the quick answer. With my original scenario, I tried rdmsr 0x186 and it returned rdmsr(0x186):0x0. Is it ok?

Then I modified the scenario and i get a lot of errors:

First I changed the <vm_type> PRE_STD_VM to RTVM, then run make hypervisor and I got this error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Traceback (most recent call last):

  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 137, in <module>

    err_dic = main(ARGS)

  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 95, in main

    err_dic = board_info_h.generate_file(config)

  File "/home/paoloc/acrn-work/acrn-hypervisor/misc/config_tools/board_config/board_info_h.py", line 96, in generate_file

    scenario_cfg_lib.VM_DB[common.VM_TYPES[0]]['load_type'] == "PRE_LAUNCHED_VM"

KeyError: 'RTVM'

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


Then if I add this line <load_order>PRE_LAUNCHED_VM</load_order>, I get a different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Board configurations for my_board is generated successfully.

Error: Scenario xml file validation failed:

Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd0629775e0>

Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd06297b6d0>

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


And if I add <lapic_passthrough>y</lapic_passthrough>, I get another different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

Board XML is fetched from /home/paoloc/acrn-work/my_board.xml

Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated

Board configurations for my_board is generated successfully.

Error: Scenario xml file validation failed:

Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a05e0>

Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a4770>

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated

Start pre-build static check ...

make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs

make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.

make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»

make[1]: *** [Makefile:413: pre_build] Errore 2

make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»

make: *** [Makefile:109: hypervisor] Errore 2


Do you have any idea what the problem could be?

P.S. Attached my original scenario and the modified one.


Re: Using perf to access hardware events in pre-launched VM

Paolo Crotti
 

Scenario files:


Re: Using perf to access hardware events in pre-launched VM

Paolo Crotti
 

Hi Minggui,

Thanks for the quick answer. With my original scenario, I tried rdmsr 0x186 and it returned rdmsr(0x186):0x0. Is it ok?

Then I modified the scenario and i get a lot of errors:

First I changed the <vm_type> PRE_STD_VM to RTVM, then run make hypervisor and I got this error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
Board XML is fetched from /home/paoloc/acrn-work/my_board.xml
Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated
Traceback (most recent call last):
  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 137, in <module>
    err_dic = main(ARGS)
  File "/home/paoloc/acrn-work/acrn-hypervisor/hypervisor/../misc/config_tools/board_config/board_cfg_gen.py", line 95, in main
    err_dic = board_info_h.generate_file(config)
  File "/home/paoloc/acrn-work/acrn-hypervisor/misc/config_tools/board_config/board_info_h.py", line 96, in generate_file
    scenario_cfg_lib.VM_DB[common.VM_TYPES[0]]['load_type'] == "PRE_LAUNCHED_VM"
KeyError: 'RTVM'
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=
make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated
Start pre-build static check ...
make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs
make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.
make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[1]: *** [Makefile:413: pre_build] Errore 2
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make: *** [Makefile:109: hypervisor] Errore 2

Then if I add this line <load_order>PRE_LAUNCHED_VM</load_order>, I get a different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
Board XML is fetched from /home/paoloc/acrn-work/my_board.xml
Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated
Board configurations for my_board is generated successfully.
Error: Scenario xml file validation failed:
Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd0629775e0>
Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'load_order' at position 2. Tag (name | clos | priority | legacy_vuart | console_vuart | communication_vuart) expected.: last call: <Element 'vm' at 0x7fd06297b6d0>
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=
make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated
Start pre-build static check ...
make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs
make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.
make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[1]: *** [Makefile:413: pre_build] Errore 2
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make: *** [Makefile:109: hypervisor] Errore 2

And if I add <lapic_passthrough>y</lapic_passthrough>, I get another different error:

make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
Board XML is fetched from /home/paoloc/acrn-work/my_board.xml
Scneario XML is configuration fetched from /home/paoloc/acrn-work/notPartitioned-EnablePMU.xml
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml generated
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/config.mk generated
Board configurations for my_board is generated successfully.
Error: Scenario xml file validation failed:
Error: vm:id=0: 'vm:id=0' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a05e0>
Error: vm:id=1: 'vm:id=1' Unexpected child with tag 'lapic_passthrough' at position 4.: last call: <Element 'vm' at 0x7fc2ef3a4770>
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make -C /home/paoloc/acrn-work/acrn-hypervisor/hypervisor BOARD=/home/paoloc/acrn-work/my_board.xml SCENARIO=/home/paoloc/acrn-work/notPartitioned-EnablePMU.xml HV_OBJDIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor RELEASE=
make[1]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/include/config.h generated
Start pre-build static check ...
make -C ../misc/hv_prebuild BOARD=my_board SCENARIO=partitioned_CAT TARGET_DIR=/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs
make[2]: ingresso nella directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[2]: ***  Nessuna regola per generare l'obiettivo «/home/paoloc/acrn-work/acrn-hypervisor/build/hypervisor/configs/scenarios/partitioned_CAT/vm_configurations.c», necessario per «default».  Arresto.
make[2]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/misc/hv_prebuild»
make[1]: *** [Makefile:413: pre_build] Errore 2
make[1]: uscita dalla directory «/home/paoloc/acrn-work/acrn-hypervisor/hypervisor»
make: *** [Makefile:109: hypervisor] Errore 2

Do you have any idea what the problem could be?

P.S. Attached my original scenario and the modified one.


Re: Extracting scenario xml information

Geoffroy Van Cutsem
 

I do not believe this is possible although this may be an interesting feature. What use-case do you have in mind for this?

 

Geoffroy

 

From: acrn-users@... <acrn-users@...> On Behalf Of jordan.nowak22@...
Sent: Friday, March 25, 2022 8:50 am
To: acrn-users@...
Subject: [acrn-users] Extracting scenario xml information

 

Hi ACRN experts,

Is there a way for me to extract my scenario xmls information from the hypervisor binary or from the target itself rather than from the acrn hypervisor build folder?


Extracting scenario xml information

jordan.nowak22@...
 

Hi ACRN experts,

Is there a way for me to extract my scenario xmls information from the hypervisor binary or from the target itself rather than from the acrn hypervisor build folder?


Re: Using perf to access hardware events in pre-launched VM

Minggui Cao
 

HiPaolo,

  In ACRN2.7 it has supported to pass-through PMU (hardware events) to RTVM.  For cache-misses, LLC-stores, LLC-store-misses hardware events, it shall support.

 

You can have a check for pre-launch VM:

1. rdmsr  0x186 à if can’t read, it could be some configuration issues.

2. please check your scenario file:

 

  <vm id=”0”>

<vm_type>RTVM</vm_type>

<load_order>PRE_LAUNCHED_VM</load_order>

<name>PRE_RT_VM0</name>

<lapic_passthrough>y</lapic_passthrough>  à if it is configured,  you can search code: is_lapic_pt_configured shall be used for PMU MSRs.

 

 

Thanks

Minggui

 

 

From: acrn-users@... <acrn-users@...> On Behalf Of Paolo Crotti
Sent: Wednesday, March 23, 2022 11:55 PM
To: acrn-users@...
Subject: [acrn-users] Using perf to access hardware events in pre-launched VM

 

Hi everyone,

I am working with ACRN in order to make some performance test on VMs in a pre-launched scenario. To take measurements i thought to use perf but it seems there is no way to access the hardware events i'm intrested in. In particular the events affecting the cache such as: cache-misses, LLC-stores, LLC-store-misses.
On the VMs runs Ubuntu 18.04 with kernel 5.4.0-100-generic.

Is there any way to allow perf to read these events? Or are there other tools I could use to access this information?

Software Versions:
ACRN Kernel v2.7
ACRN Hypervisor v2.7

Thanks in advance!


Using perf to access hardware events in pre-launched VM

Paolo Crotti
 

Hi everyone,

I am working with ACRN in order to make some performance test on VMs in a pre-launched scenario. To take measurements i thought to use perf but it seems there is no way to access the hardware events i'm intrested in. In particular the events affecting the cache such as: cache-misses, LLC-stores, LLC-store-misses.
On the VMs runs Ubuntu 18.04 with kernel 5.4.0-100-generic.

Is there any way to allow perf to read these events? Or are there other tools I could use to access this information?

Software Versions:
ACRN Kernel v2.7
ACRN Hypervisor v2.7

Thanks in advance!


2022 ACRN Project Technical Community Meeting Minutes - WW12'22

Zou, Terry
 

ACRN Project TCM - 16th Mar 2022
Location    Online by Zoom: https://zoom.com.cn/j/320664063   
Attendees (Total 10, 16/03)
Agenda
  1. ACRN project update:  Celebrating 4th Birthday, Project ACRN™: https://projectacrn.org/happy-4th-birthday-project-acrn/
  1. ‘WW12’22 Libvirt Enhancement Introduction’ Wu Xiangyang
Download foil from ACRN Presentation->WW12’22
Description: We will introduce Libvirt enhancement in ACRN, VM management functionality and typical VM Destroy/Shutdown/Reboot design.

  1. All: Community open discussion.
Q&A: 
  1. Basic VM Management Functionality has been upstreamed in ACRN github right?
A: Yes, those patches were already in ACRN github, no need to wait for v3.0 release, feel free to try if you are interested.
  1. Will ‘libvirt’ and ‘acrn-d’ co-exist for the long term?
A: For long term, because libvirt is more popular in industry, we prefer to let libvirt replace acrn-d for VM management, but for short-term, both ‘libvirt’ and ‘acrn-d’ are supported in ACRN.
 
  1. Next meeting agenda proposal:
WW Topic Presenter Status
Chinese New Year Break
WW12 Libvirt Enhancement Introduction Wu Xiangyang 3/16/2022
WW17 ACRN DX: New config/para Design and Application Xie Nanlin 4/20/2022
WW21 ACRN Based X86 OPTEE Introduction Liu Yifan 5/18/2022
WW25 ACRN Modularization Introduction Chen Jason 6/15/2022
WW30 ACRN DX: Dynamic Parameter Configuration Liu, Hang 7/20/2022
Marketing/Events   N/A
Resources     Project URL: 
  1. Portal: https://projectacrn.org   
  2. Source code: https://github.com/projectacrn   
  3. email: info@... 
  4. Technical Mailing list: acrn-dev@... 
 
 


2022 ACRN Project Technical Community Meeting: @ Monthly 3rd Wednesday 4PM (China-Shanghai), Wednesday 9AM (Europe-Munich), Tuesday 1AM (US-West Coast)

Zou, Terry
 

Special Notes: If you have Zoom connection issue by using web browser, please install & launch Zoom application, manually input the meeting ID (320664063) to join the Zoom meeting.
 
Agenda & Archives:
WW Topic Presenter Status
Chinese New Year Break
WW12 Libvirt Enhancement Introduction Wu Xiangyang 3/16/2021
WW17 ACRN DX: New config/para Design and Application Xie Nanlin 4/20/2021
WW21 ACRN Based X86 OPTEE Introduction Liu Yifan 5/18/2021
WW25 ACRN Modularization Introduction Chen Jason 6/15/2021
WW30 ACRN DX: Dynamic Parameter Configuration Liu, Hang 7/20/2021
 
Project ACRN: A flexible, light-weight, open source reference hypervisor for IoT devices
We invite you to attend a monthly "Technical Community" meeting where we'll meet community members and talk about the ACRN project and plans.
As we explore community interest and involvement opportunities, we'll (re)schedule these meetings at a time convenient to most attendees:
  • Meets every 3rd Wednesday, 4-5:00 PM (China-Shanghai), Wednesday 10-11:00 AM (Europe-Munich), Tuesday 1-2:00 AM (US-West Coast)
  • Chairperson: Terry ZOU, terry.zou@... (Intel)
  • Online conference link: https://zoom.com.cn/j/320664063
  • Zoom Meeting ID: 320 664 063
  • Special Notes: If you have Zoom connection issue by using web browser, please launch Zoom application, manually input the meeting ID (320664063) to join the Zoom meeting.
  • Online conference phone:
  • China: +86 010 87833177  or 400 669 9381 (Toll Free)
  • Germany: +49 (0) 30 3080 6188  or +49 800 724 3138 (Toll Free)
  • US: +1 669 900 6833  or +1 646 558 8656   or +1 877 369 0926 (Toll Free) or +1 855 880 1246 (Toll Free)
  • Additional international phone numbers
  • Meeting Notes:
 
 


Re: Need support for launching post RTVM

shibi590268@...
 

Liu,
      I will check the kernel config and get back. I tried adding --rtvm to the script then the os boots up. But if I add --lapic_pt to the script I see the vm exit handler failed message 3 to 4 times and then no response is there. I couldn't stop with acrnctl. I have to perform reboot.

So, do you mean that a separate harddisk is needed rather than virtio blk. I am using img file of 60 GB size.


Re: Need support for launching post RTVM

Liu, Fuzhong
 

Hi

For security concern, Service VM is not allowed to inject virtual interrupt to RTVM since the severity of RTVM is higher than Service VM.

From you shared launch log, virtio-blk is used for User VM.

[2022-03-14 12:23:57][  386.814720] pci init virtio-blk

Please help to check if   CONFIG_VIRTIO_PMD  is set in your RTVM kernel config.

 

Thanks!

 

BR.

Fuzhong

From: acrn-users@... <acrn-users@...> On Behalf Of shibi590268@...
Sent: Monday, March 14, 2022 3:04 PM
To: acrn-users@...
Subject: [acrn-users] Need support for launching post RTVM

 

[Edited Message Follows]

Hello ACRN,
          I am trying to run RT patched Ubuntu 18.04 with 5.4.177.rt69 kernel. I have generated the scenario xml and launch scripts.
Scenario: Shared
ACRN tag: acrn-2022w03.2-100000p
ACRN kernel: acrn-2022w03.2-100000p
Board: Intel  apollo lake

The OS gets launched by launch scripts without RTVM. If it is launched with script for RTVM i see vm exit handler failed in the acrn console. I am attaching the scenario.xml, launchscript xml and board file.

ACRN:\>[1774455470us][cpu=1][vm0:vcpu1][sev=3][seq=132]:ret=-1 hypercall=0x80000031 failed in vmcall_vmexit_handler

I followed the solution posted in the threadhttps://github.com/projectacrn/acrn-hypervisor/issues/6950 by picking up the acrn-kernel 5.10.83 patched with rt and installed into ubuntu18.04. But still the problem persists. 

5.10.84 kernel should be working with the ubuntu18.04 because my service vm is ubuntu18.04 with 5.10.83 sos kernel. Please help me address this problem. 
I measured the task timing performance of RTVM launched with launch script for the a normal uos. The maximum latency is high in range of 10000us while it is expected to be below 50 us. 


Re: Need support for launching post RTVM

shibi590268@...
 

Attached the files


Need support for launching post RTVM

shibi590268@...
 
Edited

Hello ACRN,
          I am trying to run RT patched Ubuntu 18.04 with 5.4.177.rt69 kernel. I have generated the scenario xml and launch scripts.
Scenario: Shared
ACRN tag: acrn-2022w03.2-100000p
ACRN kernel: acrn-2022w03.2-100000p
Board: Intel  apollo lake

The OS gets launched by launch scripts without RTVM. If it is launched with script for RTVM i see vm exit handler failed in the acrn console. I am attaching the scenario.xml, launchscript xml and board file.

ACRN:\>[1774455470us][cpu=1][vm0:vcpu1][sev=3][seq=132]:ret=-1 hypercall=0x80000031 failed in vmcall_vmexit_handler

I followed the solution posted in the threadhttps://github.com/projectacrn/acrn-hypervisor/issues/6950 by picking up the acrn-kernel 5.10.83 patched with rt and installed into ubuntu18.04. But still the problem persists. 

5.10.84 kernel should be working with the ubuntu18.04 because my service vm is ubuntu18.04 with 5.10.83 sos kernel. Please help me address this problem. 
I measured the task timing performance of RTVM launched with launch script for the a normal uos. The maximum latency is high in range of 10000us while it is expected to be below 50 us. 


Re: ACRN-Hypervisor build fail

Liu, Fuzhong
 

Hi,

 

Do you refer following guide to setup rtvm?

https://projectacrn.github.io/latest/tutorials/rtvm_performance_tips.html#

 

The main usage of partitioned mode is for safety; not necessary for rt performance.

Apollo lake isn’t the  ACRN supported platform for GPU passthru; please try GPU passthru with Kaby lake/ Whiskey Lake/ Tiger Lake

 

Thanks!

 

BR.

Fuzhong

 

From: acrn-users@... <acrn-users@...> On Behalf Of shibi590268@...
Sent: Friday, March 11, 2022 12:16 AM
To: acrn-users@...
Subject: Re: [acrn-users] ACRN-Hypervisor build fail

 

Hello,
     Thanks. I used acrn-2022w03.5-180000p to build ACRN and launch scripts. It builds without error. If I use the latest tag I am seeing some error while running acrn_configurator. It is from 40_acpi in extractor. 

How would be the performance of rt patched ubuntu in shared scenario? I tested with cyclic test. I am seeing max time around 10 ms with average around 30 us for a loop of 50000 cycles. 

Should it be run under partitioned mode for better performance?. 
Does partition mode must need separate storage devices (passthru)?

My service vm crashes and gets powered off when trying to passthru GPU to user vm. 

Is GPU passthru working in this tag. I am using Apollo lake intel board.


Re: ACRN-Hypervisor build fail

shibi590268@...
 

Hello,
     Thanks. I used acrn-2022w03.5-180000p to build ACRN and launch scripts. It builds without error. If I use the latest tag I am seeing some error while running acrn_configurator. It is from 40_acpi in extractor. 

How would be the performance of rt patched ubuntu in shared scenario? I tested with cyclic test. I am seeing max time around 10 ms with average around 30 us for a loop of 50000 cycles. 

Should it be run under partitioned mode for better performance?. 
Does partition mode must need separate storage devices (passthru)?

My service vm crashes and gets powered off when trying to passthru GPU to user vm. 

Is GPU passthru working in this tag. I am using Apollo lake intel board.


Re: ACRN-Hypervisor build fail

Liu, Fuzhong
 

Hi Shibi

Your board.xml is generated with acrn-2022w03.2-180000p; but it is a little old for your scenario.xml.

It is preferred to generate board.xml and scenario.xml with the same codebase.

 

With the updated shared.xml; the build is passed with the latest codebase on my side.

 

 

ACRN Configuration Summary:

Build directory: /home/acrn/acrn-hypervisor/build/hypervisor

This build directory is configured with the settings below.

- BOARD = zingtron

- SCENARIO = shared

- RELEASE = n

ACRN debian package acrn-zingtron-shared-3.0-unstable.deb was successfully created in the /home/acrn/acrn-hypervisor/build.

 

 

BR.

Fuzhong

From: acrn-users@... <acrn-users@...> On Behalf Of shibi590268@...
Sent: Tuesday, March 8, 2022 5:47 PM
To: acrn-users@...
Subject: Re: [acrn-users] ACRN-Hypervisor build fail

 

Hi Liu,
   acrn-2022w03.2-180000p is the acrn-hypervisor tag I am using to build. 


Re: ACRN-Hypervisor build fail

shibi590268@...
 

Hi Liu,
   acrn-2022w03.2-180000p is the acrn-hypervisor tag I am using to build. 


Re: ACRN-Hypervisor build fail

Liu, Fuzhong
 

Hi
Could you please share the codebase info about the build fail?

 

Thanks!

 

BR.

Fuzhong

 

From: acrn-users@... <acrn-users@...> On Behalf Of shibi590268@...
Sent: Tuesday, March 8, 2022 3:53 PM
To: acrn-users@...
Subject: [acrn-users] ACRN-Hypervisor build fail

 

[Edited Message Follows]

Hello,
          I am facing the build failure when trying to build acrn-hypervisor. I have generated the board.xml and scenario.xml file as given in the procedure.
I am using kontron board which belongs to intel apollo lake APL0. I am attaching the board.xml file and scenaio xml file.

Previously, i have removed those lines to suppress the warnings and built the acrn and kernel. User vm is able to launch and worked perfectly. 
My question is are these configurations mandatory for running the user vm without any problem in future. If not, how to fix them.

Traceback (most recent call last):

  File "/home/shibi/acrn-work/acrn-hypervisor/misc/config_tools/static_allocators/main.py", line 41, in

    main(args)

  File "/home/shibi/acrn-work/acrn-hypervisor/misc/config_tools/static_allocators/main.py", line 31, in main

    module.fn(board_etree, scenario_etree, allocation_etree)

  File "/home/shibi/acrn-work/acrn-hypervisor/misc/config_tools/static_allocators/bdf.py", line 149, in fn

    native_used = get_devs_bdf_native(board_etree)

  File "/home/shibi/acrn-work/acrn-hypervisor/misc/config_tools/static_allocators/bdf.py", line 89, in get_devs_bdf_native

    dev_list.append(lib.lib.BusDevFunc(bus = bus, dev = dev, func = func))

  File "/home/shibi/acrn-work/acrn-hypervisor/misc/config_tools/static_allocators/lib/lib.py", line 46, in __init__

    raise ValueError(f"Invalid function number (0 ~ 7): {self.func:#x}")

ValueError: Invalid function number (0 ~ 7): 0xff

cp acrnlog.service /home/shibi/acrn-work/acrn-hypervisor/build/misc/debug_tools/acrnlog.service

make[2]: Leaving directory '/home/shibi/acrn-work/acrn-hypervisor/misc/debug_tools/acrn_log'

make[2]: Leaving directory '/home/shibi/acrn-work/acrn-hypervisor/misc/debug_tools/acrn_trace'

make[1]: *** No rule to make target '/home/shibi/acrn-work/acrn-hypervisor/build/hypervisor/configs/allocation.xml', needed by '/home/shibi/acrn-work/acrn-hypervisor/build/hypervisor/configs/unified.xml'.  Stop.

make[1]: Leaving directory '/home/shibi/acrn-work/acrn-hypervisor/hypervisor'

Makefile:116: recipe for target 'hvdefconfig' failed

make: *** [hvdefconfig] Error 2

make: *** Waiting for unfinished jobs....

make[3]: Leaving directory '/home/shibi/acrn-work/acrn-hypervisor/misc/debug_tools/acrn_crashlog/common'

 


Re: ACRN-Hypervisor build fail

shibi590268@...
 

Attaching the xml files

61 - 80 of 1201