From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZLd4-0004ie-I3 for qemu-devel@nongnu.org; Mon, 15 Aug 2016 13:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZLd2-0000jP-6g for qemu-devel@nongnu.org; Mon, 15 Aug 2016 13:24:49 -0400 Message-ID: <1471281878.3003.13.camel@redhat.com> From: Andrea Bolognani Date: Mon, 15 Aug 2016 19:24:38 +0200 In-Reply-To: <57B1EA05.2050908@redhat.com> References: <1471067570-7503-1-git-send-email-wei@redhat.com> <1471253464.3003.5.camel@redhat.com> <57B1EA05.2050908@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V1 1/1] arm64: Add an option to turn on/off host-backed vPMU support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Huang , qemu-arm@nongnu.org Cc: peter.maydell@linaro.org, drjones@redhat.com, shannon.zhao@linaro.org, qemu-devel@nongnu.org On Mon, 2016-08-15 at 11:12 -0500, Wei Huang wrote: > > Did you already try driving this with libvirt? It should work > > out of the box. > >=C2=A0 > > If you haven't, I will do it :) >=C2=A0 > No, I haven't. All tests were done based on command line to QEMU. :-) Fair enough :) I did some testing on my own using libvirt to drive a QEMU binary that included your patch, and it looks like everything is working as expected: if I turn PMU on using the appropriate XML element () I can access the performance counters from inside the guest; if I disable it explicitly or don't enable it, I can't. The host-side testing involved making sure the 'pmu' flag was passed, or not passed, to QEMU and the value, if any, matched the guest XML. The guest-side testing involved running =C2=A0 $ dmesg | grep -i pmu =C2=A0 $ perf list | grep 'Hardware event' and making sure some output was returned in both cases, and making sure the 'instructions' counter was not marked as '' in the output of =C2=A0 $ perf stat true If the kind of testing I performed is not good enough, please let me know and I'll do another round. This was tested only with (the libvirt equivalent of -cpu host), because the aarch64 CPU driver in libvirt is not currently capable of handling other CPU models for KVM guests. I also verified that TCG guests didn't accept the 'pmu' flag. --=C2=A0 Andrea Bolognani / Red Hat / Virtualization