Add HiSilicon SoC quirk for cpufreq

Bug #1821620 reported by dann frazier on 2019-03-25
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Undecided
dann frazier
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned
Disco
Undecided
dann frazier

Bug Description

[Impact]
Some HiSilicon SoCs do not implement registers that the cpufreq subsystem uses to calculate current performance. This can result in undefined data being used in internal calculations, and being exposed to userspace via sysfs.

[Test Case]
Examine the exposed frequency under idle and load and make sure it looks sane:
sudo cat /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_cur_freq

Note: On my test system, it happens to look sane w/o this quirk as well. This is because the undefined reads all happen to return 0x1 today, and that puts us into the avoid-divide-by-zero code path that happens to do the same thing as this quirk (report desired perf instead of actual).

[Fix]
6c8d750f9784c cpufreq / cppc: Work around for Hisilicon CPPC cpufreq
1757d05f3112a ACPI / CPPC: Add a helper to get desired performance

[Regression Risk]
The fix is a quirk restricted to specific SoCs. It does rely on firmware behaving (overloading the desired_perf register w/ a correct actual perf value), so changes in firmware could lead to regressions.

CVE References

dann frazier (dannf) on 2019-03-25
Changed in linux (Ubuntu Disco):
status: New → In Progress
assignee: nobody → dann frazier (dannf)
dann frazier (dannf) on 2019-03-25
description: updated
Seth Forshee (sforshee) on 2019-03-26
Changed in linux (Ubuntu Disco):
status: In Progress → Fix Committed
dann frazier (dannf) on 2019-03-27
Changed in linux (Ubuntu Cosmic):
status: New → Invalid
Changed in linux (Ubuntu Bionic):
status: New → Invalid
Launchpad Janitor (janitor) wrote :
Download full text (50.5 KiB)

This bug was fixed in the package linux - 5.0.0-11.12

---------------
linux (5.0.0-11.12) disco; urgency=medium

  * linux: 5.0.0-11.12 -proposed tracker (LP: #1824383)

  * hns3: PPU_PF_ABNORMAL_INT_ST over_8bd_no_fe found [error status=0x1]
    (LP: #1824194)
    - net: hns3: fix for not calculating tx bd num correctly

  * disco: unable to use iptables/enable ufw under -virtual kernel
    (LP: #1823862)
    - [Packaging] add bpfilter to linux-modules

  * Make shiftfs a module rather than built-in (LP: #1824354)
    - [Config] CONFIG_SHIFT_FS=m

  * shiftfs: chown sets untranslated ids in lower fs (LP: #1824350)
    - SAUCE: shiftfs: use translated ids when chaning lower fs attrs

  * [Hyper-V] KVP daemon fails to start on first boot of disco VM (LP: #1820063)
    - [Packaging] bind hv_kvp_daemon startup to hv_kvp device

linux (5.0.0-10.11) disco; urgency=medium

  * linux: 5.0.0-10.11 -proposed tracker (LP: #1823936)

  * Apparmor enforcement failure in lxc selftests (LP: #1823379)
    - SAUCE: apparmor: Restore Y/N in /sys for apparmor's "enabled"

  * systemd cause kernel trace "BUG: unable to handle kernel paging request at
    6db23a14" on Cosmic i386 (LP: #1813244)
    - openvswitch: fix flow actions reallocation

linux (5.0.0-9.10) disco; urgency=medium

  * linux: 5.0.0-9.10 -proposed tracker (LP: #1823228)

  * Packaging resync (LP: #1786013)
    - [Packaging] resync git-ubuntu-log
    - [Packaging] update helper scripts
    - [Packaging] resync retpoline extraction

  * Huawei Hi1822 NIC has poor performance (LP: #1820187)
    - net-next/hinic: replace disable_irq_nosync/enable_irq

  * Add uid shifting overlay filesystem (shiftfs) (LP: #1823186)
    - shiftfs: uid/gid shifting bind mount
    - shiftfs: rework and extend
    - shiftfs: support some btrfs ioctls
    - [Config] enable shiftfs

  * Cannot boot or install - have to use nomodeset (LP: #1821820)
    - Revert "drm/i915/fbdev: Actually configure untiled displays"

  * Disco update: v5.0.6 upstream stable release (LP: #1823060)
    - netfilter: nf_tables: fix set double-free in abort path
    - dccp: do not use ipv6 header for ipv4 flow
    - genetlink: Fix a memory leak on error path
    - gtp: change NET_UDP_TUNNEL dependency to select
    - ipv6: make ip6_create_rt_rcu return ip6_null_entry instead of NULL
    - mac8390: Fix mmio access size probe
    - mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S
    - net: aquantia: fix rx checksum offload for UDP/TCP over IPv6
    - net: datagram: fix unbounded loop in __skb_try_recv_datagram()
    - net/packet: Set __GFP_NOWARN upon allocation in alloc_pg_vec
    - net: phy: meson-gxl: fix interrupt support
    - net: rose: fix a possible stack overflow
    - net: stmmac: fix memory corruption with large MTUs
    - net-sysfs: call dev_hold if kobject_init_and_add success
    - net: usb: aqc111: Extend HWID table by QNAP device
    - packets: Always register packet sk in the same order
    - rhashtable: Still do rehash when we get EEXIST
    - sctp: get sctphdr by offset in sctp_compute_cksum
    - sctp: use memdup_user instead of vmemdup_user
    - tcp: do not use ipv6 header for ipv4 flow
    - tipc: allow servic...

Changed in linux (Ubuntu Disco):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers