[PATCH 2/3] rfi-flush: Make it possible to call setup_rfi_flush() again

Michael Ellerman mpe at ellerman.id.au
Tue Mar 6 23:15:45 AEDT 2018

Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com> writes:

> Hi Michael, Michal,
> I got back from vacation. Checking this one.

Yeah it got stuck in a rut.

> On 02/20/2018 02:06 PM, Michal Suchánek wrote:
>>> I did it the way I did because otherwise we waste memory on every
>>> system on earth just to support a use case that we don't actually
>>> intend for anyone to ever use - ie. migrating from a patched machine
>>> to an unpatched machine.
> If this thread eventually closes in 'ok, so that memory has to be
> reserved/wasted anyway', that can be done only in pseries, right?
> It seems not so much memory for this particular platform/hardware.

Yes and no. We certainly have pseries machines with 10s of TBs of
memory, but pseries is also used when running on KVM/Openstack where
some people are interested in running small VMs - so as usual it's not
so simple :)

But it's not *that* much memory so we should probably stop worrying
about it and just always allocate the fallback on pseries.

I *think* the patch below is all we need, as well as some tweaking of
patch 2, are you able to test and repost?


diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 1a527625acf7..9116824bd7c5 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -468,26 +468,18 @@ static void pseries_setup_rfi_flush(void)
 	/* Enable by default */
 	enable = true;
 	rc = plpar_get_cpu_characteristics(&result);
 	if (rc == H_SUCCESS) {
-		types = L1D_FLUSH_NONE;
 		if (result.character & H_CPU_CHAR_L1D_FLUSH_TRIG2)
 			types |= L1D_FLUSH_MTTRIG;
 		if (result.character & H_CPU_CHAR_L1D_FLUSH_ORI30)
 			types |= L1D_FLUSH_ORI;
-		/* Use fallback if nothing set in hcall */
-		if (types == L1D_FLUSH_NONE)
-			types = L1D_FLUSH_FALLBACK;
 		if ((!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) ||
 		    (!(result.behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)))
 			enable = false;
-	} else {
-		/* Default to fallback if case hcall is not available */
-		types = L1D_FLUSH_FALLBACK;
 	setup_rfi_flush(types, enable);

More information about the Linuxppc-dev mailing list