Cherry-pick and adapt:
commit 0da15ff318480f30bbc90b9e8ecb9bb9431c7fd3
Author: Kamil Rytarowski <n54@gmx.com>
Date: Fri Jan 3 02:35:33 2020 +0100
[compiler-rt] [netbsd] Switch to syscall for ThreadSelfTlsTcb()
This change avoids using internal, namespaced per-CPU calls that
are not a stable interface to read the TSL base value.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/ibm4xx/pmap.c#rev1.85http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/ibm4xx/pmap.c#rev1.87
ibm4xx has VIPT icache and operations in pmap_procwr() should be done with
DMMU enabled (write back dcache into memory and invalidate icache).
When p == curproc, this is trivial. However, p != curproc needs a special
care; we cannot rely upon TLB miss handler in user context. Therefore,
extract pa and operate against it.
Note that va below VM_MIN_KERNEL_ADDRESS (== 2GB at the moment) is reserved
for direct mapping.
Tested by gdb with WIP software single stepping for ibm4xx.
Otherwise, object files compiled with -mlongcall contain relocation types
referring PLT, which our in-kernel linker cannot handle.
This ends up with failure in kernel module load with
``kobj_reloc: unexpected relocation type 31'' (31 == R_PPC_PLT16_HA here).
See descriptions for -mlongcall in gcc(1) of GCC9 for more details.
- It doens't provides an xencons, so allow HVM_PARAM_CONSOLE_PFN to fail
- the xen clock is not fully functionnal, so don't try to use it if
HVM_PARAM_CONSOLE_PFN failed.
- it doesn't have XEN_HVM_CPUID_VCPU_ID_PRESENT so fall back to ci_acpiid
as ci_vcpuid in this case.
It also doesn't support the per-CPU event callback; so fix the fallback
to global vector (don't try to register more per-cpu vector)
Should fix port-amd64/55543
builds on modern systems and seems to have been added as a workaround for
some 2004-era Linux NFS bug. Guessing that the issue has been sorted out
in the meantime.
Omit needless membar in pmap_kenter_pa while here -- caller must
ensure pmap_kenter_pa on one CPU happens before use of the VA on
another CPU anyway, so there is no benefit to a membar here.
ok thorpej@
This is useful for finding parse errors only. Inspired by some entries
that are obsolete and have more than the "obsolete" flag. There are
only few of these entries though, and they don't seem worth fixing.