diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index 041aeb5a..044450fa 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -126,6 +126,12 @@ def arguments_qemu(subparser): ret.add_argument("--no-kvm", dest="qemu_kvm", default=True, action='store_false', help="Avoid using hardware-assisted virtualization with KVM " "even when available (SLOW!)") + ret.add_argument("--cpu", dest="qemu_cpu", + help="Override emulated QEMU CPU. By default, the host CPU " + "will be emulated when using KVM and the QEMU default otherwise " + "(usually a CPU with minimal features). " + "A useful value is 'max' (emulate all features that are available), " + "use --cpu help to get a list of possible values from QEMU.") ret.add_argument("--tablet", dest="qemu_tablet", action='store_true', default=False, help="Use 'tablet' instead of 'mouse' input " diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 54bbdfc8..777fe7a4 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -146,9 +146,13 @@ def command_qemu(args, arch, img_path): native = args.arch_native == args.deviceinfo["arch"] if args.qemu_kvm and native and os.path.exists("/dev/kvm"): command += ["-enable-kvm"] + command += ["-cpu", "host"] else: logging.info("WARNING: QEMU is not using KVM and will run slower!") + if args.qemu_cpu: + command += ["-cpu", args.qemu_cpu] + display = args.qemu_display if display != "none": display += ",gl=" + ("on" if args.qemu_gl else "off")