Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
build: Add "pmu=off" to default cpu_features option
Browse files Browse the repository at this point in the history
The user sometimes doesn't care about pmu usage(e.g. perf tool profiling).
But pmu will cost significant overhead on boot time and virtualization
context switch. E.g. on arm64, if guest pmu is enabled, kvm should save
and restore all PMU registers when guest/host switching.

for dmesg comparision:
Before:
[    0.007620] bus: 'platform': driver_probe_device: matched device pmu with driver armv8-pmu
[    0.007622] bus: 'platform': really_probe: probing driver armv8-pmu with device pmu
[    0.036282] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    0.036285] driver: 'armv8-pmu': driver_bound: bound to device 'pmu'
[    0.036295] bus: 'platform': really_probe: bound device pmu to driver armv8-pmu

After:
[    0.007935] bus: 'platform': driver_probe_device: matched device alarmtimer with driver alarmtimer
[    0.007937] bus: 'platform': really_probe: probing driver alarmtimer with device alarmtimer
[    0.007940] driver: 'alarmtimer': driver_bound: bound to device 'alarmtimer'
[    0.007944] bus: 'platform': really_probe: bound device alarmtimer to driver alarmtimer

Because s390 doest support "pmu=off", keep the default CPUFEATURES to be ""
instead of "pmu=off".

Fixes: #2576
Signed-off-by: Jia He <[email protected]>
  • Loading branch information
justin-he authored and Julio Montes committed May 15, 2020
1 parent f03c17d commit 41a06d4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ USER_VARS += KERNELTYPE_ACRN
USER_VARS += KERNELTYPE_CLH
USER_VARS += FIRMWAREPATH
USER_VARS += MACHINEACCELERATORS
USER_VARS += CPUFEATURES
USER_VARS += DEFMACHINETYPE_CLH
USER_VARS += KERNELPARAMS
USER_VARS += LIBEXECDIR
Expand Down Expand Up @@ -604,6 +605,7 @@ $(GENERATED_FILES): %: %.in $(MAKEFILE_LIST) VERSION .git-commit
-e "s|@INITRDPATH@|$(INITRDPATH)|g" \
-e "s|@FIRMWAREPATH@|$(FIRMWAREPATH)|g" \
-e "s|@MACHINEACCELERATORS@|$(MACHINEACCELERATORS)|g" \
-e "s|@CPUFEATURES@|$(CPUFEATURES)|g" \
-e "s|@FIRMWAREPATH_CLH@|$(FIRMWAREPATH_CLH)|g" \
-e "s|@DEFMACHINETYPE_CLH@|$(DEFMACHINETYPE_CLH)|g" \
-e "s|@KERNELPARAMS@|$(KERNELPARAMS)|g" \
Expand Down
1 change: 1 addition & 0 deletions arch/amd64-options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
MACHINETYPE := pc
KERNELPARAMS :=
MACHINEACCELERATORS :=
CPUFEATURES := pmu=off

QEMUCMD := qemu-system-x86_64

Expand Down
1 change: 1 addition & 0 deletions arch/arm64-options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
MACHINETYPE := virt
KERNELPARAMS :=
MACHINEACCELERATORS :=
CPUFEATURES := pmu=off

QEMUCMD := qemu-system-aarch64

Expand Down
2 changes: 2 additions & 0 deletions arch/ppc64le-options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
MACHINETYPE := pseries
KERNELPARAMS :=
MACHINEACCELERATORS :=
CPUFEATURES := pmu=off

KERNELTYPE := uncompressed #This architecture must use an uncompressed kernel.
QEMUCMD := qemu-system-ppc64le
1 change: 1 addition & 0 deletions arch/s390x-options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
MACHINETYPE := s390-ccw-virtio
KERNELPARAMS :=
MACHINEACCELERATORS :=
CPUFEATURES :=

QEMUCMD := qemu-system-s390x

0 comments on commit 41a06d4

Please sign in to comment.