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

Commit

Permalink
qemu: Remove pmu limitation in nested virtualization of amd/ppc64le
Browse files Browse the repository at this point in the history
It's up to the user enable/disable pmu. After previous commit, the default
pmu option has been set to off.

This patch removes the hard limitation and unit test codes.

Fixes: #2576
Signed-off-by: Jia He <[email protected]>
  • Loading branch information
justin-he authored and Julio Montes committed May 15, 2020
1 parent 41a06d4 commit 18662e1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions virtcontainers/qemu_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ func (q *qemuAmd64) bridges(number uint32) {

func (q *qemuAmd64) cpuModel() string {
cpuModel := defaultCPUModel
if q.nestedRun {
cpuModel += ",pmu=off"
}

// VMX is not migratable yet.
// issue: https://github.com/kata-containers/runtime/issues/1750
Expand Down
5 changes: 0 additions & 5 deletions virtcontainers/qemu_amd64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ func TestQemuAmd64CPUModel(t *testing.T) {
model := amd64.cpuModel()
assert.Equal(expectedOut, model)

amd64.enableNestingChecks()
expectedOut = defaultCPUModel + ",pmu=off"
model = amd64.cpuModel()
assert.Equal(expectedOut, model)

amd64.disableNestingChecks()
base, ok := amd64.(*qemuAmd64)
assert.True(ok)
Expand Down
4 changes: 1 addition & 3 deletions virtcontainers/qemu_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ func (q *qemuPPC64le) bridges(number uint32) {

func (q *qemuPPC64le) cpuModel() string {
cpuModel := defaultCPUModel
if q.nestedRun {
cpuModel += ",pmu=off"
}

return cpuModel
}

Expand Down
5 changes: 0 additions & 5 deletions virtcontainers/qemu_ppc64le_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ func TestQemuPPC64leCPUModel(t *testing.T) {
expectedOut := defaultCPUModel
model := ppc64le.cpuModel()
assert.Equal(expectedOut, model)

ppc64le.enableNestingChecks()
expectedOut = defaultCPUModel + ",pmu=off"
model = ppc64le.cpuModel()
assert.Equal(expectedOut, model)
}

func getQemuVersion() (qemuMajorVersion int, qemuMinorVersion int) {
Expand Down

0 comments on commit 18662e1

Please sign in to comment.