svn commit: r357930 - in projects/clang1000-import: cddl/lib/libdtrace contrib/elftoolchain/addr2line contrib/ncurses/ncurses/base lib/libthr/thread libexec/rtld-elf libexec/rtld-elf/aarch64 libexe...
Dimitry Andric
dim at FreeBSD.org
Fri Feb 14 19:33:06 UTC 2020
Author: dim
Date: Fri Feb 14 19:32:58 2020
New Revision: 357930
URL: https://svnweb.freebsd.org/changeset/base/357930
Log:
Merge ^/head r357855 through r357920.
Added:
projects/clang1000-import/tests/sys/common/divert.py
- copied unchanged from r357908, head/tests/sys/common/divert.py
projects/clang1000-import/tests/sys/netinet/divert.sh
- copied unchanged from r357908, head/tests/sys/netinet/divert.sh
projects/clang1000-import/tests/sys/netinet6/divert.sh
- copied unchanged from r357908, head/tests/sys/netinet6/divert.sh
Modified:
projects/clang1000-import/cddl/lib/libdtrace/tcp.d
projects/clang1000-import/contrib/elftoolchain/addr2line/addr2line.c
projects/clang1000-import/contrib/ncurses/ncurses/base/MKlib_gen.sh
projects/clang1000-import/lib/libthr/thread/thr_cancel.c
projects/clang1000-import/libexec/rtld-elf/aarch64/reloc.c
projects/clang1000-import/libexec/rtld-elf/amd64/reloc.c
projects/clang1000-import/libexec/rtld-elf/arm/reloc.c
projects/clang1000-import/libexec/rtld-elf/i386/reloc.c
projects/clang1000-import/libexec/rtld-elf/mips/reloc.c
projects/clang1000-import/libexec/rtld-elf/powerpc/reloc.c
projects/clang1000-import/libexec/rtld-elf/powerpc64/reloc.c
projects/clang1000-import/libexec/rtld-elf/riscv/reloc.c
projects/clang1000-import/libexec/rtld-elf/rtld.c
projects/clang1000-import/libexec/rtld-elf/rtld.h
projects/clang1000-import/libexec/rtld-elf/sparc64/reloc.c
projects/clang1000-import/share/misc/committers-ports.dot
projects/clang1000-import/sys/amd64/amd64/trap.c
projects/clang1000-import/sys/amd64/vmm/io/iommu.c
projects/clang1000-import/sys/amd64/vmm/vmm.c
projects/clang1000-import/sys/amd64/vmm/vmm_stat.c
projects/clang1000-import/sys/amd64/vmm/vmm_util.c
projects/clang1000-import/sys/amd64/vmm/vmm_util.h
projects/clang1000-import/sys/amd64/vmm/x86.c
projects/clang1000-import/sys/cam/cam_periph.c
projects/clang1000-import/sys/cam/cam_xpt.c
projects/clang1000-import/sys/dev/ahci/ahci_pci.c
projects/clang1000-import/sys/dev/amd_ecc_inject/ecc_inject.c
projects/clang1000-import/sys/dev/amdpm/amdpm.c
projects/clang1000-import/sys/dev/amdsbwd/amd_chipset.h
projects/clang1000-import/sys/dev/amdsbwd/amdsbwd.c
projects/clang1000-import/sys/dev/cxgbe/adapter.h
projects/clang1000-import/sys/dev/cxgbe/crypto/t4_kern_tls.c
projects/clang1000-import/sys/dev/cxgbe/t4_main.c
projects/clang1000-import/sys/dev/cxgbe/t4_sge.c
projects/clang1000-import/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
projects/clang1000-import/sys/dev/intpm/intpm.c
projects/clang1000-import/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.h
projects/clang1000-import/sys/dev/usb/input/ukbd.c
projects/clang1000-import/sys/kern/kern_descrip.c
projects/clang1000-import/sys/kern/kern_jail.c
projects/clang1000-import/sys/kern/kern_lock.c
projects/clang1000-import/sys/kern/kern_priv.c
projects/clang1000-import/sys/kern/subr_smr.c
projects/clang1000-import/sys/kern/subr_syscall.c
projects/clang1000-import/sys/kern/subr_trap.c
projects/clang1000-import/sys/kern/sys_capability.c
projects/clang1000-import/sys/kern/vfs_default.c
projects/clang1000-import/sys/kern/vfs_lookup.c
projects/clang1000-import/sys/kern/vfs_syscalls.c
projects/clang1000-import/sys/kern/vfs_vnops.c
projects/clang1000-import/sys/netinet/tcp_input.c
projects/clang1000-import/sys/netinet/tcp_log_buf.c
projects/clang1000-import/sys/netinet/tcp_log_buf.h
projects/clang1000-import/sys/netinet/tcp_output.c
projects/clang1000-import/sys/netinet/tcp_sack.c
projects/clang1000-import/sys/netinet/tcp_usrreq.c
projects/clang1000-import/sys/netinet/tcp_var.h
projects/clang1000-import/sys/security/audit/audit.h
projects/clang1000-import/sys/security/mac/mac_framework.c
projects/clang1000-import/sys/security/mac/mac_framework.h
projects/clang1000-import/sys/security/mac/mac_priv.c
projects/clang1000-import/sys/security/mac/mac_vfs.c
projects/clang1000-import/sys/sys/capsicum.h
projects/clang1000-import/sys/sys/file.h
projects/clang1000-import/sys/sys/jail.h
projects/clang1000-import/sys/sys/ktrace.h
projects/clang1000-import/sys/sys/lockmgr.h
projects/clang1000-import/sys/sys/priv.h
projects/clang1000-import/sys/sys/smr.h
projects/clang1000-import/sys/sys/sysent.h
projects/clang1000-import/sys/vm/uma_core.c
projects/clang1000-import/sys/vm/vm_page.c
projects/clang1000-import/tests/sys/Makefile
projects/clang1000-import/tests/sys/common/Makefile
projects/clang1000-import/tests/sys/net/randsleep.c
projects/clang1000-import/tests/sys/netinet/Makefile
projects/clang1000-import/tests/sys/netinet6/Makefile
projects/clang1000-import/usr.bin/diff/diff.1
projects/clang1000-import/usr.bin/diff/diff.c
projects/clang1000-import/usr.bin/diff/tests/diff_test.sh
projects/clang1000-import/usr.sbin/bhyve/xmsr.c
projects/clang1000-import/usr.sbin/bhyvectl/bhyvectl.c
projects/clang1000-import/usr.sbin/services_mkdb/services
projects/clang1000-import/usr.sbin/sesutil/sesutil.c
Directory Properties:
projects/clang1000-import/ (props changed)
projects/clang1000-import/cddl/ (props changed)
projects/clang1000-import/contrib/elftoolchain/ (props changed)
projects/clang1000-import/contrib/ncurses/ (props changed)
Modified: projects/clang1000-import/cddl/lib/libdtrace/tcp.d
==============================================================================
--- projects/clang1000-import/cddl/lib/libdtrace/tcp.d Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/cddl/lib/libdtrace/tcp.d Fri Feb 14 19:32:58 2020 (r357930)
@@ -244,7 +244,7 @@ translator tcpsinfo_t < struct tcpcb *p > {
tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh;
tcps_srecover = p == NULL ? -1 : p->snd_recover;
tcps_sack_fack = p == NULL ? 0 : p->snd_fack;
- tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata;
+ tcps_sack_snxt = p == NULL ? 0 : p->snd_recover;
tcps_rto = p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz;
tcps_mss = p == NULL ? -1 : p->t_maxseg;
tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0;
Modified: projects/clang1000-import/contrib/elftoolchain/addr2line/addr2line.c
==============================================================================
--- projects/clang1000-import/contrib/elftoolchain/addr2line/addr2line.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/contrib/elftoolchain/addr2line/addr2line.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -36,6 +36,7 @@
#include <libdwarf.h>
#include <libelftc.h>
#include <libgen.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Modified: projects/clang1000-import/contrib/ncurses/ncurses/base/MKlib_gen.sh
==============================================================================
--- projects/clang1000-import/contrib/ncurses/ncurses/base/MKlib_gen.sh Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/contrib/ncurses/ncurses/base/MKlib_gen.sh Fri Feb 14 19:32:58 2020 (r357930)
@@ -73,7 +73,7 @@ USE="$3"
# determine if we are using gcc, and if so, what version because the proposed
# solution uses a nonstandard option.
PRG=`echo "$1" | $AWK '{ sub(/^[[:space:]]*/,""); sub(/[[:space:]].*$/, ""); print; }' || exit 0`
-FSF=`"$PRG" --version 2>/dev/null || exit 0 | fgrep "Free Software Foundation" | head -n 1`
+FSF=`("$PRG" --version 2>/dev/null || exit 0) | fgrep "Free Software Foundation" | head -n 1`
ALL=`"$PRG" -dumpversion 2>/dev/null || exit 0`
ONE=`echo "$ALL" | sed -e 's/\..*$//'`
if test -n "$FSF" && test -n "$ALL" && test -n "$ONE" ; then
Modified: projects/clang1000-import/lib/libthr/thread/thr_cancel.c
==============================================================================
--- projects/clang1000-import/lib/libthr/thread/thr_cancel.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/lib/libthr/thread/thr_cancel.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -71,7 +71,7 @@ _thr_cancel(pthread_t pthread)
* _thr_find_thread and THR_THREAD_UNLOCK will enter and leave critical
* region automatically.
*/
- if ((ret = _thr_find_thread(curthread, pthread, 0)) == 0) {
+ if ((ret = _thr_find_thread(curthread, pthread, 1)) == 0) {
if (!pthread->cancel_pending) {
pthread->cancel_pending = 1;
if (pthread->state != PS_DEAD)
Modified: projects/clang1000-import/libexec/rtld-elf/aarch64/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/aarch64/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/aarch64/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -258,31 +258,56 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockStat
return (0);
}
+static void
+reloc_iresolve_one(Obj_Entry *obj, const Elf_Rela *rela,
+ RtldLockState *lockstate)
+{
+ Elf_Addr *where, target, *ptr;
+
+ ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend);
+ where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+ lock_release(rtld_bind_lock, lockstate);
+ target = call_ifunc_resolver(ptr);
+ wlock_acquire(rtld_bind_lock, lockstate);
+ *where = target;
+}
+
int
reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate)
{
const Elf_Rela *relalim;
const Elf_Rela *rela;
- Elf_Addr *where, target, *ptr;
if (!obj->irelative)
return (0);
- relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize);
+ obj->irelative = false;
+ relalim = (const Elf_Rela *)((const char *)obj->pltrela +
+ obj->pltrelasize);
for (rela = obj->pltrela; rela < relalim; rela++) {
- if (ELF_R_TYPE(rela->r_info) == R_AARCH64_IRELATIVE) {
- ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend);
- where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
- lock_release(rtld_bind_lock, lockstate);
- target = call_ifunc_resolver(ptr);
- wlock_acquire(rtld_bind_lock, lockstate);
- *where = target;
- }
+ if (ELF_R_TYPE(rela->r_info) == R_AARCH64_IRELATIVE)
+ reloc_iresolve_one(obj, rela, lockstate);
}
- obj->irelative = false;
return (0);
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj, struct Struct_RtldLockState *lockstate)
+{
+ const Elf_Rela *relalim;
+ const Elf_Rela *rela;
+
+ if (!obj->irelative_nonplt)
+ return (0);
+ obj->irelative_nonplt = false;
+ relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize);
+ for (rela = obj->rela; rela < relalim; rela++) {
+ if (ELF_R_TYPE(rela->r_info) == R_AARCH64_IRELATIVE)
+ reloc_iresolve_one(obj, rela, lockstate);
+ }
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj, int flags,
struct Struct_RtldLockState *lockstate)
{
@@ -497,6 +522,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
*where = (Elf_Addr)(obj->relocbase + rela->r_addend);
break;
case R_AARCH64_NONE:
+ break;
+ case R_AARCH64_IRELATIVE:
+ obj->irelative_nonplt = true;
break;
default:
rtld_printf("%s: Unhandled relocation %lu\n",
Modified: projects/clang1000-import/libexec/rtld-elf/amd64/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/amd64/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/amd64/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -303,6 +303,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
case R_X86_64_RELATIVE:
*where = (Elf_Addr)(obj->relocbase + rela->r_addend);
break;
+ case R_X86_64_IRELATIVE:
+ obj->irelative_nonplt = true;
+ break;
+
/*
* missing:
* R_X86_64_GOTPCREL, R_X86_64_32, R_X86_64_32S, R_X86_64_16,
@@ -410,34 +414,53 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
return (target);
}
+static void
+reloc_iresolve_one(Obj_Entry *obj, const Elf_Rela *rela,
+ RtldLockState *lockstate)
+{
+ Elf_Addr *where, target, *ptr;
+
+ ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend);
+ where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+ lock_release(rtld_bind_lock, lockstate);
+ target = call_ifunc_resolver(ptr);
+ wlock_acquire(rtld_bind_lock, lockstate);
+ *where = target;
+}
+
int
reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate)
{
- const Elf_Rela *relalim;
- const Elf_Rela *rela;
+ const Elf_Rela *relalim;
+ const Elf_Rela *rela;
- if (!obj->irelative)
+ if (!obj->irelative)
+ return (0);
+ obj->irelative = false;
+ relalim = (const Elf_Rela *)((const char *)obj->pltrela +
+ obj->pltrelasize);
+ for (rela = obj->pltrela; rela < relalim; rela++) {
+ if (ELF_R_TYPE(rela->r_info) == R_X86_64_IRELATIVE)
+ reloc_iresolve_one(obj, rela, lockstate);
+ }
return (0);
- relalim = (const Elf_Rela *)((const char *)obj->pltrela + obj->pltrelasize);
- for (rela = obj->pltrela; rela < relalim; rela++) {
- Elf_Addr *where, target, *ptr;
+}
- switch (ELF_R_TYPE(rela->r_info)) {
- case R_X86_64_JMP_SLOT:
- break;
+int
+reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate)
+{
+ const Elf_Rela *relalim;
+ const Elf_Rela *rela;
- case R_X86_64_IRELATIVE:
- ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend);
- where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
- lock_release(rtld_bind_lock, lockstate);
- target = call_ifunc_resolver(ptr);
- wlock_acquire(rtld_bind_lock, lockstate);
- *where = target;
- break;
+ if (!obj->irelative_nonplt)
+ return (0);
+ obj->irelative_nonplt = false;
+ relalim = (const Elf_Rela *)((const char *)obj->rela + obj->relasize);
+ for (rela = obj->rela; rela < relalim; rela++) {
+ if (ELF_R_TYPE(rela->r_info) == R_X86_64_IRELATIVE)
+ reloc_iresolve_one(obj, rela, lockstate);
}
- }
- obj->irelative = false;
- return (0);
+ return (0);
}
int
Modified: projects/clang1000-import/libexec/rtld-elf/arm/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/arm/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/arm/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -452,6 +452,15 @@ reloc_iresolve(Obj_Entry *obj __unused,
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+
+ /* XXX not implemented */
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused,
struct Struct_RtldLockState *lockstate __unused)
{
Modified: projects/clang1000-import/libexec/rtld-elf/i386/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/i386/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/i386/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -263,6 +263,9 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int
case R_386_TLS_DTPOFF32:
*where += (Elf_Addr) def->st_value;
break;
+ case R_386_IRELATIVE:
+ obj->irelative_nonplt = true;
+ break;
default:
_rtld_error("%s: Unsupported relocation type %d"
" in non-PLT relocations\n", obj->path,
@@ -365,29 +368,51 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
return (target);
}
+static void
+reloc_iresolve_one(Obj_Entry *obj, const Elf_Rel *rel,
+ RtldLockState *lockstate)
+{
+ Elf_Addr *where, target;
+
+ where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
+ lock_release(rtld_bind_lock, lockstate);
+ target = call_ifunc_resolver(obj->relocbase + *where);
+ wlock_acquire(rtld_bind_lock, lockstate);
+ *where = target;
+}
+
int
reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate)
{
- const Elf_Rel *rellim;
- const Elf_Rel *rel;
- Elf_Addr *where, target;
+ const Elf_Rel *rellim;
+ const Elf_Rel *rel;
- if (!obj->irelative)
+ if (!obj->irelative)
+ return (0);
+ obj->irelative = false;
+ rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize);
+ for (rel = obj->pltrel; rel < rellim; rel++) {
+ if (ELF_R_TYPE(rel->r_info) == R_386_IRELATIVE)
+ reloc_iresolve_one(obj, rel, lockstate);
+ }
return (0);
- rellim = (const Elf_Rel *)((const char *)obj->pltrel + obj->pltrelsize);
- for (rel = obj->pltrel; rel < rellim; rel++) {
- switch (ELF_R_TYPE(rel->r_info)) {
- case R_386_IRELATIVE:
- where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
- lock_release(rtld_bind_lock, lockstate);
- target = call_ifunc_resolver(obj->relocbase + *where);
- wlock_acquire(rtld_bind_lock, lockstate);
- *where = target;
- break;
+}
+
+int
+reloc_iresolve_nonplt(Obj_Entry *obj, RtldLockState *lockstate)
+{
+ const Elf_Rel *rellim;
+ const Elf_Rel *rel;
+
+ if (!obj->irelative_nonplt)
+ return (0);
+ obj->irelative_nonplt = false;
+ rellim = (const Elf_Rel *)((const char *)obj->rel + obj->relsize);
+ for (rel = obj->rel; rel < rellim; rel++) {
+ if (ELF_R_TYPE(rel->r_info) == R_386_IRELATIVE)
+ reloc_iresolve_one(obj, rel, lockstate);
}
- }
- obj->irelative = false;
- return (0);
+ return (0);
}
int
Modified: projects/clang1000-import/libexec/rtld-elf/mips/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/mips/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/mips/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -723,6 +723,15 @@ reloc_iresolve(Obj_Entry *obj __unused,
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+
+ /* XXX not implemented */
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused,
struct Struct_RtldLockState *lockstate __unused)
{
Modified: projects/clang1000-import/libexec/rtld-elf/powerpc/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/powerpc/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/powerpc/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -653,6 +653,13 @@ reloc_iresolve(Obj_Entry *obj,
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused,
struct Struct_RtldLockState *lockstate __unused)
{
Modified: projects/clang1000-import/libexec/rtld-elf/powerpc64/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/powerpc64/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/powerpc64/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -652,6 +652,13 @@ reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __u
#endif
}
+int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+ return (0);
+}
+
void
init_pltgot(Obj_Entry *obj)
{
Modified: projects/clang1000-import/libexec/rtld-elf/riscv/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/riscv/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/riscv/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -212,6 +212,15 @@ reloc_iresolve(Obj_Entry *obj __unused,
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+
+ /* XXX not implemented */
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused,
struct Struct_RtldLockState *lockstate __unused)
{
Modified: projects/clang1000-import/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/rtld.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/rtld.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -3034,10 +3034,13 @@ resolve_object_ifunc(Obj_Entry *obj, bool bind_now, in
if (obj->ifuncs_resolved)
return (0);
obj->ifuncs_resolved = true;
- if (!obj->irelative && !((obj->bind_now || bind_now) && obj->gnu_ifunc))
+ if (!obj->irelative && !obj->irelative_nonplt &&
+ !((obj->bind_now || bind_now) && obj->gnu_ifunc))
return (0);
if (obj_disable_relro(obj) == -1 ||
(obj->irelative && reloc_iresolve(obj, lockstate) == -1) ||
+ (obj->irelative_nonplt && reloc_iresolve_nonplt(obj,
+ lockstate) == -1) ||
((obj->bind_now || bind_now) && obj->gnu_ifunc &&
reloc_gnu_ifunc(obj, flags, lockstate) == -1) ||
obj_enforce_relro(obj) == -1)
Modified: projects/clang1000-import/libexec/rtld-elf/rtld.h
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/rtld.h Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/rtld.h Fri Feb 14 19:32:58 2020 (r357930)
@@ -264,6 +264,7 @@ typedef struct Struct_Obj_Entry {
bool dag_inited : 1; /* Object has its DAG initialized. */
bool filtees_loaded : 1; /* Filtees loaded */
bool irelative : 1; /* Object has R_MACHDEP_IRELATIVE relocs */
+ bool irelative_nonplt : 1; /* Object has R_MACHDEP_IRELATIVE non-plt relocs */
bool gnu_ifunc : 1; /* Object has references to STT_GNU_IFUNC */
bool non_plt_gnu_ifunc : 1; /* Object has non-plt IFUNC references */
bool ifuncs_resolved : 1; /* Object ifuncs were already resolved */
@@ -406,6 +407,7 @@ int reloc_non_plt(Obj_Entry *, Obj_Entry *, int flags,
int reloc_plt(Obj_Entry *, int flags, struct Struct_RtldLockState *);
int reloc_jmpslots(Obj_Entry *, int flags, struct Struct_RtldLockState *);
int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *);
+int reloc_iresolve_nonplt(Obj_Entry *, struct Struct_RtldLockState *);
int reloc_gnu_ifunc(Obj_Entry *, int flags, struct Struct_RtldLockState *);
void ifunc_init(Elf_Auxinfo[__min_size(AT_COUNT)]);
void pre_init(void);
Modified: projects/clang1000-import/libexec/rtld-elf/sparc64/reloc.c
==============================================================================
--- projects/clang1000-import/libexec/rtld-elf/sparc64/reloc.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/libexec/rtld-elf/sparc64/reloc.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -570,6 +570,15 @@ reloc_iresolve(Obj_Entry *obj __unused,
}
int
+reloc_iresolve_nonplt(Obj_Entry *obj __unused,
+ struct Struct_RtldLockState *lockstate __unused)
+{
+
+ /* XXX not implemented */
+ return (0);
+}
+
+int
reloc_gnu_ifunc(Obj_Entry *obj __unused, int flags __unused,
struct Struct_RtldLockState *lockstate __unused)
{
Modified: projects/clang1000-import/share/misc/committers-ports.dot
==============================================================================
--- projects/clang1000-import/share/misc/committers-ports.dot Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/share/misc/committers-ports.dot Fri Feb 14 19:32:58 2020 (r357930)
@@ -159,6 +159,7 @@ kevlo [label="Kevin Lo\nkevlo at FreeBSD.org\n2003/02/21"
kmoore [label="Kris Moore\nkmoore at FreeBSD.org\n2009/04/14"]
knu [label="Akinori Musha\nknu at FreeBSD.org\n2000/03/22"]
koitsu [label="Jeremy Chadwick\nkoitsu at FreeBSD.org\n2006/11/10"]
+koobs [label="Kubilay Kocak\nkoobs at FreeBSD.org\n2012/12/24"]
krion [label="Kirill Ponomarew\nkrion at FreeBSD.org\n2003/07/20"]
kwm [label="Koop Mast\nkwm at FreeBSD.org\n2004/09/14"]
laszlof [label="Frank Laszlo\nlaszlof at FreeBSD.org\n2006/11/07"]
Modified: projects/clang1000-import/sys/amd64/amd64/trap.c
==============================================================================
--- projects/clang1000-import/sys/amd64/amd64/trap.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/amd64/trap.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -1068,25 +1068,32 @@ flush_l1d_hw(void)
wrmsr(MSR_IA32_FLUSH_CMD, IA32_FLUSH_CMD_L1D);
}
-static void __inline
-amd64_syscall_ret_flush_l1d_inline(int error)
+static void __noinline
+amd64_syscall_ret_flush_l1d_check(int error)
{
void (*p)(void);
- if (error != 0 && error != EEXIST && error != EAGAIN &&
- error != EXDEV && error != ENOENT && error != ENOTCONN &&
- error != EINPROGRESS) {
- p = syscall_ret_l1d_flush;
+ if (error != EEXIST && error != EAGAIN && error != EXDEV &&
+ error != ENOENT && error != ENOTCONN && error != EINPROGRESS) {
+ p = (void *)atomic_load_ptr(&syscall_ret_l1d_flush);
if (p != NULL)
p();
}
}
+static void __inline
+amd64_syscall_ret_flush_l1d_check_inline(int error)
+{
+
+ if (__predict_false(error != 0))
+ amd64_syscall_ret_flush_l1d_check(error);
+}
+
void
amd64_syscall_ret_flush_l1d(int error)
{
- amd64_syscall_ret_flush_l1d_inline(error);
+ amd64_syscall_ret_flush_l1d_check_inline(error);
}
void
@@ -1190,5 +1197,5 @@ amd64_syscall(struct thread *td, int traced)
if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS))
set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
- amd64_syscall_ret_flush_l1d_inline(td->td_errno);
+ amd64_syscall_ret_flush_l1d_check_inline(td->td_errno);
}
Modified: projects/clang1000-import/sys/amd64/vmm/io/iommu.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/io/iommu.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/io/iommu.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -184,7 +184,7 @@ iommu_init(void)
if (vmm_is_intel())
ops = &iommu_ops_intel;
- else if (vmm_is_amd())
+ else if (vmm_is_svm())
ops = &iommu_ops_amd;
else
ops = NULL;
Modified: projects/clang1000-import/sys/amd64/vmm/vmm.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/vmm.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -347,7 +347,7 @@ vmm_init(void)
if (vmm_is_intel())
ops = &vmm_ops_intel;
- else if (vmm_is_amd())
+ else if (vmm_is_svm())
ops = &vmm_ops_amd;
else
return (ENXIO);
Modified: projects/clang1000-import/sys/amd64/vmm/vmm_stat.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm_stat.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/vmm_stat.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -67,7 +67,7 @@ vmm_stat_register(void *arg)
if (vst->scope == VMM_STAT_SCOPE_INTEL && !vmm_is_intel())
return;
- if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_amd())
+ if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_svm())
return;
if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) {
Modified: projects/clang1000-import/sys/amd64/vmm/vmm_util.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm_util.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/vmm_util.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -46,9 +46,10 @@ vmm_is_intel(void)
}
bool
-vmm_is_amd(void)
+vmm_is_svm(void)
{
- return (strcmp(cpu_vendor, "AuthenticAMD") == 0);
+ return (strcmp(cpu_vendor, "AuthenticAMD") == 0 ||
+ strcmp(cpu_vendor, "HygonGenuine") == 0);
}
bool
Modified: projects/clang1000-import/sys/amd64/vmm/vmm_util.h
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm_util.h Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/vmm_util.h Fri Feb 14 19:32:58 2020 (r357930)
@@ -34,7 +34,7 @@
struct trapframe;
bool vmm_is_intel(void);
-bool vmm_is_amd(void);
+bool vmm_is_svm(void);
bool vmm_supports_1G_pages(void);
void dump_trapframe(struct trapframe *tf);
Modified: projects/clang1000-import/sys/amd64/vmm/x86.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/x86.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/amd64/vmm/x86.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -135,7 +135,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
case CPUID_8000_0008:
cpuid_count(*eax, *ecx, regs);
- if (vmm_is_amd()) {
+ if (vmm_is_svm()) {
/*
* As on Intel (0000_0007:0, EDX), mask out
* unsupported or unsafe AMD extended features
@@ -234,7 +234,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
case CPUID_8000_001D:
/* AMD Cache topology, like 0000_0004 for Intel. */
- if (!vmm_is_amd())
+ if (!vmm_is_svm())
goto default_leaf;
/*
@@ -276,8 +276,11 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
case CPUID_8000_001E:
- /* AMD Family 16h+ additional identifiers */
- if (!vmm_is_amd() || CPUID_TO_FAMILY(cpu_id) < 0x16)
+ /*
+ * AMD Family 16h+ and Hygon Family 18h additional
+ * identifiers.
+ */
+ if (!vmm_is_svm() || CPUID_TO_FAMILY(cpu_id) < 0x16)
goto default_leaf;
vm_get_topology(vm, &sockets, &cores, &threads,
Modified: projects/clang1000-import/sys/cam/cam_periph.c
==============================================================================
--- projects/clang1000-import/sys/cam/cam_periph.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/cam/cam_periph.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <cam/cam_periph.h>
#include <cam/cam_debug.h>
#include <cam/cam_sim.h>
+#include <cam/cam_xpt_internal.h> /* For KASSERTs only */
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
@@ -681,6 +682,10 @@ camperiphfree(struct cam_periph *periph)
cam_periph_assert(periph, MA_OWNED);
KASSERT(periph->periph_allocating == 0, ("%s%d: freed while allocating",
periph->periph_name, periph->unit_number));
+ KASSERT(periph->path->device->ccbq.dev_active == 0,
+ ("%s%d: freed with %d active CCBs\n",
+ periph->periph_name, periph->unit_number,
+ periph->path->device->ccbq.dev_active));
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0)
break;
Modified: projects/clang1000-import/sys/cam/cam_xpt.c
==============================================================================
--- projects/clang1000-import/sys/cam/cam_xpt.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/cam/cam_xpt.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -248,7 +248,6 @@ static void xpt_run_allocq(struct cam_periph *periph,
static void xpt_run_allocq_task(void *context, int pending);
static void xpt_run_devq(struct cam_devq *devq);
static callout_func_t xpt_release_devq_timeout;
-static void xpt_release_simq_timeout(void *arg) __unused;
static void xpt_acquire_bus(struct cam_eb *bus);
static void xpt_release_bus(struct cam_eb *bus);
static uint32_t xpt_freeze_devq_device(struct cam_ed *dev, u_int count);
@@ -4619,18 +4618,6 @@ xpt_release_simq(struct cam_sim *sim, int run_queue)
}
}
mtx_unlock(&devq->send_mtx);
-}
-
-/*
- * XXX Appears to be unused.
- */
-static void
-xpt_release_simq_timeout(void *arg)
-{
- struct cam_sim *sim;
-
- sim = (struct cam_sim *)arg;
- xpt_release_simq(sim, /* run_queue */ TRUE);
}
void
Modified: projects/clang1000-import/sys/dev/ahci/ahci_pci.c
==============================================================================
--- projects/clang1000-import/sys/dev/ahci/ahci_pci.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/ahci/ahci_pci.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -90,6 +90,7 @@ static const struct {
{0x06221b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX},
{0x06241b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX},
{0x06251b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX},
+ {0x79011d94, 0x00, "Hygon KERNCZ", 0},
{0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE},
{0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE},
{0x26818086, 0x00, "Intel ESB2", 0},
Modified: projects/clang1000-import/sys/dev/amd_ecc_inject/ecc_inject.c
==============================================================================
--- projects/clang1000-import/sys/dev/amd_ecc_inject/ecc_inject.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/amd_ecc_inject/ecc_inject.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -203,7 +203,8 @@ ecc_ei_load(void)
{
uint32_t val;
- if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) {
+ if ((cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) &&
+ cpu_vendor_id != CPU_VENDOR_HYGON) {
printf("DRAM ECC error injection is not supported\n");
return (ENXIO);
}
Modified: projects/clang1000-import/sys/dev/amdpm/amdpm.c
==============================================================================
--- projects/clang1000-import/sys/dev/amdpm/amdpm.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/amdpm/amdpm.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -67,6 +67,8 @@ static int amdpm_debug = 0;
#define AMDPM_DEVICEID_AMD768PM 0x7443
#define AMDPM_DEVICEID_AMD8111PM 0x746B
+#define AMDPM_VENDORID_HYGON 0x1d94
+
/* nVidia nForce chipset */
#define AMDPM_VENDORID_NVIDIA 0x10de
#define AMDPM_DEVICEID_NF_SMB 0x01b4
@@ -199,7 +201,8 @@ amdpm_attach(device_t dev)
pci_write_config(dev, AMDPCI_GEN_CONFIG_PM, val_b | AMDPCI_PMIOEN, 1);
/* Allocate I/O space */
- if (pci_get_vendor(dev) == AMDPM_VENDORID_AMD)
+ if (pci_get_vendor(dev) == AMDPM_VENDORID_AMD ||
+ pci_get_vendor(dev) == AMDPM_VENDORID_HYGON)
amdpm_sc->rid = AMDPCI_PMBASE;
else
amdpm_sc->rid = NFPCI_PMBASE;
Modified: projects/clang1000-import/sys/dev/amdsbwd/amd_chipset.h
==============================================================================
--- projects/clang1000-import/sys/dev/amdsbwd/amd_chipset.h Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/amdsbwd/amd_chipset.h Fri Feb 14 19:32:58 2020 (r357930)
@@ -146,3 +146,5 @@
#define AMDCZ_SMBUS_DEVID 0x790b1022
#define AMDCZ49_SMBUS_REVID 0x49
+#define HYGONCZ_SMBUS_DEVID 0x790b1d94
+
Modified: projects/clang1000-import/sys/dev/amdsbwd/amdsbwd.c
==============================================================================
--- projects/clang1000-import/sys/dev/amdsbwd/amdsbwd.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/amdsbwd/amdsbwd.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
+#include <machine/cputypes.h>
+#include <machine/md_var.h>
#include <machine/resource.h>
#include <sys/watchdog.h>
@@ -269,7 +271,8 @@ amdsbwd_identify(driver_t *driver, device_t parent)
return;
if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID &&
pci_get_devid(smb_dev) != AMDFCH_SMBUS_DEVID &&
- pci_get_devid(smb_dev) != AMDCZ_SMBUS_DEVID)
+ pci_get_devid(smb_dev) != AMDCZ_SMBUS_DEVID &&
+ pci_get_devid(smb_dev) != HYGONCZ_SMBUS_DEVID)
return;
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1);
@@ -378,6 +381,7 @@ static void
amdsbwd_probe_fch41(device_t dev, struct resource *pmres, uint32_t *addr)
{
uint8_t val;
+ char buf[36];
val = pmio_read(pmres, AMDFCH41_PM_ISA_CTRL);
if ((val & AMDFCH41_MMIO_EN) != 0) {
@@ -416,7 +420,9 @@ amdsbwd_probe_fch41(device_t dev, struct resource *pmr
amdsbwd_verbose_printf(dev, "AMDFCH41_PM_DECODE_EN3 value = %#04x\n",
val);
#endif
- device_set_desc(dev, "AMD FCH Rev 41h+ Watchdog Timer");
+ snprintf(buf, sizeof(buf), "%s FCH Rev 41h+ Watchdog Timer",
+ cpu_vendor_id == CPU_VENDOR_HYGON ? "Hygon" : "AMD");
+ device_set_desc_copy(dev, buf);
}
static int
Modified: projects/clang1000-import/sys/dev/cxgbe/adapter.h
==============================================================================
--- projects/clang1000-import/sys/dev/cxgbe/adapter.h Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/cxgbe/adapter.h Fri Feb 14 19:32:58 2020 (r357930)
@@ -574,7 +574,6 @@ struct sge_txq {
uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */
uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */
uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */
- uint64_t tls_wrs; /* # of TLS work requests */
uint64_t kern_tls_records;
uint64_t kern_tls_short;
Modified: projects/clang1000-import/sys/dev/cxgbe/crypto/t4_kern_tls.c
==============================================================================
--- projects/clang1000-import/sys/dev/cxgbe/crypto/t4_kern_tls.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/cxgbe/crypto/t4_kern_tls.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -2082,7 +2082,6 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq
ndesc += howmany(wr_len, EQ_ESIZE);
MPASS(ndesc <= available);
- txq->tls_wrs++;
txq->kern_tls_records++;
txq->kern_tls_octets += tlen - mtod(m_tls, vm_offset_t);
Modified: projects/clang1000-import/sys/dev/cxgbe/t4_main.c
==============================================================================
--- projects/clang1000-import/sys/dev/cxgbe/t4_main.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/cxgbe/t4_main.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -10359,7 +10359,6 @@ clear_stats(struct adapter *sc, u_int port_id)
txq->txpkts0_pkts = 0;
txq->txpkts1_pkts = 0;
txq->raw_wrs = 0;
- txq->tls_wrs = 0;
txq->kern_tls_records = 0;
txq->kern_tls_short = 0;
txq->kern_tls_partial = 0;
Modified: projects/clang1000-import/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- projects/clang1000-import/sys/dev/cxgbe/t4_sge.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/cxgbe/t4_sge.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -4204,8 +4204,6 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int
"# of frames tx'd using type1 txpkts work requests");
SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD,
&txq->raw_wrs, "# of raw work requests (non-packets)");
- SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "tls_wrs", CTLFLAG_RD,
- &txq->tls_wrs, "# of TLS work requests (TLS records)");
#ifdef KERN_TLS
if (sc->flags & KERN_TLS_OK) {
Modified: projects/clang1000-import/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c
==============================================================================
--- projects/clang1000-import/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -188,6 +188,7 @@ hyperv_tsc_tcinit(void *dummy __unused)
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
+ case CPU_VENDOR_HYGON:
hyperv_tsc_timecounter.tc_get_timecount =
hyperv_tsc_timecount_mfence;
tc64 = hyperv_tc64_tsc_mfence;
Modified: projects/clang1000-import/sys/dev/intpm/intpm.c
==============================================================================
--- projects/clang1000-import/sys/dev/intpm/intpm.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/intpm/intpm.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -102,6 +102,7 @@ const struct intsmb_device {
{ AMDSB_SMBUS_DEVID, "AMD SB600/7xx/8xx/9xx SMBus Controller" },
{ AMDFCH_SMBUS_DEVID, "AMD FCH SMBus Controller" },
{ AMDCZ_SMBUS_DEVID, "AMD FCH SMBus Controller" },
+ { HYGONCZ_SMBUS_DEVID, "Hygon FCH SMBus Controller" },
};
static int
@@ -243,6 +244,7 @@ intsmb_attach(device_t dev)
break;
case AMDFCH_SMBUS_DEVID:
case AMDCZ_SMBUS_DEVID:
+ case HYGONCZ_SMBUS_DEVID:
sc->sb8xx = 1;
break;
}
Modified: projects/clang1000-import/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
==============================================================================
--- projects/clang1000-import/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -339,10 +339,6 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
case CRYPTO_AES_NIST_GCM_16:
switch (en->cipher_key_len) {
case 128 / 8:
- if (en->auth_algorithm != CRYPTO_AES_128_NIST_GMAC) {
- error = EINVAL;
- goto failure;
- }
if (en->tls_vminor == TLS_MINOR_VER_TWO) {
if (MLX5_CAP_TLS(priv->mdev, tls_1_2_aes_gcm_128) == 0) {
error = EPROTONOSUPPORT;
@@ -360,10 +356,6 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
break;
case 256 / 8:
- if (en->auth_algorithm != CRYPTO_AES_256_NIST_GMAC) {
- error = EINVAL;
- goto failure;
- }
if (en->tls_vminor == TLS_MINOR_VER_TWO) {
if (MLX5_CAP_TLS(priv->mdev, tls_1_2_aes_gcm_256) == 0) {
error = EPROTONOSUPPORT;
Modified: projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.c
==============================================================================
--- projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -101,6 +101,16 @@ static const struct amd_ntb_hw_info amd_ntb_hw_info_li
.msix_vector_count = 24,
.quirks = 0,
.desc = "AMD Non-Transparent Bridge"},
+
+ { .vendor_id = NTB_HW_HYGON_VENDOR_ID,
+ .device_id = NTB_HW_HYGON_DEVICE_ID1,
+ .mw_count = 3,
+ .bar_start_idx = 1,
+ .spad_count = 16,
+ .db_count = 16,
+ .msix_vector_count = 24,
+ .quirks = QUIRK_MW0_32BIT,
+ .desc = "Hygon Non-Transparent Bridge"},
};
static const struct pci_device_table amd_ntb_devs[] = {
@@ -109,7 +119,10 @@ static const struct pci_device_table amd_ntb_devs[] =
PCI_DESCR("AMD Non-Transparent Bridge") },
{ PCI_DEV(NTB_HW_AMD_VENDOR_ID, NTB_HW_AMD_DEVICE_ID2),
.driver_data = (uintptr_t)&amd_ntb_hw_info_list[1],
- PCI_DESCR("AMD Non-Transparent Bridge") }
+ PCI_DESCR("AMD Non-Transparent Bridge") },
+ { PCI_DEV(NTB_HW_HYGON_VENDOR_ID, NTB_HW_HYGON_DEVICE_ID1),
+ .driver_data = (uintptr_t)&amd_ntb_hw_info_list[0],
+ PCI_DESCR("Hygon Non-Transparent Bridge") }
};
static unsigned g_amd_ntb_hw_debug_level;
Modified: projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.h
==============================================================================
--- projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.h Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/ntb/ntb_hw/ntb_hw_amd.h Fri Feb 14 19:32:58 2020 (r357930)
@@ -51,6 +51,9 @@
#define NTB_HW_AMD_DEVICE_ID1 0x145B
#define NTB_HW_AMD_DEVICE_ID2 0x148B
+#define NTB_HW_HYGON_VENDOR_ID 0x19D4
+#define NTB_HW_HYGON_DEVICE_ID1 0x145B
+
#define NTB_DEF_PEER_CNT 1
#define NTB_DEF_PEER_IDX 0
Modified: projects/clang1000-import/sys/dev/usb/input/ukbd.c
==============================================================================
--- projects/clang1000-import/sys/dev/usb/input/ukbd.c Fri Feb 14 19:31:24 2020 (r357929)
+++ projects/clang1000-import/sys/dev/usb/input/ukbd.c Fri Feb 14 19:32:58 2020 (r357930)
@@ -109,27 +109,21 @@ SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, pollrate, CTLFLAG_R
#define UKBD_EMULATE_ATSCANCODE 1
#define UKBD_DRIVER_NAME "ukbd"
-#define UKBD_NMOD 8 /* units */
-#define UKBD_NKEYCODE 6 /* units */
-#define UKBD_IN_BUF_SIZE (2*(UKBD_NMOD + (2*UKBD_NKEYCODE))) /* bytes */
-#define UKBD_IN_BUF_FULL ((UKBD_IN_BUF_SIZE / 2) - 1) /* bytes */
+#define UKBD_NKEYCODE 256 /* units */
+#define UKBD_IN_BUF_SIZE (4 * UKBD_NKEYCODE) /* scancodes */
+#define UKBD_IN_BUF_FULL ((UKBD_IN_BUF_SIZE / 2) - 1) /* scancodes */
#define UKBD_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */
#define UKBD_BUFFER_SIZE 64 /* bytes */
+#define UKBD_KEY_PRESSED(map, key) ({ \
+ CTASSERT((key) >= 0 && (key) < UKBD_NKEYCODE); \
+ ((map)[(key) / 64] & (1ULL << ((key) % 64))); \
+})
+#define MOD_EJECT 0x01
+#define MOD_FN 0x02
+
struct ukbd_data {
- uint16_t modifiers;
-#define MOD_CONTROL_L 0x01
-#define MOD_CONTROL_R 0x10
-#define MOD_SHIFT_L 0x02
-#define MOD_SHIFT_R 0x20
-#define MOD_ALT_L 0x04
-#define MOD_ALT_R 0x40
-#define MOD_WIN_L 0x08
-#define MOD_WIN_R 0x80
-/* internal */
-#define MOD_EJECT 0x0100
-#define MOD_FN 0x0200
- uint8_t keycode[UKBD_NKEYCODE];
+ uint64_t bitmap[howmany(UKBD_NKEYCODE, 64)];
};
enum {
@@ -144,17 +138,10 @@ struct ukbd_softc {
keymap_t sc_keymap;
accentmap_t sc_accmap;
fkeytab_t sc_fkeymap[UKBD_NFKEY];
+ uint64_t sc_loc_key_valid[howmany(UKBD_NKEYCODE, 64)];
struct hid_location sc_loc_apple_eject;
struct hid_location sc_loc_apple_fn;
- struct hid_location sc_loc_ctrl_l;
- struct hid_location sc_loc_ctrl_r;
- struct hid_location sc_loc_shift_l;
- struct hid_location sc_loc_shift_r;
- struct hid_location sc_loc_alt_l;
- struct hid_location sc_loc_alt_r;
- struct hid_location sc_loc_win_l;
- struct hid_location sc_loc_win_r;
- struct hid_location sc_loc_events;
+ struct hid_location sc_loc_key[UKBD_NKEYCODE];
struct hid_location sc_loc_numlock;
struct hid_location sc_loc_capslock;
struct hid_location sc_loc_scrolllock;
@@ -172,8 +159,7 @@ struct ukbd_softc {
sbintime_t sc_co_basetime;
int sc_delay;
- uint32_t sc_ntime[UKBD_NKEYCODE];
- uint32_t sc_otime[UKBD_NKEYCODE];
+ uint32_t sc_repeat_time;
uint32_t sc_input[UKBD_IN_BUF_SIZE]; /* input buffer */
uint32_t sc_time_ms;
uint32_t sc_composed_char; /* composed char code, if non-zero */
@@ -191,15 +177,6 @@ struct ukbd_softc {
#define UKBD_FLAG_APPLE_EJECT 0x00000040
#define UKBD_FLAG_APPLE_FN 0x00000080
#define UKBD_FLAG_APPLE_SWAP 0x00000100
-#define UKBD_FLAG_CTRL_L 0x00000400
-#define UKBD_FLAG_CTRL_R 0x00000800
-#define UKBD_FLAG_SHIFT_L 0x00001000
-#define UKBD_FLAG_SHIFT_R 0x00002000
-#define UKBD_FLAG_ALT_L 0x00004000
-#define UKBD_FLAG_ALT_R 0x00008000
-#define UKBD_FLAG_WIN_L 0x00010000
-#define UKBD_FLAG_WIN_R 0x00020000
-#define UKBD_FLAG_EVENTS 0x00040000
#define UKBD_FLAG_NUMLOCK 0x00080000
#define UKBD_FLAG_CAPSLOCK 0x00100000
#define UKBD_FLAG_SCROLLLOCK 0x00200000
@@ -214,31 +191,23 @@ struct ukbd_softc {
uint16_t sc_inputs;
uint16_t sc_inputhead;
uint16_t sc_inputtail;
- uint16_t sc_modifiers;
uint8_t sc_leds; /* store for async led requests */
uint8_t sc_iface_index;
uint8_t sc_iface_no;
uint8_t sc_id_apple_eject;
uint8_t sc_id_apple_fn;
- uint8_t sc_id_ctrl_l;
- uint8_t sc_id_ctrl_r;
- uint8_t sc_id_shift_l;
- uint8_t sc_id_shift_r;
- uint8_t sc_id_alt_l;
- uint8_t sc_id_alt_r;
- uint8_t sc_id_win_l;
- uint8_t sc_id_win_r;
- uint8_t sc_id_event;
+ uint8_t sc_id_loc_key[UKBD_NKEYCODE];
uint8_t sc_id_numlock;
uint8_t sc_id_capslock;
uint8_t sc_id_scrolllock;
- uint8_t sc_id_events;
uint8_t sc_kbd_id;
+ uint8_t sc_repeat_key;
uint8_t sc_buffer[UKBD_BUFFER_SIZE];
};
+#define KEY_NONE 0x00
#define KEY_ERROR 0x01
#define KEY_PRESS 0
@@ -259,21 +228,6 @@ struct ukbd_softc {
#define UKBD_UNLOCK() USB_MTX_UNLOCK(&Giant)
#define UKBD_LOCK_ASSERT() USB_MTX_ASSERT(&Giant, MA_OWNED)
-struct ukbd_mods {
- uint32_t mask, key;
-};
-
-static const struct ukbd_mods ukbd_mods[UKBD_NMOD] = {
- {MOD_CONTROL_L, 0xe0},
- {MOD_CONTROL_R, 0xe4},
- {MOD_SHIFT_L, 0xe1},
- {MOD_SHIFT_R, 0xe5},
- {MOD_ALT_L, 0xe2},
- {MOD_ALT_R, 0xe6},
- {MOD_WIN_L, 0xe3},
- {MOD_WIN_R, 0xe7},
-};
-
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list