From owner-svn-src-stable-10@freebsd.org Sun Sep 25 22:04:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC4D6BEA48A; Sun, 25 Sep 2016 22:04:03 +0000 (UTC) (envelope-from mm@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 mx1.freebsd.org (Postfix) with ESMTPS id 7F90862C; Sun, 25 Sep 2016 22:04:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8PM42re028878; Sun, 25 Sep 2016 22:04:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8PM426S028871; Sun, 25 Sep 2016 22:04:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201609252204.u8PM426S028871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 25 Sep 2016 22:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306322 - in stable/10: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2016 22:04:04 -0000 Author: mm Date: Sun Sep 25 22:04:02 2016 New Revision: 306322 URL: https://svnweb.freebsd.org/changeset/base/306322 Log: MFC r305819: Sync libarchive with vendor including important security fixes. Issues fixed (FreeBSD): PR #778: ACL error handling Issue #745: Symlink check prefix optimization is too aggressive Issue #746: Hard links with data can evade sandboxing restrictions This update fixes the vulnerability #3 and vulnerability #4 as reported in "non-cryptanalytic attacks against FreeBSD update components". https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Fix for vulnerability #2 has already been merged in r305192. Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Modified: stable/10/contrib/libarchive/libarchive/archive_platform.h stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure745.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure746.c stable/10/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c stable/10/lib/libarchive/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_platform.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_platform.h Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_platform.h Sun Sep 25 22:04:02 2016 (r306322) @@ -159,6 +159,15 @@ #define CAN_RESTORE_METADATA_FD #endif +/* + * glibc 2.24 deprecates readdir_r + */ +#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) +#define USE_READDIR_R 1 +#else +#undef USE_READDIR_R +#endif + /* Set up defaults for internal error codes. */ #ifndef ARCHIVE_ERRNO_FILE_FORMAT #if HAVE_EFTYPE Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Sep 25 22:04:02 2016 (r306322) @@ -411,9 +411,7 @@ setup_acls(struct archive_read_disk *a, { const char *accpath; acl_t acl; -#if HAVE_ACL_IS_TRIVIAL_NP int r; -#endif accpath = archive_entry_sourcepath(entry); if (accpath == NULL) @@ -473,9 +471,13 @@ setup_acls(struct archive_read_disk *a, } #endif if (acl != NULL) { - translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); acl_free(acl); - return (ARCHIVE_OK); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate NFSv4 ACLs: %s", accpath); + } + return (r); } #endif /* ACL_TYPE_NFS4 */ @@ -506,19 +508,30 @@ setup_acls(struct archive_read_disk *a, #endif if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); acl = NULL; + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate access ACLs: %s", accpath); + return (r); + } } /* Only directories can have default ACLs. */ if (S_ISDIR(archive_entry_mode(entry))) { acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { - translate_acl(a, entry, acl, + r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); acl_free(acl); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, errno, + "Couldn't translate default ACLs: %s", + accpath); + return (r); + } } } return (ARCHIVE_OK); @@ -574,19 +587,23 @@ translate_acl(struct archive_read_disk * #ifdef ACL_TYPE_NFS4 acl_entry_type_t acl_type; acl_flagset_t acl_flagset; - int brand, r; + int brand; #endif acl_entry_t acl_entry; acl_permset_t acl_permset; int i, entry_acl_type; - int s, ae_id, ae_tag, ae_perm; + int r, s, ae_id, ae_tag, ae_perm; const char *ae_name; #ifdef ACL_TYPE_NFS4 // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 // Make sure the "brand" on this ACL is consistent // with the default_entry_acl_type bits provided. - acl_get_brand_np(acl, &brand); + if (acl_get_brand_np(acl, &brand) != 0) { + archive_set_error(&a->archive, errno, + "Failed to read ACL brand"); + return (ARCHIVE_WARN); + } switch (brand) { case ACL_BRAND_POSIX: switch (default_entry_acl_type) { @@ -594,31 +611,43 @@ translate_acl(struct archive_read_disk * case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for POSIX.1e ACL"); + return (ARCHIVE_WARN); } break; case ACL_BRAND_NFS4: if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Invalid ACL entry type for NFSv4 ACL"); + return (ARCHIVE_WARN); } break; default: - // XXX set warning message? - return ARCHIVE_FAILED; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Unknown ACL brand"); + return (ARCHIVE_WARN); break; } #endif s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get first ACL entry"); + return (ARCHIVE_WARN); + } while (s == 1) { ae_id = -1; ae_name = NULL; ae_perm = 0; - acl_get_tag_type(acl_entry, &acl_tag); + if (acl_get_tag_type(acl_entry, &acl_tag) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL tag type"); + return (ARCHIVE_WARN); + } switch (acl_tag) { case ACL_USER: ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); @@ -653,13 +682,18 @@ translate_acl(struct archive_read_disk * continue; } - // XXX acl type maps to allow/deny/audit/YYYY bits - // XXX acl_get_entry_type_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs + // XXX acl_type maps to allow/deny/audit/YYYY bits entry_acl_type = default_entry_acl_type; #ifdef ACL_TYPE_NFS4 - r = acl_get_entry_type_np(acl_entry, &acl_type); - if (r == 0) { + if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + /* + * acl_get_entry_type_np() falis with non-NFSv4 ACLs + */ + if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) { + archive_set_error(&a->archive, errno, "Failed " + "to get ACL type from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } switch (acl_type) { case ACL_ENTRY_TYPE_ALLOW: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; @@ -673,32 +707,53 @@ translate_acl(struct archive_read_disk * case ACL_ENTRY_TYPE_ALARM: entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; break; + default: + archive_set_error(&a->archive, errno, + "Invalid NFSv4 ACL entry type"); + return (ARCHIVE_WARN); } - } - /* - * Libarchive stores "flag" (NFSv4 inheritance bits) - * in the ae_perm bitmap. - */ - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + * + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get flagset from a NFSv4 ACL entry"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) + r = acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check flag in a NFSv4 " + "ACL flagset"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_inherit_map[i].archive_inherit; } } #endif - acl_get_permset(acl_entry, &acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(&a->archive, errno, + "Failed to get ACL permission set"); + return (ARCHIVE_WARN); + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { /* * acl_get_perm() is spelled differently on different * platforms; see above. */ - if (ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm)) + r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to check permission in an ACL permission set"); + return (ARCHIVE_WARN); + } else if (r) ae_perm |= acl_perm_map[i].archive_perm; } @@ -707,6 +762,11 @@ translate_acl(struct archive_read_disk * ae_id, ae_name); s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get next ACL entry"); + return (ARCHIVE_WARN); + } } return (ARCHIVE_OK); } Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Sep 25 22:04:02 2016 (r306322) @@ -165,7 +165,7 @@ struct filesystem { int synthetic; int remote; int noatime; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t name_max; #endif long incr_xfer_size; @@ -200,7 +200,7 @@ struct tree { DIR *d; #define INVALID_DIR_HANDLE NULL struct dirent *de; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) struct dirent *dirent; size_t dirent_allocated; #endif @@ -1592,7 +1592,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ #if defined(HAVE_STRUCT_STATFS_F_NAMEMAX) t->current_filesystem->name_max = sfs.f_namemax; @@ -1615,7 +1615,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; #endif -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -1817,7 +1817,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namelen; #endif @@ -1901,7 +1901,7 @@ setup_current_filesystem(struct archive_ #endif t->current_filesystem->noatime = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ t->current_filesystem->name_max = sfs.f_namemax; #endif @@ -1918,7 +1918,7 @@ static int setup_current_filesystem(struct archive_read_disk *a) { struct tree *t = a->tree; -#if defined(_PC_NAME_MAX) && defined(HAVE_READDIR_R) +#if defined(_PC_NAME_MAX) && defined(USE_READDIR_R) long nm; #endif t->current_filesystem->synthetic = -1;/* Not supported */ @@ -1930,7 +1930,7 @@ setup_current_filesystem(struct archive_ t->current_filesystem->min_xfer_size = -1; t->current_filesystem->incr_xfer_size = -1; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) /* Set maximum filename length. */ # if defined(_PC_NAME_MAX) if (tree_current_is_symblic_link_target(t)) { @@ -1958,7 +1958,7 @@ setup_current_filesystem(struct archive_ else t->current_filesystem->name_max = nm; # endif /* _PC_NAME_MAX */ -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ return (ARCHIVE_OK); } @@ -2366,7 +2366,7 @@ tree_dir_next_posix(struct tree *t) size_t namelen; if (t->d == NULL) { -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) size_t dirent_size; #endif @@ -2387,7 +2387,7 @@ tree_dir_next_posix(struct tree *t) t->visit_type = r != 0 ? r : TREE_ERROR_DIR; return (t->visit_type); } -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) dirent_size = offsetof(struct dirent, d_name) + t->filesystem_table[t->current->filesystem_id].name_max + 1; if (t->dirent == NULL || t->dirent_allocated < dirent_size) { @@ -2404,11 +2404,11 @@ tree_dir_next_posix(struct tree *t) } t->dirent_allocated = dirent_size; } -#endif /* HAVE_READDIR_R */ +#endif /* USE_READDIR_R */ } for (;;) { errno = 0; -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) r = readdir_r(t->d, t->dirent, &t->de); #ifdef _AIX /* Note: According to the man page, return value 9 indicates @@ -2660,7 +2660,7 @@ tree_free(struct tree *t) if (t == NULL) return; archive_string_free(&t->path); -#if defined(HAVE_READDIR_R) +#if defined(USE_READDIR_R) free(t->dirent); #endif free(t->sparse_list); Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_tar.c Sun Sep 25 22:04:02 2016 (r306322) @@ -136,6 +136,7 @@ struct tar { int64_t entry_padding; int64_t entry_bytes_unconsumed; int64_t realsize; + int sparse_allowed; struct sparse_block *sparse_list; struct sparse_block *sparse_last; int64_t sparse_offset; @@ -1271,6 +1272,14 @@ header_common(struct archive_read *a, st * sparse information in the extended area. */ /* FALLTHROUGH */ + case '0': + /* + * Enable sparse file "read" support only for regular + * files and explicit GNU sparse files. However, we + * don't allow non-standard file types to be sparse. + */ + tar->sparse_allowed = 1; + /* FALLTHROUGH */ default: /* Regular file and non-standard types */ /* * Per POSIX: non-recognized types should always be @@ -1730,6 +1739,14 @@ pax_attribute(struct archive_read *a, st #endif switch (key[0]) { case 'G': + /* Reject GNU.sparse.* headers on non-regular files. */ + if (strncmp(key, "GNU.sparse", 10) == 0 && + !tar->sparse_allowed) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Non-regular file cannot be sparse"); + return (ARCHIVE_FATAL); + } + /* GNU "0.0" sparse pax format. */ if (strcmp(key, "GNU.sparse.numblocks") == 0) { tar->sparse_offset = -1; Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Sep 25 22:04:02 2016 (r306322) @@ -153,9 +153,19 @@ set_acl(struct archive *a, int fd, const if (entries == 0) return (ARCHIVE_OK); acl = acl_init(entries); + if (acl == (acl_t)NULL) { + archive_set_error(a, errno, + "Failed to initialize ACL working storage"); + return (ARCHIVE_FAILED); + } while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { - acl_create_entry(&acl, &acl_entry); + if (acl_create_entry(&acl, &acl_entry) != 0) { + archive_set_error(a, errno, + "Failed to create a new ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } switch (ae_tag) { case ARCHIVE_ENTRY_ACL_USER: @@ -186,53 +196,96 @@ set_acl(struct archive *a, int fd, const break; #endif default: - /* XXX */ - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; } #ifdef ACL_TYPE_NFS4 + r = 0; switch (ae_type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); break; case ARCHIVE_ENTRY_ACL_TYPE_DENY: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); break; case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); break; case ARCHIVE_ENTRY_ACL_TYPE_ALARM: - acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); + r = acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); break; case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: // These don't translate directly into the system ACL. break; default: - // XXX error handling here. - break; + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unknown ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (r != 0) { + archive_set_error(a, errno, + "Failed to set ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; } #endif - acl_get_permset(acl_entry, &acl_permset); - acl_clear_perms(acl_permset); + if (acl_get_permset(acl_entry, &acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to get ACL permission set"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_perms(acl_permset) != 0) { + archive_set_error(a, errno, + "Failed to clear ACL permissions"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { if (ae_permset & acl_perm_map[i].archive_perm) - acl_add_perm(acl_permset, - acl_perm_map[i].platform_perm); + if (acl_add_perm(acl_permset, + acl_perm_map[i].platform_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } } #ifdef ACL_TYPE_NFS4 - // XXX acl_get_flagset_np on FreeBSD returns EINVAL for - // non-NFSv4 ACLs - r = acl_get_flagset_np(acl_entry, &acl_flagset); - if (r == 0) { - acl_clear_flags_np(acl_flagset); + if (acl_type == ACL_TYPE_NFS4) { + /* + * acl_get_flagset_np() fails with non-NFSv4 ACLs + */ + if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to get flagset from an NFSv4 ACL entry"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + if (acl_clear_flags_np(acl_flagset) != 0) { + archive_set_error(a, errno, + "Failed to clear flags from an NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + if (ae_permset & acl_inherit_map[i].archive_inherit) { + if (acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit) != 0) { + archive_set_error(a, errno, + "Failed to add flag to NFSv4 ACL flagset"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } } } #endif @@ -262,6 +315,7 @@ set_acl(struct archive *a, int fd, const ret = ARCHIVE_WARN; } #endif +exit_free: acl_free(acl); return (ret); } Modified: stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Sep 25 22:02:27 2016 (r306321) +++ stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Sep 25 22:04:02 2016 (r306322) @@ -140,7 +140,17 @@ __FBSDID("$FreeBSD$"); #define O_BINARY 0 #endif #ifndef O_CLOEXEC -#define O_CLOEXEC 0 +#define O_CLOEXEC 0 +#endif + +/* Ignore non-int O_NOFOLLOW constant. */ +/* gnulib's fcntl.h does this on AIX, but it seems practical everywhere */ +#if defined O_NOFOLLOW && !(INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +#undef O_NOFOLLOW +#endif + +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0 #endif struct fixup_entry { @@ -326,12 +336,14 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) +static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif +static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -2014,6 +2026,10 @@ create_filesystem_object(struct archive_ const char *linkname; mode_t final_mode, mode; int r; + /* these for check_symlinks_fsobj */ + char *linkname_copy; /* non-const copy of linkname */ + struct archive_string error_string; + int error_number; /* We identify hard/symlinks according to the link names. */ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ @@ -2022,6 +2038,27 @@ create_filesystem_object(struct archive_ #if !HAVE_LINK return (EPERM); #else + archive_string_init(&error_string); + linkname_copy = strdup(linkname); + if (linkname_copy == NULL) { + return (EPERM); + } + /* TODO: consider using the cleaned-up path as the link target? */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + if (r != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + free(linkname_copy); + /* EPERM is more appropriate than error_number for our callers */ + return (EPERM); + } + free(linkname_copy); r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries @@ -2040,7 +2077,7 @@ create_filesystem_object(struct archive_ a->deferred = 0; } else if (r == 0 && a->filesize > 0) { a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC); + O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2351,126 +2388,233 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } -/* TODO: Make this work. */ -/* - * TODO: The deep-directory support bypasses this; disable deep directory - * support if we're doing symlink checks. - */ /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other * recent paths. */ /* TODO: Extend this to support symlinks on Windows Vista and later. */ + +/* + * Checks the given path to see if any elements along it are symlinks. Returns + * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. + */ static int -check_symlinks(struct archive_write_disk *a) +check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ - (void)a; /* UNUSED */ + (void)path; /* UNUSED */ + (void)error_number; /* UNUSED */ + (void)error_string; /* UNUSED */ + (void)flags; /* UNUSED */ return (ARCHIVE_OK); #else - char *pn; + int res = ARCHIVE_OK; + char *tail; + char *head; + int last; char c; int r; struct stat st; + int restore_pwd; + + /* Nothing to do here if name is empty */ + if(path[0] == '\0') + return (ARCHIVE_OK); /* * Guard against symlink tricks. Reject any archive entry whose * destination would be altered by a symlink. - */ - /* Whatever we checked last time doesn't need to be re-checked. */ - pn = a->name; - if (archive_strlen(&(a->path_safe)) > 0) { - char *p = a->path_safe.s; - while ((*pn != '\0') && (*p == *pn)) - ++p, ++pn; - } + * + * Walk the filename in chunks separated by '/'. For each segment: + * - if it doesn't exist, continue + * - if it's symlink, abort or remove it + * - if it's a directory and it's not the last chunk, cd into it + * As we go: + * head points to the current (relative) path + * tail points to the temporary \0 terminating the segment we're currently examining + * c holds what used to be in *tail + * last is 1 if this is the last tail + */ + restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(restore_pwd); + if (restore_pwd < 0) + return (ARCHIVE_FATAL); + head = path; + tail = path; + last = 0; + /* TODO: reintroduce a safe cache here? */ /* Skip the root directory if the path is absolute. */ - if(pn == a->name && pn[0] == '/') - ++pn; - c = pn[0]; - /* Keep going until we've checked the entire name. */ - while (pn[0] != '\0' && (pn[0] != '/' || pn[1] != '\0')) { + if(tail == path && tail[0] == '/') + ++tail; + /* Keep going until we've checked the entire name. + * head, tail, path all alias the same string, which is + * temporarily zeroed at tail, so be careful restoring the + * stashed (c=tail[0]) for error messages. + * Exiting the loop with break is okay; continue is not. + */ + while (!last) { + /* Skip the separator we just consumed, plus any adjacent ones */ + while (*tail == '/') + ++tail; /* Skip the next path element. */ - while (*pn != '\0' && *pn != '/') - ++pn; - c = pn[0]; - pn[0] = '\0'; + while (*tail != '\0' && *tail != '/') + ++tail; + /* is this the last path component? */ + last = (tail[0] == '\0') || (tail[0] == '/' && tail[1] == '\0'); + /* temporarily truncate the string here */ + c = tail[0]; + tail[0] = '\0'; /* Check that we haven't hit a symlink. */ - r = lstat(a->name, &st); + r = lstat(head, &st); if (r != 0) { + tail[0] = c; /* We've hit a dir that doesn't exist; stop now. */ if (errno == ENOENT) { break; } else { - /* Note: This effectively disables deep directory + /* Treat any other error as fatal - best to be paranoid here + * Note: This effectively disables deep directory * support when security checks are enabled. * Otherwise, very long pathnames that trigger * an error here could evade the sandbox. * TODO: We could do better, but it would probably * require merging the symlink checks with the * deep-directory editing. */ - return (ARCHIVE_FAILED); + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not stat %s", + path); + res = ARCHIVE_FAILED; + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (!last) { + if (chdir(head) != 0) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not chdir %s", + path); + res = (ARCHIVE_FATAL); + break; + } + /* Our view is now from inside this dir: */ + head = tail + 1; } } else if (S_ISLNK(st.st_mode)) { - if (c == '\0') { + if (last) { /* * Last element is symlink; remove it * so we can overwrite it with the * item being extracted. */ - if (unlink(a->name)) { - archive_set_error(&a->archive, errno, - "Could not remove symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head)) { + tail[0] = c; + if (error_number) *error_number = errno; + if (error_string) + archive_string_sprintf(error_string, + "Could not remove symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; /* * Even if we did remove it, a warning * is in order. The warning is silly, * though, if we're just replacing one * symlink with another symlink. */ - if (!S_ISLNK(a->mode)) { - archive_set_error(&a->archive, 0, - "Removing symlink %s", - a->name); + tail[0] = c; + /* FIXME: not sure how important this is to restore + if (!S_ISLNK(path)) { + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Removing symlink %s", + path); } + */ /* Symlink gone. No more problem! */ - pn[0] = c; - return (0); - } else if (a->flags & ARCHIVE_EXTRACT_UNLINK) { + res = ARCHIVE_OK; + break; + } else if (flags & ARCHIVE_EXTRACT_UNLINK) { /* User asked us to remove problems. */ - if (unlink(a->name) != 0) { - archive_set_error(&a->archive, 0, - "Cannot remove intervening symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + if (unlink(head) != 0) { + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot remove intervening symlink %s", + path); + res = ARCHIVE_FAILED; + break; } - a->pst = NULL; + tail[0] = c; } else { - archive_set_error(&a->archive, 0, - "Cannot extract through symlink %s", - a->name); - pn[0] = c; - return (ARCHIVE_FAILED); + tail[0] = c; + if (error_number) *error_number = 0; + if (error_string) + archive_string_sprintf(error_string, + "Cannot extract through symlink %s", + path); + res = ARCHIVE_FAILED; + break; } } - pn[0] = c; - if (pn[0] != '\0') - pn++; /* Advance to the next segment. */ - } - pn[0] = c; - /* We've checked and/or cleaned the whole path, so remember it. */ - archive_strcpy(&a->path_safe, a->name); - return (ARCHIVE_OK); + /* be sure to always maintain this */ + tail[0] = c; + if (tail[0] != '\0') + tail++; /* Advance to the next segment. */ + } + /* Catches loop exits via break */ + tail[0] = c; +#ifdef HAVE_FCHDIR + /* If we changed directory above, restore it here. */ + if (restore_pwd >= 0) { + r = fchdir(restore_pwd); + if (r != 0) { + if(error_number) *error_number = errno; + if(error_string) + archive_string_sprintf(error_string, + "chdir() failure"); + } + close(restore_pwd); + restore_pwd = -1; + if (r != 0) { + res = (ARCHIVE_FATAL); + } + } +#endif + /* TODO: reintroduce a safe cache here? */ + return res; #endif } +/* + * Check a->name for symlinks, returning ARCHIVE_OK if its clean, otherwise + * calls archive_set_error and returns ARCHIVE_{FATAL,FAILED} + */ +static int +check_symlinks(struct archive_write_disk *a) +{ + struct archive_string error_string; + int error_number; + int rc; + archive_string_init(&error_string); + rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags); + if (rc != ARCHIVE_OK) { + archive_set_error(&a->archive, error_number, "%s", error_string.s); + } + archive_string_free(&error_string); + a->pst = NULL; /* to be safe */ + return rc; +} + + #if defined(__CYGWIN__) /* * 1. Convert a path separator from '\' to '/' . @@ -2544,15 +2688,17 @@ cleanup_pathname_win(struct archive_writ * is set) if the path is absolute. */ static int -cleanup_pathname(struct archive_write_disk *a) +cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) { char *dest, *src; char separator = '\0'; - dest = src = a->name; + dest = src = path; if (*src == '\0') { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Invalid empty pathname"); + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Invalid empty pathname"); return (ARCHIVE_FAILED); } @@ -2561,9 +2707,11 @@ cleanup_pathname(struct archive_write_di #endif /* Skip leading '/'. */ if (*src == '/') { - if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Path is absolute"); + if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; + if (error_string) + archive_string_sprintf(error_string, + "Path is absolute"); return (ARCHIVE_FAILED); } @@ -2590,10 +2738,11 @@ cleanup_pathname(struct archive_write_di } else if (src[1] == '.') { if (src[2] == '/' || src[2] == '\0') { /* Conditionally warn about '..' */ - if (a->flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Path contains '..'"); + if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) { + if (error_number) *error_number = ARCHIVE_ERRNO_MISC; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Sep 26 15:03:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB476BE3475; Mon, 26 Sep 2016 15:03:32 +0000 (UTC) (envelope-from asomers@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 mx1.freebsd.org (Postfix) with ESMTPS id AB28CF90; Mon, 26 Sep 2016 15:03:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8QF3Vt6012407; Mon, 26 Sep 2016 15:03:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8QF3VVM012406; Mon, 26 Sep 2016 15:03:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201609261503.u8QF3VVM012406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 26 Sep 2016 15:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306345 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 15:03:33 -0000 Author: asomers Date: Mon Sep 26 15:03:31 2016 New Revision: 306345 URL: https://svnweb.freebsd.org/changeset/base/306345 Log: MFC r306131 Update mkimg(1) author's contact info Modified: stable/10/usr.bin/mkimg/mkimg.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Mon Sep 26 14:48:48 2016 (r306344) +++ stable/10/usr.bin/mkimg/mkimg.1 Mon Sep 26 15:03:31 2016 (r306345) @@ -328,4 +328,4 @@ utility first appeared in The .Nm utility and manpage were written by -.An Marcel Moolenaar Aq Mt marcelm@juniper.net . +.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org . From owner-svn-src-stable-10@freebsd.org Tue Sep 27 17:27:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 947F8BECA18; Tue, 27 Sep 2016 17:27:08 +0000 (UTC) (envelope-from loos@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 mx1.freebsd.org (Postfix) with ESMTPS id 636091CD; Tue, 27 Sep 2016 17:27:08 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8RHR7r6008381; Tue, 27 Sep 2016 17:27:07 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8RHR74E008379; Tue, 27 Sep 2016 17:27:07 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201609271727.u8RHR74E008379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 27 Sep 2016 17:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306370 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 17:27:08 -0000 Author: loos Date: Tue Sep 27 17:27:07 2016 New Revision: 306370 URL: https://svnweb.freebsd.org/changeset/base/306370 Log: MFC r306205: Add the ID for the Huawei ME909S LTE modem. Submitted by: svenauhagen at github Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Tue Sep 27 17:25:06 2016 (r306369) +++ stable/10/sys/dev/usb/serial/u3g.c Tue Sep 27 17:27:07 2016 (r306370) @@ -317,6 +317,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E392, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, ME909U, U3GINIT_HUAWEISCSI2), + U3G_DEV(HUAWEI, ME909S, U3GINIT_HUAWEISCSI2), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Tue Sep 27 17:25:06 2016 (r306369) +++ stable/10/sys/dev/usb/usbdevs Tue Sep 27 17:27:07 2016 (r306370) @@ -2417,6 +2417,7 @@ product HUAWEI E3272_INIT 0x155b LTE mod product HUAWEI ME909U 0x1573 LTE modem product HUAWEI R215_INIT 0x1582 LTE modem initial product HUAWEI R215 0x1588 LTE modem +product HUAWEI ME909S 0x15c1 LTE modem product HUAWEI ETS2055 0x1803 CDMA modem product HUAWEI E173 0x1c05 3G modem product HUAWEI E173_INIT 0x1c0b 3G modem initial From owner-svn-src-stable-10@freebsd.org Tue Sep 27 18:07:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DDC5BEC40C; Tue, 27 Sep 2016 18:07:23 +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 mx1.freebsd.org (Postfix) with ESMTPS id 67ACEF92; Tue, 27 Sep 2016 18:07:23 +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 u8RI7MBE024006; Tue, 27 Sep 2016 18:07:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8RI7M2M024005; Tue, 27 Sep 2016 18:07:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609271807.u8RI7M2M024005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 27 Sep 2016 18:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306374 - stable/10/sys/geom/mirror X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 18:07:23 -0000 Author: markj Date: Tue Sep 27 18:07:22 2016 New Revision: 306374 URL: https://svnweb.freebsd.org/changeset/base/306374 Log: MFC r305509: Don't treat an error from g_mirror_clear_metadata() as fatal. Modified: stable/10/sys/geom/mirror/g_mirror.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Tue Sep 27 18:06:43 2016 (r306373) +++ stable/10/sys/geom/mirror/g_mirror.c Tue Sep 27 18:07:22 2016 (r306374) @@ -2669,8 +2669,12 @@ again: int error; error = g_mirror_clear_metadata(disk); - if (error != 0) - return (error); + if (error != 0) { + G_MIRROR_DEBUG(0, + "Device %s: failed to clear metadata on %s: %d.", + sc->sc_name, g_mirror_get_diskname(disk), error); + break; + } DISK_STATE_CHANGED(); G_MIRROR_DEBUG(0, "Device %s: provider %s destroyed.", sc->sc_name, g_mirror_get_diskname(disk)); From owner-svn-src-stable-10@freebsd.org Tue Sep 27 19:00:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7C1BECE96; Tue, 27 Sep 2016 19:00:25 +0000 (UTC) (envelope-from pluknet@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 mx1.freebsd.org (Postfix) with ESMTPS id 3E792F45; Tue, 27 Sep 2016 19:00:25 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8RJ0Ob4043527; Tue, 27 Sep 2016 19:00:24 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8RJ0NxH043514; Tue, 27 Sep 2016 19:00:23 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201609271900.u8RJ0NxH043514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 27 Sep 2016 19:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306378 - in stable/10: lib/libc/sys lib/libdpv sbin/ipfw share/man/man4 share/man/man4/man4.arm share/man/man9 sys/boot/common sys/boot/i386/gptzfsboot usr.bin/dpv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 19:00:25 -0000 Author: pluknet Date: Tue Sep 27 19:00:22 2016 New Revision: 306378 URL: https://svnweb.freebsd.org/changeset/base/306378 Log: MFC r274925: misc mdoc fixes. Modified: stable/10/lib/libc/sys/poll.2 stable/10/lib/libdpv/dpv.3 stable/10/sbin/ipfw/ipfw.8 stable/10/share/man/man4/gre.4 stable/10/share/man/man4/man4.arm/cgem.4 stable/10/share/man/man4/me.4 stable/10/share/man/man4/netmap.4 stable/10/share/man/man9/get_cyclecount.9 stable/10/share/man/man9/malloc.9 stable/10/share/man/man9/sleepqueue.9 stable/10/sys/boot/common/zfsloader.8 stable/10/sys/boot/i386/gptzfsboot/gptzfsboot.8 stable/10/usr.bin/dpv/dpv.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/poll.2 ============================================================================== --- stable/10/lib/libc/sys/poll.2 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/lib/libc/sys/poll.2 Tue Sep 27 19:00:22 2016 (r306378) @@ -180,7 +180,6 @@ specifies a signal mask which is set whi When .Fn ppoll returns, the original signal mask is restored. -.Pp .Bd -literal struct timespec { time_t tv_sec; /* seconds */ Modified: stable/10/lib/libdpv/dpv.3 ============================================================================== --- stable/10/lib/libdpv/dpv.3 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/lib/libdpv/dpv.3 Tue Sep 27 19:00:22 2016 (r306378) @@ -503,7 +503,7 @@ This does not effect .Xr Xdialog 1 , which renders the color escape sequences as plain text. See -.Do Li +.Do embedded "\\Z" sequences .Dc in Modified: stable/10/sbin/ipfw/ipfw.8 ============================================================================== --- stable/10/sbin/ipfw/ipfw.8 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/sbin/ipfw/ipfw.8 Tue Sep 27 19:00:22 2016 (r306378) @@ -1597,7 +1597,6 @@ be specified as: .Pp Note that the ampersand character has a special meaning in many shells and should generally be escaped. -.Pp .El Note that the order of MAC addresses (destination first, source second) is Modified: stable/10/share/man/man4/gre.4 ============================================================================== --- stable/10/share/man/man4/gre.4 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man4/gre.4 Tue Sep 27 19:00:22 2016 (r306378) @@ -91,7 +91,6 @@ Enables checksum calculation for outgoin Enables use of sequence number field in the GRE header for outgoing packets. .El .Sh EXAMPLES -.Pp .Bd -literal 192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.* \\ / @@ -190,7 +189,6 @@ A description of GRE encapsulation can b .An Andrey V. Elsukov Aq Mt ae@FreeBSD.org .An Heiko W.Rupp Aq Mt hwr@pilhuhn.de .Sh BUGS -.Pp The current implementation uses the key only for outgoing packets. Incoming packets with a different key or without a key will be treated as if they would belong to this interface. Modified: stable/10/share/man/man4/man4.arm/cgem.4 ============================================================================== --- stable/10/share/man/man4/man4.arm/cgem.4 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man4/man4.arm/cgem.4 Tue Sep 27 19:00:22 2016 (r306378) @@ -248,6 +248,23 @@ checksum offloading is enabled. Counter of frames discarded due to an incorrect UDP checksum when checksum offloading is enabled. .El +.Sh SEE ALSO +.Xr miibus 4 , +.Xr ifconfig 8 +.Rs +.%T "Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585)" +.%U http://www.xilinx.com/support/documentation/user_guides/\:ug585-Zynq-7000-TRM.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +driver and this manual page was written by +.An Thomas Skibo Aq Mt thomasskibo@yahoo.com . .Sh BUGS The GEM can perform TCP/UDP/IP checksum offloading. However, when transmit checksum offloading is enabled, the GEM generates and @@ -277,21 +294,3 @@ If the bug does not exist in other versi work-around can be disabled by setting the dev.cgem.%d.rxhangwar .Xr sysctl 8 variable to 0. -.Pp -.Sh SEE ALSO -.Xr miibus 4 , -.Xr ifconfig 8 -.Rs -.%T "Zynq-7000 SoC Technical Reference Manual (Xilinx doc UG585)" -.%U http://www.xilinx.com/support/documentation/user_guides/\:ug585-Zynq-7000-TRM.pdf -.Re -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 10.0 . -.Sh AUTHORS -The -.Nm -driver and this manual page was written by -.An Thomas Skibo Aq Mt thomasskibo@yahoo.com . Modified: stable/10/share/man/man4/me.4 ============================================================================== --- stable/10/share/man/man4/me.4 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man4/me.4 Tue Sep 27 19:00:22 2016 (r306378) @@ -67,7 +67,6 @@ IP header is modified and the modificati so modified header and the original payload. The protocol number 55 is used for outer header. .Sh NOTES -.Pp For correct operation, the .Nm device needs a route to the decapsulating host that does not run over the tunnel, Modified: stable/10/share/man/man4/netmap.4 ============================================================================== --- stable/10/share/man/man4/netmap.4 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man4/netmap.4 Tue Sep 27 19:00:22 2016 (r306378) @@ -614,7 +614,7 @@ In the example below, "netmap:foo" is an (default) all hardware ring pairs .It NR_REG_SW_NIC "netmap:foo^" the ``host rings'', connecting to the host stack. -.It NR_RING_NIC_SW "netmap:foo+ +.It NR_RING_NIC_SW "netmap:foo+" all hardware rings and the host rings .It NR_REG_ONE_NIC "netmap:foo-i" only the i-th hardware ring pair, where the number is in Modified: stable/10/share/man/man9/get_cyclecount.9 ============================================================================== --- stable/10/share/man/man9/get_cyclecount.9 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man9/get_cyclecount.9 Tue Sep 27 19:00:22 2016 (r306378) @@ -77,7 +77,6 @@ and processors use the .Li TSC register. -.Pp The .Tn IA64 processors use the Modified: stable/10/share/man/man9/malloc.9 ============================================================================== --- stable/10/share/man/man9/malloc.9 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man9/malloc.9 Tue Sep 27 19:00:22 2016 (r306378) @@ -208,12 +208,6 @@ one must include .In sys/types.h ) and .In sys/kernel.h . -.Sh IMPLEMENTATION NOTES -The memory allocator allocates memory in chunks that have size a power -of two for requests up to the size of a page of memory. -For larger requests, one or more pages is allocated. -While it should not be relied upon, this information may be useful for -optimizing the efficiency of memory use. .Pp Programmers should be careful not to confuse the malloc flags .Dv M_NOWAIT @@ -255,6 +249,12 @@ when holding a .Xr vnode 9 interlock, will cause a LOR (Lock Order Reversal) due to the intertwining of VM Objects and Vnodes. +.Sh IMPLEMENTATION NOTES +The memory allocator allocates memory in chunks that have size a power +of two for requests up to the size of a page of memory. +For larger requests, one or more pages is allocated. +While it should not be relied upon, this information may be useful for +optimizing the efficiency of memory use. .Sh RETURN VALUES The .Fn malloc , Modified: stable/10/share/man/man9/sleepqueue.9 ============================================================================== --- stable/10/share/man/man9/sleepqueue.9 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/share/man/man9/sleepqueue.9 Tue Sep 27 19:00:22 2016 (r306378) @@ -246,7 +246,6 @@ allows to pass additional .Fn callout_reset_sbt flags. .Pp -.Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep until it is awakened and to context switch to another thread. Modified: stable/10/sys/boot/common/zfsloader.8 ============================================================================== --- stable/10/sys/boot/common/zfsloader.8 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/sys/boot/common/zfsloader.8 Tue Sep 27 19:00:22 2016 (r306378) @@ -62,7 +62,6 @@ refers to a ZFS filesystem, then will instruct kernel to use that filesystem as the root filesystem. .Sh ZFS COMMAND EXTENSIONS .Bl -tag -width Ds -compact -.Pp .It Ic lsdev Op Fl v Lists ZFS pools in addition to disks and partitions. Adding @@ -87,11 +86,9 @@ itself. .El .Sh EXAMPLES Set the default device used for loading a kernel from a ZFS filesystem: -.Pp .Bd -literal -offset indent set currdev=zfs:tank/ROOT/knowngood: .Ed -.Pp .Sh SEE ALSO .Xr gptzfsboot 8 , .Xr loader 8 , Modified: stable/10/sys/boot/i386/gptzfsboot/gptzfsboot.8 ============================================================================== --- stable/10/sys/boot/i386/gptzfsboot/gptzfsboot.8 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/sys/boot/i386/gptzfsboot/gptzfsboot.8 Tue Sep 27 19:00:22 2016 (r306378) @@ -176,6 +176,9 @@ gpart bootcode -p /boot/gptzfsboot -i 1 .Sh HISTORY .Nm appeared in FreeBSD 7.3. +.Sh AUTHORS +This manual page was written by +.An Andriy Gapon Aq avg@FreeBSD.org . .Sh BUGS .Nm looks for ZFS meta-data only in MBR partitions @@ -188,6 +191,3 @@ found at the fixed offsets relative to a .Nm will recognize the partition as a part of a ZFS pool, but this is not guaranteed to happen. -.Sh AUTHORS -This manual page was written by -.An Andriy Gapon Aq avg@FreeBSD.org . Modified: stable/10/usr.bin/dpv/dpv.1 ============================================================================== --- stable/10/usr.bin/dpv/dpv.1 Tue Sep 27 18:55:45 2016 (r306377) +++ stable/10/usr.bin/dpv/dpv.1 Tue Sep 27 19:00:22 2016 (r306378) @@ -104,7 +104,7 @@ Do not use the default interface of .Xr dialog 3 , but instead spawn an instance of .Xr dialog 1 . -The path to +The path to .Xr dialog 1 is taken from the .Ev DIALOG @@ -313,7 +313,6 @@ is required. .It Pa $HOME/.dialogrc .El .Sh EXAMPLES -.Pp Simple example to show how fast .Xr yes 1 produces lines @@ -363,7 +362,18 @@ Zeroing a disk: .Bd -literal -offset indent dpv -o /dev/md42 < /dev/zero .Ed -.Pp +.Sh SEE ALSO +.Xr dialog 1 , +.Xr dialog 3 , +.Xr sh 1 , +.Xr Xdialog 1 +.Sh HISTORY +A +.Nm +utility first appeared in +.Fx 10.2 . +.Sh AUTHORS +.An Devin Teske Aq dteske@FreeBSD.org .Sh BUGS .Xr Xdialog 1 , when given both @@ -415,21 +425,9 @@ This does not effect .Xr Xdialog 1 , which renders the color escape sequences as plain text. See -.Do Li +.Do embedded "\\Z" sequences .Dc in .Xr dialog 1 for additional information. -.Sh SEE ALSO -.Xr dialog 1 , -.Xr dialog 3 , -.Xr sh 1 , -.Xr Xdialog 1 -.Sh HISTORY -A -.Nm -utility first appeared in -.Fx 10.2 . -.Sh AUTHORS -.An Devin Teske Aq dteske@FreeBSD.org From owner-svn-src-stable-10@freebsd.org Wed Sep 28 20:49:34 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0C5BC0121A; Wed, 28 Sep 2016 20:49:34 +0000 (UTC) (envelope-from ache@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 mx1.freebsd.org (Postfix) with ESMTPS id 794121C0F; Wed, 28 Sep 2016 20:49:34 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8SKnXrI032721; Wed, 28 Sep 2016 20:49:33 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8SKnXgO032720; Wed, 28 Sep 2016 20:49:33 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201609282049.u8SKnXgO032720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 28 Sep 2016 20:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306414 - stable/10/lib/libc/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2016 20:49:34 -0000 Author: ache Date: Wed Sep 28 20:49:33 2016 New Revision: 306414 URL: https://svnweb.freebsd.org/changeset/base/306414 Log: MFC r306075,r306109 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week 0) request and no such week in the year. 5) Fix yday formula when Sunday requested and the week started from Monday. 6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u request. 7) Shift yday/wday to the first day of the year, if incomplete week (week 0) requested and no %w/%u used. 8) For already non-standard %z extension implement GNU compatible formats: +hh and -hh. 9) Check for incorrect values for %z. PR: 212983 (case 3 only) Modified: stable/10/lib/libc/stdtime/strptime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdtime/strptime.c ============================================================================== --- stable/10/lib/libc/stdtime/strptime.c Wed Sep 28 19:35:59 2016 (r306413) +++ stable/10/lib/libc/stdtime/strptime.c Wed Sep 28 20:49:33 2016 (r306414) @@ -301,10 +301,11 @@ label: * XXX This is bogus if parsed before hour-related * specifiers. */ + if (tm->tm_hour > 12) + return (NULL); + len = strlen(tptr->am); if (strncasecmp_l(buf, tptr->am, len, locale) == 0) { - if (tm->tm_hour > 12) - return (NULL); if (tm->tm_hour == 12) tm->tm_hour = 0; buf += len; @@ -313,8 +314,6 @@ label: len = strlen(tptr->pm); if (strncasecmp_l(buf, tptr->pm, len, locale) == 0) { - if (tm->tm_hour > 12) - return (NULL); if (tm->tm_hour != 12) tm->tm_hour += 12; buf += len; @@ -374,15 +373,17 @@ label: break; + case 'u': case 'w': if (!isdigit_l((unsigned char)*buf, locale)) return (NULL); - i = *buf - '0'; - if (i > 6) + i = *buf++ - '0'; + if (i < 0 || i > 7 || (c == 'u' && i < 1) || + (c == 'w' && i > 6)) return (NULL); - tm->tm_wday = i; + tm->tm_wday = i % 7; flags |= FLAG_WDAY; break; @@ -581,10 +582,16 @@ label: i *= 10; i += *buf - '0'; buf++; + } else if (len == 2) { + i *= 100; + break; } else return (NULL); } + if (i > 1400 || (sign == -1 && i > 1200) || + (i % 100) >= 60) + return (NULL); tm->tm_hour -= sign * (i / 100); tm->tm_min -= sign * (i % 100); *GMTp = 1; @@ -609,17 +616,28 @@ label: TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); flags |= FLAG_YDAY; } else if (day_offset != -1) { + int tmpwday, tmpyday, fwo; + + fwo = first_wday_of(tm->tm_year + TM_YEAR_BASE); + /* No incomplete week (week 0). */ + if (week_offset == 0 && fwo == day_offset) + return (NULL); + /* Set the date to the first Sunday (or Monday) * of the specified week of the year. */ - if (!(flags & FLAG_WDAY)) { - tm->tm_wday = day_offset; - flags |= FLAG_WDAY; - } - tm->tm_yday = (7 - - first_wday_of(tm->tm_year + TM_YEAR_BASE) + - day_offset) % 7 + (week_offset - 1) * 7 + - tm->tm_wday - day_offset; + tmpwday = (flags & FLAG_WDAY) ? tm->tm_wday : + day_offset; + tmpyday = (7 - fwo + day_offset) % 7 + + (week_offset - 1) * 7 + + (tmpwday - day_offset + 7) % 7; + /* Impossible yday for incomplete week (week 0). */ + if (tmpyday < 0) { + if (flags & FLAG_WDAY) + return (NULL); + tmpyday = 0; + } + tm->tm_yday = tmpyday; flags |= FLAG_YDAY; } } From owner-svn-src-stable-10@freebsd.org Thu Sep 29 01:47:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7536C0075B; Thu, 29 Sep 2016 01:47:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id A7205114B; Thu, 29 Sep 2016 01:47:03 +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 u8T1l2ng045714; Thu, 29 Sep 2016 01:47:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8T1l22S045713; Thu, 29 Sep 2016 01:47:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609290147.u8T1l22S045713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Sep 2016 01:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306427 - stable/10/usr.sbin/portsnap/phttpget X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2016 01:47:03 -0000 Author: emaste Date: Thu Sep 29 01:47:02 2016 New Revision: 306427 URL: https://svnweb.freebsd.org/changeset/base/306427 Log: MFC r296205: Fix typo. Modified: stable/10/usr.sbin/portsnap/phttpget/phttpget.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/portsnap/phttpget/phttpget.8 ============================================================================== --- stable/10/usr.sbin/portsnap/phttpget/phttpget.8 Thu Sep 29 01:41:52 2016 (r306426) +++ stable/10/usr.sbin/portsnap/phttpget/phttpget.8 Thu Sep 29 01:47:02 2016 (r306427) @@ -53,7 +53,7 @@ small files need to be downloaded. The .Xr freebsd-update 8 and -.Xr portnap 8 +.Xr portsnap 8 tools use .Nm to download binary patch files. From owner-svn-src-stable-10@freebsd.org Thu Sep 29 01:53:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 554CAC009F9; Thu, 29 Sep 2016 01:53:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 250291891; Thu, 29 Sep 2016 01:53:30 +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 u8T1rTuG049399; Thu, 29 Sep 2016 01:53:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8T1rTgM049398; Thu, 29 Sep 2016 01:53:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201609290153.u8T1rTgM049398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 29 Sep 2016 01:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306428 - stable/10/usr.sbin/portsnap/phttpget X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2016 01:53:30 -0000 Author: emaste Date: Thu Sep 29 01:53:29 2016 New Revision: 306428 URL: https://svnweb.freebsd.org/changeset/base/306428 Log: MFC (part of) r298089 by pfg: Cleanup unnecessary semicolons Modified: stable/10/usr.sbin/portsnap/phttpget/phttpget.c Modified: stable/10/usr.sbin/portsnap/phttpget/phttpget.c ============================================================================== --- stable/10/usr.sbin/portsnap/phttpget/phttpget.c Thu Sep 29 01:47:02 2016 (r306427) +++ stable/10/usr.sbin/portsnap/phttpget/phttpget.c Thu Sep 29 01:53:29 2016 (r306428) @@ -598,7 +598,7 @@ main(int argc, char *argv[]) fd = open(fname, O_CREAT | O_TRUNC | O_WRONLY, 0644); if (fd == -1) errx(1, "open(%s)", fname); - }; + } /* Read the message and send data to fd if appropriate */ if (chunked) { From owner-svn-src-stable-10@freebsd.org Fri Sep 30 00:31:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC9E2C02FE7; Fri, 30 Sep 2016 00:31:18 +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 mx1.freebsd.org (Postfix) with ESMTPS id AC4D418E8; Fri, 30 Sep 2016 00:31:18 +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 u8U0VHM8061930; Fri, 30 Sep 2016 00:31:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U0VHW7061929; Fri, 30 Sep 2016 00:31:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300031.u8U0VHW7061929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 00:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306466 - in stable: 10/sys/x86/iommu 11/sys/x86/iommu X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 00:31:19 -0000 Author: jhb Date: Fri Sep 30 00:31:17 2016 New Revision: 306466 URL: https://svnweb.freebsd.org/changeset/base/306466 Log: MFC 303886: Add additional constants. - Add constants for the fields in the root-entry table address register, namely the root type type (RTT) and root table address (RTA) mask. - Add macros for the bitmask of the domain ID field in the second word of context table entries as well as a helper macro (DMAR_CTX2_GET_DID) to extract the domain ID from a context table entry. Sponsored by: Chelsio Communications Modified: stable/10/sys/x86/iommu/intel_reg.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/x86/iommu/intel_reg.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/x86/iommu/intel_reg.h ============================================================================== --- stable/10/sys/x86/iommu/intel_reg.h Fri Sep 30 00:16:54 2016 (r306465) +++ stable/10/sys/x86/iommu/intel_reg.h Fri Sep 30 00:31:17 2016 (r306466) @@ -67,7 +67,9 @@ typedef struct dmar_ctx_entry { #define DMAR_CTX2_AW_4LVL 2 /* 4-level page tables */ #define DMAR_CTX2_AW_5LVL 3 /* 5-level page tables */ #define DMAR_CTX2_AW_6LVL 4 /* 6-level page tables */ +#define DMAR_CTX2_DID_MASK 0xffff0 #define DMAR_CTX2_DID(x) ((x) << 8) /* Domain Identifier */ +#define DMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8) typedef struct dmar_pte { uint64_t pte; @@ -214,6 +216,8 @@ typedef struct dmar_irte { /* Root-Entry Table Address register */ #define DMAR_RTADDR_REG 0x20 +#define DMAR_RTADDR_RTT (1 << 11) /* Root Table Type */ +#define DMAR_RTADDR_RTA_MASK 0xfffffffffffff000 /* Context Command register */ #define DMAR_CCMD_REG 0x28 From owner-svn-src-stable-10@freebsd.org Fri Sep 30 00:33:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58718C002E1; Fri, 30 Sep 2016 00:33:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2571E1D71; Fri, 30 Sep 2016 00:33:20 +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 u8U0XJnI065458; Fri, 30 Sep 2016 00:33:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U0XJ6N065457; Fri, 30 Sep 2016 00:33:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300033.u8U0XJ6N065457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 00:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306467 - in stable: 10/tools/tools/dmardump 11/tools/tools/dmardump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 00:33:20 -0000 Author: jhb Date: Fri Sep 30 00:33:19 2016 New Revision: 306467 URL: https://svnweb.freebsd.org/changeset/base/306467 Log: MFC 303887: Add a dmardump utility to dump the VT-d context tables. This tool parses the ACPI DMAR table looking for DMA remapping devices. For each device it walks the root table and any context tables referenced to display mapping info for PCI devices. Note that acpidump -t already parses the info in the ACPI DMAR tables directly. This tool examines some of the data structures the DMAR remapping engines use to translate DMA requests. Sponsored by: Chelsio Communications Added: stable/10/tools/tools/dmardump/ - copied from r303887, head/tools/tools/dmardump/ Modified: Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/11/tools/tools/dmardump/ - copied from r303887, head/tools/tools/dmardump/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-10@freebsd.org Fri Sep 30 00:43:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F03CC00A69; Fri, 30 Sep 2016 00:43:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id 61C5AAF6; Fri, 30 Sep 2016 00:43:31 +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 u8U0hU7t069158; Fri, 30 Sep 2016 00:43:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U0hUwB069157; Fri, 30 Sep 2016 00:43:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300043.u8U0hUwB069157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 00:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306468 - stable/10/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 00:43:31 -0000 Author: jhb Date: Fri Sep 30 00:43:30 2016 New Revision: 306468 URL: https://svnweb.freebsd.org/changeset/base/306468 Log: MFC 295813,295816: Remove redundant check for "(dinfo != NULL)". Modified: stable/10/sys/dev/pci/pci_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/pci/pci_user.c ============================================================================== --- stable/10/sys/dev/pci/pci_user.c Fri Sep 30 00:33:19 2016 (r306467) +++ stable/10/sys/dev/pci/pci_user.c Fri Sep 30 00:43:30 2016 (r306468) @@ -709,9 +709,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, * that match the user's criteria. */ for (cio->num_matches = 0, error = 0, i = 0, - dinfo = STAILQ_FIRST(devlist_head); - (dinfo != NULL) && (cio->num_matches < ionum) - && (error == 0) && (i < pci_numdevs) && (dinfo != NULL); + dinfo = STAILQ_FIRST(devlist_head); + (dinfo != NULL) && (cio->num_matches < ionum) && + (error == 0) && (i < pci_numdevs); dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { if (i < cio->offset) From owner-svn-src-stable-10@freebsd.org Fri Sep 30 01:13:58 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76E19C01337; Fri, 30 Sep 2016 01:13:58 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5230017E9; Fri, 30 Sep 2016 01:13:58 +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 u8U1DvBV080294; Fri, 30 Sep 2016 01:13:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U1DvSV080292; Fri, 30 Sep 2016 01:13:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300113.u8U1DvSV080292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 01:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306469 - in stable: 10/share/man/man4 10/sys/dev/pci 11/share/man/man4 11/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 01:13:58 -0000 Author: jhb Date: Fri Sep 30 01:13:57 2016 New Revision: 306469 URL: https://svnweb.freebsd.org/changeset/base/306469 Log: MFC 303881: Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF. Previously the loop in PCIIOCGETCONF would terminate as soon as it found enough matches. Now it will continue iterating through the PCI device list and only terminate if it finds another matching device for which it has no room to store a conf structure. This means that PCI_GETCONF_LAST_DEVICE is reliably returned when the number of matching devices is equal to the number of slots in the matches buffer. For example, if a program requests the conf structure for a single PCI function with a specified domain/bus/slot/function it will now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS. While here, simplify the loop conditional a bit more by explicitly breaking out of the loop if copyout() fails and removing a redundant i < pci_numdevs check. Sponsored by: Chelsio Communications Modified: stable/10/share/man/man4/pci.4 stable/10/sys/dev/pci/pci_user.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/pci.4 stable/11/sys/dev/pci/pci_user.c Directory Properties: stable/11/ (props changed) Modified: stable/10/share/man/man4/pci.4 ============================================================================== --- stable/10/share/man/man4/pci.4 Fri Sep 30 00:43:30 2016 (r306468) +++ stable/10/share/man/man4/pci.4 Fri Sep 30 01:13:57 2016 (r306469) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2008 +.Dd August 9, 2016 .Dt PCI 4 .Os .Sh NAME @@ -229,7 +229,8 @@ The status tells the user the dispositio The possible status values are: .Bl -ohang .It PCI_GETCONF_LAST_DEVICE -This means that there are no more devices in the PCI device list after the +This means that there are no more devices in the PCI device list matching +the specified criteria after the ones returned in the .Va matches buffer. @@ -245,9 +246,7 @@ and to zero to start over at the beginning of the list. .It PCI_GETCONF_MORE_DEVS This tells the user that his buffer was not large enough to hold all of the -remaining devices in the device list that possibly match his criteria. -It is possible for this status to be returned, even when none of the remaining -devices in the list would match the user's criteria. +remaining devices in the device list that match his criteria. .It PCI_GETCONF_ERROR This indicates a general error while servicing the user's request. If the Modified: stable/10/sys/dev/pci/pci_user.c ============================================================================== --- stable/10/sys/dev/pci/pci_user.c Fri Sep 30 00:43:30 2016 (r306468) +++ stable/10/sys/dev/pci/pci_user.c Fri Sep 30 01:13:57 2016 (r306469) @@ -708,10 +708,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, * Go through the list of devices and copy out the devices * that match the user's criteria. */ - for (cio->num_matches = 0, error = 0, i = 0, + for (cio->num_matches = 0, i = 0, dinfo = STAILQ_FIRST(devlist_head); - (dinfo != NULL) && (cio->num_matches < ionum) && - (error == 0) && (i < pci_numdevs); + dinfo != NULL; dinfo = STAILQ_NEXT(dinfo, pci_links), i++) { if (i < cio->offset) @@ -833,11 +832,12 @@ pci_ioctl(struct cdev *dev, u_long cmd, } else #endif /* PRE7_COMPAT */ confdata = &dinfo->conf; - /* Only if we can copy it out do we count it. */ - if (!(error = copyout(confdata, + error = copyout(confdata, (caddr_t)cio->matches + - confsz * cio->num_matches, confsz))) - cio->num_matches++; + confsz * cio->num_matches, confsz); + if (error) + break; + cio->num_matches++; } } From owner-svn-src-stable-10@freebsd.org Fri Sep 30 01:16:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6937AC0148B; Fri, 30 Sep 2016 01:16:10 +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 mx1.freebsd.org (Postfix) with ESMTPS id 39B0D1BF1; Fri, 30 Sep 2016 01:16:10 +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 u8U1G9w2081201; Fri, 30 Sep 2016 01:16:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U1G9fU081200; Fri, 30 Sep 2016 01:16:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300116.u8U1G9fU081200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 01:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306470 - in stable: 10/share/man/man9 11/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 01:16:10 -0000 Author: jhb Date: Fri Sep 30 01:16:09 2016 New Revision: 306470 URL: https://svnweb.freebsd.org/changeset/base/306470 Log: MFC 305248: Remove warning about pci_addr_t being different sizes. pci_addr_t has always been 64-bits since r163805. Modified: stable/10/share/man/man9/pci.9 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man9/pci.9 Directory Properties: stable/11/ (props changed) Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Fri Sep 30 01:13:57 2016 (r306469) +++ stable/10/share/man/man9/pci.9 Fri Sep 30 01:16:09 2016 (r306470) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2016 +.Dd September 1, 2016 .Dt PCI 9 .Os .Sh NAME @@ -793,11 +793,6 @@ with one in the new distribution. The .Fn pci_remap_msix function will fail if this condition is not met. -.Sh IMPLEMENTATION NOTES -The -.Vt pci_addr_t -type varies according to the size of the PCI bus address -space on the target architecture. .Sh SEE ALSO .Xr pci 4 , .Xr pciconf 8 , From owner-svn-src-stable-10@freebsd.org Fri Sep 30 01:42:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17802C01AD0; Fri, 30 Sep 2016 01:42:31 +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 mx1.freebsd.org (Postfix) with ESMTPS id E970DB4F; Fri, 30 Sep 2016 01:42:30 +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 u8U1gUB9092226; Fri, 30 Sep 2016 01:42:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8U1gTWK092222; Fri, 30 Sep 2016 01:42:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609300142.u8U1gTWK092222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 01:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306472 - in stable/10/sys/amd64/vmm: . io X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 01:42:31 -0000 Author: jhb Date: Fri Sep 30 01:42:29 2016 New Revision: 306472 URL: https://svnweb.freebsd.org/changeset/base/306472 Log: MFC 304858,305485: Fix various issues with PCI pass through and VT-d. 304858: Enable I/O MMU when PCI pass through is first used. Rather than enabling the I/O MMU when the vmm module is loaded, defer initialization until the first attempt to pass a PCI device through to a guest. If the I/O MMU fails to initialize or is not present, than fail the attempt to pass a PCI device through to a guest. The hw.vmm.force_iommu tunable has been removed since the I/O MMU is no longer enabled during boot. However, the I/O MMU support can be disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent use of the I/O MMU on any systems where it is buggy. 305485: Leave ppt devices in the host domain when they are not attached to a VM. This allows a pass through device to be reset to a normal device driver on the host and reused on the host. ppt devices are now always active in some I/O MMU domain when the I/O MMU is active, either the host domain or the domain of a VM they are attached to. Modified: stable/10/sys/amd64/vmm/io/iommu.c stable/10/sys/amd64/vmm/io/iommu.h stable/10/sys/amd64/vmm/io/ppt.c stable/10/sys/amd64/vmm/vmm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/io/iommu.c ============================================================================== --- stable/10/sys/amd64/vmm/io/iommu.c Fri Sep 30 01:39:18 2016 (r306471) +++ stable/10/sys/amd64/vmm/io/iommu.c Fri Sep 30 01:42:29 2016 (r306472) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmm_util.h" @@ -51,6 +52,10 @@ static int iommu_avail; SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail, 0, "bhyve iommu initialized?"); +static int iommu_enable = 1; +SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0, + "Enable use of I/O MMU (required for PCI passthrough)."); + static struct iommu_ops *ops; static void *host_domain; @@ -148,14 +153,16 @@ IOMMU_DISABLE(void) (*ops->disable)(); } -void +static void iommu_init(void) { int error, bus, slot, func; vm_paddr_t maxaddr; - const char *name; device_t dev; + if (!iommu_enable) + return; + if (vmm_is_intel()) ops = &iommu_ops_intel; else if (vmm_is_amd()) @@ -174,8 +181,13 @@ iommu_init(void) */ maxaddr = vmm_mem_maxaddr(); host_domain = IOMMU_CREATE_DOMAIN(maxaddr); - if (host_domain == NULL) - panic("iommu_init: unable to create a host domain"); + if (host_domain == NULL) { + printf("iommu_init: unable to create a host domain"); + IOMMU_CLEANUP(); + ops = NULL; + iommu_avail = 0; + return; + } /* * Create 1:1 mappings from '0' to 'maxaddr' for devices assigned to @@ -190,12 +202,7 @@ iommu_init(void) if (dev == NULL) continue; - /* skip passthrough devices */ - name = device_get_name(dev); - if (name != NULL && strcmp(name, "ppt") == 0) - continue; - - /* everything else belongs to the host domain */ + /* Everything belongs to the host domain. */ iommu_add_device(host_domain, pci_get_rid(dev)); } @@ -216,7 +223,16 @@ iommu_cleanup(void) void * iommu_create_domain(vm_paddr_t maxaddr) { + static volatile int iommu_initted; + if (iommu_initted < 2) { + if (atomic_cmpset_int(&iommu_initted, 0, 1)) { + iommu_init(); + atomic_store_rel_int(&iommu_initted, 2); + } else + while (iommu_initted == 1) + cpu_spinwait(); + } return (IOMMU_CREATE_DOMAIN(maxaddr)); } Modified: stable/10/sys/amd64/vmm/io/iommu.h ============================================================================== --- stable/10/sys/amd64/vmm/io/iommu.h Fri Sep 30 01:39:18 2016 (r306471) +++ stable/10/sys/amd64/vmm/io/iommu.h Fri Sep 30 01:42:29 2016 (r306472) @@ -61,7 +61,6 @@ struct iommu_ops { extern struct iommu_ops iommu_ops_intel; extern struct iommu_ops iommu_ops_amd; -void iommu_init(void); void iommu_cleanup(void); void *iommu_host_domain(void); void *iommu_create_domain(vm_paddr_t maxaddr); Modified: stable/10/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.c Fri Sep 30 01:39:18 2016 (r306471) +++ stable/10/sys/amd64/vmm/io/ppt.c Fri Sep 30 01:42:29 2016 (r306472) @@ -363,6 +363,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; + iommu_remove_device(iommu_host_domain(), pci_get_rid(ppt->dev)); iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); return (0); } @@ -385,6 +386,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + iommu_add_device(iommu_host_domain(), pci_get_rid(ppt->dev)); ppt->vm = NULL; return (0); } Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Fri Sep 30 01:39:18 2016 (r306471) +++ stable/10/sys/amd64/vmm/vmm.c Fri Sep 30 01:42:29 2016 (r306472) @@ -228,11 +228,6 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, trace_gues &trace_guest_exceptions, 0, "Trap into hypervisor on all guest exceptions and reflect them back"); -static int vmm_force_iommu = 0; -TUNABLE_INT("hw.vmm.force_iommu", &vmm_force_iommu); -SYSCTL_INT(_hw_vmm, OID_AUTO, force_iommu, CTLFLAG_RDTUN, &vmm_force_iommu, 0, - "Force use of I/O MMU even if no passthrough devices were found."); - static void vm_free_memmap(struct vm *vm, int ident); static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr); @@ -362,8 +357,6 @@ vmm_handler(module_t mod, int what, void switch (what) { case MOD_LOAD: vmmdev_init(); - if (vmm_force_iommu || ppt_avail_devices() > 0) - iommu_init(); error = vmm_init(); if (error == 0) vmm_initialized = 1; @@ -400,9 +393,6 @@ static moduledata_t vmm_kmod = { /* * vmm initialization has the following dependencies: * - * - iommu initialization must happen after the pci passthru driver has had - * a chance to attach to any passthru devices (after SI_SUB_CONFIGURE). - * * - VT-x initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). */ @@ -897,6 +887,8 @@ vm_assign_pptdev(struct vm *vm, int bus, ("vm_assign_pptdev: iommu must be NULL")); maxaddr = sysmem_maxaddr(vm); vm->iommu = iommu_create_domain(maxaddr); + if (vm->iommu == NULL) + return (ENXIO); vm_iommu_map(vm); } From owner-svn-src-stable-10@freebsd.org Fri Sep 30 01:47:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19AC1C01C47; Fri, 30 Sep 2016 01:47:46 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB308D3A; Fri, 30 Sep 2016 01:47:45 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id C937010AF8D; Thu, 29 Sep 2016 21:47:37 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r306472 - in stable/10/sys/amd64/vmm: . io Date: Thu, 29 Sep 2016 18:46:36 -0700 Message-ID: <2182781.Bke7ZiohbR@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201609300142.u8U1gTWK092222@repo.freebsd.org> References: <201609300142.u8U1gTWK092222@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 29 Sep 2016 21:47:37 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 01:47:46 -0000 On Friday, September 30, 2016 01:42:29 AM John Baldwin wrote: > Author: jhb > Date: Fri Sep 30 01:42:29 2016 > New Revision: 306472 > URL: https://svnweb.freebsd.org/changeset/base/306472 > > Log: > MFC 304858,305485: Fix various issues with PCI pass through and VT-d. > > 304858: > Enable I/O MMU when PCI pass through is first used. > > Rather than enabling the I/O MMU when the vmm module is loaded, > defer initialization until the first attempt to pass a PCI device > through to a guest. If the I/O MMU fails to initialize or is not > present, than fail the attempt to pass a PCI device through to a > guest. > > The hw.vmm.force_iommu tunable has been removed since the I/O MMU is > no longer enabled during boot. However, the I/O MMU support can be > disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent > use of the I/O MMU on any systems where it is buggy. > > 305485: > Leave ppt devices in the host domain when they are not attached to a VM. > > This allows a pass through device to be reset to a normal device driver > on the host and reused on the host. ppt devices are now always active in > some I/O MMU domain when the I/O MMU is active, either the host domain > or the domain of a VM they are attached to. I did not MFC 305497 (update I/O MMU when adding/removing PCI devices) since there was a conflict and neither SR-IOV nor PCI-e Hotplug are in 10 (though Cardbus is in 10). At this point I doubt I will get around to merging Hotplug to 10, but if I do then 305497 could be merged. -- John Baldwin From owner-svn-src-stable-10@freebsd.org Fri Sep 30 13:49:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B377EC0258D; Fri, 30 Sep 2016 13:49:51 +0000 (UTC) (envelope-from royger@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 mx1.freebsd.org (Postfix) with ESMTPS id 83DDDC03; Fri, 30 Sep 2016 13:49:51 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UDnomm066705; Fri, 30 Sep 2016 13:49:50 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UDnovN066704; Fri, 30 Sep 2016 13:49:50 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201609301349.u8UDnovN066704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 30 Sep 2016 13:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306501 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 13:49:51 -0000 Author: royger Date: Fri Sep 30 13:49:50 2016 New Revision: 306501 URL: https://svnweb.freebsd.org/changeset/base/306501 Log: MFC r299064 rtc: fix inverted resolution check Modified: stable/10/sys/kern/subr_rtc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rtc.c ============================================================================== --- stable/10/sys/kern/subr_rtc.c Fri Sep 30 13:47:52 2016 (r306500) +++ stable/10/sys/kern/subr_rtc.c Fri Sep 30 13:49:50 2016 (r306501) @@ -84,7 +84,7 @@ clock_register(device_t dev, long res) / { if (clock_dev != NULL) { - if (clock_res > res) { + if (clock_res <= res) { if (bootverbose) device_printf(dev, "not installed as " "time-of-day clock: clock %s has higher " From owner-svn-src-stable-10@freebsd.org Fri Sep 30 18:47:36 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D296C046E8; Fri, 30 Sep 2016 18:47:36 +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 mx1.freebsd.org (Postfix) with ESMTPS id E2351A6; Fri, 30 Sep 2016 18:47:35 +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 u8UIlZXj083010; Fri, 30 Sep 2016 18:47:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UIlYpo083004; Fri, 30 Sep 2016 18:47:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609301847.u8UIlYpo083004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 18:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306520 - in stable: 10/share/man/man9 10/sys/amd64/vmm/io 10/sys/dev/pci 11/share/man/man9 11/sys/amd64/vmm/io 11/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 18:47:36 -0000 Author: jhb Date: Fri Sep 30 18:47:34 2016 New Revision: 306520 URL: https://svnweb.freebsd.org/changeset/base/306520 Log: MFC 305502: Reset PCI pass through devices via PCI-e FLR during VM start/end. Add routines to trigger a function level reset (FLR) of a PCI-express device via the PCI-express device control register. This also includes support routines to wait for pending transactions to complete as well as calculating the maximum completion timeout permitted by a device. Change the ppt(4) driver to reset pass through devices before attaching to a VM during startup and before detaching from a VM during shutdown. Sponsored by: Chelsio Communications Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/pci.9 stable/10/sys/amd64/vmm/io/ppt.c stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pcireg.h stable/10/sys/dev/pci/pcivar.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man9/Makefile stable/11/share/man/man9/pci.9 stable/11/sys/amd64/vmm/io/ppt.c stable/11/sys/dev/pci/pci.c stable/11/sys/dev/pci/pcireg.h stable/11/sys/dev/pci/pcivar.h Directory Properties: stable/11/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/share/man/man9/Makefile Fri Sep 30 18:47:34 2016 (r306520) @@ -1037,7 +1037,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 \ pci.9 pcie_adjust_config.9 \ + pci.9 pcie_flr.9 \ + pci.9 pcie_max_completion_timeout.9 \ pci.9 pcie_read_config.9 \ + pci.9 pcie_wait_for_pending_transactions.9 \ pci.9 pcie_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ Modified: stable/10/share/man/man9/pci.9 ============================================================================== --- stable/10/share/man/man9/pci.9 Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/share/man/man9/pci.9 Fri Sep 30 18:47:34 2016 (r306520) @@ -62,7 +62,10 @@ .Nm pci_set_powerstate , .Nm pci_write_config , .Nm pcie_adjust_config , +.Nm pcie_flr , +.Nm pcie_get_max_completion_timeout , .Nm pcie_read_config , +.Nm pcie_wait_for_pending_transactions , .Nm pcie_write_config .Nd PCI bus interface .Sh SYNOPSIS @@ -139,8 +142,14 @@ .Fa "uint32_t val" .Fa "int width" .Fc +.Ft bool +.Fn pcie_flr "device_t dev" "u_int max_delay" "bool force" +.Ft int +.Fn pcie_get_max_completion_timeout "device_t dev" .Ft uint32_t .Fn pcie_read_config "device_t dev" "int reg" "int width" +.Ft bool +.Fn pcie_wait_for_pending_transactions "device_t dev" "u_int max_delay" .Ft void .Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width" .Sh DESCRIPTION @@ -393,6 +402,51 @@ keyword, then .Fn pci_get_vpd_readonly returns an error. +.Pp +The +.Fn pcie_get_max_completion_timeout +function returns the maximum completion timeout configured for the device +.Fa dev +in microseconds. +If the +.Fa dev +device is not a PCI-express device, +.Fn pcie_get_max_completion_timeout +returns zero. +When completion timeouts are disabled for +.Fa dev , +this function returns the maxmimum timeout that would be used if timeouts +were enabled. +.Pp +The +.Fn pcie_wait_for_pending_transactions +function waits for any pending transactions initiated by the +.Fa dev +device to complete. +The function checks for pending transactions by polling the transactions +pending flag in the PCI-express device status register. +It returns +.Dv true +once the transaction pending flag is clear. +If transactions are still pending after +.Fa max_delay +milliseconds, +.Fn pcie_wait_for_pending_transactions +returns +.Dv false . +If +.Fa max_delay +is set to zero, +.Fn pcie_wait_for_pending_transactions +performs a single check; +otherwise, +this function may sleep while polling the transactions pending flag. +.Nm pcie_wait_for_pending_transactions +returns +.Dv true +if +.Fa dev +is not a PCI-express device. .Ss Device Configuration The .Fn pci_enable_busmaster @@ -541,6 +595,51 @@ is invoked, then the device will be transitioned to .Dv PCI_POWERSTATE_D0 before any config registers are restored. +.Pp +The +.Fn pcie_flr +function requests a Function Level Reset +.Pq FLR +of +.Fa dev . +If +.Fa dev +is not a PCI-express device or does not support Function Level Resets via +the PCI-express device control register, +.Dv false +is returned. +Pending transactions are drained by disabling busmastering and calling +.Fn pcie_wait_for_pending_transactions +before resetting the device. +The +.Fa max_delay +argument specifies the maximum timeout to wait for pending transactions as +described for +.Fn pcie_wait_for_pending_transactions . +If +.Fn pcie_wait_for_pending_transactions +fails with a timeout and +.Fa force +is +.Dv false , +busmastering is re-enabled and +.Dv false +is returned. +If +.Fn pcie_wait_for_pending_transactions +fails with a timeout and +.Fa force +is +.Dv true , +the device is reset despite the timeout. +After the reset has been requested, +.Nm pcie_flr +sleeps for at least 100 milliseconds before returning +.Dv true . +Note that +.Nm pcie_flr +does not save and restore any state around the reset. +The caller should save and restore state as needed. .Ss Message Signaled Interrupts Message Signaled Interrupts .Pq MSI Modified: stable/10/sys/amd64/vmm/io/ppt.c ============================================================================== --- stable/10/sys/amd64/vmm/io/ppt.c Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/sys/amd64/vmm/io/ppt.c Fri Sep 30 18:47:34 2016 (r306520) @@ -362,6 +362,11 @@ ppt_assign_device(struct vm *vm, int bus if (ppt->vm != NULL && ppt->vm != vm) return (EBUSY); + pci_save_state(ppt->dev); + pcie_flr(ppt->dev, + max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), + true); + pci_restore_state(ppt->dev); ppt->vm = vm; iommu_remove_device(iommu_host_domain(), pci_get_rid(ppt->dev)); iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); @@ -382,6 +387,12 @@ ppt_unassign_device(struct vm *vm, int b */ if (ppt->vm != vm) return (EBUSY); + + pci_save_state(ppt->dev); + pcie_flr(ppt->dev, + max(pcie_get_max_completion_timeout(ppt->dev) / 1000, 10), + true); + pci_restore_state(ppt->dev); ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/sys/dev/pci/pci.c Fri Sep 30 18:47:34 2016 (r306520) @@ -5339,3 +5339,165 @@ pci_find_pcie_root_port(device_t dev) dev = pcib; } } + +/* + * Wait for pending transactions to complete on a PCI-express function. + * + * The maximum delay is specified in milliseconds in max_delay. Note + * that this function may sleep. + * + * Returns true if the function is idle and false if the timeout is + * exceeded. If dev is not a PCI-express function, this returns true. + */ +bool +pcie_wait_for_pending_transactions(device_t dev, u_int max_delay) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint16_t sta; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (true); + + sta = pci_read_config(dev, cap + PCIER_DEVICE_STA, 2); + while (sta & PCIEM_STA_TRANSACTION_PND) { + if (max_delay == 0) + return (false); + + /* Poll once every 100 milliseconds up to the timeout. */ + if (max_delay > 100) { + pause_sbt("pcietp", 100 * SBT_1MS, 0, C_HARDCLOCK); + max_delay -= 100; + } else { + pause_sbt("pcietp", max_delay * SBT_1MS, 0, + C_HARDCLOCK); + max_delay = 0; + } + sta = pci_read_config(dev, cap + PCIER_DEVICE_STA, 2); + } + + return (true); +} + +/* + * Determine the maximum Completion Timeout in microseconds. + * + * For non-PCI-express functions this returns 0. + */ +int +pcie_get_max_completion_timeout(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (0); + + /* + * Functions using the 1.x spec use the default timeout range of + * 50 microseconds to 50 milliseconds. Functions that do not + * support programmable timeouts also use this range. + */ + if ((dinfo->cfg.pcie.pcie_flags & PCIEM_FLAGS_VERSION) < 2 || + (pci_read_config(dev, cap + PCIER_DEVICE_CAP2, 4) & + PCIEM_CAP2_COMP_TIMO_RANGES) == 0) + return (50 * 1000); + + switch (pci_read_config(dev, cap + PCIER_DEVICE_CTL2, 2) & + PCIEM_CTL2_COMP_TIMO_VAL) { + case PCIEM_CTL2_COMP_TIMO_100US: + return (100); + case PCIEM_CTL2_COMP_TIMO_10MS: + return (10 * 1000); + case PCIEM_CTL2_COMP_TIMO_55MS: + return (55 * 1000); + case PCIEM_CTL2_COMP_TIMO_210MS: + return (210 * 1000); + case PCIEM_CTL2_COMP_TIMO_900MS: + return (900 * 1000); + case PCIEM_CTL2_COMP_TIMO_3500MS: + return (3500 * 1000); + case PCIEM_CTL2_COMP_TIMO_13S: + return (13 * 1000 * 1000); + case PCIEM_CTL2_COMP_TIMO_64S: + return (64 * 1000 * 1000); + default: + return (50 * 1000); + } +} + +/* + * Perform a Function Level Reset (FLR) on a device. + * + * This function first waits for any pending transactions to complete + * within the timeout specified by max_delay. If transactions are + * still pending, the function will return false without attempting a + * reset. + * + * If dev is not a PCI-express function or does not support FLR, this + * function returns false. + * + * Note that no registers are saved or restored. The caller is + * responsible for saving and restoring any registers including + * PCI-standard registers via pci_save_state() and + * pci_restore_state(). + */ +bool +pcie_flr(device_t dev, u_int max_delay, bool force) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + uint16_t cmd, ctl; + int compl_delay; + int cap; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (false); + + if (!(pci_read_config(dev, cap + PCIER_DEVICE_CAP, 4) & PCIEM_CAP_FLR)) + return (false); + + /* + * Disable busmastering to prevent generation of new + * transactions while waiting for the device to go idle. If + * the idle timeout fails, the command register is restored + * which will re-enable busmastering. + */ + cmd = pci_read_config(dev, PCIR_COMMAND, 2); + pci_write_config(dev, PCIR_COMMAND, cmd & ~(PCIM_CMD_BUSMASTEREN), 2); + if (!pcie_wait_for_pending_transactions(dev, max_delay)) { + if (!force) { + pci_write_config(dev, PCIR_COMMAND, cmd, 2); + return (false); + } + pci_printf(&dinfo->cfg, + "Resetting with transactions pending after %d ms\n", + max_delay); + + /* + * Extend the post-FLR delay to cover the maximum + * Completion Timeout delay of anything in flight + * during the FLR delay. Enforce a minimum delay of + * at least 10ms. + */ + compl_delay = pcie_get_max_completion_timeout(dev) / 1000; + if (compl_delay < 10) + compl_delay = 10; + } else + compl_delay = 0; + + /* Initiate the reset. */ + ctl = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + pci_write_config(dev, cap + PCIER_DEVICE_CTL, ctl | + PCIEM_CTL_INITIATE_FLR, 2); + + /* Wait for 100ms. */ + pause_sbt("pcieflr", (100 + compl_delay) * SBT_1MS, 0, C_HARDCLOCK); + + if (pci_read_config(dev, cap + PCIER_DEVICE_STA, 2) & + PCIEM_STA_TRANSACTION_PND) + pci_printf(&dinfo->cfg, "Transactions pending after FLR!\n"); + return (true); +} Modified: stable/10/sys/dev/pci/pcireg.h ============================================================================== --- stable/10/sys/dev/pci/pcireg.h Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/sys/dev/pci/pcireg.h Fri Sep 30 18:47:34 2016 (r306520) @@ -822,10 +822,25 @@ #define PCIEM_ROOT_STA_PME_STATUS 0x00010000 #define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 -#define PCIEM_CAP2_ARI 0x20 +#define PCIEM_CAP2_COMP_TIMO_RANGES 0x0000000f +#define PCIEM_CAP2_COMP_TIMO_RANGE_A 0x00000001 +#define PCIEM_CAP2_COMP_TIMO_RANGE_B 0x00000002 +#define PCIEM_CAP2_COMP_TIMO_RANGE_C 0x00000004 +#define PCIEM_CAP2_COMP_TIMO_RANGE_D 0x00000008 +#define PCIEM_CAP2_COMP_TIMO_DISABLE 0x00000010 +#define PCIEM_CAP2_ARI 0x00000020 #define PCIER_DEVICE_CTL2 0x28 -#define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f -#define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 +#define PCIEM_CTL2_COMP_TIMO_VAL 0x000f +#define PCIEM_CTL2_COMP_TIMO_50MS 0x0000 +#define PCIEM_CTL2_COMP_TIMO_100US 0x0001 +#define PCIEM_CTL2_COMP_TIMO_10MS 0x0002 +#define PCIEM_CTL2_COMP_TIMO_55MS 0x0005 +#define PCIEM_CTL2_COMP_TIMO_210MS 0x0006 +#define PCIEM_CTL2_COMP_TIMO_900MS 0x0009 +#define PCIEM_CTL2_COMP_TIMO_3500MS 0x000a +#define PCIEM_CTL2_COMP_TIMO_13S 0x000d +#define PCIEM_CTL2_COMP_TIMO_64S 0x000e +#define PCIEM_CTL2_COMP_TIMO_DISABLE 0x0010 #define PCIEM_CTL2_ARI 0x0020 #define PCIEM_CTL2_ATOMIC_REQ_ENABLE 0x0040 #define PCIEM_CTL2_ATOMIC_EGR_BLOCK 0x0080 Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Fri Sep 30 18:43:39 2016 (r306519) +++ stable/10/sys/dev/pci/pcivar.h Fri Sep 30 18:47:34 2016 (r306520) @@ -543,7 +543,9 @@ uint32_t pcie_read_config(device_t dev, void pcie_write_config(device_t dev, int reg, uint32_t value, int width); uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, int width); - +bool pcie_flr(device_t dev, u_int max_delay, bool force); +int pcie_get_max_completion_timeout(device_t dev); +bool pcie_wait_for_pending_transactions(device_t dev, u_int max_delay); #ifdef BUS_SPACE_MAXADDR #if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) From owner-svn-src-stable-10@freebsd.org Fri Sep 30 22:05:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0B0C03C9E; Fri, 30 Sep 2016 22:05:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7631EB0B; Fri, 30 Sep 2016 22:05:49 +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 u8UM5mtW061300; Fri, 30 Sep 2016 22:05:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UM5m84061293; Fri, 30 Sep 2016 22:05:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201609302205.u8UM5m84061293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 30 Sep 2016 22:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306533 - in stable: 10/lib/libdevctl 10/sys/kern 10/sys/sys 10/usr.sbin/devctl 11/lib/libdevctl 11/sys/kern 11/sys/sys 11/usr.sbin/devctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 22:05:49 -0000 Author: jhb Date: Fri Sep 30 22:05:47 2016 New Revision: 306533 URL: https://svnweb.freebsd.org/changeset/base/306533 Log: MFC 305034: Implement 'devctl clear driver' to undo a previous 'set driver'. Add a new 'clear driver' command for devctl along with the accompanying ioctl and devctl_clear_driver() library routine to reset a device to use a wildcard devclass instead of a fixed devclass. This can be used to undo a previous 'set driver' command. After the device's name has been reset to permit wildcard names, it is reprobed so that it can attach to newly-available (to it) device drivers. Sponsored by: Chelsio Communications Modified: stable/10/lib/libdevctl/devctl.3 stable/10/lib/libdevctl/devctl.c stable/10/lib/libdevctl/devctl.h stable/10/sys/kern/subr_bus.c stable/10/sys/sys/bus.h stable/10/usr.sbin/devctl/devctl.8 stable/10/usr.sbin/devctl/devctl.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libdevctl/devctl.3 stable/11/lib/libdevctl/devctl.c stable/11/lib/libdevctl/devctl.h stable/11/sys/kern/subr_bus.c stable/11/sys/sys/bus.h stable/11/usr.sbin/devctl/devctl.8 stable/11/usr.sbin/devctl/devctl.c Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libdevctl/devctl.3 ============================================================================== --- stable/10/lib/libdevctl/devctl.3 Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/lib/libdevctl/devctl.3 Fri Sep 30 22:05:47 2016 (r306533) @@ -25,12 +25,13 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2016 +.Dd August 29, 2016 .Dt DEVCTL 3 .Os .Sh NAME .Nm devctl , .Nm devctl_attach , +.Nm devctl_clear_driver , .Nm devctl_detach , .Nm devctl_disable , .Nm devctl_enable , @@ -43,6 +44,8 @@ .Ft int .Fn devctl_attach "const char *device" .Ft int +.Fn devctl_clear_driver "const char *device" "bool force" +.Ft int .Fn devctl_detach "const char *device" "bool force" .Ft int .Fn devctl_disable "const char *device" "bool force_detach" @@ -133,9 +136,26 @@ If the device is already attached and is true, the device will be detached from its current device driver before it is attached to the new device driver. +.Pp +The +.Fn devctl_clear_driver +function resets a device so that it can be attached to any valid device +driver rather than only drivers with a previously specified name. +This function is used to undo a previous call to +.Fn devctl_set_driver . +If the device is already attached and +.Fa force +is false, +the request will fail. +If the device is already attached and +.Fa force +is true, +the device will be detached from its current device driver. +After the device's name is reset, +it is reprobed and attached to a suitable device driver if one is found. .Sh RETURN VALUES -.Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \ -devctl_set_driver +.Rv -std devctl_attach devctl_clear_driver devctl_detach \ +devctl_disable devctl_enable devctl_set_driver .Sh ERRORS In addition to specific errors noted below, all of the @@ -244,6 +264,24 @@ The device is disabled. .It Bq Er ENXIO The new device driver failed to attach. .El +.Pp +The +.Fn devctl_clear_driver +function may fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The device is currently attached to a device driver and +.Fa force +is false. +.It Bq Er EBUSY +The current device driver for +.Fa device +is busy and cannot detach at this time. +.It Bq Er EINVAL +The device is not configured for a specific device driver name. +.It Bq Er ENXIO +The device driver chosen after reprobing failed to attach. +.El .Sh SEE ALSO .Xr devinfo 3 , .Xr devstat 3 , Modified: stable/10/lib/libdevctl/devctl.c ============================================================================== --- stable/10/lib/libdevctl/devctl.c Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/lib/libdevctl/devctl.c Fri Sep 30 22:05:47 2016 (r306533) @@ -108,3 +108,11 @@ devctl_set_driver(const char *device, co req.dr_flags |= DEVF_SET_DRIVER_DETACH; return (devctl_request(DEV_SET_DRIVER, &req)); } + +int +devctl_clear_driver(const char *device, bool force) +{ + + return (devctl_simple_request(DEV_CLEAR_DRIVER, device, force ? + DEVF_CLEAR_DRIVER_DETACH : 0)); +} Modified: stable/10/lib/libdevctl/devctl.h ============================================================================== --- stable/10/lib/libdevctl/devctl.h Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/lib/libdevctl/devctl.h Fri Sep 30 22:05:47 2016 (r306533) @@ -36,5 +36,6 @@ int devctl_detach(const char *device, bo int devctl_enable(const char *device); int devctl_disable(const char *device, bool force_detach); int devctl_set_driver(const char *device, const char *driver, bool force); +int devctl_clear_driver(const char *device, bool force); #endif /* !__DEVCTL_H__ */ Modified: stable/10/sys/kern/subr_bus.c ============================================================================== --- stable/10/sys/kern/subr_bus.c Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/sys/kern/subr_bus.c Fri Sep 30 22:05:47 2016 (r306533) @@ -5069,6 +5069,7 @@ devctl2_ioctl(struct cdev *cdev, u_long case DEV_ENABLE: case DEV_DISABLE: case DEV_SET_DRIVER: + case DEV_CLEAR_DRIVER: error = priv_check(td, PRIV_DRIVER); if (error == 0) error = find_device(req, &dev); @@ -5210,6 +5211,25 @@ devctl2_ioctl(struct cdev *cdev, u_long error = device_probe_and_attach(dev); break; } + case DEV_CLEAR_DRIVER: + if (!(dev->flags & DF_FIXEDCLASS)) { + error = 0; + break; + } + if (device_is_attached(dev)) { + if (req->dr_flags & DEVF_CLEAR_DRIVER_DETACH) + error = device_detach(dev); + else + error = EBUSY; + if (error) + break; + } + + dev->flags &= ~DF_FIXEDCLASS; + dev->flags |= DF_WILDCARD; + devclass_delete_device(dev->devclass, dev); + error = device_probe_and_attach(dev); + break; } mtx_unlock(&Giant); return (error); Modified: stable/10/sys/sys/bus.h ============================================================================== --- stable/10/sys/sys/bus.h Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/sys/sys/bus.h Fri Sep 30 22:05:47 2016 (r306533) @@ -103,6 +103,7 @@ struct devreq { #define DEV_ENABLE _IOW('D', 3, struct devreq) #define DEV_DISABLE _IOW('D', 4, struct devreq) #define DEV_SET_DRIVER _IOW('D', 7, struct devreq) +#define DEV_CLEAR_DRIVER _IOW('D', 8, struct devreq) /* Flags for DEV_DETACH and DEV_DISABLE. */ #define DEVF_FORCE_DETACH 0x0000001 @@ -110,6 +111,9 @@ struct devreq { /* Flags for DEV_SET_DRIVER. */ #define DEVF_SET_DRIVER_DETACH 0x0000001 /* Detach existing driver. */ +/* Flags for DEV_CLEAR_DRIVER. */ +#define DEVF_CLEAR_DRIVER_DETACH 0x0000001 /* Detach existing driver. */ + #ifdef _KERNEL #include Modified: stable/10/usr.sbin/devctl/devctl.8 ============================================================================== --- stable/10/usr.sbin/devctl/devctl.8 Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/usr.sbin/devctl/devctl.8 Fri Sep 30 22:05:47 2016 (r306533) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2016 +.Dd August 29, 2016 .Dt DEVCTL 8 .Os .Sh NAME @@ -36,6 +36,10 @@ .Cm attach .Ar device .Nm +.Cm clear driver +.Op Fl f +.Ar device +.Nm .Cm detach .Op Fl f .Ar device @@ -115,6 +119,21 @@ If the device is already attached to a d .Fl f flag is not specified, the device will not be changed. +.It Xo Cm clear driver +.Op Fl f +.Ar device +.Xc +Clear a previously-forced driver name so that the device is able to use any +valid device driver. +After the previous name has been cleared, +the device is reprobed so that other device drivers may attach to it. +This can be used to undo an earlier +.Cm set driver +command. +If the device is currently attached to a device driver and the +.Fl f +flag is not specified, +the device will not be changed. .El .Sh SEE ALSO .Xr devctl 3 , Modified: stable/10/usr.sbin/devctl/devctl.c ============================================================================== --- stable/10/usr.sbin/devctl/devctl.c Fri Sep 30 21:14:42 2016 (r306532) +++ stable/10/usr.sbin/devctl/devctl.c Fri Sep 30 22:05:47 2016 (r306533) @@ -65,17 +65,19 @@ static int devctl_table_handler(struct d SET_DECLARE(DEVCTL_DATASET(top), struct devctl_command); +DEVCTL_TABLE(top, clear); DEVCTL_TABLE(top, set); static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", "usage: devctl attach device", " devctl detach [-f] device", " devctl disable [-f] device", " devctl enable device", - " devctl set driver [-f] device driver"); + " devctl set driver [-f] device driver", + " devctl clear driver [-f] device"); exit(1); } @@ -233,6 +235,40 @@ set_driver(int ac, char **av) } DEVCTL_COMMAND(set, driver, set_driver); +static void +clear_driver_usage(void) +{ + + fprintf(stderr, "usage: devctl clear driver [-f] device\n"); + exit(1); +} + +static int +clear_driver(int ac, char **av) +{ + bool force; + int ch; + + force = false; + while ((ch = getopt(ac, av, "f")) != -1) + switch (ch) { + case 'f': + force = true; + break; + default: + clear_driver_usage(); + } + ac -= optind; + av += optind; + + if (ac != 1) + clear_driver_usage(); + if (devctl_clear_driver(av[0], force) < 0) + err(1, "Failed to clear %s driver", av[0]); + return (0); +} +DEVCTL_COMMAND(clear, driver, clear_driver); + int main(int ac, char *av[]) { From owner-svn-src-stable-10@freebsd.org Fri Sep 30 22:41:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45277C04350; Fri, 30 Sep 2016 22:41:00 +0000 (UTC) (envelope-from jkim@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 mx1.freebsd.org (Postfix) with ESMTPS id E49361142; Fri, 30 Sep 2016 22:40:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UMexeJ074549; Fri, 30 Sep 2016 22:40:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UMexp2074545; Fri, 30 Sep 2016 22:40:59 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201609302240.u8UMexp2074545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 30 Sep 2016 22:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r306536 - in stable/10: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/c... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2016 22:41:00 -0000 Author: jkim Date: Fri Sep 30 22:40:58 2016 New Revision: 306536 URL: https://svnweb.freebsd.org/changeset/base/306536 Log: MFC: r284583, r285797, r285799, r287168, r298714, r298720, r298838, r300879 Merge ACPICA up to 20160527. Requested by: mav Added: stable/10/sys/contrib/dev/acpica/common/acfileio.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/common/acfileio.c stable/10/sys/contrib/dev/acpica/common/dmtables.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/common/dmtables.c stable/10/sys/contrib/dev/acpica/compiler/aslcstyle.y - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/aslcstyle.y stable/10/sys/contrib/dev/acpica/compiler/asldebug.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/asldebug.c stable/10/sys/contrib/dev/acpica/compiler/aslexternal.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/aslexternal.c stable/10/sys/contrib/dev/acpica/compiler/aslpld.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/aslpld.c stable/10/sys/contrib/dev/acpica/compiler/aslresources.y - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/aslresources.y stable/10/sys/contrib/dev/acpica/compiler/aslxrefout.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/aslxrefout.c stable/10/sys/contrib/dev/acpica/compiler/dttable1.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/dttable1.c stable/10/sys/contrib/dev/acpica/compiler/dttable2.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/compiler/dttable2.c stable/10/sys/contrib/dev/acpica/components/debugger/dbobject.c - copied, changed from r285797, head/sys/contrib/dev/acpica/components/debugger/dbobject.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c - copied, changed from r285797, head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c stable/10/sys/contrib/dev/acpica/components/executer/exconcat.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/components/executer/exconcat.c stable/10/sys/contrib/dev/acpica/components/executer/extrace.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/components/executer/extrace.c stable/10/sys/contrib/dev/acpica/components/utilities/utascii.c - copied unchanged from r298714, head/sys/contrib/dev/acpica/components/utilities/utascii.c stable/10/sys/contrib/dev/acpica/components/utilities/utnonansi.c - copied, changed from r285797, head/sys/contrib/dev/acpica/components/utilities/utnonansi.c stable/10/sys/contrib/dev/acpica/include/acclib.h - copied, changed from r284583, head/sys/contrib/dev/acpica/include/acclib.h stable/10/sys/libkern/strncat.c - copied unchanged from r298714, head/sys/libkern/strncat.c Deleted: stable/10/sys/contrib/dev/acpica/components/disassembler/dmobject.c stable/10/sys/contrib/dev/acpica/components/utilities/utfileio.c Modified: stable/10/sys/conf/files stable/10/sys/contrib/dev/acpica/acpica_prep.sh stable/10/sys/contrib/dev/acpica/changes.txt stable/10/sys/contrib/dev/acpica/common/acgetline.c stable/10/sys/contrib/dev/acpica/common/adfile.c stable/10/sys/contrib/dev/acpica/common/adisasm.c stable/10/sys/contrib/dev/acpica/common/adwalk.c stable/10/sys/contrib/dev/acpica/common/ahids.c stable/10/sys/contrib/dev/acpica/common/ahpredef.c stable/10/sys/contrib/dev/acpica/common/ahtable.c stable/10/sys/contrib/dev/acpica/common/ahuuids.c stable/10/sys/contrib/dev/acpica/common/cmfsize.c stable/10/sys/contrib/dev/acpica/common/dmextern.c stable/10/sys/contrib/dev/acpica/common/dmrestag.c stable/10/sys/contrib/dev/acpica/common/dmtable.c stable/10/sys/contrib/dev/acpica/common/dmtbdump.c stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c stable/10/sys/contrib/dev/acpica/common/getopt.c stable/10/sys/contrib/dev/acpica/compiler/aslanalyze.c stable/10/sys/contrib/dev/acpica/compiler/aslascii.c stable/10/sys/contrib/dev/acpica/compiler/aslbtypes.c stable/10/sys/contrib/dev/acpica/compiler/aslcodegen.c stable/10/sys/contrib/dev/acpica/compiler/aslcompile.c stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.l stable/10/sys/contrib/dev/acpica/compiler/asldefine.h stable/10/sys/contrib/dev/acpica/compiler/aslerror.c stable/10/sys/contrib/dev/acpica/compiler/aslfileio.c stable/10/sys/contrib/dev/acpica/compiler/aslfiles.c stable/10/sys/contrib/dev/acpica/compiler/aslfold.c stable/10/sys/contrib/dev/acpica/compiler/aslglobal.h stable/10/sys/contrib/dev/acpica/compiler/aslhex.c stable/10/sys/contrib/dev/acpica/compiler/asllength.c stable/10/sys/contrib/dev/acpica/compiler/asllisting.c stable/10/sys/contrib/dev/acpica/compiler/asllistsup.c stable/10/sys/contrib/dev/acpica/compiler/aslload.c stable/10/sys/contrib/dev/acpica/compiler/asllookup.c stable/10/sys/contrib/dev/acpica/compiler/aslmain.c stable/10/sys/contrib/dev/acpica/compiler/aslmap.c stable/10/sys/contrib/dev/acpica/compiler/aslmapenter.c stable/10/sys/contrib/dev/acpica/compiler/aslmapoutput.c stable/10/sys/contrib/dev/acpica/compiler/aslmaputils.c stable/10/sys/contrib/dev/acpica/compiler/aslmessages.c stable/10/sys/contrib/dev/acpica/compiler/aslmessages.h stable/10/sys/contrib/dev/acpica/compiler/aslmethod.c stable/10/sys/contrib/dev/acpica/compiler/aslnamesp.c stable/10/sys/contrib/dev/acpica/compiler/asloffset.c stable/10/sys/contrib/dev/acpica/compiler/aslopcodes.c stable/10/sys/contrib/dev/acpica/compiler/asloperands.c stable/10/sys/contrib/dev/acpica/compiler/aslopt.c stable/10/sys/contrib/dev/acpica/compiler/asloptions.c stable/10/sys/contrib/dev/acpica/compiler/aslparser.y stable/10/sys/contrib/dev/acpica/compiler/aslpredef.c stable/10/sys/contrib/dev/acpica/compiler/aslprepkg.c stable/10/sys/contrib/dev/acpica/compiler/aslprintf.c stable/10/sys/contrib/dev/acpica/compiler/aslprune.c stable/10/sys/contrib/dev/acpica/compiler/aslresource.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype1.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype1i.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2d.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2e.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2q.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2s.c stable/10/sys/contrib/dev/acpica/compiler/aslrestype2w.c stable/10/sys/contrib/dev/acpica/compiler/aslrules.y stable/10/sys/contrib/dev/acpica/compiler/aslstartup.c stable/10/sys/contrib/dev/acpica/compiler/aslstubs.c stable/10/sys/contrib/dev/acpica/compiler/aslsupport.l stable/10/sys/contrib/dev/acpica/compiler/aslsupport.y stable/10/sys/contrib/dev/acpica/compiler/asltokens.y stable/10/sys/contrib/dev/acpica/compiler/asltransform.c stable/10/sys/contrib/dev/acpica/compiler/asltree.c stable/10/sys/contrib/dev/acpica/compiler/asltypes.h stable/10/sys/contrib/dev/acpica/compiler/asltypes.y stable/10/sys/contrib/dev/acpica/compiler/aslutils.c stable/10/sys/contrib/dev/acpica/compiler/asluuid.c stable/10/sys/contrib/dev/acpica/compiler/aslwalks.c stable/10/sys/contrib/dev/acpica/compiler/aslxref.c stable/10/sys/contrib/dev/acpica/compiler/dtcompile.c stable/10/sys/contrib/dev/acpica/compiler/dtcompiler.h stable/10/sys/contrib/dev/acpica/compiler/dtexpress.c stable/10/sys/contrib/dev/acpica/compiler/dtfield.c stable/10/sys/contrib/dev/acpica/compiler/dtio.c stable/10/sys/contrib/dev/acpica/compiler/dtparser.l stable/10/sys/contrib/dev/acpica/compiler/dtparser.y stable/10/sys/contrib/dev/acpica/compiler/dtsubtable.c stable/10/sys/contrib/dev/acpica/compiler/dttable.c stable/10/sys/contrib/dev/acpica/compiler/dttemplate.c stable/10/sys/contrib/dev/acpica/compiler/dttemplate.h stable/10/sys/contrib/dev/acpica/compiler/dtutils.c stable/10/sys/contrib/dev/acpica/compiler/preprocess.h stable/10/sys/contrib/dev/acpica/compiler/prexpress.c stable/10/sys/contrib/dev/acpica/compiler/prmacros.c stable/10/sys/contrib/dev/acpica/compiler/prparser.l stable/10/sys/contrib/dev/acpica/compiler/prparser.y stable/10/sys/contrib/dev/acpica/compiler/prscan.c stable/10/sys/contrib/dev/acpica/compiler/prutils.c stable/10/sys/contrib/dev/acpica/components/debugger/dbcmds.c stable/10/sys/contrib/dev/acpica/components/debugger/dbconvert.c stable/10/sys/contrib/dev/acpica/components/debugger/dbdisply.c stable/10/sys/contrib/dev/acpica/components/debugger/dbexec.c stable/10/sys/contrib/dev/acpica/components/debugger/dbfileio.c stable/10/sys/contrib/dev/acpica/components/debugger/dbhistry.c stable/10/sys/contrib/dev/acpica/components/debugger/dbinput.c stable/10/sys/contrib/dev/acpica/components/debugger/dbmethod.c stable/10/sys/contrib/dev/acpica/components/debugger/dbnames.c stable/10/sys/contrib/dev/acpica/components/debugger/dbstats.c stable/10/sys/contrib/dev/acpica/components/debugger/dbtest.c stable/10/sys/contrib/dev/acpica/components/debugger/dbutils.c stable/10/sys/contrib/dev/acpica/components/debugger/dbxface.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmnames.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmopcode.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmresrc.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmutils.c stable/10/sys/contrib/dev/acpica/components/disassembler/dmwalk.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsargs.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsfield.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsinit.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsobject.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dsutils.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dswexec.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dswload.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dswload2.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dswscope.c stable/10/sys/contrib/dev/acpica/components/dispatcher/dswstate.c stable/10/sys/contrib/dev/acpica/components/events/evevent.c stable/10/sys/contrib/dev/acpica/components/events/evglock.c stable/10/sys/contrib/dev/acpica/components/events/evgpe.c stable/10/sys/contrib/dev/acpica/components/events/evgpeblk.c stable/10/sys/contrib/dev/acpica/components/events/evgpeinit.c stable/10/sys/contrib/dev/acpica/components/events/evgpeutil.c stable/10/sys/contrib/dev/acpica/components/events/evhandler.c stable/10/sys/contrib/dev/acpica/components/events/evmisc.c stable/10/sys/contrib/dev/acpica/components/events/evregion.c stable/10/sys/contrib/dev/acpica/components/events/evrgnini.c stable/10/sys/contrib/dev/acpica/components/events/evsci.c stable/10/sys/contrib/dev/acpica/components/events/evxface.c stable/10/sys/contrib/dev/acpica/components/events/evxfevnt.c stable/10/sys/contrib/dev/acpica/components/events/evxfgpe.c stable/10/sys/contrib/dev/acpica/components/events/evxfregn.c stable/10/sys/contrib/dev/acpica/components/executer/exconfig.c stable/10/sys/contrib/dev/acpica/components/executer/exconvrt.c stable/10/sys/contrib/dev/acpica/components/executer/excreate.c stable/10/sys/contrib/dev/acpica/components/executer/exdebug.c stable/10/sys/contrib/dev/acpica/components/executer/exdump.c stable/10/sys/contrib/dev/acpica/components/executer/exfield.c stable/10/sys/contrib/dev/acpica/components/executer/exfldio.c stable/10/sys/contrib/dev/acpica/components/executer/exmisc.c stable/10/sys/contrib/dev/acpica/components/executer/exmutex.c stable/10/sys/contrib/dev/acpica/components/executer/exnames.c stable/10/sys/contrib/dev/acpica/components/executer/exoparg1.c stable/10/sys/contrib/dev/acpica/components/executer/exoparg2.c stable/10/sys/contrib/dev/acpica/components/executer/exoparg3.c stable/10/sys/contrib/dev/acpica/components/executer/exoparg6.c stable/10/sys/contrib/dev/acpica/components/executer/exprep.c stable/10/sys/contrib/dev/acpica/components/executer/exregion.c stable/10/sys/contrib/dev/acpica/components/executer/exresnte.c stable/10/sys/contrib/dev/acpica/components/executer/exresolv.c stable/10/sys/contrib/dev/acpica/components/executer/exresop.c stable/10/sys/contrib/dev/acpica/components/executer/exstore.c stable/10/sys/contrib/dev/acpica/components/executer/exstoren.c stable/10/sys/contrib/dev/acpica/components/executer/exstorob.c stable/10/sys/contrib/dev/acpica/components/executer/exsystem.c stable/10/sys/contrib/dev/acpica/components/executer/exutils.c stable/10/sys/contrib/dev/acpica/components/hardware/hwacpi.c stable/10/sys/contrib/dev/acpica/components/hardware/hwesleep.c stable/10/sys/contrib/dev/acpica/components/hardware/hwgpe.c stable/10/sys/contrib/dev/acpica/components/hardware/hwpci.c stable/10/sys/contrib/dev/acpica/components/hardware/hwregs.c stable/10/sys/contrib/dev/acpica/components/hardware/hwsleep.c stable/10/sys/contrib/dev/acpica/components/hardware/hwtimer.c stable/10/sys/contrib/dev/acpica/components/hardware/hwvalid.c stable/10/sys/contrib/dev/acpica/components/hardware/hwxface.c stable/10/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c stable/10/sys/contrib/dev/acpica/components/namespace/nsaccess.c stable/10/sys/contrib/dev/acpica/components/namespace/nsalloc.c stable/10/sys/contrib/dev/acpica/components/namespace/nsarguments.c stable/10/sys/contrib/dev/acpica/components/namespace/nsconvert.c stable/10/sys/contrib/dev/acpica/components/namespace/nsdump.c stable/10/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c stable/10/sys/contrib/dev/acpica/components/namespace/nseval.c stable/10/sys/contrib/dev/acpica/components/namespace/nsinit.c stable/10/sys/contrib/dev/acpica/components/namespace/nsload.c stable/10/sys/contrib/dev/acpica/components/namespace/nsnames.c stable/10/sys/contrib/dev/acpica/components/namespace/nsobject.c stable/10/sys/contrib/dev/acpica/components/namespace/nsparse.c stable/10/sys/contrib/dev/acpica/components/namespace/nspredef.c stable/10/sys/contrib/dev/acpica/components/namespace/nsprepkg.c stable/10/sys/contrib/dev/acpica/components/namespace/nsrepair.c stable/10/sys/contrib/dev/acpica/components/namespace/nsrepair2.c stable/10/sys/contrib/dev/acpica/components/namespace/nssearch.c stable/10/sys/contrib/dev/acpica/components/namespace/nsutils.c stable/10/sys/contrib/dev/acpica/components/namespace/nswalk.c stable/10/sys/contrib/dev/acpica/components/namespace/nsxfeval.c stable/10/sys/contrib/dev/acpica/components/namespace/nsxfname.c stable/10/sys/contrib/dev/acpica/components/namespace/nsxfobj.c stable/10/sys/contrib/dev/acpica/components/parser/psargs.c stable/10/sys/contrib/dev/acpica/components/parser/psloop.c stable/10/sys/contrib/dev/acpica/components/parser/psobject.c stable/10/sys/contrib/dev/acpica/components/parser/psopcode.c stable/10/sys/contrib/dev/acpica/components/parser/psopinfo.c stable/10/sys/contrib/dev/acpica/components/parser/psparse.c stable/10/sys/contrib/dev/acpica/components/parser/psscope.c stable/10/sys/contrib/dev/acpica/components/parser/pstree.c stable/10/sys/contrib/dev/acpica/components/parser/psutils.c stable/10/sys/contrib/dev/acpica/components/parser/pswalk.c stable/10/sys/contrib/dev/acpica/components/parser/psxface.c stable/10/sys/contrib/dev/acpica/components/resources/rsaddr.c stable/10/sys/contrib/dev/acpica/components/resources/rscalc.c stable/10/sys/contrib/dev/acpica/components/resources/rscreate.c stable/10/sys/contrib/dev/acpica/components/resources/rsdump.c stable/10/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c stable/10/sys/contrib/dev/acpica/components/resources/rsinfo.c stable/10/sys/contrib/dev/acpica/components/resources/rsio.c stable/10/sys/contrib/dev/acpica/components/resources/rsirq.c stable/10/sys/contrib/dev/acpica/components/resources/rslist.c stable/10/sys/contrib/dev/acpica/components/resources/rsmemory.c stable/10/sys/contrib/dev/acpica/components/resources/rsmisc.c stable/10/sys/contrib/dev/acpica/components/resources/rsserial.c stable/10/sys/contrib/dev/acpica/components/resources/rsutils.c stable/10/sys/contrib/dev/acpica/components/resources/rsxface.c stable/10/sys/contrib/dev/acpica/components/tables/tbdata.c stable/10/sys/contrib/dev/acpica/components/tables/tbfadt.c stable/10/sys/contrib/dev/acpica/components/tables/tbfind.c stable/10/sys/contrib/dev/acpica/components/tables/tbinstal.c stable/10/sys/contrib/dev/acpica/components/tables/tbprint.c stable/10/sys/contrib/dev/acpica/components/tables/tbutils.c stable/10/sys/contrib/dev/acpica/components/tables/tbxface.c stable/10/sys/contrib/dev/acpica/components/tables/tbxfload.c stable/10/sys/contrib/dev/acpica/components/tables/tbxfroot.c stable/10/sys/contrib/dev/acpica/components/utilities/utaddress.c stable/10/sys/contrib/dev/acpica/components/utilities/utalloc.c stable/10/sys/contrib/dev/acpica/components/utilities/utbuffer.c stable/10/sys/contrib/dev/acpica/components/utilities/utcache.c stable/10/sys/contrib/dev/acpica/components/utilities/utcopy.c stable/10/sys/contrib/dev/acpica/components/utilities/utdebug.c stable/10/sys/contrib/dev/acpica/components/utilities/utdecode.c stable/10/sys/contrib/dev/acpica/components/utilities/utdelete.c stable/10/sys/contrib/dev/acpica/components/utilities/uterror.c stable/10/sys/contrib/dev/acpica/components/utilities/uteval.c stable/10/sys/contrib/dev/acpica/components/utilities/utexcep.c stable/10/sys/contrib/dev/acpica/components/utilities/utglobal.c stable/10/sys/contrib/dev/acpica/components/utilities/uthex.c stable/10/sys/contrib/dev/acpica/components/utilities/utids.c stable/10/sys/contrib/dev/acpica/components/utilities/utinit.c stable/10/sys/contrib/dev/acpica/components/utilities/utlock.c stable/10/sys/contrib/dev/acpica/components/utilities/utmath.c stable/10/sys/contrib/dev/acpica/components/utilities/utmisc.c stable/10/sys/contrib/dev/acpica/components/utilities/utmutex.c stable/10/sys/contrib/dev/acpica/components/utilities/utobject.c stable/10/sys/contrib/dev/acpica/components/utilities/utosi.c stable/10/sys/contrib/dev/acpica/components/utilities/utownerid.c stable/10/sys/contrib/dev/acpica/components/utilities/utpredef.c stable/10/sys/contrib/dev/acpica/components/utilities/utprint.c stable/10/sys/contrib/dev/acpica/components/utilities/utresrc.c stable/10/sys/contrib/dev/acpica/components/utilities/utstate.c stable/10/sys/contrib/dev/acpica/components/utilities/utstring.c stable/10/sys/contrib/dev/acpica/components/utilities/uttrack.c stable/10/sys/contrib/dev/acpica/components/utilities/utuuid.c stable/10/sys/contrib/dev/acpica/components/utilities/utxface.c stable/10/sys/contrib/dev/acpica/components/utilities/utxferror.c stable/10/sys/contrib/dev/acpica/components/utilities/utxfinit.c stable/10/sys/contrib/dev/acpica/components/utilities/utxfmutex.c stable/10/sys/contrib/dev/acpica/include/acapps.h stable/10/sys/contrib/dev/acpica/include/acbuffer.h stable/10/sys/contrib/dev/acpica/include/accommon.h stable/10/sys/contrib/dev/acpica/include/acconfig.h stable/10/sys/contrib/dev/acpica/include/acdebug.h stable/10/sys/contrib/dev/acpica/include/acdisasm.h stable/10/sys/contrib/dev/acpica/include/acdispat.h stable/10/sys/contrib/dev/acpica/include/acevents.h stable/10/sys/contrib/dev/acpica/include/acexcep.h stable/10/sys/contrib/dev/acpica/include/acglobal.h stable/10/sys/contrib/dev/acpica/include/achware.h stable/10/sys/contrib/dev/acpica/include/acinterp.h stable/10/sys/contrib/dev/acpica/include/aclocal.h stable/10/sys/contrib/dev/acpica/include/acmacros.h stable/10/sys/contrib/dev/acpica/include/acnames.h stable/10/sys/contrib/dev/acpica/include/acnamesp.h stable/10/sys/contrib/dev/acpica/include/acobject.h stable/10/sys/contrib/dev/acpica/include/acopcode.h stable/10/sys/contrib/dev/acpica/include/acoutput.h stable/10/sys/contrib/dev/acpica/include/acparser.h stable/10/sys/contrib/dev/acpica/include/acpi.h stable/10/sys/contrib/dev/acpica/include/acpiosxf.h stable/10/sys/contrib/dev/acpica/include/acpixf.h stable/10/sys/contrib/dev/acpica/include/acpredef.h stable/10/sys/contrib/dev/acpica/include/acresrc.h stable/10/sys/contrib/dev/acpica/include/acrestyp.h stable/10/sys/contrib/dev/acpica/include/acstruct.h stable/10/sys/contrib/dev/acpica/include/actables.h stable/10/sys/contrib/dev/acpica/include/actbl.h stable/10/sys/contrib/dev/acpica/include/actbl1.h stable/10/sys/contrib/dev/acpica/include/actbl2.h stable/10/sys/contrib/dev/acpica/include/actbl3.h stable/10/sys/contrib/dev/acpica/include/actypes.h stable/10/sys/contrib/dev/acpica/include/acutils.h stable/10/sys/contrib/dev/acpica/include/acuuid.h stable/10/sys/contrib/dev/acpica/include/amlcode.h stable/10/sys/contrib/dev/acpica/include/amlresrc.h stable/10/sys/contrib/dev/acpica/include/platform/acenv.h stable/10/sys/contrib/dev/acpica/include/platform/acenvex.h stable/10/sys/contrib/dev/acpica/include/platform/acfreebsd.h stable/10/sys/contrib/dev/acpica/include/platform/acgcc.h stable/10/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c stable/10/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c stable/10/sys/dev/acpica/Osd/OsdDebug.c stable/10/sys/dev/acpica/Osd/OsdSchedule.c stable/10/sys/dev/acpica/acpi.c stable/10/sys/sys/libkern.h stable/10/sys/x86/acpica/acpi_wakeup.c stable/10/usr.sbin/acpi/acpidb/Makefile stable/10/usr.sbin/acpi/acpidb/acpidb.c stable/10/usr.sbin/acpi/iasl/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri Sep 30 22:29:19 2016 (r306535) +++ stable/10/sys/conf/files Fri Sep 30 22:40:58 2016 (r306536) @@ -270,11 +270,11 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbexec.c optional acpi acpi_debug -contrib/dev/acpica/components/debugger/dbfileio.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbhistry.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbobject.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug @@ -284,7 +284,6 @@ contrib/dev/acpica/components/disassembl contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug -contrib/dev/acpica/components/disassembler/dmobject.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrc.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrcl.c optional acpi acpi_debug contrib/dev/acpica/components/disassembler/dmresrcl2.c optional acpi acpi_debug @@ -293,6 +292,7 @@ contrib/dev/acpica/components/disassembl contrib/dev/acpica/components/disassembler/dmwalk.c optional acpi acpi_debug contrib/dev/acpica/components/dispatcher/dsargs.c optional acpi contrib/dev/acpica/components/dispatcher/dscontrol.c optional acpi +contrib/dev/acpica/components/dispatcher/dsdebug.c optional acpi contrib/dev/acpica/components/dispatcher/dsfield.c optional acpi contrib/dev/acpica/components/dispatcher/dsinit.c optional acpi contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi @@ -320,6 +320,7 @@ contrib/dev/acpica/components/events/evx contrib/dev/acpica/components/events/evxfevnt.c optional acpi contrib/dev/acpica/components/events/evxfgpe.c optional acpi contrib/dev/acpica/components/events/evxfregn.c optional acpi +contrib/dev/acpica/components/executer/exconcat.c optional acpi contrib/dev/acpica/components/executer/exconfig.c optional acpi contrib/dev/acpica/components/executer/exconvrt.c optional acpi contrib/dev/acpica/components/executer/excreate.c optional acpi @@ -343,6 +344,7 @@ contrib/dev/acpica/components/executer/e contrib/dev/acpica/components/executer/exstoren.c optional acpi contrib/dev/acpica/components/executer/exstorob.c optional acpi contrib/dev/acpica/components/executer/exsystem.c optional acpi +contrib/dev/acpica/components/executer/extrace.c optional acpi contrib/dev/acpica/components/executer/exutils.c optional acpi contrib/dev/acpica/components/hardware/hwacpi.c optional acpi contrib/dev/acpica/components/hardware/hwesleep.c optional acpi @@ -389,7 +391,7 @@ contrib/dev/acpica/components/parser/psx contrib/dev/acpica/components/resources/rsaddr.c optional acpi contrib/dev/acpica/components/resources/rscalc.c optional acpi contrib/dev/acpica/components/resources/rscreate.c optional acpi -contrib/dev/acpica/components/resources/rsdump.c optional acpi +contrib/dev/acpica/components/resources/rsdump.c optional acpi acpi_debug contrib/dev/acpica/components/resources/rsdumpinfo.c optional acpi contrib/dev/acpica/components/resources/rsinfo.c optional acpi contrib/dev/acpica/components/resources/rsio.c optional acpi @@ -411,6 +413,7 @@ contrib/dev/acpica/components/tables/tbx contrib/dev/acpica/components/tables/tbxfroot.c optional acpi contrib/dev/acpica/components/utilities/utaddress.c optional acpi contrib/dev/acpica/components/utilities/utalloc.c optional acpi +contrib/dev/acpica/components/utilities/utascii.c optional acpi contrib/dev/acpica/components/utilities/utbuffer.c optional acpi contrib/dev/acpica/components/utilities/utcache.c optional acpi contrib/dev/acpica/components/utilities/utcopy.c optional acpi @@ -428,6 +431,7 @@ contrib/dev/acpica/components/utilities/ contrib/dev/acpica/components/utilities/utmath.c optional acpi contrib/dev/acpica/components/utilities/utmisc.c optional acpi contrib/dev/acpica/components/utilities/utmutex.c optional acpi +contrib/dev/acpica/components/utilities/utnonansi.c optional acpi contrib/dev/acpica/components/utilities/utobject.c optional acpi contrib/dev/acpica/components/utilities/utosi.c optional acpi contrib/dev/acpica/components/utilities/utownerid.c optional acpi @@ -3269,6 +3273,7 @@ libkern/strndup.c standard libkern/strlcat.c standard libkern/strlcpy.c standard libkern/strlen.c standard +libkern/strncat.c standard libkern/strncmp.c standard libkern/strncpy.c standard libkern/strnlen.c standard Modified: stable/10/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- stable/10/sys/contrib/dev/acpica/acpica_prep.sh Fri Sep 30 22:29:19 2016 (r306535) +++ stable/10/sys/contrib/dev/acpica/acpica_prep.sh Fri Sep 30 22:40:58 2016 (r306536) @@ -19,20 +19,20 @@ fulldirs="common compiler components inc # files to remove stripdirs="generate libraries tests tools" stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ - acefi.h achaiku.h acintel.h aclinux.h aclinuxex.h acmacosx.h \ - acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h new_table.txt \ - osbsdtbl.c osefitbl.c osefixf.c osfreebsdtbl.c oslinuxtbl.c \ - osunixdir.c osunixmap.c oswindir.c oswintbl.c oswinxf.c \ - readme.txt utclib.c" + acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ + acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ + acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ + osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ + oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" # include files to canonify -src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \ - acdisasm.h acdispat.h acevents.h acexcep.h acglobal.h achware.h \ - acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h acobject.h \ - acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h \ - acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h \ - actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h \ - amlresrc.h platform/acenv.h platform/acenvex.h \ +src_headers="acapps.h acbuffer.h acclib.h accommon.h acconfig.h \ + acdebug.h acdisasm.h acdispat.h acevents.h acexcep.h acglobal.h \ + achware.h acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h \ + acobject.h acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h \ + acpixf.h acpredef.h acresrc.h acrestyp.h acstruct.h actables.h \ + actbl.h actbl1.h actbl2.h actbl3.h actypes.h acutils.h acuuid.h \ + amlcode.h amlresrc.h platform/acenv.h platform/acenvex.h \ platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h" Modified: stable/10/sys/contrib/dev/acpica/changes.txt ============================================================================== --- stable/10/sys/contrib/dev/acpica/changes.txt Fri Sep 30 22:29:19 2016 (r306535) +++ stable/10/sys/contrib/dev/acpica/changes.txt Fri Sep 30 22:40:58 2016 (r306536) @@ -1,5 +1,930 @@ ---------------------------------------- -08 April 2015. Summary of changes for version 20150515: +27 May 2016. Summary of changes for version 20160527: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Temporarily reverted the new arbitrary bit length/alignment support in +AcpiHwRead/AcpiHwWrite for the Generic Address Structure. There have been +a number of regressions with the new code that need to be fully resolved +and tested before this support can be finally integrated into ACPICA. +Apologies for any inconveniences these issues may have caused. + +The ACPI message macros are not configurable (ACPI_MSG_ERROR, +ACPI_MSG_EXCEPTION, ACPI_MSG_WARNING, ACPI_MSG_INFO, ACPI_MSG_BIOS_ERROR, +and ACPI_MSG_BIOS_WARNING). Lv Zheng. + +Fixed a couple of GCC warnings associated with the use of the -Wcast-qual +option. Adds a new return macro, return_STR. Junk-uk Kim. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 136.8K Code, 51.6K Data, 188.4K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + Previous Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 200.9K Code, 82.2K Data, 283.1K Total + +---------------------------------------- +22 April 2016. Summary of changes for version 20160422: + +1) ACPICA kernel-resident subsystem: + +Fixed a regression in the GAS (generic address structure) arbitrary bit +support in AcpiHwRead/AcpiHwWrite. Problem could cause incorrect behavior +and incorrect return values. Lv Zheng. ACPICA BZ 1270. + +ACPI 6.0: Added support for new/renamed resource macros. One new argument +was added to each of these macros, and the original name has been +deprecated. The AML disassembler will always disassemble to the new +names. Support for the new macros was added to iASL, disassembler, +resource manager, and the acpihelp utility. ACPICA BZ 1274. + + I2cSerialBus -> I2cSerialBusV2 + SpiSerialBus -> SpiSerialBusV2 + UartSerialBus -> UartSerialBusV2 + +ACPI 6.0: Added support for a new integer field that was appended to the +package object returned by the _BIX method. This adds iASL compile-time +and AML runtime error checking. ACPICA BZ 1273. + +ACPI 6.1: Added support for a new PCCT subtable, "HW-Reduced Comm +Subspace Type2" (Headers, Disassembler, and data table compiler). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + Previous Release: + Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total + Debug Version: 201.0K Code, 82.0K Data, 283.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented an ASL grammar extension to allow/enable executable +"module-level code" to be created and executed under the various +operators that create new scopes. This type of AML code is already +supported in all known AML interpreters, and the grammar change will +appear in the next version of the ACPI specification. Simplifies the +conditional runtime creation of named objects under these object types: + + Device + PowerResource + Processor + Scope + ThermalZone + +iASL: Implemented a new ASL extension, a "For" loop macro to add greater +ease-of-use to the ASL language. The syntax is similar to the +corresponding C operator, and is implemented with the existing AML While +opcode -- thus requiring no changes to existing AML interpreters. + + For (Initialize, Predicate, Update) {TermList} + +Grammar: + ForTerm := + For ( + Initializer // Nothing | TermArg => ComputationalData + Predicate // Nothing | TermArg => ComputationalData + Update // Nothing | TermArg => ComputationalData + ) {TermList} + + +iASL: The _HID/_ADR detection and validation has been enhanced to search +under conditionals in order to allow these objects to be conditionally +created at runtime. + +iASL: Fixed several issues with the constant folding feature. The +improvement allows better detection and resolution of statements that can +be folded at compile time. ACPICA BZ 1266. + +iASL/Disassembler: Fixed a couple issues with the Else{If{}...} +conversion to the ASL ElseIf operator where incorrect ASL code could be +generated. + +iASL/Disassembler: Fixed a problem with the ASL+ code disassembly where +sometimes an extra (and extraneous) set of parentheses were emitted for +some combinations of operators. Although this did not cause any problems +with recompilation of the disassembled code, it made the code more +difficult to read. David Box. ACPICA BZ 1231. + +iASL: Changed to ignore the unreferenced detection for predefined names +of resource descriptor elements, when the resource descriptor is +created/defined within a control method. + +iASL: Disassembler: Fix a possible fault with externally declared Buffer +objects. + +---------------------------------------- +18 March 2016. Summary of changes for version 20160318: + +1) ACPICA kernel-resident subsystem: + +Added support for arbitrary bit lengths and bit offsets for registers +defined by the Generic Address Structure. Previously, only aligned bit +lengths of 8/16/32/64 were supported. This was sufficient for many years, +but recently some machines have been seen that require arbitrary bit- +level support. ACPICA BZ 1240. Lv Zheng. + +Fixed an issue where the \_SB._INI method sometimes must be evaluated +before any _REG methods are evaluated. Lv Zheng. + +Implemented several changes related to ACPI table support +(Headers/Disassembler/TableCompiler): +NFIT: For ACPI 6.1, updated to add some additional new fields and +constants. +FADT: Updated a warning message and set compliance to ACPI 6.1 (Version +6). +DMAR: Added new constants per the 10/2014 DMAR spec. +IORT: Added new subtable per the 10/2015 IORT spec. +HEST: For ACPI 6.1, added new constants and new subtable. +DBG2: Added new constants per the 12/2015 DBG2 spec. +FPDT: Fixed several incorrect fields, add the FPDT boot record structure. +ACPICA BZ 1249. +ERST/EINJ: Updated disassembler with new "Execute Timings" actions. + +Updated header support for the DMAR table to match the current version of +the related spec. + +Added extensions to the ASL Concatenate operator to allow any ACPI object +to be passed as an operand. Any object other than Integer/String/Buffer +simply returns a string containing the object type. This extends the +usefulness of the Printf macros. Previously, Concatenate would abort the +control method if a non-data object was encountered. + +ACPICA source code: Deployed the C "const" keyword across the source code +where appropriate. ACPICA BZ 732. Joerg Sonnenberger (NetBSD). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total + Debug Version: 201.0K Code, 82.0K Data, 283.0K Total + Previous Release: + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: Improved the heuristic used to determine the number of +arguments for an externally defined control method (a method in another +table). Although this is an improvement, there is no deterministic way to +"guess" the number of method arguments. Only the ACPI 6.0 External opcode +will completely solve this problem as it is deployed (automatically) in +newer BIOS code. + +iASL/Disassembler: Fixed an ordering issue for emitted External() ASL +statements that could cause errors when the disassembled file is +compiled. ACPICA BZ 1243. David Box. + +iASL: Fixed a regression caused by the merger of the two versions of the +local strtoul64. Because of a dependency on a global variable, strtoul64 +could return an error for integers greater than a 32-bit value. ACPICA BZ +1260. + +iASL: Fixed a regression where a fault could occur for an ASL Return +statement if it invokes a control method that is not resolved. ACPICA BZ +1264. + +AcpiXtract: Improved input file validation: detection of binary files and +non-acpidump text files. + +---------------------------------------- +12 February 2016. Summary of changes for version 20160212: + +1) ACPICA kernel-resident subsystem: + +Implemented full support for the ACPI 6.1 specification (released in +January). This version of the specification is available at: +http://www.uefi.org/specifications + +Only a relatively small number of changes were required in ACPICA to +support ACPI 6.1, in these areas: +- New predefined names +- New _HID values +- A new subtable for HEST +- A few other header changes for new values + +Ensure \_SB_._INI is executed before any _REG methods are executed. There +appears to be existing BIOS code that relies on this behavior. Lv Zheng. + +Reverted a change made in version 20151218 which enabled method +invocations to be targets of various ASL operators (SuperName and Target +grammar elements). While the new behavior is supported by the ACPI +specification, other AML interpreters do not support this behavior and +never will. The ACPI specification will be updated for ACPI 6.2 to remove +this support. Therefore, the change was reverted to the original ACPICA +behavior. + +ACPICA now supports the GCC 6 compiler. + +Current Release: (Note: build changes increased sizes) + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total +Previous Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Completed full support for the ACPI 6.0 External() AML opcode. The +compiler emits an external AML opcode for each ASL External statement. +This opcode is used by the disassembler to assist with the disassembly of +external control methods by specifying the required number of arguments +for the method. AML interpreters do not use this opcode. To ensure that +interpreters do not even see the opcode, a block of one or more external +opcodes is surrounded by an "If(0)" construct. As this feature becomes +commonly deployed in BIOS code, the ability of disassemblers to correctly +disassemble AML code will be greatly improved. David Box. + +iASL: Implemented support for an optional cross-reference output file. +The -lx option will create a the cross-reference file with the suffix +"xrf". Three different types of cross-reference are created in this file: +- List of object references made from within each control method +- Invocation (caller) list for each user-defined control method +- List of references to each non-method object in the namespace + +iASL: Method invocations as ASL Target operands are now disallowed and +flagged as errors in preparation for ACPI 6.2 (see the description of the +problem above). + +---------------------------------------- +8 January 2016. Summary of changes for version 20160108: + +1) ACPICA kernel-resident subsystem: + +Updated all ACPICA copyrights and signons to 2016: Added the 2016 +copyright to all source code module headers and utility/tool signons. +This includes the standard Linux dual-license header. This affects +virtually every file in the ACPICA core subsystem, iASL compiler, all +ACPICA utilities, and the ACPICA test suite. + +Fixed a regression introduced in version 20151218 concerning the +execution of so-called module-level ASL/AML code. Namespace objects +created under a module-level If() construct were not properly/fully +entered into the namespace and could cause an interpreter fault when +accessed. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + +Current Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.4K Total + Previous Release: + Non-Debug Version: 102.6K Code, 28.4K Data, 131.0K Total + Debug Version: 200.3K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Fixed a problem with the compilation of the GpioIo and GpioInt resource +descriptors. The _PIN field name was incorrectly defined to be an array +of 32-bit values, but the _PIN values are in fact 16 bits each. This +would cause incorrect bit width warnings when using Word (16-bit) fields +to access the descriptors. + + +---------------------------------------- +18 December 2015. Summary of changes for version 20151218: + +1) ACPICA kernel-resident subsystem: + +Implemented per-AML-table execution of "module-level code" as individual +ACPI tables are loaded into the namespace during ACPICA initialization. +In other words, any module-level code within an AML table is executed +immediately after the table is loaded, instead of batched and executed +after all of the tables have been loaded. This provides compatibility +with other ACPI implementations. ACPICA BZ 1219. Bob Moore, Lv Zheng, +David Box. + +To fully support the feature above, the default operation region handlers +for the SystemMemory, SystemIO, and PCI_Config address spaces are now +installed before any ACPI tables are loaded. This enables module-level +code to access these address spaces during the table load and module- +level code execution phase. ACPICA BZ 1220. Bob Moore, Lv Zheng, David +Box. + +Implemented several changes to the internal _REG support in conjunction +with the changes above. Also, changes to the AcpiExec/AcpiNames/Examples +utilities for the changes above. Although these tools were changed, host +operating systems that simply use the default handlers for SystemMemory, +SystemIO, and PCI_Config spaces should not require any update. Lv Zheng. + +For example, in the code below, DEV1 is conditionally added to the +namespace by the DSDT via module-level code that accesses an operation +region. The SSDT references DEV1 via the Scope operator. DEV1 must be +created immediately after the DSDT is loaded in order for the SSDT to +successfully reference DEV1. Previously, this code would cause an +AE_NOT_EXIST exception during the load of the SSDT. Now, this code is +fully supported by ACPICA. + + DefinitionBlock ("", "DSDT", 2, "Intel", "DSDT1", 1) + { + OperationRegion (OPR1, SystemMemory, 0x400, 32) + Field (OPR1, AnyAcc, NoLock, Preserve) + { + FLD1, 1 + } + If (FLD1) + { + Device (\DEV1) + { + } + } + } + DefinitionBlock ("", "SSDT", 2, "Intel", "SSDT1", 1) + { + External (\DEV1, DeviceObj) + Scope (\DEV1) + { + } + } + +Fixed an AML interpreter problem where control method invocations were +not handled correctly when the invocation was itself a SuperName argument +to another ASL operator. In these cases, the method was not invoked. +ACPICA BZ 1002. Affects the following ASL operators that have a SuperName +argument: + Store + Acquire, Wait + CondRefOf, RefOf + Decrement, Increment + Load, Unload + Notify + Signal, Release, Reset + SizeOf + +Implemented automatic String-to-ObjectReference conversion support for +packages returned by predefined names (such as _DEP). A common BIOS error +is to add double quotes around an ObjectReference namepath, which turns +the reference into an unexpected string object. This support detects the +problem and corrects it before the package is returned to the caller that +invoked the method. Lv Zheng. + +Implemented extensions to the Concatenate operator. Concatenate now +accepts any type of object, it is not restricted to simply +Integer/String/Buffer. For objects other than these 3 basic data types, +the argument is treated as a string containing the name of the object +type. This expands the utility of Concatenate and the Printf/Fprintf +macros. ACPICA BZ 1222. + +Cleaned up the output of the ASL Debug object. The timer() value is now +optional and no longer emitted by default. Also, the basic data types of +Integer/String/Buffer are simply emitted as their values, without a data +type string -- since the data type is obvious from the output. ACPICA BZ +1221. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 102.6K Code, 28.4K Data, 131.0K Total + Debug Version: 200.3K Code, 81.9K Data, 282.3K Total + Previous Release: + Non-Debug Version: 102.0K Code, 28.3K Data, 130.3K Total + Debug Version: 199.6K Code, 81.8K Data, 281.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed some issues with the ASL Include() operator. This operator +was incorrectly defined in the iASL parser rules, causing a new scope to +be opened for the code within the include file. This could lead to +several issues, including allowing ASL code that is technically illegal +and not supported by AML interpreters. Note, this does not affect the +related #include preprocessor operator. ACPICA BZ 1212. + +iASL/Disassembler: Implemented support for the ASL ElseIf operator. This +operator is essentially an ASL macro since there is no AML opcode +associated with it. The code emitted by the iASL compiler for ElseIf is +an Else opcode followed immediately by an If opcode. The disassembler +will now emit an ElseIf if it finds an Else immediately followed by an +If. This simplifies the decoded ASL, especially for deeply nested +If..Else and large Switch constructs. Thus, the disassembled code more +closely follows the original source ASL. ACPICA BZ 1211. Example: + + Old disassembly: + Else + { + If (Arg0 == 0x02) + { + Local0 = 0x05 + } + } + + New disassembly: + ElseIf (Arg0 == 0x02) + { + Local0 = 0x05 + } + +AcpiExec: Added support for the new module level code behavior and the +early region installation. This required a small change to the +initialization, since AcpiExec must install its own operation region +handlers. + +AcpiExec: Added support to make the debug object timer optional. Default +is timer disabled. This cleans up the debug object output -- the timer +data is rarely used. + +AcpiExec: Multiple ACPI tables are now loaded in the order that they +appear on the command line. This can be important when there are +interdependencies/references between the tables. + +iASL/Templates. Add support to generate template files with multiple +SSDTs within a single output file. Also added ommand line support to +specify the number of SSDTs (in addition to a single DSDT). ACPICA BZ +1223, 1225. + + +---------------------------------------- +24 November 2015. Summary of changes for version 20151124: + +1) ACPICA kernel-resident subsystem: + +Fixed a possible regression for a previous update to FADT handling. The +FADT no longer has a fixed table ID, causing some issues with code that +was hardwired to a specific ID. Lv Zheng. + +Fixed a problem where the method auto-serialization could interfere with +the current SyncLevel. This change makes the auto-serialization support +transparent to the SyncLevel support and management. + +Removed support for the _SUB predefined name in AcpiGetObjectInfo. This +interface is intended for early access to the namespace during the +initial namespace device discovery walk. The _SUB method has been seen to +access operation regions in some cases, causing errors because the +operation regions are not fully initialized. + +AML Debugger: Fixed some issues with the terminate/quit/exit commands +that can cause faults. Lv Zheng. + +AML Debugger: Add thread ID support so that single-step mode only applies +to the AML Debugger thread. This prevents runtime errors within some +kernels. Lv Zheng. + +Eliminated extraneous warnings from AcpiGetSleepTypeData. Since the _Sx +methods that are invoked by this interface are optional, removed warnings +emitted for the case where one or more of these methods do not exist. +ACPICA BZ 1208, original change by Prarit Bhargava. + +Made a major pass through the entire ACPICA source code base to +standardize formatting that has diverged a bit over time. There are no +functional changes, but this will of course cause quite a few code +differences from the previous ACPICA release. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 102.0K Code, 28.3K Data, 130.3K Total + Debug Version: 199.6K Code, 81.8K Data, 281.4K Total + Previous Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.3K Code, 81.4K Data, 280.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/acpiexec/acpixtract/disassembler: Added support to allow multiple +definition blocks within a single ASL file and the resulting AML file. +Support for this type of file was also added to the various tools that +use binary AML files: acpiexec, acpixtract, and the AML disassembler. The +example code below shows two definition blocks within the same file: + + DefinitionBlock ("dsdt.aml", "DSDT", 2, "Intel", "Template", +0x12345678) + { + } + DefinitionBlock ("", "SSDT", 2, "Intel", "Template", 0xABCDEF01) + { + } + +iASL: Enhanced typechecking for the Name() operator. All expressions for +the value of the named object must be reduced/folded to a single constant +at compile time, as per the ACPI specification (the AML definition of +Name()). + +iASL: Fixed some code indentation issues for the -ic and -ia options (C +and assembly headers). Now all emitted code correctly begins in column 1. + +iASL: Added an error message for an attempt to open a Scope() on an +object defined in an SSDT. The DSDT is always loaded into the namespace +first, so any attempt to open a Scope on an SSDT object will fail at +runtime. + + +---------------------------------------- +30 September 2015. Summary of changes for version 20150930: + +1) ACPICA kernel-resident subsystem: + +Debugger: Implemented several changes and bug fixes to assist support for +the in-kernel version of the AML debugger. Lv Zheng. +- Fix the "predefined" command for in-kernel debugger. +- Do not enter debug command loop for the help and version commands. +- Disallow "execute" command during execution/single-step of a method. + +Interpreter: Updated runtime typechecking for all operators that have +target operands. The operand is resolved and validated that it is legal. +For example, the target cannot be a non-data object such as a Device, +Mutex, ThermalZone, etc., as per the ACPI specification. + +Debugger: Fixed the double-mutex user I/O handshake to work when local +deadlock detection is enabled. + +Debugger: limited display of method locals and arguments (LocalX and +ArgX) to only those that have actually been initialized. This prevents +lines of extraneous output. + +Updated the definition of the NFIT table to correct the bit polarity of +one flag: ACPI_NFIT_MEM_ARMED --> ACPI_NFIT_MEM_NOT_ARMED + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.3K Code, 81.4K Data, 280.7K Total + Previous Release: + Non-Debug Version: 101.3K Code, 27.7K Data, 129.0K Total + Debug Version: 198.6K Code, 80.9K Data, 279.5K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Improved the compile-time typechecking for operands of many of the +ASL operators: + +-- Added an option to disable compiler operand/operator typechecking (- +ot). + +-- For the following operators, the TermArg operands are now validated +when possible to be Integer data objects: BankField, OperationRegion, +DataTableRegion, Buffer, and Package. + +-- Store (Source, Target): Both the source and target operands are +resolved and checked that the operands are both legal. For example, +neither operand can be a non-data object such as a Device, Mutex, +ThermalZone, etc. Note, as per the ACPI specification, the CopyObject +operator can be used to store an object to any type of target object. + +-- Store (Source, Target): If the source is a Package object, the target +must be a Package object, LocalX, ArgX, or Debug. Likewise, if the target +is a Package, the source must also be a Package. + +-- Store (Source, Target): A warning is issued if the source and target +resolve to the identical named object. + +-- Store (Source, ): An error is generated for the +target method invocation, as this construct is not supported by the AML +interpreter. + +-- For all ASL math and logic operators, the target operand must be a +data object (Integer, String, Buffer, LocalX, ArgX, or Debug). This +includes the function return value also. + +-- External declarations are also included in the typechecking where +possible. External objects defined using the UnknownObj keyword cannot be +typechecked, however. + +iASL and Disassembler: Added symbolic (ASL+) support for the ASL Index +operator: +- Legacy code: Index(PKG1, 3) +- New ASL+ code: PKG1[3] +This completes the ACPI 6.0 ASL+ support as it was the only operator not +supported. + +iASL: Fixed the file suffix for the preprocessor output file (.i). Two +spaces were inadvertently appended to the filename, causing file access +and deletion problems on some systems. + +ASL Test Suite (ASLTS): Updated the master makefile to generate all +possible compiler output files when building the test suite -- thus +exercising these features of the compiler. These files are automatically +deleted when the test suite exits. + + +---------------------------------------- +18 August 2015. Summary of changes for version 20150818: + +1) ACPICA kernel-resident subsystem: + +Fix a regression for AcpiGetTableByIndex interface causing it to fail. Lv +Zheng. ACPICA BZ 1186. + +Completed development to ensure that the ACPICA Disassembler and Debugger +are fully standalone components of ACPICA. Removed cross-component +dependences. Lv Zheng. + +The max-number-of-AML-loops is now runtime configurable (previously was +compile-time only). This is essentially a loop timeout to force-abort +infinite AML loops. ACPCIA BZ 1192. + +Debugger: Cleanup output to dump ACPI names and namepaths without any +trailing underscores. Lv Zheng. ACPICA BZ 1135. + +Removed unnecessary conditional compilations across the Debugger and +Disassembler components where entire modules could be left uncompiled. + +The aapits test is deprecated and has been removed from the ACPICA git +tree. The test has never been completed and has not been maintained, thus +becoming rather useless. ACPICA BZ 1015, 794. + +A batch of small changes to close bugzilla and other reports: +- Remove duplicate code for _PLD processing. ACPICA BZ 1176. +- Correctly cleanup after a ACPI table load failure. ACPICA BZ 1185. +- iASL: Support POSIX yacc again in makefile. Jung-uk Kim. +- ACPI table support: general cleanup and simplification. Lv Zheng, Bob +Moore. +- ACPI table support: fix for a buffer read overrun in AcpiTbFindTable. +ACPICA BZ 1184. +- Enhance parameter validation for DataTableRegion and LoadTable ASL/AML +operators. +- Debugger: Split debugger initialization/termination interfaces. Lv +Zheng. +- AcpiExec: Emit OemTableId for SSDTs during the load phase for table +identification. +- AcpiExec: Add debug message during _REG method phase during table +load/init. +- AcpiNames: Fix a regression where some output was missing and no longer +emitted. +- Debugger: General cleanup and simplification. Lv Zheng. +- Disassembler: Cleanup use of several global option variables. Lv Zheng. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 101.3K Code, 27.7K Data, 129.0K Total + Debug Version: 198.6K Code, 80.9K Data, 279.5K Total + Previous Release: + Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total + Debug Version: 197.8K Code, 81.5K Data, 279.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Fixed a problem where any more than 32 ACPI tables in the XSDT +were not handled properly and caused load errors. Now, properly invoke +and use the ACPICA auto-reallocate mechanism for ACPI table data +structures. ACPICA BZ 1188 + +AcpiNames: Add command-line wildcard support for ACPI table files. ACPICA +BZ 1190. + +AcpiExec and AcpiNames: Add -l option to load ACPI tables only. For +AcpiExec, this means that no control methods (like _REG/_INI/_STA) are +executed during initialization. ACPICA BZ 1187, 1189. + +iASL/Disassembler: Implemented a prototype "listing" mode that emits AML +that corresponds to each disassembled ASL statement, to simplify +debugging. ACPICA BZ 1191. + +Debugger: Add option to the "objects" command to display a summary of the +current namespace objects (Object type and count). This is displayed if +the command is entered with no arguments. + +AcpiNames: Add -x option to specify debug level, similar to AcpiExec. + + +---------------------------------------- +17 July 2015. Summary of changes for version 20150717: + +1) ACPICA kernel-resident subsystem: + +Improved the partitioning between the Debugger and Disassembler +components. This allows the Debugger to be used standalone within kernel +code without the Disassembler (which is used for single stepping also). +This renames and moves one file, dmobject.c to dbobject.c. Lv Zheng. + +Debugger: Implemented a new command to trace the execution of control +methods (Trace). This is especially useful for the in-kernel version of +the debugger when file I/O may not be available for method trace output. +See the ACPICA reference for more information. Lv Zheng. + +Moved all C library prototypes (used for the local versions of these +functions when requested) to a new header, acclib.h +Cleaned up the use of non-ANSI C library functions. These functions are +implemented locally in ACPICA. Moved all such functions to a common +source file, utnonansi.c + +Debugger: Fixed a problem with the "!!" command (get last command +executed) where the debugger could enter an infinite loop and eventually +crash. + +Removed the use of local macros that were used for some of the standard C +library functions to automatically cast input parameters. This mostly +affected the is* functions where the input parameter is defined to be an +int. This required a few modifications to the main ACPICA source code to +provide casting for these functions and eliminate possible compiler +warnings for these parameters. + +Across the source code, added additional status/error checking to resolve +issues discovered by static source code analysis tools such as Coverity. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 100.9K Code, 24.5K Data, 125.4K Total + Debug Version: 197.8K Code, 81.5K Data, 279.3K Total + Previous Release: + Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total + Debug Version: 196.2K Code, 81.0K Data, 277.2K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression where the device map file feature no longer +worked properly when used in conjunction with the disassembler. It only +worked properly with the compiler itself. + +iASL: Implemented a new warning for method LocalX variables that are set +but never used (similar to a C compiler such as gcc). This also applies +to ArgX variables that are not defined by the parent method, and are +instead (legally) used as local variables. + +iASL/Preprocessor: Finished the pass-through of line numbers from the +preprocessor to the compiler. This ensures that compiler errors/warnings +have the correct original line numbers and filenames, regardless of any +#include files. + +iASL/Preprocessor: Fixed a couple of issues with comment handling and the +pass-through of comments to the preprocessor output file (which becomes +the compiler input file). Also fixed a problem with // comments that +appear after a math expression. + +iASL: Added support for the TCPA server table to the table compiler and +template generator. (The client table was already previously supported) + +iASL/Preprocessor: Added a permanent #define of the symbol "__IASL__" to +identify the iASL compiler. + +Cleaned up the use of the macros NEGATIVE and POSITIVE which were defined +multiple times. The new names are ACPI_SIGN_NEGATIVE and +ACPI_SIGN_POSITIVE. + +AcpiHelp: Update to expand help messages for the iASL preprocessor +directives. + + +---------------------------------------- +19 June 2015. Summary of changes for version 20150619: + +Two regressions in version 20150616 have been addressed: + +Fixes some problems/issues with the C library macro removal (ACPI_STRLEN, +etc.) This update changes ACPICA to only use the standard headers for +functions, or the prototypes for the local versions of the C library +functions. Across the source code, this required some additional casts +for some Clib invocations for portability. Moved all local prototypes to +a new file, acclib.h + +Fixes several problems with recent changes to the handling of the FACS +table that could cause some systems not to boot. + + +---------------------------------------- +16 June 2015. Summary of changes for version 20150616: + + +1) ACPICA kernel-resident subsystem: + +Across the entire ACPICA source code base, the various macros for the C +library functions (such as ACPI_STRLEN, etc.) have been removed and +replaced by the standard C library names (strlen, etc.) The original +purpose for these macros is no longer applicable. This simplification +reduces the number of macros used in the ACPICA source code +significantly, improving readability and maintainability. + +Implemented support for a new ACPI table, the OSDT. This table, the +"override" SDT, can be loaded directly by the host OS at boot time. It +enables the replacement of existing namespace objects that were installed +via the DSDT and/or SSDTs. The primary purpose for this is to replace +buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated +for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob +Moore. + +Added support for systems with (improperly) two FACS tables -- a "32-bit" +table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit +X field). This change will support both automatically. There continues to +be systems found with this issue. This support requires a change to the +AcpiSetFirmwareWakingVector interface. Also, a public global variable has +been added to allow the host to select which FACS is desired +(AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more +details Lv Zheng. + +Added a new feature to allow for systems that do not contain an FACS. +Although this is already supported on hardware-reduced platforms, the +feature has been extended for all platforms. The reasoning is that we do +not want to abort the entire ACPICA initialization just because the +system is seriously buggy and has no FACS. + +Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were +not correctly transcribed from the ACPI specification in ACPICA version +20150515. + +Implemented support for the _CLS object in the AcpiGetObjectInfo external +interface. + +Updated the definitions of the TCPA and TPM2 ACPI tables to the more +recent TCG ACPI Specification, December 14, 2014. Table disassembler and +compiler also updated. Note: The TCPA "server" table is not supported by +the disassembler/table-compiler at this time. + +ACPI 6.0: Added definitions for the new GIC version field in the MADT. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total + Debug Version: 196.2K Code, 81.0K Data, 277.2K Total + Previous Release: + Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total + Debug Version: 195.2K Code, 80.8K Data, 276.0K Total + + +2) iASL Compiler/Disassembler and Tools: + *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***