From owner-svn-src-stable-11@freebsd.org Mon Oct 22 07:04:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919C8FEC2FE; Mon, 22 Oct 2018 07:04:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47E228BC56; Mon, 22 Oct 2018 07:04:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E69F18F28; Mon, 22 Oct 2018 07:04:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9M74jkG082626; Mon, 22 Oct 2018 07:04:45 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9M74jKS082625; Mon, 22 Oct 2018 07:04:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201810220704.w9M74jKS082625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 22 Oct 2018 07:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339580 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 339580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2018 07:04:45 -0000 Author: ae Date: Mon Oct 22 07:04:44 2018 New Revision: 339580 URL: https://svnweb.freebsd.org/changeset/base/339580 Log: MFC r339357: Add extra parentheses to fix "versrcreach" opcode, (oif != NULL) should not be used as condition for ternary operator. Submitted by: Tatsuki Makino Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Mon Oct 22 06:44:20 2018 (r339579) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Mon Oct 22 07:04:44 2018 (r339580) @@ -2353,13 +2353,13 @@ do { \ case O_VERSRCREACH: /* Outgoing packets automatically pass/match */ - match = (hlen > 0 && ((oif != NULL) || + match = (hlen > 0 && ((oif != NULL) || ( #ifdef INET6 is_ipv6 ? verify_path6(&(args->f_id.src_ip6), NULL, args->f_id.fib) : #endif - verify_path(src_ip, NULL, args->f_id.fib))); + verify_path(src_ip, NULL, args->f_id.fib)))); break; case O_ANTISPOOF: From owner-svn-src-stable-11@freebsd.org Mon Oct 22 15:54:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 229691036598; Mon, 22 Oct 2018 15:54:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC08281223; Mon, 22 Oct 2018 15:54:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82DA1E6C7; Mon, 22 Oct 2018 15:54:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MFsS0k054157; Mon, 22 Oct 2018 15:54:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MFsS1u054156; Mon, 22 Oct 2018 15:54:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810221554.w9MFsS1u054156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 22 Oct 2018 15:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339597 - stable/11/sys/contrib/ck/include X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/contrib/ck/include X-SVN-Commit-Revision: 339597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2018 15:54:29 -0000 Author: avg Date: Mon Oct 22 15:54:28 2018 New Revision: 339597 URL: https://svnweb.freebsd.org/changeset/base/339597 Log: MFC r334189: Import CK as of commit 0f017230ccc86929f56bf44ef2dca93d7df8076b This brings us the renaming of fields in ck_queue, so that our own LIST/SLIST/TAILQ/etc won't accidentally work with them. Modified: stable/11/sys/contrib/ck/include/ck_queue.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ck/include/ck_queue.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_queue.h Mon Oct 22 15:48:07 2018 (r339596) +++ stable/11/sys/contrib/ck/include/ck_queue.h Mon Oct 22 15:54:28 2018 (r339597) @@ -125,7 +125,7 @@ */ #define CK_SLIST_HEAD(name, type) \ struct name { \ - struct type *slh_first; /* first element */ \ + struct type *cslh_first; /* first element */ \ } #define CK_SLIST_HEAD_INITIALIZER(head) \ @@ -133,20 +133,20 @@ struct name { \ #define CK_SLIST_ENTRY(type) \ struct { \ - struct type *sle_next; /* next element */ \ + struct type *csle_next; /* next element */ \ } /* * Singly-linked List functions. */ #define CK_SLIST_EMPTY(head) \ - (ck_pr_load_ptr(&(head)->slh_first) == NULL) + (ck_pr_load_ptr(&(head)->cslh_first) == NULL) #define CK_SLIST_FIRST(head) \ - (ck_pr_load_ptr(&(head)->slh_first)) + (ck_pr_load_ptr(&(head)->cslh_first)) #define CK_SLIST_NEXT(elm, field) \ - ck_pr_load_ptr(&((elm)->field.sle_next)) + ck_pr_load_ptr(&((elm)->field.csle_next)) #define CK_SLIST_FOREACH(var, head, field) \ for ((var) = CK_SLIST_FIRST((head)); \ @@ -159,59 +159,59 @@ struct { \ (var) = (tvar)) #define CK_SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &(head)->slh_first; \ + for ((varp) = &(head)->cslh_first; \ ((var) = ck_pr_load_ptr(varp)) != NULL && (ck_pr_fence_load(), 1); \ - (varp) = &(var)->field.sle_next) + (varp) = &(var)->field.csle_next) #define CK_SLIST_INIT(head) do { \ - ck_pr_store_ptr(&(head)->slh_first, NULL); \ + ck_pr_store_ptr(&(head)->cslh_first, NULL); \ ck_pr_fence_store(); \ } while (0) #define CK_SLIST_INSERT_AFTER(a, b, field) do { \ - (b)->field.sle_next = (a)->field.sle_next; \ + (b)->field.csle_next = (a)->field.csle_next; \ ck_pr_fence_store(); \ - ck_pr_store_ptr(&(a)->field.sle_next, b); \ + ck_pr_store_ptr(&(a)->field.csle_next, b); \ } while (0) #define CK_SLIST_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.sle_next = (head)->slh_first; \ + (elm)->field.csle_next = (head)->cslh_first; \ ck_pr_fence_store(); \ - ck_pr_store_ptr(&(head)->slh_first, elm); \ + ck_pr_store_ptr(&(head)->cslh_first, elm); \ } while (0) #define CK_SLIST_REMOVE_AFTER(elm, field) do { \ - ck_pr_store_ptr(&(elm)->field.sle_next, \ - (elm)->field.sle_next->field.sle_next); \ + ck_pr_store_ptr(&(elm)->field.csle_next, \ + (elm)->field.csle_next->field.csle_next); \ } while (0) #define CK_SLIST_REMOVE(head, elm, type, field) do { \ - if ((head)->slh_first == (elm)) { \ + if ((head)->cslh_first == (elm)) { \ CK_SLIST_REMOVE_HEAD((head), field); \ } else { \ - struct type *curelm = (head)->slh_first; \ - while (curelm->field.sle_next != (elm)) \ - curelm = curelm->field.sle_next; \ + struct type *curelm = (head)->cslh_first; \ + while (curelm->field.csle_next != (elm)) \ + curelm = curelm->field.csle_next; \ CK_SLIST_REMOVE_AFTER(curelm, field); \ } \ } while (0) #define CK_SLIST_REMOVE_HEAD(head, field) do { \ - ck_pr_store_ptr(&(head)->slh_first, \ - (head)->slh_first->field.sle_next); \ + ck_pr_store_ptr(&(head)->cslh_first, \ + (head)->cslh_first->field.csle_next); \ } while (0) #define CK_SLIST_MOVE(head1, head2, field) do { \ - ck_pr_store_ptr(&(head1)->slh_first, (head2)->slh_first); \ + ck_pr_store_ptr(&(head1)->cslh_first, (head2)->cslh_first); \ } while (0) /* * This operation is not applied atomically. */ #define CK_SLIST_SWAP(a, b, type) do { \ - struct type *swap_first = (a)->slh_first; \ - (a)->slh_first = (b)->slh_first; \ - (b)->slh_first = swap_first; \ + struct type *swap_first = (a)->cslh_first; \ + (a)->cslh_first = (b)->cslh_first; \ + (b)->cslh_first = swap_first; \ } while (0) /* @@ -219,33 +219,33 @@ struct { \ */ #define CK_STAILQ_HEAD(name, type) \ struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ + struct type *cstqh_first;/* first element */ \ + struct type **cstqh_last;/* addr of last next element */ \ } #define CK_STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } + { NULL, &(head).cstqh_first } #define CK_STAILQ_ENTRY(type) \ struct { \ - struct type *stqe_next; /* next element */ \ + struct type *cstqe_next; /* next element */ \ } /* * Singly-linked Tail queue functions. */ #define CK_STAILQ_CONCAT(head1, head2) do { \ - if ((head2)->stqh_first != NULL) { \ - ck_pr_store_ptr((head1)->stqh_last, (head2)->stqh_first); \ + if ((head2)->cstqh_first != NULL) { \ + ck_pr_store_ptr((head1)->cstqh_last, (head2)->cstqh_first); \ ck_pr_fence_store(); \ - (head1)->stqh_last = (head2)->stqh_last; \ + (head1)->cstqh_last = (head2)->cstqh_last; \ CK_STAILQ_INIT((head2)); \ } \ } while (0) -#define CK_STAILQ_EMPTY(head) (ck_pr_load_ptr(&(head)->stqh_first) == NULL) +#define CK_STAILQ_EMPTY(head) (ck_pr_load_ptr(&(head)->cstqh_first) == NULL) -#define CK_STAILQ_FIRST(head) (ck_pr_load_ptr(&(head)->stqh_first)) +#define CK_STAILQ_FIRST(head) (ck_pr_load_ptr(&(head)->cstqh_first)) #define CK_STAILQ_FOREACH(var, head, field) \ for((var) = CK_STAILQ_FIRST((head)); \ @@ -259,67 +259,67 @@ struct { \ (var) = (tvar)) #define CK_STAILQ_INIT(head) do { \ - ck_pr_store_ptr(&(head)->stqh_first, NULL); \ + ck_pr_store_ptr(&(head)->cstqh_first, NULL); \ ck_pr_fence_store(); \ - (head)->stqh_last = &(head)->stqh_first; \ + (head)->cstqh_last = &(head)->cstqh_first; \ } while (0) #define CK_STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - (elm)->field.stqe_next = (tqelm)->field.stqe_next; \ + (elm)->field.cstqe_next = (tqelm)->field.cstqe_next; \ ck_pr_fence_store(); \ - ck_pr_store_ptr(&(tqelm)->field.stqe_next, elm); \ - if ((elm)->field.stqe_next == NULL) \ - (head)->stqh_last = &(elm)->field.stqe_next; \ + ck_pr_store_ptr(&(tqelm)->field.cstqe_next, elm); \ + if ((elm)->field.cstqe_next == NULL) \ + (head)->cstqh_last = &(elm)->field.cstqe_next; \ } while (0) #define CK_STAILQ_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.stqe_next = (head)->stqh_first; \ + (elm)->field.cstqe_next = (head)->cstqh_first; \ ck_pr_fence_store(); \ - ck_pr_store_ptr(&(head)->stqh_first, elm); \ - if ((elm)->field.stqe_next == NULL) \ - (head)->stqh_last = &(elm)->field.stqe_next; \ + ck_pr_store_ptr(&(head)->cstqh_first, elm); \ + if ((elm)->field.cstqe_next == NULL) \ + (head)->cstqh_last = &(elm)->field.cstqe_next; \ } while (0) #define CK_STAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.stqe_next = NULL; \ + (elm)->field.cstqe_next = NULL; \ ck_pr_fence_store(); \ - ck_pr_store_ptr((head)->stqh_last, (elm)); \ - (head)->stqh_last = &(elm)->field.stqe_next; \ + ck_pr_store_ptr((head)->cstqh_last, (elm)); \ + (head)->cstqh_last = &(elm)->field.cstqe_next; \ } while (0) #define CK_STAILQ_NEXT(elm, field) \ - (ck_pr_load_ptr(&(elm)->field.stqe_next)) + (ck_pr_load_ptr(&(elm)->field.cstqe_next)) #define CK_STAILQ_REMOVE(head, elm, type, field) do { \ - if ((head)->stqh_first == (elm)) { \ + if ((head)->cstqh_first == (elm)) { \ CK_STAILQ_REMOVE_HEAD((head), field); \ } else { \ - struct type *curelm = (head)->stqh_first; \ - while (curelm->field.stqe_next != (elm)) \ - curelm = curelm->field.stqe_next; \ + struct type *curelm = (head)->cstqh_first; \ + while (curelm->field.cstqe_next != (elm)) \ + curelm = curelm->field.cstqe_next; \ CK_STAILQ_REMOVE_AFTER(head, curelm, field); \ } \ } while (0) #define CK_STAILQ_REMOVE_AFTER(head, elm, field) do { \ - ck_pr_store_ptr(&(elm)->field.stqe_next, \ - (elm)->field.stqe_next->field.stqe_next); \ - if ((elm)->field.stqe_next == NULL) \ - (head)->stqh_last = &(elm)->field.stqe_next; \ + ck_pr_store_ptr(&(elm)->field.cstqe_next, \ + (elm)->field.cstqe_next->field.cstqe_next); \ + if ((elm)->field.cstqe_next == NULL) \ + (head)->cstqh_last = &(elm)->field.cstqe_next; \ } while (0) #define CK_STAILQ_REMOVE_HEAD(head, field) do { \ - ck_pr_store_ptr(&(head)->stqh_first, \ - (head)->stqh_first->field.stqe_next); \ - if ((head)->stqh_first == NULL) \ - (head)->stqh_last = &(head)->stqh_first; \ + ck_pr_store_ptr(&(head)->cstqh_first, \ + (head)->cstqh_first->field.cstqe_next); \ + if ((head)->cstqh_first == NULL) \ + (head)->cstqh_last = &(head)->cstqh_first; \ } while (0) #define CK_STAILQ_MOVE(head1, head2, field) do { \ - ck_pr_store_ptr(&(head1)->stqh_first, (head2)->stqh_first); \ - (head1)->stqh_last = (head2)->stqh_last; \ - if ((head2)->stqh_last == &(head2)->stqh_first) \ - (head1)->stqh_last = &(head1)->stqh_first; \ + ck_pr_store_ptr(&(head1)->cstqh_first, (head2)->cstqh_first); \ + (head1)->cstqh_last = (head2)->cstqh_last; \ + if ((head2)->cstqh_last == &(head2)->cstqh_first) \ + (head1)->cstqh_last = &(head1)->cstqh_first; \ } while (0) /* @@ -327,15 +327,15 @@ struct { \ */ #define CK_STAILQ_SWAP(head1, head2, type) do { \ struct type *swap_first = CK_STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ + struct type **swap_last = (head1)->cstqh_last; \ CK_STAILQ_FIRST(head1) = CK_STAILQ_FIRST(head2); \ - (head1)->stqh_last = (head2)->stqh_last; \ + (head1)->cstqh_last = (head2)->cstqh_last; \ CK_STAILQ_FIRST(head2) = swap_first; \ - (head2)->stqh_last = swap_last; \ + (head2)->cstqh_last = swap_last; \ if (CK_STAILQ_EMPTY(head1)) \ - (head1)->stqh_last = &(head1)->stqh_first; \ + (head1)->cstqh_last = &(head1)->cstqh_first; \ if (CK_STAILQ_EMPTY(head2)) \ - (head2)->stqh_last = &(head2)->stqh_first; \ + (head2)->cstqh_last = &(head2)->cstqh_first; \ } while (0) /* @@ -343,7 +343,7 @@ struct { \ */ #define CK_LIST_HEAD(name, type) \ struct name { \ - struct type *lh_first; /* first element */ \ + struct type *clh_first; /* first element */ \ } #define CK_LIST_HEAD_INITIALIZER(head) \ @@ -351,13 +351,13 @@ struct name { \ #define CK_LIST_ENTRY(type) \ struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ + struct type *cle_next; /* next element */ \ + struct type **cle_prev; /* address of previous next element */ \ } -#define CK_LIST_FIRST(head) ck_pr_load_ptr(&(head)->lh_first) +#define CK_LIST_FIRST(head) ck_pr_load_ptr(&(head)->clh_first) #define CK_LIST_EMPTY(head) (CK_LIST_FIRST(head) == NULL) -#define CK_LIST_NEXT(elm, field) ck_pr_load_ptr(&(elm)->field.le_next) +#define CK_LIST_NEXT(elm, field) ck_pr_load_ptr(&(elm)->field.cle_next) #define CK_LIST_FOREACH(var, head, field) \ for ((var) = CK_LIST_FIRST((head)); \ @@ -370,59 +370,59 @@ struct { \ (var) = (tvar)) #define CK_LIST_INIT(head) do { \ - ck_pr_store_ptr(&(head)->lh_first, NULL); \ + ck_pr_store_ptr(&(head)->clh_first, NULL); \ ck_pr_fence_store(); \ } while (0) #define CK_LIST_INSERT_AFTER(listelm, elm, field) do { \ - (elm)->field.le_next = (listelm)->field.le_next; \ - (elm)->field.le_prev = &(listelm)->field.le_next; \ + (elm)->field.cle_next = (listelm)->field.cle_next; \ + (elm)->field.cle_prev = &(listelm)->field.cle_next; \ ck_pr_fence_store(); \ - if ((listelm)->field.le_next != NULL) \ - (listelm)->field.le_next->field.le_prev = &(elm)->field.le_next;\ - ck_pr_store_ptr(&(listelm)->field.le_next, elm); \ + if ((listelm)->field.cle_next != NULL) \ + (listelm)->field.cle_next->field.cle_prev = &(elm)->field.cle_next;\ + ck_pr_store_ptr(&(listelm)->field.cle_next, elm); \ } while (0) #define CK_LIST_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - (elm)->field.le_next = (listelm); \ + (elm)->field.cle_prev = (listelm)->field.cle_prev; \ + (elm)->field.cle_next = (listelm); \ ck_pr_fence_store(); \ - ck_pr_store_ptr((listelm)->field.le_prev, (elm)); \ - (listelm)->field.le_prev = &(elm)->field.le_next; \ + ck_pr_store_ptr((listelm)->field.cle_prev, (elm)); \ + (listelm)->field.cle_prev = &(elm)->field.cle_next; \ } while (0) #define CK_LIST_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.le_next = (head)->lh_first; \ + (elm)->field.cle_next = (head)->clh_first; \ ck_pr_fence_store(); \ - if ((elm)->field.le_next != NULL) \ - (head)->lh_first->field.le_prev = &(elm)->field.le_next; \ - ck_pr_store_ptr(&(head)->lh_first, elm); \ - (elm)->field.le_prev = &(head)->lh_first; \ + if ((elm)->field.cle_next != NULL) \ + (head)->clh_first->field.cle_prev = &(elm)->field.cle_next; \ + ck_pr_store_ptr(&(head)->clh_first, elm); \ + (elm)->field.cle_prev = &(head)->clh_first; \ } while (0) #define CK_LIST_REMOVE(elm, field) do { \ - ck_pr_store_ptr((elm)->field.le_prev, (elm)->field.le_next); \ - if ((elm)->field.le_next != NULL) \ - (elm)->field.le_next->field.le_prev = (elm)->field.le_prev; \ + ck_pr_store_ptr((elm)->field.cle_prev, (elm)->field.cle_next); \ + if ((elm)->field.cle_next != NULL) \ + (elm)->field.cle_next->field.cle_prev = (elm)->field.cle_prev; \ } while (0) #define CK_LIST_MOVE(head1, head2, field) do { \ - ck_pr_store_ptr(&(head1)->lh_first, (head2)->lh_first); \ - if ((head1)->lh_first != NULL) \ - (head1)->lh_first->field.le_prev = &(head1)->lh_first; \ + ck_pr_store_ptr(&(head1)->clh_first, (head2)->clh_first); \ + if ((head1)->clh_first != NULL) \ + (head1)->clh_first->field.cle_prev = &(head1)->clh_first; \ } while (0) /* * This operation is not applied atomically. */ #define CK_LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = (head1)->lh_first; \ - (head1)->lh_first = (head2)->lh_first; \ - (head2)->lh_first = swap_tmp; \ - if ((swap_tmp = (head1)->lh_first) != NULL) \ - swap_tmp->field.le_prev = &(head1)->lh_first; \ - if ((swap_tmp = (head2)->lh_first) != NULL) \ - swap_tmp->field.le_prev = &(head2)->lh_first; \ + struct type *swap_tmp = (head1)->clh_first; \ + (head1)->clh_first = (head2)->clh_first; \ + (head2)->clh_first = swap_tmp; \ + if ((swap_tmp = (head1)->clh_first) != NULL) \ + swap_tmp->field.cle_prev = &(head1)->clh_first; \ + if ((swap_tmp = (head2)->clh_first) != NULL) \ + swap_tmp->field.cle_prev = &(head2)->clh_first; \ } while (0) #endif /* CK_QUEUE_H */ From owner-svn-src-stable-11@freebsd.org Mon Oct 22 21:26:38 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63ADCFD7675; Mon, 22 Oct 2018 21:26:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1991974ED2; Mon, 22 Oct 2018 21:26:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFE8425E92; Mon, 22 Oct 2018 21:26:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9MLQbeo029137; Mon, 22 Oct 2018 21:26:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9MLQbSt029136; Mon, 22 Oct 2018 21:26:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201810222126.w9MLQbSt029136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Oct 2018 21:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339621 - stable/11/usr.bin/vmstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.bin/vmstat X-SVN-Commit-Revision: 339621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2018 21:26:38 -0000 Author: jhb Date: Mon Oct 22 21:26:37 2018 New Revision: 339621 URL: https://svnweb.freebsd.org/changeset/base/339621 Log: MFC 338094: Fully retire the unimplemented -t option from vmstat(8). It was #ifdef'd out in the 4.4BSD import and hasn't been re-enabled since then. Modified: stable/11/usr.bin/vmstat/vmstat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/11/usr.bin/vmstat/vmstat.c Mon Oct 22 21:25:28 2018 (r339620) +++ stable/11/usr.bin/vmstat/vmstat.c Mon Oct 22 21:26:37 2018 (r339621) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); static char da[] = "da"; enum x_stats { X_SUM, X_HZ, X_STATHZ, X_NCHSTATS, X_INTRNAMES, X_SINTRNAMES, - X_INTRCNT, X_SINTRCNT, X_DEFICIT, X_REC, X_PGIN, X_XSTATS }; + X_INTRCNT, X_SINTRCNT }; static struct nlist namelist[] = { [X_SUM] = { .n_name = "_vm_cnt", }, @@ -94,12 +94,6 @@ static struct nlist namelist[] = { [X_SINTRNAMES] = { .n_name = "_sintrnames", }, [X_INTRCNT] = { .n_name = "_intrcnt", }, [X_SINTRCNT] = { .n_name = "_sintrcnt", }, -#ifdef notyet - [X_DEFICIT] = { .n_name = "_deficit", }, - [X_REC] = { .n_name = "_rectime", }, - [X_PGIN] = { .n_name = "_pgintime", }, - [X_XSTATS] = { .n_name = "_xstats", }, -#endif { .n_name = NULL, }, }; @@ -178,7 +172,7 @@ main(int argc, char *argv[]) if (argc < 0) return (argc); - while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:stw:z")) != -1) { + while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:sw:z")) != -1) { switch (c) { case 'a': aflag++; @@ -228,14 +222,6 @@ main(int argc, char *argv[]) case 's': todo |= SUMSTAT; break; - case 't': -#ifdef notyet - todo |= TIMESTAT; -#else - xo_errx(EX_USAGE, - "sorry, -t is not (re)implemented yet"); -#endif - break; case 'w': /* Convert to milliseconds. */ f = atof(optarg); @@ -339,10 +325,6 @@ retry_nlist: dosum(); if (todo & OBJSTAT) doobjstat(); -#ifdef notyet - if (todo & TIMESTAT) - dotimes(); -#endif if (todo & INTRSTAT) dointr(interval, reps); if (todo & VMSTAT) @@ -954,29 +936,6 @@ doresize(void) */ wresized = 0; } - -#ifdef notyet -static void -dotimes(void) -{ - unsigned int pgintime, rectime; - - kread(X_REC, &rectime, sizeof(rectime)); - kread(X_PGIN, &pgintime, sizeof(pgintime)); - kread(X_SUM, &sum, sizeof(sum)); - xo_emit("{:page-reclaims/%u} {N:reclaims}, " - "{:reclaim-time/%u} {N:total time (usec)}\n", - sum.v_pgrec, rectime); - xo_emit("{L:average}: {:reclaim-average/%u} {N:usec \\/ reclaim}\n", - rectime / sum.v_pgrec); - xo_emit("\n"); - xo_emit("{:page-ins/%u} {N:page ins}, " - "{:page-in-time/%u} {N:total time (msec)}\n", - sum.v_pgin, pgintime / 10); - xo_emit("{L:average}: {:average/%8.1f} {N:msec \\/ page in}\n", - pgintime / (sum.v_pgin * 10.0)); -} -#endif static long pct(long top, long bot) From owner-svn-src-stable-11@freebsd.org Tue Oct 23 01:41:08 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D8BFF0875; Tue, 23 Oct 2018 01:41:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1179D80452; Tue, 23 Oct 2018 01:41:08 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6555BCD; Tue, 23 Oct 2018 01:41:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N1f7FT059607; Tue, 23 Oct 2018 01:41:07 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N1f7gq059604; Tue, 23 Oct 2018 01:41:07 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201810230141.w9N1f7gq059604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 23 Oct 2018 01:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339630 - stable/11/contrib/tzdata X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/contrib/tzdata X-SVN-Commit-Revision: 339630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 01:41:08 -0000 Author: philip Date: Tue Oct 23 01:41:07 2018 New Revision: 339630 URL: https://svnweb.freebsd.org/changeset/base/339630 Log: MFC r339503: Import tzdata 2018f Modified: stable/11/contrib/tzdata/CONTRIBUTING stable/11/contrib/tzdata/Makefile stable/11/contrib/tzdata/NEWS stable/11/contrib/tzdata/README stable/11/contrib/tzdata/africa stable/11/contrib/tzdata/antarctica stable/11/contrib/tzdata/asia stable/11/contrib/tzdata/australasia stable/11/contrib/tzdata/backward stable/11/contrib/tzdata/backzone stable/11/contrib/tzdata/etcetera stable/11/contrib/tzdata/europe stable/11/contrib/tzdata/factory stable/11/contrib/tzdata/leap-seconds.list stable/11/contrib/tzdata/leapseconds stable/11/contrib/tzdata/leapseconds.awk stable/11/contrib/tzdata/northamerica stable/11/contrib/tzdata/pacificnew stable/11/contrib/tzdata/southamerica stable/11/contrib/tzdata/systemv stable/11/contrib/tzdata/theory.html stable/11/contrib/tzdata/version stable/11/contrib/tzdata/yearistype.sh stable/11/contrib/tzdata/zishrink.awk stable/11/contrib/tzdata/zone.tab stable/11/contrib/tzdata/zone1970.tab stable/11/contrib/tzdata/zoneinfo2tdf.pl Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tzdata/CONTRIBUTING ============================================================================== --- stable/11/contrib/tzdata/CONTRIBUTING Tue Oct 23 01:39:26 2018 (r339629) +++ stable/11/contrib/tzdata/CONTRIBUTING Tue Oct 23 01:41:07 2018 (r339630) @@ -17,11 +17,14 @@ To email small changes, please run a POSIX shell comma 'diff -u old/europe new/europe >myfix.patch', and attach myfix.patch to the email. -For more-elaborate changes, please read the theory.html file and browse -the mailing list archives for -examples of patches that tend to work well. Additions to -data should contain commentary citing reliable sources as -justification. Citations should use https: URLs if available. +For more-elaborate or possibly-controversial changes, +such as renaming, adding or removing zones, please read + or the file +theory.html. It is also good to browse the mailing list archives + for examples of patches that tend +to work well. Additions to data should contain commentary citing +reliable sources as justification. Citations should use https: URLs +if available. Please submit changes against either the latest release in or the master branch of the development Modified: stable/11/contrib/tzdata/Makefile ============================================================================== --- stable/11/contrib/tzdata/Makefile Tue Oct 23 01:39:26 2018 (r339629) +++ stable/11/contrib/tzdata/Makefile Tue Oct 23 01:41:07 2018 (r339630) @@ -1,3 +1,5 @@ +# Make and install tzdb code and data. + # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -19,9 +21,9 @@ BUGEMAIL= tz@iana.org # DATAFORM= rearguard DATAFORM= main -# Change the line below for your time zone (after finding the zone you want in -# the time zone files, or adding it to a time zone file). -# Alternatively, if you discover you've got the wrong time zone, you can just +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just # zic -l rightzone # to correct things. # Use the command @@ -31,14 +33,14 @@ DATAFORM= main LOCALTIME= GMT # If you want something other than Eastern United States time as a template -# for handling POSIX-style time zone environment variables, -# change the line below (after finding the zone you want in the -# time zone files, or adding it to a time zone file). +# for handling POSIX-style timezone environment variables, +# change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). # When a POSIX-style environment variable is handled, the rules in the # template file are used to determine "spring forward" and "fall back" days and # times; the environment variable itself specifies UT offsets of standard and # daylight saving time. -# Alternatively, if you discover you've got the wrong time zone, you can just +# Alternatively, if you discover you've got the wrong timezone, you can just # zic -p rightzone # to correct things. # Use the command @@ -75,7 +77,7 @@ DESTDIR = # TOPDIR should be empty or an absolute name unless you're just testing. TOPDIR = -# The default local time zone is taken from the file TZDEFAULT. +# The default local timezone is taken from the file TZDEFAULT. TZDEFAULT = $(TOPDIR)/etc/localtime # The subdirectory containing installed program and data files, and @@ -84,7 +86,7 @@ TZDEFAULT = $(TOPDIR)/etc/localtime USRDIR = usr USRSHAREDIR = $(USRDIR)/share -# "Compiled" time zone information is placed in the "TZDIR" directory +# "Compiled" timezone information is placed in the "TZDIR" directory # (and subdirectories). # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. TZDIR_BASENAME= zoneinfo @@ -106,9 +108,13 @@ MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man LIBDIR = $(TOPDIR)/$(USRDIR)/lib -# Types to try, as an alternative to time_t. int64_t should be first. -TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) +TIME_T_ALTERNATIVES_HEAD = int64_t +TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t +# What kind of TZif data files to generate. +# (TZif is the binary time zone data format that zic generates.) # If you want only POSIX time, with time values interpreted as # seconds since the epoch (not counting leap seconds), use # REDO= posix_only @@ -129,7 +135,7 @@ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_ REDO= posix_right -# To install data in text form that has all the information of the binary data, +# To install data in text form that has all the information of the TZif data, # (optionally incorporating leap second information), use # TZDATA_TEXT= tzdata.zi leapseconds # To install text data without leap second information (e.g., because @@ -171,7 +177,6 @@ LDLIBS= # Add the following to the end of the "CFLAGS=" line as needed to override # defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". -# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) # -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime # formats that generate only the last two digits of year numbers # -DEPOCH_LOCAL if the 'time' function returns local time not UT @@ -295,7 +300,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", # "posix2time", and "time2posix" to be added to the time conversion library. # "tzsetwall" is like "tzset" except that it arranges for local wall clock -# time (rather than the time specified in the TZ environment variable) +# time (rather than the timezone specified in the TZ environment variable) # to be used. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. @@ -318,7 +323,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # "posix2time_z" and "time2posix_z" are added as well. # The functions ending in "_z" (or "_rz") are like their unsuffixed # (or suffixed-by-"_r") counterparts, except with an extra first -# argument of opaque type timezone_t that specifies the time zone. +# argument of opaque type timezone_t that specifies the timezone. # "tzalloc" allocates a timezone_t value, and "tzfree" frees it. # # If you want to allocate state structures in localtime, add @@ -357,11 +362,14 @@ ZIC= $(zic) $(ZFLAGS) ZFLAGS= -# How to use zic to install tz binary files. +# How to use zic to install TZif files. ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) # The name of a Posix-compliant 'awk' on your system. +# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core; +# on Ubuntu you can work around this with +# AWK= gawk AWK= awk # The full path name of a Posix-compliant shell, preferably one that supports @@ -410,10 +418,16 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' +# These characters are Latin-1, and so are likely to be displayable +# even in editors with limited character sets. +UNUSUAL_OK_LATIN_1 = «°±»½¾× +# This IPA symbol is represented in Unicode as the composition of +# U+0075 and U+032F, and U+032F is not considered alphabetic by some +# grep implementations that do not grok composition. +UNUSUAL_OK_IPA = u̯ # Non-ASCII non-letters that OK_CHAR allows, as these characters are -# useful in commentary. XEmacs 21.5.34 displays them correctly, -# presumably because they are Latin-1. -UNUSUAL_OK_CHARSET= °±½¾× +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA) # OK_CHAR matches any character allowed in the distributed files. # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and @@ -492,11 +506,14 @@ AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.a ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) TZS= to$(TZS_YEAR).tzs TZS_NEW= to$(TZS_YEAR)new.tzs TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ private.h tzfile.h zdump.c zic.c -ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) # Consult these files when deciding whether to rebuild the 'version' file. # This list is not the same as the output of 'git ls-files', since @@ -560,14 +577,21 @@ version: $(VERSION_DEPS) printf '%s\n' "$$V" >$@.out mv $@.out $@ -# These files can be tailored by setting BACKWARD, PACKRATDATA, etc. +# These files can be tailored by setting BACKWARD and PACKRATDATA. vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) $(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \ $(TDATA) $(PACKRATDATA) >$@.out mv $@.out $@ -tzdata.zi: $(DATAFORM).zi version +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk version=`sed 1q version` && \ - LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \ + LC_ALL=C $(AWK) \ + -v dataform='$(DATAFORM)' \ + -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ + -v redo='$(REDO)' \ + -v version="$$version" \ + -f zishrink.awk \ $(DATAFORM).zi >$@.out mv $@.out $@ @@ -605,14 +629,16 @@ INSTALLARGS = \ YEARISTYPE='$(YEARISTYPE)' \ ZIC='$(ZIC)' -# 'make install_data' installs one set of tz binary files. -install_data: zic leapseconds yearistype tzdata.zi +INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi + +# 'make install_data' installs one set of TZif files. +install_data: $(INSTALL_DATA_DEPS) $(ZIC_INSTALL) tzdata.zi -posix_only: +posix_only: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data -right_only: +right_only: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ install_data @@ -639,7 +665,7 @@ posix_right: posix_only # This obsolescent rule is present for backwards compatibility with # tz releases 2014g through 2015g. It should go away eventually. -posix_packrat: +posix_packrat: $(INSTALL_DATA_DEPS) $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only zones: $(REDO) @@ -650,29 +676,33 @@ ZDS = dummy.zd # Rule used only by submakes invoked by the $(TZS_NEW) rule. # It is separate so that GNU 'make -j' can run instances in parallel. $(ZDS): zdump - ./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@ + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ + >$@ -$(TZS_NEW): tzdata.zi zdump zic - rm -fr tzs.dir - mkdir tzs.dir - $(zic) -d tzs.dir tzdata.zi +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ tzdata.zi | LC_ALL=C sort >$@.out wd=`pwd` && \ - set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \ + x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ | LC_ALL=C sort -t . -k 2,2` && \ + set x $$x && \ shift && \ ZDS=$$* && \ - $(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \ - sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out - rm -fr tzs.dir + $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir mv $@.out $@ -# If $(TZS) does not already exist (e.g., old-format tarballs), create it. -# If it exists but 'make check_tzs' fails, a maintainer should inspect the +# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the # failed output and fix the inconsistency, perhaps by running 'make force_tzs'. $(TZS): - $(MAKE) force_tzs + touch $@ force_tzs: $(TZS_NEW) cp $(TZS_NEW) $(TZS) @@ -711,18 +741,21 @@ check_character_set: $(ENCHILADA) $(MISC) $(SOURCES) $(WEB_PAGES) \ CONTRIBUTING LICENSE README \ version tzdata.zi && \ - ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ Makefile && \ ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ leapseconds yearistype.sh zone.tab && \ ! grep -Env $(OK_LINE) $(ENCHILADA); \ } + touch $@ check_white_space: $(ENCHILADA) patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ - ! grep -En "$$pat" $(ENCHILADA) + ! grep -En "$$pat" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) ! grep -n '[[:space:]]$$' \ $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) + touch $@ PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+ FILE_NAME_COMPONENT_TOO_LONG = \ @@ -731,6 +764,7 @@ FILE_NAME_COMPONENT_TOO_LONG = \ check_name_lengths: $(TDATA_TO_CHECK) backzone ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ $(TDATA_TO_CHECK) backzone + touch $@ CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } @@ -743,52 +777,61 @@ check_sorted: backward backzone iso3166.tab zone.tab z LC_ALL=C sort -c $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ LC_ALL=C sort -cu + touch $@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi $(AWK) -f checklinks.awk $(TDATA_TO_CHECK) $(AWK) -f checklinks.awk tzdata.zi + touch $@ check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) for tab in $(ZONETABLES); do \ $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ || exit; \ done + touch $@ check_tzs: $(TZS) $(TZS_NEW) - diff -u $(TZS) $(TZS_NEW) + if test -s $(TZS); then \ + diff -u $(TZS) $(TZS_NEW); \ + else \ + cp $(TZS_NEW) $(TZS); \ + fi + touch $@ # This checks only the HTML 4.01 strict page. # To check the the other pages, use . check_web: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html + touch $@ # Check that zishrink.awk does not alter the data, and that ziguard.awk # preserves main-format data. -check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \ - $(DATAFORM).zi tzdata.zi - for type in posix right; do \ - mkdir -p time_t.dir/$$type time_t.dir/$$type-t \ - time_t.dir/$$type-shrunk && \ - case $$type in \ - right) leap='-L leapseconds';; \ - *) leap=;; \ - esac && \ - $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \ +check_zishrink: check_zishrink_posix check_zishrink_right +check_zishrink_posix check_zishrink_right: \ + zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi + rm -fr $@.dir $@-t.dir $@-shrunk.dir + mkdir $@.dir $@-t.dir $@-shrunk.dir + case $@ in \ + *_right) leap='-L leapseconds';; \ + *) leap=;; \ + esac && \ + $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ + $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ case $(DATAFORM) in \ main) \ - $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \ + $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ $(AWK) '/^Rule/' $(TDATA) | \ - $(ZIC) $$leap -d time_t.dir/$$type-t - \ - $(PACKRATDATA) && \ - diff -r time_t.dir/$$type time_t.dir/$$type-t;; \ - esac && \ - $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \ - diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \ - done - rm -fr time_t.dir + $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ + diff -r $@.dir $@-t.dir;; \ + esac + diff -r $@.dir $@-shrunk.dir + rm -fr $@.dir $@-t.dir $@-shrunk.dir + touch $@ clean_misc: - rm -f core *.o *.out \ + rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ + check_* core typecheck_* \ date tzselect version.h zdump zic yearistype libtz.a clean: clean_misc rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW) @@ -818,17 +861,17 @@ $(MANTXTS): workman.sh LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out mv $@.out $@ -# Set the time stamps to those of the git repository, if available, +# Set the timestamps to those of the git repository, if available, # and if the files have not changed since then. # This uses GNU 'touch' syntax 'touch -d@N FILE', # where N is the number of seconds since 1970. # If git or GNU 'touch' is absent, don't bother to sync with git timestamps. # Also, set the timestamp of each prebuilt file like 'leapseconds' # to be the maximum of the files it depends on. -set-timestamps.out: $(ENCHILADA) +set-timestamps.out: $(EIGHT_YARDS) rm -f $@ if (type git) >/dev/null 2>&1 && \ - files=`git ls-files $(ENCHILADA)` && \ + files=`git ls-files $(EIGHT_YARDS)` && \ touch -md @1 test.out; then \ rm -f test.out && \ for file in $$files; do \ @@ -846,83 +889,100 @@ set-timestamps.out: $(ENCHILADA) exit; \ done touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi - touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version touch $@ +set-tzs-timestamp.out: $(TZS) + touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) + touch $@ # The zics below ensure that each data file can stand on its own. # We also do an all-files run to catch links to links. -check_public: - $(MAKE) maintainer-clean - $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL - mkdir -p public.dir - for i in $(TDATA_TO_CHECK) tzdata.zi; do \ - $(zic) -v -d public.dir $$i 2>&1 || exit; \ +check_public: $(VERSION_DEPS) + rm -fr public.dir + mkdir public.dir + ln $(VERSION_DEPS) public.dir + cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \ + public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \ done - $(zic) -v -d public.dir $(TDATA_TO_CHECK) + public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK) rm -fr public.dir + touch $@ # Check that the code works under various alternative # implementations of time_t. -check_time_t_alternatives: - if diff -q Makefile Makefile 2>/dev/null; then \ - quiet_option='-q'; \ - else \ - quiet_option=''; \ - fi && \ +check_time_t_alternatives: $(TIME_T_ALTERNATIVES) +$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD) +$(TIME_T_ALTERNATIVES): $(VERSION_DEPS) + rm -fr $@.dir + mkdir $@.dir + ln $(VERSION_DEPS) $@.dir + case $@ in \ + int32_t) range=-2147483648,2147483648;; \ + u*) range=0,4294967296;; \ + *) range=-4294967296,4294967296;; \ + esac && \ wd=`pwd` && \ zones=`$(AWK) '/^[^#]/ { print $$3 }' time_t.dir/int64_t.out && \ - time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \ - >time_t.dir/$$type.out && \ - diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \ - || exit; \ - done - rm -fr time_t.dir + D=$$wd/$@.dir \ + TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ + install $$range_target) && \ + test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ + (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \ + $(MAKE) TOPDIR="$$wd/$@.dir" \ + TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ + D=$$wd/$@.dir \ + to$$range.tzs) && \ + diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ + $@.dir/to$$range.tzs && \ + if diff -q Makefile Makefile 2>/dev/null; then \ + quiet_option='-q'; \ + else \ + quiet_option=''; \ + fi && \ + diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \ + $@.dir/etc && \ + diff $$quiet_option -r \ + $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \ + $@.dir/usr/share; \ + } + touch $@ TRADITIONAL_ASC = \ tzcode$(VERSION).tar.gz.asc \ tzdata$(VERSION).tar.gz.asc -ALL_ASC = $(TRADITIONAL_ASC) \ - tzdata$(VERSION)-rearguard.tar.gz.asc \ +REARGUARD_ASC = \ + tzdata$(VERSION)-rearguard.tar.gz.asc +ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ tzdb-$(VERSION).tar.lz.asc -tarballs traditional_tarballs signatures traditional_signatures: version +tarballs rearguard_tarballs traditional_tarballs \ +signatures rearguard_signatures traditional_signatures: \ + version set-timestamps.out rearguard.zi VERSION=`cat version` && \ $(MAKE) VERSION="$$VERSION" $@_version # These *_version rules are intended for use if VERSION is set by some # other means. Ordinarily these rules are used only by the above # non-_version rules, which set VERSION on the 'make' command line. -tarballs_version: traditional_tarballs_version \ - tzdata$(VERSION)-rearguard.tar.gz \ +tarballs_version: traditional_tarballs_version rearguard_tarballs_version \ tzdb-$(VERSION).tar.lz +rearguard_tarballs_version: \ + tzdata$(VERSION)-rearguard.tar.gz traditional_tarballs_version: \ tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz signatures_version: $(ALL_ASC) +rearguard_signatures_version: $(REARGUARD_ASC) traditional_signatures_version: $(TRADITIONAL_ASC) tzcode$(VERSION).tar.gz: set-timestamps.out @@ -958,7 +1018,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti gzip $(GZIPFLAGS)) >$@.out mv $@.out $@ -tzdb-$(VERSION).tar.lz: set-timestamps.out +tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out rm -fr tzdb-$(VERSION) mkdir tzdb-$(VERSION) ln $(ENCHILADA) tzdb-$(VERSION) @@ -972,16 +1032,26 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz $(ALL_ASC): - gpg --armor --detach-sign $? + gpg2 --armor --detach-sign $? -typecheck: - $(MAKE) clean - for i in "long long" unsigned; \ - do \ - $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \ - ./zdump -v Europe/Rome ; \ - $(MAKE) clean ; \ - done +TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T +typecheck: typecheck_long_long typecheck_unsigned +typecheck_long_long typecheck_unsigned: $(VERSION_DEPS) + rm -fr $@.dir + mkdir $@.dir + ln $(VERSION_DEPS) $@.dir + cd $@.dir && \ + case $@ in \ + *_long_long) i="long long";; \ + *_unsigned ) i="unsigned" ;; \ + esac && \ + typecheck_cflags='' && \ + $(MAKE) \ + CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ + TOPDIR="`pwd`" \ + install + $@.dir/zdump -i -c 1970,1971 Europe/Rome + touch $@ zonenames: tzdata.zi @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi @@ -997,14 +1067,14 @@ zic.o: private.h tzfile.h version.h .KEEP_STATE: .PHONY: ALL INSTALL all -.PHONY: check check_character_set check_links check_name_lengths -.PHONY: check_public check_sorted check_tables -.PHONY: check_time_t_alternatives check_tzs check_web check_white_space +.PHONY: check check_time_t_alternatives .PHONY: check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names -.PHONY: posix_only posix_packrat posix_right -.PHONY: public right_only right_posix signatures signatures_version +.PHONY: posix_only posix_packrat posix_right public +.PHONY: rearguard_signatures rearguard_signatures_version +.PHONY: rearguard_tarballs rearguard_tarballs_version +.PHONY: right_only right_posix signatures signatures_version .PHONY: tarballs tarballs_version .PHONY: traditional_signatures traditional_signatures_version .PHONY: traditional_tarballs traditional_tarballs_version Modified: stable/11/contrib/tzdata/NEWS ============================================================================== --- stable/11/contrib/tzdata/NEWS Tue Oct 23 01:39:26 2018 (r339629) +++ stable/11/contrib/tzdata/NEWS Tue Oct 23 01:41:07 2018 (r339630) @@ -1,5 +1,136 @@ News for the tz database +Release 2018f - 2018-10-18 00:14:18 -0700 + + Briefly: + Volgograd moves from +03 to +04 on 2018-10-28. + Fiji ends DST 2019-01-13, not 2019-01-20. + Most of Chile changes DST dates, effective 2019-04-06. + + Changes to future timestamps + + Volgograd moves from +03 to +04 on 2018-10-28 at 02:00. + (Thanks to Alexander Fetisov and Stepan Golosunov.) + + Fiji ends DST 2019-01-13 instead of the 2019-01-20 previously + predicted. (Thanks to Raymond Kumar.) Adjust future predictions + accordingly. + + Most of Chile will end DST on the first Saturday in April at 24:00 mainland + time, and resume DST on the first Saturday in September at 24:00 mainland + time. The changes are effective from 2019-04-06, and do not affect the + Magallanes region modeled by America/Punta_Arenas. (Thanks to Juan Correa + and Tim Parenti.) Adjust future predictions accordingly. + + Changes to past timestamps + + The 2018-05-05 North Korea 30-minute time zone change took place + at 23:30 the previous day, not at 00:00 that day. + + China's 1988 spring-forward transition was on April 17, not + April 10. Its DST transitions in 1986/91 were at 02:00, not 00:00. + (Thanks to P Chan.) + + Fix several issues for Macau before 1992. Macau's pre-1904 LMT + was off by 10 s. Macau switched to +08 in 1904 not 1912, and + temporarily switched to +09/+10 during World War II. Macau + observed DST in 1942/79, not 1961/80, and there were several + errors for transition times and dates. (Thanks to P Chan.) + + The 1948-1951 fallback transitions in Japan were at 25:00 on + September's second Saturday, not at 24:00. (Thanks to Phake Nick.) + zic turns this into 01:00 on the day after September's second + Saturday, which is the best that POSIX or C platforms can do. + + Incorporate 1940-1949 Asia/Shanghai DST transitions from a 2014 + paper by Li Yu, replacing more-questionable data from Shanks. + + Changes to time zone abbreviations + + Use "PST" and "PDT" for Philippine time. (Thanks to Paul Goyette.) + + Changes to code + + zic now always generates TZif files where time type 0 is used for + timestamps before the first transition. This simplifies the + reading of TZif files and should not affect behavior of existing + TZif readers because the same set of time types is used; only + their internal indexes may have changed. This affects only the + legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and + EET, which previously used nonzero types for these timestamps. + + Because of the type 0 change, zic no longer outputs a dummy + transition at time -2**59 (before the Big Bang), as clients should + no longer need this to handle historical timestamps correctly. + This reverts a change introduced in 2013d and shrinks most TZif + files by a few bytes. + + zic now supports negative time-of-day in Rule and Leap lines, e.g., + "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition + occurs at 18:00 on the Saturday before the last Sunday in April. + This behavior was documented in 2018a but the code did not + entirely match the documentation. + + localtime.c no longer requires at least one time type in TZif + files that lack transitions or have a POSIX-style TZ string. This + future-proofs the code against possible future extensions to the + format that would allow TZif files with POSIX-style TZ strings and + without transitions or time types. + + A read-access subscript error in localtime.c has been fixed. + It could occur only in TZif files with timecnt == 0, something that + does not happen in practice now but could happen in future versions. + + localtime.c no longer ignores TZif POSIX-style TZ strings that + specify only standard time. Instead, these TZ strings now + override the default time type for timestamps after the last + transition (or for all time stamps if there are no transitions), + just as DST strings specifying DST have always done. + + leapseconds.awk now outputs "#updated" and "#expires" comments, + and supports leap seconds at the ends of months other than June + and December. (Inspired by suggestions from Chris Woodbury.) + + Changes to documentation + + New restrictions: A Rule name must start with a character that + is neither an ASCII digit nor "-" nor "+", and an unquoted name + should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~". + The latter restriction makes room for future extensions (a + possibility noted by Tom Lane). + + tzfile.5 now documents what time types apply before the first and + after the last transition, if any. + + Documentation now uses the spelling "timezone" for a TZ setting + that determines timestamp history, and "time zone" for a + geographic region currently sharing the same standard time. + + The name "TZif" is now used for the tz binary data format. + + tz-link.htm now mentions the A0 TimeZone Migration utilities. + (Thanks to Aldrin Martoq for the link.) + + Changes to build procedure + + New 'make' target 'rearguard_tarballs' to build the rearguard + tarball only. This is a convenience on platforms that lack lzip + if you want to build the rearguard tarball. (Problem reported by + Deborah Goldsmith.) + + tzdata.zi is now more stable from release to release. (Problem + noted by Tom Lane.) It is also a bit shorter. + + tzdata.zi now can contain comment lines documenting configuration + information, such as which data format was selected, which input + files were used, and how leap seconds are treated. (Problems + noted by Lester Caine and Brian Inglis.) If the Makefile defaults + are used these comment lines are absent, for backward + compatibility. A redistributor intending to alter its copy of the + files should also append "-LABEL" to the 'version' file's first + line, where "LABEL" identifies the redistributor's change. + + Release 2018e - 2018-05-01 23:42:51 -0700 Briefly: @@ -9,7 +140,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700 'make tarballs' now also builds a rearguard tarball. New 's' and 'd' suffixes in SAVE columns of Rule and Zone lines. - Changes to past and future time stamps + Changes to past and future timestamps North Korea switches back from +0830 to +09 on 2018-05-05. (Thanks to Kang Seonghoon, Arthur David Olson, Seo Sanghyeon, @@ -17,9 +148,9 @@ Release 2018e - 2018-05-01 23:42:51 -0700 Bring back the negative-DST changes of 2018a, except be more compatible with data parsers that do not support negative DST. - Also, this now affects historical time stamps in Namibia and the + Also, this now affects historical timestamps in Namibia and the former Czechoslovakia, not just Ireland. The main format now uses - negative DST to model time stamps in Europe/Dublin (from 1971 on), + negative DST to model timestamps in Europe/Dublin (from 1971 on), Europe/Prague (1946/7), and Africa/Windhoek (1994/2017). This does not affect UT offsets, only time zone abbreviations and the tm_isdst flag. Also, this does not affect rearguard or vanguard @@ -44,7 +175,7 @@ Release 2018e - 2018-05-01 23:42:51 -0700 in tzdata, it could be used to specify the legal time in Namibia 1994-2017, as opposed to the popular time (see below). - Changes to past time stamps + Changes to past timestamps From 1994 through 2017 Namibia observed DST in winter, not summer. That is, it used negative DST, as Ireland still does. This change @@ -54,12 +185,12 @@ Release 2018e - 2018-05-01 23:42:51 -0700 both simply called "standard time" in Namibian law, in common practice winter time was considered to be DST (as noted by Stephen Colebourne). The full effect of this change is only in vanguard - format; in rearguard and main format, the tm_isdst flag is still + and main format; in rearguard format, the tm_isdst flag is still zero in winter and nonzero in summer. In 1946/7 Czechoslovakia also observed negative DST in winter. - The full effect of this change is only in vanguard format; in - rearguard and main formats, it is modeled as plain GMT without + The full effect of this change is only in vanguard and main + formats; in rearguard format, it is modeled as plain GMT without daylight saving. Also, the dates of some 1944/5 DST transitions in Czechoslovakia have been changed. @@ -72,17 +203,17 @@ Release 2018d - 2018-03-22 07:05:46 -0700 Add support for vanguard and rearguard data consumers. Add subsecond precision to source data format, though not to data. - Changes to future time stamps + Changes to future timestamps In 2018, Palestine starts DST on March 24, not March 31. Adjust future predictions accordingly. (Thanks to Sharef Mustafa.) - Changes to past and future time stamps + Changes to past and future timestamps Casey Station in Antarctica changed from +11 to +08 on 2018-03-11 at 04:00. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Historical transitions for Uruguay, represented by America/Montevideo, have been updated per official legal documents, @@ -224,7 +355,7 @@ Release 2018c - 2018-01-22 23:00:44 -0800 change is reapplied. (Problems reported by Deborah Goldsmith and Stephen Colebourne.) - Changes to past time stamps + Changes to past timestamps Japanese DST transitions (1948-1951) were Sundays at 00:00, not Saturdays or Sundays at 02:00. (Thanks to Takayuki Nikai.) @@ -256,18 +387,18 @@ Release 2018a - 2018-01-12 22:29:21 -0800 Use Debian-style installation locations, instead of 4.3BSD-style. New zic option -t. - Changes to past and future time stamps + Changes to past and future timestamps São Tomé and Príncipe switched from +00 to +01 on 2018-01-01 at 01:00. (Thanks to Steffen Thorsen and Michael Deckers.) - Changes to future time stamps + Changes to future timestamps Starting in 2018 southern Brazil will begin DST on November's first Sunday instead of October's third Sunday. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps A discrepancy of 4 s in timestamps before 1931 in South Sudan has been corrected. The 'backzone' and 'zone.tab' files did not agree @@ -355,7 +486,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700 A new file tzdata.zi now holds a small text copy of all data. The zic input format has been regularized slightly. - Changes to future time stamps + Changes to future timestamps Northern Cyprus has decided to resume EU rules starting 2017-10-29, thus reinstituting winter time. @@ -381,7 +512,7 @@ Release 2017c - 2017-10-20 14:49:34 -0700 2018-03-11 at 03:00. This affects UT offsets starting 2018-11-04 at 02:00. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Namibia switched from +02 to +01 on 1994-03-21, not 1994-04-03. (Thanks to Arthur David Olson.) @@ -511,11 +642,11 @@ Release 2017b - 2017-03-17 07:30:38 -0700 Briefly: Haiti has resumed DST. - Changes to past and future time stamps + Changes to past and future timestamps Haiti resumed observance of DST in 2017. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps Liberia changed from -004430 to +00 on 1972-01-07, not 1972-05-01. @@ -527,7 +658,7 @@ Release 2017b - 2017-03-17 07:30:38 -0700 The reference localtime implementation now falls back on the current US daylight-saving transition rules rather than the 1987-2006 rules. This fallback occurs only when (1) the TZ - environment variable's value has a name like "AST4ADT" that asks + environment variable has a value like "AST4ADT" that asks for daylight saving time but does not specify the rules, (2) there is no file by that name, and (3) the TZDEFRULES file cannot be loaded. (Thanks to Tom Lane.) @@ -538,7 +669,7 @@ Release 2017a - 2017-02-28 00:05:36 -0800 Briefly: Southern Chile moves from -04/-03 to -03, and Mongolia discontinues DST. - Changes to future time stamps + Changes to future timestamps Mongolia no longer observes DST. (Thanks to Ganbold Tsagaankhuu.) @@ -549,12 +680,12 @@ Release 2017a - 2017-02-28 00:05:36 -0800 assume it's permanent. (Thanks to Juan Correa and Deborah Goldsmith.) This also affects Antarctica/Palmer. - Changes to past time stamps + Changes to past timestamps - Fix many entries for historical time stamps for Europe/Madrid + Fix many entries for historical timestamps for Europe/Madrid before 1979, to agree with tables compiled by Pere Planesas of the National Astronomical Observatory of Spain. As a side effect, - this changes some time stamps for Africa/Ceuta before 1929, which + this changes some timestamps for Africa/Ceuta before 1929, which are probably guesswork anyway. (Thanks to Steve Allen and Pierpaolo Bernardi for the heads-ups, and to Michael Deckers for correcting the 1901 transition.) @@ -645,13 +776,13 @@ Release 2016j - 2016-11-22 23:17:13 -0800 Briefly: Saratov, Russia moves from +03 to +04 on 2016-12-04. - Changes to future time stamps + Changes to future timestamps Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00. This hives off a new zone Europe/Saratov from Europe/Volgograd. (Thanks to Yuri Konotopov and Stepan Golosunov.) - Changes to past time stamps + Changes to past timestamps The new zone Asia/Atyrau for Atyraū Region, Kazakhstan, is like Asia/Aqtau except it switched from +05/+06 to +04/+05 in spring @@ -687,7 +818,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga reintroduces DST on 2016-11-06. - Changes to future time stamps + Changes to future timestamps Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on 2017-01-15 at 03:00. Assume future observances in Tonga will be @@ -695,7 +826,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 January, like Fiji. (Thanks to Pulu ʻAnau.) Switch to numeric time zone abbreviations for this zone. - Changes to past and future time stamps + Changes to past and future timestamps Northern Cyprus is now +03 year round, causing a split in Cyprus time zones starting 2016-10-30 at 04:00. This creates a zone @@ -704,9 +835,9 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Antarctica/Casey switched from +08 to +11 on 2016-10-22. (Thanks to Steffen Thorsen.) - Changes to past time stamps + Changes to past timestamps - Several corrections were made for pre-1975 time stamps in Italy. + Several corrections were made for pre-1975 timestamps in Italy. These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and Europe/Vatican. @@ -744,7 +875,7 @@ Release 2016i - 2016-11-01 23:19:52 -0700 Release 2016h - 2016-10-19 23:17:57 -0700 - Changes to future time stamps + Changes to future timestamps Asia/Gaza and Asia/Hebron end DST on 2016-10-29 at 01:00, not 2016-10-21 at 00:00. (Thanks to Sharef Mustafa.) Predict that @@ -752,7 +883,7 @@ Release 2016h - 2016-10-19 23:17:57 -0700 at 01:00, which is consistent with predicted spring transitions on the last Saturday of March. (Thanks to Tim Parenti.) - Changes to past time stamps + Changes to past timestamps In Turkey, transitions in 1986-1990 were at 01:00 standard time not at 02:00, and the spring 1994 transition was on March 20, not *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Tue Oct 23 07:24:04 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 907B4106EC9C; Tue, 23 Oct 2018 07:24:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462108E73B; Tue, 23 Oct 2018 07:24:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FE714C50; Tue, 23 Oct 2018 07:24:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9N7O4Nw037109; Tue, 23 Oct 2018 07:24:04 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9N7O4NX037108; Tue, 23 Oct 2018 07:24:04 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810230724.w9N7O4NX037108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 23 Oct 2018 07:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339638 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 339638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 07:24:04 -0000 Author: kp Date: Tue Oct 23 07:24:03 2018 New Revision: 339638 URL: https://svnweb.freebsd.org/changeset/base/339638 Log: MFC r338698: Significantly improve pf purge cpu usage by only taking locks when there is work to do. This reduces CPU consumption to one third on systems. This will help keep the thread CPU usage under control now that the default hash size has increased. Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Tue Oct 23 06:31:31 2018 (r339637) +++ stable/11/sys/netpfil/pf/pf.c Tue Oct 23 07:24:03 2018 (r339638) @@ -1707,24 +1707,28 @@ pf_purge_expired_states(u_int i, int maxcheck) while (maxcheck > 0) { ih = &V_pf_idhash[i]; + + /* only take the lock if we expect to do work */ + if (!LIST_EMPTY(&ih->states)) { relock: - PF_HASHROW_LOCK(ih); - LIST_FOREACH(s, &ih->states, entry) { - if (pf_state_expires(s) <= time_uptime) { - V_pf_status.states -= - pf_unlink_state(s, PF_ENTER_LOCKED); - goto relock; + PF_HASHROW_LOCK(ih); + LIST_FOREACH(s, &ih->states, entry) { + if (pf_state_expires(s) <= time_uptime) { + V_pf_status.states -= + pf_unlink_state(s, PF_ENTER_LOCKED); + goto relock; + } + s->rule.ptr->rule_flag |= PFRULE_REFS; + if (s->nat_rule.ptr != NULL) + s->nat_rule.ptr->rule_flag |= PFRULE_REFS; + if (s->anchor.ptr != NULL) + s->anchor.ptr->rule_flag |= PFRULE_REFS; + s->kif->pfik_flags |= PFI_IFLAG_REFS; + if (s->rt_kif) + s->rt_kif->pfik_flags |= PFI_IFLAG_REFS; } - s->rule.ptr->rule_flag |= PFRULE_REFS; - if (s->nat_rule.ptr != NULL) - s->nat_rule.ptr->rule_flag |= PFRULE_REFS; - if (s->anchor.ptr != NULL) - s->anchor.ptr->rule_flag |= PFRULE_REFS; - s->kif->pfik_flags |= PFI_IFLAG_REFS; - if (s->rt_kif) - s->rt_kif->pfik_flags |= PFI_IFLAG_REFS; + PF_HASHROW_UNLOCK(ih); } - PF_HASHROW_UNLOCK(ih); /* Return when we hit end of hash. */ if (++i > pf_hashmask) { From owner-svn-src-stable-11@freebsd.org Tue Oct 23 13:12:43 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A74FD79DE; Tue, 23 Oct 2018 13:12:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CDBB7BD4A; Tue, 23 Oct 2018 13:12:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27D141061F; Tue, 23 Oct 2018 13:12:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NDCh7Y021548; Tue, 23 Oct 2018 13:12:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDCgrv021544; Tue, 23 Oct 2018 13:12:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201810231312.w9NDCgrv021544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 23 Oct 2018 13:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339650 - in stable/11/sys/contrib/ck/include: . gcc/x86 gcc/x86_64 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys/contrib/ck/include: . gcc/x86 gcc/x86_64 X-SVN-Commit-Revision: 339650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 13:12:43 -0000 Author: avg Date: Tue Oct 23 13:12:42 2018 New Revision: 339650 URL: https://svnweb.freebsd.org/changeset/base/339650 Log: MFC r336634: MFV CK@r336629: Import CK as of commit 1c1f9901c2dea7a883342cd03d3906a1bc482583 This adds CK_SLIST_INSERT_PREVPTR and CK_SLIST_REMOVE_PREVPTR macros as well as ck_pr_dec_is_zero family of functions. Modified: stable/11/sys/contrib/ck/include/ck_pr.h stable/11/sys/contrib/ck/include/ck_queue.h stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ck/include/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_pr.h Tue Oct 23 13:11:45 2018 (r339649) +++ stable/11/sys/contrib/ck/include/ck_pr.h Tue Oct 23 13:12:42 2018 (r339650) @@ -619,8 +619,8 @@ CK_PR_BTX_S(bts, 16, uint16_t, |,) } #define CK_PR_UNARY_Z(K, S, M, T, P, C, Z) \ - CK_CC_INLINE static void \ - ck_pr_##K##_##S##_zero(M *target, bool *zero) \ + CK_CC_INLINE static bool \ + ck_pr_##K##_##S##_is_zero(M *target) \ { \ T previous; \ C punt; \ @@ -631,12 +631,21 @@ CK_PR_BTX_S(bts, 16, uint16_t, |,) (C)(previous P 1), \ &previous) == false) \ ck_pr_stall(); \ - *zero = previous == (T)Z; \ + return previous == (T)Z; \ + } + +#define CK_PR_UNARY_Z_STUB(K, S, M) \ + CK_CC_INLINE static void \ + ck_pr_##K##_##S##_zero(M *target, bool *zero) \ + { \ + *zero = ck_pr_##K##_##S##_is_zero(target); \ return; \ } #define CK_PR_UNARY_S(K, X, S, M) CK_PR_UNARY(K, X, S, M, M) -#define CK_PR_UNARY_Z_S(K, S, M, P, Z) CK_PR_UNARY_Z(K, S, M, M, P, M, Z) +#define CK_PR_UNARY_Z_S(K, S, M, P, Z) \ + CK_PR_UNARY_Z(K, S, M, M, P, M, Z) \ + CK_PR_UNARY_Z_STUB(K, S, M) #if defined(CK_F_PR_LOAD_CHAR) && defined(CK_F_PR_CAS_CHAR_VALUE) @@ -648,6 +657,8 @@ CK_PR_UNARY_S(inc, add, char, char) #ifndef CK_F_PR_INC_CHAR_ZERO #define CK_F_PR_INC_CHAR_ZERO CK_PR_UNARY_Z_S(inc, char, char, +, -1) +#else +CK_PR_UNARY_Z_STUB(inc, char, char) #endif /* CK_F_PR_INC_CHAR_ZERO */ #ifndef CK_F_PR_DEC_CHAR @@ -658,6 +669,8 @@ CK_PR_UNARY_S(dec, sub, char, char) #ifndef CK_F_PR_DEC_CHAR_ZERO #define CK_F_PR_DEC_CHAR_ZERO CK_PR_UNARY_Z_S(dec, char, char, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, char, char) #endif /* CK_F_PR_DEC_CHAR_ZERO */ #endif /* CK_F_PR_LOAD_CHAR && CK_F_PR_CAS_CHAR_VALUE */ @@ -672,6 +685,8 @@ CK_PR_UNARY_S(inc, add, int, int) #ifndef CK_F_PR_INC_INT_ZERO #define CK_F_PR_INC_INT_ZERO CK_PR_UNARY_Z_S(inc, int, int, +, -1) +#else +CK_PR_UNARY_Z_STUB(inc, int, int) #endif /* CK_F_PR_INC_INT_ZERO */ #ifndef CK_F_PR_DEC_INT @@ -682,6 +697,8 @@ CK_PR_UNARY_S(dec, sub, int, int) #ifndef CK_F_PR_DEC_INT_ZERO #define CK_F_PR_DEC_INT_ZERO CK_PR_UNARY_Z_S(dec, int, int, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, int, int) #endif /* CK_F_PR_DEC_INT_ZERO */ #endif /* CK_F_PR_LOAD_INT && CK_F_PR_CAS_INT_VALUE */ @@ -711,6 +728,8 @@ CK_PR_UNARY_S(inc, add, uint, unsigned int) #ifndef CK_F_PR_INC_UINT_ZERO #define CK_F_PR_INC_UINT_ZERO CK_PR_UNARY_Z_S(inc, uint, unsigned int, +, UINT_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, uint, unsigned int) #endif /* CK_F_PR_INC_UINT_ZERO */ #ifndef CK_F_PR_DEC_UINT @@ -721,6 +740,8 @@ CK_PR_UNARY_S(dec, sub, uint, unsigned int) #ifndef CK_F_PR_DEC_UINT_ZERO #define CK_F_PR_DEC_UINT_ZERO CK_PR_UNARY_Z_S(dec, uint, unsigned int, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, uint, unsigned int) #endif /* CK_F_PR_DEC_UINT_ZERO */ #endif /* CK_F_PR_LOAD_UINT && CK_F_PR_CAS_UINT_VALUE */ @@ -735,6 +756,8 @@ CK_PR_UNARY(inc, add, ptr, void, uintptr_t) #ifndef CK_F_PR_INC_PTR_ZERO #define CK_F_PR_INC_PTR_ZERO CK_PR_UNARY_Z(inc, ptr, void, uintptr_t, +, void *, UINT_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, ptr, void) #endif /* CK_F_PR_INC_PTR_ZERO */ #ifndef CK_F_PR_DEC_PTR @@ -745,6 +768,8 @@ CK_PR_UNARY(dec, sub, ptr, void, uintptr_t) #ifndef CK_F_PR_DEC_PTR_ZERO #define CK_F_PR_DEC_PTR_ZERO CK_PR_UNARY_Z(dec, ptr, void, uintptr_t, -, void *, 1) +#else +CK_PR_UNARY_Z_STUB(dec, ptr, void) #endif /* CK_F_PR_DEC_PTR_ZERO */ #endif /* CK_F_PR_LOAD_PTR && CK_F_PR_CAS_PTR_VALUE */ @@ -759,6 +784,8 @@ CK_PR_UNARY_S(inc, add, 64, uint64_t) #ifndef CK_F_PR_INC_64_ZERO #define CK_F_PR_INC_64_ZERO CK_PR_UNARY_Z_S(inc, 64, uint64_t, +, UINT64_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, 64, uint64_t) #endif /* CK_F_PR_INC_64_ZERO */ #ifndef CK_F_PR_DEC_64 @@ -769,6 +796,8 @@ CK_PR_UNARY_S(dec, sub, 64, uint64_t) #ifndef CK_F_PR_DEC_64_ZERO #define CK_F_PR_DEC_64_ZERO CK_PR_UNARY_Z_S(dec, 64, uint64_t, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, 64, uint64_t) #endif /* CK_F_PR_DEC_64_ZERO */ #endif /* CK_F_PR_LOAD_64 && CK_F_PR_CAS_64_VALUE */ @@ -783,6 +812,8 @@ CK_PR_UNARY_S(inc, add, 32, uint32_t) #ifndef CK_F_PR_INC_32_ZERO #define CK_F_PR_INC_32_ZERO CK_PR_UNARY_Z_S(inc, 32, uint32_t, +, UINT32_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, 32, uint32_t) #endif /* CK_F_PR_INC_32_ZERO */ #ifndef CK_F_PR_DEC_32 @@ -793,6 +824,8 @@ CK_PR_UNARY_S(dec, sub, 32, uint32_t) #ifndef CK_F_PR_DEC_32_ZERO #define CK_F_PR_DEC_32_ZERO CK_PR_UNARY_Z_S(dec, 32, uint32_t, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, 32, uint32_t) #endif /* CK_F_PR_DEC_32_ZERO */ #endif /* CK_F_PR_LOAD_32 && CK_F_PR_CAS_32_VALUE */ @@ -807,6 +840,8 @@ CK_PR_UNARY_S(inc, add, 16, uint16_t) #ifndef CK_F_PR_INC_16_ZERO #define CK_F_PR_INC_16_ZERO CK_PR_UNARY_Z_S(inc, 16, uint16_t, +, UINT16_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, 16, uint16_t) #endif /* CK_F_PR_INC_16_ZERO */ #ifndef CK_F_PR_DEC_16 @@ -817,6 +852,8 @@ CK_PR_UNARY_S(dec, sub, 16, uint16_t) #ifndef CK_F_PR_DEC_16_ZERO #define CK_F_PR_DEC_16_ZERO CK_PR_UNARY_Z_S(dec, 16, uint16_t, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, 16, uint16_t) #endif /* CK_F_PR_DEC_16_ZERO */ #endif /* CK_F_PR_LOAD_16 && CK_F_PR_CAS_16_VALUE */ @@ -831,6 +868,8 @@ CK_PR_UNARY_S(inc, add, 8, uint8_t) #ifndef CK_F_PR_INC_8_ZERO #define CK_F_PR_INC_8_ZERO CK_PR_UNARY_Z_S(inc, 8, uint8_t, +, UINT8_MAX) +#else +CK_PR_UNARY_Z_STUB(inc, 8, uint8_t) #endif /* CK_F_PR_INC_8_ZERO */ #ifndef CK_F_PR_DEC_8 @@ -841,6 +880,8 @@ CK_PR_UNARY_S(dec, sub, 8, uint8_t) #ifndef CK_F_PR_DEC_8_ZERO #define CK_F_PR_DEC_8_ZERO CK_PR_UNARY_Z_S(dec, 8, uint8_t, -, 1) +#else +CK_PR_UNARY_Z_STUB(dec, 8, uint8_t) #endif /* CK_F_PR_DEC_8_ZERO */ #endif /* CK_F_PR_LOAD_8 && CK_F_PR_CAS_8_VALUE */ Modified: stable/11/sys/contrib/ck/include/ck_queue.h ============================================================================== --- stable/11/sys/contrib/ck/include/ck_queue.h Tue Oct 23 13:11:45 2018 (r339649) +++ stable/11/sys/contrib/ck/include/ck_queue.h Tue Oct 23 13:12:42 2018 (r339650) @@ -180,8 +180,14 @@ struct { \ ck_pr_store_ptr(&(head)->cslh_first, elm); \ } while (0) +#define CK_SLIST_INSERT_PREVPTR(prevp, slistelm, elm, field) do { \ + (elm)->field.csle_next = (slistelm); \ + ck_pr_fence_store(); \ + ck_pr_store_ptr(prevp, elm); \ +} while (0) + #define CK_SLIST_REMOVE_AFTER(elm, field) do { \ - ck_pr_store_ptr(&(elm)->field.csle_next, \ + ck_pr_store_ptr(&(elm)->field.csle_next, \ (elm)->field.csle_next->field.csle_next); \ } while (0) @@ -190,7 +196,7 @@ struct { \ CK_SLIST_REMOVE_HEAD((head), field); \ } else { \ struct type *curelm = (head)->cslh_first; \ - while (curelm->field.csle_next != (elm)) \ + while (curelm->field.csle_next != (elm)) \ curelm = curelm->field.csle_next; \ CK_SLIST_REMOVE_AFTER(curelm, field); \ } \ @@ -199,6 +205,10 @@ struct { \ #define CK_SLIST_REMOVE_HEAD(head, field) do { \ ck_pr_store_ptr(&(head)->cslh_first, \ (head)->cslh_first->field.csle_next); \ +} while (0) + +#define CK_SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \ + ck_pr_store_ptr(prevptr, (elm)->field.csle_next); \ } while (0) #define CK_SLIST_MOVE(head1, head2, field) do { \ Modified: stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Oct 23 13:11:45 2018 (r339649) +++ stable/11/sys/contrib/ck/include/gcc/x86/ck_pr.h Tue Oct 23 13:12:42 2018 (r339650) @@ -233,17 +233,17 @@ CK_PR_FAA_S(8, uint8_t, "xaddb") } #define CK_PR_UNARY_V(K, S, T, C, I) \ - CK_CC_INLINE static void \ - ck_pr_##K##_##S##_zero(T *target, bool *r) \ + CK_CC_INLINE static bool \ + ck_pr_##K##_##S##_is_zero(T *target) \ { \ + bool ret; \ __asm__ __volatile__(CK_PR_LOCK_PREFIX I " %0; setz %1" \ : "+m" (*(C *)target), \ - "=m" (*r) \ + "=rm" (ret) \ : \ : "memory", "cc"); \ - return; \ + return ret; \ } - #define CK_PR_UNARY_S(K, S, T, I) CK_PR_UNARY(K, S, T, T, I) Modified: stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h ============================================================================== --- stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Oct 23 13:11:45 2018 (r339649) +++ stable/11/sys/contrib/ck/include/gcc/x86_64/ck_pr.h Tue Oct 23 13:12:42 2018 (r339650) @@ -332,17 +332,17 @@ CK_PR_FAA_S(8, uint8_t, "xaddb") } #define CK_PR_UNARY_V(K, S, T, C, I) \ - CK_CC_INLINE static void \ - ck_pr_##K##_##S##_zero(T *target, bool *r) \ + CK_CC_INLINE static bool \ + ck_pr_##K##_##S##_is_zero(T *target) \ { \ + bool ret; \ __asm__ __volatile__(CK_PR_LOCK_PREFIX I " %0; setz %1" \ : "+m" (*(C *)target), \ - "=m" (*r) \ + "=rm" (ret) \ : \ : "memory", "cc"); \ - return; \ + return ret; \ } - #define CK_PR_UNARY_S(K, S, T, I) CK_PR_UNARY(K, S, T, T, I) From owner-svn-src-stable-11@freebsd.org Tue Oct 23 13:44:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10178FD89AD; Tue, 23 Oct 2018 13:44:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B773D7D1FB; Tue, 23 Oct 2018 13:44:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B254310AFD; Tue, 23 Oct 2018 13:44:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9NDiXh9037083; Tue, 23 Oct 2018 13:44:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9NDiXj3037082; Tue, 23 Oct 2018 13:44:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201810231344.w9NDiXj3037082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Oct 2018 13:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339652 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 339652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 13:44:34 -0000 Author: markj Date: Tue Oct 23 13:44:33 2018 New Revision: 339652 URL: https://svnweb.freebsd.org/changeset/base/339652 Log: MFC r339365: Typo. Modified: stable/11/share/man/man4/dtrace_ip.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/dtrace_ip.4 ============================================================================== --- stable/11/share/man/man4/dtrace_ip.4 Tue Oct 23 13:38:39 2018 (r339651) +++ stable/11/share/man/man4/dtrace_ip.4 Tue Oct 23 13:44:33 2018 (r339652) @@ -235,7 +235,7 @@ This script will print some details of each IP packet by the kernel: .Bd -literal -offset indent #pragma D option quiet -#pramga D option switchrate=10Hz +#pragma D option switchrate=10Hz dtrace:::BEGIN { From owner-svn-src-stable-11@freebsd.org Wed Oct 24 05:14:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D2551073F9F; Wed, 24 Oct 2018 05:14:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1C4816EA; Wed, 24 Oct 2018 05:14:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 145101A4C2; Wed, 24 Oct 2018 05:14:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9O5E2kE017341; Wed, 24 Oct 2018 05:14:02 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9O5E2eK017340; Wed, 24 Oct 2018 05:14:02 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201810240514.w9O5E2eK017340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 24 Oct 2018 05:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339679 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 339679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 05:14:03 -0000 Author: eugen Date: Wed Oct 24 05:14:02 2018 New Revision: 339679 URL: https://svnweb.freebsd.org/changeset/base/339679 Log: MFC r339462: make upgrade from previous FreeBSD versions less painful and make previously working configuration like this work again: gif_interfaces="gif0" gifconfig_gif0="1.1.1.1 2.2.2.2" ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252" PR: 204700 Modified: stable/11/etc/network.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/network.subr ============================================================================== --- stable/11/etc/network.subr Wed Oct 24 03:14:10 2018 (r339678) +++ stable/11/etc/network.subr Wed Oct 24 05:14:02 2018 (r339679) @@ -1408,7 +1408,7 @@ clone_up() _list="$_list $ifn" fi tmpargs=$(get_if_var $ifn gifconfig_IF) - eval ifconfig_${ifn}=\"tunnel \$tmpargs\" + eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\" done if [ -n "${_list# }" ]; then echo "Created clone interfaces: ${_list# }." From owner-svn-src-stable-11@freebsd.org Wed Oct 24 18:19:33 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5781910085F4; Wed, 24 Oct 2018 18:19:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 068CD73636; Wed, 24 Oct 2018 18:19:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E702DE75; Wed, 24 Oct 2018 18:19:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9OIJWY6020405; Wed, 24 Oct 2018 18:19:32 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9OIJWhB020404; Wed, 24 Oct 2018 18:19:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810241819.w9OIJWhB020404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 24 Oct 2018 18:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339691 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 339691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 18:19:33 -0000 Author: kp Date: Wed Oct 24 18:19:32 2018 New Revision: 339691 URL: https://svnweb.freebsd.org/changeset/base/339691 Log: MFC r339547: vlan: Fix panic with lagg and vlan vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context set. We can end up trying to send ARP messages (through the iflladdr_event event), which requires a vnet context. PR: 227654 Modified: stable/11/sys/net/if_vlan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_vlan.c ============================================================================== --- stable/11/sys/net/if_vlan.c Wed Oct 24 17:32:31 2018 (r339690) +++ stable/11/sys/net/if_vlan.c Wed Oct 24 18:19:32 2018 (r339691) @@ -1318,8 +1318,13 @@ vlan_lladdr_fn(void *arg, int pending __unused) ifv = (struct ifvlan *)arg; ifp = ifv->ifv_ifp; + + CURVNET_SET(ifp->if_vnet); + /* The ifv_ifp already has the lladdr copied in. */ if_setlladdr(ifp, IF_LLADDR(ifp), ifp->if_addrlen); + + CURVNET_RESTORE(); } static int From owner-svn-src-stable-11@freebsd.org Wed Oct 24 23:17:18 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8AF0107344C; Wed, 24 Oct 2018 23:17:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6D07E3D6; Wed, 24 Oct 2018 23:17:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58A7CFEA; Wed, 24 Oct 2018 23:17:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9ONHItK075151; Wed, 24 Oct 2018 23:17:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9ONHIY8075150; Wed, 24 Oct 2018 23:17:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201810242317.w9ONHIY8075150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 24 Oct 2018 23:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339697 - stable/11/stand/forth X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/stand/forth X-SVN-Commit-Revision: 339697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 23:17:18 -0000 Author: dteske Date: Wed Oct 24 23:17:17 2018 New Revision: 339697 URL: https://svnweb.freebsd.org/changeset/base/339697 Log: MFC r339509: Fix loader.conf(5) "password" feature Restore the ability to prevent the user from interrupting the boot process without first entering the password stored in loader.conf(5). PR: kern/207069 Reported by: david@dcrosstech.com Sponsored by: Smule, Inc. Modified: stable/11/stand/forth/check-password.4th Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/forth/check-password.4th ============================================================================== --- stable/11/stand/forth/check-password.4th Wed Oct 24 23:13:53 2018 (r339696) +++ stable/11/stand/forth/check-password.4th Wed Oct 24 23:17:17 2018 (r339697) @@ -129,7 +129,7 @@ variable readlen \ input length again \ Enter was not pressed; repeat ; -only forth definitions also password-processing +only forth definitions also password-processing also support-functions : check-password ( -- ) @@ -161,6 +161,7 @@ only forth definitions also password-processing \ We should prevent the user from visiting the menu or dropping to the \ interactive loader(8) prompt, but still allow the machine to boot... + any_conf_read? if load_kernel load_modules then 0 autoboot \ Only reached if autoboot fails for any reason (including if/when From owner-svn-src-stable-11@freebsd.org Thu Oct 25 13:46:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21B521076DCF; Thu, 25 Oct 2018 13:46:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8B7A8318D; Thu, 25 Oct 2018 13:46:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A98AB129B3; Thu, 25 Oct 2018 13:46:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PDkSsB021537; Thu, 25 Oct 2018 13:46:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PDkSgf021536; Thu, 25 Oct 2018 13:46:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201810251346.w9PDkSgf021536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 25 Oct 2018 13:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339710 - stable/11/contrib/elftoolchain/elfcopy X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 339710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 13:46:29 -0000 Author: emaste Date: Thu Oct 25 13:46:28 2018 New Revision: 339710 URL: https://svnweb.freebsd.org/changeset/base/339710 Log: elfcopy: avoid stripping relocations from static binaries MFC r339350: elfcopy: delete filter_reloc, it is broken and unnecessary elfcopy contained logic to filter individual relocations in STRIP_ALL mode. However, this is not valid; relocations emitted by the linker are required, unless they apply to an entire section being removed (which is handled by other logic in elfcopy). Note that filter_reloc was also buggy: for RELA relocation sections it operated on uninitialized rel.r_info resulting in invalid operation. The logic most likely needs to be inverted: instead of removing relocations because their associated symbols are being removed, we must keep symbols referenced by relocations. That said, in practice we do not encounter this code path today: objects being stripped are either dynamically linked binaries which retain .dynsym, or static binaries with no relocations. Just remove filter_reloc. This fixes certain cases including statically linked binaries containing ifuncs. Stripping binaries with relocations referencing removed symbols was already broken, and after this change may still be broken in a different way. MFC r339451: objcopy: restore behaviour required by GCC's build In r339350 filter_reloc() was removed, to fix the case of stripping statically linked binaries with relocations (which may come from ifunc use, for example). As a side effect this changed the behaviour when stripping object files - the output was broken both before and after r339350, in different ways. Unfortunately GCC's build process relies on the previous behaviour, so: - Revert r339350, restoring filter_reloc(). - Fix an unitialized variable use (commited as r3638 in ELF Tool Chain). - Change filter_reloc() to omit relocations referencing removed symbols, while retaining relocations with no symbol reference. - Retain the entire relocation section if it references the dynamic symbol table (fix from kaiw in D17596). PR: 232176 Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/sections.c Thu Oct 25 13:37:57 2018 (r339709) +++ stable/11/contrib/elftoolchain/elfcopy/sections.c Thu Oct 25 13:46:28 2018 (r339710) @@ -689,7 +689,7 @@ filter_reloc(struct elfcopy *ecp, struct section *s) Elf32_Rela *rela32; Elf64_Rela *rela64; Elf_Data *id; - uint64_t cap, n, nrels; + uint64_t cap, n, nrels, sym; int elferr, i; if (gelf_getshdr(s->is, &ish) == NULL) @@ -698,15 +698,13 @@ filter_reloc(struct elfcopy *ecp, struct section *s) /* We don't want to touch relocation info for dynamic symbols. */ if ((ecp->flags & SYMTAB_EXIST) == 0) { - if (ish.sh_link == 0 || ecp->secndx[ish.sh_link] == 0) { - /* - * This reloc section applies to the symbol table - * that was stripped, so discard whole section. - */ - s->nocopy = 1; - s->sz = 0; - } - return; + /* + * No symbol table in output. If sh_link points to a section + * that exists in the output object, this relocation section + * is for dynamic symbols. Don't touch it. + */ + if (ish.sh_link != 0 && ecp->secndx[ish.sh_link] != 0) + return; } else { /* Symbol table exist, check if index equals. */ if (ish.sh_link != elf_ndxscn(ecp->symtab->is)) @@ -747,28 +745,45 @@ filter_reloc(struct elfcopy *ecp, struct section *s) if (gelf_getrel(id, i, &rel) != &rel) errx(EXIT_FAILURE, "gelf_getrel failed: %s", elf_errmsg(-1)); + sym = GELF_R_SYM(rel.r_info); } else { if (gelf_getrela(id, i, &rela) != &rela) errx(EXIT_FAILURE, "gelf_getrel failed: %s", elf_errmsg(-1)); + sym = GELF_R_SYM(rela.r_info); } - name = elf_strptr(ecp->ein, elf_ndxscn(ecp->strtab->is), - GELF_R_SYM(rel.r_info)); - if (name == NULL) - errx(EXIT_FAILURE, "elf_strptr failed: %s", - elf_errmsg(-1)); - if (lookup_symop_list(ecp, name, SYMOP_KEEP) != NULL) { - if (ecp->oec == ELFCLASS32) { - if (s->type == SHT_REL) - COPYREL(rel, 32); - else - COPYREL(rela, 32); - } else { - if (s->type == SHT_REL) - COPYREL(rel, 64); - else - COPYREL(rela, 64); - } + /* + * If a relocation references a symbol and we are omitting + * either that symbol or the entire symbol table we cannot + * produce valid output, and so just omit the relocation. + * Broken output like this is generally not useful, but some + * uses of elfcopy/strip rely on it - for example, GCC's build + * process uses it to check for build reproducibility by + * stripping objects and comparing them. + * + * Relocations that do not reference a symbol are retained. + */ + if (sym != 0) { + if (ish.sh_link == 0 || ecp->secndx[ish.sh_link] == 0) + continue; + name = elf_strptr(ecp->ein, elf_ndxscn(ecp->strtab->is), + sym); + if (name == NULL) + errx(EXIT_FAILURE, "elf_strptr failed: %s", + elf_errmsg(-1)); + if (lookup_symop_list(ecp, name, SYMOP_KEEP) == NULL) + continue; + } + if (ecp->oec == ELFCLASS32) { + if (s->type == SHT_REL) + COPYREL(rel, 32); + else + COPYREL(rela, 32); + } else { + if (s->type == SHT_REL) + COPYREL(rel, 64); + else + COPYREL(rela, 64); } } elferr = elf_errno(); From owner-svn-src-stable-11@freebsd.org Thu Oct 25 14:10:30 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54941077C98; Thu, 25 Oct 2018 14:10:29 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98BD18449C; Thu, 25 Oct 2018 14:10:29 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A1FA12D83; Thu, 25 Oct 2018 14:10:29 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PEATXK032167; Thu, 25 Oct 2018 14:10:29 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PEAT7v032165; Thu, 25 Oct 2018 14:10:29 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201810251410.w9PEAT7v032165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Thu, 25 Oct 2018 14:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339712 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 339712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 14:10:30 -0000 Author: slavash Date: Thu Oct 25 14:10:28 2018 New Revision: 339712 URL: https://svnweb.freebsd.org/changeset/base/339712 Log: MFC r339584 : mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation If power exceed the slot limit, or slot limit is unknown the ConnectX-6 firmware will shutdown its port. Inform the user via debug message. Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Thu Oct 25 14:07:28 2018 (r339711) +++ stable/11/sys/dev/mlx5/device.h Thu Oct 25 14:10:28 2018 (r339712) @@ -549,6 +549,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED = 0xc, }; struct mlx5_eqe_port_module_event { Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Thu Oct 25 14:07:28 2018 (r339711) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Thu Oct 25 14:10:28 2018 (r339712) @@ -615,6 +615,12 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Cable is shorted"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYSTEM_POWER_SLOT_EXCEEDED: + return "One or more network ports have been powered " + "down due to insufficient/unadvertised power on " + "the PCIe slot. Please refer to the card's user " + "manual for power specifications or contact " + "Mellanox support."; default: return "Unknown error type"; From owner-svn-src-stable-11@freebsd.org Thu Oct 25 14:34:39 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10DF71078BCA; Thu, 25 Oct 2018 14:34:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA29085C2B; Thu, 25 Oct 2018 14:34:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B2F01325A; Thu, 25 Oct 2018 14:34:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PEYcPk047313; Thu, 25 Oct 2018 14:34:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PEYcrb047312; Thu, 25 Oct 2018 14:34:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810251434.w9PEYcrb047312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Oct 2018 14:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339714 - stable/11/sys/dev/sound/midi X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/midi X-SVN-Commit-Revision: 339714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 14:34:39 -0000 Author: hselasky Date: Thu Oct 25 14:34:38 2018 New Revision: 339714 URL: https://svnweb.freebsd.org/changeset/base/339714 Log: MFC r339581: Fix off-by-one which can lead to panics. Found by: Peter Holm Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/midi/sequencer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/midi/sequencer.c ============================================================================== --- stable/11/sys/dev/sound/midi/sequencer.c Thu Oct 25 14:12:48 2018 (r339713) +++ stable/11/sys/dev/sound/midi/sequencer.c Thu Oct 25 14:34:38 2018 (r339714) @@ -728,7 +728,7 @@ static int seq_fetch_mid(struct seq_softc *scp, int unit, kobj_t *md) { - if (unit > scp->midi_number || unit < 0) + if (unit >= scp->midi_number || unit < 0) return EINVAL; *md = scp->midis[unit]; From owner-svn-src-stable-11@freebsd.org Thu Oct 25 14:55:05 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEB010799FD; Thu, 25 Oct 2018 14:55:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0464F86DE5; Thu, 25 Oct 2018 14:55:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9BC913598; Thu, 25 Oct 2018 14:55:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PEt4ie057824; Thu, 25 Oct 2018 14:55:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PEt4HD057823; Thu, 25 Oct 2018 14:55:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201810251455.w9PEt4HD057823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Oct 2018 14:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339720 - stable/11/sys/dev/sound/midi X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/midi X-SVN-Commit-Revision: 339720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 14:55:05 -0000 Author: hselasky Date: Thu Oct 25 14:55:04 2018 New Revision: 339720 URL: https://svnweb.freebsd.org/changeset/base/339720 Log: MFC r339582: Drop sequencer mutex around uiomove() and make sure we don't move more bytes than is available, else a panic might happen. Found by: Peter Holm Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/midi/sequencer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/midi/sequencer.c ============================================================================== --- stable/11/sys/dev/sound/midi/sequencer.c Thu Oct 25 14:53:24 2018 (r339719) +++ stable/11/sys/dev/sound/midi/sequencer.c Thu Oct 25 14:55:04 2018 (r339720) @@ -919,7 +919,9 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int iof SEQ_DEBUG(8, printf("midiread: uiomove cc=%d\n", used)); MIDIQ_DEQ(scp->in_q, buf, used); + mtx_unlock(&scp->seq_lock); retval = uiomove(buf, used, uio); + mtx_lock(&scp->seq_lock); if (retval) goto err1; } @@ -994,7 +996,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io retval = ENXIO; goto err0; } + mtx_unlock(&scp->seq_lock); retval = uiomove(event, used, uio); + mtx_lock(&scp->seq_lock); if (retval) goto err0; @@ -1032,7 +1036,9 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io SEQ_DEBUG(2, printf("seq_write: SEQ_FULLSIZE flusing buffer.\n")); while (uio->uio_resid > 0) { - retval = uiomove(event, EV_SZ, uio); + mtx_unlock(&scp->seq_lock); + retval = uiomove(event, MIN(EV_SZ, uio->uio_resid), uio); + mtx_lock(&scp->seq_lock); if (retval) goto err0; @@ -1043,6 +1049,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io } retval = EINVAL; if (ev_code >= 128) { + int error; /* * Some sort of an extended event. The size is eight @@ -1052,7 +1059,13 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int io SEQ_DEBUG(2, printf("seq_write: invalid level two event %x.\n", ev_code)); goto err0; } - if (uiomove((caddr_t)&event[4], 4, uio)) { + mtx_unlock(&scp->seq_lock); + if (uio->uio_resid < 4) + error = EINVAL; + else + error = uiomove((caddr_t)&event[4], 4, uio); + mtx_lock(&scp->seq_lock); + if (error) { SEQ_DEBUG(2, printf("seq_write: user memory mangled?\n")); goto err0; From owner-svn-src-stable-11@freebsd.org Thu Oct 25 15:14:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06CFB107A6CF; Thu, 25 Oct 2018 15:14:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7E89887E1; Thu, 25 Oct 2018 15:14:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86902138EA; Thu, 25 Oct 2018 15:14:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PFEGeC068141; Thu, 25 Oct 2018 15:14:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PFEG6g068140; Thu, 25 Oct 2018 15:14:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201810251514.w9PFEG6g068140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Oct 2018 15:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339725 - stable/11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/tools X-SVN-Commit-Revision: 339725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 15:14:17 -0000 Author: gjb Date: Thu Oct 25 15:14:16 2018 New Revision: 339725 URL: https://svnweb.freebsd.org/changeset/base/339725 Log: MFC r339684: Reduce the GCE image size to 27G to be lower than the free quota limit. PR: 232313 Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/gce.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Thu Oct 25 15:11:18 2018 (r339724) +++ stable/11/release/tools/gce.conf Thu Oct 25 15:14:16 2018 (r339725) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# Reduce VMSIZE to be below the free quota limit. +export VMSIZE=27G + # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ From owner-svn-src-stable-11@freebsd.org Thu Oct 25 16:01:23 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D3FE107CF0E; Thu, 25 Oct 2018 16:01:23 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 039D88B7BD; Thu, 25 Oct 2018 16:01:23 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47A1B1410F; Thu, 25 Oct 2018 16:01:20 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9PG1KcL093504; Thu, 25 Oct 2018 16:01:20 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9PG1Kra093503; Thu, 25 Oct 2018 16:01:20 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201810251601.w9PG1Kra093503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 25 Oct 2018 16:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339734 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 339734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 16:01:23 -0000 Author: tijl Date: Thu Oct 25 16:01:19 2018 New Revision: 339734 URL: https://svnweb.freebsd.org/changeset/base/339734 Log: MFC r339618: Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod. Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 16:01:10 2018 (r339733) +++ stable/11/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 16:01:19 2018 (r339734) @@ -38,153 +38,309 @@ #include #include +/* + * XXX This is all x86 specific. It should be bus space access. + */ + +/* Access MMIO registers atomically without barriers and byte swapping. */ + +static inline uint8_t +__raw_readb(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define __raw_readb(addr) __raw_readb(addr) + +static inline void +__raw_writeb(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} +#define __raw_writeb(v, addr) __raw_writeb(v, addr) + +static inline uint16_t +__raw_readw(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define __raw_readw(addr) __raw_readw(addr) + +static inline void +__raw_writew(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} +#define __raw_writew(v, addr) __raw_writew(v, addr) + static inline uint32_t __raw_readl(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (*(const volatile uint32_t *)addr); } +#define __raw_readl(addr) __raw_readl(addr) static inline void -__raw_writel(uint32_t b, volatile void *addr) +__raw_writel(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + *(volatile uint32_t *)addr = v; } +#define __raw_writel(v, addr) __raw_writel(v, addr) +#ifdef __LP64__ static inline uint64_t __raw_readq(const volatile void *addr) { - return *(const volatile uint64_t *)addr; + return (*(const volatile uint64_t *)addr); } +#define __raw_readq(addr) __raw_readq(addr) static inline void -__raw_writeq(uint64_t b, volatile void *addr) +__raw_writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + *(volatile uint64_t *)addr = v; } +#define __raw_writeq(v, addr) __raw_writeq(v, addr) +#endif -/* - * XXX This is all x86 specific. It should be bus space access. - */ #define mmiowb() barrier() -#undef writel +/* Access little-endian MMIO registers atomically with memory barriers. */ + +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + uint8_t v; + + __compiler_membar(); + v = *(const volatile uint8_t *)addr; + __compiler_membar(); + return (v); +} +#define readb(addr) readb(addr) + +#undef writeb static inline void -writel(uint32_t b, void *addr) +writeb(uint8_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint8_t *)addr = v; + __compiler_membar(); } +#define writeb(v, addr) writeb(v, addr) -#undef writel_relaxed +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + uint16_t v; + + __compiler_membar(); + v = *(const volatile uint16_t *)addr; + __compiler_membar(); + return (v); +} +#define readw(addr) readw(addr) + +#undef writew static inline void -writel_relaxed(uint32_t b, void *addr) +writew(uint16_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint16_t *)addr = v; + __compiler_membar(); } +#define writew(v, addr) writew(v, addr) +#undef readl +static inline uint32_t +readl(const volatile void *addr) +{ + uint32_t v; + + __compiler_membar(); + v = *(const volatile uint32_t *)addr; + __compiler_membar(); + return (v); +} +#define readl(addr) readl(addr) + +#undef writel +static inline void +writel(uint32_t v, volatile void *addr) +{ + __compiler_membar(); + *(volatile uint32_t *)addr = v; + __compiler_membar(); +} +#define writel(v, addr) writel(v, addr) + +#undef readq #undef writeq +#ifdef __LP64__ +static inline uint64_t +readq(const volatile void *addr) +{ + uint64_t v; + + __compiler_membar(); + v = *(const volatile uint64_t *)addr; + __compiler_membar(); + return (v); +} +#define readq(addr) readq(addr) + static inline void -writeq(uint64_t b, void *addr) +writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + __compiler_membar(); + *(volatile uint64_t *)addr = v; + __compiler_membar(); } +#define writeq(v, addr) writeq(v, addr) +#endif -#undef writeb +/* Access little-endian MMIO registers atomically without memory barriers. */ + +#undef readb_relaxed +static inline uint8_t +readb_relaxed(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define readb_relaxed(addr) readb_relaxed(addr) + +#undef writeb_relaxed static inline void -writeb(uint8_t b, void *addr) +writeb_relaxed(uint8_t v, volatile void *addr) { - *(volatile uint8_t *)addr = b; + *(volatile uint8_t *)addr = v; } +#define writeb_relaxed(v, addr) writeb_relaxed(v, addr) -#undef writew +#undef readw_relaxed +static inline uint16_t +readw_relaxed(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define readw_relaxed(addr) readw_relaxed(addr) + +#undef writew_relaxed static inline void -writew(uint16_t b, void *addr) +writew_relaxed(uint16_t v, volatile void *addr) { - *(volatile uint16_t *)addr = b; + *(volatile uint16_t *)addr = v; } +#define writew_relaxed(v, addr) writew_relaxed(v, addr) +#undef readl_relaxed +static inline uint32_t +readl_relaxed(const volatile void *addr) +{ + return (*(const volatile uint32_t *)addr); +} +#define readl_relaxed(addr) readl_relaxed(addr) + +#undef writel_relaxed +static inline void +writel_relaxed(uint32_t v, volatile void *addr) +{ + *(volatile uint32_t *)addr = v; +} +#define writel_relaxed(v, addr) writel_relaxed(v, addr) + +#undef readq_relaxed +#undef writeq_relaxed +#ifdef __LP64__ +static inline uint64_t +readq_relaxed(const volatile void *addr) +{ + return (*(const volatile uint64_t *)addr); +} +#define readq_relaxed(addr) readq_relaxed(addr) + +static inline void +writeq_relaxed(uint64_t v, volatile void *addr) +{ + *(volatile uint64_t *)addr = v; +} +#define writeq_relaxed(v, addr) writeq_relaxed(v, addr) +#endif + +/* XXX On Linux ioread and iowrite handle both MMIO and port IO. */ + #undef ioread8 static inline uint8_t ioread8(const volatile void *addr) { - return *(const volatile uint8_t *)addr; + return (readb(addr)); } +#define ioread8(addr) ioread8(addr) #undef ioread16 static inline uint16_t ioread16(const volatile void *addr) { - return *(const volatile uint16_t *)addr; + return (readw(addr)); } +#define ioread16(addr) ioread16(addr) #undef ioread16be static inline uint16_t ioread16be(const volatile void *addr) { - return be16toh(*(const volatile uint16_t *)addr); + return (bswap16(readw(addr))); } +#define ioread16be(addr) ioread16be(addr) #undef ioread32 static inline uint32_t ioread32(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (readl(addr)); } +#define ioread32(addr) ioread32(addr) #undef ioread32be static inline uint32_t ioread32be(const volatile void *addr) { - return be32toh(*(const volatile uint32_t *)addr); + return (bswap32(readl(addr))); } +#define ioread32be(addr) ioread32be(addr) #undef iowrite8 static inline void iowrite8(uint8_t v, volatile void *addr) { - *(volatile uint8_t *)addr = v; + writeb(v, addr); } +#define iowrite8(v, addr) iowrite8(v, addr) #undef iowrite16 static inline void iowrite16(uint16_t v, volatile void *addr) { - *(volatile uint16_t *)addr = v; + writew(v, addr); } +#define iowrite16 iowrite16 #undef iowrite32 static inline void iowrite32(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = v; + writel(v, addr); } +#define iowrite32(v, addr) iowrite32(v, addr) #undef iowrite32be static inline void iowrite32be(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = htobe32(v); + writel(bswap32(v), addr); } - -#undef readb -static inline uint8_t -readb(const volatile void *addr) -{ - return *(const volatile uint8_t *)addr; -} - -#undef readw -static inline uint16_t -readw(const volatile void *addr) -{ - return *(const volatile uint16_t *)addr; -} - -#undef readl -static inline uint32_t -readl(const volatile void *addr) -{ - return *(const volatile uint32_t *)addr; -} +#define iowrite32be(v, addr) iowrite32be(v, addr) #if defined(__i386__) || defined(__amd64__) static inline void From owner-svn-src-stable-11@freebsd.org Fri Oct 26 05:12:58 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BD6E10D6ACA; Fri, 26 Oct 2018 05:12:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACB11844F1; Fri, 26 Oct 2018 05:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 736701C6EA; Fri, 26 Oct 2018 05:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q5CvST003031; Fri, 26 Oct 2018 05:12:57 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q5CvLn003027; Fri, 26 Oct 2018 05:12:57 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201810260512.w9Q5CvLn003027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 26 Oct 2018 05:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339767 - in stable/11: lib/libpmc sys/amd64/include sys/dev/hwpmc sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in stable/11: lib/libpmc sys/amd64/include sys/dev/hwpmc sys/sys X-SVN-Commit-Revision: 339767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 05:12:58 -0000 Author: mmacy Date: Fri Oct 26 05:12:56 2018 New Revision: 339767 URL: https://svnweb.freebsd.org/changeset/base/339767 Log: hwpmc: Enable hwpmc support for AMD Family 17H devices Adds new counters and events for family 17H devices. Adds libpmc support for family 17H devices. Direct commit to 11 as this is supported by way of JSON counter descriptions on 12 & HEAD. Submitted by: Girish Nandibasappa Differential Revision: https://reviews.freebsd.org/D17464 Modified: stable/11/lib/libpmc/libpmc.c stable/11/sys/amd64/include/pmc_mdep.h stable/11/sys/dev/hwpmc/hwpmc_amd.c stable/11/sys/dev/hwpmc/hwpmc_amd.h stable/11/sys/dev/hwpmc/pmc_events.h stable/11/sys/sys/pmc.h Modified: stable/11/lib/libpmc/libpmc.c ============================================================================== --- stable/11/lib/libpmc/libpmc.c Fri Oct 26 04:53:29 2018 (r339766) +++ stable/11/lib/libpmc/libpmc.c Fri Oct 26 05:12:56 2018 (r339767) @@ -61,6 +61,8 @@ static int ucp_allocate_pmc(enum pmc_event _pe, char * struct pmc_op_pmcallocate *_pmc_config); static int k8_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); +static int f17h_allocate_pmc(enum pmc_event _pe, char *_ctrspec, + struct pmc_op_pmcallocate *_pmc_config); static int p4_allocate_pmc(enum pmc_event _pe, char *_ctrspec, struct pmc_op_pmcallocate *_pmc_config); #endif @@ -157,6 +159,7 @@ struct pmc_class_descr { PMC_CLASSDEP_TABLE(iaf, IAF); PMC_CLASSDEP_TABLE(k7, K7); PMC_CLASSDEP_TABLE(k8, K8); +PMC_CLASSDEP_TABLE(f17h, F17H); PMC_CLASSDEP_TABLE(p4, P4); PMC_CLASSDEP_TABLE(p5, P5); PMC_CLASSDEP_TABLE(p6, P6); @@ -342,6 +345,7 @@ PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLAS PMC_MDEP_TABLE(westmere_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); +PMC_MDEP_TABLE(f17h, F17H, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p5, P5, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p6, P6, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -408,6 +412,7 @@ PMC_CLASS_TABLE_DESC(k7, K7, k7, k7); #endif #if defined(__i386__) || defined(__amd64__) PMC_CLASS_TABLE_DESC(k8, K8, k8, k8); +PMC_CLASS_TABLE_DESC(f17h, F17H, f17h, f17h); PMC_CLASS_TABLE_DESC(p4, P4, p4, p4); #endif #if defined(__i386__) @@ -1158,7 +1163,717 @@ ucp_allocate_pmc(enum pmc_event pe, char *ctrspec, return (0); } +/* AMD Fam17H PMCs */ +static struct pmc_event_alias f17h_aliases[] = { + EV_ALIAS("branches", "ex_ret_brn_tkn"), + EV_ALIAS("branch-mispredicts", + "ex_ret_brn_tkn_misp"), + EV_ALIAS("cycles", "tsc"), + EV_ALIAS("dc-access", "ls_dc_access"), + EV_ALIAS("ic-misses", "ic_fw32_miss"), + EV_ALIAS("instructions", "ex_ret_inst"), + EV_ALIAS("unhalted-cycles", "ls_not_halted_cycle"), + EV_ALIAS(NULL, NULL) +}; +#define __F17HMASK(N, V) PMCMASK(N, (1 << (V))) +static const struct pmc_masks f17h_mask_FPU_PIPEASSIGMENT[] = { + __F17HMASK(FPU_PIPEASSIGMENT_uOP_P0, 0), + __F17HMASK(FPU_PIPEASSIGMENT_uOP_P1, 1), + __F17HMASK(FPU_PIPEASSIGMENT_uOP_P2, 2), + __F17HMASK(FPU_PIPEASSIGMENT_uOP_P3, 3), + __F17HMASK(FPU_PIPEASSIGMENT_MultiuOP_P0, 4), + __F17HMASK(FPU_PIPEASSIGMENT_MultiuOP_P1, 5), + __F17HMASK(FPU_PIPEASSIGMENT_MultiuOP_P2, 6), + __F17HMASK(FPU_PIPEASSIGMENT_MultiuOP_P3, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_FP_SCHED_EMPTY[] = { + __F17HMASK(FP_SCHED_EMPTY, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_FP_RET_X87_FPOPS[] = { + __F17HMASK(FP_RET_X87_ADDSUBOPS, 0), + __F17HMASK(FP_RET_X87_MULOPS, 1), + __F17HMASK(FP_RET_X87_DIVSQRTOPS, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_FP_RET_SSEAVX_OPS[] = { + __F17HMASK(FP_RET_SSEAVX_SPADDSUBOPS, 0), + __F17HMASK(FP_RET_SSEAVX_SPMULOPS, 1), + __F17HMASK(FP_RET_SSEAVX_SPDIVOPS, 2), + __F17HMASK(FP_RET_SSEAVX_SPMULADDOPS, 3), + __F17HMASK(FP_RET_SSEAVX_DPADDSUBOPS, 4), + __F17HMASK(FP_RET_SSEAVX_DPMULOPS, 5), + __F17HMASK(FP_RET_SSEAVX_DPDIVOPS, 6), + __F17HMASK(FP_RET_SSEAVX_DPMULADDOPS, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_FP_NUM_MOVELIM_SCAL_OPT[] = { + __F17HMASK(FP_NUM_SSEMOV_OPS, 0), + __F17HMASK(FP_NUM_SSEMOV_ELIM, 1), + __F17HMASK(FP_NUM_OPS_OPTPOT, 2), + __F17HMASK(FP_NUM_OPS_OPT, 3), + NULLMASK +}; +static const struct pmc_masks f17h_mask_FP_RET_SEROPS[] = { + __F17HMASK(FP_RET_SSE_BOTEXEC, 0), + __F17HMASK(FP_RET_SSE_CTRL, 1), + __F17HMASK(FP_RET_BOTEXEC, 2), + __F17HMASK(FP_RET_X87_CTRL, 3), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_BAD_STATUS2[] = { + __F17HMASK(LS_BAD_STATUS2_STLI_NOSTATE, 0), + __F17HMASK(LS_BAD_STATUS2_STLI_OTHER, 1), + __F17HMASK(LS_BAD_STATUS2_STLF_NODATA, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_LOCKS[] = { + __F17HMASK(LS_LOCKS_BUSLOCKS, 0), + __F17HMASK(LS_LOCKS_NONSPECLOCK, 1), + __F17HMASK(LS_SPECLOCK, 2), + __F17HMASK(LS_SPECLCOK_MAPCOMMIT, 3), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_RET_CLFLUSH_INST[] = { + __F17HMASK(LS_RET_CLFLUSH_INST, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_RET_CPUID_INST[] = { + __F17HMASK(LS_RET_CPUID_INST, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_DISPATCH[] = { + __F17HMASK(LS_DISPATCH_LD, 0), + __F17HMASK(LS_DISPATCH_STR, 1), + __F17HMASK(LS_DISPATCH_LDSTR, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_SMI_RX[] = { + __F17HMASK(LS_SMI_RX, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_STLF[] = { + __F17HMASK(LS_STLF, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_STLF_COMMITCANCEL[] = { + __F17HMASK(LS_STLF_COMMITCANCEL, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_DC_ACCESS[] = { + __F17HMASK(LS_DC_ACCESS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_MAB_ALLOCPIPE[] = { + __F17HMASK(LS_MAB_ALLOCPIPE_DATAPIPE, 0), + __F17HMASK(LS_MAB_ALLOCPIPE_STPIPE, 1), + __F17HMASK(LS_MAB_ALLOCPIPE_TLBPIPELATE, 2), + __F17HMASK(LS_MAB_ALLOCPIPE_HWPF, 3), + __F17HMASK(LS_MAB_ALLOCPIPE_TLPPIPEEARLY, 4), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_REFFILS_FROM_SYS[] = { + __F17HMASK(LS_MABRESP_LCL_L2, 0), + __F17HMASK(LS_MABRESP_LCL_CACHE, 1), + __F17HMASK(LS_MABRESP_LCL_DRAM, 3), + __F17HMASK(LS_MABRESP_LCL_RMT_CACHE, 4), + __F17HMASK(LS_MABRESP_LCL_RMT_DRAM, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_L1_DTLBMISS[] = { + __F17HMASK(LS_TLBRELOAD_4KL2HIT, 0), + __F17HMASK(LS_TLBRELOAD_32KL2HIT, 1), + __F17HMASK(LS_TLBRELOAD_2ML2HIT, 2), + __F17HMASK(LS_TLBRELOAD_1GL2HIT, 3), + __F17HMASK(LS_TLBRELOAD_4KL2MISS, 4), + __F17HMASK(LS_TLBRELOAD_32KML2MISS, 5), + __F17HMASK(LS_TLBRELOAD_2ML2MISS, 6), + __F17HMASK(LS_TLBRELOAD_1GL2MISS, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_TABLEWALKER[] = { + __F17HMASK(LS_PERFMON_TW_ALLOCDSIDE0, 0), + __F17HMASK(LS_PERFMON_TW_ALLOCDSIDE1, 1), + __F17HMASK(LS_PERFMON_TW_ALLOCISIDE0, 2), + __F17HMASK(LS_PERFMON_TW_ALLOCISIDE1, 3), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_MISAL_ACCESS[] = { + __F17HMASK(LS_MISAL_ACCESS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_PREF_INST_DISPATCH[] = { + __F17HMASK(LS_LOAD_PREF_W, 0), + __F17HMASK(LS_STORE_PREF_W, 1), + __F17HMASK(LS_PREF_PREFETCH_NTA, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_HWPF_ALLOCATED[] = { + __F17HMASK(LS_ALLOC_STREAM_PF, 0), + __F17HMASK(LS_ALLOC_STRIDE_PF, 1), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_HWPF_HIT[] = { + __F17HMASK(LS_HIT_STREAM_PF, 0), + __F17HMASK(LS_HIT_STRIDE_PF, 1), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_TW_INPROG_DSIDE[] = { + __F17HMASK(LS_TW_INPROG_DSIDE0, 0), + __F17HMASK(LS_TW_INPROG_ISIDE0, 1), + __F17HMASK(LS_TW_INPROG_DSIDE1, 2), + __F17HMASK(LS_TW_INPROG_ISIDE1, 3), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_INEF_SW_PREF[] = { + __F17HMASK(LS_INEF_SW_PREF_DATAPIPE_SW_PF_DCHIT, 0), + __F17HMASK(LS_INEF_SW_PREF_MAB_MCH_CNT, 1), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_MAB_MCH_CNT[] = { + __F17HMASK(LS_MAB_MCH_CNT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_HW_PF_MABALLOC[] = { + __F17HMASK(LS_MABALLOC_HW_PFSTREAM, 0), + __F17HMASK(LS_MABALLOC_HW_PFSTRIDE, 1), + __F17HMASK(LS_MABALLOC_PFREGION, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_HW_PF_MATCH[] = { + __F17HMASK(LS_MATCH_HW_PFSTREAM, 0), + __F17HMASK(LS_MATCH_HW_PFSTRIDE, 1), + __F17HMASK(LS_MATCH_HW_PFREGION, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_SW_PF_DCFILLS[] = { + __F17HMASK(LS_SW_PF_MABRESP_LCL_L2, 0), + __F17HMASK(LS_SW_PF_MABRESP_LCL_L2_CACHE, 1), + __F17HMASK(LS_SW_PF_MABRESP_LCL_DRM, 3), + __F17HMASK(LS_SW_PF_MABRESP_RMT_CACHE, 4), + __F17HMASK(LS_SW_PF_MABRESP_RMT_DRAM, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_HW_PF_DCFILLS[] = { + __F17HMASK(LS_HW_PF_MABRESP_LCL_L2, 0), + __F17HMASK(LS_HW_PF_MABRESP_LCL_CACHE, 1), + __F17HMASK(LS_HW_PF_MABRESP_LCL_DRAM, 3), + __F17HMASK(LS_HW_PF_MABRESP_RMT_CACHE, 4), + __F17HMASK(LS_HW_PF_MABRESP_RMT_DRAM, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_TW_DCFILLS[] = { + __F17HMASK(LS_TW_MABRESP_LCL_L2, 0), + __F17HMASK(LS_TW_MABRESP_LCL_CACHE, 1), + __F17HMASK(LS_TW_MABRESP_LCL_DRAM, 3), + __F17HMASK(LS_TW_MABRESP_RMT_CACHE, 4), + __F17HMASK(LS_TW_MABRESP_RMT_DRAM, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_ALLOC_MAB_COUNT[] = { + __F17HMASK(LS_ALLOC_MAB_COUNT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_TW_INITLEVEL[] = { + __F17HMASK(LS_TW_INITLGH_NATIVE_PDPT, 0), + __F17HMASK(LS_TW_INITLGH_NATIVE_PDT, 1), + __F17HMASK(LS_TW_INITLGH_NATIVE_PFT, 2), + __F17HMASK(LS_TW_INITLGH_NATIVE_PG, 3), + __F17HMASK(LS_TW_INITL_NESTED_PDPT, 4), + __F17HMASK(LS_TW_INITL_NESTED_PDT, 5), + __F17HMASK(LS_TW_INITL_NESTED_PFT, 6), + __F17HMASK(LS_TW_INITL_NESTED_PG, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_NOT_HALTED_CYCLE[] = { + __F17HMASK(LS_NOT_HALTED_CYCLE, 0x00), + NULLMASK +}; +static const struct pmc_masks f17h_mask_LS_TW_RETURN_TYPES[] = { + __F17HMASK(LS_TWC_RET_TYPE_SPEC_VALID, 0), + __F17HMASK(LS_TWC_RET_TYPE_SPEC_FAULT_NAB, 2), + __F17HMASK(LS_TWC_RET_TYPE_SPEC_FAULT_AB, 3), + __F17HMASK(LS_TWC_RET_TYPE_NONSPEC_VALID, 6), + __F17HMASK(LS_TWC_RET_TYPE_NONSPEC_FAULT, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_FW32[] = { + __F17HMASK(IC_FW32, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_FW32_MISS[] = { + __F17HMASK(IC_FW32_MISS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_CACHEFILL_L2[] = { + __F17HMASK(IC_CACHEFILL_L2, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_CACHEFILL_SYS[] = { + __F17HMASK(IC_CACHEFILL_SYS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_BP_L1TLBMISS_L2HIT[] = { + __F17HMASK(BP_L1TLBMISS_L2HIT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_BP_L1TLBMISS_L2MISS[] = { + __F17HMASK(BP_L1TLBMISS_L2MISS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_FETCHSTALL[] = { + __F17HMASK(IC_FETCHSTALL_BACKPRESSURE, 0), + __F17HMASK(IC_FETCHSTALL_DQEMPTY, 1), + __F17HMASK(IC_FETCHSTALL_ANY, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_BP_L1_BTBCORRECT[] = { + __F17HMASK(BP_L1_BTBCORRECT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_BP_L2_BTBCORRECT[] = { + __F17HMASK(BP_L2_BTBCORRECT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_IC_CACHEINVAL[] = { + __F17HMASK(IC_CACHEINVAL_FILLINV, 0), + __F17HMASK(IC_CACHEINVAL_L2_INV_PROVBE, 1), + NULLMASK +}; +static const struct pmc_masks f17h_mask_BP_TLB_REL[] = { + __F17HMASK(BP_TLB_REL, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_ICOC_MODE_SWITCH[] = { + __F17HMASK(IC2OC_MODE_SWITCH, 0), + __F17HMASK(OC2IC_MODE_SWITCH, 1), + NULLMASK +}; +static const struct pmc_masks f17h_mask_DE_DISPATCH_TOKEN_STALLS[] = { + __F17HMASK(DE_ALSQ1_TOKEN_STALL, 0), + __F17HMASK(DE_ALSQ2_TOKEN_STALL, 1), + __F17HMASK(DE_ALSQ3_TOKEN_STALL, 2), + __F17HMASK(DE_ALSQ3_0_TOKEN_STALL, 3), + __F17HMASK(DE_ALU_TOKEN_STALL, 4), + __F17HMASK(DE_AGSQ_TOKEN_STALL, 5), + __F17HMASK(DE_RETIRE_TOKEN_STALLS, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_INST[] = { + __F17HMASK(EX_RET_INST, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_COPS[] = { + __F17HMASK(EX_RET_COPS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN[] = { + __F17HMASK(EX_RET_BRN, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_MISP[] = { + __F17HMASK(EX_RET_BRN_MISP, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_TKN[] = { + __F17HMASK(EX_RET_BRN_TKN, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_TKN_MISP[] = { + __F17HMASK(EX_RET_BRN_TKN_MISP, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_FAR[] = { + __F17HMASK(EX_RET_BRN_FAR, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_RESYNC[] = { + __F17HMASK(EX_RET_BRN_RESYNC, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_NEAR_RET[] = { + __F17HMASK(EX_RET_BRN_NEAR_RET, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_NEAR_RET_MISPRED[] = { + __F17HMASK(EX_RET_BRN_NEAR_RET_MISPRED, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_BRN_IND_MISP[] = { + __F17HMASK(EX_RET_BRN_IND_MISP, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_MMX_FP_INSTR[] = { + __F17HMASK(EX_RET_MMX_X87_INST, 0), + __F17HMASK(EX_RET_MMX_INSTR, 1), + __F17HMASK(EX_RET_MMX_SSE_INSTR, 2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_COND_BRN[] = { + __F17HMASK(EX_RET_COND_BRN, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_DIV_BUSY[] = { + __F17HMASK(EX_DIV_BUSY, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_DIV_COUNT[] = { + __F17HMASK(EX_DIV_COUNT, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_REQUEST_G1[] = { + __F17HMASK(L2_REQUEST_G1_OTHERREQ, 0), + __F17HMASK(L2_REQUEST_G1_HWPF, 1), + __F17HMASK(L2_REQUEST_G1_PREFETCHL2, 2), + __F17HMASK(L2_REQUEST_G1_CHANGETOX, 3), + __F17HMASK(L2_REQUEST_G1_CACHEABLEICRD, 4), + __F17HMASK(L2_REQUEST_G1_LSRDBLKC, 5), + __F17HMASK(L2_REQUEST_G1_RDBLKX, 6), + __F17HMASK(L2_REQUEST_G1_RDBLKL, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_REQUEST_G2[] = { + __F17HMASK(L2_REQUEST_G2_BUSLOCKRESP, 0), + __F17HMASK(L2_REQUEST_G2_BUSLOCKORIG, 1), + __F17HMASK(L2_REQUEST_G2_SMCINV, 2), + __F17HMASK(L2_REQUEST_G2_ICRDSIZENC, 3), + __F17HMASK(L2_REQUEST_G2_ICRDSIZE, 4), + __F17HMASK(L2_REQUEST_G2_LSRDSIZENC, 5), + __F17HMASK(L2_REQUEST_G2_LSRDSIZE, 6), + __F17HMASK(L2_REQUEST_G2_GROUP1, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_LATENCY[] = { + __F17HMASK(L2_LATENCY_CYC_WAITINGONFILLS, 0x0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_WBCREQ[] = { + __F17HMASK(L2_WBCREQ_CLZERO, 0), + __F17HMASK(L2_WBCREQ_LOCALICCLR, 1), + __F17HMASK(L2_WBCREQ_ZEROBYTESTORE, 2), + __F17HMASK(L2_WBCREQ_ILINEFLUSH, 3), + __F17HMASK(L2_WBCREQ_CACHELINEFLUSH, 4), + __F17HMASK(L2_WBCREQ_WBCCLOSE, 5), + __F17HMASK(L2_WBCREQ_WCBWRITE, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_CACHEREQSTAT[] = { + __F17HMASK(L2_CACHEREQSTAT_ICFILLMISS, 0), + __F17HMASK(L2_CACHEREQSTAT_ICFILLHITS, 1), + __F17HMASK(L2_CACHEREQSTAT_ICFILLHITX, 2), + __F17HMASK(L2_CACHEREQSTAT_LSRDBLKC, 3), + __F17HMASK(L2_CACHEREQSTAT_LSRDBLKX, 4), + __F17HMASK(L2_CACHEREQSTAT_LSRDBLKLHITS, 5), + __F17HMASK(L2_CACHEREQSTAT_LSRDBLKLHITX, 6), + __F17HMASK(L2_CACHEREQSTAT_LSRDBLKCS, 7), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_SMCEVENTS[] = { + __F17HMASK(L2_SMCEVENTS_ICFILLSTQCAMMATOT, 0), + __F17HMASK(L2_SMCEVENTS_ICFILLSTQCAMMATTT, 1), + __F17HMASK(L2_SMCEVENTS_LSRDBLKLSXCHGTOX, 2), + __F17HMASK(L2_SMCEVENTS_RDBLKXCHGTOX, 3), + __F17HMASK(L2_SMCEVENTS_LSRDBLKLSCHITL2ICVAL, 4), + __F17HMASK(L2_SMCEVENTS_ICFETCHHITL2, 5), + __F17HMASK(L2_SMCEVENTS_ICFETCHHITL2DCVAL, 6), + NULLMASK +}; +static const struct pmc_masks f17h_mask_L2_FILLPENDING[] = { + __F17HMASK(L2_FILLPENDING_L2FILLBUSY, 0), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_TAGGED_IBSOPS[] = { + __F17HMASK(EX_TAGGED_IBSOPS, 0x0), + __F17HMASK(EX_TAGGED_IBSOPS_RET, 0x1), + __F17HMASK(EX_TAGGED_IBSOPS_CNT_RLOVER, 0x2), + NULLMASK +}; +static const struct pmc_masks f17h_mask_EX_RET_FUSED_BRNCH_INST[] = { + __F17HMASK(EX_RET_FUSED_BRNCH_INST, 0x0), + NULLMASK +}; + +#define F17H_KW_COUNT "count" +#define F17H_KW_EDGE "edge" +#define F17H_KW_INV "inv" +#define F17H_KW_MASK "mask" +#define F17H_KW_OS "os" +#define F17H_KW_USR "usr" + +static int +f17h_allocate_pmc(enum pmc_event pe, char *ctrspec, + struct pmc_op_pmcallocate *pmc_config) +{ + char *e, *p, *q; + int n; + uint32_t count; + const struct pmc_masks *pmask; + uint64_t evmask = 0; + (void)ctrspec; + + pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE); + pmc_config->pm_md.pm_amd.pm_amd_config = 0; + + +#define __F17HSETMASK(M) pmask = f17h_mask_##M + switch (pe) { + case PMC_EV_F17H_FPU_PIPEASSIGMENT: + __F17HSETMASK(FPU_PIPEASSIGMENT); + break; + case PMC_EV_F17H_FP_SCHED_EMPTY: + __F17HSETMASK(FP_SCHED_EMPTY); + break; + case PMC_EV_F17H_FP_RET_X87_FPOPS: + __F17HSETMASK(FP_RET_X87_FPOPS); + break; + case PMC_EV_F17H_FP_RET_SSEAVX_OPS: + __F17HSETMASK(FP_RET_SSEAVX_OPS); + break; + case PMC_EV_F17H_FP_NUM_MOVELIM_SCAL_OPT: + __F17HSETMASK(FP_NUM_MOVELIM_SCAL_OPT); + break; + case PMC_EV_F17H_FP_RET_SEROPS: + __F17HSETMASK(FP_RET_SEROPS); + break; + case PMC_EV_F17H_LS_BAD_STATUS2: + __F17HSETMASK(LS_BAD_STATUS2); + break; + case PMC_EV_F17H_LS_LOCKS: + __F17HSETMASK(LS_LOCKS); + break; + case PMC_EV_F17H_LS_RET_CLFLUSH_INST: + __F17HSETMASK(LS_RET_CLFLUSH_INST); + break; + case PMC_EV_F17H_LS_RET_CPUID_INST: + __F17HSETMASK(LS_RET_CPUID_INST); + break; + case PMC_EV_F17H_LS_DISPATCH: + __F17HSETMASK(LS_DISPATCH); + break; + case PMC_EV_F17H_LS_SMI_RX: + __F17HSETMASK(LS_SMI_RX); + break; + case PMC_EV_F17H_LS_STLF: + __F17HSETMASK(LS_STLF); + break; + case PMC_EV_F17H_LS_STLF_COMMITCANCEL: + __F17HSETMASK(LS_STLF_COMMITCANCEL); + break; + case PMC_EV_F17H_LS_DC_ACCESS: + __F17HSETMASK(LS_DC_ACCESS); + break; + case PMC_EV_F17H_LS_MAB_ALLOCPIPE: + __F17HSETMASK(LS_MAB_ALLOCPIPE); + break; + case PMC_EV_F17H_LS_REFFILS_FROM_SYS: + __F17HSETMASK(LS_REFFILS_FROM_SYS); + break; + case PMC_EV_F17H_LS_L1_DTLBMISS: + __F17HSETMASK(LS_L1_DTLBMISS); + break; + case PMC_EV_F17H_LS_TABLEWALKER: + __F17HSETMASK(LS_TABLEWALKER); + break; + case PMC_EV_F17H_LS_MISAL_ACCESS: + __F17HSETMASK(LS_MISAL_ACCESS); + break; + case PMC_EV_F17H_LS_PREF_INST_DISPATCH: + __F17HSETMASK(LS_PREF_INST_DISPATCH); + break; + case PMC_EV_F17H_LS_HWPF_ALLOCATED: + __F17HSETMASK(LS_HWPF_ALLOCATED); + break; + case PMC_EV_F17H_LS_HWPF_HIT: + __F17HSETMASK(LS_HWPF_HIT); + break; + case PMC_EV_F17H_LS_TW_INPROG_DSIDE: + __F17HSETMASK(LS_TW_INPROG_DSIDE); + break; + case PMC_EV_F17H_LS_INEF_SW_PREF: + __F17HSETMASK(LS_INEF_SW_PREF); + break; + case PMC_EV_F17H_LS_MAB_MCH_CNT: + __F17HSETMASK(LS_MAB_MCH_CNT); + break; + case PMC_EV_F17H_LS_HW_PF_MABALLOC: + __F17HSETMASK(LS_HW_PF_MABALLOC); + break; + case PMC_EV_F17H_LS_HW_PF_MATCH: + __F17HSETMASK(LS_HW_PF_MATCH); + break; + case PMC_EV_F17H_LS_SW_PF_DCFILLS: + __F17HSETMASK(LS_SW_PF_DCFILLS); + break; + case PMC_EV_F17H_LS_HW_PF_DCFILLS: + __F17HSETMASK(LS_HW_PF_DCFILLS); + break; + case PMC_EV_F17H_LS_TW_DCFILLS: + __F17HSETMASK(LS_TW_DCFILLS); + break; + case PMC_EV_F17H_LS_ALLOC_MAB_COUNT: + __F17HSETMASK(LS_ALLOC_MAB_COUNT); + break; + case PMC_EV_F17H_LS_TW_INITLEVEL: + __F17HSETMASK(LS_TW_INITLEVEL); + break; + case PMC_EV_F17H_LS_NOT_HALTED_CYCLE: + __F17HSETMASK(LS_NOT_HALTED_CYCLE); + break; + case PMC_EV_F17H_LS_TW_RETURN_TYPES: + __F17HSETMASK(LS_TW_RETURN_TYPES); + break; + case PMC_EV_F17H_IC_FW32: + __F17HSETMASK(IC_FW32); + break; + case PMC_EV_F17H_IC_FW32_MISS: + __F17HSETMASK(IC_FW32_MISS); + break; + case PMC_EV_F17H_IC_CACHEFILL_L2: + __F17HSETMASK(IC_CACHEFILL_L2); + break; + case PMC_EV_F17H_IC_CACHEFILL_SYS: + __F17HSETMASK(IC_CACHEFILL_SYS); + break; + case PMC_EV_F17H_BP_L1TLBMISS_L2HIT: + __F17HSETMASK(BP_L1TLBMISS_L2HIT); + break; + case PMC_EV_F17H_BP_L1TLBMISS_L2MISS: + __F17HSETMASK(BP_L1TLBMISS_L2MISS); + break; + case PMC_EV_F17H_IC_FETCHSTALL: + __F17HSETMASK(IC_FETCHSTALL); + break; + case PMC_EV_F17H_BP_L1_BTBCORRECT: + __F17HSETMASK(BP_L1_BTBCORRECT); + break; + case PMC_EV_F17H_BP_L2_BTBCORRECT: + __F17HSETMASK(BP_L2_BTBCORRECT); + break; + case PMC_EV_F17H_IC_CACHEINVAL: + __F17HSETMASK(IC_CACHEINVAL); + break; + case PMC_EV_F17H_BP_TLB_REL: + __F17HSETMASK(BP_TLB_REL); + break; + case PMC_EV_F17H_ICOC_MODE_SWITCH: + __F17HSETMASK(ICOC_MODE_SWITCH); + break; + case PMC_EV_F17H_DE_DISPATCH_TOKEN_STALLS: + __F17HSETMASK(DE_DISPATCH_TOKEN_STALLS); + break; + case PMC_EV_F17H_EX_RET_INST: + __F17HSETMASK(EX_RET_INST); + break; + case PMC_EV_F17H_EX_RET_COPS: + __F17HSETMASK(EX_RET_COPS); + break; + case PMC_EV_F17H_EX_RET_BRN: + __F17HSETMASK(EX_RET_BRN); + break; + case PMC_EV_F17H_EX_RET_BRN_MISP: + __F17HSETMASK(EX_RET_BRN_MISP); + break; + case PMC_EV_F17H_EX_RET_BRN_TKN: + __F17HSETMASK(EX_RET_BRN_TKN); + break; + case PMC_EV_F17H_EX_RET_BRN_TKN_MISP: + __F17HSETMASK(EX_RET_BRN_TKN_MISP); + break; + case PMC_EV_F17H_EX_RET_BRN_FAR: + __F17HSETMASK(EX_RET_BRN_FAR); + break; + case PMC_EV_F17H_EX_RET_BRN_RESYNC: + __F17HSETMASK(EX_RET_BRN_RESYNC); + break; + case PMC_EV_F17H_EX_RET_BRN_NEAR_RET: + __F17HSETMASK(EX_RET_BRN_NEAR_RET); + break; + case PMC_EV_F17H_EX_RET_BRN_NEAR_RET_MISPRED: + __F17HSETMASK(EX_RET_BRN_NEAR_RET_MISPRED); + break; + case PMC_EV_F17H_EX_RET_BRN_IND_MISP: + __F17HSETMASK(EX_RET_BRN_IND_MISP); + break; + case PMC_EV_F17H_EX_RET_MMX_FP_INSTR: + __F17HSETMASK(EX_RET_MMX_FP_INSTR); + break; + case PMC_EV_F17H_EX_RET_COND_BRN: + __F17HSETMASK(EX_RET_COND_BRN); + break; + case PMC_EV_F17H_EX_DIV_BUSY: + __F17HSETMASK(EX_DIV_BUSY); + break; + case PMC_EV_F17H_EX_DIV_COUNT: + __F17HSETMASK(EX_DIV_COUNT); + break; + case PMC_EV_F17H_L2_REQUEST_G1: + __F17HSETMASK(L2_REQUEST_G1); + break; + case PMC_EV_F17H_L2_REQUEST_G2: + __F17HSETMASK(L2_REQUEST_G2); + break; + case PMC_EV_F17H_L2_LATENCY: + __F17HSETMASK(L2_LATENCY); + break; + case PMC_EV_F17H_L2_WBCREQ: + __F17HSETMASK(L2_WBCREQ); + break; + case PMC_EV_F17H_L2_CACHEREQSTAT: + __F17HSETMASK(L2_CACHEREQSTAT); + break; + case PMC_EV_F17H_L2_SMCEVENTS: + __F17HSETMASK(L2_SMCEVENTS); + break; + case PMC_EV_F17H_L2_FILLPENDING: + __F17HSETMASK(L2_FILLPENDING); + break; + case PMC_EV_F17H_EX_TAGGED_IBSOPS: + __F17HSETMASK(EX_TAGGED_IBSOPS); + break; + case PMC_EV_F17H_EX_RET_FUSED_BRNCH_INST: + __F17HSETMASK(EX_RET_FUSED_BRNCH_INST); + break; + default: + printf(" %s failed, event not supported\n", __FUNCTION__); + return -1; + } + while ((p = strsep(&ctrspec, ",")) != NULL) { + if (KWPREFIXMATCH(p, F17H_KW_COUNT "=")) { + q = strchr(p, '='); + if (*++q == '\0') /* skip '=' */ + return (-1); + + count = strtol(q, &e, 0); + if (e == q || *e != '\0') + return (-1); + + pmc_config->pm_caps |= PMC_CAP_THRESHOLD; + pmc_config->pm_md.pm_amd.pm_amd_config |= + AMD_PMC_TO_COUNTER(count); + + } else if (KWMATCH(p, F17H_KW_EDGE)) { + pmc_config->pm_caps |= PMC_CAP_EDGE; + } else if (KWMATCH(p, F17H_KW_INV)) { + pmc_config->pm_caps |= PMC_CAP_INVERT; + } else if (KWPREFIXMATCH(p, F17H_KW_MASK "=")) { + if ((n = pmc_parse_mask(pmask, p, &evmask)) < 0) + return (-1); + pmc_config->pm_caps |= PMC_CAP_QUALIFIER; + } else if (KWMATCH(p, F17H_KW_OS)) { + pmc_config->pm_caps |= PMC_CAP_SYSTEM; + } else if (KWMATCH(p, F17H_KW_USR)) { + pmc_config->pm_caps |= PMC_CAP_USER; + } else + return (-1); +} + if (pmc_config->pm_caps & PMC_CAP_QUALIFIER) { + pmc_config->pm_md.pm_amd.pm_amd_config = + AMD_PMC_TO_UNITMASK(evmask); + } + return 0; +} /* * AMD K8 PMCs. * @@ -3092,6 +3807,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char ev = k8_event_table; count = PMC_EVENT_TABLE_SIZE(k8); break; + case PMC_CLASS_F17H: + ev = f17h_event_table; + count = PMC_EVENT_TABLE_SIZE(f17h); + break; case PMC_CLASS_P4: ev = p4_event_table; count = PMC_EVENT_TABLE_SIZE(p4); @@ -3360,6 +4079,10 @@ pmc_init(void) PMC_MDEP_INIT(k8); pmc_class_table[n] = &k8_class_table_descr; break; + case PMC_CPU_AMD_F17H: + PMC_MDEP_INIT(f17h); + pmc_class_table[n] = &f17h_class_table_descr; + break; case PMC_CPU_INTEL_ATOM: PMC_MDEP_INIT_INTEL_V2(atom); break; @@ -3675,6 +4398,10 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype } else if (pe >= PMC_EV_K8_FIRST && pe <= PMC_EV_K8_LAST) { ev = k8_event_table; evfence = k8_event_table + PMC_EVENT_TABLE_SIZE(k8); + } else if ((int)pe >= PMC_EV_F17H_FIRST && + (int)pe <= PMC_EV_F17H_LAST) { + ev = f17h_event_table; + evfence = f17h_event_table + PMC_EVENT_TABLE_SIZE(f17h); } else if (pe >= PMC_EV_P4_FIRST && pe <= PMC_EV_P4_LAST) { ev = p4_event_table; evfence = p4_event_table + PMC_EVENT_TABLE_SIZE(p4); Modified: stable/11/sys/amd64/include/pmc_mdep.h ============================================================================== --- stable/11/sys/amd64/include/pmc_mdep.h Fri Oct 26 04:53:29 2018 (r339766) +++ stable/11/sys/amd64/include/pmc_mdep.h Fri Oct 26 05:12:56 2018 (r339767) @@ -52,6 +52,7 @@ struct pmc_mdep; */ #define PMC_MDEP_CLASS_INDEX_TSC 1 #define PMC_MDEP_CLASS_INDEX_K8 2 +#define PMC_MDEP_CLASS_INDEX_F17H 2 #define PMC_MDEP_CLASS_INDEX_P4 2 #define PMC_MDEP_CLASS_INDEX_IAP 2 #define PMC_MDEP_CLASS_INDEX_IAF 3 Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 04:53:29 2018 (r339766) +++ stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 05:12:56 2018 (r339767) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #ifdef HWPMC_DEBUG enum pmc_class amd_pmc_class; #endif - +int AMD_cpufamily = 0, npmc = 0; /* AMD K7 & K8 PMCs */ struct amd_descr { struct pmc_descr pm_descr; /* "base class" */ @@ -103,12 +103,38 @@ static struct amd_descr amd_pmcdesc[AMD_NPMCS] = }, .pm_evsel = AMD_PMC_EVSEL_3, .pm_perfctr = AMD_PMC_PERFCTR_3 - } + }, + { + .pm_descr = + { + .pd_name = "", + .pd_class = -1, + .pd_caps = AMD_PMC_CAPS, + .pd_width = 48 + }, + .pm_evsel = AMD_PMC_EVSEL_4, + .pm_perfctr = AMD_PMC_PERFCTR_4 + }, + { + .pm_descr = + { + .pd_name = "", + .pd_class = -1, + .pd_caps = AMD_PMC_CAPS, + .pd_width = 48 + }, + .pm_evsel = AMD_PMC_EVSEL_5, + .pm_perfctr = AMD_PMC_PERFCTR_5 + }, }; struct amd_event_code_map { enum pmc_event pe_ev; /* enum value */ +#if defined(__i386__) uint8_t pe_code; /* encoded event mask */ +#elif defined(__amd64__) + uint16_t pe_code; /* encoded event mask */ +#endif uint8_t pe_mask; /* bits allowed in unit mask */ }; @@ -237,7 +263,79 @@ const struct amd_event_code_map amd_event_codes[] = { { PMC_EV_K8_NB_PROBE_RESULT, 0xEC, 0x0F }, { PMC_EV_K8_NB_HT_BUS0_BANDWIDTH, 0xF6, 0x0F }, { PMC_EV_K8_NB_HT_BUS1_BANDWIDTH, 0xF7, 0x0F }, - { PMC_EV_K8_NB_HT_BUS2_BANDWIDTH, 0xF8, 0x0F } + { PMC_EV_K8_NB_HT_BUS2_BANDWIDTH, 0xF8, 0x0F }, + { PMC_EV_F17H_FPU_PIPEASSIGMENT, 0x00, 0xFF }, + { PMC_EV_F17H_FP_SCHED_EMPTY, 0x01, 0x00 }, + { PMC_EV_F17H_FP_RET_X87_FPOPS, 0x02, 0x07 }, + { PMC_EV_F17H_FP_RET_SSEAVX_OPS, 0x03, 0xFF }, + { PMC_EV_F17H_FP_NUM_MOVELIM_SCAL_OPT, 0x04, 0x0F }, + { PMC_EV_F17H_FP_RET_SEROPS, 0x05, 0x0F }, + { PMC_EV_F17H_LS_BAD_STATUS2, 0x24, 0x07 }, + { PMC_EV_F17H_LS_LOCKS, 0x25, 0x0F }, + { PMC_EV_F17H_LS_RET_CLFLUSH_INST, 0x26, 0x00 }, + { PMC_EV_F17H_LS_RET_CPUID_INST, 0x27, 0x00 }, + { PMC_EV_F17H_LS_DISPATCH, 0x29, 0x07 }, + { PMC_EV_F17H_LS_SMI_RX, 0x2B, 0x00 }, + { PMC_EV_F17H_LS_STLF, 0x35, 0x00 }, + { PMC_EV_F17H_LS_STLF_COMMITCANCEL, 0x37, 0x00 }, + { PMC_EV_F17H_LS_DC_ACCESS, 0x40, 0x00 }, + { PMC_EV_F17H_LS_MAB_ALLOCPIPE, 0x41, 0x1F }, + { PMC_EV_F17H_LS_REFFILS_FROM_SYS, 0x43, 0x5B }, + { PMC_EV_F17H_LS_L1_DTLBMISS, 0x45, 0xFF }, + { PMC_EV_F17H_LS_TABLEWALKER, 0x46, 0x0F }, + { PMC_EV_F17H_LS_MISAL_ACCESS, 0x47, 0x00 }, + { PMC_EV_F17H_LS_PREF_INST_DISPATCH, 0x4B, 0x07 }, + { PMC_EV_F17H_LS_HWPF_ALLOCATED, 0x4C, 0x03 }, + { PMC_EV_F17H_LS_HWPF_HIT, 0x4D, 0x03 }, + { PMC_EV_F17H_LS_TW_INPROG_DSIDE, 0x4E, 0x0F }, + { PMC_EV_F17H_LS_INEF_SW_PREF, 0x52, 0x03 }, + { PMC_EV_F17H_LS_MAB_MCH_CNT, 0x55, 0x00 }, + { PMC_EV_F17H_LS_HW_PF_MABALLOC, 0x57, 0x07 }, + { PMC_EV_F17H_LS_HW_PF_MATCH, 0x58, 0x07 }, + { PMC_EV_F17H_LS_SW_PF_DCFILLS, 0x59, 0x5B }, + { PMC_EV_F17H_LS_HW_PF_DCFILLS, 0x5A, 0x5B }, + { PMC_EV_F17H_LS_TW_DCFILLS, 0x5B, 0x5B }, + { PMC_EV_F17H_LS_ALLOC_MAB_COUNT, 0x5F, 0x00 }, + { PMC_EV_F17H_LS_TW_INITLEVEL, 0x6E, 0xFF }, + { PMC_EV_F17H_LS_NOT_HALTED_CYCLE, 0x76, 0x00 }, + { PMC_EV_F17H_LS_TW_RETURN_TYPES, 0x170, 0xCD }, + { PMC_EV_F17H_IC_FW32, 0x80, 0x00 }, + { PMC_EV_F17H_IC_FW32_MISS, 0x81, 0x00 }, + { PMC_EV_F17H_IC_CACHEFILL_L2, 0x82, 0x00 }, + { PMC_EV_F17H_IC_CACHEFILL_SYS, 0x83, 0x00 }, + { PMC_EV_F17H_BP_L1TLBMISS_L2HIT, 0x84, 0x00 }, + { PMC_EV_F17H_BP_L1TLBMISS_L2MISS, 0x85, 0x00 }, + { PMC_EV_F17H_IC_FETCHSTALL, 0x87, 0x07 }, + { PMC_EV_F17H_BP_L1_BTBCORRECT, 0x8A, 0x00 }, + { PMC_EV_F17H_BP_L2_BTBCORRECT, 0x8B, 0x00 }, + { PMC_EV_F17H_IC_CACHEINVAL, 0x8C, 0x03 }, + { PMC_EV_F17H_BP_TLB_REL, 0x99, 0x00 }, + { PMC_EV_F17H_ICOC_MODE_SWITCH, 0x28A, 0x03 }, + { PMC_EV_F17H_DE_DISPATCH_TOKEN_STALLS, 0xAF, 0x7F }, + { PMC_EV_F17H_EX_RET_INST, 0xC0, 0x00 }, + { PMC_EV_F17H_EX_RET_COPS, 0xC1, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN, 0xC2, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_MISP, 0xC3, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_TKN, 0xC4, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_TKN_MISP, 0xC5, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_FAR, 0xC6, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_RESYNC, 0xC7, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_NEAR_RET, 0xC8, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_NEAR_RET_MISPRED, 0xC9, 0x00 }, + { PMC_EV_F17H_EX_RET_BRN_IND_MISP, 0xCA, 0x00 }, + { PMC_EV_F17H_EX_RET_MMX_FP_INSTR, 0xCB, 0x07 }, + { PMC_EV_F17H_EX_RET_COND_BRN, 0xD1, 0x00 }, + { PMC_EV_F17H_EX_DIV_BUSY, 0xD3, 0x00 }, + { PMC_EV_F17H_EX_DIV_COUNT, 0xD4, 0x00 }, + { PMC_EV_F17H_L2_REQUEST_G1, 0x60, 0xFF }, + { PMC_EV_F17H_L2_REQUEST_G2, 0x61, 0xFF }, + { PMC_EV_F17H_L2_LATENCY, 0x62, 0x01 }, + { PMC_EV_F17H_L2_WBCREQ, 0x63, 0x7F }, + { PMC_EV_F17H_L2_CACHEREQSTAT, 0x64, 0xFF }, + { PMC_EV_F17H_L2_SMCEVENTS, 0x67, 0x7F }, + { PMC_EV_F17H_L2_FILLPENDING, 0x6D, 0x01 }, + { PMC_EV_F17H_EX_TAGGED_IBSOPS, 0x1CF, 0x07 }, + { PMC_EV_F17H_EX_RET_FUSED_BRNCH_INST, 0x1D0, 0x00 } }; @@ -267,7 +365,7 @@ amd_read_pmc(int cpu, int ri, pmc_value_t *v) KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < AMD_NPMCS, + KASSERT(ri >= 0 && ri < npmc, ("[amd,%d] illegal row-index %d", __LINE__, ri)); KASSERT(amd_pcpu[cpu], ("[amd,%d] null per-cpu, cpu %d", __LINE__, cpu)); @@ -316,7 +414,7 @@ amd_write_pmc(int cpu, int ri, pmc_value_t v) KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < AMD_NPMCS, + KASSERT(ri >= 0 && ri < npmc, ("[amd,%d] illegal row-index %d", __LINE__, ri)); pm = amd_pcpu[cpu]->pc_amdpmcs[ri].phw_pmc; @@ -359,7 +457,7 @@ amd_config_pmc(int cpu, int ri, struct pmc *pm) KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < AMD_NPMCS, + KASSERT(ri >= 0 && ri < npmc, ("[amd,%d] illegal row-index %d", __LINE__, ri)); phw = &amd_pcpu[cpu]->pc_amdpmcs[ri]; @@ -433,15 +531,21 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { int i; - uint32_t allowed_unitmask, caps, config, unitmask; + uint32_t allowed_unitmask, caps, unitmask; + uint16_t eventval, extevent; enum pmc_event pe; const struct pmc_descr *pd; (void) cpu; +#if defined(__i386__) + uint32_t config; +#elif defined(__amd64__) + uint64_t config; +#endif KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); - KASSERT(ri >= 0 && ri < AMD_NPMCS, + KASSERT(ri >= 0 && ri < npmc, ("[amd,%d] illegal row index %d", __LINE__, ri)); pd = &amd_pmcdesc[ri].pm_descr; @@ -463,8 +567,26 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, config = allowed_unitmask = 0; for (i = 0; i < amd_event_codes_size; i++) if (amd_event_codes[i].pe_ev == pe) { +#if defined(__i386__) config = - AMD_PMC_TO_EVENTMASK(amd_event_codes[i].pe_code); + AMD_PMC_TO_EVENTMASK( + amd_event_codes[i].pe_code); +#elif defined(__amd64__) + eventval = + AMD_PMC_TO_EVENTMASK( + amd_event_codes[i].pe_code); + if (eventval & AMD_PMC_EXTENDEDEVMASK) { + extevent = (eventval & AMD_PMC_EXTENDEDEVMASK); + config = (uint64_t) + extevent << AMD_PMC_EXTENDEDEVBIT; + config |= eventval & AMD_PMC_EVENTMASK_EXT; + } else { + config |= + AMD_PMC_TO_EVENTMASK( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Fri Oct 26 06:12:57 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5448910D7FA1; Fri, 26 Oct 2018 06:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0579286034; Fri, 26 Oct 2018 06:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9A011D0C7; Fri, 26 Oct 2018 06:12:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q6CuCW033692; Fri, 26 Oct 2018 06:12:56 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q6CugK033690; Fri, 26 Oct 2018 06:12:56 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201810260612.w9Q6CugK033690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 26 Oct 2018 06:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339769 - in stable/11/sys: dev/hwpmc i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in stable/11/sys: dev/hwpmc i386/include X-SVN-Commit-Revision: 339769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 06:12:57 -0000 Author: mmacy Date: Fri Oct 26 06:12:56 2018 New Revision: 339769 URL: https://svnweb.freebsd.org/changeset/base/339769 Log: fix i386 breakage caused by r339767 Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c stable/11/sys/i386/include/pmc_mdep.h Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 05:25:22 2018 (r339768) +++ stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 06:12:56 2018 (r339769) @@ -130,11 +130,7 @@ static struct amd_descr amd_pmcdesc[AMD_NPMCS] = struct amd_event_code_map { enum pmc_event pe_ev; /* enum value */ -#if defined(__i386__) - uint8_t pe_code; /* encoded event mask */ -#elif defined(__amd64__) uint16_t pe_code; /* encoded event mask */ -#endif uint8_t pe_mask; /* bits allowed in unit mask */ }; @@ -532,7 +528,6 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, { int i; uint32_t allowed_unitmask, caps, unitmask; - uint16_t eventval, extevent; enum pmc_event pe; const struct pmc_descr *pd; @@ -541,6 +536,7 @@ amd_allocate_pmc(int cpu, int ri, struct pmc *pm, uint32_t config; #elif defined(__amd64__) uint64_t config; + uint16_t eventval, extevent; #endif KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), Modified: stable/11/sys/i386/include/pmc_mdep.h ============================================================================== --- stable/11/sys/i386/include/pmc_mdep.h Fri Oct 26 05:25:22 2018 (r339768) +++ stable/11/sys/i386/include/pmc_mdep.h Fri Oct 26 06:12:56 2018 (r339769) @@ -69,6 +69,7 @@ struct pmc_mdep; #define PMC_MDEP_CLASS_INDEX_TSC 1 #define PMC_MDEP_CLASS_INDEX_K7 2 #define PMC_MDEP_CLASS_INDEX_K8 2 +#define PMC_MDEP_CLASS_INDEX_F17H 2 #define PMC_MDEP_CLASS_INDEX_P4 2 #define PMC_MDEP_CLASS_INDEX_P5 2 #define PMC_MDEP_CLASS_INDEX_P6 2 From owner-svn-src-stable-11@freebsd.org Fri Oct 26 08:52:23 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD3010DC387; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5177C6D253; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32AC51EADC; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q8qNfu015120; Fri, 26 Oct 2018 08:52:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q8qNFc015119; Fri, 26 Oct 2018 08:52:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201810260852.w9Q8qNFc015119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 26 Oct 2018 08:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339771 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 339771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 08:52:23 -0000 Author: mmacy Date: Fri Oct 26 08:52:22 2018 New Revision: 339771 URL: https://svnweb.freebsd.org/changeset/base/339771 Log: fix up more issues introduced by failing to have run TB before r339767 Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 08:12:28 2018 (r339770) +++ stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 08:52:22 2018 (r339771) @@ -816,11 +816,12 @@ amd_intr(int cpu, struct trapframe *tf) v = pm->pm_sc.pm_reloadcount; config = rdmsr(evsel); + KASSERT((config & ~AMD_PMC_ENABLE) == (pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE), - ("[amd,%d] config mismatch reg=0x%x pm=0x%x", __LINE__, - config, pm->pm_md.pm_amd.pm_amd_evsel)); - + ("[amd,%d] config mismatch reg=0x%jx pm=0x%jx", __LINE__, + (uintmax_t)config, (uintmax_t)pm->pm_md.pm_amd.pm_amd_evsel)); + wrmsr(evsel, config & ~AMD_PMC_ENABLE); wrmsr(perfctr, AMD_RELOAD_COUNT_TO_PERFCTR_VALUE(v)); @@ -1195,9 +1196,12 @@ pmc_amd_finalize(struct pmc_mdep *md) } else if (AMD_cpufamily == 0x17) { classindex = PMC_MDEP_CLASS_INDEX_F17H; pmcclass = PMC_CLASS_F17H; - } else + } else { + classindex = PMC_MDEP_CLASS_INDEX_K8; + pmcclass = PMC_CLASS_K8; (void) printf("pmc:AMD CPU family unknown.\n"); - + } + } KASSERT(md->pmd_classdep[classindex].pcd_class == pmcclass, From owner-svn-src-stable-11@freebsd.org Sat Oct 27 19:08:07 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAD010D0BAA; Sat, 27 Oct 2018 19:08:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51988778B1; Sat, 27 Oct 2018 19:08:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 329DD14618; Sat, 27 Oct 2018 19:08:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9RJ86Mb082940; Sat, 27 Oct 2018 19:08:06 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9RJ86sk082939; Sat, 27 Oct 2018 19:08:06 GMT (envelope-from des@FreeBSD.org) Message-Id: <201810271908.w9RJ86sk082939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 27 Oct 2018 19:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339821 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: des X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 339821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Oct 2018 19:08:07 -0000 Author: des Date: Sat Oct 27 19:08:06 2018 New Revision: 339821 URL: https://svnweb.freebsd.org/changeset/base/339821 Log: MFH (r305124): fix case where fd_lastfile is -1. Modified: stable/11/sys/sys/filedesc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/filedesc.h ============================================================================== --- stable/11/sys/sys/filedesc.h Sat Oct 27 18:48:49 2018 (r339820) +++ stable/11/sys/sys/filedesc.h Sat Oct 27 19:08:06 2018 (r339821) @@ -219,7 +219,7 @@ fdeget_locked(struct filedesc *fdp, int fd) FILEDESC_LOCK_ASSERT(fdp); - if ((u_int)fd > fdp->fd_lastfile) + if (fd < 0 || fd > fdp->fd_lastfile) return (NULL); fde = &fdp->fd_ofiles[fd];