linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* ARM64: Question: Supporting outer-no-allocate
@ 2020-07-17 22:24 David Clear
  2020-07-30 11:40 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: David Clear @ 2020-07-17 22:24 UTC (permalink / raw)
  To: linux-arm-kernel, catalin.marinas, will

Hi,

I'd like to ask whether we can support the configuration of the TCR and MAIR
registers so as to select outer read-no-allocate, outer write-no-allocate on
ARM memory transactions.  I recognize that this might be quite a limited
use-case so let me explain why I'm asking.

The Pensando ASIC is a PCIE host-attached multi-100Gbps I/O chip that includes
an A72 arm64 complex for internal device management. The hardware data-path
makes extensive use of RAM for in-flight metadata, and performance is
maximized by preventing the ARM from allocating cache lines in L3 that would
evict that metadata, at the acceptable cost of increasing ARM memory latency
through L3.

I'd like to upstream as much support for the chip as possible, but I don't
want to formally post a patch if the idea is objectionable, or if there's
a more acceptable way to accomplish the same goal.

The simplest solution might be a new Kconfig option MMU_OUTER_NO_ALLOCATE
to choose the desired TCR and MAIR values:

arch/arm64/include/asm/sysreg.h:
#ifndef CONFIG_MMU_OUTER_NO_ALLOCATE
#define MAIR_ATTR_NORMAL_WT             UL(0x8b)
#define MAIR_ATTR_NORMAL                UL(0xcf)
#else
#define MAIR_ATTR_NORMAL_WT             UL(0xbb)
#define MAIR_ATTR_NORMAL                UL(0xff)
#endif

arch/arm64/mm/proc.S:
#ifndef CONFIG_MMU_OUTER_NO_ALLOCATE
#define TCR_CACHE_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBnWA
#else
#define TCR_CACHE_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA
#endif

Please let me know if a formal patch based on the above would be
acceptable at all, or if there is a different way to accomplish this.

Regards,
David.

_______________________________________________
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: ARM64: Question: Supporting outer-no-allocate
  2020-07-17 22:24 ARM64: Question: Supporting outer-no-allocate David Clear
@ 2020-07-30 11:40 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2020-07-30 11:40 UTC (permalink / raw)
  To: David Clear; +Cc: will, linux-arm-kernel

On Fri, Jul 17, 2020 at 03:24:31PM -0700, David Clear wrote:
> I'd like to ask whether we can support the configuration of the TCR and MAIR
> registers so as to select outer read-no-allocate, outer write-no-allocate on
> ARM memory transactions.  I recognize that this might be quite a limited
> use-case so let me explain why I'm asking.
> 
> The Pensando ASIC is a PCIE host-attached multi-100Gbps I/O chip that includes
> an A72 arm64 complex for internal device management. The hardware data-path
> makes extensive use of RAM for in-flight metadata, and performance is
> maximized by preventing the ARM from allocating cache lines in L3 that would
> evict that metadata, at the acceptable cost of increasing ARM memory latency
> through L3.
> 
> I'd like to upstream as much support for the chip as possible, but I don't
> want to formally post a patch if the idea is objectionable, or if there's
> a more acceptable way to accomplish the same goal.
> 
> The simplest solution might be a new Kconfig option MMU_OUTER_NO_ALLOCATE
> to choose the desired TCR and MAIR values:
> 
> arch/arm64/include/asm/sysreg.h:
> #ifndef CONFIG_MMU_OUTER_NO_ALLOCATE
> #define MAIR_ATTR_NORMAL_WT             UL(0x8b)
> #define MAIR_ATTR_NORMAL                UL(0xcf)
> #else
> #define MAIR_ATTR_NORMAL_WT             UL(0xbb)
> #define MAIR_ATTR_NORMAL                UL(0xff)
> #endif

I'm not keen on having config options for such use-cases. In theory, we
could add a command-line option but given that it's only for one driver
that's not even in mainline, it doesn't have a strong case ;).

-- 
Catalin

_______________________________________________
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-07-30 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 22:24 ARM64: Question: Supporting outer-no-allocate David Clear
2020-07-30 11:40 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).