Skip to content

Commit 103423a

Browse files
Marc Zyngierwilldeacon
authored andcommitted
arm64: Get rid of ARM64_HAS_NO_HW_PREFETCH
Back in 2016, it was argued that implementations lacking a HW prefetcher could be helped by sprinkling a number of PRFM instructions in strategic locations. In 2023, the one platform that presumably needed this hack is no longer in active use (let alone maintained), and an quick experiment shows dropping this hack only leads to a 0.4% drop on a full kernel compilation (tested on a MT30-GS0 48 CPU system). Given that this is pretty much in the noise department and that it may give odd ideas to other implementers, drop the hack for good. Suggested-by: Will Deacon <will@kernel.org> Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20231122133754.1240687-1-maz@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent 2cc14f5 commit 103423a

3 files changed

Lines changed: 0 additions & 28 deletions

File tree

arch/arm64/kernel/cpufeature.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,16 +1584,6 @@ static bool has_useable_gicv3_cpuif(const struct arm64_cpu_capabilities *entry,
15841584
return has_sre;
15851585
}
15861586

1587-
static bool has_no_hw_prefetch(const struct arm64_cpu_capabilities *entry, int __unused)
1588-
{
1589-
u32 midr = read_cpuid_id();
1590-
1591-
/* Cavium ThunderX pass 1.x and 2.x */
1592-
return midr_is_cpu_model_range(midr, MIDR_THUNDERX,
1593-
MIDR_CPU_VAR_REV(0, 0),
1594-
MIDR_CPU_VAR_REV(1, MIDR_REVISION_MASK));
1595-
}
1596-
15971587
static bool has_cache_idc(const struct arm64_cpu_capabilities *entry,
15981588
int scope)
15991589
{
@@ -2321,12 +2311,6 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
23212311
ARM64_CPUID_FIELDS(ID_AA64ISAR0_EL1, ATOMIC, IMP)
23222312
},
23232313
#endif /* CONFIG_ARM64_LSE_ATOMICS */
2324-
{
2325-
.desc = "Software prefetching using PRFM",
2326-
.capability = ARM64_HAS_NO_HW_PREFETCH,
2327-
.type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE,
2328-
.matches = has_no_hw_prefetch,
2329-
},
23302314
{
23312315
.desc = "Virtualization Host Extensions",
23322316
.capability = ARM64_HAS_VIRT_HOST_EXTN,

arch/arm64/lib/copy_page.S

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
* x1 - src
1919
*/
2020
SYM_FUNC_START(__pi_copy_page)
21-
alternative_if ARM64_HAS_NO_HW_PREFETCH
22-
// Prefetch three cache lines ahead.
23-
prfm pldl1strm, [x1, #128]
24-
prfm pldl1strm, [x1, #256]
25-
prfm pldl1strm, [x1, #384]
26-
alternative_else_nop_endif
27-
2821
ldp x2, x3, [x1]
2922
ldp x4, x5, [x1, #16]
3023
ldp x6, x7, [x1, #32]
@@ -39,10 +32,6 @@ alternative_else_nop_endif
3932
1:
4033
tst x0, #(PAGE_SIZE - 1)
4134

42-
alternative_if ARM64_HAS_NO_HW_PREFETCH
43-
prfm pldl1strm, [x1, #384]
44-
alternative_else_nop_endif
45-
4635
stnp x2, x3, [x0, #-256]
4736
ldp x2, x3, [x1]
4837
stnp x4, x5, [x0, #16 - 256]

arch/arm64/tools/cpucaps

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ HAS_LDAPR
4040
HAS_LSE_ATOMICS
4141
HAS_MOPS
4242
HAS_NESTED_VIRT
43-
HAS_NO_HW_PREFETCH
4443
HAS_PAN
4544
HAS_S1PIE
4645
HAS_RAS_EXTN

0 commit comments

Comments
 (0)