Aux Vector section misstates the interpretation of cache geometries #110

Open
opened 4 years ago by wschmidt-ibm · 0 comments
wschmidt-ibm commented 4 years ago (Migrated from github.com)

In Section 4.1.2.3 (Auxiliary Vector), we have

The low-order sixteen bits contain the cache associativity as a value N, where N = 1 represents 
a direct-mapped cache, N = 0xffff represents a fully associative cache, and any other N represents 
an N-way set-associative cache. The next higher-order sixteen bits contain the size of the cache
line in bytes. Note that the cache line size is not necessarily the same as the cache block size.

In fact, the two fields described herein are swapped, as Linux uses

#define get_cache_geometry(level) \
        (ppc64_caches.level.assoc << 16 | ppc64_caches.level.line_size)

in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/asm/elf.h#n136.

In Section 4.1.2.3 (Auxiliary Vector), we have ``` The low-order sixteen bits contain the cache associativity as a value N, where N = 1 represents a direct-mapped cache, N = 0xffff represents a fully associative cache, and any other N represents an N-way set-associative cache. The next higher-order sixteen bits contain the size of the cache line in bytes. Note that the cache line size is not necessarily the same as the cache block size. ``` In fact, the two fields described herein are swapped, as Linux uses ``` #define get_cache_geometry(level) \ (ppc64_caches.level.assoc << 16 | ppc64_caches.level.line_size) ``` in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/asm/elf.h#n136.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: systemsoftware/ELFv2-ABI#110
Loading…
There is no content yet.