[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97bafb53-6ae9-1d42-1816-ef81b845b80c@linux.ibm.com>
Date: Fri, 13 Sep 2019 07:30:42 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To: Laurent Dufour <ldufour@...ux.ibm.com>, mpe@...erman.id.au,
benh@...nel.crashing.org, paulus@...ba.org, npiggin@...il.com
Cc: linuxppc-dev@...ts.ozlabs.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] powperc/mm: read TLB Block Invalidate Characteristics
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@...ux.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
Powered by blists - more mailing lists