On Wed, Sep 21, 2016 at 08:35:41AM -0500, Wei Huang wrote: > On 09/21/2016 02:53 AM, Andrew Jones wrote: > > On Tue, Sep 20, 2016 at 10:33:53PM -0400, Wei Huang wrote: [snip] > >> + if (cpu->has_pmu == ON_OFF_AUTO_ON && !kvm_enabled()) { > >> + cpu->has_pmu = ON_OFF_AUTO_OFF; > >> + if (!pmu_warned && !qtest_enabled()) { > > > > Why do we need this qtest_enabled thing? > > Without this, "make check" will print out the warning message (using a > qtest machine type). This seems to be a common practice across QEMU code.
I see. Too bad it's so ugly. Maybe we need a new error_report that hides that ugliness, i.e. an error_report that only reports when !qtest_enabled(). CC'ing Markus to get his opinion, but I'm off topic now and wouldn't expect anything like that to be worked out before accepting this patch. > > > > >> + error_report("warning: pmu can't be enabled without KVM > >> acceleration"); > >> + pmu_warned = true; > >> + } > >> + } > >> + if (cpu->has_pmu == ON_OFF_AUTO_OFF) { > >> + unset_feature(env, ARM_FEATURE_PMU); > >> + } > >> + [snip] Thanks, drew