<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/sbi/sbi_tlb.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_tlb.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_tlb.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2026-08-20T15:00:48Z</updated>
<entry>
<title>lib: sbi: Allow platforms to override local TLB operations</title>
<updated>2026-08-20T15:00:48Z</updated>
<author>
<name>Xiang W</name>
<email>wangxiang@iscas.ac.cn</email>
</author>
<published>2026-06-17T11:29:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f465413402c53fd022d54c3e56a26f96cdc32ffc'/>
<id>urn:sha1:f465413402c53fd022d54c3e56a26f96cdc32ffc</id>
<content type='text'>
Some T-Head based processors, for example the Sophgo SG2044, have a
JTLB errata that requires special handling of certain TLB maintenance
instructions (sfence.vma).

Introduce a sbi_tlb_local_operations structure so platforms can provide
custom local TLB flush implementations. Use it to implement the JTLB
workaround on affected SoCs (currently Sophgo SG2044).

Signed-off-by: Xiang W &lt;wangxiang@iscas.ac.cn&gt;
Signed-off-by: Han Gao &lt;gaohan@iscas.ac.cn&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20260617112925.1144190-2-wangxiang@iscas.ac.cn
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Expose __sbi_sfence_vma_all() function</title>
<updated>2025-12-16T14:49:21Z</updated>
<author>
<name>Andrew Waterman</name>
<email>andrew@sifive.com</email>
</author>
<published>2025-11-27T11:21:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=843e916dcab4163e84bab9a22ef2db89ff269979'/>
<id>urn:sha1:843e916dcab4163e84bab9a22ef2db89ff269979</id>
<content type='text'>
The __sbi_sfence_vma_all() can be shared by different parts of
OpenSBI so rename __tlb_flush_all() to __sbi_sfence_vma_all()
and make it global function.

Signed-off-by: Andrew Waterman &lt;andrew@sifive.com&gt;
Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Link: https://lore.kernel.org/r/20251127112121.334023-2-apatel@ventanamicro.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Allow forceful queueing of data in sbi_fifo_enqueue()</title>
<updated>2024-07-24T06:48:36Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2024-07-04T17:07:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=94c3c53a56d32d1d6bf4e015c6266fcb4a80aaad'/>
<id>urn:sha1:94c3c53a56d32d1d6bf4e015c6266fcb4a80aaad</id>
<content type='text'>
Extend sbi_fifo_enqueue() to allow forceful queueing by droping
data from the tail.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-By: Himanshu Chauhan &lt;hchauhan@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_tlb: Reduce size of struct sbi_tlb_info</title>
<updated>2023-12-19T10:26:37Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-12-11T07:56:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=416ceb3cd72db8d24373274316e2f5d5d3800bf3'/>
<id>urn:sha1:416ceb3cd72db8d24373274316e2f5d5d3800bf3</id>
<content type='text'>
Let us reduce the size of struct sbi_tlb_info by doing the
following:
1) Change the data type of asid and vmid fields to uint16_t
2) Replace local_fn() function pointer with an enum

Based on the above, the size of struct sbi_tlb_info is reduced
by 16 bytes on RV64 and 4 bytes on RV32.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_tlb: Check tlb_range_flush_limit only once per request</title>
<updated>2023-12-11T05:11:48Z</updated>
<author>
<name>Samuel Holland</name>
<email>samuel.holland@sifive.com</email>
</author>
<published>2023-12-08T20:29:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=35cba9265514ab73cc3f1777f8ee179f6aa71cd5'/>
<id>urn:sha1:35cba9265514ab73cc3f1777f8ee179f6aa71cd5</id>
<content type='text'>
The tlb_update() callback is called for each destination hart.
Move the size check earlier, so it is executed only once.

Signed-off-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Correctly limit flushes to a single ASID/VMID</title>
<updated>2023-11-16T03:51:47Z</updated>
<author>
<name>Samuel Holland</name>
<email>samuel.holland@sifive.com</email>
</author>
<published>2023-10-17T22:20:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=a140a4e862ce04584dee208424714952609e5b2c'/>
<id>urn:sha1:a140a4e862ce04584dee208424714952609e5b2c</id>
<content type='text'>
Per the SBI specification, the effects of these functions are limited to
a specific ASID and/or VMID. This applies even when flushing the entire
address space.

Signed-off-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Prefer hartindex over hartid in IPI framework</title>
<updated>2023-09-24T06:09:38Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-09-01T12:11:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=78c667b6fc07d2ea783fbd18f43a3f8191de6164'/>
<id>urn:sha1:78c667b6fc07d2ea783fbd18f43a3f8191de6164</id>
<content type='text'>
Let us prefer hartindex over hartid in IPI framework which in-turn
forces IPI users to also prefer hartindex.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Use sbi_scratch_last_hartindex() in remote TLB managment</title>
<updated>2023-09-24T06:09:35Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-09-01T11:29:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e632cd7c816736dc9dab7597b59f9f77a7925fb3'/>
<id>urn:sha1:e632cd7c816736dc9dab7597b59f9f77a7925fb3</id>
<content type='text'>
The sbi_hartid_to_scratch() involves translating hartid to hartindex
which is expensive so let's use sbi_hartindex_to_scratch() instead.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Extend sbi_hartmask to support both hartid and hartindex</title>
<updated>2023-09-24T06:09:32Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-08-31T03:39:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=296e70d69da74b09426e4f565306f26e9a6c79f8'/>
<id>urn:sha1:296e70d69da74b09426e4f565306f26e9a6c79f8</id>
<content type='text'>
Currently, the sbi_hartmask is indexed by hartid which puts a
limit on hartid to be less than SBI_HARTMASK_MAX_BITS.

We extend the sbi_hartmask implementation to use hartindex and
support updating sbi_hartmask using hartid. This removes the
limit on hartid and existing code works largely unmodified.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: alloc tlb fifo by sbi_malloc</title>
<updated>2023-09-10T06:16:44Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-09-06T13:10:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=5bd969477f2c710ee5945f1a66cf534c478c48de'/>
<id>urn:sha1:5bd969477f2c710ee5945f1a66cf534c478c48de</id>
<content type='text'>
If the system is defined from tlb_fifo_num_entries, the scratch may be
too small to hold the fifo, so it is alloc through the heap.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Signed-off-by: Xing Xiaoguang &lt;xiaoguang.xing@sophgo.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
