Skip to content

Commit abf110f

Browse files
committed
powerpc/rfi-flush: Make it possible to call setup_rfi_flush() again
For PowerVM migration we want to be able to call setup_rfi_flush() again after we've migrated the partition. To support that we need to check that we're not trying to allocate the fallback flush area after memblock has gone away (i.e., boot-time only). Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Mauricio Faria de Oliveira <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 1e2a9fc commit abf110f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

arch/powerpc/include/asm/setup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum l1d_flush_type {
4949
L1D_FLUSH_MTTRIG = 0x8,
5050
};
5151

52-
void __init setup_rfi_flush(enum l1d_flush_type, bool enable);
52+
void setup_rfi_flush(enum l1d_flush_type, bool enable);
5353
void do_rfi_flush_fixups(enum l1d_flush_type types);
5454

5555
#endif /* !__ASSEMBLY__ */

arch/powerpc/kernel/setup_64.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,10 @@ static void init_fallback_flush(void)
860860
u64 l1d_size, limit;
861861
int cpu;
862862

863+
/* Only allocate the fallback flush area once (at boot time). */
864+
if (l1d_flush_fallback_area)
865+
return;
866+
863867
l1d_size = ppc64_caches.l1d.size;
864868
limit = min(ppc64_bolted_size(), ppc64_rma_size);
865869

@@ -877,7 +881,7 @@ static void init_fallback_flush(void)
877881
}
878882
}
879883

880-
void __init setup_rfi_flush(enum l1d_flush_type types, bool enable)
884+
void setup_rfi_flush(enum l1d_flush_type types, bool enable)
881885
{
882886
if (types & L1D_FLUSH_FALLBACK) {
883887
pr_info("rfi-flush: Using fallback displacement flush\n");

0 commit comments

Comments
 (0)