* Re: [PATCH] ARM: 8936/1: decompressor: avoid CP15 barrier instructions in v7 cache setup code [not found] <20200125173950.GA19126@roeck-us.net> @ 2020-01-25 18:06 ` Russell King - ARM Linux admin 2020-01-25 18:12 ` Ard Biesheuvel 0 siblings, 1 reply; 2+ messages in thread From: Russell King - ARM Linux admin @ 2020-01-25 18:06 UTC (permalink / raw) To: Guenter Roeck Cc: Marc Zyngier, linux-kernel, linux-arm-kernel, Ard Biesheuvel On Sat, Jan 25, 2020 at 09:39:50AM -0800, Guenter Roeck wrote: > Hi, > > On Fri, Nov 08, 2019 at 01:44:32PM +0100, Ard Biesheuvel wrote: > > Commit e17b1af96b2afc38e684aa2f1033387e2ed10029 > > > > "ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache" > > > > added some explicit handling of the CP15BEN bit in the SCTLR system > > register, to ensure that CP15 barrier instructions are enabled, even > > if we enter the decompressor via the EFI stub. > > > > However, as it turns out, there are other ways in which we may end up > > using CP15 barrier instructions without them being enabled. I.e., when > > the decompressor startup code skips the cache_on() initially, we end > > up calling cache_clean_flush() with the caches and MMU off, in which > > case the CP15BEN bit in SCTLR may not be programmed either. And in > > fact, cache_on() itself issues CP15 barrier instructions before actually > > enabling them by programming the new SCTLR value (and issuing an ISB) > > > > Since all these routines are specific to v7, let's clean this up by > > using the ordinary v7 barrier instructions in the v7 specific cache > > handling routines, so that we never rely on the CP15 ones. This also > > avoids the issue where a barrier is required between programming SCTLR > > and using the CP15 barrier instructions, which would result in two > > different kinds of barriers being used in the same function. > > > > Acked-by: Marc Zyngier <maz@kernel.org> > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> > > This patch causes all qemu emulations for ARM1176 to fail hard (stall with > no console output even with earlycon enabled). This affects witherspoon-bmc, > ast2500-evb, romulus-bmc, and swift-bmc. It does not affect emulations > for other CPU types, even with the same kernel configuration (such as > ast2600-evb). Hmm, looks like we're going to have to drop 8936/1, 8941/1 and 8942/1 in that case. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: 8936/1: decompressor: avoid CP15 barrier instructions in v7 cache setup code 2020-01-25 18:06 ` [PATCH] ARM: 8936/1: decompressor: avoid CP15 barrier instructions in v7 cache setup code Russell King - ARM Linux admin @ 2020-01-25 18:12 ` Ard Biesheuvel 0 siblings, 0 replies; 2+ messages in thread From: Ard Biesheuvel @ 2020-01-25 18:12 UTC (permalink / raw) To: Russell King - ARM Linux admin Cc: Marc Zyngier, linux-arm-kernel, Guenter Roeck, Linux Kernel Mailing List On Sat, 25 Jan 2020 at 19:06, Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote: > > On Sat, Jan 25, 2020 at 09:39:50AM -0800, Guenter Roeck wrote: > > Hi, > > > > On Fri, Nov 08, 2019 at 01:44:32PM +0100, Ard Biesheuvel wrote: > > > Commit e17b1af96b2afc38e684aa2f1033387e2ed10029 > > > > > > "ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache" > > > > > > added some explicit handling of the CP15BEN bit in the SCTLR system > > > register, to ensure that CP15 barrier instructions are enabled, even > > > if we enter the decompressor via the EFI stub. > > > > > > However, as it turns out, there are other ways in which we may end up > > > using CP15 barrier instructions without them being enabled. I.e., when > > > the decompressor startup code skips the cache_on() initially, we end > > > up calling cache_clean_flush() with the caches and MMU off, in which > > > case the CP15BEN bit in SCTLR may not be programmed either. And in > > > fact, cache_on() itself issues CP15 barrier instructions before actually > > > enabling them by programming the new SCTLR value (and issuing an ISB) > > > > > > Since all these routines are specific to v7, let's clean this up by > > > using the ordinary v7 barrier instructions in the v7 specific cache > > > handling routines, so that we never rely on the CP15 ones. This also > > > avoids the issue where a barrier is required between programming SCTLR > > > and using the CP15 barrier instructions, which would result in two > > > different kinds of barriers being used in the same function. > > > > > > Acked-by: Marc Zyngier <maz@kernel.org> > > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org> > > > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> > > > > This patch causes all qemu emulations for ARM1176 to fail hard (stall with > > no console output even with earlycon enabled). This affects witherspoon-bmc, > > ast2500-evb, romulus-bmc, and swift-bmc. It does not affect emulations > > for other CPU types, even with the same kernel configuration (such as > > ast2600-evb). > > Hmm, looks like we're going to have to drop 8936/1, 8941/1 and 8942/1 > in that case. > 8941 was intended as an alternative approach to 8936, as the latter is flawed, given that the v7 cache maintenance routines are shared with CPUID capable non-v7 CPUs such as the ARM1176. So it was never the intention for both to be applied. It should be sufficient to revert 8936. Apologies for the confusion. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-25 18:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200125173950.GA19126@roeck-us.net>
2020-01-25 18:06 ` [PATCH] ARM: 8936/1: decompressor: avoid CP15 barrier instructions in v7 cache setup code Russell King - ARM Linux admin
2020-01-25 18:12 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox