Compare commits

...
2 Commits
Author SHA1 Message Date
Dima Panov 9fe7f514ef usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)
Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.

Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions

MFC after:		1 day
MFC to:			stable/15 stable/14
Reviewed by:		ziaee, fernape
Approved by:		fernape
Differential Revision:	https://reviews.freebsd.org/D55805

(cherry picked from commit 5250c98908)
2026-10-28 01:04:44 +03:00
Alan Cox acab75276d arm64: a local TLB invalidation suffices when enabling write access
When a PTE logically supports write access, as indicated by its DBM
field, but write access is nonetheless blocked by the PTE's protection
field, pmap_fault() can enable write access with only a local TLB
invalidation.

(cherry picked from commit 7dd9a8125f)
2026-10-27 13:29:45 -05:00
3 changed files with 38 additions and 4 deletions

No files matched your search

+33 -3
View File
@@ -1992,6 +1992,31 @@ pmap_s1_invalidate_page(pmap_t pmap, vm_offset_t va, bool final_only)
isb();
}
/*
* Invalidates any cached final-level TLB entry for the specified virtual
* address in the given virtual address space, but only on the current
* processor.
*
* The pmap_multiple_tlbi errata only affect broadcast invalidations.
*/
static __inline void
pmap_s1_invalidate_page_local(pmap_t pmap, vm_offset_t va)
{
uint64_t r;
PMAP_ASSERT_STAGE1(pmap);
dsb(nshst);
r = TLBI_VA(va);
if (pmap == kernel_pmap) {
__asm __volatile("tlbi vaale1, %0" : : "r" (r));
} else {
r |= ASID_TO_OPERAND(COOKIE_TO_ASID(pmap->pm_cookie));
__asm __volatile("tlbi vale1, %0" : : "r" (r));
}
dsb(nsh);
isb();
}
static __inline void
pmap_s2_invalidate_page(pmap_t pmap, vm_offset_t va, bool final_only)
{
@@ -9496,11 +9521,16 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far)
ptep = pmap_pte(pmap, far, &lvl);
if (ptep != NULL &&
((pte = pmap_load(ptep)) & ATTR_SW_DBM) != 0) {
/*
* A local invalidation suffices when enabling write
* access. At worst, a write using a stale read-only
* TLB entry on another processor triggers a fault,
* requiring its own local invalidation below.
*/
if ((pte & ATTR_S1_AP_RW_BIT) ==
ATTR_S1_AP(ATTR_S1_AP_RO)) {
ATTR_S1_AP(ATTR_S1_AP_RO))
pmap_clear_bits(ptep, ATTR_S1_AP_RW_BIT);
pmap_s1_invalidate_page(pmap, far, true);
}
pmap_s1_invalidate_page_local(pmap, far);
rv = KERN_SUCCESS;
}
PMAP_UNLOCK(pmap);
+4
View File
@@ -225,6 +225,8 @@ will search for locale specific manual pages using the following logic:
.It
.Va lang . Ns Va charset
.It
.Va lang
.It
.Li en . Ns Va charset
.El
.Pp
@@ -242,6 +244,8 @@ will search the following paths when considering section 1 manual pages in
.It
.Pa /usr/share/man/ja.eucJP/man1
.It
.Pa /usr/share/man/ja/man1
.It
.Pa /usr/share/man/en.eucJP/man1
.It
.Pa /usr/share/man/man1
+1 -1
View File
@@ -748,7 +748,7 @@ man_setup_locale() {
man_country="${lang_cc#*_}"
man_charset="${locstr#*.}"
locpaths="$locstr"
locpaths="$locpaths:$man_lang.$man_charset"
locpaths="$locpaths:$man_lang.$man_charset:$man_lang"
if [ "$man_lang" != "en" ]; then
locpaths="$locpaths:en.$man_charset"
fi