lkml.org 
[lkml]   [2019]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/3] powperc/mm: read TLB Block Invalidate Characteristics
From
Date
On 9/13/19 12:56 AM, Laurent Dufour wrote:
> Le 12/09/2019 à 16:44, Aneesh Kumar K.V a écrit :
>> Laurent Dufour <ldufour@linux.ibm.com> writes:

>>> +
>>> +    idx = 2;
>>> +    while (idx < len) {
>>> +        unsigned int block_size = local_buffer[idx++];
>>> +        unsigned int npsize;
>>> +
>>> +        if (!block_size)
>>> +            break;
>>> +
>>> +        block_size = 1 << block_size;
>>> +        if (block_size != 8)
>>> +            /* We only support 8 bytes size TLB invalidate buffer */
>>> +            pr_warn("Unsupported H_BLOCK_REMOVE block size : %d\n",
>>> +                block_size);
>>
>> Should we skip setting block size if we find block_size != 8? Also can
>> we avoid doing that pr_warn in loop and only warn if we don't find
>> block_size 8 in the invalidate characteristics array?
>
> My idea here is to fully read and process the data returned by the
> hcall, and to put the limitation to 8 when checking before calling
> H_BLOCK_REMOVE.
> The warning is there because I want it to be displayed once at boot.
>


Can we have two block size reported for the same base page size/actual
page size combination? If so we will overwrite the hblk[actual_psize] ?

>>
>>> +
>>> +        for (npsize = local_buffer[idx++];  npsize > 0; npsize--)
>>> +            check_lp_set_hblk((unsigned int) local_buffer[idx++],
>>> +                      block_size);
>>> +    }
>>> +
>>> +    for (bpsize = 0; bpsize < MMU_PAGE_COUNT; bpsize++)
>>> +        for (idx = 0; idx < MMU_PAGE_COUNT; idx++)
>>> +            if (mmu_psize_defs[bpsize].hblk[idx])
>>> +                pr_info("H_BLOCK_REMOVE supports base psize:%d
>>> psize:%d block size:%d",
>>> +                    bpsize, idx,
>>> +                    mmu_psize_defs[bpsize].hblk[idx]);
>>> +
>>> +    return 0;
>>> +}
>>> +machine_arch_initcall(pseries, read_tlbbi_characteristics);
>>> +
>>>   /*
>>>    * Take a spinlock around flushes to avoid bouncing the hypervisor
>>> tlbie
>>>    * lock.

-aneesh

\
 
 \ /
  Last update: 2019-09-13 04:01    [W:0.074 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site