Skip to contentSkip to conversation

How many colours does the ARC cache have?

DISCUSSION Matthew Wilcox 2 participants 3 messages Feb 10, 2023 – Feb 18, 2023 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

I see a discrepancy here ...

arch/arc/include/asm/shmparam.h:
/* Handle upto 2 cache bins */
#define SHMLBA (2 * PAGE_SIZE)

arch/arc/include/asm/cacheflush.h:
#define CACHE_COLORS_NUM 4

(there are some other problems with the arc cache flushing code; I'm working on patches to address them, but those are things I understand a little better. I know nothing about the ARC architecture itself)

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

maintainer
#1 lore raw
Quoted 8 lines · Matthew Wilcox

I see a discrepancy here ...

arch/arc/include/asm/shmparam.h:
/* Handle upto 2 cache bins */
#define SHMLBA (2 * PAGE_SIZE)

arch/arc/include/asm/cacheflush.h:
#define CACHE_COLORS_NUM 4

The initial aliasing dcache support assumed 2 colors but was later bumped to 4, w/o making the adjustment in shmparam.h

Quoted 1 line

(there are some other problems with the arc cache flushing code;

The VIPT aliasing config (which is pretty much dead and unused) or regular parts ?

Quoted 2 lines

I'm working on patches to address them, but those are things I understand a little better. I know nothing about the ARC architecture itself)

Legacy ARC700 cpus had VIPT D$. The cache size was configurable by Soc builder and the specific geometry could yield an aliasing configuration (e.g. standard page size 8K, 4 way set associative D$: so D$ > 32K were aliasing and needed CONFIG_ARC_CACHE_VIPT_ALIASING). Although there was ever only 1 customer who taped out an aliasing cache config.

The newer ARC HS cores have PIPT D$ and thus don't need the aliasing support.

FWIW we could rip out all the VIPT aliasing code as I don't think it is needed anymore. @Alexey can you confirm ?

-Vineet

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#2 lore raw
Quoted 7 lines · Vineet Gupta
Quoted 6 lines · Matthew Wilcox

I see a discrepancy here ...

arch/arc/include/asm/shmparam.h:
/* Handle upto 2 cache bins */
#define SHMLBA (2 * PAGE_SIZE)

Quoted 5 lines
Quoted 2 lines

arch/arc/include/asm/cacheflush.h:
#define CACHE_COLORS_NUM 4

The initial aliasing dcache support assumed 2 colors but was later bumped to 4, w/o making the adjustment in shmparam.h

OK. Will you fix it yourself, or do you want me to send a patch?

Quoted 4 lines
Quoted 1 line

(there are some other problems with the arc cache flushing code;

The VIPT aliasing config (which is pretty much dead and unused) or regular parts ?

I'm not sure. This is incorrect in flush_dcache_page():

        } else if (page_mapcount(page)) {
[...]
                unsigned long vaddr = page->index << PAGE_SHIFT;

If the page being flushed is a tail page, then page->index is not valid, so you're essentially flushing a random address. I have a fix for it that I sent out earlier this week.

Quoted 9 lines
Quoted 2 lines

I'm working on patches to address them, but those are things I understand a little better. I know nothing about the ARC architecture itself)

Legacy ARC700 cpus had VIPT D$. The cache size was configurable by Soc builder and the specific geometry could yield an aliasing configuration (e.g. standard page size 8K, 4 way set associative D$: so D$ > 32K were aliasing and needed CONFIG_ARC_CACHE_VIPT_ALIASING). Although there was ever only 1 customer who taped out an aliasing cache config.

Quoted 7 lines

The newer ARC HS cores have PIPT D$ and thus don't need the aliasing support.

FWIW we could rip out all the VIPT aliasing code as I don't think it is needed anymore. @Alexey can you confirm ?

-Vineet

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc