qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH V1 0/4] Add vPMU vPMU support under TCG mode
@ 2017-01-12  7:04 Wei Huang
  2017-01-12  7:04 ` [Qemu-devel] [PATCH V1 1/4] target-arm: Add support for PMU register PMSELR_EL0 Wei Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Wei Huang @ 2017-01-12  7:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm, peter.maydell

QEMU has implemented cycle count support for guest VM under TCG mode.
But this feature is not complete. In fact using perf inside a
64-bit Linux guest VM (under TCG) can cause the following kernel panic
because some PMU registers are not implemented.

[  329.445970] [<fffffe000009e600>] armv8pmu_enable_event+0x58/0x8c
[  329.446713] [<fffffe0000621e74>] armpmu_start+0x4c/0x74

This patchset solves the problem by adding support for missing vPMU
registers. Basic perf test can work now under TCG by applying this
patchset.

[root@localhost ~]# perf stat ls
 Performance counter stats for 'ls':

        226.740256      task-clock (msec)         #    0.312 CPUs utilized    
                76      context-switches          #    0.335 K/sec
                 0      cpu-migrations            #    0.000 K/sec
                64      page-faults               #    0.282 K/sec
       186,031,410      cycles                    #    0.820 GHz      (36.40%)
   <not supported>      stalled-cycles-frontend
   <not supported>      stalled-cycles-backend
     <not counted>      instructions               (0.00%)
   <not supported>      branches
     <not counted>      branch-misses              (0.00%)

Thanks,
-Wei

Wei Huang (4):
  target-arm: Add support for PMU register PMSELR_EL0
  target-arm: Add support for AArch64 PMU register PMXEVTYPER_EL0
  target-arm: Add support for PMU register PMINTENSET_EL1
  target-arm: Hook up TCG vPMU with CPU pmu option

 target/arm/cpu.c    |  2 +-
 target/arm/cpu.h    |  1 +
 target/arm/helper.c | 41 +++++++++++++++++++++++++++++++++++------
 3 files changed, 37 insertions(+), 7 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-17 13:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12  7:04 [Qemu-devel] [PATCH V1 0/4] Add vPMU vPMU support under TCG mode Wei Huang
2017-01-12  7:04 ` [Qemu-devel] [PATCH V1 1/4] target-arm: Add support for PMU register PMSELR_EL0 Wei Huang
2017-01-17 13:41   ` Peter Maydell
2017-01-12  7:04 ` [Qemu-devel] [PATCH V1 2/4] target-arm: Add support for AArch64 PMU register PMXEVTYPER_EL0 Wei Huang
2017-01-17 13:43   ` Peter Maydell
2017-01-12  7:04 ` [Qemu-devel] [PATCH V1 3/4] target-arm: Add support for PMU register PMINTENSET_EL1 Wei Huang
2017-01-17 13:46   ` Peter Maydell
2017-01-12  7:04 ` [Qemu-devel] [PATCH V1 4/4] target-arm: Hook up TCG vPMU with CPU pmu option Wei Huang
2017-01-17 13:49   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).