From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 29471 invoked from network); 20 Mar 2000 21:00:13 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 20 Mar 2000 21:00:13 -0000 Received: from network-services.uoregon.edu (network-services.uoregon.edu [128.223.60.21]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA13302 for ; Mon, 20 Mar 2000 16:00:13 -0500 From: werner@darkwing.uoregon.edu Received: from darkwing.uoregon.edu (ev6.uoregon.edu [128.223.23.31]) by network-services.uoregon.edu (8.9.3/8.9.3) with ESMTP id NAA29826; Mon, 20 Mar 2000 13:00:12 -0800 (PST) Sender: werner@network-services.uoregon.edu Message-ID: <38D6915B.BDEDB59D@darkwing.uoregon.edu> Date: Mon, 20 Mar 2000 13:00:11 -0800 X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.3.99-pre2 alpha) X-Accept-Language: en MIME-Version: 1.0 To: Linus Torvalds CC: axp-list@redhat.com Subject: Re: patch for include/asm-alpha/cache.h References: Content-Type: multipart/mixed; boundary="------------B922E7779404A1CF7C6F44E1" This is a multi-part message in MIME format. --------------B922E7779404A1CF7C6F44E1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Linus Torvalds wrote: > > It's much better to have specific CONFIG_xxx options that are set > automatically depending on the CPU type (see, for example, the way the x86 > stuff sets "CONFIG_X86_WP_WORKS_OK" or whatever we called those options). > That makes for much more readable code, and makes the configure scripts > work correctly on dependencies. > > So I'd suggest a CONFIG_L1_CACHELINE define for the size of the L1 > cacheline instead of having CPU defines and then checking those. > > Linus CONFIG_X86_WP_WORKS_OK only takes boolean values so I tried a compromise. I now use the config.h way, don't add any new CONFIG_xx options but still test cpu type in cache.h. It should work with i386 as well but I don't know how the cache lines vary across the many versions. Yours, Mike --------------B922E7779404A1CF7C6F44E1 Content-Type: text/plain; charset=us-ascii; name="cache.h.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cache.h.diff" --- cache.h.orig Sun Mar 19 16:39:23 2000 +++ cache.h Mon Mar 20 12:38:14 2000 @@ -1,12 +1,54 @@ /* * include/asm-alpha/cache.h + * + * Modified 03/20/2000 by Michael Werner to include more details + * of the Alpha processors for future optimizations, + * for example, processor dependent page coloring. */ + #ifndef __ARCH_ALPHA_CACHE_H #define __ARCH_ALPHA_CACHE_H -/* Bytes per L1 (data) cache line. Both EV4 and EV5 are write-through, - read-allocate, direct-mapped, physical. */ +#include + +/* L1_CACHE_BYTES is Bytes per L1 (data) cache line. + * L1_CACHE_PAGES is the size of the L1 data cache in units of default pages + */ + +/* + * EV5 has a dual-read-ported, single-write-ported, 8KB data cache. + * It is a write-through, read-allocate, direct-mapped, physical cache + * with 32-byte blocks. + * See 21164 and 21164PC Alpha Microprocessor Data Sheets. + */ + +#if defined(CONFIG_ALPHA_EV4) || defined(CONFIG_ALPHA_EV5) #define L1_CACHE_BYTES 32 +#define L1_CACHE_PAGES 1 + +/* + * EV6 has a virtually-indexed, physically-tagged two-way associative + * write-back, read/write allocate 64KB data cache. + * See 21264 Alpha Microprocessor Data Sheet at + * http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html + * + * Avoid touching data that is 32KB apart. + * The 21264 can have only one memory operation in progress at a time + * that maps to any one cache index. Otherwise a replay trap may result. + * See 21264 Compilers Writers Guide for more information. + */ + +#elif defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV7) +#define L1_CACHE_BYTES 64 +#define L1_CACHE_PAGES 8 +#else + +/* Default back to previous behaviour */ +#define L1_CACHE_BYTES 32 +#define L1_CACHE_PAGES 1 +#endif + + #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) #define SMP_CACHE_BYTES L1_CACHE_BYTES --------------B922E7779404A1CF7C6F44E1--