Discussion:
[gem5-users] m5 pseudo instructions in KVM mode x86
Mohammad Alian
2018-06-12 22:40:16 UTC
Permalink
Hi All,

Are pseudo instructions functional for x86 KVM mode? For me initparam
always returns 12288.

Thank you,
Mohammad
Gabe Black
2018-06-12 22:45:05 UTC
Permalink
I don't think so. If I remember correctly, they're mapped into a range of
NOPs and so will just not do anything on a real x86 CPU. Since nothing
"interesting" is happening as far as the virtualization hardware is
concerned, the instruction will execute on hardware and gem5 will never be
aware of it. If you use the memory mapped device which gives access to the
pseudo operations, then that should work on a KVM cpu.

Gabe
Post by Mohammad Alian
Hi All,
Are pseudo instructions functional for x86 KVM mode? For me initparam
always returns 12288.
Thank you,
Mohammad
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Mohammad Alian
2018-06-14 03:06:32 UTC
Permalink
Thank you Gabe for the reply.
But I can see that initParam function in src/sim/pseudo_inst.cc gets called
with the correct arguments, only at the application layer initparam pseudo
instruction does not return the correct value.

Here Jason provides scripts for sampling using KVM cpu based on workitems:
https://github.com/jlpresearch/gem5/tree/jason/kvm-testing/configs/myconfigs

I was wondering how workitems work in KVM but initparam doesn't. Do you
have any thoughts Jason?

Thank you,
Mohammad
Post by Gabe Black
I don't think so. If I remember correctly, they're mapped into a range of
NOPs and so will just not do anything on a real x86 CPU. Since nothing
"interesting" is happening as far as the virtualization hardware is
concerned, the instruction will execute on hardware and gem5 will never be
aware of it. If you use the memory mapped device which gives access to the
pseudo operations, then that should work on a KVM cpu.
Gabe
Post by Mohammad Alian
Hi All,
Are pseudo instructions functional for x86 KVM mode? For me initparam
always returns 12288.
Thank you,
Mohammad
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Jason Lowe-Power
2018-06-14 20:49:00 UTC
Permalink
Hi Mohammad,

In KVM mode the magic instructions are mapped to MMIO accesses. (See the
implementation of the user-mode side in util/m5/.) There is a specific part
of physical memory that is mapped for the magic instructions. For x86 I
believe it is somewhere between 3GB and 4GB. See
https://github.com/jlpresearch/gem5/blob/jason/kvm-testing/configs/myconfigs/system/system.py#L407
.

The most likely problem is just that initparam isn't implemented correctly
in either the user-mode side or in the simulator. I would try running with
the PseudoInst debug flag and see what's going on.

Cheers,
Jason
Post by Mohammad Alian
Thank you Gabe for the reply.
But I can see that initParam function in src/sim/pseudo_inst.cc gets
called with the correct arguments, only at the application layer initparam
pseudo instruction does not return the correct value.
https://github.com/jlpresearch/gem5/tree/jason/kvm-testing/configs/myconfigs
I was wondering how workitems work in KVM but initparam doesn't. Do you
have any thoughts Jason?
Thank you,
Mohammad
Post by Gabe Black
I don't think so. If I remember correctly, they're mapped into a range of
NOPs and so will just not do anything on a real x86 CPU. Since nothing
"interesting" is happening as far as the virtualization hardware is
concerned, the instruction will execute on hardware and gem5 will never be
aware of it. If you use the memory mapped device which gives access to the
pseudo operations, then that should work on a KVM cpu.
Gabe
Post by Mohammad Alian
Hi All,
Are pseudo instructions functional for x86 KVM mode? For me initparam
always returns 12288.
Thank you,
Mohammad
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Loading...