[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU
From: |
Andrew Jones |
Subject: |
Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU |
Date: |
Tue, 25 Oct 2016 09:33:27 +0200 |
User-agent: |
Mutt/1.6.0.1 (2016-04-01) |
On Mon, Oct 24, 2016 at 11:39:59PM -0500, Wei Huang wrote:
> >> V6->V7:
> >> * change has_pmu variable type from OnOffAuto to Boolean
> >> * only add "pmu" property to CPU under kvm mode, default ON
> >
> > Hmm, if we don't allow the property with TCG then switching a guest from
> > KVM to TCG will require more than just an accelerator switch. That's a
> > bit annoying and I think we'd have to teach it to libvirt too. I'd prefer
> >
> > -M virt-2.8,accel=tcg -cpu cortex-a57 NO NO
> > -M virt-2.8,accel=tcg -cpu cortex-a57,pmu=off NO NO
> > -M virt-2.8,accel=tcg -cpu cortex-a57,pmu=on NO "Warning: PMU not
> > yet supported with TCG" (or something)
>
> I am fine with this request. But note that, if we enforce
> pmu-default=ON, we can't tell "-cpu cortex-a57" apart from
> "cortex-a57,pmu=on", implying that we have to print the warning msg for
> the case of "cortex-a57" as well (this was why we switch to tri-state
> before). To solve this problem, we have to switch from pmu-default=ON to
> pmu-default=OFF under TCG mode, something like:
>
> if (arm_feature(&cpu->env, ARM_FEATURE_PMU)) {
> qdev_property_add_static(DEVICE(obj),
> &arm_cpu_has_pmu_property, &error_abort);
> if (!kvm_enabled())
> object_property_set_bool(obj, false, "pmu", NULL);
> }
>
> Then we do:
> if (cpu->has_pmu && !kvm_enabled()) {
> cpu->has_pmu = false;
> if (!pmu_warned && !qtest_enabled()) {
> error_report("warning: pmu not supported under TCG");
> pmu_warned = true;
> }
> }
>
> This will work. Are you and Peter OK with this solution?
>
Yes, I prefer it to not being able to easily switch a command line from
KVM to TCG. Granted, right now we mostly need to run with -cpu host for
KVM, which also needs to be switched for TCG. However that will hopefully
change with Shannon's work.
Thanks,
drew
- [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Wei Huang, 2016/10/21
- [Qemu-devel] [PATCH V7 2/2] arm: virt: add PMU property to mach-virt machine type, Wei Huang, 2016/10/21
- [Qemu-devel] [PATCH V7 1/2] arm: Add an option to turn on/off vPMU support, Wei Huang, 2016/10/21
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Andrew Jones, 2016/10/24
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Wei Huang, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU,
Andrew Jones <=
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Peter Maydell, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Peter Maydell, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Wei Huang, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Wei Huang, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Andrew Jones, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Wei Huang, 2016/10/25
- Re: [Qemu-devel] [PATCH V7 0/2] Add option to configure guest vPMU, Andrew Jones, 2016/10/26