[PATCH] powerpc/pseries: energy driver only print message when LPAR guest

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Fri Jul 21 18:02:02 AEST 2017


* Michael Ellerman <mpe at ellerman.id.au> [2017-07-21 16:33:07]:

> Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com> writes:
> > * Nicholas Piggin <npiggin at gmail.com> [2017-07-21 11:16:44]:
> >> diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
> >> index 164a13d3998a..35c891aabef0 100644
> >> --- a/arch/powerpc/platforms/pseries/pseries_energy.c
> >> +++ b/arch/powerpc/platforms/pseries/pseries_energy.c
> >> @@ -229,10 +229,9 @@ static int __init pseries_energy_init(void)
> >>  	int cpu, err;
> >>  	struct device *cpu_dev;
> >> 
> >> -	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY)) {
> >> -		printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
> >> -		return 0;
> >> -	}
> >> +	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY))
> >> +		return 0; /* H_BEST_ENERGY hcall not supported */
> >> +
> >
> > The first patch (!firmware_has_feature(FW_FEATURE_LPAR)) would be
> > ideal, but we do not have this in KVM guest case also.
> 
> Yeah we do.
> 
> It should really be called FW_FEATURE_RUNNING_UNDER_PAPR_HYPERVISOR.
> 
> static int __init probe_fw_features(unsigned long node, const char *uname, int
> 				    depth, void *data)
> {
> 	....
> 	if (!strcmp(uname, "rtas") || !strcmp(uname, "rtas at 0")) {
> 		prop = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
> 		if (prop) {
> 			powerpc_firmware_features |= FW_FEATURE_LPAR;
> 
> 
> Qemu initialises that property unconditionally in spapr_dt_rtas().

oops... I meant that FW_FEATURE_BEST_ENERGY is not found in KVM and we
will see the print needlessly.

If we have a check for phyp LPAR, then we can enable the print
"H_BEST_ENERGY hcall not supported"

Since the FW_FEATURE_LPAR is common for all PAPR guest (both pHyp and
KVM), I agree that deleting the print is the right thing to do since
we see it on both powernv and KVM where it is not supported and there
is no point reporting it.

--Vaidy



More information about the Linuxppc-dev mailing list