lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5529fe79-e2f8-47ab-a0cf-2b37bb13bbd7@broadcom.com>
Date: Fri, 3 May 2024 11:56:43 -0700
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Christian Marangi <ansuelsmth@...il.com>,
 Hauke Mehrtens <hauke@...ke-m.de>, Rafał Miłecki
 <zajec5@...il.com>, Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
 Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
 Conor Dooley <conor+dt@...nel.org>,
 Florian Fainelli <florian.fainelli@...adcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@...adcom.com>,
 Álvaro Fernández Rojas <noltari@...il.com>,
 linux-mips@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, Daniel González Cabanelas
 <dgcbueu@...il.com>
Subject: Re: [PATCH 5/6] mips: bmips: enable RAC on BMIPS4350

On 5/3/24 06:54, Christian Marangi wrote:
> From: Daniel González Cabanelas <dgcbueu@...il.com>
> 
> The data RAC is left disabled by the bootloader in some SoCs, at least in
> the core it boots from.
> Enabling this feature increases the performance up to +30% depending on the
> task.
> 
> Signed-off-by: Daniel González Cabanelas <dgcbueu@...il.com>
> Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
> [ rework code and reduce code duplication ]
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
>   arch/mips/kernel/smp-bmips.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
> index 6048c471b5ee..7bde6bbaa41f 100644
> --- a/arch/mips/kernel/smp-bmips.c
> +++ b/arch/mips/kernel/smp-bmips.c
> @@ -617,6 +617,18 @@ void bmips_cpu_setup(void)
>   		__raw_readl(bmips_cbr_addr + BMIPS_RAC_ADDRESS_RANGE);
>   		break;
>   
> +	case CPU_BMIPS4350:
> +		u32 rac_addr = BMIPS_RAC_CONFIG_1;
> +
> +		if (!(read_c0_brcm_cmt_local() & (1 << 31)))
> +			rac_addr = BMIPS_RAC_CONFIG;
> +
> +		/* Enable data RAC */
> +		cfg = __raw_readl(bmips_cbr_addr + rac_addr);
> +		__raw_writel(cfg | 0xa, bmips_cbr_addr + rac_addr);

This enables data pre-fetching (bit 3) and data-caching (bit 1), have 
you tried with 0xF to see if this provides any additional speed-up?

Looks correct to me otherwise, I wonder if a flush would be in order 
right after enabling, though I did not see any specific instructions 
towards that part in the programming notes.

> +		__raw_readl(bmips_cbr_addr + rac_addr);
> +		break;
> +
>   	case CPU_BMIPS4380:
>   		/* CBG workaround for early BMIPS4380 CPUs */
>   		switch (read_c0_prid()) {

-- 
Florian


Download attachment "smime.p7s" of type "application/pkcs7-signature" (4221 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ