svn commit: r305466 - stable/9/sys/boot/i386/libi386
Author: avg Date: Tue Sep 6 08:14:56 2016 New Revision: 305466 URL: https://svnweb.freebsd.org/changeset/base/305466 Log: fix r305459: stdint.h has to be included for uintmax_t Apparently on other branches the type is visible via indirect inclusions. Modified: stable/9/sys/boot/i386/libi386/biosdisk.c Modified: stable/9/sys/boot/i386/libi386/biosdisk.c == --- stable/9/sys/boot/i386/libi386/biosdisk.c Tue Sep 6 06:40:59 2016 (r305465) +++ stable/9/sys/boot/i386/libi386/biosdisk.c Tue Sep 6 08:14:56 2016 (r305466) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305467 - in head: . etc/mtree tests/sys/kqueue tests/sys/kqueue/libkqueue
Author: ngie Date: Tue Sep 6 08:45:29 2016 New Revision: 305467 URL: https://svnweb.freebsd.org/changeset/base/305467 Log: Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/... This is being done to clearly distinguish the libkqueue tests from the (soon to be imported) NetBSD tests. MFC after:58 days Sponsored by: EMC / Isilon Storage Division Added: head/tests/sys/kqueue/libkqueue/ head/tests/sys/kqueue/libkqueue/Makefile - copied, changed from r305466, head/tests/sys/kqueue/Makefile head/tests/sys/kqueue/libkqueue/Makefile.depend - copied unchanged from r305466, head/tests/sys/kqueue/Makefile.depend head/tests/sys/kqueue/libkqueue/common.h - copied unchanged from r305466, head/tests/sys/kqueue/common.h head/tests/sys/kqueue/libkqueue/config.h - copied unchanged from r305466, head/tests/sys/kqueue/config.h head/tests/sys/kqueue/libkqueue/kqueue_test.sh - copied unchanged from r305466, head/tests/sys/kqueue/kqueue_test.sh head/tests/sys/kqueue/libkqueue/main.c - copied unchanged from r305466, head/tests/sys/kqueue/main.c head/tests/sys/kqueue/libkqueue/proc.c - copied unchanged from r305466, head/tests/sys/kqueue/proc.c head/tests/sys/kqueue/libkqueue/read.c - copied unchanged from r305466, head/tests/sys/kqueue/read.c head/tests/sys/kqueue/libkqueue/signal.c - copied unchanged from r305466, head/tests/sys/kqueue/signal.c head/tests/sys/kqueue/libkqueue/timer.c - copied unchanged from r305466, head/tests/sys/kqueue/timer.c head/tests/sys/kqueue/libkqueue/user.c - copied unchanged from r305466, head/tests/sys/kqueue/user.c head/tests/sys/kqueue/libkqueue/vnode.c - copied unchanged from r305466, head/tests/sys/kqueue/vnode.c Replaced: head/tests/sys/kqueue/Makefile (contents, props changed) Deleted: head/tests/sys/kqueue/Makefile.depend head/tests/sys/kqueue/common.h head/tests/sys/kqueue/config.h head/tests/sys/kqueue/kqueue_test.sh head/tests/sys/kqueue/main.c head/tests/sys/kqueue/proc.c head/tests/sys/kqueue/read.c head/tests/sys/kqueue/signal.c head/tests/sys/kqueue/timer.c head/tests/sys/kqueue/user.c head/tests/sys/kqueue/vnode.c Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.tests.dist Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Tue Sep 6 08:14:56 2016(r305466) +++ head/ObsoleteFiles.inc Tue Sep 6 08:45:29 2016(r305467) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue +OLD_FILES+=usr/tests/sys/kqueue/kqtest +OLD_FILES+=usr/tests/sys/kqueue/kqueue_test # 20160901: Remove digi(4) OLD_FILES+=usr/share/man/man4/digi.4.gz # 20160819: Remove ie(4) Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Tue Sep 6 08:14:56 2016 (r305466) +++ head/etc/mtree/BSD.tests.dist Tue Sep 6 08:45:29 2016 (r305467) @@ -419,6 +419,8 @@ .. .. kqueue +libkqueue +.. .. mac bsdextended Added: head/tests/sys/kqueue/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kqueue/Makefile Tue Sep 6 08:45:29 2016 (r305467) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/kqueue +BINDIR=${TESTSDIR} + +TESTS_SUBDIRS+=libkqueue + +.include Copied and modified: head/tests/sys/kqueue/libkqueue/Makefile (from r305466, head/tests/sys/kqueue/Makefile) == --- head/tests/sys/kqueue/Makefile Tue Sep 6 08:14:56 2016 (r305466, copy source) +++ head/tests/sys/kqueue/libkqueue/MakefileTue Sep 6 08:45:29 2016 (r305467) @@ -1,16 +1,11 @@ # $FreeBSD$ -# -# svn://mark.heily.com/libkqueue/trunk/test -# Last update: r114 -# -# libkqueue and test suite by Mark Heily -# - -TAP_TESTS_SH= kqueue_test -TESTSDIR= ${TESTSBASE}/sys/kqueue +TESTSDIR= ${TESTSBASE}/sys/kqueue/libkqueue BINDIR=${TESTSDIR} +# libkqueue and test suite by Mark Heily +TAP_TESTS_SH= kqueue_test + PROGS= kqtest SRCS.kqtest= \ Copied: head/tests/sys/kqueue/libkqueue/Makefile.depend (from r305466, head/tests/sys/kqueue/Makefile.depend) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kqueue/libkqueue/Makefile.depend Tue Sep 6 08:45:29 2016(r305467, copy of r305466, head/tests/sys/kqueue/Makefile.depend) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit
svn commit: r305468 - in head: contrib/netbsd-tests/kernel/kqueue tests/sys/kqueue
Author: ngie Date: Tue Sep 6 08:50:21 2016 New Revision: 305468 URL: https://svnweb.freebsd.org/changeset/base/305468 Log: Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/... proc2_test must be skipped because the invariant tested (`ke.fflags & NOTE_TRACKERR`) doesn't pass. MFC after:58 days Submitted by: kib (earlier form) Sponsored by: EMC / Isilon Storage Division Differential Revision:https://reviews.freebsd.org/D6172 Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c head/contrib/netbsd-tests/kernel/kqueue/t_sig.c head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c head/tests/sys/kqueue/Makefile Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Tue Sep 6 08:45:29 2016(r305467) +++ head/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Tue Sep 6 08:50:21 2016(r305468) @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Tue Sep 6 08:45:29 2016(r305467) +++ head/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Tue Sep 6 08:50:21 2016(r305468) @@ -32,6 +32,9 @@ #include __RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: head/contrib/netbsd-tests/kernel/kqueue/t_sig.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Tue Sep 6 08:45:29 2016(r305467) +++ head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Tue Sep 6 08:50:21 2016(r305468) @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -60,9 +63,13 @@ ATF_TC_HEAD(sig, tc) ATF_TC_BODY(sig, tc) { struct timespec timeout; +#ifdef __NetBSD__ struct kfilter_mapping km; +#endif struct kevent event[1]; +#ifdef __NetBSD__ char namebuf[32]; +#endif pid_t pid, child; int kq, n, num, status; @@ -84,16 +91,22 @@ ATF_TC_BODY(sig, tc) RL(kq = kqueue()); +#ifdef __NetBSD__ (void)strlcpy(namebuf, "EVFILT_SIGNAL", sizeof(namebuf)); km.name = namebuf; RL(ioctl(kq, KFILTER_BYNAME, &km)); (void)printf("got %d as filter number for `%s'.\n", km.filter, km.name); +#endif /* ignore the signal to avoid taking it for real */ REQUIRE_LIBC(signal(SIGUSR1, SIG_IGN), SIG_ERR); event[0].ident = SIGUSR1; +#ifdef __NetBSD__ event[0].filter = km.filter; +#else + event[0].filter = EVFILT_SIGNAL; +#endif event[0].flags = EV_ADD | EV_ENABLE; RL(kevent(kq, event, 1, NULL, 0, NULL)); Modified: head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Tue Sep 6 08:45:29 2016(r305467) +++ head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Tue Sep 6 08:50:21 2016(r305468) @@ -1,3 +1,6 @@ +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: head/tests/sys/kqueue/Makefile == --- head/tests/sys/kqueue/Makefile Tue Sep 6 08:45:29 2016 (r305467) +++ head/tests/sys/kqueue/Makefile Tue Sep 6 08:50:21 2016 (r305468) @@ -1,8 +1,20 @@ # $FreeBSD$ +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel/kqueue + TESTSDIR= ${TESTSBASE}/sys/kqueue BINDIR=${TESTSDIR} +NETBSD_ATF_TESTS_C=proc1_test +# XXX: fails `ke.fflags & NOTE_TRACKERR` invariant +#NETBSD_ATF_TESTS_C+= proc2_test +NETBSD_ATF_TESTS_C+= proc3_test +NETBSD_ATF_TESTS_C+= sig_test +NETBSD_ATF_TESTS_C+= vnode_test + +WARNS?=3 + TESTS_SUBDIRS+=libkqueue +.include .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305469 - head/usr.sbin/portsnap/portsnap
Author: delphij Date: Tue Sep 6 08:52:00 2016 New Revision: 305469 URL: https://svnweb.freebsd.org/changeset/base/305469 Log: Ensure that we always open only files that is named by explicitly using shell redirections instead of having gzip(1) to decide what file to open. Issue reported in the "non-cryptanalytic attacks against freebsd update components" anonymous gist. Reviewed by: allanjude, emaste MFC after:3 days Differential Revision:https://reviews.freebsd.org/D7653 Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh == --- head/usr.sbin/portsnap/portsnap/portsnap.sh Tue Sep 6 08:50:21 2016 (r305468) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Tue Sep 6 08:52:00 2016 (r305469) @@ -651,7 +651,7 @@ fetch_index_sanity() { # Verify a list of files fetch_snapshot_verify() { while read F; do - if [ "`gunzip -c snap/${F} | ${SHA256} -q`" != ${F} ]; then + if [ "`gunzip -c < snap/${F}.gz | ${SHA256} -q`" != ${F} ]; then echo "snapshot corrupt." return 1 fi @@ -686,7 +686,7 @@ fetch_snapshot() { cut -f 2 -d '|' tINDEX.new | fetch_snapshot_verify || return 1 # Extract the index rm -f INDEX.new - gunzip -c snap/`look INDEX tINDEX.new | + gunzip -c < snap/`look INDEX tINDEX.new | cut -f 2 -d '|'`.gz > INDEX.new fetch_index_sanity || return 1 # Verify the snapshot contents @@ -782,7 +782,7 @@ fetch_update() { # Extract the index echo -n "Extracting index... " 1>${QUIETREDIR} - gunzip -c files/`look INDEX tINDEX.new | + gunzip -c < files/`look INDEX tINDEX.new | cut -f 2 -d '|'`.gz > INDEX.new fetch_index_sanity || return 1 @@ -902,7 +902,7 @@ extract_make_index() { echo -n "$1 not provided by portsnap server; " echo "$2 not being generated." else - gunzip -c "${WORKDIR}/files/`look $1 ${WORKDIR}/tINDEX | + gunzip -c < "${WORKDIR}/files/`look $1 ${WORKDIR}/tINDEX | cut -f 2 -d '|'`.gz" | cat - ${LOCALDESC} | ${MKINDEX} /dev/stdin > ${PORTSDIR}/$2 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305470 - head/sys/dev/iwm
Author: avos Date: Tue Sep 6 10:08:32 2016 New Revision: 305470 URL: https://svnweb.freebsd.org/changeset/base/305470 Log: iwm: fix scanning for hidden SSIDs. Setup SSIDs in scan command so firmware will send direct probe request(s) while scanning. Tested by:dbk...@gmail.com PR: 211519 MFC after:1 week Modified: head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_scan.c == --- head/sys/dev/iwm/if_iwm_scan.c Tue Sep 6 08:52:00 2016 (r305469) +++ head/sys/dev/iwm/if_iwm_scan.c Tue Sep 6 10:08:32 2016 (r305470) @@ -265,6 +265,7 @@ iwm_mvm_lmac_scan_fill_channels(struct i struct iwm_scan_channel_cfg_lmac *chan, int n_ssids) { struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_scan_state *ss = ic->ic_scan; struct ieee80211_channel *c; uint8_t nchan; int j; @@ -292,10 +293,11 @@ iwm_mvm_lmac_scan_fill_channels(struct i chan->iter_count = htole16(1); chan->iter_interval = htole32(0); chan->flags = htole32(IWM_UNIFIED_SCAN_CHANNEL_PARTIAL); -#if 0 /* makes scanning while associated less useful */ - if (n_ssids != 0) - chan->flags |= htole32(1 << 1); /* select SSID 0 */ -#endif + chan->flags |= htole32(IWM_SCAN_CHANNEL_NSSIDS(n_ssids)); + /* XXX IEEE80211_SCAN_NOBCAST flag is never set. */ + if (!IEEE80211_IS_CHAN_PASSIVE(c) && + (!(ss->ss_flags & IEEE80211_SCAN_NOBCAST) || n_ssids != 0)) + chan->flags |= htole32(IWM_SCAN_CHANNEL_TYPE_ACTIVE); chan++; nchan++; } @@ -334,11 +336,7 @@ iwm_mvm_umac_scan_fill_channels(struct i chan->channel_num = ieee80211_mhz2ieee(c->ic_freq, 0); chan->iter_count = 1; chan->iter_interval = htole16(0); - chan->flags = htole32(0); -#if 0 /* makes scanning while associated less useful */ - if (n_ssids != 0) - chan->flags = htole32(1 << 0); /* select SSID 0 */ -#endif + chan->flags = htole32(IWM_SCAN_CHANNEL_UMAC_NSSIDS(n_ssids)); chan++; nchan++; } @@ -355,13 +353,11 @@ iwm_mvm_fill_probe_req(struct iwm_softc struct ieee80211_rateset *rs; size_t remain = sizeof(preq->buf); uint8_t *frm, *pos; - int ssid_len = 0; - const uint8_t *ssid = NULL; memset(preq, 0, sizeof(*preq)); /* Ensure enough space for header and SSID IE. */ - if (remain < sizeof(*wh) + 2 + ssid_len) + if (remain < sizeof(*wh) + 2) return ENOBUFS; /* @@ -378,7 +374,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *(uint16_t *)&wh->i_seq[0] = 0; /* filled by HW */ frm = (uint8_t *)(wh + 1); - frm = ieee80211_add_ssid(frm, ssid, ssid_len); + frm = ieee80211_add_ssid(frm, NULL, 0); /* Tell the firmware where the MAC header is. */ preq->mac_header.offset = 0; @@ -544,11 +540,11 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) .data = { NULL, }, .flags = IWM_CMD_SYNC, }; + struct ieee80211_scan_state *ss = sc->sc_ic.ic_scan; struct iwm_scan_req_umac *req; struct iwm_scan_req_umac_tail *tail; size_t req_len; - int ssid_len = 0; - const uint8_t *ssid = NULL; + uint8_t i, nssid; int ret; req_len = sizeof(struct iwm_scan_req_umac) + @@ -577,8 +573,9 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req->scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH); req->ooc_priority = htole32(IWM_SCAN_PRIORITY_HIGH); + nssid = MIN(ss->ss_nssid, IWM_PROBE_OPTION_MAX); req->n_channels = iwm_mvm_umac_scan_fill_channels(sc, - (struct iwm_scan_channel_cfg_umac *)req->data, ssid_len != 0); + (struct iwm_scan_channel_cfg_umac *)req->data, nssid); req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL | IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE | @@ -589,15 +586,19 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) sc->sc_capa_n_scan_channels); /* Check if we're doing an active directed scan. */ - if (ssid_len != 0) { - tail->direct_scan[0].id = IEEE80211_ELEMID_SSID; - tail->direct_scan[0].len = ssid_len; - memcpy(tail->direct_scan[0].ssid, ssid, ssid_len); + for (i = 0; i < nssid; i++) { + tail->direct_scan[i].id = IEEE80211_ELEMID_SSID; + tail->direct_scan[i].len = MIN(ss->ss_ssid[i].len, + IEEE80211_NWID_LEN); + memcpy(tail->direct_scan[i].ssid, ss->ss_ssid[i].ssid, + tail->direct_scan[i].len); +
svn commit: r305471 - head/usr.sbin/acpi/acpidump
Author: andrew Date: Tue Sep 6 10:13:49 2016 New Revision: 305471 URL: https://svnweb.freebsd.org/changeset/base/305471 Log: Teach acpidump how to parse ACPI 5.1 tables found on the development ThunderX units in the netperf cluster. Approved by: jkim Obtained from:ABT Systems Ltd MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D7252 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c == --- head/usr.sbin/acpi/acpidump/acpi.c Tue Sep 6 10:08:32 2016 (r305470) +++ head/usr.sbin/acpi/acpidump/acpi.c Tue Sep 6 10:13:49 2016 (r305471) @@ -356,6 +356,23 @@ acpi_print_mps_flags(uint16_t flags) } static void +acpi_print_gicc_flags(uint32_t flags) +{ + + printf("\tFlags={Performance intr="); + if (flags & ACPI_MADT_PERFORMANCE_IRQ_MODE) + printf("edge"); + else + printf("level"); + printf(", VGIC intr="); + if (flags & ACPI_MADT_VGIC_IRQ_MODE) + printf("edge"); + else + printf("level"); + printf("}\n"); +} + +static void acpi_print_intr(uint32_t intr, uint16_t mps_flags) { @@ -375,7 +392,12 @@ static const char *apic_types[] = { "Loc "NMI", "Local APIC NMI", "Local APIC Override", "IO SAPIC", "Local SAPIC", "Platform Interrupt", - "Local X2APIC", "Local X2APIC NMI" }; + "Local X2APIC", "Local X2APIC NMI", + "GIC CPU Interface Structure", + "GIC Distributor Structure", + "GICv2m MSI Frame", + "GIC Redistributor Structure", + "GIC ITS Structure" }; static const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT", "Corrected Platform Error" }; @@ -393,6 +415,10 @@ acpi_print_madt(ACPI_SUBTABLE_HEADER *mp ACPI_MADT_INTERRUPT_SOURCE *isrc; ACPI_MADT_LOCAL_X2APIC *x2apic; ACPI_MADT_LOCAL_X2APIC_NMI *x2apic_nmi; + ACPI_MADT_GENERIC_INTERRUPT *gicc; + ACPI_MADT_GENERIC_DISTRIBUTOR *gicd; + ACPI_MADT_GENERIC_REDISTRIBUTOR *gicr; + ACPI_MADT_GENERIC_TRANSLATOR *gict; if (mp->Type < sizeof(apic_types) / sizeof(apic_types[0])) printf("\tType=%s\n", apic_types[mp->Type]); @@ -464,6 +490,41 @@ acpi_print_madt(ACPI_SUBTABLE_HEADER *mp acpi_print_cpu_uid(x2apic_nmi->Uid, NULL); acpi_print_local_nmi(x2apic_nmi->Lint, x2apic_nmi->IntiFlags); break; + case ACPI_MADT_TYPE_GENERIC_INTERRUPT: + gicc = (ACPI_MADT_GENERIC_INTERRUPT *)mp; + acpi_print_cpu_uid(gicc->Uid, NULL); + printf("\tCPU INTERFACE=%x\n", gicc->CpuInterfaceNumber); + acpi_print_gicc_flags(gicc->Flags); + printf("\tParking Protocol Version=%x\n", gicc->ParkingVersion); + printf("\tPERF INTR=%d\n", gicc->PerformanceInterrupt); + printf("\tParked ADDR=%016jx\n", + (uintmax_t)gicc->ParkedAddress); + printf("\tBase ADDR=%016jx\n", (uintmax_t)gicc->BaseAddress); + printf("\tGICV=%016jx\n", (uintmax_t)gicc->GicvBaseAddress); + printf("\tGICH=%016jx\n", (uintmax_t)gicc->GichBaseAddress); + printf("\tVGIC INTR=%d\n", gicc->VgicInterrupt); + printf("\tGICR ADDR=%016jx\n", + (uintmax_t)gicc->GicrBaseAddress); + printf("\tMPIDR=%jx\n", (uintmax_t)gicc->ArmMpidr); + printf("\tEfficency Class=%d\n", (u_int)gicc->EfficiencyClass); + break; + case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: + gicd = (ACPI_MADT_GENERIC_DISTRIBUTOR *)mp; + printf("\tGIC ID=%d\n", (u_int)gicd->GicId); + printf("\tBase ADDR=%016jx\n", (uintmax_t)gicd->BaseAddress); + printf("\tVector Base=%d\n", gicd->GlobalIrqBase); + printf("\tGIC VERSION=%d\n", (u_int)gicd->Version); + break; + case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: + gicr = (ACPI_MADT_GENERIC_REDISTRIBUTOR *)mp; + printf("\tBase ADDR=%016jx\n", (uintmax_t)gicr->BaseAddress); + printf("\tLength=%08x\n", gicr->Length); + break; + case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: + gict = (ACPI_MADT_GENERIC_TRANSLATOR *)mp; + printf("\tGIC ITS ID=%d\n", gict->TranslationId); + printf("\tBase ADDR=%016jx\n", (uintmax_t)gict->BaseAddress); + break; } } @@
Re: svn commit: r305468 - in head: contrib/netbsd-tests/kernel/kqueue tests/sys/kqueue
On 6 Sep 2016, at 8:50, Ngie Cooper wrote: Author: ngie Date: Tue Sep 6 08:50:21 2016 New Revision: 305468 URL: https://svnweb.freebsd.org/changeset/base/305468 Log: Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/... proc2_test must be skipped because the invariant tested (`ke.fflags & NOTE_TRACKERR`) doesn't pass. MFC after:58 days Submitted by: kib (earlier form) Sponsored by: EMC / Isilon Storage Division Differential Revision:https://reviews.freebsd.org/D6172 Breaks build on 32bit platforms due to incorrect format strings in various places. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305472 - head/sys/dev/rtwn
Author: avos Date: Tue Sep 6 11:08:32 2016 New Revision: 305472 URL: https://svnweb.freebsd.org/changeset/base/305472 Log: rtwn: fix firmware readiness check in rtwn_load_firmware(). Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c == --- head/sys/dev/rtwn/if_rtwn.c Tue Sep 6 10:13:49 2016(r305471) +++ head/sys/dev/rtwn/if_rtwn.c Tue Sep 6 11:08:32 2016(r305472) @@ -2204,7 +2204,7 @@ rtwn_load_firmware(struct rtwn_softc *sc break; DELAY(50); } - if (ntries == 1000) { + if (ntries == 2000) { device_printf(sc->sc_dev, "timeout waiting for firmware readiness\n"); error = ETIMEDOUT; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305473 - head/sys/dev/usb/wlan
Author: avos Date: Tue Sep 6 12:00:16 2016 New Revision: 305473 URL: https://svnweb.freebsd.org/changeset/base/305473 Log: rum: use m_get2() in Rx path. Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c == --- head/sys/dev/usb/wlan/if_rum.c Tue Sep 6 11:08:32 2016 (r305472) +++ head/sys/dev/usb/wlan/if_rum.c Tue Sep 6 12:00:16 2016 (r305473) @@ -1205,7 +1205,7 @@ rum_bulk_read_callback(struct usb_xfer * goto tr_setup; } - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF("could not allocate mbuf\n"); counter_u64_add(ic->ic_ierrors, 1); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305474 - in head/sys/dev/bhnd: . bhndb
Author: emaste Date: Tue Sep 6 13:34:10 2016 New Revision: 305474 URL: https://svnweb.freebsd.org/changeset/base/305474 Log: bhnd: remove redundant ;s at the end of functions or switch statements Modified: head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhnd_subr.c == --- head/sys/dev/bhnd/bhnd_subr.c Tue Sep 6 12:00:16 2016 (r305473) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Sep 6 13:34:10 2016 (r305474) @@ -833,7 +833,7 @@ bhnd_alloc_resources(device_t dev, struc } return (0); -}; +} /** * Release bhnd(4) resources defined in @p rs from a parent bus. @@ -1657,7 +1657,7 @@ bhnd_bus_generic_activate_resource(devic } return (error); -}; +} /** * Helper function for implementing BHND_BUS_DEACTIVATE_RESOURCE(). @@ -1674,5 +1674,5 @@ bhnd_bus_generic_deactivate_resource(dev child, type, rid, r)); return (EINVAL); -}; +} Modified: head/sys/dev/bhnd/bhndb/bhndb.c == --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Sep 6 12:00:16 2016 (r305473) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Sep 6 13:34:10 2016 (r305474) @@ -1101,7 +1101,7 @@ bhndb_get_rman(struct bhndb_softc *sc, d return (NULL); default: return (NULL); - }; + } case BHNDB_ADDRSPACE_BRIDGED: switch (type) { @@ -,7 +,7 @@ bhndb_get_rman(struct bhndb_softc *sc, d return (NULL); default: return (NULL); - }; + } } /* Quieten gcc */ @@ -1830,7 +1830,7 @@ bhndb_activate_bhnd_resource(device_t de } return (error); -}; +} /** * Default bhndb(4) implementation of BHND_BUS_DEACTIVATE_RESOURCE(). @@ -1854,7 +1854,7 @@ bhndb_deactivate_bhnd_resource(device_t r->direct = false; return (error); -}; +} /** * Slow path for bhndb_io_resource(). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305475 - in vendor-sys/alpine-hal: 2.7a 2.7a/eth dist dist/eth
Author: wma Date: Tue Sep 6 14:26:41 2016 New Revision: 305475 URL: https://svnweb.freebsd.org/changeset/base/305475 Log: Update Annapurna Alpine HAL to a newer version. HAL version: 2.7a Added: vendor-sys/alpine-hal/2.7a/ vendor-sys/alpine-hal/2.7a/al_hal_common.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_iofic_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_nb_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pbs_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_axi_reg.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_interrupts.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_pcie_w_reg.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_plat_services.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_plat_types.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_reg_utils.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_25g_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_hssp_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_interface.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_serdes_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_types.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_config.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_config.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_debug.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_debug.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_iofic_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_main.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_gen.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_m2s.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_udma_regs_s2m.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_hal_unit_adapter_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/al_serdes.c (contents, props changed) vendor-sys/alpine-hal/2.7a/al_serdes.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/ vendor-sys/alpine-hal/2.7a/eth/al_hal_an_lt_wrapper_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_alu.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_ec_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_kr.c (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_kr.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_mac_regs.h (contents, props changed) vendor-sys/alpine-hal/2.7a/eth/al_hal_eth_main.c (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g.c (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_25g_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp_internal_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_hssp_regs.h (contents, props changed) vendor-sys/alpine-hal/dist/al_hal_serdes_interface.h (contents, props changed) ven
svn commit: r305476 - in stable/11: crypto/openssh secure/usr.sbin/sshd
Author: lidl Date: Tue Sep 6 14:52:14 2016 New Revision: 305476 URL: https://svnweb.freebsd.org/changeset/base/305476 Log: MFC r305065: Add refactored blacklist support to sshd Change the calls to of blacklist_init() and blacklist_notify to be macros defined in the blacklist_client.h file. This avoids the need for #ifdef USE_BLACKLIST / #endif except in the blacklist.c file. Remove redundent initialization attempts from within blacklist_notify - everything always goes through blacklistd_init(). Added UseBlacklist option to sshd, which defaults to off. To enable the functionality, use '-o UseBlacklist=yes' on the command line, or uncomment in the sshd_config file. Approved by: des Sponsored by: The FreeBSD Foundation Added: stable/11/crypto/openssh/blacklist.c - copied unchanged from r305065, head/crypto/openssh/blacklist.c stable/11/crypto/openssh/blacklist_client.h - copied unchanged from r305065, head/crypto/openssh/blacklist_client.h Modified: stable/11/crypto/openssh/auth-pam.c stable/11/crypto/openssh/auth.c stable/11/crypto/openssh/auth1.c stable/11/crypto/openssh/auth2.c stable/11/crypto/openssh/packet.c stable/11/crypto/openssh/servconf.c stable/11/crypto/openssh/servconf.h stable/11/crypto/openssh/sshd.c stable/11/crypto/openssh/sshd_config stable/11/crypto/openssh/sshd_config.5 stable/11/secure/usr.sbin/sshd/Makefile stable/11/secure/usr.sbin/sshd/Makefile.depend Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/openssh/auth-pam.c == --- stable/11/crypto/openssh/auth-pam.c Tue Sep 6 14:26:41 2016 (r305475) +++ stable/11/crypto/openssh/auth-pam.c Tue Sep 6 14:52:14 2016 (r305476) @@ -98,6 +98,7 @@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" +#include "blacklist_client.h" extern ServerOptions options; extern Buffer loginmsg; @@ -794,6 +795,7 @@ sshpam_query(void *ctx, char **name, cha free(msg); return (0); } + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, Modified: stable/11/crypto/openssh/auth.c == --- stable/11/crypto/openssh/auth.c Tue Sep 6 14:26:41 2016 (r305475) +++ stable/11/crypto/openssh/auth.c Tue Sep 6 14:52:14 2016 (r305476) @@ -75,6 +75,7 @@ __RCSID("$FreeBSD$"); #include "authfile.h" #include "ssherr.h" #include "compat.h" +#include "blacklist_client.h" /* import */ extern ServerOptions options; @@ -292,8 +293,11 @@ auth_log(Authctxt *authctxt, int authent authmsg = "Postponed"; else if (partial) authmsg = "Partial"; - else + else { authmsg = authenticated ? "Accepted" : "Failed"; + BLACKLIST_NOTIFY(authenticated ? + BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL); + } authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s", authmsg, @@ -640,6 +644,7 @@ getpwnamallow(const char *user) } #endif if (pw == NULL) { + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); logit("Invalid user %.100s from %.100s", user, get_remote_ipaddr()); #ifdef CUSTOM_FAILED_LOGIN Modified: stable/11/crypto/openssh/auth1.c == --- stable/11/crypto/openssh/auth1.cTue Sep 6 14:26:41 2016 (r305475) +++ stable/11/crypto/openssh/auth1.cTue Sep 6 14:52:14 2016 (r305476) @@ -43,6 +43,7 @@ #endif #include "monitor_wrap.h" #include "buffer.h" +#include "blacklist_client.h" /* import */ extern ServerOptions options; @@ -337,6 +338,7 @@ do_authloop(Authctxt *authctxt) char *msg; size_t len; + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); error("Access denied for user %s by PAM account " "configuration", authctxt->user); len = buffer_len(&loginmsg); @@ -404,6 +406,7 @@ do_authentication(Authctxt *authctxt) else { debug("do_authentication: invalid user %s", user); authctxt->pw = fakepw(); + BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL); } /* Configuration may have changed as a result of Match */ Modified: stable/11/crypto/openssh/auth2.c == --- stable/11/crypto/openssh/auth2.cTue Sep 6 14:26:41 2016 (r305475) +++ stable/11/cr
svn commit: r305477 - in head/sys/contrib/alpine-hal: . eth eth/eth
Author: wma Date: Tue Sep 6 14:59:13 2016 New Revision: 305477 URL: https://svnweb.freebsd.org/changeset/base/305477 Log: Update Annapurna Alpine HAL to a newer version. HAL version: 2.7a Import from vendor-sys, r305475 Added: head/sys/contrib/alpine-hal/al_hal_serdes_25g.c (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_25g.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_25g_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_25g_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_hssp.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_hssp_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_hssp_regs.h (contents, props changed) head/sys/contrib/alpine-hal/al_hal_serdes_interface.h (contents, props changed) head/sys/contrib/alpine-hal/al_serdes.c (contents, props changed) head/sys/contrib/alpine-hal/al_serdes.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_common.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_iofic.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_iofic.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_iofic_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_nb_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pbs_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie_axi_reg.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie_interrupts.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_pcie_w_reg.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_plat_services.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_plat_types.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_reg_utils.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_25g.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_25g.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_25g_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_25g_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_hssp.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_hssp_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_hssp_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_interface.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_internal_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_serdes_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_types.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_config.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_config.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_debug.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_debug.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_iofic.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_iofic.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_iofic_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_main.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_regs_gen.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_regs_m2s.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_udma_regs_s2m.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_hal_unit_adapter_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/al_serdes.c (contents, props changed) head/sys/contrib/alpine-hal/eth/al_serdes.h (contents, props changed) head/sys/contrib/alpine-hal/eth/eth/ head/sys/contrib/alpine-hal/eth/eth/al_hal_an_lt_wrapper_regs.h (contents, props changed) head/sys/contrib/alpine-hal/eth/eth/al_hal_eth.h (contents, props changed) head/sys/contrib/alpine-hal/eth/eth/al_hal_eth_alu.h (contents, props
svn commit: r305478 - head/sys/dev/pci
Author: wma Date: Tue Sep 6 15:06:08 2016 New Revision: 305478 URL: https://svnweb.freebsd.org/changeset/base/305478 Log: Remove check for 64-bit FDT ranges in pci-host-generic This allows 32-bit platforms to use pci-host-generic. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: wma Differential Revision: https://reviews.freebsd.org/D7560 Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c == --- head/sys/dev/pci/pci_host_generic.c Tue Sep 6 14:59:13 2016 (r305477) +++ head/sys/dev/pci/pci_host_generic.c Tue Sep 6 15:06:08 2016 (r305478) @@ -281,7 +281,7 @@ parse_pci_mem_ranges(struct generic_pcie OF_getencprop(OF_parent(node), "#address-cells", &parent_addr_cells, sizeof(parent_addr_cells)); - if (parent_addr_cells != 2 || pci_addr_cells != 3 || size_cells != 2) { + if (parent_addr_cells > 2 || pci_addr_cells != 3 || size_cells > 2) { device_printf(sc->dev, "Unexpected number of address or size cells in FDT\n"); return (ENXIO); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305479 - head/sys/dev/pci
Author: wma Date: Tue Sep 6 15:11:37 2016 New Revision: 305479 URL: https://svnweb.freebsd.org/changeset/base/305479 Log: Import missing enum declaration in pci_host_generic header file Other files including pci_host_generic.h failed to compile due to missing declaration of enum pci_id_type. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: wma Differential Revision: https://reviews.freebsd.org/D7561 Modified: head/sys/dev/pci/pci_host_generic.h Modified: head/sys/dev/pci/pci_host_generic.h == --- head/sys/dev/pci/pci_host_generic.h Tue Sep 6 15:06:08 2016 (r305478) +++ head/sys/dev/pci/pci_host_generic.h Tue Sep 6 15:11:37 2016 (r305479) @@ -34,6 +34,8 @@ #ifndef __PCI_HOST_GENERIC_H_ #define__PCI_HOST_GENERIC_H_ +#include "pci_if.h" + #defineMAX_RANGES_TUPLES 16 #defineMIN_RANGES_TUPLES 2 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305480 - in head: lib/libstand sys/ufs/ffs sys/ufs/ufs
Author: imp Date: Tue Sep 6 15:17:35 2016 New Revision: 305480 URL: https://svnweb.freebsd.org/changeset/base/305480 Log: Renumber the advertising clause. Modified: head/lib/libstand/ufs.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dir.h Modified: head/lib/libstand/ufs.c == --- head/lib/libstand/ufs.c Tue Sep 6 15:11:37 2016(r305479) +++ head/lib/libstand/ufs.c Tue Sep 6 15:17:35 2016(r305480) @@ -24,7 +24,7 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/ufs/ffs/fs.h == --- head/sys/ufs/ffs/fs.h Tue Sep 6 15:11:37 2016(r305479) +++ head/sys/ufs/ffs/fs.h Tue Sep 6 15:17:35 2016(r305480) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/ufs/ufs/dir.h == --- head/sys/ufs/ufs/dir.h Tue Sep 6 15:11:37 2016(r305479) +++ head/sys/ufs/ufs/dir.h Tue Sep 6 15:17:35 2016(r305480) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305483 - in head/contrib/netbsd-tests/kernel/kqueue: . read
Author: ngie Date: Tue Sep 6 17:22:25 2016 New Revision: 305483 URL: https://svnweb.freebsd.org/changeset/base/305483 Log: Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper format specifier for pointers when printing them out with printf(3) MFC after:57 days Pointyhat to: ngie Reported by: bz, cy, Jenkins (i386 job) Submitted by: cy Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c head/contrib/netbsd-tests/kernel/kqueue/read/t_file.c head/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c head/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Modified: head/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c == --- head/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Tue Sep 6 17:22:25 2016(r305483) @@ -78,7 +78,11 @@ ATF_TC_BODY(fifo, tc) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, " +#ifdef __FreeBSD__ + "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags, +#else "data: %" PRId64 "\n", n, event[0].filter, event[0].flags, +#endif event[0].fflags, event[0].data); ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ); Modified: head/contrib/netbsd-tests/kernel/kqueue/read/t_file.c == --- head/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Tue Sep 6 17:22:25 2016(r305483) @@ -111,7 +111,11 @@ ATF_TC_BODY(file, tc) num += n; (void)printf("kevent num %d flags: %#x, fflags: %#x, data: " +#ifdef __FreeBSD__ + "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags, +#else "%" PRId64 "\n", n, event[0].flags, event[0].fflags, +#endif event[0].data); if (event[0].data < 0) Modified: head/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c == --- head/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Tue Sep 6 17:22:25 2016(r305483) @@ -67,7 +67,11 @@ ATF_TC_BODY(pipe, tc) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d flags: %#x, fflags: %#x, data: " +#ifdef __FreeBSD__ + "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags, event[0].data); +#else "%" PRId64 "\n", n, event[0].flags, event[0].fflags, event[0].data); +#endif RL(n = read(fds[0], buffer, event[0].data)); buffer[n] = '\0'; Modified: head/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c == --- head/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Tue Sep 6 17:22:25 2016(r305483) @@ -103,7 +103,11 @@ h_check(bool check_master) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, " +#ifdef __FreeBSD__ + "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags, +#else "data: %" PRId64 "\n", n, event[0].filter, event[0].flags, +#endif event[0].fflags, event[0].data); ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ); Modified: head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Tue Sep 6 17:22:25 2016(r305483) @@ -139,7 +139,11 @@ ATF_TC_BODY(proc1, tc) printf(" NOTE_FORK"); } if (event[0].fflags & NOTE_CHILD) +#ifdef __FreeBSD__ + printf(" NOTE_CHILD, parent = %" PRIdPTR, event[0].data); +#else printf(" NOTE_CHILD, parent = %" PRId64, event[0].data); +#endif printf("\n"); } Modified: head/contrib/netbsd-tests/kernel/kqueue/t_sig.c == --- head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Tue Sep 6 17:16:59 2016(r305482) +++ head/contrib/netbsd-tests/kernel/kqueue/t_sig.c Tue Sep 6 17:22:25 2
svn commit: r305482 - head/sys/kern
Author: mjg Date: Tue Sep 6 17:16:59 2016 New Revision: 305482 URL: https://svnweb.freebsd.org/changeset/base/305482 Log: cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri In case of some consumers like zfs there are no waiters vast majority of the time Reviewed by: jhb MFC after:1 week Modified: head/sys/kern/kern_condvar.c Modified: head/sys/kern/kern_condvar.c == --- head/sys/kern/kern_condvar.cTue Sep 6 17:08:31 2016 (r305481) +++ head/sys/kern/kern_condvar.cTue Sep 6 17:16:59 2016 (r305482) @@ -397,6 +397,8 @@ cv_signal(struct cv *cvp) { int wakeup_swapper; + if (cvp->cv_waiters == 0) + return; wakeup_swapper = 0; sleepq_lock(cvp); if (cvp->cv_waiters > 0) { @@ -424,6 +426,8 @@ cv_broadcastpri(struct cv *cvp, int pri) { int wakeup_swapper; + if (cvp->cv_waiters == 0) + return; /* * XXX sleepq_broadcast pri argument changed from -1 meaning * no pri to 0 meaning no pri. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305484 - head/sys/boot/efi/loader
Author: will Date: Tue Sep 6 17:58:58 2016 New Revision: 305484 URL: https://svnweb.freebsd.org/changeset/base/305484 Log: loader.efi: Bump the staging size to 64M. This is required on my system, which loads nvidia, vmm, and zfs, and 48M is no longer enough for that. nvidia-driver's recent update increased its size by several megabytes. Reviewed by: jhb MFC after:1 week Modified: head/sys/boot/efi/loader/copy.c Modified: head/sys/boot/efi/loader/copy.c == --- head/sys/boot/efi/loader/copy.c Tue Sep 6 17:22:25 2016 (r305483) +++ head/sys/boot/efi/loader/copy.c Tue Sep 6 17:58:58 2016 (r305484) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" #ifndef EFI_STAGING_SIZE -#defineEFI_STAGING_SIZE48 +#defineEFI_STAGING_SIZE64 #endif #defineSTAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305485 - head/sys/amd64/vmm/io
Author: jhb Date: Tue Sep 6 18:53:17 2016 New Revision: 305485 URL: https://svnweb.freebsd.org/changeset/base/305485 Log: Leave ppt devices in the host domain when they are not attached to a VM. This allows a pass through device to be reset to a normal device driver on the host and reused on the host. ppt devices are now always active in some I/O MMU domain when the I/O MMU is active, either the host domain or the domain of a VM they are attached to. Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D7666 Modified: head/sys/amd64/vmm/io/iommu.c head/sys/amd64/vmm/io/ppt.c Modified: head/sys/amd64/vmm/io/iommu.c == --- head/sys/amd64/vmm/io/iommu.c Tue Sep 6 17:58:58 2016 (r305484) +++ head/sys/amd64/vmm/io/iommu.c Tue Sep 6 18:53:17 2016 (r305485) @@ -158,7 +158,6 @@ iommu_init(void) { int error, bus, slot, func; vm_paddr_t maxaddr; - const char *name; device_t dev; if (!iommu_enable) @@ -203,12 +202,7 @@ iommu_init(void) if (dev == NULL) continue; - /* skip passthrough devices */ - name = device_get_name(dev); - if (name != NULL && strcmp(name, "ppt") == 0) - continue; - - /* everything else belongs to the host domain */ + /* Everything belongs to the host domain. */ iommu_add_device(host_domain, pci_get_rid(dev)); } Modified: head/sys/amd64/vmm/io/ppt.c == --- head/sys/amd64/vmm/io/ppt.c Tue Sep 6 17:58:58 2016(r305484) +++ head/sys/amd64/vmm/io/ppt.c Tue Sep 6 18:53:17 2016(r305485) @@ -363,6 +363,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; + iommu_remove_device(iommu_host_domain(), pci_get_rid(ppt->dev)); iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); return (0); } @@ -385,6 +386,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + iommu_add_device(iommu_host_domain(), pci_get_rid(ppt->dev)); ppt->vm = NULL; return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305486 - head/usr.bin/bsdiff/bspatch
Author: emaste Date: Tue Sep 6 19:00:37 2016 New Revision: 305486 URL: https://svnweb.freebsd.org/changeset/base/305486 Log: bspatch: add sanity checks on sizes to avoid integer overflow Note that this introduces an explicit 2GB limit, but this was already implicit in variable and function argument types. This is based on the "non-cryptanalytic attacks against freebsd update components" anonymous gist. Further refinement is planned. Reviewed by: allanjude, cem, kib Obtained from:anonymous gist MFC after:3 days Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D7619 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c == --- head/usr.bin/bsdiff/bspatch/bspatch.c Tue Sep 6 18:53:17 2016 (r305485) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Tue Sep 6 19:00:37 2016 (r305486) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -98,8 +99,8 @@ int main(int argc, char *argv[]) char *directory, *namebuf; int cbz2err, dbz2err, ebz2err; int newfd, oldfd; - ssize_t oldsize, newsize; - ssize_t bzctrllen, bzdatalen; + off_t oldsize, newsize; + off_t bzctrllen, bzdatalen; u_char header[32], buf[8]; u_char *old, *new; off_t oldpos, newpos; @@ -194,7 +195,9 @@ int main(int argc, char *argv[]) bzctrllen = offtin(header + 8); bzdatalen = offtin(header + 16); newsize = offtin(header + 24); - if ((bzctrllen < 0) || (bzdatalen < 0) || (newsize < 0)) + if (bzctrllen < 0 || bzctrllen > OFF_MAX - 32 || + bzdatalen < 0 || bzctrllen + 32 > OFF_MAX - bzdatalen || + newsize < 0 || newsize > SSIZE_MAX) errx(1, "Corrupt patch\n"); /* Close patch file and re-open it via libbzip2 at the right places */ @@ -217,12 +220,13 @@ int main(int argc, char *argv[]) errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); if ((oldsize = lseek(oldfd, 0, SEEK_END)) == -1 || - (old = malloc(oldsize+1)) == NULL || + oldsize > SSIZE_MAX || + (old = malloc(oldsize)) == NULL || lseek(oldfd, 0, SEEK_SET) != 0 || read(oldfd, old, oldsize) != oldsize || close(oldfd) == -1) err(1, "%s", argv[1]); - if ((new = malloc(newsize + 1)) == NULL) + if ((new = malloc(newsize)) == NULL) err(1, NULL); oldpos = 0; @@ -238,7 +242,8 @@ int main(int argc, char *argv[]) } /* Sanity-check */ - if ((ctrl[0] < 0) || (ctrl[1] < 0)) + if (ctrl[0] < 0 || ctrl[0] > INT_MAX || + ctrl[1] < 0 || ctrl[1] > INT_MAX) errx(1, "Corrupt patch\n"); /* Sanity-check */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305487 - stable/11/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 19:15:44 2016 New Revision: 305487 URL: https://svnweb.freebsd.org/changeset/base/305487 Log: MFC r394247 Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC r394248 Add ql_minidump.h Added: stable/11/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304248, head/sys/dev/qlxgbe/ql_minidump.h Modified: stable/11/sys/dev/qlxgbe/ql_boot.c stable/11/sys/dev/qlxgbe/ql_def.h stable/11/sys/dev/qlxgbe/ql_fw.c stable/11/sys/dev/qlxgbe/ql_glbl.h stable/11/sys/dev/qlxgbe/ql_hw.c stable/11/sys/dev/qlxgbe/ql_hw.h stable/11/sys/dev/qlxgbe/ql_ioctl.c stable/11/sys/dev/qlxgbe/ql_ioctl.h stable/11/sys/dev/qlxgbe/ql_isr.c stable/11/sys/dev/qlxgbe/ql_minidump.c stable/11/sys/dev/qlxgbe/ql_os.c stable/11/sys/dev/qlxgbe/ql_reset.c stable/11/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_boot.c == --- stable/11/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 19:00:37 2016 (r305486) +++ stable/11/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 19:15:44 2016 (r305487) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1589,7 +1589,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00
svn commit: r305488 - stable/11/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 19:18:50 2016 New Revision: 305488 URL: https://svnweb.freebsd.org/changeset/base/305488 Log: MFC 304249 Add support for set/get cam search mode Modified: stable/11/sys/dev/qlxgbe/ql_dbg.h stable/11/sys/dev/qlxgbe/ql_hw.c stable/11/sys/dev/qlxgbe/ql_hw.h stable/11/sys/dev/qlxgbe/ql_isr.c stable/11/sys/dev/qlxgbe/ql_os.c stable/11/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlxgbe/ql_dbg.h == --- stable/11/sys/dev/qlxgbe/ql_dbg.h Tue Sep 6 19:15:44 2016 (r305487) +++ stable/11/sys/dev/qlxgbe/ql_dbg.h Tue Sep 6 19:18:50 2016 (r305488) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x8 #define INJCT_HEARTBEAT_FAILURE0x9 #define INJCT_TEMPERATURE_FAILURE 0xA +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB #ifdef QL_DBG Modified: stable/11/sys/dev/qlxgbe/ql_hw.c == --- stable/11/sys/dev/qlxgbe/ql_hw.cTue Sep 6 19:15:44 2016 (r305487) +++ stable/11/sys/dev/qlxgbe/ql_hw.cTue Sep 6 19:18:50 2016 (r305488) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -407,7 +479,8 @@
svn commit: r305489 - in head/sys: amd64/amd64 amd64/conf conf x86/x86
Author: jhb Date: Tue Sep 6 19:25:32 2016 New Revision: 305489 URL: https://svnweb.freebsd.org/changeset/base/305489 Log: Remove remnants of PERFMON and I586_PMC_GUPROF from amd64. These options were never fully ported over from i386. Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/prof_machdep.c head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Tue Sep 6 19:18:50 2016 (r305488) +++ head/sys/amd64/amd64/machdep.c Tue Sep 6 19:25:32 2016 (r305489) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include "opt_maxmem.h" #include "opt_mp_watchdog.h" -#include "opt_perfmon.h" #include "opt_platform.h" #include "opt_sched.h" @@ -125,9 +124,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef PERFMON -#include -#endif #include #ifdef SMP #include @@ -274,9 +270,6 @@ cpu_startup(dummy) startrtclock(); printcpuinfo(); panicifcpuunsupported(); -#ifdef PERFMON - perfmon_init(); -#endif /* * Display physical memory if SMBIOS reports reasonable amount. Modified: head/sys/amd64/amd64/prof_machdep.c == --- head/sys/amd64/amd64/prof_machdep.c Tue Sep 6 19:18:50 2016 (r305488) +++ head/sys/amd64/amd64/prof_machdep.c Tue Sep 6 19:25:32 2016 (r305489) @@ -28,10 +28,6 @@ __FBSDID("$FreeBSD$"); #ifdef GUPROF -#if 0 -#include "opt_i586_guprof.h" -#include "opt_perfmon.h" -#endif #include #include @@ -44,25 +40,16 @@ __FBSDID("$FreeBSD$"); #include #include -#if 0 -#include -#endif #include #defineCPUTIME_CLOCK_UNINITIALIZED 0 #defineCPUTIME_CLOCK_I8254 1 #defineCPUTIME_CLOCK_TSC 2 -#defineCPUTIME_CLOCK_I586_PMC 3 #defineCPUTIME_CLOCK_I8254_SHIFT 7 intcputime_bias = 1; /* initialize for locality of reference */ static int cputime_clock = CPUTIME_CLOCK_UNINITIALIZED; -#if defined(PERFMON) && defined(I586_PMC_GUPROF) -static u_int cputime_clock_pmc_conf = I586_PMC_GUPROF; -static int cputime_clock_pmc_init; -static struct gmonparam saved_gmp; -#endif static int cputime_prof_active; #endif /* GUPROF */ @@ -198,9 +185,6 @@ cputime() { u_int count; int delta; -#if defined(PERFMON) && defined(I586_PMC_GUPROF) && !defined(SMP) - u_quad_t event_count; -#endif u_char high, low; static u_int prev_count; @@ -217,21 +201,6 @@ cputime() prev_count = count; return (delta); } -#if defined(PERFMON) && defined(I586_PMC_GUPROF) && !defined(SMP) - if (cputime_clock == CPUTIME_CLOCK_I586_PMC) { - /* -* XXX permon_read() should be inlined so that the -* perfmon module doesn't need to be compiled with -* profiling disabled and so that it is fast. -*/ - perfmon_read(0, &event_count); - - count = (u_int)event_count; - delta = (int)(count - prev_count); - prev_count = count; - return (delta); - } -#endif /* PERFMON && I586_PMC_GUPROF && !SMP */ /* * Read the current value of the 8254 timer counter 0. @@ -262,39 +231,13 @@ sysctl_machdep_cputime_clock(SYSCTL_HAND { int clock; int error; -#if defined(PERFMON) && defined(I586_PMC_GUPROF) - int event; - struct pmc pmc; -#endif clock = cputime_clock; -#if defined(PERFMON) && defined(I586_PMC_GUPROF) - if (clock == CPUTIME_CLOCK_I586_PMC) { - pmc.pmc_val = cputime_clock_pmc_conf; - clock += pmc.pmc_event; - } -#endif error = sysctl_handle_opaque(oidp, &clock, sizeof clock, req); if (error == 0 && req->newptr != NULL) { -#if defined(PERFMON) && defined(I586_PMC_GUPROF) - if (clock >= CPUTIME_CLOCK_I586_PMC) { - event = clock - CPUTIME_CLOCK_I586_PMC; - if (event >= 256) - return (EINVAL); - pmc.pmc_num = 0; - pmc.pmc_event = event; - pmc.pmc_unit = 0; - pmc.pmc_flags = PMCF_E | PMCF_OS | PMCF_USR; - pmc.pmc_mask = 0; - cputime_clock_pmc_conf = pmc.pmc_val; - cputime_clock = CPUTIME_CLOCK_I586_PMC; - } else -#endif - { - if (clock < 0 || clock >= CPUTIME_CLOCK_I586_PMC) - return (EINVAL); - cputime_clock = clock; - } +
svn commit: r305490 - stable/10/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 19:27:00 2016 New Revision: 305490 URL: https://svnweb.freebsd.org/changeset/base/305490 Log: MFC r394247 Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC r394248 Add ql_minidump.h Added: stable/10/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304248, head/sys/dev/qlxgbe/ql_minidump.h Modified: stable/10/sys/dev/qlxgbe/ql_boot.c stable/10/sys/dev/qlxgbe/ql_def.h stable/10/sys/dev/qlxgbe/ql_fw.c stable/10/sys/dev/qlxgbe/ql_glbl.h stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_hw.h stable/10/sys/dev/qlxgbe/ql_ioctl.c stable/10/sys/dev/qlxgbe/ql_ioctl.h stable/10/sys/dev/qlxgbe/ql_isr.c stable/10/sys/dev/qlxgbe/ql_minidump.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/qlxgbe/ql_reset.c stable/10/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_boot.c == --- stable/10/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 19:25:32 2016 (r305489) +++ stable/10/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 19:27:00 2016 (r305490) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1589,7 +1589,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00
svn commit: r305491 - stable/10/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 19:29:14 2016 New Revision: 305491 URL: https://svnweb.freebsd.org/changeset/base/305491 Log: MFC 304249 Add support for set/get cam search mode Modified: stable/10/sys/dev/qlxgbe/ql_dbg.h stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_hw.h stable/10/sys/dev/qlxgbe/ql_isr.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_dbg.h == --- stable/10/sys/dev/qlxgbe/ql_dbg.h Tue Sep 6 19:27:00 2016 (r305490) +++ stable/10/sys/dev/qlxgbe/ql_dbg.h Tue Sep 6 19:29:14 2016 (r305491) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x8 #define INJCT_HEARTBEAT_FAILURE0x9 #define INJCT_TEMPERATURE_FAILURE 0xA +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB #ifdef QL_DBG Modified: stable/10/sys/dev/qlxgbe/ql_hw.c == --- stable/10/sys/dev/qlxgbe/ql_hw.cTue Sep 6 19:27:00 2016 (r305490) +++ stable/10/sys/dev/qlxgbe/ql_hw.cTue Sep 6 19:29:14 2016 (r305491) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -407,7 +479,8 @
svn commit: r305492 - head/sys/arm/ti
Author: gonzo Date: Tue Sep 6 19:36:28 2016 New Revision: 305492 URL: https://svnweb.freebsd.org/changeset/base/305492 Log: Let knlist_add do the locking part Remove explicit mtx_lock/mtx_unlock around knlist_add and pass 0 as locked parameter so knlist_add does the locking itself Suggested by: kib@ Modified: head/sys/arm/ti/ti_pruss.c Modified: head/sys/arm/ti/ti_pruss.c == --- head/sys/arm/ti/ti_pruss.c Tue Sep 6 19:29:14 2016(r305491) +++ head/sys/arm/ti/ti_pruss.c Tue Sep 6 19:36:28 2016(r305492) @@ -310,9 +310,7 @@ ti_pruss_kqfilter(struct cdev *cdev, str case EVFILT_READ: kn->kn_hook = sc; kn->kn_fop = &ti_pruss_kq_read; - mtx_lock(&sc->sc_mtx); - knlist_add(&sc->sc_selinfo.si_note, kn, 1); - mtx_unlock(&sc->sc_mtx); + knlist_add(&sc->sc_selinfo.si_note, kn, 0); break; default: return (EINVAL); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305493 - stable/11/sys/fs/ext2fs
Author: pfg Date: Tue Sep 6 19:51:24 2016 New Revision: 305493 URL: https://svnweb.freebsd.org/changeset/base/305493 Log: MFC r303799, r303800: ext2fs: Add defines for some missing ext4 features and inode flags. These are currently unused in our implementation and some even appear to have not been implemented yet on linux but it is good to keep them for reference. Obtained from:NetBSD Modified: stable/11/sys/fs/ext2fs/ext2_dinode.h stable/11/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_dinode.h == --- stable/11/sys/fs/ext2fs/ext2_dinode.h Tue Sep 6 19:36:28 2016 (r305492) +++ stable/11/sys/fs/ext2fs/ext2_dinode.h Tue Sep 6 19:51:24 2016 (r305493) @@ -71,7 +71,10 @@ #defineEXT4_TOPDIR 0x0002 /* Top of directory hierarchies*/ #defineEXT4_HUGE_FILE 0x0004 /* Set to each huge file */ #defineEXT4_EXTENTS0x0008 /* Inode uses extents */ +#defineEXT4_EA_INODE 0x0020 /* Inode used for large EA */ #defineEXT4_EOFBLOCKS 0x0040 /* Blocks allocated beyond EOF */ +#defineEXT4_INLINE_DATA0x1000 /* Inode has inline data */ +#defineEXT4_PROJINHERIT0x2000 /* Children inherit project ID */ /* * Definitions for nanosecond timestamps. Modified: stable/11/sys/fs/ext2fs/ext2fs.h == --- stable/11/sys/fs/ext2fs/ext2fs.hTue Sep 6 19:36:28 2016 (r305492) +++ stable/11/sys/fs/ext2fs/ext2fs.hTue Sep 6 19:51:24 2016 (r305493) @@ -206,6 +206,7 @@ struct csum { #defineEXT2F_COMPAT_HASJOURNAL 0x0004 #defineEXT2F_COMPAT_RESIZE 0x0010 #defineEXT2F_COMPAT_DIRHASHINDEX 0x0020 +#defineEXT2F_COMPAT_SPARSESUPER2 0x0200 #defineEXT2F_ROCOMPAT_SPARSESUPER 0x0001 #defineEXT2F_ROCOMPAT_LARGEFILE0x0002 @@ -214,6 +215,11 @@ struct csum { #defineEXT2F_ROCOMPAT_GDT_CSUM 0x0010 #defineEXT2F_ROCOMPAT_DIR_NLINK0x0020 #defineEXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 +#defineEXT2F_ROCOMPAT_QUOTA0x0100 +#defineEXT2F_ROCOMPAT_BIGALLOC 0x0200 +#defineEXT2F_ROCOMPAT_METADATA_CKSUM 0x0400 +#defineEXT2F_ROCOMPAT_READONLY 0x1000 +#defineEXT2F_ROCOMPAT_PROJECT 0x2000 #defineEXT2F_INCOMPAT_COMP 0x0001 #defineEXT2F_INCOMPAT_FTYPE0x0002 @@ -223,6 +229,12 @@ struct csum { #defineEXT2F_INCOMPAT_64BIT0x0080 #defineEXT2F_INCOMPAT_MMP 0x0100 #defineEXT2F_INCOMPAT_FLEX_BG 0x0200 +#defineEXT2F_INCOMPAT_EA_INODE 0x0400 +#defineEXT2F_INCOMPAT_DIRDATA 0x1000 +#defineEXT2F_INCOMPAT_CSUM_SEED0x2000 +#defineEXT2F_INCOMPAT_LARGEDIR 0x4000 +#defineEXT2F_INCOMPAT_INLINE_DATA 0x8000 +#defineEXT2F_INCOMPAT_ENCRYPT 0x1 /* * Features supported in this implementation ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305494 - stable/10/sys/fs/ext2fs
Author: pfg Date: Tue Sep 6 19:53:05 2016 New Revision: 305494 URL: https://svnweb.freebsd.org/changeset/base/305494 Log: MFC r303799, r303800: ext2fs: Add defines for some missing ext4 features and inode flags. These are currently unused in our implementation and some even appear to have not been implemented yet on linux but it is good to keep them for reference. Obtained from:NetBSD Modified: stable/10/sys/fs/ext2fs/ext2_dinode.h stable/10/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_dinode.h == --- stable/10/sys/fs/ext2fs/ext2_dinode.h Tue Sep 6 19:51:24 2016 (r305493) +++ stable/10/sys/fs/ext2fs/ext2_dinode.h Tue Sep 6 19:53:05 2016 (r305494) @@ -71,7 +71,10 @@ #defineEXT4_TOPDIR 0x0002 /* Top of directory hierarchies*/ #defineEXT4_HUGE_FILE 0x0004 /* Set to each huge file */ #defineEXT4_EXTENTS0x0008 /* Inode uses extents */ +#defineEXT4_EA_INODE 0x0020 /* Inode used for large EA */ #defineEXT4_EOFBLOCKS 0x0040 /* Blocks allocated beyond EOF */ +#defineEXT4_INLINE_DATA0x1000 /* Inode has inline data */ +#defineEXT4_PROJINHERIT0x2000 /* Children inherit project ID */ /* * Definitions for nanosecond timestamps. Modified: stable/10/sys/fs/ext2fs/ext2fs.h == --- stable/10/sys/fs/ext2fs/ext2fs.hTue Sep 6 19:51:24 2016 (r305493) +++ stable/10/sys/fs/ext2fs/ext2fs.hTue Sep 6 19:53:05 2016 (r305494) @@ -206,6 +206,7 @@ struct csum { #defineEXT2F_COMPAT_HASJOURNAL 0x0004 #defineEXT2F_COMPAT_RESIZE 0x0010 #defineEXT2F_COMPAT_DIRHASHINDEX 0x0020 +#defineEXT2F_COMPAT_SPARSESUPER2 0x0200 #defineEXT2F_ROCOMPAT_SPARSESUPER 0x0001 #defineEXT2F_ROCOMPAT_LARGEFILE0x0002 @@ -214,6 +215,11 @@ struct csum { #defineEXT2F_ROCOMPAT_GDT_CSUM 0x0010 #defineEXT2F_ROCOMPAT_DIR_NLINK0x0020 #defineEXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 +#defineEXT2F_ROCOMPAT_QUOTA0x0100 +#defineEXT2F_ROCOMPAT_BIGALLOC 0x0200 +#defineEXT2F_ROCOMPAT_METADATA_CKSUM 0x0400 +#defineEXT2F_ROCOMPAT_READONLY 0x1000 +#defineEXT2F_ROCOMPAT_PROJECT 0x2000 #defineEXT2F_INCOMPAT_COMP 0x0001 #defineEXT2F_INCOMPAT_FTYPE0x0002 @@ -223,6 +229,12 @@ struct csum { #defineEXT2F_INCOMPAT_64BIT0x0080 #defineEXT2F_INCOMPAT_MMP 0x0100 #defineEXT2F_INCOMPAT_FLEX_BG 0x0200 +#defineEXT2F_INCOMPAT_EA_INODE 0x0400 +#defineEXT2F_INCOMPAT_DIRDATA 0x1000 +#defineEXT2F_INCOMPAT_CSUM_SEED0x2000 +#defineEXT2F_INCOMPAT_LARGEDIR 0x4000 +#defineEXT2F_INCOMPAT_INLINE_DATA 0x8000 +#defineEXT2F_INCOMPAT_ENCRYPT 0x1 /* * Features supported in this implementation ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305495 - stable/9/sys/fs/ext2fs
Author: pfg Date: Tue Sep 6 19:54:52 2016 New Revision: 305495 URL: https://svnweb.freebsd.org/changeset/base/305495 Log: MFC r303799, r303800: ext2fs: Add defines for some missing ext4 features and inode flags. These are currently unused in our implementation and some even appear to have not been implemented yet on linux but it is good to keep them for reference. Obtained from:NetBSD Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h stable/9/sys/fs/ext2fs/ext2fs.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_dinode.h == --- stable/9/sys/fs/ext2fs/ext2_dinode.hTue Sep 6 19:53:05 2016 (r305494) +++ stable/9/sys/fs/ext2fs/ext2_dinode.hTue Sep 6 19:54:52 2016 (r305495) @@ -71,7 +71,10 @@ #defineEXT4_TOPDIR 0x0002 /* Top of directory hierarchies*/ #defineEXT4_HUGE_FILE 0x0004 /* Set to each huge file */ #defineEXT4_EXTENTS0x0008 /* Inode uses extents */ +#defineEXT4_EA_INODE 0x0020 /* Inode used for large EA */ #defineEXT4_EOFBLOCKS 0x0040 /* Blocks allocated beyond EOF */ +#defineEXT4_INLINE_DATA0x1000 /* Inode has inline data */ +#defineEXT4_PROJINHERIT0x2000 /* Children inherit project ID */ /* * Definitions for nanosecond timestamps. Modified: stable/9/sys/fs/ext2fs/ext2fs.h == --- stable/9/sys/fs/ext2fs/ext2fs.h Tue Sep 6 19:53:05 2016 (r305494) +++ stable/9/sys/fs/ext2fs/ext2fs.h Tue Sep 6 19:54:52 2016 (r305495) @@ -205,6 +205,7 @@ struct csum { #defineEXT2F_COMPAT_HASJOURNAL 0x0004 #defineEXT2F_COMPAT_RESIZE 0x0010 #defineEXT2F_COMPAT_DIRHASHINDEX 0x0020 +#defineEXT2F_COMPAT_SPARSESUPER2 0x0200 #defineEXT2F_ROCOMPAT_SPARSESUPER 0x0001 #defineEXT2F_ROCOMPAT_LARGEFILE0x0002 @@ -213,6 +214,11 @@ struct csum { #defineEXT2F_ROCOMPAT_GDT_CSUM 0x0010 #defineEXT2F_ROCOMPAT_DIR_NLINK0x0020 #defineEXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 +#defineEXT2F_ROCOMPAT_QUOTA0x0100 +#defineEXT2F_ROCOMPAT_BIGALLOC 0x0200 +#defineEXT2F_ROCOMPAT_METADATA_CKSUM 0x0400 +#defineEXT2F_ROCOMPAT_READONLY 0x1000 +#defineEXT2F_ROCOMPAT_PROJECT 0x2000 #defineEXT2F_INCOMPAT_COMP 0x0001 #defineEXT2F_INCOMPAT_FTYPE0x0002 @@ -222,6 +228,12 @@ struct csum { #defineEXT2F_INCOMPAT_64BIT0x0080 #defineEXT2F_INCOMPAT_MMP 0x0100 #defineEXT2F_INCOMPAT_FLEX_BG 0x0200 +#defineEXT2F_INCOMPAT_EA_INODE 0x0400 +#defineEXT2F_INCOMPAT_DIRDATA 0x1000 +#defineEXT2F_INCOMPAT_CSUM_SEED0x2000 +#defineEXT2F_INCOMPAT_LARGEDIR 0x4000 +#defineEXT2F_INCOMPAT_INLINE_DATA 0x8000 +#defineEXT2F_INCOMPAT_ENCRYPT 0x1 /* * Features supported in this implementation ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305497 - in head: share/man/man9 sys/amd64/vmm/io sys/dev/pci
Author: jhb Date: Tue Sep 6 20:17:54 2016 New Revision: 305497 URL: https://svnweb.freebsd.org/changeset/base/305497 Log: Update the I/O MMU in bhyve when PCI devices are added and removed. When the I/O MMU is active in bhyve, all PCI devices need valid entries in the DMAR context tables. The I/O MMU code does a single enumeration of the available PCI devices during initialization to add all existing devices to a domain representing the host. The ppt(4) driver then moves pass through devices in and out of domains for virtual machines as needed. However, when new PCI devices were added at runtime either via SR-IOV or HotPlug, the I/O MMU tables were not updated. This change adds a new set of EVENTHANDLERS that are invoked when PCI devices are added and deleted. The I/O MMU driver in bhyve installs handlers for these events which it uses to add and remove devices to the "host" domain. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D7667 Modified: head/share/man/man9/pci.9 head/sys/amd64/vmm/io/iommu.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/pci.9 == --- head/share/man/man9/pci.9 Tue Sep 6 20:01:15 2016(r305496) +++ head/share/man/man9/pci.9 Tue Sep 6 20:17:54 2016(r305497) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2016 +.Dd September 6, 2016 .Dt PCI 9 .Os .Sh NAME @@ -149,6 +149,10 @@ .Fn pcie_read_config "device_t dev" "int reg" "int width" .Ft void .Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" +.Ft void +.Fn pci_event_fn "void *arg" "device_t dev" +.Fn EVENTHANDLER_REGISTER "pci_add_device" "pci_event_fn" +.Fn EVENTHANDLER_DEREGISTER "pci_delete_resource" "pci_event_fn" .In dev/pci/pci_iov.h .Ft int .Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema" @@ -910,6 +914,24 @@ with one in the new distribution. The .Fn pci_remap_msix function will fail if this condition is not met. +.Ss Device Events +The +.Va pci_add_device +event handler is invoked every time a new PCI device is added to the system. +This includes the creation of Virtual Functions via SR-IOV. +.Pp +The +.Va pci_delete_device +event handler is invoked every time a PCI device is removed from the system. +.Pp +Both event handlers pass the +.Vt device_t +object of the relevant PCI device as +.Fa dev +to each callback function. +Both event handlers are invoked while +.Fa dev +is unattached but with valid instance variables. .Sh SEE ALSO .Xr pci 4 , .Xr pciconf 8 , @@ -921,6 +943,7 @@ function will fail if this condition is .Xr devclass 9 , .Xr device 9 , .Xr driver 9 , +.Xr eventhandler 9 , .Xr rman 9 .Rs .%B FreeBSD Developers' Handbook Modified: head/sys/amd64/vmm/io/iommu.c == --- head/sys/amd64/vmm/io/iommu.c Tue Sep 6 20:01:15 2016 (r305496) +++ head/sys/amd64/vmm/io/iommu.c Tue Sep 6 20:17:54 2016 (r305497) @@ -58,6 +58,7 @@ SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enab static struct iommu_ops *ops; static void *host_domain; +static eventhandler_tag add_tag, delete_tag; static __inline int IOMMU_INIT(void) @@ -154,6 +155,21 @@ IOMMU_DISABLE(void) } static void +iommu_pci_add(void *arg, device_t dev) +{ + + /* Add new devices to the host domain. */ + iommu_add_device(host_domain, pci_get_rid(dev)); +} + +static void +iommu_pci_delete(void *arg, device_t dev) +{ + + iommu_remove_device(host_domain, pci_get_rid(dev)); +} + +static void iommu_init(void) { int error, bus, slot, func; @@ -195,6 +211,9 @@ iommu_init(void) */ iommu_create_mapping(host_domain, 0, 0, maxaddr); + add_tag = EVENTHANDLER_REGISTER(pci_add_device, iommu_pci_add, NULL, 0); + delete_tag = EVENTHANDLER_REGISTER(pci_delete_device, iommu_pci_delete, + NULL, 0); for (bus = 0; bus <= PCI_BUSMAX; bus++) { for (slot = 0; slot <= PCI_SLOTMAX; slot++) { for (func = 0; func <= PCI_FUNCMAX; func++) { @@ -215,6 +234,15 @@ iommu_init(void) void iommu_cleanup(void) { + + if (add_tag != NULL) { + EVENTHANDLER_DEREGISTER(pci_add_device, add_tag); + add_tag = NULL; + } + if (delete_tag != NULL) { + EVENTHANDLER_DEREGISTER(pci_delete_device, delete_tag); + delete_tag = NULL; + } IOMMU_DISABLE(); IOMMU_DESTROY_DOMAIN(host_domain); IOMMU_CLEANUP(); Modified: head/sys/dev/pci/pci.c == --- head/sys/dev/pci/pci.c Tue Sep 6 20:01:15 2016(r305496) +++ head/sys/dev/pci/pci.c Tue Sep 6 20:17:54 2016(r305497) @@ -4071,6 +4071,7
svn commit: r305498 - head/sys/dev/cpufreq
Author: jmcneill Date: Tue Sep 6 20:43:26 2016 New Revision: 305498 URL: https://svnweb.freebsd.org/changeset/base/305498 Log: Add generic device-tree cpufreq driver. This driver supports two bindings: - cpufreq-dt: systems which share clock and voltage across all CPUs - arm_big_little_dt: systems which share clock and voltage across all CPUs in a single cluster Reviewed by: andrew, imp Relnotes: yes Differential Revision:https://reviews.freebsd.org/D7741 Added: head/sys/dev/cpufreq/cpufreq_dt.c (contents, props changed) Added: head/sys/dev/cpufreq/cpufreq_dt.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cpufreq/cpufreq_dt.c Tue Sep 6 20:43:26 2016 (r305498) @@ -0,0 +1,360 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Generic DT based cpufreq driver + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "cpufreq_if.h" + +struct cpufreq_dt_opp { + uint32_tfreq_khz; + uint32_tvoltage_uv; +}; + +struct cpufreq_dt_softc { + clk_t clk; + regulator_t reg; + + struct cpufreq_dt_opp *opp; + ssize_t nopp; + int clk_latency; + + cpuset_t cpus; +}; + +static void +cpufreq_dt_notify(device_t dev, uint64_t freq) +{ +#ifdef __aarch64__ + struct cpufreq_dt_softc *sc; + struct pcpu *pc; + int cpu; + + sc = device_get_softc(dev); + + CPU_FOREACH(cpu) { + if (CPU_ISSET(cpu, &sc->cpus)) { + pc = pcpu_find(cpu); + pc->pc_clock = freq; + } + } +#endif +} + +static const struct cpufreq_dt_opp * +cpufreq_dt_find_opp(device_t dev, uint32_t freq_mhz) +{ + struct cpufreq_dt_softc *sc; + ssize_t n; + + sc = device_get_softc(dev); + + for (n = 0; n < sc->nopp; n++) + if (CPUFREQ_CMP(sc->opp[n].freq_khz / 1000, freq_mhz)) + return (&sc->opp[n]); + + return (NULL); +} + +static void +cpufreq_dt_opp_to_setting(device_t dev, const struct cpufreq_dt_opp *opp, +struct cf_setting *set) +{ + struct cpufreq_dt_softc *sc; + + sc = device_get_softc(dev); + + memset(set, 0, sizeof(*set)); + set->freq = opp->freq_khz / 1000; + set->volts = opp->voltage_uv / 1000; + set->power = CPUFREQ_VAL_UNKNOWN; + set->lat = sc->clk_latency; + set->dev = dev; +} + +static int +cpufreq_dt_get(device_t dev, struct cf_setting *set) +{ + struct cpufreq_dt_softc *sc; + const struct cpufreq_dt_opp *opp; + uint64_t freq; + + sc = device_get_softc(dev); + + if (clk_get_freq(sc->clk, &freq) != 0) + return (ENXIO); + + opp = cpufreq_dt_find_opp(dev, freq / 100); + if (opp == NULL) + return (ENOENT); + + cpufreq_dt_opp_to_setting(dev, opp, set); + + return (0); +} + +static int +cpufreq_dt_set(device_t dev, const struct cf_setting *set) +{ + struct cpufreq_dt_softc *sc; + const struct cpufreq_dt_opp *opp, *copp; + uint64_t freq; + int error; + + sc = device_get_softc(dev); + + if (clk_get_freq(sc->clk, &freq) != 0) + return (ENXIO); + + copp = cpufreq_dt_find_opp(dev, freq / 100); + if (copp == NULL) + return (ENOENT); + opp = cpufreq_dt_find_opp(dev, set->freq); + if
svn commit: r305499 - in stable/9/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Tue Sep 6 20:53:23 2016 New Revision: 305499 URL: https://svnweb.freebsd.org/changeset/base/305499 Log: MFC r394247 Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC r394248 Add ql_minidump.h Added CFLAGS +=-fms-extensions in qlxgbe/Makefile Added: stable/9/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304248, head/sys/dev/qlxgbe/ql_minidump.h Modified: stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_ioctl.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_reset.c stable/9/sys/dev/qlxgbe/ql_ver.h stable/9/sys/modules/qlxgbe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 20:43:26 2016 (r305498) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 20:53:23 2016 (r305499) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0
svn commit: r305500 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 20:55:59 2016 New Revision: 305500 URL: https://svnweb.freebsd.org/changeset/base/305500 Log: MFC 304249 Add support for set/get cam search mode Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h == --- stable/9/sys/dev/qlxgbe/ql_dbg.hTue Sep 6 20:53:23 2016 (r305499) +++ stable/9/sys/dev/qlxgbe/ql_dbg.hTue Sep 6 20:55:59 2016 (r305500) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x8 #define INJCT_HEARTBEAT_FAILURE0x9 #define INJCT_TEMPERATURE_FAILURE 0xA +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB #ifdef QL_DBG Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 6 20:53:23 2016 (r305499) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 6 20:55:59 2016 (r305500) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1; SYSCTL_ADD_UINT(device_get_sysctl_c
svn commit: r305501 - head/sys/conf
Author: jmcneill Date: Tue Sep 6 21:01:38 2016 New Revision: 305501 URL: https://svnweb.freebsd.org/changeset/base/305501 Log: Add "pci" as a dependency to ichss. Reviewed by: jhibbits Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Tue Sep 6 20:55:59 2016(r305500) +++ head/sys/conf/files Tue Sep 6 21:01:38 2016(r305501) @@ -1236,7 +1236,7 @@ dev/ciss/ciss.c optional ciss dev/cm/smc90cx6.c optional cm dev/cmx/cmx.c optional cmx dev/cmx/cmx_pccard.c optional cmx pccard -dev/cpufreq/ichss.coptional cpufreq +dev/cpufreq/ichss.coptional cpufreq pci dev/cs/if_cs.c optional cs dev/cs/if_cs_isa.c optional cs isa dev/cs/if_cs_pccard.c optional cs pccard ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305502 - in head: share/man/man9 sys/amd64/vmm/io sys/dev/pci
Author: jhb Date: Tue Sep 6 21:15:35 2016 New Revision: 305502 URL: https://svnweb.freebsd.org/changeset/base/305502 Log: Reset PCI pass through devices via PCI-e FLR during VM start and end. Add routines to trigger a function level reset (FLR) of a PCI-express device via the PCI-express device control register. This also includes support routines to wait for pending transactions to complete as well as calculating the maximum completion timeout permitted by a device. Change the ppt(4) driver to reset pass through devices before attaching to a VM during startup and before detaching from a VM during shutdown. Reviewed by: imp, wblock (earlier version) MFC after:1 month Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D7751 Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 head/sys/amd64/vmm/io/ppt.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileTue Sep 6 21:01:38 2016 (r305501) +++ head/share/man/man9/MakefileTue Sep 6 21:15:35 2016 (r305502) @@ -1354,7 +1354,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ + pci.9 pcie_flr.9 \ + pci.9 pcie_max_completion_timeout.9 \ pci.9 pcie_read_config.9 \ + pci.9 pcie_wait_for_pending_transactions.9 \ pci.9 pcie_write_config.9 MLINKS+=pci_iov_schema.9 pci_iov_schema_alloc_node.9 \ pci_iov_schema.9 pci_iov_schema_add_bool.9 \ Modified: head/share/man/man9/pci.9 == --- head/share/man/man9/pci.9 Tue Sep 6 21:01:38 2016(r305501) +++ head/share/man/man9/pci.9 Tue Sep 6 21:15:35 2016(r305502) @@ -66,7 +66,10 @@ .Nm pci_set_powerstate , .Nm pci_write_config , .Nm pcie_adjust_config , +.Nm pcie_flr , +.Nm pcie_get_max_completion_timeout , .Nm pcie_read_config , +.Nm pcie_wait_for_pending_transactions , .Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS @@ -145,8 +148,14 @@ .Fa "uint32_t val" .Fa "int width" .Fc +.Ft bool +.Fn pcie_flr "device_t dev" "u_int max_delay" "bool force" +.Ft int +.Fn pcie_get_max_completion_timeout "device_t dev" .Ft uint32_t .Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft bool +.Fn pcie_wait_for_pending_transactions "device_t dev" "u_int max_delay" .Ft void .Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Ft void @@ -431,6 +440,51 @@ keyword, then .Fn pci_get_vpd_readonly returns an error. +.Pp +The +.Fn pcie_get_max_completion_timeout +function returns the maximum completion timeout configured for the device +.Fa dev +in microseconds. +If the +.Fa dev +device is not a PCI-express device, +.Fn pcie_get_max_completion_timeout +returns zero. +When completion timeouts are disabled for +.Fa dev , +this function returns the maxmimum timeout that would be used if timeouts +were enabled. +.Pp +The +.Fn pcie_wait_for_pending_transactions +function waits for any pending transactions initiated by the +.Fa dev +device to complete. +The function checks for pending transactions by polling the transactions +pending flag in the PCI-express device status register. +It returns +.Dv true +once the transaction pending flag is clear. +If transactions are still pending after +.Fa max_delay +milliseconds, +.Fn pcie_wait_for_pending_transactions +returns +.Dv false . +If +.Fa max_delay +is set to zero, +.Fn pcie_wait_for_pending_transactions +performs a single check; +otherwise, +this function may sleep while polling the transactions pending flag. +.Nm pcie_wait_for_pending_transactions +returns +.Dv true +if +.Fa dev +is not a PCI-express device. .Ss Device Configuration The .Fn pci_enable_busmaster @@ -662,6 +716,51 @@ is invoked, then the device will be transitioned to .Dv PCI_POWERSTATE_D0 before any config registers are restored. +.Pp +The +.Fn pcie_flr +function requests a Function Level Reset +.Pq FLR +of +.Fa dev . +If +.Fa dev +is not a PCI-express device or does not support Function Level Resets via +the PCI-express device control register, +.Dv false +is returned. +Pending transactions are drained by disabling busmastering and calling +.Fn pcie_wait_for_pending_transactions +before resetting the device. +The +.Fa max_delay +argument specifies the maximum timeout to wait for pending transactions as +described for +.Fn pcie_wait_for_pending_transactions . +If +.Fn pcie_wait_for_pending_transactions +fails with a timeout and +.Fa force +is +.Dv false , +busmastering is re-enabled and +.Dv false +is returned. +If +.Fn pcie_wait_for_pending_transactions +fails with a timeout and +.Fa force +is +.Dv true , +the device is reset despite the t
svn commit: r305503 - in head/sys: arm64/conf conf
Author: jmcneill Date: Tue Sep 6 21:18:14 2016 New Revision: 305503 URL: https://svnweb.freebsd.org/changeset/base/305503 Log: Add generic device-tree cpufreq driver. Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Tue Sep 6 21:15:35 2016(r305502) +++ head/sys/arm64/conf/GENERIC Tue Sep 6 21:18:14 2016(r305503) @@ -96,6 +96,9 @@ devicevirtio_mmio device virtio_blk device vtnet +# CPU frequency control +device cpufreq + # Bus drivers device pci optionsPCI_HP # PCI-Express native HotPlug Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Tue Sep 6 21:15:35 2016(r305502) +++ head/sys/conf/files.arm64 Tue Sep 6 21:18:14 2016(r305503) @@ -97,6 +97,7 @@ crypto/blowfish/bf_enc.c optionalcrypto crypto/des/des_enc.c optionalcrypto | ipsec | netsmb dev/acpica/acpi_if.m optionalacpi dev/ahci/ahci_generic.coptional ahci fdt +dev/cpufreq/cpufreq_dt.c optionalcpufreq fdt dev/hwpmc/hwpmc_arm64.coptionalhwpmc dev/hwpmc/hwpmc_arm64_md.c optionalhwpmc dev/mmc/host/dwmmc.c optionaldwmmc fdt ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305504 - head/sys/fs/nullfs
Author: mjg Date: Tue Sep 6 21:22:03 2016 New Revision: 305504 URL: https://svnweb.freebsd.org/changeset/base/305504 Log: nullfs: stop special-casing directories in null_vptocnp The previous code was forcing an expensive walk in vop_stdvptocnp, which was causing performance issues on highly contended zfs. No objections:kib MFC after:2 weeks Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c == --- head/sys/fs/nullfs/null_vnops.c Tue Sep 6 21:18:14 2016 (r305503) +++ head/sys/fs/nullfs/null_vnops.c Tue Sep 6 21:22:03 2016 (r305504) @@ -870,9 +870,6 @@ null_vptocnp(struct vop_vptocnp_args *ap struct ucred *cred = ap->a_cred; int error, locked; - if (vp->v_type == VDIR) - return (vop_stdvptocnp(ap)); - locked = VOP_ISLOCKED(vp); lvp = NULLVPTOLOWERVP(vp); vhold(lvp); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r305502 - in head: share/man/man9 sys/amd64/vmm/io sys/dev/pci
On Tuesday, September 06, 2016 09:15:35 PM John Baldwin wrote: > Author: jhb > Date: Tue Sep 6 21:15:35 2016 > New Revision: 305502 > URL: https://svnweb.freebsd.org/changeset/base/305502 > > Log: > Reset PCI pass through devices via PCI-e FLR during VM start and end. > > Add routines to trigger a function level reset (FLR) of a PCI-express > device via the PCI-express device control register. This also includes > support routines to wait for pending transactions to complete as well > as calculating the maximum completion timeout permitted by a device. > > Change the ppt(4) driver to reset pass through devices before attaching > to a VM during startup and before detaching from a VM during shutdown. With the recent fixes, it should (in theory) be safe to do something like: kldload vmm iovctl -C -f /path/to/iovctl.conf devctl set driver ppt vmrun.sh -p And have it work correctly, including if you hotplug or create new VFs after an initial VM is running/has run, or you delete a VF, etc. FLR should (in theory) make VMs with pass through devices a bit more robust if they do not cleanly shutdown the device hardware. I also have some thoughts (still kicking around in my head) about adding a 'devctl reset' command. In particular the trickier case is what to do for attached devices (I think we suspend / resume devices around reset perhaps). Also, there are different ways you can trigger a PCI reset that we should eventually support. -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305505 - in head/sys: arm/conf conf
Author: jmcneill Date: Tue Sep 6 21:36:20 2016 New Revision: 305505 URL: https://svnweb.freebsd.org/changeset/base/305505 Log: Add generic device-tree cpufreq driver. Modified: head/sys/arm/conf/ALLWINNER head/sys/conf/files.arm Modified: head/sys/arm/conf/ALLWINNER == --- head/sys/arm/conf/ALLWINNER Tue Sep 6 21:22:03 2016(r305504) +++ head/sys/arm/conf/ALLWINNER Tue Sep 6 21:36:20 2016(r305505) @@ -52,6 +52,9 @@ devicephy device hwreset device regulator +# CPU frequency control +device cpufreq + # Interrupt controller device gic Modified: head/sys/conf/files.arm == --- head/sys/conf/files.arm Tue Sep 6 21:22:03 2016(r305504) +++ head/sys/conf/files.arm Tue Sep 6 21:36:20 2016(r305505) @@ -94,6 +94,7 @@ cddl/dev/dtrace/arm/dtrace_subr.c opti cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" crypto/blowfish/bf_enc.c optionalcrypto | ipsec crypto/des/des_enc.c optionalcrypto | ipsec | netsmb +dev/cpufreq/cpufreq_dt.c optionalcpufreq fdt dev/dwc/if_dwc.c optionaldwc dev/dwc/if_dwc_if.moptionaldwc dev/fb/fb.coptionalsc ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r305504 - head/sys/fs/nullfs
On 07/09/2016 00:22, Mateusz Guzik wrote: > nullfs: stop special-casing directories in null_vptocnp > > The previous code was forcing an expensive walk in vop_stdvptocnp, > which was causing performance issues on highly contended zfs. In other words, the name cache was always bypassed for directories? -- Andriy Gapon ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r305504 - head/sys/fs/nullfs
On Wed, Sep 07, 2016 at 12:46:44AM +0300, Andriy Gapon wrote: > On 07/09/2016 00:22, Mateusz Guzik wrote: > > nullfs: stop special-casing directories in null_vptocnp > > > > The previous code was forcing an expensive walk in vop_stdvptocnp, > > which was causing performance issues on highly contended zfs. > > In other words, the name cache was always bypassed for directories? > Or whatever the target fs had in store for resolving names. This particular thing was causing a lot of idle time on my poudriere tests due to lockmgr contention. -- Mateusz Guzik ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r305504 - head/sys/fs/nullfs
On Tue, Sep 06, 2016 at 11:51:49PM +0200, Mateusz Guzik wrote: > On Wed, Sep 07, 2016 at 12:46:44AM +0300, Andriy Gapon wrote: > > On 07/09/2016 00:22, Mateusz Guzik wrote: > > > nullfs: stop special-casing directories in null_vptocnp > > > > > > The previous code was forcing an expensive walk in vop_stdvptocnp, > > > which was causing performance issues on highly contended zfs. > > > > In other words, the name cache was always bypassed for directories? > > > > Or whatever the target fs had in store for resolving names. > > This particular thing was causing a lot of idle time on my poudriere > tests due to lockmgr contention. > To be clear, this is not name -> vp translation, but the other way around (e.g. for getcwd). -- Mateusz Guzik ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305506 - head/sys/kern
Author: brooks Date: Tue Sep 6 22:03:53 2016 New Revision: 305506 URL: https://svnweb.freebsd.org/changeset/base/305506 Log: Modernize the initalization of sigproptbl. Use C99 designators to set the value of each slot and the nitems macro to check for valid entries. In the process, switch to indexing by signal number rather than signal-1 for improved clarity. Obtained from:CheriBSD (a6053c5abf03a5f53bbfcdd3a26429383f67e09f) Sponsored by: DARPA, AFRL Reviewed by: kib Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c == --- head/sys/kern/kern_sig.cTue Sep 6 21:36:20 2016(r305505) +++ head/sys/kern/kern_sig.cTue Sep 6 22:03:53 2016(r305506) @@ -198,37 +198,37 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_dev #defineSIGPROP_CANTMASK0x40/* non-maskable, catchable */ static int sigproptbl[NSIG] = { - SIGPROP_KILL, /* SIGHUP */ - SIGPROP_KILL, /* SIGINT */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGQUIT */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGILL */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGTRAP */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGABRT */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGEMT */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGFPE */ - SIGPROP_KILL, /* SIGKILL */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGBUS */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGSEGV */ - SIGPROP_KILL | SIGPROP_CORE,/* SIGSYS */ - SIGPROP_KILL, /* SIGPIPE */ - SIGPROP_KILL, /* SIGALRM */ - SIGPROP_KILL, /* SIGTERM */ - SIGPROP_IGNORE, /* SIGURG */ - SIGPROP_STOP, /* SIGSTOP */ - SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTSTP */ - SIGPROP_IGNORE | SIGPROP_CONT, /* SIGCONT */ - SIGPROP_IGNORE, /* SIGCHLD */ - SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTTIN */ - SIGPROP_STOP | SIGPROP_TTYSTOP, /* SIGTTOU */ - SIGPROP_IGNORE, /* SIGIO */ - SIGPROP_KILL, /* SIGXCPU */ - SIGPROP_KILL, /* SIGXFSZ */ - SIGPROP_KILL, /* SIGVTALRM */ - SIGPROP_KILL, /* SIGPROF */ - SIGPROP_IGNORE, /* SIGWINCH */ - SIGPROP_IGNORE, /* SIGINFO */ - SIGPROP_KILL, /* SIGUSR1 */ - SIGPROP_KILL, /* SIGUSR2 */ + [SIGHUP] = SIGPROP_KILL, + [SIGINT] = SIGPROP_KILL, + [SIGQUIT] = SIGPROP_KILL | SIGPROP_CORE, + [SIGILL] = SIGPROP_KILL | SIGPROP_CORE, + [SIGTRAP] = SIGPROP_KILL | SIGPROP_CORE, + [SIGABRT] = SIGPROP_KILL | SIGPROP_CORE, + [SIGEMT] = SIGPROP_KILL | SIGPROP_CORE, + [SIGFPE] = SIGPROP_KILL | SIGPROP_CORE, + [SIGKILL] = SIGPROP_KILL, + [SIGBUS] = SIGPROP_KILL | SIGPROP_CORE, + [SIGSEGV] = SIGPROP_KILL | SIGPROP_CORE, + [SIGSYS] = SIGPROP_KILL | SIGPROP_CORE, + [SIGPIPE] = SIGPROP_KILL, + [SIGALRM] = SIGPROP_KILL, + [SIGTERM] = SIGPROP_KILL, + [SIGURG] = SIGPROP_IGNORE, + [SIGSTOP] = SIGPROP_STOP, + [SIGTSTP] = SIGPROP_STOP | SIGPROP_TTYSTOP, + [SIGCONT] = SIGPROP_IGNORE | SIGPROP_CONT, + [SIGCHLD] = SIGPROP_IGNORE, + [SIGTTIN] = SIGPROP_STOP | SIGPROP_TTYSTOP, + [SIGTTOU] = SIGPROP_STOP | SIGPROP_TTYSTOP, + [SIGIO] = SIGPROP_IGNORE, + [SIGXCPU] = SIGPROP_KILL, + [SIGXFSZ] = SIGPROP_KILL, + [SIGVTALRM] = SIGPROP_KILL, + [SIGPROF] = SIGPROP_KILL, + [SIGWINCH] =SIGPROP_IGNORE, + [SIGINFO] = SIGPROP_IGNORE, + [SIGUSR1] = SIGPROP_KILL, + [SIGUSR2] = SIGPROP_KILL, }; static void reschedule_signals(struct proc *p, sigset_t block, int flags); @@ -611,8 +611,8 @@ static __inline int sigprop(int sig) { - if (sig > 0 && sig < NSIG) - return (sigproptbl[_SIG_IDX(sig)]); + if (sig > 0 && sig < nitems(sigproptbl)) + return (sigproptbl[sig]); return (0); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305507 - head/sys/sparc64/conf
Author: marius Date: Tue Sep 6 22:18:08 2016 New Revision: 305507 URL: https://svnweb.freebsd.org/changeset/base/305507 Log: Disable vt(4) by default on sparc64 as creator_vt(4) and vt_ofwfb(4) have the serious problem of not actually attaching the hardware they are driving at the bus level. This causes creator(4) and machfb(4) to attach and drive the very same hardware in parallel when both syscons(4) and vt(4) as well as their associated hardware drivers are built into a kernel, i. e. GENERIC, at the same time. Also, syscons(4) and its drivers still are way superior to vt(4) and its equivalents; unlike the syscons(4) counterparts the vt(4) drivers don't provide hardware acceleration resulting in considerably slower screen drawing, creator_vt(4) doesn't provide a /dev/fb node as required by the Xorg sunffb(4) etc. In theory, vt_ofwfb(4) should be able to handle more devices than machfb(4). However, testing shows that it hardly works with any hardware machfb(4) isn't also able to drive, making vt(4) and vt_ofwfb(4) not favorable for the time being from that perspective either. MFC after:3 days Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC == --- head/sys/sparc64/conf/GENERIC Tue Sep 6 22:03:53 2016 (r305506) +++ head/sys/sparc64/conf/GENERIC Tue Sep 6 22:18:08 2016 (r305507) @@ -147,7 +147,7 @@ device splash # Splash screen and scre optionsKBD_INSTALL_CDEV # install a CDEV entry in /dev # vt is the new video console driver -device vt +#devicevt # Builtin hardware device auxio # auxiliary I/O device ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305508 - head/sys/geom/mirror
Author: markj Date: Tue Sep 6 23:35:48 2016 New Revision: 305508 URL: https://svnweb.freebsd.org/changeset/base/305508 Log: Add some fail points to gmirror. These are useful for testing changes to I/O error handling, and for reproducing existing bugs in a controlled manner. The fail points are g_mirror_regular_request_read g_mirror_regular_request_write g_mirror_sync_request_read g_mirror_sync_request_write g_mirror_metadata_write They all effectively allow one to inject an error value into the bio_error field of a corresponding BIO request as it is being completed. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c == --- head/sys/geom/mirror/g_mirror.c Tue Sep 6 22:18:08 2016 (r305507) +++ head/sys/geom/mirror/g_mirror.c Tue Sep 6 23:35:48 2016 (r305508) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -646,6 +647,7 @@ g_mirror_write_metadata(struct g_mirror_ else mirror_metadata_encode(md, sector); } + KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_metadata_write, error); if (error == 0) error = g_write_data(cp, offset, sector, length); free(sector, M_MIRROR); @@ -914,6 +916,13 @@ g_mirror_regular_request(struct bio *bp) g_topology_unlock(); } + if (bp->bio_cmd == BIO_READ) + KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_regular_request_read, + bp->bio_error); + else if (bp->bio_cmd == BIO_WRITE) + KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_regular_request_write, + bp->bio_error); + pbp->bio_inbed++; KASSERT(pbp->bio_inbed <= pbp->bio_children, ("bio_inbed (%u) is bigger than bio_children (%u).", pbp->bio_inbed, @@ -1308,6 +1317,9 @@ g_mirror_sync_request(struct bio *bp) { struct g_consumer *cp; + KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_read, + bp->bio_error); + if (bp->bio_error != 0) { G_MIRROR_LOGREQ(0, bp, "Synchronization request failed (error=%d).", @@ -1334,6 +1346,9 @@ g_mirror_sync_request(struct bio *bp) void *data; int i; + KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_write, + bp->bio_error); + if (bp->bio_error != 0) { G_MIRROR_LOGREQ(0, bp, "Synchronization request failed (error=%d).", ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305509 - head/sys/geom/mirror
Author: markj Date: Tue Sep 6 23:42:59 2016 New Revision: 305509 URL: https://svnweb.freebsd.org/changeset/base/305509 Log: Don't treat an error from g_mirror_clear_metadata() as fatal. Such errors can occur as the result of a write error or because the disk backing the mirror element was removed. They result in a generation ID bump on all active elements of the mirror, so we can safely disconnect the mirror component rather than destroy it. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision:https://reviews.freebsd.org/D7750 Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c == --- head/sys/geom/mirror/g_mirror.c Tue Sep 6 23:35:48 2016 (r305508) +++ head/sys/geom/mirror/g_mirror.c Tue Sep 6 23:42:59 2016 (r305509) @@ -2678,8 +2678,12 @@ again: int error; error = g_mirror_clear_metadata(disk); - if (error != 0) - return (error); + if (error != 0) { + G_MIRROR_DEBUG(0, + "Device %s: failed to clear metadata on %s: %d.", + sc->sc_name, g_mirror_get_diskname(disk), error); + break; + } DISK_STATE_CHANGED(); G_MIRROR_DEBUG(0, "Device %s: provider %s destroyed.", sc->sc_name, g_mirror_get_diskname(disk)); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305511 - head/sys/arm/allwinner
Author: jmcneill Date: Wed Sep 7 01:09:25 2016 New Revision: 305511 URL: https://svnweb.freebsd.org/changeset/base/305511 Log: Attach later so axp81x attaches after aw_nmi. Modified: head/sys/arm/allwinner/axp81x.c Modified: head/sys/arm/allwinner/axp81x.c == --- head/sys/arm/allwinner/axp81x.c Wed Sep 7 00:34:45 2016 (r305510) +++ head/sys/arm/allwinner/axp81x.c Wed Sep 7 01:09:25 2016 (r305511) @@ -777,9 +777,9 @@ extern devclass_t ofwgpiobus_devclass, g extern driver_t ofw_gpiobus_driver, gpioc_driver; EARLY_DRIVER_MODULE(axp81x, iicbus, axp81x_driver, axp81x_devclass, 0, 0, -BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); EARLY_DRIVER_MODULE(ofw_gpiobus, axp81x_pmu, ofw_gpiobus_driver, -ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); DRIVER_MODULE(gpioc, axp81x_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp81x, 1); MODULE_DEPEND(axp81x, iicbus, 1, 1, 1); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305512 - in head/sys: arm/allwinner/clk boot/fdt/dts/arm
Author: jmcneill Date: Wed Sep 7 01:10:16 2016 New Revision: 305512 URL: https://svnweb.freebsd.org/changeset/base/305512 Log: Add support for Allwinner A83T CPU frequency scaling. Modified: head/sys/arm/allwinner/clk/aw_cpuclk.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/boot/fdt/dts/arm/a83t.dtsi head/sys/boot/fdt/dts/arm/sinovoip-bpi-m3.dts Modified: head/sys/arm/allwinner/clk/aw_cpuclk.c == --- head/sys/arm/allwinner/clk/aw_cpuclk.c Wed Sep 7 01:09:25 2016 (r305511) +++ head/sys/arm/allwinner/clk/aw_cpuclk.c Wed Sep 7 01:10:16 2016 (r305512) @@ -47,8 +47,42 @@ __FBSDID("$FreeBSD$"); #include -#defineCPU_CLK_SRC_SEL_WIDTH 2 -#defineCPU_CLK_SRC_SEL_SHIFT 16 +#defineA10_CPU_CLK_SRC_SEL_WIDTH 2 +#defineA10_CPU_CLK_SRC_SEL_SHIFT 16 + +#defineA83T_Cx_CLK_SRC_SEL_WIDTH 1 +#defineA83T_C0_CLK_SRC_SEL_SHIFT 12 +#defineA83T_C1_CLK_SRC_SEL_SHIFT 28 + +struct aw_cpuclk_config { + u_int width; + u_int shift; +}; + +static struct aw_cpuclk_config a10_config = { + .width = A10_CPU_CLK_SRC_SEL_WIDTH, + .shift = A10_CPU_CLK_SRC_SEL_SHIFT, +}; + +static struct aw_cpuclk_config a83t_c0_config = { + .width = A83T_Cx_CLK_SRC_SEL_WIDTH, + .shift = A83T_C0_CLK_SRC_SEL_SHIFT, +}; + +static struct aw_cpuclk_config a83t_c1_config = { + .width = A83T_Cx_CLK_SRC_SEL_WIDTH, + .shift = A83T_C1_CLK_SRC_SEL_SHIFT, +}; + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun4i-a10-cpu-clk",(uintptr_t)&a10_config }, + { "allwinner,sun8i-a83t-c0cpu-clk", (uintptr_t)&a83t_c0_config }, + { "allwinner,sun8i-a83t-c1cpu-clk", (uintptr_t)&a83t_c1_config }, + { NULL, (uintptr_t)NULL } +}; + +#defineCPUCLK_CONF(d) \ + (void *)ofw_bus_search_compatible((d), compat_data)->ocd_data static int aw_cpuclk_probe(device_t dev) @@ -56,7 +90,7 @@ aw_cpuclk_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-cpu-clk")) + if (CPUCLK_CONF(dev) == NULL) return (ENXIO); device_set_desc(dev, "Allwinner CPU Clock"); @@ -68,6 +102,7 @@ aw_cpuclk_attach(device_t dev) { struct clk_mux_def def; struct clkdom *clkdom; + struct aw_cpuclk_config *conf; bus_addr_t paddr; bus_size_t psize; phandle_t node; @@ -75,6 +110,7 @@ aw_cpuclk_attach(device_t dev) clk_t clk; node = ofw_bus_get_node(dev); + conf = CPUCLK_CONF(dev); if (ofw_reg_to_paddr(node, 0, &paddr, &psize, NULL) != 0) { device_printf(dev, "cannot parse 'reg' property\n"); @@ -105,8 +141,8 @@ aw_cpuclk_attach(device_t dev) } def.clkdef.parent_cnt = ncells; def.offset = paddr; - def.shift = CPU_CLK_SRC_SEL_SHIFT; - def.width = CPU_CLK_SRC_SEL_WIDTH; + def.shift = conf->shift; + def.width = conf->width; error = clk_parse_ofw_clk_name(dev, node, &def.clkdef.name); if (error != 0) { Modified: head/sys/arm/allwinner/clk/aw_pll.c == --- head/sys/arm/allwinner/clk/aw_pll.c Wed Sep 7 01:09:25 2016 (r305511) +++ head/sys/arm/allwinner/clk/aw_pll.c Wed Sep 7 01:10:16 2016 (r305512) @@ -157,6 +157,17 @@ __FBSDID("$FreeBSD$"); #defineA80_PLL4_FACTOR_N (0xff << 8) #defineA80_PLL4_FACTOR_N_SHIFT 8 +#defineA83T_PLLCPUX_LOCK_TIME (0x7 << 24) +#defineA83T_PLLCPUX_LOCK_TIME_SHIFT24 +#defineA83T_PLLCPUX_CLOCK_OUTPUT_DIS (1 << 20) +#defineA83T_PLLCPUX_OUT_EXT_DIVP (1 << 16) +#defineA83T_PLLCPUX_FACTOR_N (0xff << 8) +#defineA83T_PLLCPUX_FACTOR_N_SHIFT 8 +#defineA83T_PLLCPUX_FACTOR_N_MIN 12 +#defineA83T_PLLCPUX_FACTOR_N_MAX 125 +#defineA83T_PLLCPUX_POSTDIV_M (0x3 << 0) +#defineA83T_PLLCPUX_POSTDIV_M_SHIFT0 + #defineCLKID_A10_PLL3_1X 0 #defineCLKID_A10_PLL3_2X 1 @@ -202,6 +213,7 @@ enum aw_pll_type { AWPLL_A31_PLL6, AWPLL_A64_PLLHSIC, AWPLL_A80_PLL4, + AWPLL_A83T_PLLCPUX, AWPLL_H3_PLL1, }; @@ -824,6 +836,46 @@ a64_pllhsic_init(device_t dev, bus_addr_ return (0); } +static int +a83t_pllcpux_recalc(struct aw_pll_sc *sc, uint64_t *freq) +{ + uint32_t val, n, p; + + DEVICE_LOCK(sc); + PLL_READ(sc, &val); + DEVICE_UNLOCK(sc); + + n = (val & A83T_PLLCPUX_FACTOR_N) >> A83T_PLLCPUX_FACTOR_N_SHIFT; + p = (val & A83T_PLLCPUX_OUT_EXT_DIVP) ? 4 : 1; + + *f
svn commit: r305513 - head/share/man/man4
Author: kevlo Date: Wed Sep 7 02:45:09 2016 New Revision: 305513 URL: https://svnweb.freebsd.org/changeset/base/305513 Log: Remove extra period from kern.vt.kbd_reboot Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 == --- head/share/man/man4/vt.4Wed Sep 7 01:10:16 2016(r305512) +++ head/share/man/man4/vt.4Wed Sep 7 02:45:09 2016(r305513) @@ -250,7 +250,7 @@ command. Enable halt keyboard combination. .It Va kern.vt.kbd_poweroff Enable power off key combination. -.It Va kern.vt.kbd_reboot. +.It Va kern.vt.kbd_reboot Enable reboot key combination, usually Ctrl+Alt+Del. .It Va kern.vt.kbd_debug Enable debug request key combination, usually Ctrl+Alt+Esc. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305514 - stable/11/sys/kern
Author: emaste Date: Wed Sep 7 02:53:38 2016 New Revision: 305514 URL: https://svnweb.freebsd.org/changeset/base/305514 Log: MFC r305140: Allow getdtablesize in capability mode Modified: stable/11/sys/kern/capabilities.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/capabilities.conf == --- stable/11/sys/kern/capabilities.confWed Sep 7 02:45:09 2016 (r305513) +++ stable/11/sys/kern/capabilities.confWed Sep 7 02:53:38 2016 (r305514) @@ -248,6 +248,7 @@ getdirentries ## Allow querying certain trivial global state. ## getdomainname +getdtablesize ## ## Allow querying current process credential state. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305515 - stable/11/sys/kern
Author: emaste Date: Wed Sep 7 02:54:40 2016 New Revision: 305515 URL: https://svnweb.freebsd.org/changeset/base/305515 Log: Regen after r305514, allow getdtablesize in capability mode Modified: stable/11/sys/kern/init_sysent.c Modified: stable/11/sys/kern/init_sysent.c == --- stable/11/sys/kern/init_sysent.cWed Sep 7 02:53:38 2016 (r305514) +++ stable/11/sys/kern/init_sysent.cWed Sep 7 02:54:40 2016 (r305515) @@ -135,7 +135,7 @@ struct sysent sysent[] = { { AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 86 = getitimer */ { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 87 = old gethostname */ { compat(AS(sethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = old sethostname */ - { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = getdtablesize */ + { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 89 = getdtablesize */ { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 90 = dup2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 91 = getdopt */ { AS(fcntl_args), (sy_call_t *)sys_fcntl, AUE_FCNTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 92 = fcntl */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305516 - stable/11/sys/kern
Author: emaste Date: Wed Sep 7 03:15:26 2016 New Revision: 305516 URL: https://svnweb.freebsd.org/changeset/base/305516 Log: MFC r305171: allow kern.proc.nfds sysctl in capability mode Modified: stable/11/sys/kern/kern_descrip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_descrip.c == --- stable/11/sys/kern/kern_descrip.c Wed Sep 7 02:54:40 2016 (r305515) +++ stable/11/sys/kern/kern_descrip.c Wed Sep 7 03:15:26 2016 (r305516) @@ -3175,7 +3175,7 @@ sysctl_kern_proc_nfds(SYSCTL_HANDLER_ARG } static SYSCTL_NODE(_kern_proc, KERN_PROC_NFDS, nfds, -CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_nfds, +CTLFLAG_RD|CTLFLAG_CAPRD|CTLFLAG_MPSAFE, sysctl_kern_proc_nfds, "Number of open file descriptors"); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305517 - head/sys/powerpc/booke
Author: jhibbits Date: Wed Sep 7 03:26:55 2016 New Revision: 305517 URL: https://svnweb.freebsd.org/changeset/base/305517 Log: Allow pmap_early_io_unmap() to reclaim memory pmap_early_io_map()/pmap_early_io_unmap(), if used in pairs, should be used in the form: pmap_early_io_map() ..do stuff.. pmap_early_io_unmap() Without other allocations in the middle. Without reclaiming memory this can leave large holes in the device space. While here, make a simple change to the unmap loop which now permits it to unmap multiple TLB entries in the range. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Wed Sep 7 03:15:26 2016 (r305516) +++ head/sys/powerpc/booke/pmap.c Wed Sep 7 03:26:55 2016 (r305517) @@ -3391,27 +3391,37 @@ tlb1_init() set_mas4_defaults(); } +/* + * pmap_early_io_unmap() should be used in short conjunction with + * pmap_early_io_map(), as in the following snippet: + * + * x = pmap_early_io_map(...); + * + * pmap_early_io_unmap(x, size); + * + * And avoiding more allocations between. + */ void pmap_early_io_unmap(vm_offset_t va, vm_size_t size) { int i; tlb_entry_t e; + vm_size_t isize; - for (i = 0; i < TLB1_ENTRIES && size > 0; i ++) { + size = roundup(size, PAGE_SIZE); + isize = size; + for (i = 0; i < TLB1_ENTRIES && size > 0; i++) { tlb1_read_entry(&e, i); if (!(e.mas1 & MAS1_VALID)) continue; - /* -* FIXME: this code does not work if VA region -* spans multiple TLB entries. This does not cause -* problems right now but shall be fixed in the future -*/ - if (va >= e.virt && (va + size) <= (e.virt + e.size)) { + if (va <= e.virt && (va + isize) >= (e.virt + e.size)) { size -= e.size; e.mas1 &= ~MAS1_VALID; tlb1_write_entry(&e, i); } } + if (tlb1_map_base == va + isize) + tlb1_map_base -= isize; } vm_offset_t ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305518 - stable/10/sys/kern
Author: emaste Date: Wed Sep 7 04:06:25 2016 New Revision: 305518 URL: https://svnweb.freebsd.org/changeset/base/305518 Log: MFC r305140: Allow getdtablesize in capability mode Modified: stable/10/sys/kern/capabilities.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/capabilities.conf == --- stable/10/sys/kern/capabilities.confWed Sep 7 03:26:55 2016 (r305517) +++ stable/10/sys/kern/capabilities.confWed Sep 7 04:06:25 2016 (r305518) @@ -250,6 +250,7 @@ getdirentries ## Allow querying certain trivial global state. ## getdomainname +getdtablesize ## ## Allow querying current process credential state. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305519 - stable/10/sys/kern
Author: emaste Date: Wed Sep 7 04:07:43 2016 New Revision: 305519 URL: https://svnweb.freebsd.org/changeset/base/305519 Log: Regen after r305518: Allow getdtablesize in capability mode Modified: stable/10/sys/kern/init_sysent.c Modified: stable/10/sys/kern/init_sysent.c == --- stable/10/sys/kern/init_sysent.cWed Sep 7 04:06:25 2016 (r305518) +++ stable/10/sys/kern/init_sysent.cWed Sep 7 04:07:43 2016 (r305519) @@ -123,7 +123,7 @@ struct sysent sysent[] = { { AS(getitimer_args), (sy_call_t *)sys_getitimer, AUE_GETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 86 = getitimer */ { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 87 = old gethostname */ { compat(AS(sethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = old sethostname */ - { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = getdtablesize */ + { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },/* 89 = getdtablesize */ { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 90 = dup2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 91 = getdopt */ { AS(fcntl_args), (sy_call_t *)sys_fcntl, AUE_FCNTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 92 = fcntl */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305520 - head/sys/powerpc/mpc85xx
Author: jhibbits Date: Wed Sep 7 04:13:28 2016 New Revision: 305520 URL: https://svnweb.freebsd.org/changeset/base/305520 Log: Disable the qoriq errata fix for now It hangs more often than it actually works it seems. Further debugging is needed to determine why, but for now the system needs to be able to boot. Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c == --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed Sep 7 04:07:43 2016 (r305519) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Wed Sep 7 04:13:28 2016 (r305520) @@ -195,7 +195,9 @@ mpc85xx_attach(platform_t plat) } ccsrbar_va = pmap_early_io_map(ccsrbar, ccsrsize); +#if 0 mpc85xx_fix_errata(ccsrbar_va); +#endif mpc85xx_enable_l3_cache(); return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305521 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Sep 7 05:27:43 2016 New Revision: 305521 URL: https://svnweb.freebsd.org/changeset/base/305521 Log: hyperv/hn: Avoid bit fields for TXCSUM setup. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7792 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 04:13:28 2016(r305520) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 05:27:43 2016(r305521) @@ -972,16 +972,14 @@ hn_encap(struct hn_tx_ring *txr, struct csum_info = (rndis_tcp_ip_csum_info *)((uint8_t *)rppi + rppi->per_packet_info_offset); - csum_info->xmit.is_ipv4 = 1; + csum_info->value = NDIS_TXCSUM_INFO_IPV4; if (m_head->m_pkthdr.csum_flags & CSUM_IP) - csum_info->xmit.ip_header_csum = 1; + csum_info->value |= NDIS_TXCSUM_INFO_IPCS; - if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { - csum_info->xmit.tcp_csum = 1; - csum_info->xmit.tcp_header_offset = 0; - } else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) { - csum_info->xmit.udp_csum = 1; - } + if (m_head->m_pkthdr.csum_flags & CSUM_TCP) + csum_info->value |= NDIS_TXCSUM_INFO_TCPCS; + else if (m_head->m_pkthdr.csum_flags & CSUM_UDP) + csum_info->value |= NDIS_TXCSUM_INFO_UDPCS; } rndis_mesg->msg_len = tot_data_buf_len + rndis_msg_size; Modified: head/sys/dev/hyperv/netvsc/ndis.h == --- head/sys/dev/hyperv/netvsc/ndis.h Wed Sep 7 04:13:28 2016 (r305520) +++ head/sys/dev/hyperv/netvsc/ndis.h Wed Sep 7 05:27:43 2016 (r305521) @@ -232,6 +232,7 @@ struct ndis_rssprm_toeplitz { #defineNDIS_RXCSUM_INFO_IPCS_INVAL 0x0100 /* LSOv2 */ +#defineNDIS_LSO2_INFO_SIZE sizeof(uint32_t) #defineNDIS_LSO2_INFO_MSS_MASK 0x000f #defineNDIS_LSO2_INFO_THOFF_MASK 0x3ff0 #defineNDIS_LSO2_INFO_ISLSO2 0x4000 @@ -248,4 +249,13 @@ struct ndis_rssprm_toeplitz { #defineNDIS_LSO2_INFO_MAKEIPV6(thoff, mss) \ (NDIS_LSO2_INFO_MAKE((thoff), (mss)) | NDIS_LSO2_INFO_ISIPV6) +/* Transmission checksum */ +#defineNDIS_TXCSUM_INFO_SIZE sizeof(uint32_t) +#defineNDIS_TXCSUM_INFO_IPV4 0x0001 +#defineNDIS_TXCSUM_INFO_IPV6 0x0002 +#defineNDIS_TXCSUM_INFO_TCPCS 0x0004 +#defineNDIS_TXCSUM_INFO_UDPCS 0x0008 +#defineNDIS_TXCSUM_INFO_IPCS 0x0010 +#defineNDIS_TXCSUM_INFO_THOFF 0x03ff + #endif /* !_NET_NDIS_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r305522 - in head/sys: arm/annapurna/alpine arm64/conf boot/fdt/dts/arm conf
Author: wma Date: Wed Sep 7 05:34:41 2016 New Revision: 305522 URL: https://svnweb.freebsd.org/changeset/base/305522 Log: Introduce support for Annapurna Alpine CCU and NB devices This commit adds drivers for Alpine Cache Coherency Unit and North Bridge Service whose task is to configure the system fabric and enable cache coherency. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: wma Differential Revision: https://reviews.freebsd.org/D7565 Added: head/sys/arm/annapurna/alpine/alpine_ccu.c (contents, props changed) head/sys/arm/annapurna/alpine/alpine_nb_service.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/boot/fdt/dts/arm/annapurna-alpine.dts head/sys/conf/files.arm head/sys/conf/files.arm64 Added: head/sys/arm/annapurna/alpine/alpine_ccu.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/annapurna/alpine/alpine_ccu.c Wed Sep 7 05:34:41 2016 (r305522) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2015,2016 Annapurna Labs Ltd. and affiliates + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#defineAL_CCU_SNOOP_CONTROL_IOFAB_0_OFFSET 0x4000 +#defineAL_CCU_SNOOP_CONTROL_IOFAB_1_OFFSET 0x5000 +#defineAL_CCU_SPECULATION_CONTROL_OFFSET 0x4 + +static struct resource_spec al_ccu_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +struct al_ccu_softc { + struct resource *res; +}; + +static int al_ccu_probe(device_t dev); +static int al_ccu_attach(device_t dev); +static int al_ccu_detach(device_t dev); + +static device_method_t al_ccu_methods[] = { + DEVMETHOD(device_probe, al_ccu_probe), + DEVMETHOD(device_attach,al_ccu_attach), + DEVMETHOD(device_detach,al_ccu_detach), + + { 0, 0 } +}; + +static driver_t al_ccu_driver = { + "ccu", + al_ccu_methods, + sizeof(struct al_ccu_softc) +}; + +static devclass_t al_ccu_devclass; + +EARLY_DRIVER_MODULE(al_ccu, simplebus, al_ccu_driver, +al_ccu_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE); +EARLY_DRIVER_MODULE(al_ccu, ofwbus, al_ccu_driver, +al_ccu_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE); + +static int +al_ccu_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "annapurna-labs,al-ccu")) + return (ENXIO); + + device_set_desc(dev, "Alpine CCU"); + + return (BUS_PROBE_DEFAULT); +} + +static int +al_ccu_attach(device_t dev) +{ + struct al_ccu_softc *sc; + int err; + + sc = device_get_softc(dev); + + err = bus_alloc_resources(dev, al_ccu_spec, &sc->res); + if (err != 0) { + device_printf(dev, "could not allocate resources\n"); + return (err); + } + + /* Enable cache snoop */ + bus_write_4(sc->res, AL_CCU_SNOOP_CONTROL_IOFAB_0_OFFSET, 1); + bus_write_4(sc->res, AL_CCU_SNOOP_CONTROL_IOFAB_1_OFFSET, 1); + + /* Disable speculative fetches from masters */ + bus_write_4(sc->res, AL_CCU_SPECULATION_CONTROL_OFFSET, 7); + + return (0); +} + +static int +al_ccu_detach(device_t dev) +{ + struct al_ccu_softc *sc; + + sc = device_get_softc(dev); + + bus_release_resources(dev, a
svn commit: r305523 - in head/sys/arm: annapurna/alpine conf
Author: wma Date: Wed Sep 7 05:36:55 2016 New Revision: 305523 URL: https://svnweb.freebsd.org/changeset/base/305523 Log: Remove messy machdep code for Alpine V1 and use proper drivers instead Let drivers for Alpine CCU, NB and Serdes take care of internal SoC configuration. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Reviewed by: imp,wma Differential Revision: https://reviews.freebsd.org/D7566 Modified: head/sys/arm/annapurna/alpine/alpine_machdep.c head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/conf/ALPINE Modified: head/sys/arm/annapurna/alpine/alpine_machdep.c == --- head/sys/arm/annapurna/alpine/alpine_machdep.c Wed Sep 7 05:34:41 2016(r305522) +++ head/sys/arm/annapurna/alpine/alpine_machdep.c Wed Sep 7 05:36:55 2016(r305523) @@ -51,21 +51,10 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_platform.h" -struct mtx al_dbg_lock; - #defineDEVMAP_MAX_VA_ADDRESS 0xF000 bus_addr_t al_devmap_pa; bus_addr_t al_devmap_size; -#defineAL_NB_SERVICE_OFFSET0x7 -#defineAL_NB_CCU_OFFSET0x9 -#defineAL_CCU_SNOOP_CONTROL_IOFAB_0_OFFSET 0x4000 -#defineAL_CCU_SNOOP_CONTROL_IOFAB_1_OFFSET 0x5000 -#defineAL_CCU_SPECULATION_CONTROL_OFFSET 0x4 - -#defineAL_NB_ACF_MISC_OFFSET 0xD0 -#defineAL_NB_ACF_MISC_READ_BYPASS (1 << 30) - int alpine_get_devmap_base(bus_addr_t *pa, bus_addr_t *size); vm_offset_t @@ -90,35 +79,7 @@ platform_gpio_init(void) void platform_late_init(void) { - bus_addr_t reg_baddr; - uint32_t val; - - if (!mtx_initialized(&al_dbg_lock)) - mtx_init(&al_dbg_lock, "ALDBG", "ALDBG", MTX_SPIN); - - /* configure system fabric */ - if (bus_space_map(fdtbus_bs_tag, al_devmap_pa, al_devmap_size, 0, - ®_baddr)) - panic("Couldn't map Register Space area"); - - /* do not allow reads to bypass writes to different addresses */ - val = bus_space_read_4(fdtbus_bs_tag, reg_baddr, - AL_NB_SERVICE_OFFSET + AL_NB_ACF_MISC_OFFSET); - val &= ~AL_NB_ACF_MISC_READ_BYPASS; - bus_space_write_4(fdtbus_bs_tag, reg_baddr, - AL_NB_SERVICE_OFFSET + AL_NB_ACF_MISC_OFFSET, val); - - /* enable cache snoop */ - bus_space_write_4(fdtbus_bs_tag, reg_baddr, - AL_NB_CCU_OFFSET + AL_CCU_SNOOP_CONTROL_IOFAB_0_OFFSET, 1); - bus_space_write_4(fdtbus_bs_tag, reg_baddr, - AL_NB_CCU_OFFSET + AL_CCU_SNOOP_CONTROL_IOFAB_1_OFFSET, 1); - - /* disable speculative fetches from masters */ - bus_space_write_4(fdtbus_bs_tag, reg_baddr, - AL_NB_CCU_OFFSET + AL_CCU_SPECULATION_CONTROL_OFFSET, 7); - bus_space_unmap(fdtbus_bs_tag, reg_baddr, al_devmap_size); } /* Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c == --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Wed Sep 7 05:34:41 2016(r305522) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Wed Sep 7 05:36:55 2016(r305523) @@ -68,22 +68,14 @@ __FBSDID("$FreeBSD$"); #define AL_NB_INIT_CONTROL (0x8) #define AL_NB_CONFIG_STATUS_PWR_CTRL(cpu) (0x2020 + (cpu)*0x100) -#define SERDES_NUM_GROUPS 4 -#define SERDES_GROUP_SIZE 0x400 - extern bus_addr_t al_devmap_pa; extern bus_addr_t al_devmap_size; extern void mpentry(void); -int alpine_serdes_resource_get(uint32_t group, bus_space_tag_t *tag, -bus_addr_t *baddr); static int platform_mp_get_core_cnt(void); static int alpine_get_cpu_resume_base(u_long *pbase, u_long *psize); static int alpine_get_nb_base(u_long *pbase, u_long *psize); -static int alpine_get_serdes_base(u_long *pbase, u_long *psize); -int alpine_serdes_resource_get(uint32_t group, bus_space_tag_t *tag, -bus_addr_t *baddr); static boolean_t alpine_validate_cpu(u_int, phandle_t, u_int, pcell_t *); static boolean_t @@ -254,60 +246,3 @@ platform_mp_start_ap(void) bus_space_unmap(fdtbus_bs_tag, nb_baddr, nb_size); bus_space_unmap(fdtbus_bs_tag, cpu_resume_baddr, cpu_resume_size); } - -static int -alpine_get_serdes_base(u_long *pbase, u_long *psize) -{ - phandle_t node; - u_long base = 0; - u_long size = 0; - - if (pbase == NULL || psize == NULL) - return (EINVAL); - - if ((node = OF_finddevice("/")) == -1) - return (EFAULT); - - if ((node = - ofw_bus_find_compatible(node, "annapurna-labs,al-serdes")) == 0) - return (EFAULT); - - if (fdt_regsize(node, &base, &size)) - return (EFAULT); - - *pbase = base; - *psize = si
svn commit: r305524 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Sep 7 05:41:01 2016 New Revision: 305524 URL: https://svnweb.freebsd.org/changeset/base/305524 Log: hyperv/hn: Cleanup RNDIS packet message encapsulation. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7793 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 05:36:55 2016(r305523) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 05:41:01 2016(r305524) @@ -142,14 +142,14 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX8 -#define HN_RNDIS_MSG_LEN \ -(sizeof(rndis_msg) + \ +#define HN_RNDIS_PKT_LEN \ +(sizeof(struct rndis_packet_msg) + \ RNDIS_HASHVAL_PPI_SIZE + \ RNDIS_VLAN_PPI_SIZE + \ RNDIS_TSO_PPI_SIZE + \ RNDIS_CSUM_PPI_SIZE) -#define HN_RNDIS_MSG_BOUNDARY PAGE_SIZE -#define HN_RNDIS_MSG_ALIGN CACHE_LINE_SIZE +#define HN_RNDIS_PKT_BOUNDARY PAGE_SIZE +#define HN_RNDIS_PKT_ALIGN CACHE_LINE_SIZE #define HN_TX_DATA_BOUNDARYPAGE_SIZE #define HN_TX_DATA_MAXSIZE IP_MAXPACKET @@ -173,9 +173,9 @@ struct hn_txdesc { bus_dmamap_tdata_dmap; - bus_addr_t rndis_msg_paddr; - rndis_msg *rndis_msg; - bus_dmamap_trndis_msg_dmap; + bus_addr_t rndis_pkt_paddr; + struct rndis_packet_msg *rndis_pkt; + bus_dmamap_trndis_pkt_dmap; }; #define HN_TXD_FLAG_ONLIST 0x1 @@ -845,6 +845,15 @@ netvsc_channel_rollup(struct hn_rx_ring hn_txeof(txr); } +static __inline uint32_t +hn_rndis_pktmsg_offset(uint32_t ofs) +{ + + KASSERT(ofs >= sizeof(struct rndis_packet_msg), + ("invalid RNDIS packet msg offset %u", ofs)); + return (ofs - __offsetof(struct rndis_packet_msg, rm_dataoffset)); +} + /* * NOTE: * If this function fails, then both txd and m_head0 will be freed. @@ -855,14 +864,11 @@ hn_encap(struct hn_tx_ring *txr, struct bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX]; int error, nsegs, i; struct mbuf *m_head = *m_head0; - rndis_msg *rndis_mesg; - rndis_packet *rndis_pkt; + struct rndis_packet_msg *pkt; rndis_per_packet_info *rppi; struct rndis_hash_value *hash_value; - uint32_t rndis_msg_size, tot_data_buf_len, send_buf_section_idx; - int send_buf_section_size; - - tot_data_buf_len = m_head->m_pkthdr.len; + uint32_t send_buf_section_idx; + int send_buf_section_size, pktlen; /* * extension points to the area reserved for the @@ -870,25 +876,20 @@ hn_encap(struct hn_tx_ring *txr, struct * the netvsc_packet (and rppi struct, if present; * length is updated later). */ - rndis_mesg = txd->rndis_msg; - /* XXX not necessary */ - memset(rndis_mesg, 0, HN_RNDIS_MSG_LEN); - rndis_mesg->ndis_msg_type = REMOTE_NDIS_PACKET_MSG; - - rndis_pkt = &rndis_mesg->msg.packet; - rndis_pkt->data_offset = sizeof(rndis_packet); - rndis_pkt->data_length = tot_data_buf_len; - rndis_pkt->per_pkt_info_offset = sizeof(rndis_packet); - - rndis_msg_size = RNDIS_MESSAGE_SIZE(rndis_packet); + pkt = txd->rndis_pkt; + pkt->rm_type = REMOTE_NDIS_PACKET_MSG; + pkt->rm_len = sizeof(*pkt) + m_head->m_pkthdr.len; + pkt->rm_dataoffset = sizeof(*pkt); + pkt->rm_datalen = m_head->m_pkthdr.len; + pkt->rm_pktinfooffset = sizeof(*pkt); + pkt->rm_pktinfolen = 0; /* * Set the hash value for this packet, so that the host could * dispatch the TX done event for this packet back to this TX * ring's channel. */ - rndis_msg_size += RNDIS_HASHVAL_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_HASHVAL_PPI_SIZE, + rppi = hv_set_rppi_data(pkt, RNDIS_HASHVAL_PPI_SIZE, nbl_hash_value); hash_value = (struct rndis_hash_value *)((uint8_t *)rppi + rppi->per_packet_info_offset); @@ -897,8 +898,7 @@ hn_encap(struct hn_tx_ring *txr, struct if (m_head->m_flags & M_VLANTAG) { ndis_8021q_info *rppi_vlan_info; - rndis_msg_size += RNDIS_VLAN_PPI_SIZE; - rppi = hv_set_rppi_data(rndis_mesg, RNDIS_VLAN_PPI_SIZE, + rppi = hv_set_rppi_data(pkt, RNDIS_VLAN_PPI_SIZE, ieee_8021q_info); rppi_vlan_info = (ndis_8021q_info *)((uint8_t *)rppi + @@ -924,8 +924,7 @@ hn_encap(struct hn_tx_ring *txr, struct else
svn commit: r305525 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Sep 7 06:02:29 2016 New Revision: 305525 URL: https://svnweb.freebsd.org/changeset/base/305525 Log: hyperv/hn: Simplify per-packet-info construction. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7794 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 05:41:01 2016(r305524) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Sep 7 06:02:29 2016(r305525) @@ -142,12 +142,12 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX8 -#define HN_RNDIS_PKT_LEN \ -(sizeof(struct rndis_packet_msg) + \ - RNDIS_HASHVAL_PPI_SIZE + \ - RNDIS_VLAN_PPI_SIZE + \ - RNDIS_TSO_PPI_SIZE + \ - RNDIS_CSUM_PPI_SIZE) +#define HN_RNDIS_PKT_LEN \ + (sizeof(struct rndis_packet_msg) + \ +HN_RNDIS_PKTINFO_SIZE(HN_NDIS_HASH_VALUE_SIZE) + \ +HN_RNDIS_PKTINFO_SIZE(NDIS_VLAN_INFO_SIZE) + \ +HN_RNDIS_PKTINFO_SIZE(NDIS_LSO2_INFO_SIZE) + \ +HN_RNDIS_PKTINFO_SIZE(NDIS_TXCSUM_INFO_SIZE)) #define HN_RNDIS_PKT_BOUNDARY PAGE_SIZE #define HN_RNDIS_PKT_ALIGN CACHE_LINE_SIZE @@ -865,10 +865,9 @@ hn_encap(struct hn_tx_ring *txr, struct int error, nsegs, i; struct mbuf *m_head = *m_head0; struct rndis_packet_msg *pkt; - rndis_per_packet_info *rppi; - struct rndis_hash_value *hash_value; uint32_t send_buf_section_idx; int send_buf_section_size, pktlen; + uint32_t *pi_data; /* * extension points to the area reserved for the @@ -889,21 +888,14 @@ hn_encap(struct hn_tx_ring *txr, struct * dispatch the TX done event for this packet back to this TX * ring's channel. */ - rppi = hv_set_rppi_data(pkt, RNDIS_HASHVAL_PPI_SIZE, - nbl_hash_value); - hash_value = (struct rndis_hash_value *)((uint8_t *)rppi + - rppi->per_packet_info_offset); - hash_value->hash_value = txr->hn_tx_idx; + pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, + HN_NDIS_HASH_VALUE_SIZE, HN_NDIS_PKTINFO_TYPE_HASHVAL); + *pi_data = txr->hn_tx_idx; if (m_head->m_flags & M_VLANTAG) { - ndis_8021q_info *rppi_vlan_info; - - rppi = hv_set_rppi_data(pkt, RNDIS_VLAN_PPI_SIZE, - ieee_8021q_info); - - rppi_vlan_info = (ndis_8021q_info *)((uint8_t *)rppi + - rppi->per_packet_info_offset); - rppi_vlan_info->u1.value = NDIS_VLAN_INFO_MAKE( + pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, + NDIS_VLAN_INFO_SIZE, NDIS_PKTINFO_TYPE_VLAN); + *pi_data = NDIS_VLAN_INFO_MAKE( EVL_VLANOFTAG(m_head->m_pkthdr.ether_vtag), EVL_PRIOFTAG(m_head->m_pkthdr.ether_vtag), EVL_CFIOFTAG(m_head->m_pkthdr.ether_vtag)); @@ -911,7 +903,6 @@ hn_encap(struct hn_tx_ring *txr, struct if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { #if defined(INET6) || defined(INET) - rndis_tcp_tso_info *tso_info; struct ether_vlan_header *eh; int ether_len; @@ -924,12 +915,8 @@ hn_encap(struct hn_tx_ring *txr, struct else ether_len = ETHER_HDR_LEN; - rppi = hv_set_rppi_data(pkt, RNDIS_TSO_PPI_SIZE, - tcp_large_send_info); - - tso_info = (rndis_tcp_tso_info *)((uint8_t *)rppi + - rppi->per_packet_info_offset); - + pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, + NDIS_LSO2_INFO_SIZE, NDIS_PKTINFO_TYPE_LSO); #ifdef INET if (m_head->m_pkthdr.csum_flags & CSUM_IP_TSO) { struct ip *ip = @@ -942,7 +929,7 @@ hn_encap(struct hn_tx_ring *txr, struct ip->ip_sum = 0; th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - tso_info->value = NDIS_LSO2_INFO_MAKEIPV4(0, + *pi_data = NDIS_LSO2_INFO_MAKEIPV4(0, m_head->m_pkthdr.tso_segsz); } #endif @@ -957,27 +944,23 @@ hn_encap(struct hn_tx_ring *txr, struct ip6->ip6_plen = 0; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPR