summary refs log tree commit diff stats
path: root/results/classifier/accel-gemma3:12b/kvm/1587535
blob: 5c52c0aaea7997c3b8fd2b0ab6cd5af08e858cdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Incorrect MAS1_TSIZE_SHIFT in ppce500_spin.c causes incorrectly sized TLB.

When e500 PPC is booted multi-core, the non-boot cores are started via
the spin table.  ppce500_spin.c:spin_kick() calls
mmubooke_create_initial_mapping() to allocate a 64MB TLB entry, but
the created TLB entry is only 256KB.

The root cause is that the function computing the size of the TLB
entry, namely booke206_page_size_to_tlb assumes MAS1.TSIZE as defined
by latter PPC cores, specifically n to the power of FOUR * 1KB.  The
result is then used by mmubooke_create_initial_mapping using
MAS1_TSIZE_SHIFT, but MAS1_TSIZE_SHIFT is defined assuming TLB entries
are n to the power of TWO * 1KB.  I.e., a difference of shift=7 or
shift=8.

Simply changing MAS1_TSIZE_SHIFT from 7 to 8 is not appropriate since
the macro is used elsewhere.

Removing the ">>1" from:

> static inline hwaddr booke206_page_size_to_tlb(uint64_t size)
> {
>     return ctz32(size >> 10) >> 1;

and adding an appropriate comment is what I used as a work around:

> static inline hwaddr booke206_page_size_to_tlb(uint64_t size)
> {
>     // resulting size is based on MAS1_TSIZE_SHIFT=7 TLB size.
>     return ctz32(size >> 10);