Thread (17 messages) 17 messages, 2 authors, 2019-11-11

Re: [PATCH 2/3] powperc/mm: read TLB Block Invalidate Characteristics

From: Laurent Dufour <hidden>
Date: 2019-09-13 09:10:44
Also in: linux-mm, lkml

Le 13/09/2019 à 04:00, Aneesh Kumar K.V a écrit :
On 9/13/19 12:56 AM, Laurent Dufour wrote:
quoted
Le 12/09/2019 à 16:44, Aneesh Kumar K.V a écrit :
quoted
Laurent Dufour [off-list ref] writes:
quoted
quoted
quoted
+
+    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] ?
In check_lp_set_hblk() I'm only keeping the bigger one.
quoted
quoted
quoted
+
+        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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help