[roll] Roll fuchsia [perf_mon][x86] Reduce required Perf Monitoring version from 4 -> 2

The x86 perf_mon kernel driver and cpu-trace userspace driver drive
the Intel Architectural Performance Monitoring Unit; the kernel and
userspace drivers required a version 4 or newer Performance Monitoring
Unit. (For reference, v4 is supported by Intel Skylake / Intel Goldmont
and newer CPUs natively).

Reduce the minimum required version to version 2; the differences
between version 2 and version 4 are not very large and the existing code
is quite capable of doing basic tracing on the v2 PMU.

Differences between version 2 / 3 & 4:
* Slightly different layout of IA32_PERFEVTSELx
* AnyThread bit (added in v3, but deprecated in v5. We don't use it)
* IA32_PERF_GLOBAL_STATUS freeze indicators
* Freeze_LBRs_ON_PMI -- Fuchsia has disabled support for this, since
  we had trouble with this on Skylake CPUs.

Supporting the version 2 and version 3 PMUs adds:
* (minor) Support some pre-Skylake CPUs; notably Broadwell CPUs
* QEMU/KVM only support / emulate the version 2 Architectural
  Performance Monitoring Unit, even on newer CPUs. This CR allows us
  to use the virtual / emulated PMU on VMs.

Tested:
1) qemu-kvm on Intel Apollo Lake/Goldmont:
$ cpuperf --verbose  --spec-file=/pkgfs/packages/cpuperf/0/data/basic-cpu-memory.cpspec
03734:03736> arch_perfmon_start:1484: Enabling perfmon, 2 fixed, 0 programmable, 0 misc
03734:03736> arch_perfmon_stop_locked:1631: Disabling perfmon
          |unhalted_reference_cycles|instructions_retired
Trace 0:  |               42,733,236|           9,364,816
Trace 1:  |               36,898,992|           5,038,940
Trace 2:  |               40,587,690|          33,890,484
Trace 3:  |               27,410,292|          11,436,008

2) /boot/test/mtrace on Intel Apollo Lake/Goldmont still works

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/532890
Original-Revision: 257d0784522ad9e194ebe1625284617e71c2f6da
GitOrigin-RevId: 231be4fc2a6fe8943a07786ddde75e799ef32f0c
Change-Id: Iaa37de0ab25bf80725308389afaad917588f4894
1 file changed
tree: 942e9c3887f8217960a6e4191621fb9e13d222b1
  1. garnet/
  2. infra/
  3. peridot/
  4. third_party/
  5. topaz/
  6. zircon/
  7. firmware
  8. flower
  9. jiri.lock
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.