From 4619c51b8a2a5b5fa5869748c008b71f16f8cfc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Mon, 14 Sep 2020 02:00:01 +0000 Subject: [PATCH] =?UTF-8?q?run:=20fix=20QEMU=20aarch64=20KVM=20failing=20w?= =?UTF-8?q?ith:=20"PMU=C2=A0KVM=5FSET=5FDEVICE=5FATTR:=20Invalid=20argumen?= =?UTF-8?q?t"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/run b/run index 991d53d..5bba8ff 100755 --- a/run +++ b/run @@ -616,13 +616,13 @@ Extra options to append at the end of the emulator command line. else: dp650_cmd = '' cmd.extend([ - # TODO why is it mandatory to pass mem= here? Not true for QEMU. - # Anything smaller than physical blows up as expected, but why can't it auto-detect the right value? '--machine-type', self.env['machine'], LF, ]) if not self.env['baremetal']: cmd.extend([ '--command-line', + # TODO why is it mandatory to pass mem= here? Not true for QEMU. + # Anything smaller than physical blows up as expected, but why can't it auto-detect the right value? 'earlyprintk=pl011,0x1c090000 lpj=19988480 rw loglevel=8 mem={} root=/dev/sda {}'.format(memory, kernel_cli), LF ]) cmd.extend(['--param', 'system.workload.panic_on_panic = True', LF]) @@ -758,6 +758,10 @@ Extra options to append at the end of the emulator command line. # Needed since v3.0.0 due to: # http://lists.nongnu.org/archive/html/qemu-discuss/2018-08/msg00034.html machines.append('highmem=off') + if self.env['is_arm'] and self.env['kvm']: + # Otherwise "PMU: KVM_SET_DEVICE_ATTR: Invalid argument" + # https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1661976 + machines.append('gic-version=host') machines_cli = [] for machine in machines: machines_cli.extend(['-machine', machine, LF])