powertop crashes inside intel kvm machine

Bug #1541837 reported by Ryan Harper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
powertop (Ubuntu)
New
Undecided
Unassigned

Bug Description

Running powertop inside a KVM intel VM crashes with this output:

  unknown op '{'
                read_msr cpu0 0xe8 : Input/output error

powertop should not crash out to prompt.

Upstream patch supposed to address this:
   https://github.com/fenrus75/powertop/commit/037906c55374cbf045f197b43c22314617dbfc21

1. $ lsb_release -rd
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04

2. $ apt-cache policy powertop
powertop:
  Installed: 2.8-1
  Candidate: 2.8-1
  Version table:
 *** 2.8-1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

3. sudo powertop should startup and run as it does on baremetal (without error)

4. sudo powertop exits 254 and with the message above.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: powertop 2.8-1
ProcVersionSignature: User Name 4.3.0-7.18-generic 4.3.3
Uname: Linux 4.3.0-7-generic x86_64
ApportVersion: 2.19.4-0ubuntu1
Architecture: amd64
Date: Thu Feb 4 11:30:02 2016
Ec2AMI: ami-0000079f
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.large
Ec2Kernel: None
Ec2Ramdisk: None
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: powertop
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Ryan Harper (raharper) wrote :

The suggested patch in my original report is already applied.

Instead, I believe this is an issue under KVM where the MSR powertop is using (IA32_APERF, 0xe8) is an unimplemented MSR.

http://www.spinics.net/lists/kvm/msg120054.html

Ideally powertop would detect it's running under KVM and avoid using unimplemented MSRs. For example if could skip sampling the IA32_APERF MSR and use only TSC records.

Alternatively, powertop could have a more robust get_msr() method which handled failure with fallback behavior (and warn of reduced accuracy due to unavailable MSRs).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.