Skip to content

Commit

Permalink
qemu: set the cpu type to max
Browse files Browse the repository at this point in the history
RHEL9 and therefore the dependent distributions and base containers have
a minimum microarchitechture level of x86-64-v2.[1]

The default cpu level of the qemu driver on an Intel Mac is x86-64-v1
even if the host cpu has the x86-64-v2 capability. Using the cpu type of
max allows qemu to use all the host cpu capabilities that is also
supported by the hypervisor framework.[2]

This was fixed for linux host by changing the default within qemu but it
wasn't changed for MacOS.

[1] https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level
[2] https://gitlab.com/qemu-project/qemu/-/issues/1686#note_1417714887
[3] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04066.html

Signed-off-by: Raghavendra Talur <[email protected]>
  • Loading branch information
raghavendra-talur committed Sep 14, 2023
1 parent 08233d0 commit 8716ac0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/minikube/registry/drvs/qemu2/qemu2.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
switch runtime.GOARCH {
case "amd64":
qemuMachine = "" // default
qemuCPU = "" // default
// set cpu type to max to enable higher microarchitecture levels
// see https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04066.html for details
qemuCPU = "max"
case "arm64":
qemuMachine = "virt"
qemuCPU = "cortex-a72"
Expand Down

0 comments on commit 8716ac0

Please sign in to comment.