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


Minggui Cao
 

I don’t meet that issue.   If you have Pre-launched RTVM / Service VM, you can check in ACRN console:   vm_list

And then vm_console  N to switch the VM console.

 

Thanks

Minggui

 

From: acrn-users@... <acrn-users@...> On Behalf Of Paolo Crotti
Sent: Thursday, March 31, 2022 1:07 AM
To: acrn-users@...
Cc: 204572@...
Subject: Re: [acrn-users] Using perf to access hardware events in pre-launched VM

 

IT WORKS! I set the scenario as you said and now I can read the cache events.

 

Thank you so much for the help.

 

Only one small note: when I use the GUEST_FLAG_LAPIC_PASSTHROUGH flag, the terminal of the VM (minicom) becomes unresponsive. When I start the VM, I see some of the kernel messages: it displays only the ones with the time (like [    1.299022] Run /init as init process) and none with the "ok" (like [  OK  ] Started WPA supplicant.). I cannot write or interact in any way with the shell.

It seems that, for some reason, it no longer shows the stdout and doesn't get the stdin.

It's not a real problem because the kernel starts correctly and I connect to the machine via SSH, still it's strange because it happens only with that flag.

 

Anyway, thanks again for your help.

 

On Wed, 30 Mar 2022 at 02:40, Minggui Cao <minggui.cao@...> wrote:

That is reasonable. It means APIC pass-through not set. Let me check,

 

 

  1. You can refer this file to modify yours:

misc/config_tools/data/whl-ipc-i5/hybrid_rt.xml

 

 

  <vm id="0">

    <vm_type>PRE_RT_VM</vm_type>

    <name>PRE_RT_VM0</name>

    <guest_flags>

      <guest_flag>GUEST_FLAG_LAPIC_PASSTHROUGH</guest_flag>

      <guest_flag>GUEST_FLAG_RT</guest_flag>

    </guest_flags>

 

 

  1. After you build hypervisor, you can check:

build/hypervisor/configs/scenarios/hybrid_rt/vm_configurations.c:23:            .guest_flags = (GUEST_FLAG_STATIC_VM | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT),

 

 

good luck.

 

 

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

 

Hi Minggui,

I'm sorry, I didn't realize I had to read the 0x186 register from inside the VM. I had read it from the ACRN shell (ACRN: \> rdmsr 0x186).

Actually, I cannot read these registers from the virtual machine. In addition, when I try to read them I got two strange error messages:

usb-ubuntu@usbubuntu-C93:~$ sudo rdmsr 0x186[1131822537us][cpu=0][vm0:vcpu0][sev=1][seq=44]:dispatch VM exit handler failed for reason 31, ret = -13!

rdmsr: CPU 0 cannot read MSR 0x00000186

usb-ubuntu@usbubuntu-C93:~$ sudo rdmsr 0x38f[1149902298us][cpu=0][vm0:vcpu0][sev=1][seq=46]:dispatch VM exit handler failed for reason 31, ret = -13!

rdmsr: CPU 0 cannot read MSR 0x0000038f

 

Join {acrn-users@lists.projectacrn.org to automatically receive all group messages.