summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-06 07:51:36 -0300
committerRenato Botelho <renato@netgate.com>2016-10-06 07:51:36 -0300
commit5dd7ab172435dc99e1abc1f7d73fd5e720050bbc (patch)
tree19b1dffa928be3fe0fb3b046f47c39e471c592bc
parent32988844e41ba2dafefd4b0ca819b8c48ecbbb81 (diff)
parent22e3935b200286024203db77aec100fca35e3e95 (diff)
downloadFreeBSD-src-5dd7ab172435dc99e1abc1f7d73fd5e720050bbc.zip
FreeBSD-src-5dd7ab172435dc99e1abc1f7d73fd5e720050bbc.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
-rw-r--r--cddl/contrib/opensolaris/cmd/dtrace/dtrace.c26
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf.h15
-rw-r--r--contrib/elftoolchain/libdwarf/dwarf_dump.c26
-rw-r--r--crypto/openssl/CHANGES12
-rw-r--r--crypto/openssl/Makefile2
-rw-r--r--crypto/openssl/NEWS4
-rw-r--r--crypto/openssl/README2
-rw-r--r--crypto/openssl/crypto/engine/eng_cryptodev.c2
-rw-r--r--crypto/openssl/crypto/opensslv.h6
-rw-r--r--crypto/openssl/crypto/x509/x509_vfy.c4
-rw-r--r--crypto/openssl/ssl/t1_ext.c2
-rwxr-xr-xetc/periodic/security/100.chksetuid2
-rwxr-xr-xetc/periodic/security/110.neggrpperm2
-rw-r--r--lib/libc/stdtime/strptime.c46
-rw-r--r--lib/libc/sys/Makefile.inc2
-rw-r--r--lib/libc/sys/cap_enter.232
-rw-r--r--lib/libc/sys/procctl.269
-rw-r--r--lib/libc/sys/thr_suspend.2130
-rw-r--r--lib/libc/sys/thr_wake.2112
-rw-r--r--lib/libdevctl/devctl.345
-rw-r--r--lib/libdevctl/devctl.c8
-rw-r--r--lib/libdevctl/devctl.h1
-rw-r--r--lib/libprocstat/common_kvm.c9
-rw-r--r--secure/lib/libcrypto/Makefile.inc4
-rw-r--r--secure/lib/libcrypto/man/ASN1_OBJECT_new.32
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_length.32
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_new.32
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_print_ex.32
-rw-r--r--secure/lib/libcrypto/man/ASN1_TIME_set.32
-rw-r--r--secure/lib/libcrypto/man/ASN1_generate_nconf.32
-rw-r--r--secure/lib/libcrypto/man/BIO_ctrl.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_base64.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_buffer.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_cipher.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_md.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_null.32
-rw-r--r--secure/lib/libcrypto/man/BIO_f_ssl.32
-rw-r--r--secure/lib/libcrypto/man/BIO_find_type.32
-rw-r--r--secure/lib/libcrypto/man/BIO_new.32
-rw-r--r--secure/lib/libcrypto/man/BIO_new_CMS.32
-rw-r--r--secure/lib/libcrypto/man/BIO_push.32
-rw-r--r--secure/lib/libcrypto/man/BIO_read.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_accept.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_bio.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_connect.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_fd.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_file.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_mem.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_null.32
-rw-r--r--secure/lib/libcrypto/man/BIO_s_socket.32
-rw-r--r--secure/lib/libcrypto/man/BIO_set_callback.32
-rw-r--r--secure/lib/libcrypto/man/BIO_should_retry.32
-rw-r--r--secure/lib/libcrypto/man/BN_BLINDING_new.32
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_new.32
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_start.32
-rw-r--r--secure/lib/libcrypto/man/BN_add.32
-rw-r--r--secure/lib/libcrypto/man/BN_add_word.32
-rw-r--r--secure/lib/libcrypto/man/BN_bn2bin.32
-rw-r--r--secure/lib/libcrypto/man/BN_cmp.32
-rw-r--r--secure/lib/libcrypto/man/BN_copy.32
-rw-r--r--secure/lib/libcrypto/man/BN_generate_prime.32
-rw-r--r--secure/lib/libcrypto/man/BN_mod_inverse.32
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_montgomery.32
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_reciprocal.32
-rw-r--r--secure/lib/libcrypto/man/BN_new.32
-rw-r--r--secure/lib/libcrypto/man/BN_num_bytes.32
-rw-r--r--secure/lib/libcrypto/man/BN_rand.32
-rw-r--r--secure/lib/libcrypto/man/BN_set_bit.32
-rw-r--r--secure/lib/libcrypto/man/BN_swap.32
-rw-r--r--secure/lib/libcrypto/man/BN_zero.32
-rw-r--r--secure/lib/libcrypto/man/CMS_add0_cert.32
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_recipient_cert.32
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_signer.32
-rw-r--r--secure/lib/libcrypto/man/CMS_compress.32
-rw-r--r--secure/lib/libcrypto/man/CMS_decrypt.32
-rw-r--r--secure/lib/libcrypto/man/CMS_encrypt.32
-rw-r--r--secure/lib/libcrypto/man/CMS_final.32
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_RecipientInfos.32
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_SignerInfos.32
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_type.32
-rw-r--r--secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.32
-rw-r--r--secure/lib/libcrypto/man/CMS_sign.32
-rw-r--r--secure/lib/libcrypto/man/CMS_sign_receipt.32
-rw-r--r--secure/lib/libcrypto/man/CMS_uncompress.32
-rw-r--r--secure/lib/libcrypto/man/CMS_verify.32
-rw-r--r--secure/lib/libcrypto/man/CMS_verify_receipt.32
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_free.32
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_load_file.32
-rw-r--r--secure/lib/libcrypto/man/CRYPTO_set_ex_data.32
-rw-r--r--secure/lib/libcrypto/man/DH_generate_key.32
-rw-r--r--secure/lib/libcrypto/man/DH_generate_parameters.32
-rw-r--r--secure/lib/libcrypto/man/DH_get_ex_new_index.32
-rw-r--r--secure/lib/libcrypto/man/DH_new.32
-rw-r--r--secure/lib/libcrypto/man/DH_set_method.32
-rw-r--r--secure/lib/libcrypto/man/DH_size.32
-rw-r--r--secure/lib/libcrypto/man/DSA_SIG_new.32
-rw-r--r--secure/lib/libcrypto/man/DSA_do_sign.32
-rw-r--r--secure/lib/libcrypto/man/DSA_dup_DH.32
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_key.32
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_parameters.32
-rw-r--r--secure/lib/libcrypto/man/DSA_get_ex_new_index.32
-rw-r--r--secure/lib/libcrypto/man/DSA_new.32
-rw-r--r--secure/lib/libcrypto/man/DSA_set_method.32
-rw-r--r--secure/lib/libcrypto/man/DSA_sign.32
-rw-r--r--secure/lib/libcrypto/man/DSA_size.32
-rw-r--r--secure/lib/libcrypto/man/EC_GFp_simple_method.32
-rw-r--r--secure/lib/libcrypto/man/EC_GROUP_copy.32
-rw-r--r--secure/lib/libcrypto/man/EC_GROUP_new.32
-rw-r--r--secure/lib/libcrypto/man/EC_KEY_new.32
-rw-r--r--secure/lib/libcrypto/man/EC_POINT_add.32
-rw-r--r--secure/lib/libcrypto/man/EC_POINT_new.32
-rw-r--r--secure/lib/libcrypto/man/ERR_GET_LIB.32
-rw-r--r--secure/lib/libcrypto/man/ERR_clear_error.32
-rw-r--r--secure/lib/libcrypto/man/ERR_error_string.32
-rw-r--r--secure/lib/libcrypto/man/ERR_get_error.32
-rw-r--r--secure/lib/libcrypto/man/ERR_load_crypto_strings.32
-rw-r--r--secure/lib/libcrypto/man/ERR_load_strings.32
-rw-r--r--secure/lib/libcrypto/man/ERR_print_errors.32
-rw-r--r--secure/lib/libcrypto/man/ERR_put_error.32
-rw-r--r--secure/lib/libcrypto/man/ERR_remove_state.32
-rw-r--r--secure/lib/libcrypto/man/ERR_set_mark.32
-rw-r--r--secure/lib/libcrypto/man/EVP_BytesToKey.32
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestSignInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestVerifyInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_EncodeInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_EncryptInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_OpenInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_new.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_cmp.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_decrypt.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_derive.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_encrypt.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_keygen.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_new.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_print_private.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_sign.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify.32
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify_recover.32
-rw-r--r--secure/lib/libcrypto/man/EVP_SealInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_SignInit.32
-rw-r--r--secure/lib/libcrypto/man/EVP_VerifyInit.32
-rw-r--r--secure/lib/libcrypto/man/OBJ_nid2obj.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_Applink.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_config.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_ia32cap.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_instrument_bus.32
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.32
-rw-r--r--secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.32
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.32
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.32
-rw-r--r--secure/lib/libcrypto/man/PKCS12_create.32
-rw-r--r--secure/lib/libcrypto/man/PKCS12_parse.32
-rw-r--r--secure/lib/libcrypto/man/PKCS7_decrypt.32
-rw-r--r--secure/lib/libcrypto/man/PKCS7_encrypt.32
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign.32
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign_add_signer.32
-rw-r--r--secure/lib/libcrypto/man/PKCS7_verify.32
-rw-r--r--secure/lib/libcrypto/man/RAND_add.32
-rw-r--r--secure/lib/libcrypto/man/RAND_bytes.32
-rw-r--r--secure/lib/libcrypto/man/RAND_cleanup.32
-rw-r--r--secure/lib/libcrypto/man/RAND_egd.32
-rw-r--r--secure/lib/libcrypto/man/RAND_load_file.32
-rw-r--r--secure/lib/libcrypto/man/RAND_set_rand_method.32
-rw-r--r--secure/lib/libcrypto/man/RSA_blinding_on.32
-rw-r--r--secure/lib/libcrypto/man/RSA_check_key.32
-rw-r--r--secure/lib/libcrypto/man/RSA_generate_key.32
-rw-r--r--secure/lib/libcrypto/man/RSA_get_ex_new_index.32
-rw-r--r--secure/lib/libcrypto/man/RSA_new.32
-rw-r--r--secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.32
-rw-r--r--secure/lib/libcrypto/man/RSA_print.32
-rw-r--r--secure/lib/libcrypto/man/RSA_private_encrypt.32
-rw-r--r--secure/lib/libcrypto/man/RSA_public_encrypt.32
-rw-r--r--secure/lib/libcrypto/man/RSA_set_method.32
-rw-r--r--secure/lib/libcrypto/man/RSA_sign.32
-rw-r--r--secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.32
-rw-r--r--secure/lib/libcrypto/man/RSA_size.32
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_CMS.32
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_PKCS7.32
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_CMS.32
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_PKCS7.32
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.32
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.32
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.32
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_print_ex.32
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_error.32
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.32
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_new.32
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.32
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.32
-rw-r--r--secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.32
-rw-r--r--secure/lib/libcrypto/man/X509_check_host.32
-rw-r--r--secure/lib/libcrypto/man/X509_new.32
-rw-r--r--secure/lib/libcrypto/man/X509_verify_cert.32
-rw-r--r--secure/lib/libcrypto/man/bio.32
-rw-r--r--secure/lib/libcrypto/man/blowfish.32
-rw-r--r--secure/lib/libcrypto/man/bn.32
-rw-r--r--secure/lib/libcrypto/man/bn_internal.32
-rw-r--r--secure/lib/libcrypto/man/buffer.32
-rw-r--r--secure/lib/libcrypto/man/crypto.32
-rw-r--r--secure/lib/libcrypto/man/d2i_ASN1_OBJECT.32
-rw-r--r--secure/lib/libcrypto/man/d2i_CMS_ContentInfo.32
-rw-r--r--secure/lib/libcrypto/man/d2i_DHparams.32
-rw-r--r--secure/lib/libcrypto/man/d2i_DSAPublicKey.32
-rw-r--r--secure/lib/libcrypto/man/d2i_ECPKParameters.32
-rw-r--r--secure/lib/libcrypto/man/d2i_ECPrivateKey.32
-rw-r--r--secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.32
-rw-r--r--secure/lib/libcrypto/man/d2i_PrivateKey.32
-rw-r--r--secure/lib/libcrypto/man/d2i_RSAPublicKey.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_ALGOR.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_CRL.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_NAME.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_REQ.32
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_SIG.32
-rw-r--r--secure/lib/libcrypto/man/des.32
-rw-r--r--secure/lib/libcrypto/man/dh.32
-rw-r--r--secure/lib/libcrypto/man/dsa.32
-rw-r--r--secure/lib/libcrypto/man/ec.32
-rw-r--r--secure/lib/libcrypto/man/ecdsa.32
-rw-r--r--secure/lib/libcrypto/man/engine.32
-rw-r--r--secure/lib/libcrypto/man/err.32
-rw-r--r--secure/lib/libcrypto/man/evp.32
-rw-r--r--secure/lib/libcrypto/man/hmac.32
-rw-r--r--secure/lib/libcrypto/man/i2d_CMS_bio_stream.32
-rw-r--r--secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.32
-rw-r--r--secure/lib/libcrypto/man/lh_stats.32
-rw-r--r--secure/lib/libcrypto/man/lhash.32
-rw-r--r--secure/lib/libcrypto/man/md5.32
-rw-r--r--secure/lib/libcrypto/man/mdc2.32
-rw-r--r--secure/lib/libcrypto/man/pem.32
-rw-r--r--secure/lib/libcrypto/man/rand.32
-rw-r--r--secure/lib/libcrypto/man/rc4.32
-rw-r--r--secure/lib/libcrypto/man/ripemd.32
-rw-r--r--secure/lib/libcrypto/man/rsa.32
-rw-r--r--secure/lib/libcrypto/man/sha.32
-rw-r--r--secure/lib/libcrypto/man/threads.32
-rw-r--r--secure/lib/libcrypto/man/ui.32
-rw-r--r--secure/lib/libcrypto/man/ui_compat.32
-rw-r--r--secure/lib/libcrypto/man/x509.32
-rw-r--r--secure/lib/libssl/man/SSL_CIPHER_get_name.32
-rw-r--r--secure/lib/libssl/man/SSL_COMP_add_compression_method.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_new.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set_flags.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_cmd.32
-rw-r--r--secure/lib/libssl/man/SSL_CONF_cmd_argv.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add1_chain_cert.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_session.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_ctrl.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_flush_sessions.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_free.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get0_param.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_ex_new_index.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_verify_mode.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_load_verify_locations.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_new.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_number.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sessions.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set1_curves.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_store.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cipher_list.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_CA_list.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_generate_session_id.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_info_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_max_cert_list.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_mode.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_msg_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_options.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_read_ahead.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_id_context.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_ssl_version.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_timeout.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_verify.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_certificate.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.32
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_serverinfo.32
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_free.32
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.32
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_time.32
-rw-r--r--secure/lib/libssl/man/SSL_accept.32
-rw-r--r--secure/lib/libssl/man/SSL_alert_type_string.32
-rw-r--r--secure/lib/libssl/man/SSL_check_chain.32
-rw-r--r--secure/lib/libssl/man/SSL_clear.32
-rw-r--r--secure/lib/libssl/man/SSL_connect.32
-rw-r--r--secure/lib/libssl/man/SSL_do_handshake.32
-rw-r--r--secure/lib/libssl/man/SSL_free.32
-rw-r--r--secure/lib/libssl/man/SSL_get_SSL_CTX.32
-rw-r--r--secure/lib/libssl/man/SSL_get_ciphers.32
-rw-r--r--secure/lib/libssl/man/SSL_get_client_CA_list.32
-rw-r--r--secure/lib/libssl/man/SSL_get_current_cipher.32
-rw-r--r--secure/lib/libssl/man/SSL_get_default_timeout.32
-rw-r--r--secure/lib/libssl/man/SSL_get_error.32
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.32
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_new_index.32
-rw-r--r--secure/lib/libssl/man/SSL_get_fd.32
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_cert_chain.32
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_certificate.32
-rw-r--r--secure/lib/libssl/man/SSL_get_psk_identity.32
-rw-r--r--secure/lib/libssl/man/SSL_get_rbio.32
-rw-r--r--secure/lib/libssl/man/SSL_get_session.32
-rw-r--r--secure/lib/libssl/man/SSL_get_verify_result.32
-rw-r--r--secure/lib/libssl/man/SSL_get_version.32
-rw-r--r--secure/lib/libssl/man/SSL_library_init.32
-rw-r--r--secure/lib/libssl/man/SSL_load_client_CA_file.32
-rw-r--r--secure/lib/libssl/man/SSL_new.32
-rw-r--r--secure/lib/libssl/man/SSL_pending.32
-rw-r--r--secure/lib/libssl/man/SSL_read.32
-rw-r--r--secure/lib/libssl/man/SSL_rstate_string.32
-rw-r--r--secure/lib/libssl/man/SSL_session_reused.32
-rw-r--r--secure/lib/libssl/man/SSL_set_bio.32
-rw-r--r--secure/lib/libssl/man/SSL_set_connect_state.32
-rw-r--r--secure/lib/libssl/man/SSL_set_fd.32
-rw-r--r--secure/lib/libssl/man/SSL_set_session.32
-rw-r--r--secure/lib/libssl/man/SSL_set_shutdown.32
-rw-r--r--secure/lib/libssl/man/SSL_set_verify_result.32
-rw-r--r--secure/lib/libssl/man/SSL_shutdown.32
-rw-r--r--secure/lib/libssl/man/SSL_state_string.32
-rw-r--r--secure/lib/libssl/man/SSL_want.32
-rw-r--r--secure/lib/libssl/man/SSL_write.32
-rw-r--r--secure/lib/libssl/man/d2i_SSL_SESSION.32
-rw-r--r--secure/lib/libssl/man/ssl.32
-rw-r--r--secure/usr.bin/openssl/man/CA.pl.12
-rw-r--r--secure/usr.bin/openssl/man/asn1parse.12
-rw-r--r--secure/usr.bin/openssl/man/c_rehash.12
-rw-r--r--secure/usr.bin/openssl/man/ca.12
-rw-r--r--secure/usr.bin/openssl/man/ciphers.12
-rw-r--r--secure/usr.bin/openssl/man/cms.12
-rw-r--r--secure/usr.bin/openssl/man/crl.12
-rw-r--r--secure/usr.bin/openssl/man/crl2pkcs7.12
-rw-r--r--secure/usr.bin/openssl/man/dgst.12
-rw-r--r--secure/usr.bin/openssl/man/dhparam.12
-rw-r--r--secure/usr.bin/openssl/man/dsa.12
-rw-r--r--secure/usr.bin/openssl/man/dsaparam.12
-rw-r--r--secure/usr.bin/openssl/man/ec.12
-rw-r--r--secure/usr.bin/openssl/man/ecparam.12
-rw-r--r--secure/usr.bin/openssl/man/enc.12
-rw-r--r--secure/usr.bin/openssl/man/errstr.12
-rw-r--r--secure/usr.bin/openssl/man/gendsa.12
-rw-r--r--secure/usr.bin/openssl/man/genpkey.12
-rw-r--r--secure/usr.bin/openssl/man/genrsa.12
-rw-r--r--secure/usr.bin/openssl/man/nseq.12
-rw-r--r--secure/usr.bin/openssl/man/ocsp.12
-rw-r--r--secure/usr.bin/openssl/man/openssl.12
-rw-r--r--secure/usr.bin/openssl/man/passwd.12
-rw-r--r--secure/usr.bin/openssl/man/pkcs12.12
-rw-r--r--secure/usr.bin/openssl/man/pkcs7.12
-rw-r--r--secure/usr.bin/openssl/man/pkcs8.12
-rw-r--r--secure/usr.bin/openssl/man/pkey.12
-rw-r--r--secure/usr.bin/openssl/man/pkeyparam.12
-rw-r--r--secure/usr.bin/openssl/man/pkeyutl.12
-rw-r--r--secure/usr.bin/openssl/man/rand.12
-rw-r--r--secure/usr.bin/openssl/man/req.12
-rw-r--r--secure/usr.bin/openssl/man/rsa.12
-rw-r--r--secure/usr.bin/openssl/man/rsautl.12
-rw-r--r--secure/usr.bin/openssl/man/s_client.12
-rw-r--r--secure/usr.bin/openssl/man/s_server.12
-rw-r--r--secure/usr.bin/openssl/man/s_time.12
-rw-r--r--secure/usr.bin/openssl/man/sess_id.12
-rw-r--r--secure/usr.bin/openssl/man/smime.12
-rw-r--r--secure/usr.bin/openssl/man/speed.12
-rw-r--r--secure/usr.bin/openssl/man/spkac.12
-rw-r--r--secure/usr.bin/openssl/man/ts.12
-rw-r--r--secure/usr.bin/openssl/man/tsget.12
-rw-r--r--secure/usr.bin/openssl/man/verify.12
-rw-r--r--secure/usr.bin/openssl/man/version.12
-rw-r--r--secure/usr.bin/openssl/man/x509.12
-rw-r--r--secure/usr.bin/openssl/man/x509v3_config.12
-rw-r--r--share/man/man4/Makefile4
-rw-r--r--share/man/man4/cxgbe.44
-rw-r--r--share/man/man4/cxgbev.4290
-rw-r--r--share/man/man4/pci.47
-rw-r--r--share/man/man9/Makefile4
-rw-r--r--share/man/man9/device_quiet.914
-rw-r--r--share/man/man9/pci.9150
-rw-r--r--sys/amd64/amd64/efirt.c609
-rw-r--r--sys/amd64/amd64/machdep.c4
-rw-r--r--sys/amd64/amd64/minidump_machdep.c10
-rw-r--r--sys/amd64/amd64/pmap.c123
-rw-r--r--sys/amd64/conf/NOTES3
-rw-r--r--sys/amd64/include/cpufunc.h33
-rw-r--r--sys/amd64/include/efi.h59
-rw-r--r--sys/amd64/include/pmap.h31
-rw-r--r--sys/amd64/vmm/io/iommu.c66
-rw-r--r--sys/amd64/vmm/io/iommu.h1
-rw-r--r--sys/amd64/vmm/io/ppt.c13
-rw-r--r--sys/amd64/vmm/vmm.c12
-rw-r--r--sys/arm/arm/pmap-v6.c23
-rw-r--r--sys/arm/conf/NOTES1
-rw-r--r--sys/arm/include/efi.h37
-rw-r--r--sys/arm64/include/efi.h37
-rw-r--r--sys/boot/efi/loader/arch/amd64/Makefile.inc4
-rw-r--r--sys/boot/efi/loader/arch/amd64/exc.S165
-rw-r--r--sys/boot/efi/loader/arch/amd64/trap.c398
-rw-r--r--sys/cam/cam_xpt.c18
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_proc.c57
-rw-r--r--sys/cddl/compat/opensolaris/sys/proc.h3
-rw-r--r--sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c28
-rw-r--r--sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c26
-rw-r--r--sys/cddl/dev/systrace/systrace.c6
-rw-r--r--sys/compat/freebsd32/Makefile2
-rw-r--r--sys/compat/freebsd32/capabilities.conf284
-rw-r--r--sys/compat/freebsd32/freebsd32_capability.c20
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c3
-rw-r--r--sys/compat/freebsd32/freebsd32_proto.h7
-rw-r--r--sys/compat/freebsd32/freebsd32_syscall.h4
-rw-r--r--sys/compat/freebsd32/freebsd32_syscalls.c4
-rw-r--r--sys/compat/freebsd32/freebsd32_sysent.c466
-rw-r--r--sys/compat/freebsd32/freebsd32_systrace_args.c6
-rw-r--r--sys/compat/freebsd32/syscalls.master2
-rw-r--r--sys/conf/NOTES2
-rw-r--r--sys/conf/files8
-rw-r--r--sys/conf/files.amd641
-rw-r--r--sys/conf/options.amd643
-rw-r--r--sys/dev/cxgbe/adapter.h36
-rw-r--r--sys/dev/cxgbe/common/common.h75
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c148
-rw-r--r--sys/dev/cxgbe/common/t4vf_hw.c376
-rw-r--r--sys/dev/cxgbe/if_cxlv.c44
-rw-r--r--sys/dev/cxgbe/iw_cxgbe/cq.c2
-rw-r--r--sys/dev/cxgbe/iw_cxgbe/qp.c4
-rw-r--r--sys/dev/cxgbe/offload.h1
-rw-r--r--sys/dev/cxgbe/t4_if.m65
-rw-r--r--sys/dev/cxgbe/t4_iov.c297
-rw-r--r--sys/dev/cxgbe/t4_main.c357
-rw-r--r--sys/dev/cxgbe/t4_netmap.c18
-rw-r--r--sys/dev/cxgbe/t4_sge.c375
-rw-r--r--sys/dev/cxgbe/t4_vf.c950
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c485
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.c51
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.h14
-rw-r--r--sys/dev/pci/pci.c169
-rw-r--r--sys/dev/pci/pci_if.m16
-rw-r--r--sys/dev/pci/pci_iov.c18
-rw-r--r--sys/dev/pci/pci_iov.h7
-rw-r--r--sys/dev/pci/pci_private.h3
-rw-r--r--sys/dev/pci/pci_user.c14
-rw-r--r--sys/dev/pci/pcireg.h21
-rw-r--r--sys/dev/pci/pcivar.h13
-rw-r--r--sys/dev/usb/serial/u3g.c1
-rw-r--r--sys/dev/usb/usbdevs1
-rw-r--r--sys/dev/usb/wlan/if_rsu.c9
-rw-r--r--sys/fs/cuse/cuse.c6
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c12
-rw-r--r--sys/fs/nfs/nfs_commonport.c208
-rw-r--r--sys/fs/nfs/nfsport.h102
-rw-r--r--sys/fs/nfs/nfsproto.h4
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c18
-rw-r--r--sys/fs/nfsclient/nfs_clcomsubs.c6
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c58
-rw-r--r--sys/fs/nfsclient/nfs_clsubs.c6
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c1
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c26
-rw-r--r--sys/fs/nfsserver/nfs_nfsdcache.c36
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c5
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsocket.c103
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c50
-rw-r--r--sys/fs/nullfs/null_vnops.c1
-rw-r--r--sys/geom/geom_disk.c9
-rw-r--r--sys/geom/geom_subr.c2
-rw-r--r--sys/geom/mirror/g_mirror.c8
-rw-r--r--sys/i386/i386/pmap.c18
-rw-r--r--sys/kern/kern_fork.c2
-rw-r--r--sys/kern/kern_lockf.c6
-rw-r--r--sys/kern/kern_procctl.c40
-rw-r--r--sys/kern/kern_sendfile.c13
-rw-r--r--sys/kern/subr_bus.c27
-rw-r--r--sys/kern/subr_rtc.c4
-rw-r--r--sys/kern/subr_syscall.c15
-rw-r--r--sys/kern/sys_capability.c4
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/modules/cxgbe/Makefile2
-rw-r--r--sys/modules/cxgbe/if_cxgbe/Makefile4
-rw-r--r--sys/modules/cxgbe/if_cxgbev/Makefile21
-rw-r--r--sys/modules/cxgbe/if_cxlv/Makefile11
-rw-r--r--sys/modules/efirt/Makefile9
-rw-r--r--sys/modules/opensolaris/Makefile1
-rw-r--r--sys/net/if_bridge.c86
-rw-r--r--sys/netinet/tcp_fsm.h3
-rw-r--r--sys/netinet6/icmp6.c161
-rw-r--r--sys/netinet6/in6.c12
-rw-r--r--sys/netinet6/nd6.c4
-rw-r--r--sys/netinet6/nd6.h2
-rw-r--r--sys/netinet6/nd6_rtr.c6
-rw-r--r--sys/netpfil/ipfw/ip_fw2.c4
-rw-r--r--sys/powerpc/conf/NOTES1
-rw-r--r--sys/sparc64/sparc64/pmap.c15
-rw-r--r--sys/sys/bus.h4
-rw-r--r--sys/sys/capsicum.h2
-rw-r--r--sys/sys/clock.h1
-rw-r--r--sys/sys/efi.h31
-rw-r--r--sys/sys/proc.h1
-rw-r--r--sys/sys/procctl.h9
-rw-r--r--sys/sys/signal.h1
-rw-r--r--sys/ufs/ffs/ffs_alloc.c139
-rw-r--r--sys/ufs/ffs/ffs_balloc.c12
-rw-r--r--sys/ufs/ffs/ffs_inode.c38
-rw-r--r--sys/ufs/ffs/ffs_rawread.c6
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c64
-rw-r--r--sys/ufs/ffs/ffs_softdep.c335
-rw-r--r--sys/ufs/ffs/ffs_subr.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c13
-rw-r--r--sys/ufs/ffs/ffs_vnops.c19
-rw-r--r--sys/ufs/ufs/extattr.h4
-rw-r--r--sys/ufs/ufs/inode.h94
-rw-r--r--sys/ufs/ufs/ufs_acl.c6
-rw-r--r--sys/ufs/ufs/ufs_bmap.c4
-rw-r--r--sys/ufs/ufs/ufs_gjournal.c15
-rw-r--r--sys/ufs/ufs/ufs_inode.c5
-rw-r--r--sys/ufs/ufs/ufs_quota.c27
-rw-r--r--sys/ufs/ufs/ufs_vnops.c21
-rw-r--r--sys/ufs/ufs/ufsmount.h4
-rw-r--r--sys/vm/swap_pager.c183
-rw-r--r--sys/vm/vm_page.c4
-rw-r--r--sys/x86/acpica/madt.c38
-rw-r--r--sys/x86/include/apicvar.h8
-rw-r--r--sys/x86/iommu/intel_reg.h4
-rw-r--r--sys/x86/x86/local_apic.c11
-rw-r--r--sys/x86/xen/xen_apic.c8
-rw-r--r--targets/pseudo/userland/Makefile.depend1
-rw-r--r--tools/tools/dmardump/Makefile15
-rw-r--r--tools/tools/dmardump/dmardump.c292
-rw-r--r--usr.bin/Makefile1
-rw-r--r--usr.bin/mkimg/mkimg.12
-rw-r--r--usr.bin/nfsstat/Makefile2
-rw-r--r--usr.bin/nfsstat/nfsstat.129
-rw-r--r--usr.bin/nfsstat/nfsstat.c770
-rw-r--r--usr.bin/proccontrol/Makefile7
-rw-r--r--usr.bin/proccontrol/Makefile.depend18
-rw-r--r--usr.bin/proccontrol/proccontrol.c180
-rw-r--r--usr.sbin/devctl/devctl.821
-rw-r--r--usr.sbin/devctl/devctl.c38
-rw-r--r--usr.sbin/portsnap/portsnap/portsnap.sh7
555 files changed, 9346 insertions, 2203 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
index d065cdc..5b291e4 100644
--- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
+++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
@@ -93,6 +93,9 @@ static int g_flowindent;
static int g_intr;
static int g_impatient;
static int g_newline;
+#ifdef __FreeBSD__
+static int g_siginfo;
+#endif
static int g_total;
static int g_cflags;
static int g_oflags;
@@ -1260,6 +1263,16 @@ intr(int signo)
g_impatient = 1;
}
+#ifdef __FreeBSD__
+static void
+siginfo(int signo __unused)
+{
+
+ g_siginfo++;
+ g_newline = 1;
+}
+#endif
+
static void
installsighands(void)
{
@@ -1275,12 +1288,16 @@ installsighands(void)
if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGTERM, &act, NULL);
-#ifndef illumos
+#ifdef __FreeBSD__
if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGPIPE, &act, NULL);
if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
(void) sigaction(SIGUSR1, &act, NULL);
+
+ act.sa_handler = siginfo;
+ if (sigaction(SIGINFO, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN)
+ (void) sigaction(SIGINFO, &act, NULL);
#endif
}
@@ -1944,6 +1961,13 @@ main(int argc, char *argv[])
if (!g_intr && !done)
dtrace_sleep(g_dtp);
+#ifdef __FreeBSD__
+ if (g_siginfo) {
+ (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL);
+ g_siginfo = 0;
+ }
+#endif
+
if (g_newline) {
/*
* Output a newline just to make the output look
diff --git a/contrib/elftoolchain/libdwarf/dwarf.h b/contrib/elftoolchain/libdwarf/dwarf.h
index c79da96..f3b85ff 100644
--- a/contrib/elftoolchain/libdwarf/dwarf.h
+++ b/contrib/elftoolchain/libdwarf/dwarf.h
@@ -234,6 +234,21 @@
#define DW_AT_GNU_all_call_sites 0x2117
#define DW_AT_GNU_all_source_call_sites 0x2118
+/* Apple extensions. */
+#define DW_AT_APPLE_optimized 0x3fe1
+#define DW_AT_APPLE_flags 0x3fe2
+#define DW_AT_APPLE_isa 0x3fe3
+#define DW_AT_APPLE_block 0x3fe4
+#define DW_AT_APPLE_major_runtime_vers 0x3fe5
+#define DW_AT_APPLE_runtime_class 0x3fe6
+#define DW_AT_APPLE_omit_frame_ptr 0x3fe7
+#define DW_AT_APPLE_property_name 0x3fe8
+#define DW_AT_APPLE_property_getter 0x3fe9
+#define DW_AT_APPLE_property_setter 0x3fea
+#define DW_AT_APPLE_property_attribute 0x3feb
+#define DW_AT_APPLE_objc_complete_type 0x3fec
+#define DW_AT_APPLE_property 0x3fed
+
#define DW_FORM_addr 0x01
#define DW_FORM_block2 0x03
#define DW_FORM_block4 0x04
diff --git a/contrib/elftoolchain/libdwarf/dwarf_dump.c b/contrib/elftoolchain/libdwarf/dwarf_dump.c
index 3219fa4..03b6d6c 100644
--- a/contrib/elftoolchain/libdwarf/dwarf_dump.c
+++ b/contrib/elftoolchain/libdwarf/dwarf_dump.c
@@ -298,6 +298,32 @@ dwarf_get_AT_name(unsigned attr, const char **s)
*s = "DW_AT_GNU_all_call_sites"; break;
case DW_AT_GNU_all_source_call_sites:
*s = "DW_AT_GNU_all_source_call_sites"; break;
+ case DW_AT_APPLE_optimized:
+ *s = "DW_AT_APPLE_optimized"; break;
+ case DW_AT_APPLE_flags:
+ *s = "DW_AT_APPLE_flags"; break;
+ case DW_AT_APPLE_isa:
+ *s = "DW_AT_APPLE_isa"; break;
+ case DW_AT_APPLE_block:
+ *s = "DW_AT_APPLE_block"; break;
+ case DW_AT_APPLE_major_runtime_vers:
+ *s = "DW_AT_APPLE_major_runtime_vers"; break;
+ case DW_AT_APPLE_runtime_class:
+ *s = "DW_AT_APPLE_runtime_class"; break;
+ case DW_AT_APPLE_omit_frame_ptr:
+ *s = "DW_AT_APPLE_omit_frame_ptr"; break;
+ case DW_AT_APPLE_property_name:
+ *s = "DW_AT_APPLE_property_name"; break;
+ case DW_AT_APPLE_property_getter:
+ *s = "DW_AT_APPLE_property_getter"; break;
+ case DW_AT_APPLE_property_setter:
+ *s = "DW_AT_APPLE_property_setter"; break;
+ case DW_AT_APPLE_property_attribute:
+ *s = "DW_AT_APPLE_property_attribute"; break;
+ case DW_AT_APPLE_objc_complete_type:
+ *s = "DW_AT_APPLE_objc_complete_type"; break;
+ case DW_AT_APPLE_property:
+ *s = "DW_AT_APPLE_property"; break;
default:
return (DW_DLV_NO_ENTRY);
}
diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES
index 4bdd390..042afe3 100644
--- a/crypto/openssl/CHANGES
+++ b/crypto/openssl/CHANGES
@@ -2,6 +2,18 @@
OpenSSL CHANGES
_______________
+ Changes between 1.0.2i and 1.0.2j [26 Sep 2016]
+
+ *) Missing CRL sanity check
+
+ A bug fix which included a CRL sanity check was added to OpenSSL 1.1.0
+ but was omitted from OpenSSL 1.0.2i. As a result any attempt to use
+ CRLs in OpenSSL 1.0.2i will crash with a null pointer exception.
+
+ This issue only affects the OpenSSL 1.0.2i
+ (CVE-2016-7052)
+ [Matt Caswell]
+
Changes between 1.0.2h and 1.0.2i [22 Sep 2016]
*) OCSP Status Request extension unbounded memory growth
diff --git a/crypto/openssl/Makefile b/crypto/openssl/Makefile
index 58daaa5..04bfb11 100644
--- a/crypto/openssl/Makefile
+++ b/crypto/openssl/Makefile
@@ -4,7 +4,7 @@
## Makefile for OpenSSL
##
-VERSION=1.0.2i
+VERSION=1.0.2j
MAJOR=1
MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0
diff --git a/crypto/openssl/NEWS b/crypto/openssl/NEWS
index 5a65284..c057963 100644
--- a/crypto/openssl/NEWS
+++ b/crypto/openssl/NEWS
@@ -5,6 +5,10 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
+ Major changes between OpenSSL 1.0.2i and OpenSSL 1.0.2j [26 Sep 2016]
+
+ o Fix Use After Free for large message sizes (CVE-2016-6309)
+
Major changes between OpenSSL 1.0.2h and OpenSSL 1.0.2i [22 Sep 2016]
o OCSP Status Request extension unbounded memory growth (CVE-2016-6304)
diff --git a/crypto/openssl/README b/crypto/openssl/README
index 70d4ddd..6dedfc0 100644
--- a/crypto/openssl/README
+++ b/crypto/openssl/README
@@ -1,5 +1,5 @@
- OpenSSL 1.0.2i 22 Sep 2016
+ OpenSSL 1.0.2j 26 Sep 2016
Copyright (c) 1998-2015 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
diff --git a/crypto/openssl/crypto/engine/eng_cryptodev.c b/crypto/openssl/crypto/engine/eng_cryptodev.c
index 65a74df..2a2b95c 100644
--- a/crypto/openssl/crypto/engine/eng_cryptodev.c
+++ b/crypto/openssl/crypto/engine/eng_cryptodev.c
@@ -939,7 +939,7 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
if (fstate->mac_len != 0) {
if (fstate->mac_data != NULL) {
dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
- if (dstate->ac_data == NULL) {
+ if (dstate->mac_data == NULL) {
printf("cryptodev_digest_init: malloc failed\n");
return 0;
}
diff --git a/crypto/openssl/crypto/opensslv.h b/crypto/openssl/crypto/opensslv.h
index fdc3116..7f52eae 100644
--- a/crypto/openssl/crypto/opensslv.h
+++ b/crypto/openssl/crypto/opensslv.h
@@ -30,11 +30,11 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-# define OPENSSL_VERSION_NUMBER 0x1000209fL
+# define OPENSSL_VERSION_NUMBER 0x100020afL
# ifdef OPENSSL_FIPS
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2i-fips 22 Sep 2016"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j-fips 26 Sep 2016"
# else
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2i-freebsd 22 Sep 2016"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j-freebsd 26 Sep 2016"
# endif
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
diff --git a/crypto/openssl/crypto/x509/x509_vfy.c b/crypto/openssl/crypto/x509/x509_vfy.c
index 8334b3f..b147201 100644
--- a/crypto/openssl/crypto/x509/x509_vfy.c
+++ b/crypto/openssl/crypto/x509/x509_vfy.c
@@ -1124,10 +1124,10 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
crl = sk_X509_CRL_value(crls, i);
reasons = *preasons;
crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x);
- if (crl_score < best_score)
+ if (crl_score < best_score || crl_score == 0)
continue;
/* If current CRL is equivalent use it if it is newer */
- if (crl_score == best_score) {
+ if (crl_score == best_score && best_crl != NULL) {
int day, sec;
if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl),
X509_CRL_get_lastUpdate(crl)) == 0)
diff --git a/crypto/openssl/ssl/t1_ext.c b/crypto/openssl/ssl/t1_ext.c
index 724ddf7..79ed946 100644
--- a/crypto/openssl/ssl/t1_ext.c
+++ b/crypto/openssl/ssl/t1_ext.c
@@ -275,7 +275,9 @@ int SSL_extension_supported(unsigned int ext_type)
case TLSEXT_TYPE_ec_point_formats:
case TLSEXT_TYPE_elliptic_curves:
case TLSEXT_TYPE_heartbeat:
+# ifndef OPENSSL_NO_NEXTPROTONEG
case TLSEXT_TYPE_next_proto_neg:
+# endif
case TLSEXT_TYPE_padding:
case TLSEXT_TYPE_renegotiate:
case TLSEXT_TYPE_server_name:
diff --git a/etc/periodic/security/100.chksetuid b/etc/periodic/security/100.chksetuid
index 95920a6..da8d29d 100755
--- a/etc/periodic/security/100.chksetuid
+++ b/etc/periodic/security/100.chksetuid
@@ -46,7 +46,7 @@ then
echo ""
echo 'Checking setuid files and devices:'
MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'`
- find -sx $MP /dev/null -type f \
+ find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \
\( -perm -u+x -or -perm -g+x -or -perm -o+x \) \
\( -perm -u+s -or -perm -g+s \) -exec ls -liTd \{\} \+ |
check_diff setuid - "${host} setuid diffs:"
diff --git a/etc/periodic/security/110.neggrpperm b/etc/periodic/security/110.neggrpperm
index 1d545ac..bd94015 100755
--- a/etc/periodic/security/110.neggrpperm
+++ b/etc/periodic/security/110.neggrpperm
@@ -44,7 +44,7 @@ then
echo ""
echo 'Checking negative group permissions:'
MP=`mount -t ufs,zfs | awk '$0 !~ /no(suid|exec)/ { print $3 }'`
- n=$(find -sx $MP /dev/null -type f \
+ n=$(find -sx $MP /dev/null \( ! -fstype local \) -prune -o -type f \
\( \( ! -perm +010 -and -perm +001 \) -or \
\( ! -perm +020 -and -perm +002 \) -or \
\( ! -perm +040 -and -perm +004 \) \) \
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 2be6358..89703ec 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -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;
+ 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 = (7 -
- first_wday_of(tm->tm_year + TM_YEAR_BASE) +
- day_offset) % 7 + (week_offset - 1) * 7 +
- tm->tm_wday - day_offset;
+ tm->tm_yday = tmpyday;
flags |= FLAG_YDAY;
}
}
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 3b04acc..623216c 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -311,6 +311,8 @@ MAN+= sctp_generic_recvmsg.2 \
thr_new.2 \
thr_self.2 \
thr_set_name.2 \
+ thr_suspend.2 \
+ thr_wake.2 \
timer_create.2 \
timer_delete.2 \
timer_settime.2 \
diff --git a/lib/libc/sys/cap_enter.2 b/lib/libc/sys/cap_enter.2
index 807d7ed..03be524 100644
--- a/lib/libc/sys/cap_enter.2
+++ b/lib/libc/sys/cap_enter.2
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 27, 2014
+.Dd September 27, 2016
.Dt CAP_ENTER 2
.Os
.Sh NAME
@@ -69,6 +69,34 @@ appropriately-crafted applications or application components may be run.
.Fn cap_getmode
returns a flag indicating whether or not the process is in a capability mode
sandbox.
+.Sh RUN-TIME SETTINGS
+If the
+.Dv kern.trap_enocap
+sysctl MIB is set to a non-zero value, then for any process executing in a
+capability mode sandbox, any syscall which results in either an
+.Er ENOTCAPABLE
+or
+.Er ECAPMODE
+error also generates the synchronous
+.Dv SIGTRAP
+signal to the thread on the syscall return.
+On signal delivery, the
+.Va si_errno
+member of the
+.Fa siginfo
+signal handler parameter is set to the syscall error value,
+and the
+.Va si_code
+member is set to
+.Dv TRAP_CAP .
+.Pp
+See also the
+.Dv PROC_TRAPCAP_CTL
+and
+.Dv PROC_TRAPCAP_STATUS
+operations of the
+.Xr procctl 2
+function for similar per-process functionality.
.Sh CAVEAT
Creating effective process sandboxes is a tricky process that involves
identifying the least possible rights required by the process and then
@@ -111,6 +139,8 @@ points outside the process's allocated address space.
.Xr cap_fcntls_limit 2 ,
.Xr cap_ioctls_limit 2 ,
.Xr cap_rights_limit 2 ,
+.Xr procctl 2 ,
+.Xr sysctl 2 ,
.Xr fexecve 2 ,
.Xr cap_sandboxed 3 ,
.Xr capsicum 4
diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2
index 88dcfd3..da73fb0 100644
--- a/lib/libc/sys/procctl.2
+++ b/lib/libc/sys/procctl.2
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 21, 2015
+.Dd September 27, 2016
.Dt PROCCTL 2
.Os
.Sh NAME
@@ -71,7 +71,7 @@ The control request to perform is specified by the
.Fa cmd
argument.
The following commands are supported:
-.Bl -tag -width "PROC_REAP_GETPIDS"
+.Bl -tag -width "Dv PROC_TRAPCAP_STATUS"
.It Dv PROC_SPROTECT
Set process protection state.
This is used to mark a process as protected from being killed if the system
@@ -327,6 +327,67 @@ is set to 0.
If a debugger is attached,
.Fa data
is set to the pid of the debugger process.
+.It Dv PROC_TRAPCAP_CTL
+Controls the capability mode sandbox actions for the specified
+sandboxed processes,
+on a return from any syscall which gives either a
+.Er ENOTCAPABLE
+or
+.Er ECAPMODE
+error.
+If the control is enabled, such errors from the syscalls cause
+delivery of the synchronous
+.Dv SIGTRAP
+signal to the thread immediately before returning from the syscalls.
+.Pp
+Possible values for the
+.Fa data
+argument are:
+.Bl -tag -width "Dv PROC_TRAPCAP_CTL_DISABLE"
+.It Dv PROC_TRAPCAP_CTL_ENABLE
+Enable the
+.Dv SIGTRAP
+signal delivery on capability mode access violations.
+The enabled mode is inherited by the children of the process,
+and is kept after
+.Xr fexecve 2
+calls.
+.It Dv PROC_TRAPCAP_CTL_DISABLE
+Disable the signal delivery on capability mode access violations.
+Note that the global sysctl
+.Dv kern.trap_enocap
+might still cause the signal to be delivered.
+See
+.Xr capsicum 4 .
+.El
+.Pp
+On signal delivery, the
+.Va si_errno
+member of the
+.Fa siginfo
+signal handler parameter is set to the syscall error value,
+and the
+.Va si_code
+member is set to
+.Dv TRAP_CAP .
+.Pp
+See
+.Xr capsicum 4
+for more information about the capability mode.
+.It Dv PROC_TRAPCAP_STATUS
+Return the current status of signalling capability mode access
+violations for the specified process.
+The integer value pointed to by the
+.Fa data
+argument is set to the
+.Dv PROC_TRAPCAP_CTL_ENABLE
+value if the process control enables signal delivery, and to
+.Dv PROC_TRAPCAP_CTL_DISABLE
+otherwise.
+.Pp
+See the note about sysctl
+.Dv kern.trap_enocap
+above, which gives independent global control of signal delivery.
.El
.Sh NOTES
Disabling tracing on a process should not be considered a security
@@ -420,14 +481,18 @@ The value of the integer
.Fa data
parameter for the
.Dv PROC_TRACE_CTL
+or
+.Dv PROC_TRAPCAP_CTL
request is invalid.
.El
.Sh SEE ALSO
.Xr dtrace 1 ,
+.Xr cap_enter 2,
.Xr kill 2 ,
.Xr ktrace 2 ,
.Xr ptrace 2 ,
.Xr wait 2 ,
+.Xr capsicum 4 ,
.Xr hwpmc 4 ,
.Xr init 8
.Sh HISTORY
diff --git a/lib/libc/sys/thr_suspend.2 b/lib/libc/sys/thr_suspend.2
new file mode 100644
index 0000000..b470d18
--- /dev/null
+++ b/lib/libc/sys/thr_suspend.2
@@ -0,0 +1,130 @@
+.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This documentation was written by
+.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
+.\" from the FreeBSD Foundation.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 23, 2016
+.Dt THR_SUSPEND 2
+.Os
+.Sh NAME
+.Nm thr_suspend
+.Nd suspend the calling thread
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/thr.h
+.Ft int
+.Fn thr_suspend "struct timespec *timeout"
+.Sh DESCRIPTION
+.Bf -symbolic
+This function is intended for implementing threading.
+Normal applications should use
+.Xr pthread_cond_timedwait 3
+together with
+.Xr pthread_cond_broadcast 3
+for typical safe suspension with cooperation of the thread
+being suspended, or
+.Xr pthread_suspend_np 3
+and
+.Xr pthread_resume_np 3
+in some specific situations, instead.
+.Ef
+.Pp
+The
+.Fn thr_suspend
+system call puts the calling thread in a suspended state, where it is
+not eligible for CPU time.
+This state is exited by another thread calling
+.Xr thr_wake 2 ,
+when the time interval specified by
+.Fa timeout
+has elapsed,
+or by the delivery of a signal to the suspended thread.
+.Pp
+If the
+.Fa timeout
+argument is
+.Dv NULL ,
+the suspended state can be only terminated by explicit
+.Fn thr_wake
+or signal.
+.Pp
+If a wake from
+.Xr thr_wake 2
+was delivered before the
+.Nm
+call, the thread is not put into a suspended state.
+Instead, the call
+returns immediately without an error.
+.Pp
+If a thread previously called
+.Xr thr_wake 2
+with its own thread identifier, which resulted in setting the internal kernel
+flag to immediately abort interruptible sleeps with an
+.Er EINTR
+error
+.Po
+see
+.Xr thr_wake 2
+.Pc ,
+the flag is cleared.
+As with
+.Xr thr_wake 2
+called from another thread, the next
+.Nm
+call does not result in suspension.
+.Pp
+.Sh RETURN VALUES
+.Rv -std thr_suspend
+.Sh ERRORS
+The
+.Fn thr_suspend
+operation returns the following errors:
+.Bl -tag -width Er
+.It Bq Er EFAULT
+The memory pointed to by the
+.Fa timeout
+argument is not valid.
+.It Bq Er ETIMEDOUT
+The specified timeout expired.
+.It Bq Er ETIMEDOUT
+The
+.Fa timeout
+argument specified a zero time interval.
+.It Bq Er EINTR
+The sleep was interrupted by a signal.
+.El
+.Sh SEE ALSO
+.Xr ps 1 ,
+.Xr thr_wake 2 ,
+.Xr pthread_resume_np 3 ,
+.Xr pthread_suspend_np 3
+.Sh STANDARDS
+The
+.Fn thr_suspend
+system call is non-standard.
diff --git a/lib/libc/sys/thr_wake.2 b/lib/libc/sys/thr_wake.2
new file mode 100644
index 0000000..59df7d2
--- /dev/null
+++ b/lib/libc/sys/thr_wake.2
@@ -0,0 +1,112 @@
+.\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This documentation was written by
+.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
+.\" from the FreeBSD Foundation.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd September 23, 2016
+.Dt THR_WAKE 2
+.Os
+.Sh NAME
+.Nm thr_wake
+.Nd wake up the suspended thread
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/thr.h
+.Ft int
+.Fn thr_wake "long id"
+.Sh DESCRIPTION
+.Bf -symbolic
+This function is intended for implementing threading.
+Normal applications should use
+.Xr pthread_cond_timedwait 3
+together with
+.Xr pthread_cond_broadcast 3
+for typical safe suspension with cooperation of the thread
+being suspended, or
+.Xr pthread_suspend_np 3
+and
+.Xr pthread_resume_np 3
+in some specific situations, instead.
+.Ef
+.Pp
+Passing the thread identifier of the calling thread
+.Po
+see
+.Xr thr_self 2
+.Pc
+to
+.Fn thr_wake
+sets a thread's flag to cause the next signal-interruptible sleep
+of that thread in the kernel to fail immediately with the
+.Er EINTR
+error.
+The flag is cleared by an interruptible sleep attempt or by a call to
+.Xr thr_suspend 2.
+This is used by the system threading library to implement cancellation.
+.Pp
+If
+.Fa id
+is not equal to the current thread identifier, the specified thread is
+woken up if suspended by the
+.Xr thr_suspend
+system call.
+If the thread is not suspended at the time of the
+.Nm
+call, the wake is remembered and the next attempt of the thread to
+suspend itself with the
+.Xr thr_suspend 2
+results in immediate return with success.
+Only one wake is remembered.
+.Sh RETURN VALUES
+.Rv -std thr_wake
+.Sh ERRORS
+The
+.Fn thr_wake
+operation returns these errors:
+.Bl -tag -width Er
+.It Bq Er ESRCH
+The specified thread was not found or does not belong to the process
+of the calling thread.
+.El
+.Sh SEE ALSO
+.Xr ps 1 ,
+.Xr thr_self 2
+.Xr thr_suspend 2 ,
+.Xr pthread_cancel 3 ,
+.Xr pthread_resume_np 3 ,
+.Xr pthread_suspend_np 3
+.Sh STANDARDS
+The
+.Fn thr_suspend
+system call is non-standard and is used by
+.Lb libthr
+to implement
+.St -p1003.1-2001
+.Xr pthread 3
+functionality.
diff --git a/lib/libdevctl/devctl.3 b/lib/libdevctl/devctl.3
index 866bb6a..a4fe062 100644
--- a/lib/libdevctl/devctl.3
+++ b/lib/libdevctl/devctl.3
@@ -25,12 +25,13 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 27, 2016
+.Dd August 29, 2016
.Dt DEVCTL 3
.Os
.Sh NAME
.Nm devctl ,
.Nm devctl_attach ,
+.Nm devctl_clear_driver ,
.Nm devctl_delete ,
.Nm devctl_detach ,
.Nm devctl_disable ,
@@ -47,6 +48,8 @@
.Ft int
.Fn devctl_attach "const char *device"
.Ft int
+.Fn devctl_clear_driver "const char *device" "bool force"
+.Ft int
.Fn devctl_delete "const char *device" "bool force"
.Ft int
.Fn devctl_detach "const char *device" "bool force"
@@ -166,12 +169,30 @@ 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.
+.Pp
+The
.Fn devctl_rescan
function rescans a bus device checking for devices that have been added or
removed.
.Sh RETURN VALUES
-.Rv -std devctl_attach devctl_delete devctl_detach devctl_disable \
-devctl_enable devctl_suspend devctl_rescan devctl_resume devctl_set_driver
+.Rv -std devctl_attach devctl_clear_driver devctl_delete devctl_detach \
+devctl_disable devctl_enable devctl_suspend devctl_rescan devctl_resume \
+devctl_set_driver
.Sh ERRORS
In addition to specific errors noted below,
all of the
@@ -302,6 +323,24 @@ 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
+.Pp
+The
.Fn devctl_rescan
function may fail if:
.Bl -tag -width Er
diff --git a/lib/libdevctl/devctl.c b/lib/libdevctl/devctl.c
index 9f275e7..5013fb0 100644
--- a/lib/libdevctl/devctl.c
+++ b/lib/libdevctl/devctl.c
@@ -124,6 +124,14 @@ devctl_set_driver(const char *device, const char *driver, bool force)
}
int
+devctl_clear_driver(const char *device, bool force)
+{
+
+ return (devctl_simple_request(DEV_CLEAR_DRIVER, device, force ?
+ DEVF_CLEAR_DRIVER_DETACH : 0));
+}
+
+int
devctl_rescan(const char *device)
{
diff --git a/lib/libdevctl/devctl.h b/lib/libdevctl/devctl.h
index 670ca1a..d49199a 100644
--- a/lib/libdevctl/devctl.h
+++ b/lib/libdevctl/devctl.h
@@ -38,6 +38,7 @@ int devctl_disable(const char *device, bool force_detach);
int devctl_suspend(const char *device);
int devctl_resume(const char *device);
int devctl_set_driver(const char *device, const char *driver, bool force);
+int devctl_clear_driver(const char *device, bool force);
int devctl_rescan(const char *device);
int devctl_delete(const char *device, bool force);
diff --git a/lib/libprocstat/common_kvm.c b/lib/libprocstat/common_kvm.c
index be05980..4ca2514 100644
--- a/lib/libprocstat/common_kvm.c
+++ b/lib/libprocstat/common_kvm.c
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
#include <sys/mount.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
+#include <ufs/ufs/extattr.h>
+#include <ufs/ufs/ufsmount.h>
#include <fs/devfs/devfs.h>
#include <fs/devfs/devfs_int.h>
#undef _KERNEL
@@ -88,17 +90,22 @@ int
ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
{
struct inode inode;
+ struct ufsmount um;
if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) {
warnx("can't read inode at %p", (void *)VTOI(vp));
return (1);
}
+ if (!kvm_read_all(kd, (unsigned long)inode.i_ump, &um, sizeof(um))) {
+ warnx("can't read ufsmount at %p", (void *)inode.i_ump);
+ return (1);
+ }
/*
* The st_dev from stat(2) is a dev_t. These kernel structures
* contain cdev pointers. We need to convert to dev_t to make
* comparisons
*/
- vn->vn_fsid = dev2udev(kd, inode.i_dev);
+ vn->vn_fsid = dev2udev(kd, um.um_dev);
vn->vn_fileid = inode.i_number;
vn->vn_mode = (mode_t)inode.i_mode;
vn->vn_size = inode.i_size;
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index 7a95f59..3be4ddc 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -3,8 +3,8 @@
.include <bsd.own.mk>
# OpenSSL version used for manual page generation
-OPENSSL_VER= 1.0.2i
-OPENSSL_DATE= 2016-09-22
+OPENSSL_VER= 1.0.2j
+OPENSSL_DATE= 2016-09-26
LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl
LCRYPTO_DOC= ${LCRYPTO_SRC}/doc
diff --git a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
index 36b3727..f172d64 100644
--- a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
+++ b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_OBJECT_new 3"
-.TH ASN1_OBJECT_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_OBJECT_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/ASN1_STRING_length.3
index 17618b0..9bf6e38 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_length.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_length.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_length 3"
-.TH ASN1_STRING_length 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_STRING_length 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/ASN1_STRING_new.3
index 011cfb5..d0e29ff 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_new.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_new 3"
-.TH ASN1_STRING_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_STRING_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
index 08209a4..8b0b3f0 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_print_ex 3"
-.TH ASN1_STRING_print_ex 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_STRING_print_ex 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/ASN1_TIME_set.3
index aa7d1bd..1a71b85 100644
--- a/secure/lib/libcrypto/man/ASN1_TIME_set.3
+++ b/secure/lib/libcrypto/man/ASN1_TIME_set.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_TIME_set 3"
-.TH ASN1_TIME_set 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_TIME_set 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
index fac552d..78469f3 100644
--- a/secure/lib/libcrypto/man/ASN1_generate_nconf.3
+++ b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_generate_nconf 3"
-.TH ASN1_generate_nconf 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1_generate_nconf 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_ctrl.3 b/secure/lib/libcrypto/man/BIO_ctrl.3
index 3506e5c..b976d67 100644
--- a/secure/lib/libcrypto/man/BIO_ctrl.3
+++ b/secure/lib/libcrypto/man/BIO_ctrl.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_ctrl 3"
-.TH BIO_ctrl 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_ctrl 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_base64.3 b/secure/lib/libcrypto/man/BIO_f_base64.3
index 6be4f54..d92c643 100644
--- a/secure/lib/libcrypto/man/BIO_f_base64.3
+++ b/secure/lib/libcrypto/man/BIO_f_base64.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_base64 3"
-.TH BIO_f_base64 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_base64 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_buffer.3 b/secure/lib/libcrypto/man/BIO_f_buffer.3
index c16dbd6..efaaff8 100644
--- a/secure/lib/libcrypto/man/BIO_f_buffer.3
+++ b/secure/lib/libcrypto/man/BIO_f_buffer.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_buffer 3"
-.TH BIO_f_buffer 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_buffer 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_cipher.3 b/secure/lib/libcrypto/man/BIO_f_cipher.3
index c2a5327..feb481d 100644
--- a/secure/lib/libcrypto/man/BIO_f_cipher.3
+++ b/secure/lib/libcrypto/man/BIO_f_cipher.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_cipher 3"
-.TH BIO_f_cipher 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_cipher 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_md.3 b/secure/lib/libcrypto/man/BIO_f_md.3
index 0e230ed..3f17fdf 100644
--- a/secure/lib/libcrypto/man/BIO_f_md.3
+++ b/secure/lib/libcrypto/man/BIO_f_md.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_md 3"
-.TH BIO_f_md 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_md 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_null.3 b/secure/lib/libcrypto/man/BIO_f_null.3
index c78009d..3385b87 100644
--- a/secure/lib/libcrypto/man/BIO_f_null.3
+++ b/secure/lib/libcrypto/man/BIO_f_null.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_null 3"
-.TH BIO_f_null 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_null 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_ssl.3 b/secure/lib/libcrypto/man/BIO_f_ssl.3
index eb43bff..ecc975e 100644
--- a/secure/lib/libcrypto/man/BIO_f_ssl.3
+++ b/secure/lib/libcrypto/man/BIO_f_ssl.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_ssl 3"
-.TH BIO_f_ssl 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_f_ssl 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_find_type.3 b/secure/lib/libcrypto/man/BIO_find_type.3
index d13c9c7..39d84a6 100644
--- a/secure/lib/libcrypto/man/BIO_find_type.3
+++ b/secure/lib/libcrypto/man/BIO_find_type.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_find_type 3"
-.TH BIO_find_type 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_find_type 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new.3 b/secure/lib/libcrypto/man/BIO_new.3
index 41a9899..ad4d9c3 100644
--- a/secure/lib/libcrypto/man/BIO_new.3
+++ b/secure/lib/libcrypto/man/BIO_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new 3"
-.TH BIO_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new_CMS.3 b/secure/lib/libcrypto/man/BIO_new_CMS.3
index 9f35882..df0ca68 100644
--- a/secure/lib/libcrypto/man/BIO_new_CMS.3
+++ b/secure/lib/libcrypto/man/BIO_new_CMS.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new_CMS 3"
-.TH BIO_new_CMS 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_new_CMS 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_push.3 b/secure/lib/libcrypto/man/BIO_push.3
index 3247ae3..2838125 100644
--- a/secure/lib/libcrypto/man/BIO_push.3
+++ b/secure/lib/libcrypto/man/BIO_push.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_push 3"
-.TH BIO_push 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_push 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_read.3 b/secure/lib/libcrypto/man/BIO_read.3
index 5ad5695..c7c3691 100644
--- a/secure/lib/libcrypto/man/BIO_read.3
+++ b/secure/lib/libcrypto/man/BIO_read.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_read 3"
-.TH BIO_read 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_read 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_accept.3 b/secure/lib/libcrypto/man/BIO_s_accept.3
index 205dbda..8a4e5ed 100644
--- a/secure/lib/libcrypto/man/BIO_s_accept.3
+++ b/secure/lib/libcrypto/man/BIO_s_accept.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_accept 3"
-.TH BIO_s_accept 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_accept 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_bio.3 b/secure/lib/libcrypto/man/BIO_s_bio.3
index e56503b..3b2da9a 100644
--- a/secure/lib/libcrypto/man/BIO_s_bio.3
+++ b/secure/lib/libcrypto/man/BIO_s_bio.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_bio 3"
-.TH BIO_s_bio 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_bio 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_connect.3 b/secure/lib/libcrypto/man/BIO_s_connect.3
index 762a6ab..ff8d911 100644
--- a/secure/lib/libcrypto/man/BIO_s_connect.3
+++ b/secure/lib/libcrypto/man/BIO_s_connect.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_connect 3"
-.TH BIO_s_connect 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_connect 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_fd.3 b/secure/lib/libcrypto/man/BIO_s_fd.3
index d5afdb7..5106403 100644
--- a/secure/lib/libcrypto/man/BIO_s_fd.3
+++ b/secure/lib/libcrypto/man/BIO_s_fd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_fd 3"
-.TH BIO_s_fd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_fd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_file.3 b/secure/lib/libcrypto/man/BIO_s_file.3
index 5286393..21f84f5 100644
--- a/secure/lib/libcrypto/man/BIO_s_file.3
+++ b/secure/lib/libcrypto/man/BIO_s_file.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_file 3"
-.TH BIO_s_file 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_file 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_mem.3 b/secure/lib/libcrypto/man/BIO_s_mem.3
index 6b4898c..ce98a1f 100644
--- a/secure/lib/libcrypto/man/BIO_s_mem.3
+++ b/secure/lib/libcrypto/man/BIO_s_mem.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_mem 3"
-.TH BIO_s_mem 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_mem 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_null.3 b/secure/lib/libcrypto/man/BIO_s_null.3
index af9bc4a..f82825ed 100644
--- a/secure/lib/libcrypto/man/BIO_s_null.3
+++ b/secure/lib/libcrypto/man/BIO_s_null.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_null 3"
-.TH BIO_s_null 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_null 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_socket.3 b/secure/lib/libcrypto/man/BIO_s_socket.3
index e6af124..52d5274 100644
--- a/secure/lib/libcrypto/man/BIO_s_socket.3
+++ b/secure/lib/libcrypto/man/BIO_s_socket.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_socket 3"
-.TH BIO_s_socket 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_s_socket 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_set_callback.3 b/secure/lib/libcrypto/man/BIO_set_callback.3
index b5b3533..9a57f6c 100644
--- a/secure/lib/libcrypto/man/BIO_set_callback.3
+++ b/secure/lib/libcrypto/man/BIO_set_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_set_callback 3"
-.TH BIO_set_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_set_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_should_retry.3 b/secure/lib/libcrypto/man/BIO_should_retry.3
index 1280917..c9c4645 100644
--- a/secure/lib/libcrypto/man/BIO_should_retry.3
+++ b/secure/lib/libcrypto/man/BIO_should_retry.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_should_retry 3"
-.TH BIO_should_retry 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BIO_should_retry 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_BLINDING_new.3 b/secure/lib/libcrypto/man/BN_BLINDING_new.3
index 907209a..d140412 100644
--- a/secure/lib/libcrypto/man/BN_BLINDING_new.3
+++ b/secure/lib/libcrypto/man/BN_BLINDING_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_BLINDING_new 3"
-.TH BN_BLINDING_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_BLINDING_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_new.3 b/secure/lib/libcrypto/man/BN_CTX_new.3
index f487609..cb0ee0c 100644
--- a/secure/lib/libcrypto/man/BN_CTX_new.3
+++ b/secure/lib/libcrypto/man/BN_CTX_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_new 3"
-.TH BN_CTX_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_CTX_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_start.3 b/secure/lib/libcrypto/man/BN_CTX_start.3
index aa9f579..535a55c 100644
--- a/secure/lib/libcrypto/man/BN_CTX_start.3
+++ b/secure/lib/libcrypto/man/BN_CTX_start.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_start 3"
-.TH BN_CTX_start 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_CTX_start 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add.3 b/secure/lib/libcrypto/man/BN_add.3
index 7d72d7b..b2ab3c9 100644
--- a/secure/lib/libcrypto/man/BN_add.3
+++ b/secure/lib/libcrypto/man/BN_add.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add 3"
-.TH BN_add 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_add 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add_word.3 b/secure/lib/libcrypto/man/BN_add_word.3
index ebe98f3..0be74ce 100644
--- a/secure/lib/libcrypto/man/BN_add_word.3
+++ b/secure/lib/libcrypto/man/BN_add_word.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add_word 3"
-.TH BN_add_word 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_add_word 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_bn2bin.3 b/secure/lib/libcrypto/man/BN_bn2bin.3
index bee8781..f4c6389 100644
--- a/secure/lib/libcrypto/man/BN_bn2bin.3
+++ b/secure/lib/libcrypto/man/BN_bn2bin.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_bn2bin 3"
-.TH BN_bn2bin 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_bn2bin 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_cmp.3 b/secure/lib/libcrypto/man/BN_cmp.3
index 8769dd1..984b25c 100644
--- a/secure/lib/libcrypto/man/BN_cmp.3
+++ b/secure/lib/libcrypto/man/BN_cmp.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_cmp 3"
-.TH BN_cmp 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_cmp 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_copy.3 b/secure/lib/libcrypto/man/BN_copy.3
index ef83d72..a10de7d 100644
--- a/secure/lib/libcrypto/man/BN_copy.3
+++ b/secure/lib/libcrypto/man/BN_copy.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_copy 3"
-.TH BN_copy 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_copy 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_generate_prime.3 b/secure/lib/libcrypto/man/BN_generate_prime.3
index 0af3cc6..ef78d78 100644
--- a/secure/lib/libcrypto/man/BN_generate_prime.3
+++ b/secure/lib/libcrypto/man/BN_generate_prime.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_generate_prime 3"
-.TH BN_generate_prime 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_generate_prime 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_inverse.3 b/secure/lib/libcrypto/man/BN_mod_inverse.3
index d6654eb..e496484 100644
--- a/secure/lib/libcrypto/man/BN_mod_inverse.3
+++ b/secure/lib/libcrypto/man/BN_mod_inverse.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_inverse 3"
-.TH BN_mod_inverse 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_mod_inverse 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
index 17e3b68..c1eb75d 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_montgomery 3"
-.TH BN_mod_mul_montgomery 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_mod_mul_montgomery 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
index d2ab42e3..c150aa6 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_reciprocal 3"
-.TH BN_mod_mul_reciprocal 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_mod_mul_reciprocal 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_new.3 b/secure/lib/libcrypto/man/BN_new.3
index 653a647..0062a1b 100644
--- a/secure/lib/libcrypto/man/BN_new.3
+++ b/secure/lib/libcrypto/man/BN_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_new 3"
-.TH BN_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_num_bytes.3 b/secure/lib/libcrypto/man/BN_num_bytes.3
index 3ac7799..befe646 100644
--- a/secure/lib/libcrypto/man/BN_num_bytes.3
+++ b/secure/lib/libcrypto/man/BN_num_bytes.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_num_bytes 3"
-.TH BN_num_bytes 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_num_bytes 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_rand.3 b/secure/lib/libcrypto/man/BN_rand.3
index 83ada14..ec5a3a3 100644
--- a/secure/lib/libcrypto/man/BN_rand.3
+++ b/secure/lib/libcrypto/man/BN_rand.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_rand 3"
-.TH BN_rand 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_rand 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_set_bit.3 b/secure/lib/libcrypto/man/BN_set_bit.3
index b509549..a1c1243 100644
--- a/secure/lib/libcrypto/man/BN_set_bit.3
+++ b/secure/lib/libcrypto/man/BN_set_bit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_set_bit 3"
-.TH BN_set_bit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_set_bit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_swap.3 b/secure/lib/libcrypto/man/BN_swap.3
index ec51fbb..4201c9f38 100644
--- a/secure/lib/libcrypto/man/BN_swap.3
+++ b/secure/lib/libcrypto/man/BN_swap.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_swap 3"
-.TH BN_swap 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_swap 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_zero.3 b/secure/lib/libcrypto/man/BN_zero.3
index f5b72e4..59daa9d 100644
--- a/secure/lib/libcrypto/man/BN_zero.3
+++ b/secure/lib/libcrypto/man/BN_zero.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_zero 3"
-.TH BN_zero 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH BN_zero 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add0_cert.3 b/secure/lib/libcrypto/man/CMS_add0_cert.3
index 5c68fe3..cba8871 100644
--- a/secure/lib/libcrypto/man/CMS_add0_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add0_cert.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add0_cert 3"
-.TH CMS_add0_cert 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_add0_cert 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
index cef9402..9947d33 100644
--- a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_recipient_cert 3"
-.TH CMS_add1_recipient_cert 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_add1_recipient_cert 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_signer.3 b/secure/lib/libcrypto/man/CMS_add1_signer.3
index 2019430..84100bd 100644
--- a/secure/lib/libcrypto/man/CMS_add1_signer.3
+++ b/secure/lib/libcrypto/man/CMS_add1_signer.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_signer 3"
-.TH CMS_add1_signer 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_add1_signer 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_compress.3 b/secure/lib/libcrypto/man/CMS_compress.3
index 0dc09c3..6a54be7 100644
--- a/secure/lib/libcrypto/man/CMS_compress.3
+++ b/secure/lib/libcrypto/man/CMS_compress.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_compress 3"
-.TH CMS_compress 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_compress 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_decrypt.3 b/secure/lib/libcrypto/man/CMS_decrypt.3
index b626d33..13a5881 100644
--- a/secure/lib/libcrypto/man/CMS_decrypt.3
+++ b/secure/lib/libcrypto/man/CMS_decrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_decrypt 3"
-.TH CMS_decrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_decrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_encrypt.3 b/secure/lib/libcrypto/man/CMS_encrypt.3
index fb0f48e..b74bcf0 100644
--- a/secure/lib/libcrypto/man/CMS_encrypt.3
+++ b/secure/lib/libcrypto/man/CMS_encrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_encrypt 3"
-.TH CMS_encrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_encrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_final.3 b/secure/lib/libcrypto/man/CMS_final.3
index 5969055..9fb43fa 100644
--- a/secure/lib/libcrypto/man/CMS_final.3
+++ b/secure/lib/libcrypto/man/CMS_final.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_final 3"
-.TH CMS_final 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_final 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
index a3f2d28..ef7bd5e 100644
--- a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_RecipientInfos 3"
-.TH CMS_get0_RecipientInfos 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_get0_RecipientInfos 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
index 3e75dc6..e222eca 100644
--- a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_SignerInfos 3"
-.TH CMS_get0_SignerInfos 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_get0_SignerInfos 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_type.3 b/secure/lib/libcrypto/man/CMS_get0_type.3
index 410e94e..8110336 100644
--- a/secure/lib/libcrypto/man/CMS_get0_type.3
+++ b/secure/lib/libcrypto/man/CMS_get0_type.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_type 3"
-.TH CMS_get0_type 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_get0_type 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
index de5f90c..b0dd7b1 100644
--- a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
+++ b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get1_ReceiptRequest 3"
-.TH CMS_get1_ReceiptRequest 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_get1_ReceiptRequest 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign.3 b/secure/lib/libcrypto/man/CMS_sign.3
index 37709d9..89722d0 100644
--- a/secure/lib/libcrypto/man/CMS_sign.3
+++ b/secure/lib/libcrypto/man/CMS_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign 3"
-.TH CMS_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign_receipt.3 b/secure/lib/libcrypto/man/CMS_sign_receipt.3
index 61a3821..d009ac6 100644
--- a/secure/lib/libcrypto/man/CMS_sign_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_sign_receipt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign_receipt 3"
-.TH CMS_sign_receipt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_sign_receipt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_uncompress.3 b/secure/lib/libcrypto/man/CMS_uncompress.3
index cbf69c3..708bff9 100644
--- a/secure/lib/libcrypto/man/CMS_uncompress.3
+++ b/secure/lib/libcrypto/man/CMS_uncompress.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_uncompress 3"
-.TH CMS_uncompress 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_uncompress 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify.3 b/secure/lib/libcrypto/man/CMS_verify.3
index fc4012e..aea03b5 100644
--- a/secure/lib/libcrypto/man/CMS_verify.3
+++ b/secure/lib/libcrypto/man/CMS_verify.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify 3"
-.TH CMS_verify 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_verify 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify_receipt.3 b/secure/lib/libcrypto/man/CMS_verify_receipt.3
index 25e3bc2..693390c 100644
--- a/secure/lib/libcrypto/man/CMS_verify_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_verify_receipt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify_receipt 3"
-.TH CMS_verify_receipt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS_verify_receipt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_free.3 b/secure/lib/libcrypto/man/CONF_modules_free.3
index 53ae454..e86cda5 100644
--- a/secure/lib/libcrypto/man/CONF_modules_free.3
+++ b/secure/lib/libcrypto/man/CONF_modules_free.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_free 3"
-.TH CONF_modules_free 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CONF_modules_free 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_load_file.3 b/secure/lib/libcrypto/man/CONF_modules_load_file.3
index 98c4d99..341678e 100644
--- a/secure/lib/libcrypto/man/CONF_modules_load_file.3
+++ b/secure/lib/libcrypto/man/CONF_modules_load_file.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_load_file 3"
-.TH CONF_modules_load_file 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CONF_modules_load_file 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
index f85a676..a2ec1ce 100644
--- a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
+++ b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRYPTO_set_ex_data 3"
-.TH CRYPTO_set_ex_data 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CRYPTO_set_ex_data 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_key.3 b/secure/lib/libcrypto/man/DH_generate_key.3
index 4fdd72f..30b4b02 100644
--- a/secure/lib/libcrypto/man/DH_generate_key.3
+++ b/secure/lib/libcrypto/man/DH_generate_key.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_key 3"
-.TH DH_generate_key 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_generate_key 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_parameters.3 b/secure/lib/libcrypto/man/DH_generate_parameters.3
index 5370a0f..7ad81ef 100644
--- a/secure/lib/libcrypto/man/DH_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DH_generate_parameters.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_parameters 3"
-.TH DH_generate_parameters 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_generate_parameters 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_get_ex_new_index.3 b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
index 175a504..c51a74c 100644
--- a/secure/lib/libcrypto/man/DH_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_get_ex_new_index 3"
-.TH DH_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_new.3 b/secure/lib/libcrypto/man/DH_new.3
index e138fd9..bd123ff 100644
--- a/secure/lib/libcrypto/man/DH_new.3
+++ b/secure/lib/libcrypto/man/DH_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_new 3"
-.TH DH_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_set_method.3 b/secure/lib/libcrypto/man/DH_set_method.3
index 1ef0de0..1253534 100644
--- a/secure/lib/libcrypto/man/DH_set_method.3
+++ b/secure/lib/libcrypto/man/DH_set_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_set_method 3"
-.TH DH_set_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_set_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_size.3 b/secure/lib/libcrypto/man/DH_size.3
index b6d0cdd..b2bf9f9 100644
--- a/secure/lib/libcrypto/man/DH_size.3
+++ b/secure/lib/libcrypto/man/DH_size.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_size 3"
-.TH DH_size 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DH_size 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_SIG_new.3 b/secure/lib/libcrypto/man/DSA_SIG_new.3
index 9602923..56db67f 100644
--- a/secure/lib/libcrypto/man/DSA_SIG_new.3
+++ b/secure/lib/libcrypto/man/DSA_SIG_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_SIG_new 3"
-.TH DSA_SIG_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_SIG_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_do_sign.3 b/secure/lib/libcrypto/man/DSA_do_sign.3
index 5f6f170..901d63a 100644
--- a/secure/lib/libcrypto/man/DSA_do_sign.3
+++ b/secure/lib/libcrypto/man/DSA_do_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_do_sign 3"
-.TH DSA_do_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_do_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_dup_DH.3 b/secure/lib/libcrypto/man/DSA_dup_DH.3
index 6f09340..aade09c 100644
--- a/secure/lib/libcrypto/man/DSA_dup_DH.3
+++ b/secure/lib/libcrypto/man/DSA_dup_DH.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_dup_DH 3"
-.TH DSA_dup_DH 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_dup_DH 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_key.3 b/secure/lib/libcrypto/man/DSA_generate_key.3
index 9f025b4..58af0d3 100644
--- a/secure/lib/libcrypto/man/DSA_generate_key.3
+++ b/secure/lib/libcrypto/man/DSA_generate_key.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_key 3"
-.TH DSA_generate_key 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_generate_key 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_parameters.3 b/secure/lib/libcrypto/man/DSA_generate_parameters.3
index 265207d..6b587f6 100644
--- a/secure/lib/libcrypto/man/DSA_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DSA_generate_parameters.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_parameters 3"
-.TH DSA_generate_parameters 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_generate_parameters 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
index 073a560..c4de2fa 100644
--- a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_get_ex_new_index 3"
-.TH DSA_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_new.3 b/secure/lib/libcrypto/man/DSA_new.3
index abf8c4c..f3a4647 100644
--- a/secure/lib/libcrypto/man/DSA_new.3
+++ b/secure/lib/libcrypto/man/DSA_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_new 3"
-.TH DSA_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_set_method.3 b/secure/lib/libcrypto/man/DSA_set_method.3
index 736e8e4..79035d1 100644
--- a/secure/lib/libcrypto/man/DSA_set_method.3
+++ b/secure/lib/libcrypto/man/DSA_set_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_set_method 3"
-.TH DSA_set_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_set_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_sign.3 b/secure/lib/libcrypto/man/DSA_sign.3
index 01a281a..9943b2d 100644
--- a/secure/lib/libcrypto/man/DSA_sign.3
+++ b/secure/lib/libcrypto/man/DSA_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_sign 3"
-.TH DSA_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_size.3 b/secure/lib/libcrypto/man/DSA_size.3
index 9ba45ce..bc51ac7 100644
--- a/secure/lib/libcrypto/man/DSA_size.3
+++ b/secure/lib/libcrypto/man/DSA_size.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_size 3"
-.TH DSA_size 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA_size 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GFp_simple_method.3 b/secure/lib/libcrypto/man/EC_GFp_simple_method.3
index 921250f..dbe62f2 100644
--- a/secure/lib/libcrypto/man/EC_GFp_simple_method.3
+++ b/secure/lib/libcrypto/man/EC_GFp_simple_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GFp_simple_method 3"
-.TH EC_GFp_simple_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_GFp_simple_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GROUP_copy.3 b/secure/lib/libcrypto/man/EC_GROUP_copy.3
index 7d3e2d9..3fdbfec 100644
--- a/secure/lib/libcrypto/man/EC_GROUP_copy.3
+++ b/secure/lib/libcrypto/man/EC_GROUP_copy.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GROUP_copy 3"
-.TH EC_GROUP_copy 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_GROUP_copy 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GROUP_new.3 b/secure/lib/libcrypto/man/EC_GROUP_new.3
index c3f225b..fe99e39 100644
--- a/secure/lib/libcrypto/man/EC_GROUP_new.3
+++ b/secure/lib/libcrypto/man/EC_GROUP_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GROUP_new 3"
-.TH EC_GROUP_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_GROUP_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_KEY_new.3 b/secure/lib/libcrypto/man/EC_KEY_new.3
index a3b5be5..f5a0dc5 100644
--- a/secure/lib/libcrypto/man/EC_KEY_new.3
+++ b/secure/lib/libcrypto/man/EC_KEY_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_KEY_new 3"
-.TH EC_KEY_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_KEY_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_POINT_add.3 b/secure/lib/libcrypto/man/EC_POINT_add.3
index 2ed896b..3aac9c7 100644
--- a/secure/lib/libcrypto/man/EC_POINT_add.3
+++ b/secure/lib/libcrypto/man/EC_POINT_add.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_POINT_add 3"
-.TH EC_POINT_add 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_POINT_add 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_POINT_new.3 b/secure/lib/libcrypto/man/EC_POINT_new.3
index a425156..c6c56d3 100644
--- a/secure/lib/libcrypto/man/EC_POINT_new.3
+++ b/secure/lib/libcrypto/man/EC_POINT_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_POINT_new 3"
-.TH EC_POINT_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC_POINT_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_GET_LIB.3 b/secure/lib/libcrypto/man/ERR_GET_LIB.3
index 8f48005..d254330 100644
--- a/secure/lib/libcrypto/man/ERR_GET_LIB.3
+++ b/secure/lib/libcrypto/man/ERR_GET_LIB.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_GET_LIB 3"
-.TH ERR_GET_LIB 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_GET_LIB 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_clear_error.3 b/secure/lib/libcrypto/man/ERR_clear_error.3
index 36fe425..ba9be8f 100644
--- a/secure/lib/libcrypto/man/ERR_clear_error.3
+++ b/secure/lib/libcrypto/man/ERR_clear_error.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_clear_error 3"
-.TH ERR_clear_error 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_clear_error 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_error_string.3 b/secure/lib/libcrypto/man/ERR_error_string.3
index 4d24b0a..bd86ec6 100644
--- a/secure/lib/libcrypto/man/ERR_error_string.3
+++ b/secure/lib/libcrypto/man/ERR_error_string.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_error_string 3"
-.TH ERR_error_string 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_error_string 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_get_error.3 b/secure/lib/libcrypto/man/ERR_get_error.3
index 3cdfb1d..e7fd852 100644
--- a/secure/lib/libcrypto/man/ERR_get_error.3
+++ b/secure/lib/libcrypto/man/ERR_get_error.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_get_error 3"
-.TH ERR_get_error 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_get_error 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
index 7662507..fd71b3a 100644
--- a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_crypto_strings 3"
-.TH ERR_load_crypto_strings 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_load_crypto_strings 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_strings.3 b/secure/lib/libcrypto/man/ERR_load_strings.3
index 6684b04..c0518ab 100644
--- a/secure/lib/libcrypto/man/ERR_load_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_strings.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_strings 3"
-.TH ERR_load_strings 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_load_strings 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_print_errors.3 b/secure/lib/libcrypto/man/ERR_print_errors.3
index 6baea0b..2756de3 100644
--- a/secure/lib/libcrypto/man/ERR_print_errors.3
+++ b/secure/lib/libcrypto/man/ERR_print_errors.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_print_errors 3"
-.TH ERR_print_errors 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_print_errors 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_put_error.3 b/secure/lib/libcrypto/man/ERR_put_error.3
index e4befad..283b234 100644
--- a/secure/lib/libcrypto/man/ERR_put_error.3
+++ b/secure/lib/libcrypto/man/ERR_put_error.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_put_error 3"
-.TH ERR_put_error 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_put_error 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_remove_state.3 b/secure/lib/libcrypto/man/ERR_remove_state.3
index 149fc8b..931ad34 100644
--- a/secure/lib/libcrypto/man/ERR_remove_state.3
+++ b/secure/lib/libcrypto/man/ERR_remove_state.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_remove_state 3"
-.TH ERR_remove_state 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_remove_state 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_set_mark.3 b/secure/lib/libcrypto/man/ERR_set_mark.3
index 6ef06fa..ee8eea7 100644
--- a/secure/lib/libcrypto/man/ERR_set_mark.3
+++ b/secure/lib/libcrypto/man/ERR_set_mark.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_set_mark 3"
-.TH ERR_set_mark 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERR_set_mark 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_BytesToKey.3 b/secure/lib/libcrypto/man/EVP_BytesToKey.3
index e8f7702..d98ff0c 100644
--- a/secure/lib/libcrypto/man/EVP_BytesToKey.3
+++ b/secure/lib/libcrypto/man/EVP_BytesToKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_BytesToKey 3"
-.TH EVP_BytesToKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_BytesToKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestInit.3 b/secure/lib/libcrypto/man/EVP_DigestInit.3
index fffd334..3a230d4 100644
--- a/secure/lib/libcrypto/man/EVP_DigestInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestInit 3"
-.TH EVP_DigestInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_DigestInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestSignInit.3 b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
index 73e8cdd..c3b79e2 100644
--- a/secure/lib/libcrypto/man/EVP_DigestSignInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestSignInit 3"
-.TH EVP_DigestSignInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_DigestSignInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
index 8df778e..88d9cb0 100644
--- a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestVerifyInit 3"
-.TH EVP_DigestVerifyInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_DigestVerifyInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_EncodeInit.3 b/secure/lib/libcrypto/man/EVP_EncodeInit.3
index c63d633..fe8b651 100644
--- a/secure/lib/libcrypto/man/EVP_EncodeInit.3
+++ b/secure/lib/libcrypto/man/EVP_EncodeInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_EncodeInit 3"
-.TH EVP_EncodeInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_EncodeInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_EncryptInit.3 b/secure/lib/libcrypto/man/EVP_EncryptInit.3
index d3f98e8..9bdf94f 100644
--- a/secure/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/secure/lib/libcrypto/man/EVP_EncryptInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_EncryptInit 3"
-.TH EVP_EncryptInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_EncryptInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_OpenInit.3 b/secure/lib/libcrypto/man/EVP_OpenInit.3
index f8cbfd9..a086537 100644
--- a/secure/lib/libcrypto/man/EVP_OpenInit.3
+++ b/secure/lib/libcrypto/man/EVP_OpenInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_OpenInit 3"
-.TH EVP_OpenInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_OpenInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
index 584cb5a..1c86987 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_ctrl 3"
-.TH EVP_PKEY_CTX_ctrl 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_CTX_ctrl 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
index 56c1e6f..22218e1 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_new 3"
-.TH EVP_PKEY_CTX_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_CTX_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
index 6d836b6..db2aeac 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_cmp 3"
-.TH EVP_PKEY_cmp 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_cmp 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
index bb788ec..89672b5 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_decrypt 3"
-.TH EVP_PKEY_decrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_decrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_derive.3 b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
index 9934edd..4b42be1 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_derive.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_derive 3"
-.TH EVP_PKEY_derive 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_derive 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
index 7fa0671..c0aefe9 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_encrypt 3"
-.TH EVP_PKEY_encrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_encrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
index a3790e8..24183f3 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_get_default_digest 3"
-.TH EVP_PKEY_get_default_digest 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_get_default_digest 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
index 843750b..4b43bfa 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_keygen 3"
-.TH EVP_PKEY_keygen 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_keygen 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_new.3
index 4887e17..39d40ff 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_new 3"
-.TH EVP_PKEY_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
index 03fb07d..931c70c 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_print_private 3"
-.TH EVP_PKEY_print_private 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_print_private 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
index 8794c20..8c704d1 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_set1_RSA 3"
-.TH EVP_PKEY_set1_RSA 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_set1_RSA 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_sign.3 b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
index 87344c5..669cc91 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_sign.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_sign 3"
-.TH EVP_PKEY_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
index 8eb5495..9f30810 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify 3"
-.TH EVP_PKEY_verify 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_verify 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
index c8b8f3b..dfe31f6 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify_recover 3"
-.TH EVP_PKEY_verify_recover 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_PKEY_verify_recover 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_SealInit.3 b/secure/lib/libcrypto/man/EVP_SealInit.3
index f54157e..142e07b 100644
--- a/secure/lib/libcrypto/man/EVP_SealInit.3
+++ b/secure/lib/libcrypto/man/EVP_SealInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_SealInit 3"
-.TH EVP_SealInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_SealInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_SignInit.3 b/secure/lib/libcrypto/man/EVP_SignInit.3
index 1cc2e62..37ca0bc 100644
--- a/secure/lib/libcrypto/man/EVP_SignInit.3
+++ b/secure/lib/libcrypto/man/EVP_SignInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_SignInit 3"
-.TH EVP_SignInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_SignInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_VerifyInit.3 b/secure/lib/libcrypto/man/EVP_VerifyInit.3
index 4743cfa..224be3d 100644
--- a/secure/lib/libcrypto/man/EVP_VerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_VerifyInit.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_VerifyInit 3"
-.TH EVP_VerifyInit 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EVP_VerifyInit 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OBJ_nid2obj.3 b/secure/lib/libcrypto/man/OBJ_nid2obj.3
index e95f3db..657c7da 100644
--- a/secure/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/secure/lib/libcrypto/man/OBJ_nid2obj.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OBJ_nid2obj 3"
-.TH OBJ_nid2obj 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OBJ_nid2obj 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_Applink.3 b/secure/lib/libcrypto/man/OPENSSL_Applink.3
index 5505727..8998c9d 100644
--- a/secure/lib/libcrypto/man/OPENSSL_Applink.3
+++ b/secure/lib/libcrypto/man/OPENSSL_Applink.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_Applink 3"
-.TH OPENSSL_Applink 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_Applink 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
index 49daff6..f6d62cb 100644
--- a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
+++ b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_VERSION_NUMBER 3"
-.TH OPENSSL_VERSION_NUMBER 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_VERSION_NUMBER 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_config.3 b/secure/lib/libcrypto/man/OPENSSL_config.3
index a78fc40..03bd803 100644
--- a/secure/lib/libcrypto/man/OPENSSL_config.3
+++ b/secure/lib/libcrypto/man/OPENSSL_config.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_config 3"
-.TH OPENSSL_config 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_config 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
index 5c1ea50..8f2a9c8 100644
--- a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
+++ b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_ia32cap 3"
-.TH OPENSSL_ia32cap 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_ia32cap 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 b/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
index 2ac44f6..24e2031 100644
--- a/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
+++ b/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_instrument_bus 3"
-.TH OPENSSL_instrument_bus 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_instrument_bus 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
index 0e3f215..9a9c088 100644
--- a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
+++ b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_load_builtin_modules 3"
-.TH OPENSSL_load_builtin_modules 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL_load_builtin_modules 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
index be5fc20..bcad101 100644
--- a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
+++ b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OpenSSL_add_all_algorithms 3"
-.TH OpenSSL_add_all_algorithms 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OpenSSL_add_all_algorithms 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
index 026ae12..6124239 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_CMS_stream 3"
-.TH PEM_write_bio_CMS_stream 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PEM_write_bio_CMS_stream 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
index c45fbbc..0f8fb49 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_PKCS7_stream 3"
-.TH PEM_write_bio_PKCS7_stream 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PEM_write_bio_PKCS7_stream 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_create.3 b/secure/lib/libcrypto/man/PKCS12_create.3
index 6bda8d2..4637298 100644
--- a/secure/lib/libcrypto/man/PKCS12_create.3
+++ b/secure/lib/libcrypto/man/PKCS12_create.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_create 3"
-.TH PKCS12_create 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS12_create 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_parse.3 b/secure/lib/libcrypto/man/PKCS12_parse.3
index 34418fb..900b3ad 100644
--- a/secure/lib/libcrypto/man/PKCS12_parse.3
+++ b/secure/lib/libcrypto/man/PKCS12_parse.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_parse 3"
-.TH PKCS12_parse 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS12_parse 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_decrypt.3 b/secure/lib/libcrypto/man/PKCS7_decrypt.3
index 418fe74..51691d8 100644
--- a/secure/lib/libcrypto/man/PKCS7_decrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_decrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_decrypt 3"
-.TH PKCS7_decrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7_decrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_encrypt.3 b/secure/lib/libcrypto/man/PKCS7_encrypt.3
index 9bcd924..ed41db6 100644
--- a/secure/lib/libcrypto/man/PKCS7_encrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_encrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_encrypt 3"
-.TH PKCS7_encrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7_encrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign.3 b/secure/lib/libcrypto/man/PKCS7_sign.3
index 503f67c..3fc0bd5 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign 3"
-.TH PKCS7_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
index 34ee516..ee6f154 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign_add_signer 3"
-.TH PKCS7_sign_add_signer 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7_sign_add_signer 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_verify.3 b/secure/lib/libcrypto/man/PKCS7_verify.3
index f9c4acf..f129da7 100644
--- a/secure/lib/libcrypto/man/PKCS7_verify.3
+++ b/secure/lib/libcrypto/man/PKCS7_verify.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_verify 3"
-.TH PKCS7_verify 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7_verify 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_add.3 b/secure/lib/libcrypto/man/RAND_add.3
index 9809e3f..06058d1 100644
--- a/secure/lib/libcrypto/man/RAND_add.3
+++ b/secure/lib/libcrypto/man/RAND_add.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_add 3"
-.TH RAND_add 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_add 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_bytes.3 b/secure/lib/libcrypto/man/RAND_bytes.3
index a067818..4375ca31 100644
--- a/secure/lib/libcrypto/man/RAND_bytes.3
+++ b/secure/lib/libcrypto/man/RAND_bytes.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_bytes 3"
-.TH RAND_bytes 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_bytes 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_cleanup.3 b/secure/lib/libcrypto/man/RAND_cleanup.3
index dbfa18d..68806f0 100644
--- a/secure/lib/libcrypto/man/RAND_cleanup.3
+++ b/secure/lib/libcrypto/man/RAND_cleanup.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_cleanup 3"
-.TH RAND_cleanup 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_cleanup 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_egd.3 b/secure/lib/libcrypto/man/RAND_egd.3
index 0e70816..31f6f7b 100644
--- a/secure/lib/libcrypto/man/RAND_egd.3
+++ b/secure/lib/libcrypto/man/RAND_egd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_egd 3"
-.TH RAND_egd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_egd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_load_file.3 b/secure/lib/libcrypto/man/RAND_load_file.3
index ce10819..fd681c8 100644
--- a/secure/lib/libcrypto/man/RAND_load_file.3
+++ b/secure/lib/libcrypto/man/RAND_load_file.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_load_file 3"
-.TH RAND_load_file 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_load_file 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_set_rand_method.3 b/secure/lib/libcrypto/man/RAND_set_rand_method.3
index b162736..d0fa72f 100644
--- a/secure/lib/libcrypto/man/RAND_set_rand_method.3
+++ b/secure/lib/libcrypto/man/RAND_set_rand_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_set_rand_method 3"
-.TH RAND_set_rand_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND_set_rand_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_blinding_on.3 b/secure/lib/libcrypto/man/RSA_blinding_on.3
index d2c2070..d5ff5e6 100644
--- a/secure/lib/libcrypto/man/RSA_blinding_on.3
+++ b/secure/lib/libcrypto/man/RSA_blinding_on.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_blinding_on 3"
-.TH RSA_blinding_on 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_blinding_on 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_check_key.3 b/secure/lib/libcrypto/man/RSA_check_key.3
index a0faa9c..1000adc 100644
--- a/secure/lib/libcrypto/man/RSA_check_key.3
+++ b/secure/lib/libcrypto/man/RSA_check_key.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_check_key 3"
-.TH RSA_check_key 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_check_key 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_generate_key.3 b/secure/lib/libcrypto/man/RSA_generate_key.3
index dc20a29..3bea9a9 100644
--- a/secure/lib/libcrypto/man/RSA_generate_key.3
+++ b/secure/lib/libcrypto/man/RSA_generate_key.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_generate_key 3"
-.TH RSA_generate_key 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_generate_key 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
index a5be4f1..5c9027f 100644
--- a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_get_ex_new_index 3"
-.TH RSA_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_new.3 b/secure/lib/libcrypto/man/RSA_new.3
index ddbdcaf..542e0e0 100644
--- a/secure/lib/libcrypto/man/RSA_new.3
+++ b/secure/lib/libcrypto/man/RSA_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_new 3"
-.TH RSA_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
index 6200969..5393645 100644
--- a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
+++ b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_padding_add_PKCS1_type_1 3"
-.TH RSA_padding_add_PKCS1_type_1 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_padding_add_PKCS1_type_1 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_print.3 b/secure/lib/libcrypto/man/RSA_print.3
index 90e7ec5..3aa6d68 100644
--- a/secure/lib/libcrypto/man/RSA_print.3
+++ b/secure/lib/libcrypto/man/RSA_print.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_print 3"
-.TH RSA_print 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_print 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_private_encrypt.3 b/secure/lib/libcrypto/man/RSA_private_encrypt.3
index 95e1023..6ac7e1d 100644
--- a/secure/lib/libcrypto/man/RSA_private_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_private_encrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_private_encrypt 3"
-.TH RSA_private_encrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_private_encrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_public_encrypt.3 b/secure/lib/libcrypto/man/RSA_public_encrypt.3
index c46869b..206004a 100644
--- a/secure/lib/libcrypto/man/RSA_public_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_public_encrypt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_public_encrypt 3"
-.TH RSA_public_encrypt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_public_encrypt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_set_method.3 b/secure/lib/libcrypto/man/RSA_set_method.3
index 550218d..adc239d 100644
--- a/secure/lib/libcrypto/man/RSA_set_method.3
+++ b/secure/lib/libcrypto/man/RSA_set_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_set_method 3"
-.TH RSA_set_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_set_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign.3 b/secure/lib/libcrypto/man/RSA_sign.3
index 527ed8d..b7321b8 100644
--- a/secure/lib/libcrypto/man/RSA_sign.3
+++ b/secure/lib/libcrypto/man/RSA_sign.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign 3"
-.TH RSA_sign 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_sign 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
index a587ce0..567ce05 100644
--- a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
+++ b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign_ASN1_OCTET_STRING 3"
-.TH RSA_sign_ASN1_OCTET_STRING 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_sign_ASN1_OCTET_STRING 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_size.3 b/secure/lib/libcrypto/man/RSA_size.3
index 8598f68..4975d1d 100644
--- a/secure/lib/libcrypto/man/RSA_size.3
+++ b/secure/lib/libcrypto/man/RSA_size.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_size 3"
-.TH RSA_size 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA_size 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_CMS.3 b/secure/lib/libcrypto/man/SMIME_read_CMS.3
index 9a56462..1dacdd1 100644
--- a/secure/lib/libcrypto/man/SMIME_read_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_read_CMS.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_CMS 3"
-.TH SMIME_read_CMS 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SMIME_read_CMS 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
index 229b209..ef20419 100644
--- a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_PKCS7 3"
-.TH SMIME_read_PKCS7 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SMIME_read_PKCS7 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_CMS.3 b/secure/lib/libcrypto/man/SMIME_write_CMS.3
index 8c9b981..e5201b4 100644
--- a/secure/lib/libcrypto/man/SMIME_write_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_write_CMS.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_CMS 3"
-.TH SMIME_write_CMS 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SMIME_write_CMS 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
index 13ee603..005600b 100644
--- a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_PKCS7 3"
-.TH SMIME_write_PKCS7 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SMIME_write_PKCS7 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
index 0486e81..754a2e5 100644
--- a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
+++ b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_ENTRY_get_object 3"
-.TH X509_NAME_ENTRY_get_object 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_NAME_ENTRY_get_object 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
index 1cdd302..3530f74 100644
--- a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
+++ b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_add_entry_by_txt 3"
-.TH X509_NAME_add_entry_by_txt 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_NAME_add_entry_by_txt 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
index 3ac6c1d..4b47e78 100644
--- a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
+++ b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_get_index_by_NID 3"
-.TH X509_NAME_get_index_by_NID 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_NAME_get_index_by_NID 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_print_ex.3 b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
index e69d878..9e4e212 100644
--- a/secure/lib/libcrypto/man/X509_NAME_print_ex.3
+++ b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_print_ex 3"
-.TH X509_NAME_print_ex 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_NAME_print_ex 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
index 2bed249..89a1b05 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_error 3"
-.TH X509_STORE_CTX_get_error 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_STORE_CTX_get_error 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
index c8c8831..9161174 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_ex_new_index 3"
-.TH X509_STORE_CTX_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_STORE_CTX_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
index bdb1bd2..491450e 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_new 3"
-.TH X509_STORE_CTX_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_STORE_CTX_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
index 1064755..d27642f 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_set_verify_cb 3"
-.TH X509_STORE_CTX_set_verify_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_STORE_CTX_set_verify_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
index 8ad600e..c567533 100644
--- a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
+++ b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_set_verify_cb_func 3"
-.TH X509_STORE_set_verify_cb_func 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_STORE_set_verify_cb_func 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index cb0c503..40fd977 100644
--- a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_VERIFY_PARAM_set_flags 3"
-.TH X509_VERIFY_PARAM_set_flags 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_VERIFY_PARAM_set_flags 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_check_host.3 b/secure/lib/libcrypto/man/X509_check_host.3
index afb35c5..864e3a7 100644
--- a/secure/lib/libcrypto/man/X509_check_host.3
+++ b/secure/lib/libcrypto/man/X509_check_host.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_check_host 3"
-.TH X509_check_host 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_check_host 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_new.3 b/secure/lib/libcrypto/man/X509_new.3
index b829e09..5ef09a7 100644
--- a/secure/lib/libcrypto/man/X509_new.3
+++ b/secure/lib/libcrypto/man/X509_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_new 3"
-.TH X509_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_verify_cert.3 b/secure/lib/libcrypto/man/X509_verify_cert.3
index 864e1ab..a7fe51c 100644
--- a/secure/lib/libcrypto/man/X509_verify_cert.3
+++ b/secure/lib/libcrypto/man/X509_verify_cert.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_verify_cert 3"
-.TH X509_verify_cert 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509_verify_cert 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bio.3 b/secure/lib/libcrypto/man/bio.3
index 2074cac..ae4aea5 100644
--- a/secure/lib/libcrypto/man/bio.3
+++ b/secure/lib/libcrypto/man/bio.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bio 3"
-.TH bio 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH bio 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/blowfish.3 b/secure/lib/libcrypto/man/blowfish.3
index aa5b8f7..a44fec2 100644
--- a/secure/lib/libcrypto/man/blowfish.3
+++ b/secure/lib/libcrypto/man/blowfish.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "blowfish 3"
-.TH blowfish 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH blowfish 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn.3 b/secure/lib/libcrypto/man/bn.3
index 1bc3380..fcc2b4c 100644
--- a/secure/lib/libcrypto/man/bn.3
+++ b/secure/lib/libcrypto/man/bn.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn 3"
-.TH bn 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH bn 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn_internal.3 b/secure/lib/libcrypto/man/bn_internal.3
index b6bfc91..76f0a80 100644
--- a/secure/lib/libcrypto/man/bn_internal.3
+++ b/secure/lib/libcrypto/man/bn_internal.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn_internal 3"
-.TH bn_internal 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH bn_internal 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/buffer.3 b/secure/lib/libcrypto/man/buffer.3
index 499ca39..4a7598c 100644
--- a/secure/lib/libcrypto/man/buffer.3
+++ b/secure/lib/libcrypto/man/buffer.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "buffer 3"
-.TH buffer 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH buffer 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/crypto.3 b/secure/lib/libcrypto/man/crypto.3
index 0be252c..6a393d9 100644
--- a/secure/lib/libcrypto/man/crypto.3
+++ b/secure/lib/libcrypto/man/crypto.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "crypto 3"
-.TH crypto 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH crypto 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
index d9f6214..7fcbb7b 100644
--- a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
+++ b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ASN1_OBJECT 3"
-.TH d2i_ASN1_OBJECT 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_ASN1_OBJECT 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
index 2123e2f..9e2175b 100644
--- a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
+++ b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_CMS_ContentInfo 3"
-.TH d2i_CMS_ContentInfo 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_CMS_ContentInfo 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DHparams.3 b/secure/lib/libcrypto/man/d2i_DHparams.3
index e4152d0..0715b13 100644
--- a/secure/lib/libcrypto/man/d2i_DHparams.3
+++ b/secure/lib/libcrypto/man/d2i_DHparams.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DHparams 3"
-.TH d2i_DHparams 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_DHparams 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
index 753506f..ac1142a 100644
--- a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DSAPublicKey 3"
-.TH d2i_DSAPublicKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_DSAPublicKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ECPKParameters.3 b/secure/lib/libcrypto/man/d2i_ECPKParameters.3
index 6beead1..1e12c614 100644
--- a/secure/lib/libcrypto/man/d2i_ECPKParameters.3
+++ b/secure/lib/libcrypto/man/d2i_ECPKParameters.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ECPKParameters 3"
-.TH d2i_ECPKParameters 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_ECPKParameters 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
index a275fe7..69a66ff 100644
--- a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ECPrivateKey 3"
-.TH d2i_ECPrivateKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_ECPrivateKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
index 71891ad..28a879b 100644
--- a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_PKCS8PrivateKey 3"
-.TH d2i_PKCS8PrivateKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_PKCS8PrivateKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_PrivateKey.3 b/secure/lib/libcrypto/man/d2i_PrivateKey.3
index 80423ad..bdc6490 100644
--- a/secure/lib/libcrypto/man/d2i_PrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_PrivateKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_PrivateKey 3"
-.TH d2i_PrivateKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_PrivateKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
index b293ac8..a8620a8 100644
--- a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_RSAPublicKey 3"
-.TH d2i_RSAPublicKey 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_RSAPublicKey 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509.3 b/secure/lib/libcrypto/man/d2i_X509.3
index ba77425..6e61974 100644
--- a/secure/lib/libcrypto/man/d2i_X509.3
+++ b/secure/lib/libcrypto/man/d2i_X509.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509 3"
-.TH d2i_X509 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
index f7c99f3..725b2f0 100644
--- a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
+++ b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_ALGOR 3"
-.TH d2i_X509_ALGOR 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509_ALGOR 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_CRL.3 b/secure/lib/libcrypto/man/d2i_X509_CRL.3
index 82a5fca..5a43040 100644
--- a/secure/lib/libcrypto/man/d2i_X509_CRL.3
+++ b/secure/lib/libcrypto/man/d2i_X509_CRL.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_CRL 3"
-.TH d2i_X509_CRL 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509_CRL 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_NAME.3 b/secure/lib/libcrypto/man/d2i_X509_NAME.3
index 89a08d4..2911ca1 100644
--- a/secure/lib/libcrypto/man/d2i_X509_NAME.3
+++ b/secure/lib/libcrypto/man/d2i_X509_NAME.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_NAME 3"
-.TH d2i_X509_NAME 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509_NAME 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_REQ.3 b/secure/lib/libcrypto/man/d2i_X509_REQ.3
index 1817254..8ede938 100644
--- a/secure/lib/libcrypto/man/d2i_X509_REQ.3
+++ b/secure/lib/libcrypto/man/d2i_X509_REQ.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_REQ 3"
-.TH d2i_X509_REQ 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509_REQ 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_SIG.3 b/secure/lib/libcrypto/man/d2i_X509_SIG.3
index 72ab9db..2a05751 100644
--- a/secure/lib/libcrypto/man/d2i_X509_SIG.3
+++ b/secure/lib/libcrypto/man/d2i_X509_SIG.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_SIG 3"
-.TH d2i_X509_SIG 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_X509_SIG 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/des.3 b/secure/lib/libcrypto/man/des.3
index 757fb5e..035d566 100644
--- a/secure/lib/libcrypto/man/des.3
+++ b/secure/lib/libcrypto/man/des.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "des 3"
-.TH des 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH des 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dh.3 b/secure/lib/libcrypto/man/dh.3
index 03b6fc5..695a992 100644
--- a/secure/lib/libcrypto/man/dh.3
+++ b/secure/lib/libcrypto/man/dh.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dh 3"
-.TH dh 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH dh 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dsa.3 b/secure/lib/libcrypto/man/dsa.3
index 49d536f..94a5659 100644
--- a/secure/lib/libcrypto/man/dsa.3
+++ b/secure/lib/libcrypto/man/dsa.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dsa 3"
-.TH dsa 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH dsa 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ec.3 b/secure/lib/libcrypto/man/ec.3
index a6e0acd..3b1a619 100644
--- a/secure/lib/libcrypto/man/ec.3
+++ b/secure/lib/libcrypto/man/ec.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ec 3"
-.TH ec 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ec 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ecdsa.3 b/secure/lib/libcrypto/man/ecdsa.3
index 95b3c55..debcf1b 100644
--- a/secure/lib/libcrypto/man/ecdsa.3
+++ b/secure/lib/libcrypto/man/ecdsa.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ecdsa 3"
-.TH ecdsa 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ecdsa 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/engine.3 b/secure/lib/libcrypto/man/engine.3
index 50d2e8a..6bf6fa0 100644
--- a/secure/lib/libcrypto/man/engine.3
+++ b/secure/lib/libcrypto/man/engine.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "engine 3"
-.TH engine 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH engine 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/err.3 b/secure/lib/libcrypto/man/err.3
index a4b13c6..fb3e5e8 100644
--- a/secure/lib/libcrypto/man/err.3
+++ b/secure/lib/libcrypto/man/err.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "err 3"
-.TH err 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH err 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/evp.3 b/secure/lib/libcrypto/man/evp.3
index 327c970..d9986d6 100644
--- a/secure/lib/libcrypto/man/evp.3
+++ b/secure/lib/libcrypto/man/evp.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "evp 3"
-.TH evp 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH evp 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/hmac.3 b/secure/lib/libcrypto/man/hmac.3
index cd71e7d..2db9d34 100644
--- a/secure/lib/libcrypto/man/hmac.3
+++ b/secure/lib/libcrypto/man/hmac.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "hmac 3"
-.TH hmac 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH hmac 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
index 04c065a..487782a 100644
--- a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_CMS_bio_stream 3"
-.TH i2d_CMS_bio_stream 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH i2d_CMS_bio_stream 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
index 2503258..7f8b67a 100644
--- a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_PKCS7_bio_stream 3"
-.TH i2d_PKCS7_bio_stream 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH i2d_PKCS7_bio_stream 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lh_stats.3 b/secure/lib/libcrypto/man/lh_stats.3
index 444394e..efb5154 100644
--- a/secure/lib/libcrypto/man/lh_stats.3
+++ b/secure/lib/libcrypto/man/lh_stats.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lh_stats 3"
-.TH lh_stats 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH lh_stats 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lhash.3 b/secure/lib/libcrypto/man/lhash.3
index 06d1237..5f9e36d 100644
--- a/secure/lib/libcrypto/man/lhash.3
+++ b/secure/lib/libcrypto/man/lhash.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lhash 3"
-.TH lhash 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH lhash 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/md5.3 b/secure/lib/libcrypto/man/md5.3
index bb9ff53..58241b9 100644
--- a/secure/lib/libcrypto/man/md5.3
+++ b/secure/lib/libcrypto/man/md5.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "md5 3"
-.TH md5 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH md5 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/mdc2.3 b/secure/lib/libcrypto/man/mdc2.3
index 216c60c..a2e9687 100644
--- a/secure/lib/libcrypto/man/mdc2.3
+++ b/secure/lib/libcrypto/man/mdc2.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "mdc2 3"
-.TH mdc2 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH mdc2 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/pem.3 b/secure/lib/libcrypto/man/pem.3
index 48dbf22..7b6f295 100644
--- a/secure/lib/libcrypto/man/pem.3
+++ b/secure/lib/libcrypto/man/pem.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "pem 3"
-.TH pem 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH pem 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rand.3 b/secure/lib/libcrypto/man/rand.3
index 2d741ef..2ee5593 100644
--- a/secure/lib/libcrypto/man/rand.3
+++ b/secure/lib/libcrypto/man/rand.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rand 3"
-.TH rand 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH rand 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rc4.3 b/secure/lib/libcrypto/man/rc4.3
index ee9f915..c3f122f 100644
--- a/secure/lib/libcrypto/man/rc4.3
+++ b/secure/lib/libcrypto/man/rc4.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rc4 3"
-.TH rc4 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH rc4 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ripemd.3 b/secure/lib/libcrypto/man/ripemd.3
index 112c9fe..e900d3a 100644
--- a/secure/lib/libcrypto/man/ripemd.3
+++ b/secure/lib/libcrypto/man/ripemd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ripemd 3"
-.TH ripemd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ripemd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rsa.3 b/secure/lib/libcrypto/man/rsa.3
index 276f553..6b10c2c 100644
--- a/secure/lib/libcrypto/man/rsa.3
+++ b/secure/lib/libcrypto/man/rsa.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rsa 3"
-.TH rsa 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH rsa 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/sha.3 b/secure/lib/libcrypto/man/sha.3
index d4f1a5e..10181df 100644
--- a/secure/lib/libcrypto/man/sha.3
+++ b/secure/lib/libcrypto/man/sha.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "sha 3"
-.TH sha 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH sha 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/threads.3 b/secure/lib/libcrypto/man/threads.3
index 75e2b75..213cf7a 100644
--- a/secure/lib/libcrypto/man/threads.3
+++ b/secure/lib/libcrypto/man/threads.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "threads 3"
-.TH threads 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH threads 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui.3 b/secure/lib/libcrypto/man/ui.3
index b19e28e..888f531 100644
--- a/secure/lib/libcrypto/man/ui.3
+++ b/secure/lib/libcrypto/man/ui.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui 3"
-.TH ui 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ui 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui_compat.3 b/secure/lib/libcrypto/man/ui_compat.3
index 88879b8..aafbfab 100644
--- a/secure/lib/libcrypto/man/ui_compat.3
+++ b/secure/lib/libcrypto/man/ui_compat.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui_compat 3"
-.TH ui_compat 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ui_compat 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/x509.3 b/secure/lib/libcrypto/man/x509.3
index c282114..eb88385 100644
--- a/secure/lib/libcrypto/man/x509.3
+++ b/secure/lib/libcrypto/man/x509.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "x509 3"
-.TH x509 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH x509 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CIPHER_get_name.3 b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
index 95c0d1f..ae4e7df 100644
--- a/secure/lib/libssl/man/SSL_CIPHER_get_name.3
+++ b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CIPHER_get_name 3"
-.TH SSL_CIPHER_get_name 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CIPHER_get_name 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
index 03e4c8a..4a06bd5 100644
--- a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
+++ b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_COMP_add_compression_method 3"
-.TH SSL_COMP_add_compression_method 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_COMP_add_compression_method 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_new.3 b/secure/lib/libssl/man/SSL_CONF_CTX_new.3
index fd9ab18..f2ca9da 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_new.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_new 3"
-.TH SSL_CONF_CTX_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_CTX_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
index c4c58bd..bbb9098 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set1_prefix 3"
-.TH SSL_CONF_CTX_set1_prefix 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_CTX_set1_prefix 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
index 165a058..613220e 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set_flags 3"
-.TH SSL_CONF_CTX_set_flags 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_CTX_set_flags 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
index cc9b896..d904bdf 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set_ssl_ctx 3"
-.TH SSL_CONF_CTX_set_ssl_ctx 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_CTX_set_ssl_ctx 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_cmd.3 b/secure/lib/libssl/man/SSL_CONF_cmd.3
index 34b447c..199e4e0 100644
--- a/secure/lib/libssl/man/SSL_CONF_cmd.3
+++ b/secure/lib/libssl/man/SSL_CONF_cmd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_cmd 3"
-.TH SSL_CONF_cmd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_cmd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 b/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
index 013c590..567f65a 100644
--- a/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
+++ b/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_cmd_argv 3"
-.TH SSL_CONF_cmd_argv 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CONF_cmd_argv 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 b/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
index 59b7b16..edb29e1 100644
--- a/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
+++ b/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add1_chain_cert 3"
-.TH SSL_CTX_add1_chain_cert 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_add1_chain_cert 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
index a29cb79..c24bd7f 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_extra_chain_cert 3"
-.TH SSL_CTX_add_extra_chain_cert 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_add_extra_chain_cert 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add_session.3 b/secure/lib/libssl/man/SSL_CTX_add_session.3
index 8367538..3e64db3 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_session.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_session.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_session 3"
-.TH SSL_CTX_add_session 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_add_session 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_ctrl.3 b/secure/lib/libssl/man/SSL_CTX_ctrl.3
index 7da3853..8dabd6f 100644
--- a/secure/lib/libssl/man/SSL_CTX_ctrl.3
+++ b/secure/lib/libssl/man/SSL_CTX_ctrl.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_ctrl 3"
-.TH SSL_CTX_ctrl 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_ctrl 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
index a055a1a..fb2560f 100644
--- a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_flush_sessions 3"
-.TH SSL_CTX_flush_sessions 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_flush_sessions 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_free.3 b/secure/lib/libssl/man/SSL_CTX_free.3
index ea5d96b..6662cd2 100644
--- a/secure/lib/libssl/man/SSL_CTX_free.3
+++ b/secure/lib/libssl/man/SSL_CTX_free.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_free 3"
-.TH SSL_CTX_free 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_free 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get0_param.3 b/secure/lib/libssl/man/SSL_CTX_get0_param.3
index 9a20d4f..5452724 100644
--- a/secure/lib/libssl/man/SSL_CTX_get0_param.3
+++ b/secure/lib/libssl/man/SSL_CTX_get0_param.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get0_param 3"
-.TH SSL_CTX_get0_param 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_get0_param 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
index f920657..c8e806e 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_ex_new_index 3"
-.TH SSL_CTX_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
index af08998..1a8cbae 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_verify_mode 3"
-.TH SSL_CTX_get_verify_mode 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_get_verify_mode 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
index 5e4863d..4f64fe2 100644
--- a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
+++ b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_load_verify_locations 3"
-.TH SSL_CTX_load_verify_locations 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_load_verify_locations 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_new.3 b/secure/lib/libssl/man/SSL_CTX_new.3
index 78d94c8..1699cd8 100644
--- a/secure/lib/libssl/man/SSL_CTX_new.3
+++ b/secure/lib/libssl/man/SSL_CTX_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_new 3"
-.TH SSL_CTX_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_number.3 b/secure/lib/libssl/man/SSL_CTX_sess_number.3
index 574fe2a..27269b3 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_number.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_number.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_number 3"
-.TH SSL_CTX_sess_number 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_sess_number 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
index 51827b6..2a386a8 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_cache_size 3"
-.TH SSL_CTX_sess_set_cache_size 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_sess_set_cache_size 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
index 4d727f4..241a20f 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_get_cb 3"
-.TH SSL_CTX_sess_set_get_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_sess_set_get_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sessions.3 b/secure/lib/libssl/man/SSL_CTX_sessions.3
index 5081e54..19bdb01 100644
--- a/secure/lib/libssl/man/SSL_CTX_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_sessions.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sessions 3"
-.TH SSL_CTX_sessions 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_sessions 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set1_curves.3 b/secure/lib/libssl/man/SSL_CTX_set1_curves.3
index 8c24662..1cffb26 100644
--- a/secure/lib/libssl/man/SSL_CTX_set1_curves.3
+++ b/secure/lib/libssl/man/SSL_CTX_set1_curves.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set1_curves 3"
-.TH SSL_CTX_set1_curves 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set1_curves 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 b/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
index afe656f..3620505 100644
--- a/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
+++ b/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set1_verify_cert_store 3"
-.TH SSL_CTX_set1_verify_cert_store 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set1_verify_cert_store 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
index bdcc488..6263444 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_alpn_select_cb 3"
-.TH SSL_CTX_set_alpn_select_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_alpn_select_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
index e1207d0..0dc5e59 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_cb 3"
-.TH SSL_CTX_set_cert_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_cert_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
index a280c64..c612e2d 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_store 3"
-.TH SSL_CTX_set_cert_store 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_cert_store 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
index 3f3b963..474477d 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_verify_callback 3"
-.TH SSL_CTX_set_cert_verify_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_cert_verify_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
index 701b694..dea914a 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cipher_list 3"
-.TH SSL_CTX_set_cipher_list 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_cipher_list 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
index 227dbaa..87fb6a7 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_CA_list 3"
-.TH SSL_CTX_set_client_CA_list 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_client_CA_list 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
index cf38037..505518e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_cert_cb 3"
-.TH SSL_CTX_set_client_cert_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_client_cert_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 b/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
index 32f2cb2..810709b 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_custom_cli_ext 3"
-.TH SSL_CTX_set_custom_cli_ext 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_custom_cli_ext 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
index 63e87c8..1660ed6 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_default_passwd_cb 3"
-.TH SSL_CTX_set_default_passwd_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_default_passwd_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
index 8bfc1c4..e082922 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_generate_session_id 3"
-.TH SSL_CTX_set_generate_session_id 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_generate_session_id 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
index 10f441a..5eafbe5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_info_callback 3"
-.TH SSL_CTX_set_info_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_info_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
index ba7d3e0..9c96887 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_max_cert_list 3"
-.TH SSL_CTX_set_max_cert_list 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_max_cert_list 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_mode.3
index 2796358..87a6a85 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_mode.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_mode 3"
-.TH SSL_CTX_set_mode 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_mode 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
index a6a30f9..abf6397 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_msg_callback 3"
-.TH SSL_CTX_set_msg_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_msg_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_options.3 b/secure/lib/libssl/man/SSL_CTX_set_options.3
index 43008b2..3099ff5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_options.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_options.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_options 3"
-.TH SSL_CTX_set_options 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_options 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
index b847b3a..3be80a9 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_psk_client_callback 3"
-.TH SSL_CTX_set_psk_client_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_psk_client_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
index 50f4d0e..c509f67 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_quiet_shutdown 3"
-.TH SSL_CTX_set_quiet_shutdown 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_quiet_shutdown 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
index 8a6a044..fff30a5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_read_ahead 3"
-.TH SSL_CTX_set_read_ahead 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_read_ahead 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
index aa3004b..d3e2862 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_cache_mode 3"
-.TH SSL_CTX_set_session_cache_mode 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_session_cache_mode 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
index 46f2a40..8a4a20e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_id_context 3"
-.TH SSL_CTX_set_session_id_context 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_session_id_context 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
index 3609726..a02fd82 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_ssl_version 3"
-.TH SSL_CTX_set_ssl_version 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_ssl_version 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_timeout.3 b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
index 259b7a2..73591b5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_timeout.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_timeout 3"
-.TH SSL_CTX_set_timeout 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_timeout 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
index e79ab64..606e080 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tlsext_status_cb 3"
-.TH SSL_CTX_set_tlsext_status_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_tlsext_status_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
index d228d34..2435561 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tlsext_ticket_key_cb 3"
-.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
index ddd968e..59077ad 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_dh_callback 3"
-.TH SSL_CTX_set_tmp_dh_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_tmp_dh_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
index cedeaab..a023752 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_rsa_callback 3"
-.TH SSL_CTX_set_tmp_rsa_callback 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_tmp_rsa_callback 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_verify.3 b/secure/lib/libssl/man/SSL_CTX_set_verify.3
index 0df23db..8056cea 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_verify.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_verify.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_verify 3"
-.TH SSL_CTX_set_verify 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_set_verify 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_certificate.3 b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
index bf6384e..5cb56b0 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_certificate.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_certificate 3"
-.TH SSL_CTX_use_certificate 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_use_certificate 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
index cb881e4..2167891 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_psk_identity_hint 3"
-.TH SSL_CTX_use_psk_identity_hint 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_use_psk_identity_hint 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 b/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
index 33b76bf..5cdc821 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_serverinfo 3"
-.TH SSL_CTX_use_serverinfo 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_CTX_use_serverinfo 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_free.3 b/secure/lib/libssl/man/SSL_SESSION_free.3
index 4ecc36f..dcc4588 100644
--- a/secure/lib/libssl/man/SSL_SESSION_free.3
+++ b/secure/lib/libssl/man/SSL_SESSION_free.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_free 3"
-.TH SSL_SESSION_free 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_SESSION_free 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
index edcc38d..6393778 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_ex_new_index 3"
-.TH SSL_SESSION_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_SESSION_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_time.3 b/secure/lib/libssl/man/SSL_SESSION_get_time.3
index 914a2c4..dc796d2 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_time.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_time.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_time 3"
-.TH SSL_SESSION_get_time 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_SESSION_get_time 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_accept.3 b/secure/lib/libssl/man/SSL_accept.3
index 0d69ebf..9e10122 100644
--- a/secure/lib/libssl/man/SSL_accept.3
+++ b/secure/lib/libssl/man/SSL_accept.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_accept 3"
-.TH SSL_accept 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_accept 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_alert_type_string.3 b/secure/lib/libssl/man/SSL_alert_type_string.3
index fd0c0c6..d89233e 100644
--- a/secure/lib/libssl/man/SSL_alert_type_string.3
+++ b/secure/lib/libssl/man/SSL_alert_type_string.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_alert_type_string 3"
-.TH SSL_alert_type_string 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_alert_type_string 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_check_chain.3 b/secure/lib/libssl/man/SSL_check_chain.3
index b2ed8c3..022f5dd 100644
--- a/secure/lib/libssl/man/SSL_check_chain.3
+++ b/secure/lib/libssl/man/SSL_check_chain.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_check_chain 3"
-.TH SSL_check_chain 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_check_chain 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_clear.3 b/secure/lib/libssl/man/SSL_clear.3
index 4426ef6..1b70bbf 100644
--- a/secure/lib/libssl/man/SSL_clear.3
+++ b/secure/lib/libssl/man/SSL_clear.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_clear 3"
-.TH SSL_clear 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_clear 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_connect.3 b/secure/lib/libssl/man/SSL_connect.3
index 4e05eb1..e5a760e 100644
--- a/secure/lib/libssl/man/SSL_connect.3
+++ b/secure/lib/libssl/man/SSL_connect.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_connect 3"
-.TH SSL_connect 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_connect 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_do_handshake.3 b/secure/lib/libssl/man/SSL_do_handshake.3
index 8339391..28879cf 100644
--- a/secure/lib/libssl/man/SSL_do_handshake.3
+++ b/secure/lib/libssl/man/SSL_do_handshake.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_do_handshake 3"
-.TH SSL_do_handshake 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_do_handshake 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_free.3 b/secure/lib/libssl/man/SSL_free.3
index 7792fa7..4fea22a 100644
--- a/secure/lib/libssl/man/SSL_free.3
+++ b/secure/lib/libssl/man/SSL_free.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_free 3"
-.TH SSL_free 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_free 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_SSL_CTX.3 b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
index 4d5b789..384f3e5 100644
--- a/secure/lib/libssl/man/SSL_get_SSL_CTX.3
+++ b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_SSL_CTX 3"
-.TH SSL_get_SSL_CTX 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_SSL_CTX 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ciphers.3 b/secure/lib/libssl/man/SSL_get_ciphers.3
index 701e3b5..cfeb686 100644
--- a/secure/lib/libssl/man/SSL_get_ciphers.3
+++ b/secure/lib/libssl/man/SSL_get_ciphers.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ciphers 3"
-.TH SSL_get_ciphers 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_ciphers 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_client_CA_list.3 b/secure/lib/libssl/man/SSL_get_client_CA_list.3
index 60c3e49..d04fe45 100644
--- a/secure/lib/libssl/man/SSL_get_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_get_client_CA_list.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_client_CA_list 3"
-.TH SSL_get_client_CA_list 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_client_CA_list 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_current_cipher.3 b/secure/lib/libssl/man/SSL_get_current_cipher.3
index 3233903..e37416d 100644
--- a/secure/lib/libssl/man/SSL_get_current_cipher.3
+++ b/secure/lib/libssl/man/SSL_get_current_cipher.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_current_cipher 3"
-.TH SSL_get_current_cipher 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_current_cipher 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_default_timeout.3 b/secure/lib/libssl/man/SSL_get_default_timeout.3
index 9837bdd..c21481c 100644
--- a/secure/lib/libssl/man/SSL_get_default_timeout.3
+++ b/secure/lib/libssl/man/SSL_get_default_timeout.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_default_timeout 3"
-.TH SSL_get_default_timeout 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_default_timeout 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_error.3 b/secure/lib/libssl/man/SSL_get_error.3
index 54588fc..bfef89e 100644
--- a/secure/lib/libssl/man/SSL_get_error.3
+++ b/secure/lib/libssl/man/SSL_get_error.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_error 3"
-.TH SSL_get_error 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_error 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
index 3de44fc..86bb3dc 100644
--- a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
+++ b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_data_X509_STORE_CTX_idx 3"
-.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_get_ex_new_index.3
index e55b50e..5b2ff61 100644
--- a/secure/lib/libssl/man/SSL_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_get_ex_new_index.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_new_index 3"
-.TH SSL_get_ex_new_index 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_ex_new_index 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_fd.3 b/secure/lib/libssl/man/SSL_get_fd.3
index bb763e3..46f2f4f 100644
--- a/secure/lib/libssl/man/SSL_get_fd.3
+++ b/secure/lib/libssl/man/SSL_get_fd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_fd 3"
-.TH SSL_get_fd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_fd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
index b6c2520..758bce1 100644
--- a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
+++ b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_cert_chain 3"
-.TH SSL_get_peer_cert_chain 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_peer_cert_chain 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_certificate.3 b/secure/lib/libssl/man/SSL_get_peer_certificate.3
index 4f79206..9ec0ae5 100644
--- a/secure/lib/libssl/man/SSL_get_peer_certificate.3
+++ b/secure/lib/libssl/man/SSL_get_peer_certificate.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_certificate 3"
-.TH SSL_get_peer_certificate 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_peer_certificate 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_psk_identity.3 b/secure/lib/libssl/man/SSL_get_psk_identity.3
index f541c29..5e70339 100644
--- a/secure/lib/libssl/man/SSL_get_psk_identity.3
+++ b/secure/lib/libssl/man/SSL_get_psk_identity.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_psk_identity 3"
-.TH SSL_get_psk_identity 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_psk_identity 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_rbio.3 b/secure/lib/libssl/man/SSL_get_rbio.3
index 5b4c370..4322ecf 100644
--- a/secure/lib/libssl/man/SSL_get_rbio.3
+++ b/secure/lib/libssl/man/SSL_get_rbio.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_rbio 3"
-.TH SSL_get_rbio 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_rbio 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_session.3 b/secure/lib/libssl/man/SSL_get_session.3
index 089fc4d..f8571c1 100644
--- a/secure/lib/libssl/man/SSL_get_session.3
+++ b/secure/lib/libssl/man/SSL_get_session.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_session 3"
-.TH SSL_get_session 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_session 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_verify_result.3 b/secure/lib/libssl/man/SSL_get_verify_result.3
index e185a38..dd8ae05 100644
--- a/secure/lib/libssl/man/SSL_get_verify_result.3
+++ b/secure/lib/libssl/man/SSL_get_verify_result.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_verify_result 3"
-.TH SSL_get_verify_result 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_verify_result 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_version.3 b/secure/lib/libssl/man/SSL_get_version.3
index 1e6be3c..d291371 100644
--- a/secure/lib/libssl/man/SSL_get_version.3
+++ b/secure/lib/libssl/man/SSL_get_version.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_version 3"
-.TH SSL_get_version 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_get_version 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_library_init.3 b/secure/lib/libssl/man/SSL_library_init.3
index ac916ab..f4f2ab2 100644
--- a/secure/lib/libssl/man/SSL_library_init.3
+++ b/secure/lib/libssl/man/SSL_library_init.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_library_init 3"
-.TH SSL_library_init 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_library_init 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_load_client_CA_file.3 b/secure/lib/libssl/man/SSL_load_client_CA_file.3
index 3973dfb..8d360f8 100644
--- a/secure/lib/libssl/man/SSL_load_client_CA_file.3
+++ b/secure/lib/libssl/man/SSL_load_client_CA_file.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_load_client_CA_file 3"
-.TH SSL_load_client_CA_file 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_load_client_CA_file 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_new.3 b/secure/lib/libssl/man/SSL_new.3
index 0f48504..1dc9894 100644
--- a/secure/lib/libssl/man/SSL_new.3
+++ b/secure/lib/libssl/man/SSL_new.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_new 3"
-.TH SSL_new 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_new 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_pending.3 b/secure/lib/libssl/man/SSL_pending.3
index 8c3cf4b..2fecac4 100644
--- a/secure/lib/libssl/man/SSL_pending.3
+++ b/secure/lib/libssl/man/SSL_pending.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_pending 3"
-.TH SSL_pending 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_pending 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_read.3 b/secure/lib/libssl/man/SSL_read.3
index f8cfcdc..8299830 100644
--- a/secure/lib/libssl/man/SSL_read.3
+++ b/secure/lib/libssl/man/SSL_read.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_read 3"
-.TH SSL_read 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_read 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_rstate_string.3 b/secure/lib/libssl/man/SSL_rstate_string.3
index 047d854..2823452 100644
--- a/secure/lib/libssl/man/SSL_rstate_string.3
+++ b/secure/lib/libssl/man/SSL_rstate_string.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_rstate_string 3"
-.TH SSL_rstate_string 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_rstate_string 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_session_reused.3 b/secure/lib/libssl/man/SSL_session_reused.3
index 56ec9a4..c744d4c 100644
--- a/secure/lib/libssl/man/SSL_session_reused.3
+++ b/secure/lib/libssl/man/SSL_session_reused.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_session_reused 3"
-.TH SSL_session_reused 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_session_reused 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_bio.3 b/secure/lib/libssl/man/SSL_set_bio.3
index 06f1b97..8acf762 100644
--- a/secure/lib/libssl/man/SSL_set_bio.3
+++ b/secure/lib/libssl/man/SSL_set_bio.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_bio 3"
-.TH SSL_set_bio 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_bio 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_connect_state.3 b/secure/lib/libssl/man/SSL_set_connect_state.3
index e908153..b6a1ac7 100644
--- a/secure/lib/libssl/man/SSL_set_connect_state.3
+++ b/secure/lib/libssl/man/SSL_set_connect_state.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_connect_state 3"
-.TH SSL_set_connect_state 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_connect_state 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_fd.3 b/secure/lib/libssl/man/SSL_set_fd.3
index 2354a93..338e4e8 100644
--- a/secure/lib/libssl/man/SSL_set_fd.3
+++ b/secure/lib/libssl/man/SSL_set_fd.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_fd 3"
-.TH SSL_set_fd 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_fd 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_session.3 b/secure/lib/libssl/man/SSL_set_session.3
index 0f37a58..13a5b40 100644
--- a/secure/lib/libssl/man/SSL_set_session.3
+++ b/secure/lib/libssl/man/SSL_set_session.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_session 3"
-.TH SSL_set_session 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_session 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_shutdown.3 b/secure/lib/libssl/man/SSL_set_shutdown.3
index ed00917..f535076 100644
--- a/secure/lib/libssl/man/SSL_set_shutdown.3
+++ b/secure/lib/libssl/man/SSL_set_shutdown.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_shutdown 3"
-.TH SSL_set_shutdown 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_shutdown 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_verify_result.3 b/secure/lib/libssl/man/SSL_set_verify_result.3
index 354105a..db3c22f 100644
--- a/secure/lib/libssl/man/SSL_set_verify_result.3
+++ b/secure/lib/libssl/man/SSL_set_verify_result.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_verify_result 3"
-.TH SSL_set_verify_result 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_set_verify_result 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_shutdown.3 b/secure/lib/libssl/man/SSL_shutdown.3
index af785d3..4c03775 100644
--- a/secure/lib/libssl/man/SSL_shutdown.3
+++ b/secure/lib/libssl/man/SSL_shutdown.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_shutdown 3"
-.TH SSL_shutdown 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_shutdown 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_state_string.3 b/secure/lib/libssl/man/SSL_state_string.3
index 1e29002..4a1ab93 100644
--- a/secure/lib/libssl/man/SSL_state_string.3
+++ b/secure/lib/libssl/man/SSL_state_string.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_state_string 3"
-.TH SSL_state_string 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_state_string 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_want.3 b/secure/lib/libssl/man/SSL_want.3
index ab20b9a..7a847ab 100644
--- a/secure/lib/libssl/man/SSL_want.3
+++ b/secure/lib/libssl/man/SSL_want.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_want 3"
-.TH SSL_want 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_want 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_write.3 b/secure/lib/libssl/man/SSL_write.3
index 922d411..6fef483 100644
--- a/secure/lib/libssl/man/SSL_write.3
+++ b/secure/lib/libssl/man/SSL_write.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_write 3"
-.TH SSL_write 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SSL_write 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/d2i_SSL_SESSION.3 b/secure/lib/libssl/man/d2i_SSL_SESSION.3
index d175688..25fbd8c 100644
--- a/secure/lib/libssl/man/d2i_SSL_SESSION.3
+++ b/secure/lib/libssl/man/d2i_SSL_SESSION.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_SSL_SESSION 3"
-.TH d2i_SSL_SESSION 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH d2i_SSL_SESSION 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/ssl.3 b/secure/lib/libssl/man/ssl.3
index cd42641..fafe4ad 100644
--- a/secure/lib/libssl/man/ssl.3
+++ b/secure/lib/libssl/man/ssl.3
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ssl 3"
-.TH ssl 3 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ssl 3 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/CA.pl.1 b/secure/usr.bin/openssl/man/CA.pl.1
index bdfcc16..0d65d2a 100644
--- a/secure/usr.bin/openssl/man/CA.pl.1
+++ b/secure/usr.bin/openssl/man/CA.pl.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA.PL 1"
-.TH CA.PL 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CA.PL 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/asn1parse.1 b/secure/usr.bin/openssl/man/asn1parse.1
index 6c3a563..590a763 100644
--- a/secure/usr.bin/openssl/man/asn1parse.1
+++ b/secure/usr.bin/openssl/man/asn1parse.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1PARSE 1"
-.TH ASN1PARSE 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ASN1PARSE 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/c_rehash.1 b/secure/usr.bin/openssl/man/c_rehash.1
index e5beb50..dd20190 100644
--- a/secure/usr.bin/openssl/man/c_rehash.1
+++ b/secure/usr.bin/openssl/man/c_rehash.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "C_REHASH 1"
-.TH C_REHASH 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH C_REHASH 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ca.1 b/secure/usr.bin/openssl/man/ca.1
index 113bc40..e9fe870 100644
--- a/secure/usr.bin/openssl/man/ca.1
+++ b/secure/usr.bin/openssl/man/ca.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA 1"
-.TH CA 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CA 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ciphers.1 b/secure/usr.bin/openssl/man/ciphers.1
index 8aea03e..399d2be 100644
--- a/secure/usr.bin/openssl/man/ciphers.1
+++ b/secure/usr.bin/openssl/man/ciphers.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CIPHERS 1"
-.TH CIPHERS 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CIPHERS 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/cms.1 b/secure/usr.bin/openssl/man/cms.1
index 73087e5..9afb285 100644
--- a/secure/usr.bin/openssl/man/cms.1
+++ b/secure/usr.bin/openssl/man/cms.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS 1"
-.TH CMS 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CMS 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/crl.1 b/secure/usr.bin/openssl/man/crl.1
index 2d84357..4e7d8d6 100644
--- a/secure/usr.bin/openssl/man/crl.1
+++ b/secure/usr.bin/openssl/man/crl.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL 1"
-.TH CRL 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CRL 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/crl2pkcs7.1 b/secure/usr.bin/openssl/man/crl2pkcs7.1
index 7bcc8d8..3cb3f2c 100644
--- a/secure/usr.bin/openssl/man/crl2pkcs7.1
+++ b/secure/usr.bin/openssl/man/crl2pkcs7.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL2PKCS7 1"
-.TH CRL2PKCS7 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH CRL2PKCS7 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dgst.1 b/secure/usr.bin/openssl/man/dgst.1
index ec8feab..f4f8250 100644
--- a/secure/usr.bin/openssl/man/dgst.1
+++ b/secure/usr.bin/openssl/man/dgst.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DGST 1"
-.TH DGST 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DGST 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dhparam.1 b/secure/usr.bin/openssl/man/dhparam.1
index f802fde..ab60480 100644
--- a/secure/usr.bin/openssl/man/dhparam.1
+++ b/secure/usr.bin/openssl/man/dhparam.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DHPARAM 1"
-.TH DHPARAM 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DHPARAM 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dsa.1 b/secure/usr.bin/openssl/man/dsa.1
index 5075f26..c1b9f3c 100644
--- a/secure/usr.bin/openssl/man/dsa.1
+++ b/secure/usr.bin/openssl/man/dsa.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA 1"
-.TH DSA 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSA 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dsaparam.1 b/secure/usr.bin/openssl/man/dsaparam.1
index f7e83f8..589f64e 100644
--- a/secure/usr.bin/openssl/man/dsaparam.1
+++ b/secure/usr.bin/openssl/man/dsaparam.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSAPARAM 1"
-.TH DSAPARAM 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH DSAPARAM 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ec.1 b/secure/usr.bin/openssl/man/ec.1
index 5e10e0a..f5cd041 100644
--- a/secure/usr.bin/openssl/man/ec.1
+++ b/secure/usr.bin/openssl/man/ec.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC 1"
-.TH EC 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH EC 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ecparam.1 b/secure/usr.bin/openssl/man/ecparam.1
index 68c30c1..811d81d 100644
--- a/secure/usr.bin/openssl/man/ecparam.1
+++ b/secure/usr.bin/openssl/man/ecparam.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ECPARAM 1"
-.TH ECPARAM 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ECPARAM 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/enc.1 b/secure/usr.bin/openssl/man/enc.1
index da567c2..17cb07b 100644
--- a/secure/usr.bin/openssl/man/enc.1
+++ b/secure/usr.bin/openssl/man/enc.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ENC 1"
-.TH ENC 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ENC 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/errstr.1 b/secure/usr.bin/openssl/man/errstr.1
index c5e4d45..b2adb4d 100644
--- a/secure/usr.bin/openssl/man/errstr.1
+++ b/secure/usr.bin/openssl/man/errstr.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERRSTR 1"
-.TH ERRSTR 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH ERRSTR 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/gendsa.1 b/secure/usr.bin/openssl/man/gendsa.1
index aa85d3f..f9af5ff 100644
--- a/secure/usr.bin/openssl/man/gendsa.1
+++ b/secure/usr.bin/openssl/man/gendsa.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENDSA 1"
-.TH GENDSA 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH GENDSA 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genpkey.1 b/secure/usr.bin/openssl/man/genpkey.1
index 96bf07f..f844dbe 100644
--- a/secure/usr.bin/openssl/man/genpkey.1
+++ b/secure/usr.bin/openssl/man/genpkey.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENPKEY 1"
-.TH GENPKEY 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH GENPKEY 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genrsa.1 b/secure/usr.bin/openssl/man/genrsa.1
index 9a118bd..92262b3 100644
--- a/secure/usr.bin/openssl/man/genrsa.1
+++ b/secure/usr.bin/openssl/man/genrsa.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENRSA 1"
-.TH GENRSA 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH GENRSA 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/nseq.1 b/secure/usr.bin/openssl/man/nseq.1
index b0397f4..7b58fd2 100644
--- a/secure/usr.bin/openssl/man/nseq.1
+++ b/secure/usr.bin/openssl/man/nseq.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "NSEQ 1"
-.TH NSEQ 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH NSEQ 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ocsp.1 b/secure/usr.bin/openssl/man/ocsp.1
index 856d17b..7c8555f 100644
--- a/secure/usr.bin/openssl/man/ocsp.1
+++ b/secure/usr.bin/openssl/man/ocsp.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OCSP 1"
-.TH OCSP 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OCSP 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/openssl.1 b/secure/usr.bin/openssl/man/openssl.1
index 55dce59..c10667d 100644
--- a/secure/usr.bin/openssl/man/openssl.1
+++ b/secure/usr.bin/openssl/man/openssl.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL 1"
-.TH OPENSSL 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH OPENSSL 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/passwd.1 b/secure/usr.bin/openssl/man/passwd.1
index 57de399..74ecd5d 100644
--- a/secure/usr.bin/openssl/man/passwd.1
+++ b/secure/usr.bin/openssl/man/passwd.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PASSWD 1"
-.TH PASSWD 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PASSWD 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs12.1 b/secure/usr.bin/openssl/man/pkcs12.1
index ef0451a..4e9c313 100644
--- a/secure/usr.bin/openssl/man/pkcs12.1
+++ b/secure/usr.bin/openssl/man/pkcs12.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12 1"
-.TH PKCS12 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS12 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs7.1 b/secure/usr.bin/openssl/man/pkcs7.1
index 32c6134..2e66ea4 100644
--- a/secure/usr.bin/openssl/man/pkcs7.1
+++ b/secure/usr.bin/openssl/man/pkcs7.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7 1"
-.TH PKCS7 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS7 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs8.1 b/secure/usr.bin/openssl/man/pkcs8.1
index aadfecb..1fbd688 100644
--- a/secure/usr.bin/openssl/man/pkcs8.1
+++ b/secure/usr.bin/openssl/man/pkcs8.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS8 1"
-.TH PKCS8 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKCS8 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkey.1 b/secure/usr.bin/openssl/man/pkey.1
index 90cfbfc..7d11055 100644
--- a/secure/usr.bin/openssl/man/pkey.1
+++ b/secure/usr.bin/openssl/man/pkey.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEY 1"
-.TH PKEY 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKEY 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyparam.1 b/secure/usr.bin/openssl/man/pkeyparam.1
index 02e391c..d2fefe5 100644
--- a/secure/usr.bin/openssl/man/pkeyparam.1
+++ b/secure/usr.bin/openssl/man/pkeyparam.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYPARAM 1"
-.TH PKEYPARAM 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKEYPARAM 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyutl.1 b/secure/usr.bin/openssl/man/pkeyutl.1
index 6c25a10..b09af42 100644
--- a/secure/usr.bin/openssl/man/pkeyutl.1
+++ b/secure/usr.bin/openssl/man/pkeyutl.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYUTL 1"
-.TH PKEYUTL 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH PKEYUTL 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rand.1 b/secure/usr.bin/openssl/man/rand.1
index 3f2fc40..5f30c36 100644
--- a/secure/usr.bin/openssl/man/rand.1
+++ b/secure/usr.bin/openssl/man/rand.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND 1"
-.TH RAND 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RAND 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/req.1 b/secure/usr.bin/openssl/man/req.1
index 0fec01a..45423d5 100644
--- a/secure/usr.bin/openssl/man/req.1
+++ b/secure/usr.bin/openssl/man/req.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "REQ 1"
-.TH REQ 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH REQ 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rsa.1 b/secure/usr.bin/openssl/man/rsa.1
index e4459ca..79257a3 100644
--- a/secure/usr.bin/openssl/man/rsa.1
+++ b/secure/usr.bin/openssl/man/rsa.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA 1"
-.TH RSA 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSA 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rsautl.1 b/secure/usr.bin/openssl/man/rsautl.1
index 9e6cad2..41c049f 100644
--- a/secure/usr.bin/openssl/man/rsautl.1
+++ b/secure/usr.bin/openssl/man/rsautl.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSAUTL 1"
-.TH RSAUTL 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH RSAUTL 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_client.1 b/secure/usr.bin/openssl/man/s_client.1
index 7a874cd..0de6732 100644
--- a/secure/usr.bin/openssl/man/s_client.1
+++ b/secure/usr.bin/openssl/man/s_client.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_CLIENT 1"
-.TH S_CLIENT 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH S_CLIENT 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_server.1 b/secure/usr.bin/openssl/man/s_server.1
index dc951e0..fb375dc 100644
--- a/secure/usr.bin/openssl/man/s_server.1
+++ b/secure/usr.bin/openssl/man/s_server.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_SERVER 1"
-.TH S_SERVER 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH S_SERVER 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_time.1 b/secure/usr.bin/openssl/man/s_time.1
index b58f7b5..0af5bc6 100644
--- a/secure/usr.bin/openssl/man/s_time.1
+++ b/secure/usr.bin/openssl/man/s_time.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_TIME 1"
-.TH S_TIME 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH S_TIME 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/sess_id.1 b/secure/usr.bin/openssl/man/sess_id.1
index b08257b..d50eeb9 100644
--- a/secure/usr.bin/openssl/man/sess_id.1
+++ b/secure/usr.bin/openssl/man/sess_id.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SESS_ID 1"
-.TH SESS_ID 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SESS_ID 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/smime.1 b/secure/usr.bin/openssl/man/smime.1
index c696a67..22ca062 100644
--- a/secure/usr.bin/openssl/man/smime.1
+++ b/secure/usr.bin/openssl/man/smime.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME 1"
-.TH SMIME 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SMIME 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/speed.1 b/secure/usr.bin/openssl/man/speed.1
index 14d849d..3fe6eef 100644
--- a/secure/usr.bin/openssl/man/speed.1
+++ b/secure/usr.bin/openssl/man/speed.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPEED 1"
-.TH SPEED 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SPEED 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/spkac.1 b/secure/usr.bin/openssl/man/spkac.1
index 7c1ce8c..0c88e6f 100644
--- a/secure/usr.bin/openssl/man/spkac.1
+++ b/secure/usr.bin/openssl/man/spkac.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPKAC 1"
-.TH SPKAC 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH SPKAC 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ts.1 b/secure/usr.bin/openssl/man/ts.1
index c5c3d3e..0c92d2e 100644
--- a/secure/usr.bin/openssl/man/ts.1
+++ b/secure/usr.bin/openssl/man/ts.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TS 1"
-.TH TS 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH TS 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/tsget.1 b/secure/usr.bin/openssl/man/tsget.1
index 9def7ad..8fea187 100644
--- a/secure/usr.bin/openssl/man/tsget.1
+++ b/secure/usr.bin/openssl/man/tsget.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TSGET 1"
-.TH TSGET 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH TSGET 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/verify.1 b/secure/usr.bin/openssl/man/verify.1
index b847976..73e7ff5 100644
--- a/secure/usr.bin/openssl/man/verify.1
+++ b/secure/usr.bin/openssl/man/verify.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERIFY 1"
-.TH VERIFY 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH VERIFY 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/version.1 b/secure/usr.bin/openssl/man/version.1
index 0a9e0a0..c6531fd 100644
--- a/secure/usr.bin/openssl/man/version.1
+++ b/secure/usr.bin/openssl/man/version.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERSION 1"
-.TH VERSION 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH VERSION 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/x509.1 b/secure/usr.bin/openssl/man/x509.1
index bd61c2e..695a7d9 100644
--- a/secure/usr.bin/openssl/man/x509.1
+++ b/secure/usr.bin/openssl/man/x509.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509 1"
-.TH X509 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/x509v3_config.1 b/secure/usr.bin/openssl/man/x509v3_config.1
index e32533b..52205f0 100644
--- a/secure/usr.bin/openssl/man/x509v3_config.1
+++ b/secure/usr.bin/openssl/man/x509v3_config.1
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509V3_CONFIG 1"
-.TH X509V3_CONFIG 1 "2016-09-22" "1.0.2i" "OpenSSL"
+.TH X509V3_CONFIG 1 "2016-09-26" "1.0.2j" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 1cd099b..e94dff4 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -113,6 +113,7 @@ MAN= aac.4 \
cue.4 \
cxgb.4 \
cxgbe.4 \
+ cxgbev.4 \
cy.4 \
cyapa.4 \
da.4 \
@@ -607,6 +608,9 @@ MLINKS+=cxgb.4 if_cxgb.4
MLINKS+=cxgbe.4 if_cxgbe.4 \
cxgbe.4 cxl.4 \
cxgbe.4 if_cxl.4
+MLINKS+=cxgbev.4 if_cxgbev.4 \
+ cxgbev.4 cxlv.4 \
+ cxgbev.4 if_cxlv.4
MLINKS+=dc.4 if_dc.4
MLINKS+=de.4 if_de.4
MLINKS+=disc.4 if_disc.4
diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4
index 72a9483..afa7e38 100644
--- a/share/man/man4/cxgbe.4
+++ b/share/man/man4/cxgbe.4
@@ -77,8 +77,7 @@ For more information on configuring this device, see
.Sh HARDWARE
The
.Nm
-driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC
-(ports will be named cxl):
+driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC:
.Pp
.Bl -bullet -compact
.It
@@ -320,6 +319,7 @@ email all the specific information related to the issue to
.Xr altq 4 ,
.Xr arp 4 ,
.Xr cxgb 4 ,
+.Xr cxgbev 4 ,
.Xr netintro 4 ,
.Xr ng_ether 4 ,
.Xr ifconfig 8
diff --git a/share/man/man4/cxgbev.4 b/share/man/man4/cxgbev.4
new file mode 100644
index 0000000..f4e3dc5
--- /dev/null
+++ b/share/man/man4/cxgbev.4
@@ -0,0 +1,290 @@
+.\" Copyright (c) 2011-2016, Chelsio Inc
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright notice,
+.\" this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the Chelsio Inc nor the names of its
+.\" contributors may be used to endorse or promote products derived from
+.\" this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" * Other names and brands may be claimed as the property of others.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd August 22, 2016
+.Dt CXGBEV 4
+.Os
+.Sh NAME
+.Nm cxgbev
+.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet VF driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device cxgbe"
+.Cd "device cxgbev"
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_cxgbev_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Virtual Functions on PCI Express Ethernet adapters
+based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5).
+The driver supports Jumbo Frames, Transmit/Receive checksum offload,
+TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN
+tag insertion/extraction, VLAN checksum offload, VLAN TSO, and
+Receive Side Steering (RSS).
+For further hardware information and questions related to hardware
+requirements, see
+.Pa http://www.chelsio.com/ .
+.Pp
+Note that ports of T5 VFs are named cxlv and attach to a t5vf parent device
+(in contrast to ports named cxgbev that attach to a t4vf parent for a T4 VF).
+Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 VFs.
+The Physical Function driver for T4 and T5 adapters shares these tunables.
+The sysctl MIBs are at dev.t5vf and dev.cxlv for T5 cards and at dev.t4vf and
+dev.cxgbev for T4 cards.
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh HARDWARE
+The
+.Nm
+driver supports Virtual Functions on 40Gb, 10Gb and 1Gb Ethernet adapters
+based on the T5 ASIC:
+.Pp
+.Bl -bullet -compact
+.It
+Chelsio T580-CR
+.It
+Chelsio T580-LP-CR
+.It
+Chelsio T580-LP-SO-CR
+.It
+Chelsio T560-CR
+.It
+Chelsio T540-CR
+.It
+Chelsio T540-LP-CR
+.It
+Chelsio T522-CR
+.It
+Chelsio T520-LL-CR
+.It
+Chelsio T520-CR
+.It
+Chelsio T520-SO
+.It
+Chelsio T520-BT
+.It
+Chelsio T504-BT
+.El
+.Pp
+The
+.Nm
+driver supports Virtual Functions on 10Gb and 1Gb Ethernet adapters based
+on the T4 ASIC:
+.Pp
+.Bl -bullet -compact
+.It
+Chelsio T420-CR
+.It
+Chelsio T422-CR
+.It
+Chelsio T440-CR
+.It
+Chelsio T420-BCH
+.It
+Chelsio T440-BCH
+.It
+Chelsio T440-CH
+.It
+Chelsio T420-SO
+.It
+Chelsio T420-CX
+.It
+Chelsio T420-BT
+.It
+Chelsio T404-BT
+.El
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.cxgbe.ntxq10g
+The number of tx queues to use for a 10Gb or 40Gb port.
+The default is 16 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nrxq10g
+The number of rx queues to use for a 10Gb or 40Gb port.
+The default is 8 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.ntxq1g
+The number of tx queues to use for a 1Gb port.
+The default is 4 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nrxq1g
+The number of rx queues to use for a 1Gb port.
+The default is 2 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.holdoff_timer_idx_10G
+.It Va hw.cxgbe.holdoff_timer_idx_1G
+The timer index value to use to delay interrupts.
+The holdoff timer list has the values 1, 5, 10, 50, 100, and 200
+by default (all values are in microseconds) and the index selects a
+value from this list.
+The default value is 1 which means the timer value is 5us.
+Different interfaces can be assigned different values at any time via the
+dev.cxgbev.X.holdoff_tmr_idx or dev.cxlv.X.holdoff_tmr_idx sysctl.
+.It Va hw.cxgbe.holdoff_pktc_idx_10G
+.It Va hw.cxgbe.holdoff_pktc_idx_1G
+The packet-count index value to use to delay interrupts.
+The packet-count list has the values 1, 8, 16, and 32 by default
+and the index selects a value from this list.
+The default value is -1 which means packet counting is disabled and interrupts
+are generated based solely on the holdoff timer value.
+Different interfaces can be assigned different values via the
+dev.cxgbev.X.holdoff_pktc_idx or dev.cxlv.X.holdoff_pktc_idx sysctl.
+This sysctl works only when the interface has never been marked up (as done by
+ifconfig up).
+.It Va hw.cxgbe.qsize_txq
+The size, in number of entries, of the descriptor ring used for a tx
+queue.
+A buf_ring of the same size is also allocated for additional
+software queuing.
+See
+.Xr ifnet 9 .
+The default value is 1024.
+Different interfaces can be assigned different values via the
+dev.cxgbev.X.qsize_txq sysctl or dev.cxlv.X.qsize_txq sysctl.
+This sysctl works only when the interface has never been marked up (as done by
+ifconfig up).
+.It Va hw.cxgbe.qsize_rxq
+The size, in number of entries, of the descriptor ring used for an
+rx queue.
+The default value is 1024.
+Different interfaces can be assigned different values via the
+dev.cxgbev.X.qsize_rxq or dev.cxlv.X.qsize_rxq sysctl.
+This sysctl works only when the interface has never been marked up (as done by
+ifconfig up).
+.It Va hw.cxgbe.interrupt_types
+The interrupt types that the driver is allowed to use.
+Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X.
+The default is 7 (all allowed).
+The driver will select the best possible type out of the allowed types by
+itself.
+.It Va hw.cxgbe.fl_pktshift
+The number of bytes of padding inserted before the beginning of an Ethernet
+frame in the receive buffer.
+The default value of 2 ensures that the Ethernet payload (usually the IP header)
+is at a 4 byte aligned address.
+0-7 are all valid values.
+.It Va hw.cxgbe.fl_pad
+A non-zero value ensures that writes from the hardware to a receive buffer are
+padded up to the specified boundary.
+The default is -1 which lets the driver pick a pad boundary.
+0 disables trailer padding completely.
+.It Va hw.cxgbe.buffer_packing
+Allow the hardware to deliver multiple frames in the same receive buffer
+opportunistically.
+The default is -1 which lets the driver decide.
+0 or 1 explicitly disable or enable this feature.
+.It Va hw.cxgbe.allow_mbufs_in_cluster
+1 allows the driver to lay down one or more mbufs within the receive buffer
+opportunistically.
+This is the default.
+0 prohibits the driver from doing so.
+.It Va hw.cxgbe.largest_rx_cluster
+.It Va hw.cxgbe.safest_rx_cluster
+Sizes of rx clusters.
+Each of these must be set to one of the sizes available
+(usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater
+than or equal to safest_rx_cluster.
+The defaults are 16384 and 4096 respectively.
+The driver will never attempt to allocate a receive buffer larger than
+largest_rx_cluster and will fall back to allocating buffers of
+safest_rx_cluster size if an allocation larger than safest_rx_cluster fails.
+Note that largest_rx_cluster merely establishes a ceiling -- the driver is
+allowed to allocate buffers of smaller sizes.
+.El
+.Pp
+Certain settings and resources for Virtual Functions are dictated
+by the parent Physical Function driver.
+For example, the Physical Function driver limits the number of queues a
+Virtual Function is permitted to use.
+Some of these limits can be adjusted in the firmware configuration file
+used with the Physical Function driver.
+.Pp
+The PAUSE settings on the port of a Virtual Function are inherited from
+the settings of the same port on the Physical Function.
+Virtual Functions cannot modify the setting and track changes made to
+the associated port's setting by the Physical Function driver.
+.Pp
+Receive queues on a Virtual Function always drop packets in response to
+congestion
+.Po
+equivalent to setting
+.Va hw.cxgbe.cong_drop
+to 1
+.Pc .
+.Pp
+The VF driver currently depends on the PF driver.
+As a result, loading the VF driver will also load the PF driver as a
+dependency.
+.Sh SUPPORT
+For general information and support,
+go to the Chelsio support website at:
+.Pa http://www.chelsio.com/ .
+.Pp
+If an issue is identified with this driver with a supported adapter,
+email all the specific information related to the issue to
+.Aq Mt support@chelsio.com .
+.Sh SEE ALSO
+.Xr altq 4 ,
+.Xr arp 4 ,
+.Xr cxgbe 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 12.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Navdeep Parhar Aq Mt np@FreeBSD.org
+and
+.An John Baldwin Aq Mt jhb@FreeBSD.org .
diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4
index 2cdc71b..7623a9a 100644
--- a/share/man/man4/pci.4
+++ b/share/man/man4/pci.4
@@ -254,7 +254,8 @@ The status tells the user the disposition of his request for a device list.
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.
@@ -270,9 +271,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
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 58b35f6..1a438c6 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1303,6 +1303,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_ident.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_iov_attach.9 \
+ pci.9 pci_iov_attach_name.9 \
pci.9 pci_iov_detach.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \
@@ -1318,7 +1319,10 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_set_max_read_req.9 \
pci.9 pci_write_config.9 \
pci.9 pcie_adjust_config.9 \
+ pci.9 pcie_flr.9 \
+ pci.9 pcie_max_completion_timeout.9 \
pci.9 pcie_read_config.9 \
+ pci.9 pcie_wait_for_pending_transactions.9 \
pci.9 pcie_write_config.9
MLINKS+=pci_iov_schema.9 pci_iov_schema_alloc_node.9 \
pci_iov_schema.9 pci_iov_schema_add_bool.9 \
diff --git a/share/man/man9/device_quiet.9 b/share/man/man9/device_quiet.9
index 0e5526d..08d88ca 100644
--- a/share/man/man9/device_quiet.9
+++ b/share/man/man9/device_quiet.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 21, 1999
+.Dd September 12, 2016
.Dt DEVICE_QUIET 9
.Os
.Sh NAME
@@ -49,16 +49,18 @@
Each device has a quiet flag associated with it.
A device is
verbose by default when it is created but may be quieted to prevent
-the device identification string to be printed during probe.
+printing of the device identification string during attach
+and printing of a message during detach.
To quiet a device, call
-.Fn device_quiet ,
-to re-enable to probe message (to make the message appear again, for
-example after a
-.Xr device_detach 9 )
+.Fn device_quiet
+during a device driver probe routine.
+To re-enable probe messages,
call
.Fn device_verbose .
To test to see if a device is quieted, call
.Fn device_is_quiet .
+.Pp
+Devices are implicitly marked verbose after a driver detaches.
.Sh SEE ALSO
.Xr device 9
.Sh AUTHORS
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index a53f971..d8b4b91 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 24, 2016
+.Dd September 6, 2016
.Dt PCI 9
.Os
.Sh NAME
@@ -50,6 +50,7 @@
.Nm pci_get_vpd_ident ,
.Nm pci_get_vpd_readonly ,
.Nm pci_iov_attach ,
+.Nm pci_iov_attach_name ,
.Nm pci_iov_detach ,
.Nm pci_msi_count ,
.Nm pci_msix_count ,
@@ -65,7 +66,10 @@
.Nm pci_set_powerstate ,
.Nm pci_write_config ,
.Nm pcie_adjust_config ,
+.Nm pcie_flr ,
+.Nm pcie_get_max_completion_timeout ,
.Nm pcie_read_config ,
+.Nm pcie_wait_for_pending_transactions ,
.Nm pcie_write_config
.Nd PCI bus interface
.Sh SYNOPSIS
@@ -144,14 +148,32 @@
.Fa "uint32_t val"
.Fa "int width"
.Fc
+.Ft bool
+.Fn pcie_flr "device_t dev" "u_int max_delay" "bool force"
+.Ft int
+.Fn pcie_get_max_completion_timeout "device_t dev"
.Ft uint32_t
.Fn pcie_read_config "device_t dev" "int reg" "int width"
+.Ft bool
+.Fn pcie_wait_for_pending_transactions "device_t dev" "u_int max_delay"
.Ft void
.Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width"
+.Ft void
+.Fn pci_event_fn "void *arg" "device_t dev"
+.Fn EVENTHANDLER_REGISTER "pci_add_device" "pci_event_fn"
+.Fn EVENTHANDLER_DEREGISTER "pci_delete_resource" "pci_event_fn"
.In dev/pci/pci_iov.h
.Ft int
.Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
.Ft int
+.Fo pci_iov_attach_name
+.Fa "device_t dev"
+.Fa "nvlist_t *pf_schema"
+.Fa "nvlist_t *vf_schema"
+.Fa "const char *fmt"
+.Fa "..."
+.Fc
+.Ft int
.Fn pci_iov_detach "device_t dev"
.Sh DESCRIPTION
The
@@ -418,6 +440,51 @@ keyword,
then
.Fn pci_get_vpd_readonly
returns an error.
+.Pp
+The
+.Fn pcie_get_max_completion_timeout
+function returns the maximum completion timeout configured for the device
+.Fa dev
+in microseconds.
+If the
+.Fa dev
+device is not a PCI-express device,
+.Fn pcie_get_max_completion_timeout
+returns zero.
+When completion timeouts are disabled for
+.Fa dev ,
+this function returns the maxmimum timeout that would be used if timeouts
+were enabled.
+.Pp
+The
+.Fn pcie_wait_for_pending_transactions
+function waits for any pending transactions initiated by the
+.Fa dev
+device to complete.
+The function checks for pending transactions by polling the transactions
+pending flag in the PCI-express device status register.
+It returns
+.Dv true
+once the transaction pending flag is clear.
+If transactions are still pending after
+.Fa max_delay
+milliseconds,
+.Fn pcie_wait_for_pending_transactions
+returns
+.Dv false .
+If
+.Fa max_delay
+is set to zero,
+.Fn pcie_wait_for_pending_transactions
+performs a single check;
+otherwise,
+this function may sleep while polling the transactions pending flag.
+.Nm pcie_wait_for_pending_transactions
+returns
+.Dv true
+if
+.Fa dev
+is not a PCI-express device.
.Ss Device Configuration
The
.Fn pci_enable_busmaster
@@ -595,6 +662,20 @@ and is responsible for freeing them.
The driver must never free the schemas itself.
.Pp
The
+.Fn pci_iov_attach_name
+function is a variant of
+.Fn pci_iov_attach
+that allows the name of the associated character device in
+.Pa /dev/iov
+to be specified by
+.Fa fmt .
+The
+.Fn pci_iov_attach
+function uses the name of
+.Fa dev
+as the device name.
+.Pp
+The
.Fn pci_iov_detach
function is used to advise the SR-IOV infrastructure that the driver for the
given device is attempting to detach and that all SR-IOV resources for the
@@ -635,6 +716,51 @@ is invoked,
then the device will be transitioned to
.Dv PCI_POWERSTATE_D0
before any config registers are restored.
+.Pp
+The
+.Fn pcie_flr
+function requests a Function Level Reset
+.Pq FLR
+of
+.Fa dev .
+If
+.Fa dev
+is not a PCI-express device or does not support Function Level Resets via
+the PCI-express device control register,
+.Dv false
+is returned.
+Pending transactions are drained by disabling busmastering and calling
+.Fn pcie_wait_for_pending_transactions
+before resetting the device.
+The
+.Fa max_delay
+argument specifies the maximum timeout to wait for pending transactions as
+described for
+.Fn pcie_wait_for_pending_transactions .
+If
+.Fn pcie_wait_for_pending_transactions
+fails with a timeout and
+.Fa force
+is
+.Dv false ,
+busmastering is re-enabled and
+.Dv false
+is returned.
+If
+.Fn pcie_wait_for_pending_transactions
+fails with a timeout and
+.Fa force
+is
+.Dv true ,
+the device is reset despite the 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
@@ -887,11 +1013,24 @@ with one in the new distribution.
The
.Fn pci_remap_msix
function will fail if this condition is not met.
-.Sh IMPLEMENTATION NOTES
+.Ss Device Events
+The
+.Va pci_add_device
+event handler is invoked every time a new PCI device is added to the system.
+This includes the creation of Virtual Functions via SR-IOV.
+.Pp
The
-.Vt pci_addr_t
-type varies according to the size of the PCI bus address
-space on the target architecture.
+.Va pci_delete_device
+event handler is invoked every time a PCI device is removed from the system.
+.Pp
+Both event handlers pass the
+.Vt device_t
+object of the relevant PCI device as
+.Fa dev
+to each callback function.
+Both event handlers are invoked while
+.Fa dev
+is unattached but with valid instance variables.
.Sh SEE ALSO
.Xr pci 4 ,
.Xr pciconf 8 ,
@@ -903,6 +1042,7 @@ space on the target architecture.
.Xr devclass 9 ,
.Xr device 9 ,
.Xr driver 9 ,
+.Xr eventhandler 9 ,
.Xr rman 9
.Rs
.%B FreeBSD Developers' Handbook
diff --git a/sys/amd64/amd64/efirt.c b/sys/amd64/amd64/efirt.c
new file mode 100644
index 0000000..8db768b
--- /dev/null
+++ b/sys/amd64/amd64/efirt.c
@@ -0,0 +1,609 @@
+/*-
+ * Copyright (c) 2004 Marcel Moolenaar
+ * Copyright (c) 2001 Doug Rabson
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/efi.h>
+#include <sys/kernel.h>
+#include <sys/linker.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/clock.h>
+#include <sys/proc.h>
+#include <sys/rwlock.h>
+#include <sys/sched.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+#include <machine/fpu.h>
+#include <machine/efi.h>
+#include <machine/metadata.h>
+#include <machine/md_var.h>
+#include <machine/smp.h>
+#include <machine/vmparam.h>
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pager.h>
+
+static struct efi_systbl *efi_systbl;
+static struct efi_cfgtbl *efi_cfgtbl;
+static struct efi_rt *efi_runtime;
+
+static int efi_status2err[25] = {
+ 0, /* EFI_SUCCESS */
+ ENOEXEC, /* EFI_LOAD_ERROR */
+ EINVAL, /* EFI_INVALID_PARAMETER */
+ ENOSYS, /* EFI_UNSUPPORTED */
+ EMSGSIZE, /* EFI_BAD_BUFFER_SIZE */
+ EOVERFLOW, /* EFI_BUFFER_TOO_SMALL */
+ EBUSY, /* EFI_NOT_READY */
+ EIO, /* EFI_DEVICE_ERROR */
+ EROFS, /* EFI_WRITE_PROTECTED */
+ EAGAIN, /* EFI_OUT_OF_RESOURCES */
+ EIO, /* EFI_VOLUME_CORRUPTED */
+ ENOSPC, /* EFI_VOLUME_FULL */
+ ENXIO, /* EFI_NO_MEDIA */
+ ESTALE, /* EFI_MEDIA_CHANGED */
+ ENOENT, /* EFI_NOT_FOUND */
+ EACCES, /* EFI_ACCESS_DENIED */
+ ETIMEDOUT, /* EFI_NO_RESPONSE */
+ EADDRNOTAVAIL, /* EFI_NO_MAPPING */
+ ETIMEDOUT, /* EFI_TIMEOUT */
+ EDOOFUS, /* EFI_NOT_STARTED */
+ EALREADY, /* EFI_ALREADY_STARTED */
+ ECANCELED, /* EFI_ABORTED */
+ EPROTO, /* EFI_ICMP_ERROR */
+ EPROTO, /* EFI_TFTP_ERROR */
+ EPROTO /* EFI_PROTOCOL_ERROR */
+};
+
+static int
+efi_status_to_errno(efi_status status)
+{
+ u_long code;
+
+ code = status & 0x3ffffffffffffffful;
+ return (code < nitems(efi_status2err) ? efi_status2err[code] : EDOOFUS);
+}
+
+static struct mtx efi_lock;
+static pml4_entry_t *efi_pml4;
+static vm_object_t obj_1t1_pt;
+static vm_page_t efi_pml4_page;
+
+static void
+efi_destroy_1t1_map(void)
+{
+ vm_page_t m;
+
+ if (obj_1t1_pt != NULL) {
+ VM_OBJECT_RLOCK(obj_1t1_pt);
+ TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq)
+ m->wire_count = 0;
+ atomic_subtract_int(&vm_cnt.v_wire_count,
+ obj_1t1_pt->resident_page_count);
+ VM_OBJECT_RUNLOCK(obj_1t1_pt);
+ vm_object_deallocate(obj_1t1_pt);
+ }
+
+ obj_1t1_pt = NULL;
+ efi_pml4 = NULL;
+ efi_pml4_page = NULL;
+}
+
+static vm_page_t
+efi_1t1_page(vm_pindex_t idx)
+{
+
+ return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY |
+ VM_ALLOC_WIRED | VM_ALLOC_ZERO));
+}
+
+static pt_entry_t *
+efi_1t1_pte(vm_offset_t va)
+{
+ pml4_entry_t *pml4e;
+ pdp_entry_t *pdpe;
+ pd_entry_t *pde;
+ pt_entry_t *pte;
+ vm_page_t m;
+ vm_pindex_t pml4_idx, pdp_idx, pd_idx;
+ vm_paddr_t mphys;
+
+ pml4_idx = pmap_pml4e_index(va);
+ pml4e = &efi_pml4[pml4_idx];
+ if (*pml4e == 0) {
+ m = efi_1t1_page(1 + pml4_idx);
+ mphys = VM_PAGE_TO_PHYS(m);
+ *pml4e = mphys | X86_PG_RW | X86_PG_V;
+ } else {
+ mphys = *pml4e & ~PAGE_MASK;
+ }
+
+ pdpe = (pdp_entry_t *)PHYS_TO_DMAP(mphys);
+ pdp_idx = pmap_pdpe_index(va);
+ pdpe += pdp_idx;
+ if (*pdpe == 0) {
+ m = efi_1t1_page(1 + NPML4EPG + (pml4_idx + 1) * (pdp_idx + 1));
+ mphys = VM_PAGE_TO_PHYS(m);
+ *pdpe = mphys | X86_PG_RW | X86_PG_V;
+ } else {
+ mphys = *pdpe & ~PAGE_MASK;
+ }
+
+ pde = (pd_entry_t *)PHYS_TO_DMAP(mphys);
+ pd_idx = pmap_pde_index(va);
+ pde += pd_idx;
+ if (*pde == 0) {
+ m = efi_1t1_page(1 + NPML4EPG + NPML4EPG * NPDPEPG +
+ (pml4_idx + 1) * (pdp_idx + 1) * (pd_idx + 1));
+ mphys = VM_PAGE_TO_PHYS(m);
+ *pde = mphys | X86_PG_RW | X86_PG_V;
+ } else {
+ mphys = *pde & ~PAGE_MASK;
+ }
+
+ pte = (pt_entry_t *)PHYS_TO_DMAP(mphys);
+ pte += pmap_pte_index(va);
+ KASSERT(*pte == 0, ("va %#jx *pt %#jx", va, *pte));
+
+ return (pte);
+}
+
+static bool
+efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
+{
+ struct efi_md *p;
+ pt_entry_t *pte;
+ vm_offset_t va;
+ uint64_t idx;
+ int bits, i, mode;
+
+ obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, 1 + NPML4EPG +
+ NPML4EPG * NPDPEPG + NPML4EPG * NPDPEPG * NPDEPG,
+ VM_PROT_ALL, 0, NULL);
+ VM_OBJECT_WLOCK(obj_1t1_pt);
+ efi_pml4_page = efi_1t1_page(0);
+ VM_OBJECT_WUNLOCK(obj_1t1_pt);
+ efi_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_pml4_page));
+ pmap_pinit_pml4(efi_pml4_page);
+
+ for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p,
+ descsz)) {
+ if ((p->md_attr & EFI_MD_ATTR_RT) == 0)
+ continue;
+ if (p->md_virt != NULL) {
+ if (bootverbose)
+ printf("EFI Runtime entry %d is mapped\n", i);
+ goto fail;
+ }
+ if ((p->md_phys & EFI_PAGE_MASK) != 0) {
+ if (bootverbose)
+ printf("EFI Runtime entry %d is not aligned\n",
+ i);
+ goto fail;
+ }
+ if (p->md_phys + p->md_pages * EFI_PAGE_SIZE < p->md_phys ||
+ p->md_phys + p->md_pages * EFI_PAGE_SIZE >=
+ VM_MAXUSER_ADDRESS) {
+ printf("EFI Runtime entry %d is not in mappable for RT:"
+ "base %#016jx %#jx pages\n",
+ i, (uintmax_t)p->md_phys,
+ (uintmax_t)p->md_pages);
+ goto fail;
+ }
+ if ((p->md_attr & EFI_MD_ATTR_WB) != 0)
+ mode = VM_MEMATTR_WRITE_BACK;
+ else if ((p->md_attr & EFI_MD_ATTR_WT) != 0)
+ mode = VM_MEMATTR_WRITE_THROUGH;
+ else if ((p->md_attr & EFI_MD_ATTR_WC) != 0)
+ mode = VM_MEMATTR_WRITE_COMBINING;
+ else if ((p->md_attr & EFI_MD_ATTR_WP) != 0)
+ mode = VM_MEMATTR_WRITE_PROTECTED;
+ else if ((p->md_attr & EFI_MD_ATTR_UC) != 0)
+ mode = VM_MEMATTR_UNCACHEABLE;
+ else {
+ if (bootverbose)
+ printf("EFI Runtime entry %d mapping "
+ "attributes unsupported\n", i);
+ mode = VM_MEMATTR_UNCACHEABLE;
+ }
+ bits = pmap_cache_bits(kernel_pmap, mode, FALSE) | X86_PG_RW |
+ X86_PG_V;
+ VM_OBJECT_WLOCK(obj_1t1_pt);
+ for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++,
+ va += PAGE_SIZE) {
+ pte = efi_1t1_pte(va);
+ pte_store(pte, va | bits);
+ }
+ VM_OBJECT_WUNLOCK(obj_1t1_pt);
+ }
+
+ return (true);
+
+fail:
+ efi_destroy_1t1_map();
+ return (false);
+}
+
+/*
+ * Create an environment for the EFI runtime code call. The most
+ * important part is creating the required 1:1 physical->virtual
+ * mappings for the runtime segments. To do that, we manually create
+ * page table which unmap userspace but gives correct kernel mapping.
+ * The 1:1 mappings for runtime segments usually occupy low 4G of the
+ * physical address map.
+ *
+ * The 1:1 mappings were chosen over the SetVirtualAddressMap() EFI RT
+ * service, because there are some BIOSes which fail to correctly
+ * relocate itself on the call, requiring both 1:1 and virtual
+ * mapping. As result, we must provide 1:1 mapping anyway, so no
+ * reason to bother with the virtual map, and no need to add a
+ * complexity into loader.
+ *
+ * The fpu_kern_enter() call allows firmware to use FPU, as mandated
+ * by the specification. In particular, CR0.TS bit is cleared. Also
+ * it enters critical section, giving us neccessary protection against
+ * context switch.
+ *
+ * There is no need to disable interrupts around the change of %cr3,
+ * the kernel mappings are correct, while we only grabbed the
+ * userspace portion of VA. Interrupts handlers must not access
+ * userspace. Having interrupts enabled fixes the issue with
+ * firmware/SMM long operation, which would negatively affect IPIs,
+ * esp. TLB shootdown requests.
+ */
+static int
+efi_enter(void)
+{
+ pmap_t curpmap;
+ int error;
+
+ if (efi_runtime == NULL)
+ return (ENXIO);
+ curpmap = PCPU_GET(curpmap);
+ PMAP_LOCK(curpmap);
+ mtx_lock(&efi_lock);
+ error = fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX);
+ if (error != 0) {
+ PMAP_UNLOCK(curpmap);
+ return (error);
+ }
+
+ /*
+ * IPI TLB shootdown handler invltlb_pcid_handler() reloads
+ * %cr3 from the curpmap->pm_cr3, which would disable runtime
+ * segments mappings. Block the handler's action by setting
+ * curpmap to impossible value. See also comment in
+ * pmap.c:pmap_activate_sw().
+ */
+ if (pmap_pcid_enabled && !invpcid_works)
+ PCPU_SET(curpmap, NULL);
+
+ load_cr3(VM_PAGE_TO_PHYS(efi_pml4_page) | (pmap_pcid_enabled ?
+ curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0));
+ /*
+ * If PCID is enabled, the clear CR3_PCID_SAVE bit in the loaded %cr3
+ * causes TLB invalidation.
+ */
+ if (!pmap_pcid_enabled)
+ invltlb();
+ return (0);
+}
+
+static void
+efi_leave(void)
+{
+ pmap_t curpmap;
+
+ curpmap = &curproc->p_vmspace->vm_pmap;
+ if (pmap_pcid_enabled && !invpcid_works)
+ PCPU_SET(curpmap, curpmap);
+ load_cr3(curpmap->pm_cr3 | (pmap_pcid_enabled ?
+ curpmap->pm_pcids[PCPU_GET(cpuid)].pm_pcid : 0));
+ if (!pmap_pcid_enabled)
+ invltlb();
+
+ fpu_kern_leave(curthread, NULL);
+ mtx_unlock(&efi_lock);
+ PMAP_UNLOCK(curpmap);
+}
+
+static int
+efi_init(void)
+{
+ struct efi_map_header *efihdr;
+ struct efi_md *map;
+ caddr_t kmdp;
+ size_t efisz;
+
+ mtx_init(&efi_lock, "efi", NULL, MTX_DEF);
+
+ if (efi_systbl_phys == 0) {
+ if (bootverbose)
+ printf("EFI systbl not available\n");
+ return (ENXIO);
+ }
+ efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys);
+ if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) {
+ efi_systbl = NULL;
+ if (bootverbose)
+ printf("EFI systbl signature invalid\n");
+ return (ENXIO);
+ }
+ efi_cfgtbl = (efi_systbl->st_cfgtbl == 0) ? NULL :
+ (struct efi_cfgtbl *)efi_systbl->st_cfgtbl;
+ if (efi_cfgtbl == NULL) {
+ if (bootverbose)
+ printf("EFI config table is not present\n");
+ }
+
+ kmdp = preload_search_by_type("elf kernel");
+ if (kmdp == NULL)
+ kmdp = preload_search_by_type("elf64 kernel");
+ efihdr = (struct efi_map_header *)preload_search_info(kmdp,
+ MODINFO_METADATA | MODINFOMD_EFI_MAP);
+ if (efihdr == NULL) {
+ if (bootverbose)
+ printf("EFI map is not present\n");
+ return (ENXIO);
+ }
+ efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf;
+ map = (struct efi_md *)((uint8_t *)efihdr + efisz);
+ if (efihdr->descriptor_size == 0)
+ return (ENOMEM);
+
+ if (!efi_create_1t1_map(map, efihdr->memory_size /
+ efihdr->descriptor_size, efihdr->descriptor_size)) {
+ if (bootverbose)
+ printf("EFI cannot create runtime map\n");
+ return (ENOMEM);
+ }
+
+ efi_runtime = (efi_systbl->st_rt == 0) ? NULL :
+ (struct efi_rt *)efi_systbl->st_rt;
+ if (efi_runtime == NULL) {
+ if (bootverbose)
+ printf("EFI runtime services table is not present\n");
+ efi_destroy_1t1_map();
+ return (ENXIO);
+ }
+
+ return (0);
+}
+
+static void
+efi_uninit(void)
+{
+
+ efi_destroy_1t1_map();
+
+ efi_systbl = NULL;
+ efi_cfgtbl = NULL;
+ efi_runtime = NULL;
+
+ mtx_destroy(&efi_lock);
+}
+
+int
+efi_get_table(struct uuid *uuid, void **ptr)
+{
+ struct efi_cfgtbl *ct;
+ u_long count;
+
+ if (efi_cfgtbl == NULL)
+ return (ENXIO);
+ count = efi_systbl->st_entries;
+ ct = efi_cfgtbl;
+ while (count--) {
+ if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) {
+ *ptr = (void *)PHYS_TO_DMAP(ct->ct_data);
+ return (0);
+ }
+ ct++;
+ }
+ return (ENOENT);
+}
+
+int
+efi_get_time_locked(struct efi_tm *tm)
+{
+ efi_status status;
+ int error;
+
+ mtx_assert(&resettodr_lock, MA_OWNED);
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ status = efi_runtime->rt_gettime(tm, NULL);
+ efi_leave();
+ error = efi_status_to_errno(status);
+ return (error);
+}
+
+int
+efi_get_time(struct efi_tm *tm)
+{
+ int error;
+
+ if (efi_runtime == NULL)
+ return (ENXIO);
+ mtx_lock(&resettodr_lock);
+ error = efi_get_time_locked(tm);
+ mtx_unlock(&resettodr_lock);
+ return (error);
+}
+
+int
+efi_reset_system(void)
+{
+ int error;
+
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL);
+ efi_leave();
+ return (EIO);
+}
+
+int
+efi_set_time_locked(struct efi_tm *tm)
+{
+ efi_status status;
+ int error;
+
+ mtx_assert(&resettodr_lock, MA_OWNED);
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ status = efi_runtime->rt_settime(tm);
+ efi_leave();
+ error = efi_status_to_errno(status);
+ return (error);
+}
+
+int
+efi_set_time(struct efi_tm *tm)
+{
+ int error;
+
+ if (efi_runtime == NULL)
+ return (ENXIO);
+ mtx_lock(&resettodr_lock);
+ error = efi_set_time_locked(tm);
+ mtx_unlock(&resettodr_lock);
+ return (error);
+}
+
+int
+efi_var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib,
+ size_t *datasize, void *data)
+{
+ efi_status status;
+ int error;
+
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data);
+ efi_leave();
+ error = efi_status_to_errno(status);
+ return (error);
+}
+
+int
+efi_var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor)
+{
+ efi_status status;
+ int error;
+
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ status = efi_runtime->rt_scanvar(namesize, name, vendor);
+ efi_leave();
+ error = efi_status_to_errno(status);
+ return (error);
+}
+
+int
+efi_var_set(efi_char *name, struct uuid *vendor, uint32_t attrib,
+ size_t datasize, void *data)
+{
+ efi_status status;
+ int error;
+
+ error = efi_enter();
+ if (error != 0)
+ return (error);
+ status = efi_runtime->rt_setvar(name, vendor, attrib, datasize, data);
+ efi_leave();
+ error = efi_status_to_errno(status);
+ return (error);
+}
+
+static int
+efirt_modevents(module_t m, int event, void *arg __unused)
+{
+
+ switch (event) {
+ case MOD_LOAD:
+ return (efi_init());
+ break;
+
+ case MOD_UNLOAD:
+ efi_uninit();
+ return (0);
+
+ case MOD_SHUTDOWN:
+ return (0);
+
+ default:
+ return (EOPNOTSUPP);
+ }
+}
+
+static moduledata_t efirt_moddata = {
+ .name = "efirt",
+ .evhand = efirt_modevents,
+ .priv = NULL,
+};
+DECLARE_MODULE(efirt, efirt_moddata, SI_SUB_VM_CONF, SI_ORDER_ANY);
+MODULE_VERSION(efirt, 1);
+
+/* XXX debug stuff */
+static int
+efi_time_sysctl_handler(SYSCTL_HANDLER_ARGS)
+{
+ struct efi_tm tm;
+ int error, val;
+
+ val = 0;
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+ error = efi_get_time(&tm);
+ if (error == 0) {
+ uprintf("EFI reports: Year %d Month %d Day %d Hour %d Min %d "
+ "Sec %d\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour,
+ tm.tm_min, tm.tm_sec);
+ }
+ return (error);
+}
+
+SYSCTL_PROC(_debug, OID_AUTO, efi_time, CTLTYPE_INT | CTLFLAG_RW, NULL, 0,
+ efi_time_sysctl_handler, "I", "");
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 05b75dd..8aa21bb 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -192,7 +192,7 @@ struct msgbuf *msgbufp;
* Physical address of the EFI System Table. Stashed from the metadata hints
* passed into the kernel and used by the EFI code to call runtime services.
*/
-vm_paddr_t efi_systbl;
+vm_paddr_t efi_systbl_phys;
/* Intel ICH registers */
#define ICH_PMBASE 0x400
@@ -1502,7 +1502,7 @@ native_parse_preload_data(u_int64_t modulep)
ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
db_fetch_ksymtab(ksym_start, ksym_end);
#endif
- efi_systbl = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t);
+ efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t);
return (kmdp);
}
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
index df04f42..442819b 100644
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -239,10 +239,10 @@ minidumpsys(struct dumperinfo *di)
* page written corresponds to 1GB of space
*/
pmapsize += PAGE_SIZE;
- ii = (va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1);
+ ii = pmap_pml4e_index(va);
pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii;
pdp = (uint64_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME);
- i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
+ i = pmap_pdpe_index(va);
if ((pdp[i] & PG_V) == 0) {
va += NBPDP;
continue;
@@ -264,7 +264,7 @@ minidumpsys(struct dumperinfo *di)
pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME);
for (n = 0; n < NPDEPG; n++, va += NBPDR) {
- j = (va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1);
+ j = pmap_pde_index(va);
if ((pd[j] & PG_V) == 0)
continue;
@@ -368,10 +368,10 @@ minidumpsys(struct dumperinfo *di)
bzero(fakepd, sizeof(fakepd));
for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + nkpt * NBPDR,
kernel_vm_end); va += NBPDP) {
- ii = (va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1);
+ ii = pmap_pml4e_index(va);
pml4 = (uint64_t *)PHYS_TO_DMAP(KPML4phys) + ii;
pdp = (uint64_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME);
- i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1);
+ i = pmap_pdpe_index(va);
/* We always write a page, even if it is zero */
if ((pdp[i] & PG_V) == 0) {
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index f87d3b5..ae525da 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -673,35 +673,6 @@ pmap_pde_pindex(vm_offset_t va)
}
-/* Return various clipped indexes for a given VA */
-static __inline vm_pindex_t
-pmap_pte_index(vm_offset_t va)
-{
-
- return ((va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1));
-}
-
-static __inline vm_pindex_t
-pmap_pde_index(vm_offset_t va)
-{
-
- return ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
-}
-
-static __inline vm_pindex_t
-pmap_pdpe_index(vm_offset_t va)
-{
-
- return ((va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1));
-}
-
-static __inline vm_pindex_t
-pmap_pml4e_index(vm_offset_t va)
-{
-
- return ((va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1));
-}
-
/* Return a pointer to the PML4 slot that corresponds to a VA */
static __inline pml4_entry_t *
pmap_pml4e(pmap_t pmap, vm_offset_t va)
@@ -1353,7 +1324,7 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t entry)
* Determine the appropriate bits to set in a PTE or PDE for a specified
* caching mode.
*/
-static int
+int
pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde)
{
int cache_bits, pat_flag, pat_idx;
@@ -2374,6 +2345,29 @@ pmap_pinit0(pmap_t pmap)
CPU_FILL(&kernel_pmap->pm_active);
}
+void
+pmap_pinit_pml4(vm_page_t pml4pg)
+{
+ pml4_entry_t *pm_pml4;
+ int i;
+
+ pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pg));
+
+ /* Wire in kernel global address entries. */
+ for (i = 0; i < NKPML4E; i++) {
+ pm_pml4[KPML4BASE + i] = (KPDPphys + ptoa(i)) | X86_PG_RW |
+ X86_PG_V | PG_U;
+ }
+ for (i = 0; i < ndmpdpphys; i++) {
+ pm_pml4[DMPML4I + i] = (DMPDPphys + ptoa(i)) | X86_PG_RW |
+ X86_PG_V | PG_U;
+ }
+
+ /* install self-referential address mapping entry(s) */
+ pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | X86_PG_V | X86_PG_RW |
+ X86_PG_A | X86_PG_M;
+}
+
/*
* Initialize a preallocated and zeroed pmap structure,
* such as one in a vmspace structure.
@@ -2410,20 +2404,7 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags)
*/
if ((pmap->pm_type = pm_type) == PT_X86) {
pmap->pm_cr3 = pml4phys;
-
- /* Wire in kernel global address entries. */
- for (i = 0; i < NKPML4E; i++) {
- pmap->pm_pml4[KPML4BASE + i] = (KPDPphys + ptoa(i)) |
- X86_PG_RW | X86_PG_V | PG_U;
- }
- for (i = 0; i < ndmpdpphys; i++) {
- pmap->pm_pml4[DMPML4I + i] = (DMPDPphys + ptoa(i)) |
- X86_PG_RW | X86_PG_V | PG_U;
- }
-
- /* install self-referential address mapping entry(s) */
- pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) |
- X86_PG_V | X86_PG_RW | X86_PG_A | X86_PG_M;
+ pmap_pinit_pml4(pml4pg);
}
pmap->pm_root.rt_root = 0;
@@ -5850,6 +5831,14 @@ safe_to_clear_referenced(pmap_t pmap, pt_entry_t pte)
* should be tested and standardized at some point in the future for
* optimal aging of shared pages.
*
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits. This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified(). However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages. Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
+ *
* A DI block is not needed within this function, because
* invalidations are performed before the PV list lock is
* released.
@@ -5862,7 +5851,7 @@ pmap_ts_referenced(vm_page_t m)
pmap_t pmap;
struct rwlock *lock;
pd_entry_t oldpde, *pde;
- pt_entry_t *pte, PG_A;
+ pt_entry_t *pte, PG_A, PG_M, PG_RW;
vm_offset_t va;
vm_paddr_t pa;
int cleared, md_gen, not_cleared, pvh_gen;
@@ -5897,9 +5886,19 @@ retry:
}
}
PG_A = pmap_accessed_bit(pmap);
+ PG_M = pmap_modified_bit(pmap);
+ PG_RW = pmap_rw_bit(pmap);
va = pv->pv_va;
pde = pmap_pde(pmap, pv->pv_va);
oldpde = *pde;
+ if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
+ /*
+ * Although "oldpde" is mapping a 2MB page, because
+ * this function is called at a 4KB page granularity,
+ * we only update the 4KB page under test.
+ */
+ vm_page_dirty(m);
+ }
if ((*pde & PG_A) != 0) {
/*
* Since this reference bit is shared by 512 4KB
@@ -5993,11 +5992,15 @@ small_mappings:
}
}
PG_A = pmap_accessed_bit(pmap);
+ PG_M = pmap_modified_bit(pmap);
+ PG_RW = pmap_rw_bit(pmap);
pde = pmap_pde(pmap, pv->pv_va);
KASSERT((*pde & PG_PS) == 0,
("pmap_ts_referenced: found a 2mpage in page %p's pv list",
m));
pte = pmap_pde_to_pte(pde, pv->pv_va);
+ if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW))
+ vm_page_dirty(m);
if ((*pte & PG_A) != 0) {
if (safe_to_clear_referenced(pmap, *pte)) {
atomic_clear_long(pte, PG_A);
@@ -6865,6 +6868,7 @@ pmap_activate_sw(struct thread *td)
{
pmap_t oldpmap, pmap;
uint64_t cached, cr3;
+ register_t rflags;
u_int cpuid;
oldpmap = PCPU_GET(curpmap);
@@ -6888,16 +6892,43 @@ pmap_activate_sw(struct thread *td)
pmap == kernel_pmap,
("non-kernel pmap thread %p pmap %p cpu %d pcid %#x",
td, pmap, cpuid, pmap->pm_pcids[cpuid].pm_pcid));
+
+ /*
+ * If the INVPCID instruction is not available,
+ * invltlb_pcid_handler() is used for handle
+ * invalidate_all IPI, which checks for curpmap ==
+ * smp_tlb_pmap. Below operations sequence has a
+ * window where %CR3 is loaded with the new pmap's
+ * PML4 address, but curpmap value is not yet updated.
+ * This causes invltlb IPI handler, called between the
+ * updates, to execute as NOP, which leaves stale TLB
+ * entries.
+ *
+ * Note that the most typical use of
+ * pmap_activate_sw(), from the context switch, is
+ * immune to this race, because interrupts are
+ * disabled (while the thread lock is owned), and IPI
+ * happends after curpmap is updated. Protect other
+ * callers in a similar way, by disabling interrupts
+ * around the %cr3 register reload and curpmap
+ * assignment.
+ */
+ if (!invpcid_works)
+ rflags = intr_disable();
+
if (!cached || (cr3 & ~CR3_PCID_MASK) != pmap->pm_cr3) {
load_cr3(pmap->pm_cr3 | pmap->pm_pcids[cpuid].pm_pcid |
cached);
if (cached)
PCPU_INC(pm_save_cnt);
}
+ PCPU_SET(curpmap, pmap);
+ if (!invpcid_works)
+ intr_restore(rflags);
} else if (cr3 != pmap->pm_cr3) {
load_cr3(pmap->pm_cr3);
+ PCPU_SET(curpmap, pmap);
}
- PCPU_SET(curpmap, pmap);
#ifdef SMP
CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active);
#else
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index 4107ca6..bf10762 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -599,6 +599,9 @@ options ENABLE_ALART # Control alarm on Intel intpm driver
#
options NKPT=31
+# EFI Runtime Services support (not functional yet).
+options EFIRT
+
#####################################################################
# ABI Emulation
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index f234873..4b7df46 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -645,12 +645,36 @@ load_gs(u_short sel)
#endif
static __inline void
+bare_lgdt(struct region_descriptor *addr)
+{
+ __asm __volatile("lgdt (%0)" : : "r" (addr));
+}
+
+static __inline void
+sgdt(struct region_descriptor *addr)
+{
+ char *loc;
+
+ loc = (char *)addr;
+ __asm __volatile("sgdt %0" : "=m" (*loc) : : "memory");
+}
+
+static __inline void
lidt(struct region_descriptor *addr)
{
__asm __volatile("lidt (%0)" : : "r" (addr));
}
static __inline void
+sidt(struct region_descriptor *addr)
+{
+ char *loc;
+
+ loc = (char *)addr;
+ __asm __volatile("sidt %0" : "=m" (*loc) : : "memory");
+}
+
+static __inline void
lldt(u_short sel)
{
__asm __volatile("lldt %0" : : "r" (sel));
@@ -662,6 +686,15 @@ ltr(u_short sel)
__asm __volatile("ltr %0" : : "r" (sel));
}
+static __inline uint32_t
+read_tr(void)
+{
+ u_short sel;
+
+ __asm __volatile("str %0" : "=r" (sel));
+ return (sel);
+}
+
static __inline uint64_t
rdr0(void)
{
diff --git a/sys/amd64/include/efi.h b/sys/amd64/include/efi.h
new file mode 100644
index 0000000..272d5a8
--- /dev/null
+++ b/sys/amd64/include/efi.h
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AMD64_INCLUDE_EFI_H_
+#define __AMD64_INCLUDE_EFI_H_
+
+/*
+ * XXX: from gcc 6.2 manual:
+ * Note, the ms_abi attribute for Microsoft Windows 64-bit targets
+ * currently requires the -maccumulate-outgoing-args option.
+ */
+#define EFIABI_ATTR __attribute__((ms_abi))
+
+#ifdef _KERNEL
+struct uuid;
+struct efi_tm;
+
+int efi_get_table(struct uuid *uuid, void **ptr);
+int efi_get_time(struct efi_tm *tm);
+int efi_get_time_locked(struct efi_tm *tm);
+int efi_reset_system(void);
+int efi_set_time(struct efi_tm *tm);
+int efi_set_time_locked(struct efi_tm *tm);
+int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,
+ size_t *datasize, void *data);
+int efi_var_nextname(size_t *namesize, uint16_t *name, struct uuid *vendor);
+int efi_var_set(uint16_t *name, struct uuid *vendor, uint32_t attrib,
+ size_t datasize, void *data);
+#endif
+
+#endif /* __AMD64_INCLUDE_EFI_H_ */
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 90546f5..4d924bd 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -391,6 +391,7 @@ struct thread;
void pmap_activate_sw(struct thread *);
void pmap_bootstrap(vm_paddr_t *);
+int pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde);
int pmap_change_attr(vm_offset_t, vm_size_t, int);
void pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boolean_t invalidate);
void pmap_init_pat(void);
@@ -403,6 +404,7 @@ void *pmap_mapdev(vm_paddr_t, vm_size_t);
void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int);
boolean_t pmap_page_is_mapped(vm_page_t m);
void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma);
+void pmap_pinit_pml4(vm_page_t);
void pmap_unmapdev(vm_offset_t, vm_size_t);
void pmap_invalidate_page(pmap_t, vm_offset_t);
void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t);
@@ -416,6 +418,35 @@ boolean_t pmap_map_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t);
void pmap_unmap_io_transient(vm_page_t *, vm_offset_t *, int, boolean_t);
#endif /* _KERNEL */
+/* Return various clipped indexes for a given VA */
+static __inline vm_pindex_t
+pmap_pte_index(vm_offset_t va)
+{
+
+ return ((va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1));
+}
+
+static __inline vm_pindex_t
+pmap_pde_index(vm_offset_t va)
+{
+
+ return ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1));
+}
+
+static __inline vm_pindex_t
+pmap_pdpe_index(vm_offset_t va)
+{
+
+ return ((va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1));
+}
+
+static __inline vm_pindex_t
+pmap_pml4e_index(vm_offset_t va)
+{
+
+ return ((va >> PML4SHIFT) & ((1ul << NPML4EPGSHIFT) - 1));
+}
+
#endif /* !LOCORE */
#endif /* !_MACHINE_PMAP_H_ */
diff --git a/sys/amd64/vmm/io/iommu.c b/sys/amd64/vmm/io/iommu.c
index 9cfc4c2..75cf1ec 100644
--- a/sys/amd64/vmm/io/iommu.c
+++ b/sys/amd64/vmm/io/iommu.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
+#include <machine/cpu.h>
#include <machine/md_var.h>
#include "vmm_util.h"
@@ -51,8 +52,13 @@ 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;
+static eventhandler_tag add_tag, delete_tag;
static __inline int
IOMMU_INIT(void)
@@ -148,14 +154,31 @@ IOMMU_DISABLE(void)
(*ops->disable)();
}
-void
+static void
+iommu_pci_add(void *arg, device_t dev)
+{
+
+ /* Add new devices to the host domain. */
+ iommu_add_device(host_domain, pci_get_rid(dev));
+}
+
+static void
+iommu_pci_delete(void *arg, device_t dev)
+{
+
+ iommu_remove_device(host_domain, pci_get_rid(dev));
+}
+
+static void
iommu_init(void)
{
int error, bus, slot, func;
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 +197,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
@@ -183,6 +211,9 @@ iommu_init(void)
*/
iommu_create_mapping(host_domain, 0, 0, maxaddr);
+ add_tag = EVENTHANDLER_REGISTER(pci_add_device, iommu_pci_add, NULL, 0);
+ delete_tag = EVENTHANDLER_REGISTER(pci_delete_device, iommu_pci_delete,
+ NULL, 0);
for (bus = 0; bus <= PCI_BUSMAX; bus++) {
for (slot = 0; slot <= PCI_SLOTMAX; slot++) {
for (func = 0; func <= PCI_FUNCMAX; func++) {
@@ -190,12 +221,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));
}
@@ -208,6 +234,15 @@ iommu_init(void)
void
iommu_cleanup(void)
{
+
+ if (add_tag != NULL) {
+ EVENTHANDLER_DEREGISTER(pci_add_device, add_tag);
+ add_tag = NULL;
+ }
+ if (delete_tag != NULL) {
+ EVENTHANDLER_DEREGISTER(pci_delete_device, delete_tag);
+ delete_tag = NULL;
+ }
IOMMU_DISABLE();
IOMMU_DESTROY_DOMAIN(host_domain);
IOMMU_CLEANUP();
@@ -216,7 +251,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));
}
diff --git a/sys/amd64/vmm/io/iommu.h b/sys/amd64/vmm/io/iommu.h
index 36b44fa..a941c77 100644
--- a/sys/amd64/vmm/io/iommu.h
+++ b/sys/amd64/vmm/io/iommu.h
@@ -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);
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c
index 692190a..4c9ff47 100644
--- a/sys/amd64/vmm/io/ppt.c
+++ b/sys/amd64/vmm/io/ppt.c
@@ -362,7 +362,13 @@ ppt_assign_device(struct vm *vm, int bus, int slot, int func)
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));
return (0);
}
@@ -381,10 +387,17 @@ ppt_unassign_device(struct vm *vm, int bus, int slot, int func)
*/
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);
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);
}
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index ebd6360..537454a 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -224,11 +224,6 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, trace_guest_exceptions, CTLFLAG_RDTUN,
&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);
@@ -358,8 +353,6 @@ vmm_handler(module_t mod, int what, void *arg)
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;
@@ -396,9 +389,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).
*/
@@ -893,6 +883,8 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int func)
("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);
}
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index 5b81927..6eaab42 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -5178,6 +5178,14 @@ pmap_is_referenced(vm_page_t m)
* XXX: The exact number of bits to check and clear is a matter that
* should be tested and standardized at some point in the future for
* optimal aging of shared pages.
+ *
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits. This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified(). However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages. Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
*/
int
pmap_ts_referenced(vm_page_t m)
@@ -5186,7 +5194,7 @@ pmap_ts_referenced(vm_page_t m)
pv_entry_t pv, pvf;
pmap_t pmap;
pt1_entry_t *pte1p, opte1;
- pt2_entry_t *pte2p;
+ pt2_entry_t *pte2p, opte2;
vm_paddr_t pa;
int rtval = 0;
@@ -5205,6 +5213,14 @@ pmap_ts_referenced(vm_page_t m)
PMAP_LOCK(pmap);
pte1p = pmap_pte1(pmap, pv->pv_va);
opte1 = pte1_load(pte1p);
+ if (pte1_is_dirty(opte1)) {
+ /*
+ * Although "opte1" is mapping a 1MB page, because
+ * this function is called at a 4KB page granularity,
+ * we only update the 4KB page under test.
+ */
+ vm_page_dirty(m);
+ }
if ((opte1 & PTE1_A) != 0) {
/*
* Since this reference bit is shared by 256 4KB pages,
@@ -5253,7 +5269,10 @@ small_mappings:
("%s: not found a link in page %p's pv list", __func__, m));
pte2p = pmap_pte2_quick(pmap, pv->pv_va);
- if ((pte2_load(pte2p) & PTE2_A) != 0) {
+ opte2 = pte2_load(pte2p);
+ if (pte2_is_dirty(opte2))
+ vm_page_dirty(m);
+ if ((opte2 & PTE2_A) != 0) {
pte2_clear_bit(pte2p, PTE2_A);
pmap_tlb_flush(pmap, pv->pv_va);
rtval++;
diff --git a/sys/arm/conf/NOTES b/sys/arm/conf/NOTES
index ebb5d04..b785927 100644
--- a/sys/arm/conf/NOTES
+++ b/sys/arm/conf/NOTES
@@ -80,6 +80,7 @@ nodevice star_saver
nodevice warp_saver
nodevice cxgbe
+nodevice cxgbev
nodevice snd_cmi
#
diff --git a/sys/arm/include/efi.h b/sys/arm/include/efi.h
new file mode 100644
index 0000000..476e184
--- /dev/null
+++ b/sys/arm/include/efi.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __ARM_INCLUDE_EFI_H_
+#define __ARM_INCLUDE_EFI_H_
+
+#define EFIABI_ATTR
+
+#endif /* __ARM_INCLUDE_EFI_H_ */
diff --git a/sys/arm64/include/efi.h b/sys/arm64/include/efi.h
new file mode 100644
index 0000000..5b5a7c4
--- /dev/null
+++ b/sys/arm64/include/efi.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __ARM64_INCLUDE_EFI_H_
+#define __ARM64_INCLUDE_EFI_H_
+
+#define EFIABI_ATTR
+
+#endif /* __ARM64_INCLUDE_EFI_H_ */
diff --git a/sys/boot/efi/loader/arch/amd64/Makefile.inc b/sys/boot/efi/loader/arch/amd64/Makefile.inc
index fee959b..5649c12 100644
--- a/sys/boot/efi/loader/arch/amd64/Makefile.inc
+++ b/sys/boot/efi/loader/arch/amd64/Makefile.inc
@@ -3,7 +3,9 @@
SRCS+= amd64_tramp.S \
start.S \
framebuffer.c \
- elf64_freebsd.c
+ elf64_freebsd.c \
+ trap.c \
+ exc.S
.PATH: ${.CURDIR}/../../i386/libi386
SRCS+= nullconsole.c \
diff --git a/sys/boot/efi/loader/arch/amd64/exc.S b/sys/boot/efi/loader/arch/amd64/exc.S
new file mode 100644
index 0000000..0035d4a
--- /dev/null
+++ b/sys/boot/efi/loader/arch/amd64/exc.S
@@ -0,0 +1,165 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+ .macro EH N, err=1
+ .align 8
+ .globl EXC\N\()_handler
+EXC\N\()_handler:
+ .if \err != 1
+ pushq $0
+ .endif
+ pushq %rax
+ pushq %rdx
+ pushq %rcx
+ movl $\N,%ecx
+ jmp all_handlers
+ .endm
+
+ .text
+ EH 0,0
+ EH 1,0
+ EH 2,0
+ EH 3,0
+ EH 4,0
+ EH 5,0
+ EH 6,0
+ EH 7,0
+ EH 8
+ EH 9,0
+ EH 10
+ EH 11
+ EH 12
+ EH 13
+ EH 14
+ EH 16,0
+ EH 17
+ EH 18,0
+ EH 19,0
+ EH 20,0
+
+ .globl exc_rsp
+all_handlers:
+ cmpq %rsp,exc_rsp(%rip)
+ je exception
+
+ /*
+ * Interrupt, not exception.
+ * First, copy the hardware interrupt frame to the previous stack.
+ * Our handler always has private IST stack.
+ */
+ movq (6*8)(%rsp),%rax /* saved %rsp value, AKA old stack */
+ subq (5*8),%rax
+ movq (3*8)(%rsp),%rdx /* copy %rip to old stack */
+ movq %rdx,(%rax)
+ movq (4*8)(%rsp),%rdx /* copy %cs */
+ movq %rdx,(1*8)(%rax)
+ movq (5*8)(%rsp),%rdx /* copy %rflags */
+ movq %rdx,(2*8)(%rax)
+ movq (6*8)(%rsp),%rdx /* copy %rsp */
+ movq %rdx,(3*8)(%rax)
+ movq (7*8)(%rsp),%rdx /* copy %ss */
+ movq %rdx,(4*8)(%rax)
+
+ /*
+ * Now simulate invocation of the original interrupt handler
+ * with retq. We switch stacks and execute retq from the old
+ * stack since there is no free registers at the last moment.
+ */
+ subq $16,%rax
+ leaq fw_intr_handlers(%rip),%rdx
+ movq (%rdx,%rcx,8),%rdx /* push intr handler address on old stack */
+ movq %rdx,8(%rax)
+ movq (2*8)(%rsp),%rcx /* saved %rax is put on top of old stack */
+ movq %rcx,(%rax)
+ movq (%rsp),%rcx
+ movq 8(%rsp),%rdx
+
+ movq 32(%rsp),%rsp /* switch to old stack */
+ popq %rax
+ retq
+
+exception:
+ /*
+ * Form the struct trapframe on our IST stack.
+ * Skip three words, which are currently busy with temporal
+ * saves.
+ */
+ pushq %r15
+ pushq %r14
+ pushq %r13
+ pushq %r12
+ pushq %r11
+ pushq %r10
+ pushq %rbp
+ pushq %rbx
+ pushq $0 /* %rax */
+ pushq %r9
+ pushq %r8
+ pushq $0 /* %rcx */
+ pushq $0 /* %rdx */
+ pushq %rsi
+ pushq %rdi
+
+ /*
+ * Move %rax, %rdx, %rcx values into the final location,
+ * from the three words which were skipped above.
+ */
+ movq 0x88(%rsp),%rax
+ movq %rax,0x30(%rsp) /* tf_rax */
+ movq 0x78(%rsp),%rax
+ movq %rax,0x18(%rsp) /* tf_rcx */
+ movq 0x80(%rsp),%rax
+ movq %rax,0x10(%rsp) /* tf_rdx */
+
+ /*
+ * And fill the three words themself.
+ */
+ movq %cr2,%rax
+ movq %rax,0x80(%rsp) /* tf_addr */
+ movl %ecx,0x78(%rsp) /* tf_trapno */
+ movw %ds,0x8e(%rsp)
+ movw %es,0x8c(%rsp)
+ movw %fs,0x7c(%rsp)
+ movw %gs,0x7e(%rsp)
+ movw $0,0x88(%rsp) /* tf_flags */
+
+ /*
+ * Call dump routine.
+ */
+ movq %rsp,%rdi
+ callq report_exc
+
+ /*
+ * Hang after reporting. Interrupts are already disabled.
+ */
+1:
+ hlt
+ jmp 1b
diff --git a/sys/boot/efi/loader/arch/amd64/trap.c b/sys/boot/efi/loader/arch/amd64/trap.c
new file mode 100644
index 0000000..c821349
--- /dev/null
+++ b/sys/boot/efi/loader/arch/amd64/trap.c
@@ -0,0 +1,398 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stand.h>
+#include <string.h>
+#include <sys/param.h>
+#include <machine/cpufunc.h>
+#include <machine/psl.h>
+#include <machine/segments.h>
+#include <machine/frame.h>
+#include <machine/tss.h>
+
+#include <efi.h>
+#include <efilib.h>
+
+#include "bootstrap.h"
+#include "loader_efi.h"
+
+#define NUM_IST 8
+#define NUM_EXC 32
+
+/*
+ * This code catches exceptions but forwards hardware interrupts to
+ * handlers installed by firmware. It differentiates exceptions
+ * vs. interrupts by presence of the error code on the stack, which
+ * causes different stack pointer value on trap handler entry.
+ *
+ * Use kernel layout for the trapframe just to not be original.
+ *
+ * Use free IST slot in existing TSS, or create our own TSS if
+ * firmware did not configured any, to have stack switched to
+ * IST-specified one, e.g. to handle #SS. If hand-off cannot find
+ * unused IST slot, or create a new descriptor in GDT, we bail out.
+ */
+
+static struct region_descriptor fw_idt; /* Descriptor for pristine fw IDT */
+static struct region_descriptor loader_idt;/* Descriptor for loader
+ shadow IDT */
+static EFI_PHYSICAL_ADDRESS lidt_pa; /* Address of loader shadow IDT */
+static EFI_PHYSICAL_ADDRESS tss_pa; /* Address of TSS */
+static EFI_PHYSICAL_ADDRESS exc_stack_pa;/* Address of IST stack for loader */
+EFI_PHYSICAL_ADDRESS exc_rsp; /* %rsp value on our IST stack when
+ exception happens */
+EFI_PHYSICAL_ADDRESS fw_intr_handlers[NUM_EXC]; /* fw handlers for < 32 IDT
+ vectors */
+static int intercepted[NUM_EXC];
+static int ist; /* IST for exception handlers */
+static uint32_t tss_fw_seg; /* Fw TSS segment */
+static uint32_t loader_tss; /* Loader TSS segment */
+static struct region_descriptor fw_gdt; /* Descriptor of pristine GDT */
+static EFI_PHYSICAL_ADDRESS loader_gdt_pa; /* Address of loader shadow GDT */
+
+void report_exc(struct trapframe *tf);
+void
+report_exc(struct trapframe *tf)
+{
+
+ /* XXX using printf */
+ printf("===================================================="
+ "============================\n");
+ printf("Exception %u\n", tf->tf_trapno);
+ printf("ss 0x%04hx cs 0x%04hx ds 0x%04hx es 0x%04hx fs 0x%04hx "
+ "gs 0x%04hx\n",
+ (uint16_t)tf->tf_ss, (uint16_t)tf->tf_cs, (uint16_t)tf->tf_ds,
+ (uint16_t)tf->tf_es, (uint16_t)tf->tf_fs, (uint16_t)tf->tf_gs);
+ printf("err 0x%08x rfl 0x%08x addr 0x%016lx\n"
+ "rsp 0x%016lx rip 0x%016lx\n",
+ (uint32_t)tf->tf_err, (uint32_t)tf->tf_rflags, tf->tf_addr,
+ tf->tf_rsp, tf->tf_rip);
+ printf(
+ "rdi 0x%016lx rsi 0x%016lx rdx 0x%016lx\n"
+ "rcx 0x%016lx r8 0x%016lx r9 0x%016lx\n"
+ "rax 0x%016lx rbx 0x%016lx rbp 0x%016lx\n"
+ "r10 0x%016lx r11 0x%016lx r12 0x%016lx\n"
+ "r13 0x%016lx r14 0x%016lx r15 0x%016lx\n",
+ tf->tf_rdi, tf->tf_rsi, tf->tf_rdx, tf->tf_rcx, tf->tf_r8,
+ tf->tf_r9, tf->tf_rax, tf->tf_rbx, tf->tf_rbp, tf->tf_r10,
+ tf->tf_r11, tf->tf_r12, tf->tf_r13, tf->tf_r14, tf->tf_r15);
+ printf("Machine stopped.\n");
+}
+
+static void
+prepare_exception(unsigned idx, uint64_t my_handler,
+ int ist_use_table[static NUM_IST])
+{
+ struct gate_descriptor *fw_idt_e, *loader_idt_e;
+
+ fw_idt_e = &((struct gate_descriptor *)fw_idt.rd_base)[idx];
+ loader_idt_e = &((struct gate_descriptor *)loader_idt.rd_base)[idx];
+ fw_intr_handlers[idx] = fw_idt_e->gd_looffset +
+ (fw_idt_e->gd_hioffset << 16);
+ intercepted[idx] = 1;
+ ist_use_table[fw_idt_e->gd_ist]++;
+ loader_idt_e->gd_looffset = my_handler;
+ loader_idt_e->gd_hioffset = my_handler >> 16;
+ loader_idt_e->gd_selector = fw_idt_e->gd_selector; /* XXX */
+ loader_idt_e->gd_ist = 0;
+ loader_idt_e->gd_type = SDT_SYSIGT;
+ loader_idt_e->gd_dpl = 0;
+ loader_idt_e->gd_p = 1;
+ loader_idt_e->gd_xx = 0;
+ loader_idt_e->sd_xx1 = 0;
+}
+#define PREPARE_EXCEPTION(N) \
+ extern char EXC##N##_handler[]; \
+ prepare_exception(N, (uintptr_t)EXC##N##_handler, ist_use_table);
+
+static void
+free_tables(void)
+{
+
+ if (lidt_pa != 0) {
+ BS->FreePages(lidt_pa, EFI_SIZE_TO_PAGES(fw_idt.rd_limit));
+ lidt_pa = 0;
+ }
+ if (exc_stack_pa != 0) {
+ BS->FreePages(exc_stack_pa, 1);
+ exc_stack_pa = 0;
+ }
+ if (tss_pa != 0 && tss_fw_seg == 0) {
+ BS->FreePages(tss_pa, EFI_SIZE_TO_PAGES(sizeof(struct
+ amd64tss)));
+ tss_pa = 0;
+ }
+ if (loader_gdt_pa != 0) {
+ BS->FreePages(tss_pa, 2);
+ loader_gdt_pa = 0;
+ }
+ ist = 0;
+ loader_tss = 0;
+}
+
+static int
+efi_setup_tss(struct region_descriptor *gdt, uint32_t loader_tss_idx,
+ struct amd64tss **tss)
+{
+ EFI_STATUS status;
+ struct system_segment_descriptor *tss_desc;
+
+ tss_desc = (struct system_segment_descriptor *)(gdt->rd_base +
+ (loader_tss_idx << 3));
+ status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
+ EFI_SIZE_TO_PAGES(sizeof(struct amd64tss)), &tss_pa);
+ if (EFI_ERROR(status)) {
+ printf("efi_setup_tss: AllocatePages tss error %lu\n",
+ EFI_ERROR_CODE(status));
+ return (0);
+ }
+ *tss = (struct amd64tss *)tss_pa;
+ bzero(*tss, sizeof(**tss));
+ tss_desc->sd_lolimit = sizeof(struct amd64tss);
+ tss_desc->sd_lobase = tss_pa;
+ tss_desc->sd_type = SDT_SYSTSS;
+ tss_desc->sd_dpl = 0;
+ tss_desc->sd_p = 1;
+ tss_desc->sd_hilimit = sizeof(struct amd64tss) >> 16;
+ tss_desc->sd_gran = 0;
+ tss_desc->sd_hibase = tss_pa >> 24;
+ tss_desc->sd_xx0 = 0;
+ tss_desc->sd_xx1 = 0;
+ tss_desc->sd_mbz = 0;
+ tss_desc->sd_xx2 = 0;
+ return (1);
+}
+
+static int
+efi_redirect_exceptions(void)
+{
+ int ist_use_table[NUM_IST];
+ struct gate_descriptor *loader_idt_e;
+ struct system_segment_descriptor *tss_desc, *gdt_desc;
+ struct amd64tss *tss;
+ struct region_descriptor *gdt_rd, loader_gdt;
+ uint32_t i;
+ EFI_STATUS status;
+ register_t rfl;
+
+ sidt(&fw_idt);
+ status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
+ EFI_SIZE_TO_PAGES(fw_idt.rd_limit), &lidt_pa);
+ if (EFI_ERROR(status)) {
+ printf("efi_redirect_exceptions: AllocatePages IDT error %lu\n",
+ EFI_ERROR_CODE(status));
+ lidt_pa = 0;
+ return (0);
+ }
+ status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, 1,
+ &exc_stack_pa);
+ if (EFI_ERROR(status)) {
+ printf("efi_redirect_exceptions: AllocatePages stk error %lu\n",
+ EFI_ERROR_CODE(status));
+ exc_stack_pa = 0;
+ free_tables();
+ return (0);
+ }
+ loader_idt.rd_limit = fw_idt.rd_limit;
+ bcopy((void *)fw_idt.rd_base, (void *)loader_idt.rd_base,
+ loader_idt.rd_limit);
+ bzero(ist_use_table, sizeof(ist_use_table));
+ bzero(fw_intr_handlers, sizeof(fw_intr_handlers));
+ bzero(intercepted, sizeof(intercepted));
+
+ sgdt(&fw_gdt);
+ tss_fw_seg = read_tr();
+ gdt_rd = NULL;
+ if (tss_fw_seg == 0) {
+ for (i = 2; (i << 3) + sizeof(*gdt_desc) <= fw_gdt.rd_limit;
+ i += 2) {
+ gdt_desc = (struct system_segment_descriptor *)(
+ fw_gdt.rd_base + (i << 3));
+ if (gdt_desc->sd_type == 0 && gdt_desc->sd_mbz == 0) {
+ gdt_rd = &fw_gdt;
+ break;
+ }
+ }
+ if (gdt_rd == NULL) {
+ if (i >= 8190) {
+ printf("efi_redirect_exceptions: all slots "
+ "in gdt are used\n");
+ free_tables();
+ return (0);
+ }
+ loader_gdt.rd_limit = roundup2(fw_gdt.rd_limit +
+ sizeof(struct system_segment_descriptor),
+ sizeof(struct system_segment_descriptor)) - 1;
+ i = (loader_gdt.rd_limit + 1 -
+ sizeof(struct system_segment_descriptor)) /
+ sizeof(struct system_segment_descriptor) * 2;
+ status = BS->AllocatePages(AllocateAnyPages,
+ EfiLoaderData,
+ EFI_SIZE_TO_PAGES(loader_gdt.rd_limit),
+ &loader_gdt_pa);
+ if (EFI_ERROR(status)) {
+ printf("efi_setup_tss: AllocatePages gdt error "
+ "%lu\n", EFI_ERROR_CODE(status));
+ loader_gdt_pa = 0;
+ free_tables();
+ return (0);
+ }
+ loader_gdt.rd_base = loader_gdt_pa;
+ bzero((void *)loader_gdt.rd_base, loader_gdt.rd_limit);
+ bcopy((void *)fw_gdt.rd_base,
+ (void *)loader_gdt.rd_base, fw_gdt.rd_limit);
+ gdt_rd = &loader_gdt;
+ }
+ loader_tss = i << 3;
+ if (!efi_setup_tss(gdt_rd, i, &tss)) {
+ tss_pa = 0;
+ free_tables();
+ return (0);
+ }
+ } else {
+ tss_desc = (struct system_segment_descriptor *)((char *)
+ fw_gdt.rd_base + tss_fw_seg);
+ if (tss_desc->sd_type != SDT_SYSTSS &&
+ tss_desc->sd_type != SDT_SYSBSY) {
+ printf("LTR points to non-TSS descriptor\n");
+ free_tables();
+ return (0);
+ }
+ tss_pa = tss_desc->sd_lobase + (tss_desc->sd_hibase << 16);
+ tss = (struct amd64tss *)tss_pa;
+ tss_desc->sd_type = SDT_SYSTSS; /* unbusy */
+ }
+
+ PREPARE_EXCEPTION(0);
+ PREPARE_EXCEPTION(1);
+ PREPARE_EXCEPTION(2);
+ PREPARE_EXCEPTION(3);
+ PREPARE_EXCEPTION(4);
+ PREPARE_EXCEPTION(5);
+ PREPARE_EXCEPTION(6);
+ PREPARE_EXCEPTION(7);
+ PREPARE_EXCEPTION(8);
+ PREPARE_EXCEPTION(9);
+ PREPARE_EXCEPTION(10);
+ PREPARE_EXCEPTION(11);
+ PREPARE_EXCEPTION(12);
+ PREPARE_EXCEPTION(13);
+ PREPARE_EXCEPTION(14);
+ PREPARE_EXCEPTION(16);
+ PREPARE_EXCEPTION(17);
+ PREPARE_EXCEPTION(18);
+ PREPARE_EXCEPTION(19);
+ PREPARE_EXCEPTION(20);
+
+ exc_rsp = exc_stack_pa + PAGE_SIZE -
+ (6 /* hw exception frame */ + 3 /* scratch regs */) * 8;
+
+ /* Find free IST and use it */
+ for (ist = 1; ist < NUM_IST; ist++) {
+ if (ist_use_table[ist] == 0)
+ break;
+ }
+ if (ist == NUM_IST) {
+ printf("efi_redirect_exceptions: all ISTs used\n");
+ free_tables();
+ lidt_pa = 0;
+ return (0);
+ }
+ for (i = 0; i < NUM_EXC; i++) {
+ loader_idt_e = &((struct gate_descriptor *)loader_idt.
+ rd_base)[i];
+ if (intercepted[i])
+ loader_idt_e->gd_ist = ist;
+ }
+ (&(tss->tss_ist1))[ist - 1] = exc_stack_pa + PAGE_SIZE;
+
+ /* Switch to new IDT */
+ rfl = intr_disable();
+ if (loader_gdt_pa != 0)
+ bare_lgdt(&loader_gdt);
+ if (loader_tss != 0)
+ ltr(loader_tss);
+ lidt(&loader_idt);
+ intr_restore(rfl);
+ return (1);
+}
+
+static void
+efi_unredirect_exceptions(void)
+{
+ register_t rfl;
+
+ if (lidt_pa == 0)
+ return;
+
+ rfl = intr_disable();
+ if (ist != 0)
+ (&(((struct amd64tss *)tss_pa)->tss_ist1))[ist - 1] = 0;
+ if (loader_gdt_pa != 0)
+ bare_lgdt(&fw_gdt);
+ if (loader_tss != 0)
+ ltr(tss_fw_seg);
+ lidt(&fw_idt);
+ intr_restore(rfl);
+ free_tables();
+}
+
+static int
+command_grab_faults(int argc, char *argv[])
+{
+ int res;
+
+ res = efi_redirect_exceptions();
+ if (!res)
+ printf("failed\n");
+ return (CMD_OK);
+}
+COMMAND_SET(grap_faults, "grab_faults", "grab faults", command_grab_faults);
+
+static int
+command_ungrab_faults(int argc, char *argv[])
+{
+
+ efi_unredirect_exceptions();
+ return (CMD_OK);
+}
+COMMAND_SET(ungrab_faults, "ungrab_faults", "ungrab faults",
+ command_ungrab_faults);
+
+static int
+command_fault(int argc, char *argv[])
+{
+
+ __asm("ud2");
+ return (CMD_OK);
+}
+COMMAND_SET(fault, "fault", "generate fault", command_fault);
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 58ea13a..4037b53 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -2565,21 +2565,25 @@ xpt_action_default(union ccb *start_ccb)
abort_ccb = start_ccb->cab.abort_ccb;
if (XPT_FC_IS_DEV_QUEUED(abort_ccb)) {
+ struct cam_ed *device;
+ struct cam_devq *devq;
- if (abort_ccb->ccb_h.pinfo.index >= 0) {
- struct cam_ccbq *ccbq;
- struct cam_ed *device;
+ device = abort_ccb->ccb_h.path->device;
+ devq = device->sim->devq;
- device = abort_ccb->ccb_h.path->device;
- ccbq = &device->ccbq;
- cam_ccbq_remove_ccb(ccbq, abort_ccb);
+ mtx_lock(&devq->send_mtx);
+ if (abort_ccb->ccb_h.pinfo.index > 0) {
+ cam_ccbq_remove_ccb(&device->ccbq, abort_ccb);
abort_ccb->ccb_h.status =
CAM_REQ_ABORTED|CAM_DEV_QFRZN;
- xpt_freeze_devq(abort_ccb->ccb_h.path, 1);
+ xpt_freeze_devq_device(device, 1);
+ mtx_unlock(&devq->send_mtx);
xpt_done(abort_ccb);
start_ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
+ mtx_unlock(&devq->send_mtx);
+
if (abort_ccb->ccb_h.pinfo.index == CAM_UNQUEUED_INDEX
&& (abort_ccb->ccb_h.status & CAM_SIM_QUEUED) == 0) {
/*
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c b/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
new file mode 100644
index 0000000..652fa89
--- /dev/null
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c
@@ -0,0 +1,57 @@
+/*-
+ * Copyright 2016 Mark Johnston <markj@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/proc.h>
+#include <sys/ptrace.h>
+
+int
+uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+ ssize_t n;
+
+ PHOLD(p);
+ n = proc_readmem(curthread, p, uaddr, kaddr, len);
+ PRELE(p);
+ if (n != len)
+ return (ENOMEM);
+ return (0);
+}
+
+int
+uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+ ssize_t n;
+
+ PHOLD(p);
+ n = proc_writemem(curthread, p, uaddr, kaddr, len);
+ PRELE(p);
+ if (n != len)
+ return (ENOMEM);
+ return (0);
+}
diff --git a/sys/cddl/compat/opensolaris/sys/proc.h b/sys/cddl/compat/opensolaris/sys/proc.h
index 5c9e8de..ce503cf 100644
--- a/sys/cddl/compat/opensolaris/sys/proc.h
+++ b/sys/cddl/compat/opensolaris/sys/proc.h
@@ -92,6 +92,9 @@ do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
do_thread_create(stk, stksize, proc, arg, len, pp, state, pri)
#define thread_exit() kthread_exit()
+int uread(proc_t *, void *, size_t, uintptr_t);
+int uwrite(proc_t *, void *, size_t, uintptr_t);
+
#endif /* _KERNEL */
#endif /* _OPENSOLARIS_SYS_PROC_H_ */
diff --git a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
index 5b3f485..4f2619d 100644
--- a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
+++ b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
@@ -59,34 +59,8 @@
#include <sys/archsystm.h>
#else
#include <sys/ptrace.h>
-
-static int
-uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
- ssize_t n;
-
- PHOLD(p);
- n = proc_readmem(curthread, p, uaddr, kaddr, len);
- PRELE(p);
- if (n != len)
- return (ENOMEM);
- return (0);
-}
-
-static int
-uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
- ssize_t n;
-
- PHOLD(p);
- n = proc_writemem(curthread, p, uaddr, kaddr, len);
- PRELE(p);
- if (n != len)
- return (ENOMEM);
- return (0);
-}
-
#endif /* illumos */
+
#ifdef __i386__
#define r_rax r_eax
#define r_rbx r_ebx
diff --git a/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
index e8dd684..b0fc581 100644
--- a/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
+++ b/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
@@ -44,32 +44,6 @@
#define OP_RA(x) (((x) & 0x001F0000) >> 16)
#define OP_RB(x) (((x) & 0x0000F100) >> 11)
-static int
-uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
- ssize_t n;
-
- PHOLD(p);
- n = proc_readmem(curthread, p, uaddr, kaddr, len);
- PRELE(p);
- if (n <= 0 || n < len)
- return (ENOMEM);
- return (0);
-}
-
-static int
-uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
-{
- ssize_t n;
-
- PHOLD(p);
- n = proc_writemem(curthread, p, uaddr, kaddr, len);
- PRELE(p);
- if (n <= 0 || n < len)
- return (ENOMEM);
- return (0);
-}
-
int
fasttrap_tracepoint_install(proc_t *p, fasttrap_tracepoint_t *tp)
{
diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c
index 88e680a..014a007 100644
--- a/sys/cddl/dev/systrace/systrace.c
+++ b/sys/cddl/dev/systrace/systrace.c
@@ -193,7 +193,8 @@ systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval)
memset(uargs, 0, sizeof(uargs));
if (type == SYSTRACE_ENTRY) {
- id = sa->callp->sy_entry;
+ if ((id = sa->callp->sy_entry) == DTRACE_IDNONE)
+ return;
if (sa->callp->sy_systrace_args_func != NULL)
/*
@@ -215,7 +216,8 @@ systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval)
*/
curthread->t_dtrace_systrace_args = uargs;
} else {
- id = sa->callp->sy_return;
+ if ((id = sa->callp->sy_return) == DTRACE_IDNONE)
+ return;
curthread->t_dtrace_systrace_args = NULL;
/* Set arg0 and arg1 as the return value of this syscall. */
diff --git a/sys/compat/freebsd32/Makefile b/sys/compat/freebsd32/Makefile
index 34d3e81..bffd4af 100644
--- a/sys/compat/freebsd32/Makefile
+++ b/sys/compat/freebsd32/Makefile
@@ -8,7 +8,7 @@ all:
sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c
freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \
- ../../kern/makesyscalls.sh syscalls.master syscalls.conf
+ ../../kern/makesyscalls.sh syscalls.master syscalls.conf capabilities.conf
-mv -f freebsd32_sysent.c freebsd32_sysent.c.bak
-mv -f freebsd32_syscalls.c freebsd32_syscalls.c.bak
-mv -f freebsd32_syscall.h freebsd32_syscall.h.bak
diff --git a/sys/compat/freebsd32/capabilities.conf b/sys/compat/freebsd32/capabilities.conf
new file mode 100644
index 0000000..e14ff2d
--- /dev/null
+++ b/sys/compat/freebsd32/capabilities.conf
@@ -0,0 +1,284 @@
+##
+## Copyright (c) 2008-2010 Robert N. M. Watson
+## Copyright (c) 2016 The FreeBSD Foundation
+## All rights reserved.
+##
+## This software was developed at the University of Cambridge Computer
+## Laboratory with support from a grant from Google, Inc.
+##
+## Portions of this software were developed by Konstantin Belousov
+## under sponsorship from the FreeBSD Foundation.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions
+## are met:
+## 1. Redistributions of source code must retain the above copyright
+## notice, this list of conditions and the following disclaimer.
+## 2. Redistributions in binary form must reproduce the above copyright
+## notice, this list of conditions and the following disclaimer in the
+## documentation and/or other materials provided with the distribution.
+##
+## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+## SUCH DAMAGE.
+##
+## List of system calls enabled in freebsd32 capability mode, one name
+## per line. See the original list in the sys/kern/capabilities.conf.
+## Position of the compat syscall in this file must be identical to
+## the master, to facilitate comparision and diagnostic.
+##
+## $FreeBSD$
+##
+
+__acl_aclcheck_fd
+__acl_delete_fd
+__acl_get_fd
+__acl_set_fd
+__mac_get_fd
+#__mac_get_pid
+__mac_get_proc
+__mac_set_fd
+__mac_set_proc
+freebsd32_sysctl
+freebsd32_umtx_op
+abort2
+accept
+accept4
+aio_cancel
+freebsd32_aio_error
+aio_fsync
+freebsd32_aio_read
+freebsd32_aio_return
+freebsd32_aio_suspend
+freebsd32_aio_waitcomplete
+freebsd32_aio_write
+#audit
+bindat
+cap_enter
+cap_fcntls_get
+cap_fcntls_limit
+cap_getmode
+freebsd32_cap_ioctls_get
+freebsd32_cap_ioctls_limit
+__cap_rights_get
+cap_rights_limit
+freebsd32_clock_getres
+freebsd32_clock_gettime
+close
+closefrom
+connectat
+#cpuset
+#freebsd32_cpuset_getaffinity
+#freebsd32_cpuset_getid
+#freebsd32_cpuset_setaffinity
+#freebsd32_cpuset_setid
+dup
+dup2
+extattr_delete_fd
+extattr_get_fd
+extattr_list_fd
+extattr_set_fd
+fchflags
+fchmod
+fchown
+freebsd32_fcntl
+freebsd32_fexecve
+flock
+fork
+fpathconf
+freebsd6_freebsd32_ftruncate
+freebsd6_freebsd32_lseek
+freebsd6_freebsd32_mmap
+freebsd6_freebsd32_pread
+freebsd6_freebsd32_pwrite
+freebsd32_fstat
+fstatfs
+fsync
+ftruncate
+freebsd32_futimens
+freebsd32_futimes
+getaudit
+getaudit_addr
+getauid
+freebsd32_getcontext
+getdents
+freebsd32_getdirentries
+getdomainname
+getdtablesize
+getegid
+geteuid
+gethostid
+gethostname
+freebsd32_getitimer
+getgid
+getgroups
+getlogin
+freebsd32_getpagesize
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getresgid
+getresuid
+getrlimit
+freebsd32_getrusage
+getsid
+getsockname
+getsockopt
+freebsd32_gettimeofday
+getuid
+freebsd32_ioctl
+issetugid
+freebsd32_kevent
+kill
+freebsd32_kmq_notify
+freebsd32_kmq_setattr
+freebsd32_kmq_timedreceive
+freebsd32_kmq_timedsend
+kqueue
+freebsd32_ktimer_create
+ktimer_delete
+ktimer_getoverrun
+freebsd32_ktimer_gettime
+freebsd32_ktimer_settime
+#ktrace
+freebsd32_lio_listio
+listen
+freebsd32_lseek
+madvise
+mincore
+minherit
+mlock
+mlockall
+freebsd32_mmap
+freebsd32_mprotect
+msync
+munlock
+munlockall
+munmap
+freebsd32_nanosleep
+ntp_gettime
+freebsd6_freebsd32_aio_read
+freebsd6_freebsd32_aio_write
+obreak
+freebsd6_freebsd32_lio_listio
+chflagsat
+faccessat
+fchmodat
+fchownat
+freebsd32_fstatat
+freebsd32_futimesat
+linkat
+mkdirat
+mkfifoat
+mknodat
+openat
+readlinkat
+renameat
+symlinkat
+unlinkat
+freebsd32_utimensat
+open
+pdfork
+pdgetpid
+pdkill
+#pdwait4 # not yet implemented
+freebsd32_pipe
+pipe2
+poll
+freebsd32_pread
+freebsd32_preadv
+profil
+#ptrace
+freebsd32_pwrite
+freebsd32_pwritev
+read
+freebsd32_readv
+freebsd6_freebsd32_recv
+freebsd32_recvfrom
+freebsd32_recvmsg
+rtprio
+rtprio_thread
+sbrk
+sched_get_priority_max
+sched_get_priority_min
+sched_getparam
+sched_getscheduler
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sched_yield
+sctp_generic_recvmsg
+sctp_generic_sendmsg
+sctp_generic_sendmsg_iov
+sctp_peeloff
+freebsd32_pselect
+freebsd32_select
+freebsd6_freebsd32_send
+freebsd32_sendfile
+freebsd32_sendmsg
+sendto
+setaudit
+setaudit_addr
+setauid
+freebsd32_setcontext
+setegid
+seteuid
+setgid
+freebsd32_setitimer
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+setuid
+shm_open
+shutdown
+freebsd32_sigaction
+freebsd32_sigaltstack
+freebsd32_sigblock
+freebsd32_sigpending
+sigprocmask
+sigqueue
+freebsd32_sigreturn
+freebsd32_sigsetmask
+ofreebsd32_sigstack
+sigsuspend
+freebsd32_sigtimedwait
+freebsd32_sigvec
+freebsd32_sigwaitinfo
+sigwait
+socket
+socketpair
+sstk
+sync
+sys_exit
+freebsd32_sysarch
+thr_create
+thr_exit
+thr_kill
+#thr_kill2
+freebsd32_thr_new
+thr_self
+thr_set_name
+freebsd32_thr_suspend
+thr_wake
+umask
+utrace
+uuidgen
+write
+freebsd32_writev
+yield
diff --git a/sys/compat/freebsd32/freebsd32_capability.c b/sys/compat/freebsd32/freebsd32_capability.c
index 2aee10b..cc4cad2 100644
--- a/sys/compat/freebsd32/freebsd32_capability.c
+++ b/sys/compat/freebsd32/freebsd32_capability.c
@@ -49,18 +49,6 @@ __FBSDID("$FreeBSD$");
MALLOC_DECLARE(M_FILECAPS);
int
-freebsd32_cap_enter(struct thread *td,
- struct freebsd32_cap_enter_args *uap)
-{
-
- /*
- * We do not have an equivalent of capabilities.conf for freebsd32
- * compatibility, so do not allow capability mode for now.
- */
- return (ENOSYS);
-}
-
-int
freebsd32_cap_ioctls_limit(struct thread *td,
struct freebsd32_cap_ioctls_limit_args *uap)
{
@@ -148,14 +136,6 @@ out:
#else /* !CAPABILITIES */
int
-freebsd32_cap_enter(struct thread *td,
- struct freebsd32_cap_enter_args *uap)
-{
-
- return (ENOSYS);
-}
-
-int
freebsd32_cap_ioctls_limit(struct thread *td,
struct freebsd32_cap_ioctls_limit_args *uap)
{
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 893ad98..838d1aa 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -3048,6 +3048,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
switch (uap->com) {
case PROC_SPROTECT:
case PROC_TRACE_CTL:
+ case PROC_TRAPCAP_CTL:
error = copyin(PTRIN(uap->data), &flags, sizeof(flags));
if (error != 0)
return (error);
@@ -3077,6 +3078,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
data = &x.rk;
break;
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
data = &flags;
break;
default:
@@ -3095,6 +3097,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap)
error = error1;
break;
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
if (error == 0)
error = copyout(&flags, uap->data, sizeof(flags));
break;
diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h
index 4bd2b74..5bc7a22 100644
--- a/sys/compat/freebsd32/freebsd32_proto.h
+++ b/sys/compat/freebsd32/freebsd32_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 306586 2016-10-02 16:13:18Z kib
*/
#ifndef _FREEBSD32_SYSPROTO_H_
@@ -578,9 +578,6 @@ struct freebsd32_shmctl_args {
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char buf_l_[PADL_(struct shmid_ds32 *)]; struct shmid_ds32 * buf; char buf_r_[PADR_(struct shmid_ds32 *)];
};
-struct freebsd32_cap_enter_args {
- register_t dummy;
-};
struct freebsd32_pselect_args {
char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)];
char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)];
@@ -798,7 +795,6 @@ int freebsd32_jail_set(struct thread *, struct freebsd32_jail_set_args *);
int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *);
int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *);
int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *);
-int freebsd32_cap_enter(struct thread *, struct freebsd32_cap_enter_args *);
int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *);
#ifdef PAD64_REQUIRED
int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *);
@@ -1258,7 +1254,6 @@ int freebsd10_freebsd32_pipe(struct thread *, struct freebsd10_freebsd32_pipe_ar
#define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL
#define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL
#define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL
-#define FREEBSD32_SYS_AUE_freebsd32_cap_enter AUE_CAP_ENTER
#define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT
#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL
#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL
diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h
index 77f1166..d367534 100644
--- a/sys/compat/freebsd32/freebsd32_syscall.h
+++ b/sys/compat/freebsd32/freebsd32_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 306586 2016-10-02 16:13:18Z kib
*/
#define FREEBSD32_SYS_syscall 0
@@ -420,7 +420,7 @@
#define FREEBSD32_SYS_lpathconf 513
/* 514 is obsolete cap_new */
#define FREEBSD32_SYS___cap_rights_get 515
-#define FREEBSD32_SYS_freebsd32_cap_enter 516
+#define FREEBSD32_SYS_cap_enter 516
#define FREEBSD32_SYS_cap_getmode 517
#define FREEBSD32_SYS_pdfork 518
#define FREEBSD32_SYS_pdkill 519
diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c
index a4d7c4f..3175f2b 100644
--- a/sys/compat/freebsd32/freebsd32_syscalls.c
+++ b/sys/compat/freebsd32/freebsd32_syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 306586 2016-10-02 16:13:18Z kib
*/
const char *freebsd32_syscallnames[] = {
@@ -539,7 +539,7 @@ const char *freebsd32_syscallnames[] = {
"lpathconf", /* 513 = lpathconf */
"obs_cap_new", /* 514 = obsolete cap_new */
"__cap_rights_get", /* 515 = __cap_rights_get */
- "freebsd32_cap_enter", /* 516 = freebsd32_cap_enter */
+ "cap_enter", /* 516 = cap_enter */
"cap_getmode", /* 517 = cap_getmode */
"pdfork", /* 518 = pdfork */
"pdkill", /* 519 = pdkill */
diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c
index 7a2aa67..ff7445c 100644
--- a/sys/compat/freebsd32/freebsd32_sysent.c
+++ b/sys/compat/freebsd32/freebsd32_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 2016-08-29 05:15:43Z kib
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 306586 2016-10-02 16:13:18Z kib
*/
#include "opt_compat.h"
@@ -54,12 +54,12 @@ struct sysent freebsd32_sysent[] = {
#define PAD64_REQUIRED
#endif
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */
- { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */
- { 0, (sy_call_t *)sys_fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = fork */
- { AS(read_args), (sy_call_t *)sys_read, AUE_READ, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */
- { AS(write_args), (sy_call_t *)sys_write, AUE_WRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */
- { AS(open_args), (sy_call_t *)sys_open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = open */
- { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = close */
+ { AS(sys_exit_args), (sy_call_t *)sys_sys_exit, AUE_EXIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 1 = exit */
+ { 0, (sy_call_t *)sys_fork, AUE_FORK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = fork */
+ { AS(read_args), (sy_call_t *)sys_read, AUE_READ, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = read */
+ { AS(write_args), (sy_call_t *)sys_write, AUE_WRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = write */
+ { AS(open_args), (sy_call_t *)sys_open, AUE_OPEN_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 5 = open */
+ { AS(close_args), (sy_call_t *)sys_close, AUE_CLOSE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = close */
{ AS(freebsd32_wait4_args), (sy_call_t *)freebsd32_wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = freebsd32_wait4 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 8 = obsolete old creat */
{ AS(link_args), (sy_call_t *)sys_link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */
@@ -70,125 +70,125 @@ struct sysent freebsd32_sysent[] = {
{ AS(mknod_args), (sy_call_t *)sys_mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = mknod */
{ AS(chmod_args), (sy_call_t *)sys_chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */
{ AS(chown_args), (sy_call_t *)sys_chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */
- { AS(obreak_args), (sy_call_t *)sys_obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */
+ { AS(obreak_args), (sy_call_t *)sys_obreak, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */
{ compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */
- { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */
- { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */
+ { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */
+ { 0, (sy_call_t *)sys_getpid, AUE_GETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = getpid */
{ AS(mount_args), (sy_call_t *)sys_mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */
{ AS(unmount_args), (sy_call_t *)sys_unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */
- { AS(setuid_args), (sy_call_t *)sys_setuid, AUE_SETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = setuid */
- { 0, (sy_call_t *)sys_getuid, AUE_GETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = getuid */
- { 0, (sy_call_t *)sys_geteuid, AUE_GETEUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = geteuid */
+ { AS(setuid_args), (sy_call_t *)sys_setuid, AUE_SETUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 23 = setuid */
+ { 0, (sy_call_t *)sys_getuid, AUE_GETUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 24 = getuid */
+ { 0, (sy_call_t *)sys_geteuid, AUE_GETEUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 25 = geteuid */
{ AS(ptrace_args), (sy_call_t *)sys_ptrace, AUE_PTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = ptrace */
- { AS(freebsd32_recvmsg_args), (sy_call_t *)freebsd32_recvmsg, AUE_RECVMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = freebsd32_recvmsg */
- { AS(freebsd32_sendmsg_args), (sy_call_t *)freebsd32_sendmsg, AUE_SENDMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = freebsd32_sendmsg */
- { AS(freebsd32_recvfrom_args), (sy_call_t *)freebsd32_recvfrom, AUE_RECVFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = freebsd32_recvfrom */
- { AS(accept_args), (sy_call_t *)sys_accept, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = accept */
- { AS(getpeername_args), (sy_call_t *)sys_getpeername, AUE_GETPEERNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 31 = getpeername */
- { AS(getsockname_args), (sy_call_t *)sys_getsockname, AUE_GETSOCKNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 32 = getsockname */
+ { AS(freebsd32_recvmsg_args), (sy_call_t *)freebsd32_recvmsg, AUE_RECVMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 27 = freebsd32_recvmsg */
+ { AS(freebsd32_sendmsg_args), (sy_call_t *)freebsd32_sendmsg, AUE_SENDMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 28 = freebsd32_sendmsg */
+ { AS(freebsd32_recvfrom_args), (sy_call_t *)freebsd32_recvfrom, AUE_RECVFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 29 = freebsd32_recvfrom */
+ { AS(accept_args), (sy_call_t *)sys_accept, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = accept */
+ { AS(getpeername_args), (sy_call_t *)sys_getpeername, AUE_GETPEERNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = getpeername */
+ { AS(getsockname_args), (sy_call_t *)sys_getsockname, AUE_GETSOCKNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = getsockname */
{ AS(access_args), (sy_call_t *)sys_access, AUE_ACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = access */
{ AS(chflags_args), (sy_call_t *)sys_chflags, AUE_CHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = chflags */
- { AS(fchflags_args), (sy_call_t *)sys_fchflags, AUE_FCHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 35 = fchflags */
- { 0, (sy_call_t *)sys_sync, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = sync */
- { AS(kill_args), (sy_call_t *)sys_kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = kill */
+ { AS(fchflags_args), (sy_call_t *)sys_fchflags, AUE_FCHFLAGS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = fchflags */
+ { 0, (sy_call_t *)sys_sync, AUE_SYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = sync */
+ { AS(kill_args), (sy_call_t *)sys_kill, AUE_KILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = kill */
{ compat(AS(ofreebsd32_stat_args),freebsd32_stat), AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = old freebsd32_stat */
- { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = getppid */
+ { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = getppid */
{ compat(AS(ofreebsd32_lstat_args),freebsd32_lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old freebsd32_lstat */
- { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */
- { compat10(0,freebsd32_pipe), AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = freebsd10 freebsd32_pipe */
- { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = getegid */
- { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */
+ { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = dup */
+ { compat10(0,freebsd32_pipe), AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = freebsd10 freebsd32_pipe */
+ { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = getegid */
+ { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = profil */
{ AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */
- { compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = old freebsd32_sigaction */
- { 0, (sy_call_t *)sys_getgid, AUE_GETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = getgid */
+ { compat(AS(ofreebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = old freebsd32_sigaction */
+ { 0, (sy_call_t *)sys_getgid, AUE_GETGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = getgid */
{ compat(AS(ofreebsd32_sigprocmask_args),freebsd32_sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = old freebsd32_sigprocmask */
- { AS(getlogin_args), (sy_call_t *)sys_getlogin, AUE_GETLOGIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = getlogin */
+ { AS(getlogin_args), (sy_call_t *)sys_getlogin, AUE_GETLOGIN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = getlogin */
{ AS(setlogin_args), (sy_call_t *)sys_setlogin, AUE_SETLOGIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = setlogin */
{ AS(acct_args), (sy_call_t *)sys_acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 51 = acct */
- { compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = old freebsd32_sigpending */
- { AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = freebsd32_sigaltstack */
- { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = freebsd32_ioctl */
+ { compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = old freebsd32_sigpending */
+ { AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = freebsd32_sigaltstack */
+ { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = freebsd32_ioctl */
{ AS(reboot_args), (sy_call_t *)sys_reboot, AUE_REBOOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = reboot */
{ AS(revoke_args), (sy_call_t *)sys_revoke, AUE_REVOKE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = revoke */
{ AS(symlink_args), (sy_call_t *)sys_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = symlink */
{ AS(readlink_args), (sy_call_t *)sys_readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = readlink */
{ AS(freebsd32_execve_args), (sy_call_t *)freebsd32_execve, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = freebsd32_execve */
- { AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = umask */
+ { AS(umask_args), (sy_call_t *)sys_umask, AUE_UMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 60 = umask */
{ AS(chroot_args), (sy_call_t *)sys_chroot, AUE_CHROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = chroot */
- { compat(AS(ofreebsd32_fstat_args),freebsd32_fstat), AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = old freebsd32_fstat */
+ { compat(AS(ofreebsd32_fstat_args),freebsd32_fstat), AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 62 = old freebsd32_fstat */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 63 = obsolete ogetkerninfo */
- { compat(AS(ofreebsd32_getpagesize_args),freebsd32_getpagesize), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 64 = old freebsd32_getpagesize */
- { AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 65 = msync */
+ { compat(AS(ofreebsd32_getpagesize_args),freebsd32_getpagesize), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 64 = old freebsd32_getpagesize */
+ { AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 65 = msync */
{ 0, (sy_call_t *)sys_vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 66 = vfork */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 67 = obsolete vread */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = obsolete vwrite */
- { AS(sbrk_args), (sy_call_t *)sys_sbrk, AUE_SBRK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 69 = sbrk */
- { AS(sstk_args), (sy_call_t *)sys_sstk, AUE_SSTK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 70 = sstk */
+ { AS(sbrk_args), (sy_call_t *)sys_sbrk, AUE_SBRK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 69 = sbrk */
+ { AS(sstk_args), (sy_call_t *)sys_sstk, AUE_SSTK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 70 = sstk */
{ compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 71 = old mmap */
{ AS(ovadvise_args), (sy_call_t *)sys_ovadvise, AUE_O_VADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 72 = vadvise */
- { AS(munmap_args), (sy_call_t *)sys_munmap, AUE_MUNMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 73 = munmap */
- { AS(freebsd32_mprotect_args), (sy_call_t *)freebsd32_mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 74 = freebsd32_mprotect */
- { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 75 = madvise */
+ { AS(munmap_args), (sy_call_t *)sys_munmap, AUE_MUNMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 73 = munmap */
+ { AS(freebsd32_mprotect_args), (sy_call_t *)freebsd32_mprotect, AUE_MPROTECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 74 = freebsd32_mprotect */
+ { AS(madvise_args), (sy_call_t *)sys_madvise, AUE_MADVISE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 75 = madvise */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 76 = obsolete vhangup */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 77 = obsolete vlimit */
- { AS(mincore_args), (sy_call_t *)sys_mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 78 = mincore */
- { AS(getgroups_args), (sy_call_t *)sys_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = getgroups */
+ { AS(mincore_args), (sy_call_t *)sys_mincore, AUE_MINCORE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 78 = mincore */
+ { AS(getgroups_args), (sy_call_t *)sys_getgroups, AUE_GETGROUPS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 79 = getgroups */
{ AS(setgroups_args), (sy_call_t *)sys_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = setgroups */
- { 0, (sy_call_t *)sys_getpgrp, AUE_GETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = getpgrp */
+ { 0, (sy_call_t *)sys_getpgrp, AUE_GETPGRP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 81 = getpgrp */
{ AS(setpgid_args), (sy_call_t *)sys_setpgid, AUE_SETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 82 = setpgid */
- { AS(freebsd32_setitimer_args), (sy_call_t *)freebsd32_setitimer, AUE_SETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 83 = freebsd32_setitimer */
+ { AS(freebsd32_setitimer_args), (sy_call_t *)freebsd32_setitimer, AUE_SETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 83 = freebsd32_setitimer */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 84 = obsolete owait */
{ AS(swapon_args), (sy_call_t *)sys_swapon, AUE_SWAPON, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = swapon */
- { AS(freebsd32_getitimer_args), (sy_call_t *)freebsd32_getitimer, AUE_GETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = freebsd32_getitimer */
+ { AS(freebsd32_getitimer_args), (sy_call_t *)freebsd32_getitimer, AUE_GETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 86 = freebsd32_getitimer */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 87 = obsolete ogethostname */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 88 = obsolete osethostname */
- { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = getdtablesize */
- { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = dup2 */
+ { 0, (sy_call_t *)sys_getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 89 = getdtablesize */
+ { AS(dup2_args), (sy_call_t *)sys_dup2, AUE_DUP2, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 90 = dup2 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 91 = getdopt */
- { AS(freebsd32_fcntl_args), (sy_call_t *)freebsd32_fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = freebsd32_fcntl */
- { AS(freebsd32_select_args), (sy_call_t *)freebsd32_select, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 93 = freebsd32_select */
+ { AS(freebsd32_fcntl_args), (sy_call_t *)freebsd32_fcntl, AUE_FCNTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 92 = freebsd32_fcntl */
+ { AS(freebsd32_select_args), (sy_call_t *)freebsd32_select, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 93 = freebsd32_select */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 94 = setdopt */
- { AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 95 = fsync */
- { AS(setpriority_args), (sy_call_t *)sys_setpriority, AUE_SETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 96 = setpriority */
- { AS(socket_args), (sy_call_t *)sys_socket, AUE_SOCKET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 97 = socket */
+ { AS(fsync_args), (sy_call_t *)sys_fsync, AUE_FSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 95 = fsync */
+ { AS(setpriority_args), (sy_call_t *)sys_setpriority, AUE_SETPRIORITY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 96 = setpriority */
+ { AS(socket_args), (sy_call_t *)sys_socket, AUE_SOCKET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 97 = socket */
{ AS(connect_args), (sy_call_t *)sys_connect, AUE_CONNECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 98 = connect */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 99 = obsolete oaccept */
- { AS(getpriority_args), (sy_call_t *)sys_getpriority, AUE_GETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 100 = getpriority */
+ { AS(getpriority_args), (sy_call_t *)sys_getpriority, AUE_GETPRIORITY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 100 = getpriority */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 101 = obsolete osend */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 102 = obsolete orecv */
- { compat(AS(ofreebsd32_sigreturn_args),freebsd32_sigreturn), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = old freebsd32_sigreturn */
+ { compat(AS(ofreebsd32_sigreturn_args),freebsd32_sigreturn), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 103 = old freebsd32_sigreturn */
{ AS(bind_args), (sy_call_t *)sys_bind, AUE_BIND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 104 = bind */
- { AS(setsockopt_args), (sy_call_t *)sys_setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 105 = setsockopt */
- { AS(listen_args), (sy_call_t *)sys_listen, AUE_LISTEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 106 = listen */
+ { AS(setsockopt_args), (sy_call_t *)sys_setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 105 = setsockopt */
+ { AS(listen_args), (sy_call_t *)sys_listen, AUE_LISTEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 106 = listen */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 107 = obsolete vtimes */
- { compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), AUE_O_SIGVEC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 108 = old freebsd32_sigvec */
- { compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), AUE_O_SIGBLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 109 = old freebsd32_sigblock */
- { compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), AUE_O_SIGSETMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 110 = old freebsd32_sigsetmask */
+ { compat(AS(ofreebsd32_sigvec_args),freebsd32_sigvec), AUE_O_SIGVEC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 108 = old freebsd32_sigvec */
+ { compat(AS(ofreebsd32_sigblock_args),freebsd32_sigblock), AUE_O_SIGBLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 109 = old freebsd32_sigblock */
+ { compat(AS(ofreebsd32_sigsetmask_args),freebsd32_sigsetmask), AUE_O_SIGSETMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 110 = old freebsd32_sigsetmask */
{ compat(AS(ofreebsd32_sigsuspend_args),freebsd32_sigsuspend), AUE_SIGSUSPEND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 111 = old freebsd32_sigsuspend */
{ compat(AS(ofreebsd32_sigstack_args),freebsd32_sigstack), AUE_O_SIGSTACK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 112 = old freebsd32_sigstack */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 113 = obsolete orecvmsg */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 114 = obsolete osendmsg */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 115 = obsolete vtrace */
- { AS(freebsd32_gettimeofday_args), (sy_call_t *)freebsd32_gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 116 = freebsd32_gettimeofday */
- { AS(freebsd32_getrusage_args), (sy_call_t *)freebsd32_getrusage, AUE_GETRUSAGE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 117 = freebsd32_getrusage */
- { AS(getsockopt_args), (sy_call_t *)sys_getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 118 = getsockopt */
+ { AS(freebsd32_gettimeofday_args), (sy_call_t *)freebsd32_gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 116 = freebsd32_gettimeofday */
+ { AS(freebsd32_getrusage_args), (sy_call_t *)freebsd32_getrusage, AUE_GETRUSAGE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 117 = freebsd32_getrusage */
+ { AS(getsockopt_args), (sy_call_t *)sys_getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 118 = getsockopt */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 119 = resuba */
- { AS(freebsd32_readv_args), (sy_call_t *)freebsd32_readv, AUE_READV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 120 = freebsd32_readv */
- { AS(freebsd32_writev_args), (sy_call_t *)freebsd32_writev, AUE_WRITEV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 121 = freebsd32_writev */
+ { AS(freebsd32_readv_args), (sy_call_t *)freebsd32_readv, AUE_READV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 120 = freebsd32_readv */
+ { AS(freebsd32_writev_args), (sy_call_t *)freebsd32_writev, AUE_WRITEV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 121 = freebsd32_writev */
{ AS(freebsd32_settimeofday_args), (sy_call_t *)freebsd32_settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 122 = freebsd32_settimeofday */
- { AS(fchown_args), (sy_call_t *)sys_fchown, AUE_FCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 123 = fchown */
- { AS(fchmod_args), (sy_call_t *)sys_fchmod, AUE_FCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = fchmod */
+ { AS(fchown_args), (sy_call_t *)sys_fchown, AUE_FCHOWN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 123 = fchown */
+ { AS(fchmod_args), (sy_call_t *)sys_fchmod, AUE_FCHMOD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 124 = fchmod */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 125 = obsolete orecvfrom */
- { AS(setreuid_args), (sy_call_t *)sys_setreuid, AUE_SETREUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = setreuid */
- { AS(setregid_args), (sy_call_t *)sys_setregid, AUE_SETREGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = setregid */
+ { AS(setreuid_args), (sy_call_t *)sys_setreuid, AUE_SETREUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 126 = setreuid */
+ { AS(setregid_args), (sy_call_t *)sys_setregid, AUE_SETREGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 127 = setregid */
{ AS(rename_args), (sy_call_t *)sys_rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = rename */
{ compat(AS(otruncate_args),truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = old truncate */
- { compat(AS(oftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = old ftruncate */
- { AS(flock_args), (sy_call_t *)sys_flock, AUE_FLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = flock */
+ { compat(AS(oftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 130 = old ftruncate */
+ { AS(flock_args), (sy_call_t *)sys_flock, AUE_FLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 131 = flock */
{ AS(mkfifo_args), (sy_call_t *)sys_mkfifo, AUE_MKFIFO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = mkfifo */
- { AS(sendto_args), (sy_call_t *)sys_sendto, AUE_SENDTO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = sendto */
- { AS(shutdown_args), (sy_call_t *)sys_shutdown, AUE_SHUTDOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 134 = shutdown */
- { AS(socketpair_args), (sy_call_t *)sys_socketpair, AUE_SOCKETPAIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 135 = socketpair */
+ { AS(sendto_args), (sy_call_t *)sys_sendto, AUE_SENDTO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 133 = sendto */
+ { AS(shutdown_args), (sy_call_t *)sys_shutdown, AUE_SHUTDOWN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 134 = shutdown */
+ { AS(socketpair_args), (sy_call_t *)sys_socketpair, AUE_SOCKETPAIR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 135 = socketpair */
{ AS(mkdir_args), (sy_call_t *)sys_mkdir, AUE_MKDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 136 = mkdir */
{ AS(rmdir_args), (sy_call_t *)sys_rmdir, AUE_RMDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 137 = rmdir */
{ AS(freebsd32_utimes_args), (sy_call_t *)freebsd32_utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 138 = freebsd32_utimes */
@@ -200,7 +200,7 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 144 = obsolete getrlimit */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 145 = obsolete setrlimit */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 146 = obsolete killpg */
- { 0, (sy_call_t *)sys_setsid, AUE_SETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 147 = setsid */
+ { 0, (sy_call_t *)sys_setsid, AUE_SETSID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 147 = setsid */
{ AS(quotactl_args), (sy_call_t *)sys_quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 148 = quotactl */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 149 = obsolete oquota */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 150 = obsolete ogetsockname */
@@ -209,7 +209,7 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 153 = asyncdaemon */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 154 = nlm_syscall */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 155 = nfssvc */
- { compat(AS(ofreebsd32_getdirentries_args),freebsd32_getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = old freebsd32_getdirentries */
+ { compat(AS(ofreebsd32_getdirentries_args),freebsd32_getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 156 = old freebsd32_getdirentries */
{ compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = freebsd4 freebsd32_statfs */
{ compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = freebsd4 freebsd32_fstatfs */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 159 = nosys */
@@ -218,51 +218,51 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 162 = obsolete getdomainname */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 163 = obsolete setdomainname */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 164 = obsolete uname */
- { AS(freebsd32_sysarch_args), (sy_call_t *)freebsd32_sysarch, AUE_SYSARCH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 165 = freebsd32_sysarch */
- { AS(rtprio_args), (sy_call_t *)sys_rtprio, AUE_RTPRIO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 166 = rtprio */
+ { AS(freebsd32_sysarch_args), (sy_call_t *)freebsd32_sysarch, AUE_SYSARCH, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 165 = freebsd32_sysarch */
+ { AS(rtprio_args), (sy_call_t *)sys_rtprio, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 166 = rtprio */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 167 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 168 = nosys */
{ AS(freebsd32_semsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 169 = freebsd32_semsys */
{ AS(freebsd32_msgsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 170 = freebsd32_msgsys */
{ AS(freebsd32_shmsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 171 = freebsd32_shmsys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 172 = nosys */
- { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 173 = freebsd6 freebsd32_pread */
- { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 174 = freebsd6 freebsd32_pwrite */
+ { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6 freebsd32_pread */
+ { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 174 = freebsd6 freebsd32_pwrite */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 175 = nosys */
{ AS(ntp_adjtime_args), (sy_call_t *)sys_ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = ntp_adjtime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = sfork */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 178 = getdescriptor */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 179 = setdescriptor */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 180 = nosys */
- { AS(setgid_args), (sy_call_t *)sys_setgid, AUE_SETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = setgid */
- { AS(setegid_args), (sy_call_t *)sys_setegid, AUE_SETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = setegid */
- { AS(seteuid_args), (sy_call_t *)sys_seteuid, AUE_SETEUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = seteuid */
+ { AS(setgid_args), (sy_call_t *)sys_setgid, AUE_SETGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 181 = setgid */
+ { AS(setegid_args), (sy_call_t *)sys_setegid, AUE_SETEGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 182 = setegid */
+ { AS(seteuid_args), (sy_call_t *)sys_seteuid, AUE_SETEUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 183 = seteuid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 184 = lfs_bmapv */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 185 = lfs_markv */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 186 = lfs_segclean */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = lfs_segwait */
{ AS(freebsd32_stat_args), (sy_call_t *)freebsd32_stat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 188 = freebsd32_stat */
- { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 189 = freebsd32_fstat */
+ { AS(freebsd32_fstat_args), (sy_call_t *)freebsd32_fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 189 = freebsd32_fstat */
{ AS(freebsd32_lstat_args), (sy_call_t *)freebsd32_lstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = freebsd32_lstat */
{ AS(pathconf_args), (sy_call_t *)sys_pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 191 = pathconf */
- { AS(fpathconf_args), (sy_call_t *)sys_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 192 = fpathconf */
+ { AS(fpathconf_args), (sy_call_t *)sys_fpathconf, AUE_FPATHCONF, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 192 = fpathconf */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 193 = nosys */
- { AS(__getrlimit_args), (sy_call_t *)sys_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 194 = getrlimit */
- { AS(__setrlimit_args), (sy_call_t *)sys_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 195 = setrlimit */
- { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 196 = freebsd32_getdirentries */
- { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 197 = freebsd6 freebsd32_mmap */
+ { AS(__getrlimit_args), (sy_call_t *)sys_getrlimit, AUE_GETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 194 = getrlimit */
+ { AS(__setrlimit_args), (sy_call_t *)sys_setrlimit, AUE_SETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 195 = setrlimit */
+ { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 196 = freebsd32_getdirentries */
+ { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 197 = freebsd6 freebsd32_mmap */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 198 = __syscall */
- { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 199 = freebsd6 freebsd32_lseek */
+ { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6 freebsd32_lseek */
{ compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6 freebsd32_truncate */
{ compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 201 = freebsd6 freebsd32_ftruncate */
- { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 202 = freebsd32_sysctl */
- { AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = mlock */
- { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 204 = munlock */
+ { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 202 = freebsd32_sysctl */
+ { AS(mlock_args), (sy_call_t *)sys_mlock, AUE_MLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 203 = mlock */
+ { AS(munlock_args), (sy_call_t *)sys_munlock, AUE_MUNLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 204 = munlock */
{ AS(undelete_args), (sy_call_t *)sys_undelete, AUE_UNDELETE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = undelete */
- { AS(freebsd32_futimes_args), (sy_call_t *)freebsd32_futimes, AUE_FUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 206 = freebsd32_futimes */
- { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 207 = getpgid */
+ { AS(freebsd32_futimes_args), (sy_call_t *)freebsd32_futimes, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 206 = freebsd32_futimes */
+ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 207 = getpgid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = newreboot */
- { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 209 = poll */
+ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 209 = poll */
{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = lkmnosys */
{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = lkmnosys */
{ AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 212 = lkmnosys */
@@ -285,15 +285,15 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 229 = freebsd7 freebsd32_shmctl */
{ AS(shmdt_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 230 = shmdt */
{ AS(shmget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 231 = shmget */
- { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = freebsd32_clock_gettime */
+ { AS(freebsd32_clock_gettime_args), (sy_call_t *)freebsd32_clock_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 232 = freebsd32_clock_gettime */
{ AS(freebsd32_clock_settime_args), (sy_call_t *)freebsd32_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = freebsd32_clock_settime */
- { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = freebsd32_clock_getres */
- { AS(freebsd32_ktimer_create_args), (sy_call_t *)freebsd32_ktimer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = freebsd32_ktimer_create */
- { AS(ktimer_delete_args), (sy_call_t *)sys_ktimer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = ktimer_delete */
- { AS(freebsd32_ktimer_settime_args), (sy_call_t *)freebsd32_ktimer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = freebsd32_ktimer_settime */
- { AS(freebsd32_ktimer_gettime_args), (sy_call_t *)freebsd32_ktimer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = freebsd32_ktimer_gettime */
- { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */
- { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */
+ { AS(freebsd32_clock_getres_args), (sy_call_t *)freebsd32_clock_getres, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 234 = freebsd32_clock_getres */
+ { AS(freebsd32_ktimer_create_args), (sy_call_t *)freebsd32_ktimer_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 235 = freebsd32_ktimer_create */
+ { AS(ktimer_delete_args), (sy_call_t *)sys_ktimer_delete, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 236 = ktimer_delete */
+ { AS(freebsd32_ktimer_settime_args), (sy_call_t *)freebsd32_ktimer_settime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 237 = freebsd32_ktimer_settime */
+ { AS(freebsd32_ktimer_gettime_args), (sy_call_t *)freebsd32_ktimer_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 238 = freebsd32_ktimer_gettime */
+ { AS(ktimer_getoverrun_args), (sy_call_t *)sys_ktimer_getoverrun, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */
+ { AS(freebsd32_nanosleep_args), (sy_call_t *)freebsd32_nanosleep, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 240 = freebsd32_nanosleep */
{ AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */
{ AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */
{ AS(ffclock_getestimate_args), (sy_call_t *)sys_ffclock_getestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = ffclock_getestimate */
@@ -303,14 +303,14 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_clock_getcpuclockid2_args), (sy_call_t *)freebsd32_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = freebsd32_clock_getcpuclockid2 */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 248 = ntp_gettime */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */
- { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */
+ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 250 = minherit */
{ AS(rfork_args), (sy_call_t *)sys_rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */
{ AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = openbsd_poll */
- { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = issetugid */
+ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */
{ AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */
- { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */
- { AS(freebsd32_aio_write_args), (sy_call_t *)freebsd32_aio_write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = freebsd32_aio_write */
- { AS(freebsd32_lio_listio_args), (sy_call_t *)freebsd32_lio_listio, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = freebsd32_lio_listio */
+ { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */
+ { AS(freebsd32_aio_write_args), (sy_call_t *)freebsd32_aio_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 256 = freebsd32_aio_write */
+ { AS(freebsd32_lio_listio_args), (sy_call_t *)freebsd32_lio_listio, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 257 = freebsd32_lio_listio */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 258 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 259 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 260 = nosys */
@@ -325,12 +325,12 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 269 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 270 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 271 = nosys */
- { AS(getdents_args), (sy_call_t *)sys_getdents, AUE_O_GETDENTS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = getdents */
+ { AS(getdents_args), (sy_call_t *)sys_getdents, AUE_O_GETDENTS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 272 = getdents */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = nosys */
{ AS(lchmod_args), (sy_call_t *)sys_lchmod, AUE_LCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = lchmod */
{ AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = netbsd_lchown */
{ AS(freebsd32_lutimes_args), (sy_call_t *)freebsd32_lutimes, AUE_LUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = freebsd32_lutimes */
- { AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = netbsd_msync */
+ { AS(msync_args), (sy_call_t *)sys_msync, AUE_MSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 277 = netbsd_msync */
{ AS(nstat_args), (sy_call_t *)sys_nstat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = nstat */
{ AS(nfstat_args), (sy_call_t *)sys_nfstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = nfstat */
{ AS(nlstat_args), (sy_call_t *)sys_nlstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = nlstat */
@@ -342,8 +342,8 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 286 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 287 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 288 = nosys */
- { AS(freebsd32_preadv_args), (sy_call_t *)freebsd32_preadv, AUE_PREADV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = freebsd32_preadv */
- { AS(freebsd32_pwritev_args), (sy_call_t *)freebsd32_pwritev, AUE_PWRITEV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = freebsd32_pwritev */
+ { AS(freebsd32_preadv_args), (sy_call_t *)freebsd32_preadv, AUE_PREADV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 289 = freebsd32_preadv */
+ { AS(freebsd32_pwritev_args), (sy_call_t *)freebsd32_pwritev, AUE_PWRITEV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 290 = freebsd32_pwritev */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 291 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 292 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 293 = nosys */
@@ -363,60 +363,60 @@ struct sysent freebsd32_sysent[] = {
{ AS(kldnext_args), (sy_call_t *)sys_kldnext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = kldnext */
{ AS(freebsd32_kldstat_args), (sy_call_t *)freebsd32_kldstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = freebsd32_kldstat */
{ AS(kldfirstmod_args), (sy_call_t *)sys_kldfirstmod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = kldfirstmod */
- { AS(getsid_args), (sy_call_t *)sys_getsid, AUE_GETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = getsid */
- { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = setresuid */
- { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = setresgid */
+ { AS(getsid_args), (sy_call_t *)sys_getsid, AUE_GETSID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 310 = getsid */
+ { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */
+ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */
- { AS(freebsd32_aio_return_args), (sy_call_t *)freebsd32_aio_return, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = freebsd32_aio_return */
- { AS(freebsd32_aio_suspend_args), (sy_call_t *)freebsd32_aio_suspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = freebsd32_aio_suspend */
- { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = aio_cancel */
- { AS(freebsd32_aio_error_args), (sy_call_t *)freebsd32_aio_error, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = freebsd32_aio_error */
- { compat6(AS(freebsd6_freebsd32_aio_read_args),freebsd32_aio_read), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = freebsd6 freebsd32_aio_read */
- { compat6(AS(freebsd6_freebsd32_aio_write_args),freebsd32_aio_write), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = freebsd6 freebsd32_aio_write */
- { compat6(AS(freebsd6_freebsd32_lio_listio_args),freebsd32_lio_listio), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = freebsd6 freebsd32_lio_listio */
- { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = yield */
+ { AS(freebsd32_aio_return_args), (sy_call_t *)freebsd32_aio_return, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 314 = freebsd32_aio_return */
+ { AS(freebsd32_aio_suspend_args), (sy_call_t *)freebsd32_aio_suspend, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 315 = freebsd32_aio_suspend */
+ { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 316 = aio_cancel */
+ { AS(freebsd32_aio_error_args), (sy_call_t *)freebsd32_aio_error, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 317 = freebsd32_aio_error */
+ { compat6(AS(freebsd6_freebsd32_aio_read_args),freebsd32_aio_read), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 318 = freebsd6 freebsd32_aio_read */
+ { compat6(AS(freebsd6_freebsd32_aio_write_args),freebsd32_aio_write), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 319 = freebsd6 freebsd32_aio_write */
+ { compat6(AS(freebsd6_freebsd32_lio_listio_args),freebsd32_lio_listio), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 320 = freebsd6 freebsd32_lio_listio */
+ { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */
- { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = mlockall */
- { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = munlockall */
+ { AS(mlockall_args), (sy_call_t *)sys_mlockall, AUE_MLOCKALL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 324 = mlockall */
+ { 0, (sy_call_t *)sys_munlockall, AUE_MUNLOCKALL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 325 = munlockall */
{ AS(__getcwd_args), (sy_call_t *)sys___getcwd, AUE_GETCWD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = __getcwd */
- { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = sched_setparam */
- { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = sched_getparam */
- { AS(sched_setscheduler_args), (sy_call_t *)sys_sched_setscheduler, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = sched_setscheduler */
- { AS(sched_getscheduler_args), (sy_call_t *)sys_sched_getscheduler, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = sched_getscheduler */
- { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = sched_yield */
- { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = sched_get_priority_max */
- { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = sched_get_priority_min */
- { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */
- { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = utrace */
- { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */
+ { AS(sched_setparam_args), (sy_call_t *)sys_sched_setparam, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 327 = sched_setparam */
+ { AS(sched_getparam_args), (sy_call_t *)sys_sched_getparam, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 328 = sched_getparam */
+ { AS(sched_setscheduler_args), (sy_call_t *)sys_sched_setscheduler, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 329 = sched_setscheduler */
+ { AS(sched_getscheduler_args), (sy_call_t *)sys_sched_getscheduler, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 330 = sched_getscheduler */
+ { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */
+ { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */
+ { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */
+ { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */
+ { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */
+ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */
{ AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */
{ AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = freebsd32_jail */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = pioctl */
- { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = sigprocmask */
- { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = sigsuspend */
- { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = freebsd4 freebsd32_sigaction */
+ { AS(sigprocmask_args), (sy_call_t *)sys_sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */
+ { AS(sigsuspend_args), (sy_call_t *)sys_sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */
+ { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 342 = freebsd4 freebsd32_sigaction */
{ AS(sigpending_args), (sy_call_t *)sys_sigpending, AUE_SIGPENDING, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = sigpending */
- { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = freebsd4 freebsd32_sigreturn */
- { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = freebsd32_sigtimedwait */
- { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = freebsd32_sigwaitinfo */
+ { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 344 = freebsd4 freebsd32_sigreturn */
+ { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 345 = freebsd32_sigtimedwait */
+ { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 346 = freebsd32_sigwaitinfo */
{ AS(__acl_get_file_args), (sy_call_t *)sys___acl_get_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */
{ AS(__acl_set_file_args), (sy_call_t *)sys___acl_set_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */
- { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 349 = __acl_get_fd */
- { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 350 = __acl_set_fd */
+ { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */
+ { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */
{ AS(__acl_delete_file_args), (sy_call_t *)sys___acl_delete_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */
- { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 352 = __acl_delete_fd */
+ { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */
{ AS(__acl_aclcheck_file_args), (sy_call_t *)sys___acl_aclcheck_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */
- { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */
+ { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */
{ AS(extattrctl_args), (sy_call_t *)sys_extattrctl, AUE_EXTATTRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 355 = extattrctl */
{ AS(extattr_set_file_args), (sy_call_t *)sys_extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */
{ AS(extattr_get_file_args), (sy_call_t *)sys_extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */
{ AS(extattr_delete_file_args), (sy_call_t *)sys_extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */
- { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)freebsd32_aio_waitcomplete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 359 = freebsd32_aio_waitcomplete */
- { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 360 = getresuid */
- { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 361 = getresgid */
- { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 362 = kqueue */
- { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 363 = freebsd32_kevent */
+ { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)freebsd32_aio_waitcomplete, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 359 = freebsd32_aio_waitcomplete */
+ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */
+ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */
+ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */
+ { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd32_kevent */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */
@@ -424,9 +424,9 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 368 = __cap_set_fd */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 369 = __cap_set_file */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 370 = nosys */
- { AS(extattr_set_fd_args), (sy_call_t *)sys_extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 371 = extattr_set_fd */
- { AS(extattr_get_fd_args), (sy_call_t *)sys_extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 372 = extattr_get_fd */
- { AS(extattr_delete_fd_args), (sy_call_t *)sys_extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 373 = extattr_delete_fd */
+ { AS(extattr_set_fd_args), (sy_call_t *)sys_extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 371 = extattr_set_fd */
+ { AS(extattr_get_fd_args), (sy_call_t *)sys_extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 372 = extattr_get_fd */
+ { AS(extattr_delete_fd_args), (sy_call_t *)sys_extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 373 = extattr_delete_fd */
{ AS(__setugid_args), (sy_call_t *)sys___setugid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nfsclnt */
{ AS(eaccess_args), (sy_call_t *)sys_eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 376 = eaccess */
@@ -445,12 +445,12 @@ struct sysent freebsd32_sysent[] = {
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = __mac_set_file */
{ AS(kenv_args), (sy_call_t *)sys_kenv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 390 = kenv */
{ AS(lchflags_args), (sy_call_t *)sys_lchflags, AUE_LCHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 391 = lchflags */
- { AS(uuidgen_args), (sy_call_t *)sys_uuidgen, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 392 = uuidgen */
- { AS(freebsd32_sendfile_args), (sy_call_t *)freebsd32_sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 393 = freebsd32_sendfile */
+ { AS(uuidgen_args), (sy_call_t *)sys_uuidgen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 392 = uuidgen */
+ { AS(freebsd32_sendfile_args), (sy_call_t *)freebsd32_sendfile, AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 393 = freebsd32_sendfile */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 394 = mac_syscall */
{ AS(getfsstat_args), (sy_call_t *)sys_getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 395 = getfsstat */
{ AS(statfs_args), (sy_call_t *)sys_statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 396 = statfs */
- { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 397 = fstatfs */
+ { AS(fstatfs_args), (sy_call_t *)sys_fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 397 = fstatfs */
{ AS(fhstatfs_args), (sy_call_t *)sys_fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 398 = fhstatfs */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 399 = nosys */
{ AS(ksem_close_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 400 = ksem_close */
@@ -469,82 +469,82 @@ struct sysent freebsd32_sysent[] = {
{ AS(extattr_get_link_args), (sy_call_t *)sys_extattr_get_link, AUE_EXTATTR_GET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 413 = extattr_get_link */
{ AS(extattr_delete_link_args), (sy_call_t *)sys_extattr_delete_link, AUE_EXTATTR_DELETE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 414 = extattr_delete_link */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = __mac_execve */
- { AS(freebsd32_sigaction_args), (sy_call_t *)freebsd32_sigaction, AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 416 = freebsd32_sigaction */
- { AS(freebsd32_sigreturn_args), (sy_call_t *)freebsd32_sigreturn, AUE_SIGRETURN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 417 = freebsd32_sigreturn */
+ { AS(freebsd32_sigaction_args), (sy_call_t *)freebsd32_sigaction, AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 416 = freebsd32_sigaction */
+ { AS(freebsd32_sigreturn_args), (sy_call_t *)freebsd32_sigreturn, AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 417 = freebsd32_sigreturn */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 418 = __xstat */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 419 = __xfstat */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 420 = __xlstat */
- { AS(freebsd32_getcontext_args), (sy_call_t *)freebsd32_getcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 421 = freebsd32_getcontext */
- { AS(freebsd32_setcontext_args), (sy_call_t *)freebsd32_setcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 422 = freebsd32_setcontext */
+ { AS(freebsd32_getcontext_args), (sy_call_t *)freebsd32_getcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 421 = freebsd32_getcontext */
+ { AS(freebsd32_setcontext_args), (sy_call_t *)freebsd32_setcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 422 = freebsd32_setcontext */
{ AS(freebsd32_swapcontext_args), (sy_call_t *)freebsd32_swapcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = freebsd32_swapcontext */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 424 = swapoff */
{ AS(__acl_get_link_args), (sy_call_t *)sys___acl_get_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */
{ AS(__acl_set_link_args), (sy_call_t *)sys___acl_set_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = __acl_set_link */
{ AS(__acl_delete_link_args), (sy_call_t *)sys___acl_delete_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */
{ AS(__acl_aclcheck_link_args), (sy_call_t *)sys___acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */
- { AS(sigwait_args), (sy_call_t *)sys_sigwait, AUE_SIGWAIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 429 = sigwait */
+ { AS(sigwait_args), (sy_call_t *)sys_sigwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 429 = sigwait */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 430 = thr_create; */
- { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 431 = thr_exit */
- { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 432 = thr_self */
- { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 433 = thr_kill */
+ { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */
+ { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 432 = thr_self */
+ { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 434 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 435 = nosys */
{ AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */
- { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 437 = extattr_list_fd */
+ { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 437 = extattr_list_fd */
{ AS(extattr_list_file_args), (sy_call_t *)sys_extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */
{ AS(extattr_list_link_args), (sy_call_t *)sys_extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 439 = extattr_list_link */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 440 = kse_switchin */
{ AS(freebsd32_ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 441 = freebsd32_ksem_timedwait */
- { AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 442 = freebsd32_thr_suspend */
- { AS(thr_wake_args), (sy_call_t *)sys_thr_wake, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 443 = thr_wake */
+ { AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 442 = freebsd32_thr_suspend */
+ { AS(thr_wake_args), (sy_call_t *)sys_thr_wake, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 443 = thr_wake */
{ AS(kldunloadf_args), (sy_call_t *)sys_kldunloadf, AUE_MODUNLOAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 444 = kldunloadf */
{ AS(audit_args), (sy_call_t *)sys_audit, AUE_AUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 445 = audit */
{ AS(auditon_args), (sy_call_t *)sys_auditon, AUE_AUDITON, NULL, 0, 0, 0, SY_THR_STATIC }, /* 446 = auditon */
- { AS(getauid_args), (sy_call_t *)sys_getauid, AUE_GETAUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 447 = getauid */
- { AS(setauid_args), (sy_call_t *)sys_setauid, AUE_SETAUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 448 = setauid */
- { AS(getaudit_args), (sy_call_t *)sys_getaudit, AUE_GETAUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 449 = getaudit */
- { AS(setaudit_args), (sy_call_t *)sys_setaudit, AUE_SETAUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 450 = setaudit */
- { AS(getaudit_addr_args), (sy_call_t *)sys_getaudit_addr, AUE_GETAUDIT_ADDR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 451 = getaudit_addr */
- { AS(setaudit_addr_args), (sy_call_t *)sys_setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 452 = setaudit_addr */
+ { AS(getauid_args), (sy_call_t *)sys_getauid, AUE_GETAUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 447 = getauid */
+ { AS(setauid_args), (sy_call_t *)sys_setauid, AUE_SETAUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 448 = setauid */
+ { AS(getaudit_args), (sy_call_t *)sys_getaudit, AUE_GETAUDIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 449 = getaudit */
+ { AS(setaudit_args), (sy_call_t *)sys_setaudit, AUE_SETAUDIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 450 = setaudit */
+ { AS(getaudit_addr_args), (sy_call_t *)sys_getaudit_addr, AUE_GETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 451 = getaudit_addr */
+ { AS(setaudit_addr_args), (sy_call_t *)sys_setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 452 = setaudit_addr */
{ AS(auditctl_args), (sy_call_t *)sys_auditctl, AUE_AUDITCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 453 = auditctl */
- { AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 454 = freebsd32_umtx_op */
- { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 455 = freebsd32_thr_new */
- { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 456 = sigqueue */
+ { AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = freebsd32_umtx_op */
+ { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = freebsd32_thr_new */
+ { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */
{ AS(freebsd32_kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = freebsd32_kmq_open */
- { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */
- { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */
- { AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = freebsd32_kmq_timedsend */
- { AS(freebsd32_kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = freebsd32_kmq_notify */
+ { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */
+ { AS(freebsd32_kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 459 = freebsd32_kmq_timedreceive */
+ { AS(freebsd32_kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 460 = freebsd32_kmq_timedsend */
+ { AS(freebsd32_kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 461 = freebsd32_kmq_notify */
{ AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */
- { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 463 = abort2 */
- { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 464 = thr_set_name */
+ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */
+ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */
{ AS(freebsd32_aio_fsync_args), (sy_call_t *)freebsd32_aio_fsync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 465 = freebsd32_aio_fsync */
- { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 466 = rtprio_thread */
+ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 469 = __getpath_fromfd */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 470 = __getpath_fromaddr */
- { AS(sctp_peeloff_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 471 = sctp_peeloff */
- { AS(sctp_generic_sendmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */
- { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */
- { AS(sctp_generic_recvmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 474 = sctp_generic_recvmsg */
+ { AS(sctp_peeloff_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 471 = sctp_peeloff */
+ { AS(sctp_generic_sendmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 472 = sctp_generic_sendmsg */
+ { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 473 = sctp_generic_sendmsg_iov */
+ { AS(sctp_generic_recvmsg_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 474 = sctp_generic_recvmsg */
#ifdef PAD64_REQUIRED
- { AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 475 = freebsd32_pread */
- { AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 476 = freebsd32_pwrite */
- { AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 477 = freebsd32_mmap */
- { AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 478 = freebsd32_lseek */
+ { AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 475 = freebsd32_pread */
+ { AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 476 = freebsd32_pwrite */
+ { AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 477 = freebsd32_mmap */
+ { AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 478 = freebsd32_lseek */
{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = freebsd32_truncate */
{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 480 = freebsd32_ftruncate */
#else
- { AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 475 = freebsd32_pread */
- { AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 476 = freebsd32_pwrite */
- { AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 477 = freebsd32_mmap */
- { AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 478 = freebsd32_lseek */
+ { AS(freebsd32_pread_args), (sy_call_t *)freebsd32_pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 475 = freebsd32_pread */
+ { AS(freebsd32_pwrite_args), (sy_call_t *)freebsd32_pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 476 = freebsd32_pwrite */
+ { AS(freebsd32_mmap_args), (sy_call_t *)freebsd32_mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 477 = freebsd32_mmap */
+ { AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 478 = freebsd32_lseek */
{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = freebsd32_truncate */
{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 480 = freebsd32_ftruncate */
#endif
{ AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */
- { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 482 = shm_open */
+ { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */
{ AS(shm_unlink_args), (sy_call_t *)sys_shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */
{ AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */
#ifdef PAD64_REQUIRED
@@ -555,40 +555,40 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_cpuset_getid_args), (sy_call_t *)freebsd32_cpuset_getid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 486 = freebsd32_cpuset_getid */
{ AS(freebsd32_cpuset_getaffinity_args), (sy_call_t *)freebsd32_cpuset_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 487 = freebsd32_cpuset_getaffinity */
{ AS(freebsd32_cpuset_setaffinity_args), (sy_call_t *)freebsd32_cpuset_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 488 = freebsd32_cpuset_setaffinity */
- { AS(faccessat_args), (sy_call_t *)sys_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 489 = faccessat */
- { AS(fchmodat_args), (sy_call_t *)sys_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 490 = fchmodat */
- { AS(fchownat_args), (sy_call_t *)sys_fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 491 = fchownat */
- { AS(freebsd32_fexecve_args), (sy_call_t *)freebsd32_fexecve, AUE_FEXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 492 = freebsd32_fexecve */
- { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 493 = freebsd32_fstatat */
- { AS(freebsd32_futimesat_args), (sy_call_t *)freebsd32_futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 494 = freebsd32_futimesat */
- { AS(linkat_args), (sy_call_t *)sys_linkat, AUE_LINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 495 = linkat */
- { AS(mkdirat_args), (sy_call_t *)sys_mkdirat, AUE_MKDIRAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 496 = mkdirat */
- { AS(mkfifoat_args), (sy_call_t *)sys_mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 497 = mkfifoat */
- { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 498 = mknodat */
- { AS(openat_args), (sy_call_t *)sys_openat, AUE_OPENAT_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 499 = openat */
- { AS(readlinkat_args), (sy_call_t *)sys_readlinkat, AUE_READLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 500 = readlinkat */
- { AS(renameat_args), (sy_call_t *)sys_renameat, AUE_RENAMEAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 501 = renameat */
- { AS(symlinkat_args), (sy_call_t *)sys_symlinkat, AUE_SYMLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 502 = symlinkat */
- { AS(unlinkat_args), (sy_call_t *)sys_unlinkat, AUE_UNLINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 503 = unlinkat */
+ { AS(faccessat_args), (sy_call_t *)sys_faccessat, AUE_FACCESSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 489 = faccessat */
+ { AS(fchmodat_args), (sy_call_t *)sys_fchmodat, AUE_FCHMODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 490 = fchmodat */
+ { AS(fchownat_args), (sy_call_t *)sys_fchownat, AUE_FCHOWNAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 491 = fchownat */
+ { AS(freebsd32_fexecve_args), (sy_call_t *)freebsd32_fexecve, AUE_FEXECVE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 492 = freebsd32_fexecve */
+ { AS(freebsd32_fstatat_args), (sy_call_t *)freebsd32_fstatat, AUE_FSTATAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 493 = freebsd32_fstatat */
+ { AS(freebsd32_futimesat_args), (sy_call_t *)freebsd32_futimesat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 494 = freebsd32_futimesat */
+ { AS(linkat_args), (sy_call_t *)sys_linkat, AUE_LINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 495 = linkat */
+ { AS(mkdirat_args), (sy_call_t *)sys_mkdirat, AUE_MKDIRAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 496 = mkdirat */
+ { AS(mkfifoat_args), (sy_call_t *)sys_mkfifoat, AUE_MKFIFOAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 497 = mkfifoat */
+ { AS(mknodat_args), (sy_call_t *)sys_mknodat, AUE_MKNODAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 498 = mknodat */
+ { AS(openat_args), (sy_call_t *)sys_openat, AUE_OPENAT_RWTC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 499 = openat */
+ { AS(readlinkat_args), (sy_call_t *)sys_readlinkat, AUE_READLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 500 = readlinkat */
+ { AS(renameat_args), (sy_call_t *)sys_renameat, AUE_RENAMEAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 501 = renameat */
+ { AS(symlinkat_args), (sy_call_t *)sys_symlinkat, AUE_SYMLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 502 = symlinkat */
+ { AS(unlinkat_args), (sy_call_t *)sys_unlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 503 = unlinkat */
{ AS(posix_openpt_args), (sy_call_t *)sys_posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 504 = posix_openpt */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 505 = gssd_syscall */
{ AS(freebsd32_jail_get_args), (sy_call_t *)freebsd32_jail_get, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = freebsd32_jail_get */
{ AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = freebsd32_jail_set */
{ AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */
- { AS(closefrom_args), (sy_call_t *)sys_closefrom, AUE_CLOSEFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 509 = closefrom */
+ { AS(closefrom_args), (sy_call_t *)sys_closefrom, AUE_CLOSEFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 509 = closefrom */
{ AS(freebsd32_semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 510 = freebsd32_semctl */
{ AS(freebsd32_msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 511 = freebsd32_msgctl */
{ AS(freebsd32_shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 512 = freebsd32_shmctl */
{ AS(lpathconf_args), (sy_call_t *)sys_lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 513 = lpathconf */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 514 = obsolete cap_new */
- { AS(__cap_rights_get_args), (sy_call_t *)sys___cap_rights_get, AUE_CAP_RIGHTS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 515 = __cap_rights_get */
- { 0, (sy_call_t *)freebsd32_cap_enter, AUE_CAP_ENTER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 516 = freebsd32_cap_enter */
- { AS(cap_getmode_args), (sy_call_t *)sys_cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 517 = cap_getmode */
- { AS(pdfork_args), (sy_call_t *)sys_pdfork, AUE_PDFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 518 = pdfork */
- { AS(pdkill_args), (sy_call_t *)sys_pdkill, AUE_PDKILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 519 = pdkill */
- { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 520 = pdgetpid */
+ { AS(__cap_rights_get_args), (sy_call_t *)sys___cap_rights_get, AUE_CAP_RIGHTS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 515 = __cap_rights_get */
+ { 0, (sy_call_t *)sys_cap_enter, AUE_CAP_ENTER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 516 = cap_enter */
+ { AS(cap_getmode_args), (sy_call_t *)sys_cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 517 = cap_getmode */
+ { AS(pdfork_args), (sy_call_t *)sys_pdfork, AUE_PDFORK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 518 = pdfork */
+ { AS(pdkill_args), (sy_call_t *)sys_pdkill, AUE_PDKILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 519 = pdkill */
+ { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 520 = pdgetpid */
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait4 */
- { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 522 = freebsd32_pselect */
+ { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 522 = freebsd32_pselect */
{ AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */
{ AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */
{ AS(rctl_get_racct_args), (sy_call_t *)sys_rctl_get_racct, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_racct */
@@ -605,16 +605,16 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */
{ AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */
#endif
- { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 533 = cap_rights_limit */
- { AS(freebsd32_cap_ioctls_limit_args), (sy_call_t *)freebsd32_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 534 = freebsd32_cap_ioctls_limit */
- { AS(freebsd32_cap_ioctls_get_args), (sy_call_t *)freebsd32_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 535 = freebsd32_cap_ioctls_get */
- { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */
- { AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 537 = cap_fcntls_get */
- { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 538 = bindat */
- { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 539 = connectat */
- { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 540 = chflagsat */
- { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 541 = accept4 */
- { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 542 = pipe2 */
+ { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 533 = cap_rights_limit */
+ { AS(freebsd32_cap_ioctls_limit_args), (sy_call_t *)freebsd32_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 534 = freebsd32_cap_ioctls_limit */
+ { AS(freebsd32_cap_ioctls_get_args), (sy_call_t *)freebsd32_cap_ioctls_get, AUE_CAP_IOCTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 535 = freebsd32_cap_ioctls_get */
+ { AS(cap_fcntls_limit_args), (sy_call_t *)sys_cap_fcntls_limit, AUE_CAP_FCNTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 536 = cap_fcntls_limit */
+ { AS(cap_fcntls_get_args), (sy_call_t *)sys_cap_fcntls_get, AUE_CAP_FCNTLS_GET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 537 = cap_fcntls_get */
+ { AS(bindat_args), (sy_call_t *)sys_bindat, AUE_BINDAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 538 = bindat */
+ { AS(connectat_args), (sy_call_t *)sys_connectat, AUE_CONNECTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 539 = connectat */
+ { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */
+ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */
+ { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */
{ AS(freebsd32_aio_mlock_args), (sy_call_t *)freebsd32_aio_mlock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 543 = freebsd32_aio_mlock */
#ifdef PAD64_REQUIRED
{ AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */
@@ -622,8 +622,8 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */
#endif
{ AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */
- { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 546 = freebsd32_futimens */
- { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */
+ { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = freebsd32_futimens */
+ { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */
{ AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */
{ AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */
{ AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */
diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c
index 2618b9d..cc75370 100644
--- a/sys/compat/freebsd32/freebsd32_systrace_args.c
+++ b/sys/compat/freebsd32/freebsd32_systrace_args.c
@@ -2956,7 +2956,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
- /* freebsd32_cap_enter */
+ /* cap_enter */
case 516: {
*n_args = 0;
break;
@@ -8249,7 +8249,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
- /* freebsd32_cap_enter */
+ /* cap_enter */
case 516:
break;
/* cap_getmode */
@@ -10612,7 +10612,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "int";
break;
- /* freebsd32_cap_enter */
+ /* cap_enter */
case 516:
/* cap_getmode */
case 517:
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index d2487b1..5ba9793 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -975,7 +975,7 @@
514 AUE_NULL OBSOL cap_new
515 AUE_CAP_RIGHTS_GET NOPROTO { int __cap_rights_get(int version, \
int fd, cap_rights_t *rightsp); }
-516 AUE_CAP_ENTER STD { int freebsd32_cap_enter(void); }
+516 AUE_CAP_ENTER NOPROTO { int cap_enter(void); }
517 AUE_CAP_GETMODE NOPROTO { int cap_getmode(u_int *modep); }
518 AUE_PDFORK NOPROTO { int pdfork(int *fdp, int flags); }
519 AUE_PDKILL NOPROTO { int pdkill(int fd, int signum); }
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 837cf71..29d9171 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -1949,6 +1949,7 @@ device xmphy # XaQti XMAC II
# (and SMC COM90c66 in '56 compatibility mode) adapters.
# cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters.
# cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters.
+# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions.
# dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143
# and various workalikes including:
# the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics
@@ -2132,6 +2133,7 @@ device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# PCI Ethernet NICs.
+device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel Pro/1000 Gigabit Ethernet
device igb # Intel Pro/1000 PCIE Gigabit Ethernet
diff --git a/sys/conf/files b/sys/conf/files
index 448060c..cd81e71 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -127,6 +127,7 @@ cddl/compat/opensolaris/kern/opensolaris.c optional zfs | dtrace compile-with "
cddl/compat/opensolaris/kern/opensolaris_cmn_err.c optional zfs | dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_kmem.c optional zfs | dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_misc.c optional zfs | dtrace compile-with "${CDDL_C}"
+cddl/compat/opensolaris/kern/opensolaris_proc.c optional zfs | dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_sunddi.c optional zfs | dtrace compile-with "${CDDL_C}"
cddl/compat/opensolaris/kern/opensolaris_taskq.c optional zfs | dtrace compile-with "${CDDL_C}"
# zfs specific
@@ -1243,6 +1244,9 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb pci \
compile-with "${NORMAL_C} -I$S/dev/cxgb"
dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \
compile-with "${NORMAL_C} -I$S/dev/cxgb"
+dev/cxgbe/t4_if.m optional cxgbe pci
+dev/cxgbe/t4_iov.c optional cxgbe pci \
+ compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/t4_mp_ring.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/t4_main.c optional cxgbe pci \
@@ -1255,8 +1259,12 @@ dev/cxgbe/t4_l2t.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/t4_tracer.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
+dev/cxgbe/t4_vf.c optional cxgbev pci \
+ compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/common/t4_hw.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
+dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \
+ compile-with "${NORMAL_C} -I$S/dev/cxgbe"
t4fw_cfg.c optional cxgbe \
compile-with "${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \
no-implicit-rule before-depend local \
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 186ea7d..72b8666 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -110,6 +110,7 @@ amd64/amd64/cpu_switch.S standard
amd64/amd64/db_disasm.c optional ddb
amd64/amd64/db_interface.c optional ddb
amd64/amd64/db_trace.c optional ddb
+amd64/amd64/efirt.c optional efirt
amd64/amd64/elf_machdep.c standard
amd64/amd64/exception.S standard
amd64/amd64/fpu.c standard
diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64
index f1d4b4a..a582553 100644
--- a/sys/conf/options.amd64
+++ b/sys/conf/options.amd64
@@ -65,3 +65,6 @@ XENHVM opt_global.h
# options for the Intel C600 SAS driver (isci)
ISCI_LOGGING opt_isci.h
+
+# EFI Runtime services support
+EFIRT opt_efirt.h
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index d311245..e3b3981 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -195,6 +195,7 @@ enum {
ADAP_SYSCTL_CTX = (1 << 4),
/* TOM_INIT_DONE= (1 << 5), No longer used */
BUF_PACKING_OK = (1 << 6),
+ IS_VF = (1 << 7),
CXGBE_BUSY = (1 << 9),
@@ -429,6 +430,7 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORBELL_UDBWC, DOORBELL_KDB};
struct sge_eq {
unsigned int flags; /* MUST be first */
unsigned int cntxt_id; /* SGE context id for the eq */
+ unsigned int abs_id; /* absolute SGE id for the eq */
struct mtx eq_lock;
struct tx_desc *desc; /* KVA of descriptor ring */
@@ -737,8 +739,10 @@ struct sge {
struct sge_nm_txq *nm_txq; /* netmap tx queues */
struct sge_nm_rxq *nm_rxq; /* netmap rx queues */
- uint16_t iq_start;
- int eq_start;
+ uint16_t iq_start; /* first cntxt_id */
+ uint16_t iq_base; /* first abs_id */
+ int eq_start; /* first cntxt_id */
+ int eq_base; /* first abs_id */
struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */
struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */
@@ -781,6 +785,8 @@ struct adapter {
struct sge_rxq *rxq;
struct sge_nm_rxq *nm_rxq;
} __aligned(CACHE_LINE_SIZE) *irq;
+ int sge_gts_reg;
+ int sge_kdoorbell_reg;
bus_dma_tag_t dmat; /* Parent DMA tag */
@@ -938,6 +944,9 @@ struct adapter {
/* One for errors, one for firmware events */
#define T4_EXTRA_INTR 2
+/* One for firmware events */
+#define T4VF_EXTRA_INTR 1
+
static inline uint32_t
t4_read_reg(struct adapter *sc, uint32_t reg)
{
@@ -1072,13 +1081,34 @@ t4_use_ldst(struct adapter *sc)
}
/* t4_main.c */
+extern int t4_ntxq10g;
+extern int t4_nrxq10g;
+extern int t4_ntxq1g;
+extern int t4_nrxq1g;
+extern int t4_intr_types;
+extern int t4_tmr_idx_10g;
+extern int t4_pktc_idx_10g;
+extern int t4_tmr_idx_1g;
+extern int t4_pktc_idx_1g;
+extern unsigned int t4_qsize_rxq;
+extern unsigned int t4_qsize_txq;
+extern device_method_t cxgbe_methods[];
+
int t4_os_find_pci_capability(struct adapter *, int);
int t4_os_pci_save_state(struct adapter *);
int t4_os_pci_restore_state(struct adapter *);
void t4_os_portmod_changed(const struct adapter *, int);
void t4_os_link_changed(struct adapter *, int, int, int);
void t4_iterate(void (*)(struct adapter *, void *), void *);
+void t4_add_adapter(struct adapter *);
+int t4_detach_common(device_t);
int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
+int t4_map_bars_0_and_4(struct adapter *);
+int t4_map_bar_2(struct adapter *);
+int t4_set_sched_class(struct adapter *, struct t4_sched_params *);
+int t4_set_sched_queue(struct adapter *, struct t4_sched_queue *);
+int t4_setup_intr_handlers(struct adapter *);
+void t4_sysctls(struct adapter *);
int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *);
void doom_vi(struct adapter *, struct vi_info *);
void end_synchronized_op(struct adapter *, int);
@@ -1119,7 +1149,7 @@ void t4_intr_err(void *);
void t4_intr_evt(void *);
void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);
void t4_update_fl_bufsize(struct ifnet *);
-int parse_pkt(struct mbuf **);
+int parse_pkt(struct adapter *, struct mbuf **);
void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *);
void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *);
int tnl_cong(struct port_info *, int);
diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index cc6edf3..8a738ed 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -215,6 +215,8 @@ struct sge_params {
int pad_boundary;
int pack_boundary;
int fl_pktshift;
+ u32 sge_control;
+ u32 sge_fl_buffer_size[SGE_FLBUF_SIZES];
};
struct tp_params {
@@ -278,12 +280,52 @@ struct chip_params {
u16 mps_tcam_size;
};
+/* VF-only parameters. */
+
+/*
+ * Global Receive Side Scaling (RSS) parameters in host-native format.
+ */
+struct rss_params {
+ unsigned int mode; /* RSS mode */
+ union {
+ struct {
+ u_int synmapen:1; /* SYN Map Enable */
+ u_int syn4tupenipv6:1; /* enable hashing 4-tuple IPv6 SYNs */
+ u_int syn2tupenipv6:1; /* enable hashing 2-tuple IPv6 SYNs */
+ u_int syn4tupenipv4:1; /* enable hashing 4-tuple IPv4 SYNs */
+ u_int syn2tupenipv4:1; /* enable hashing 2-tuple IPv4 SYNs */
+ u_int ofdmapen:1; /* Offload Map Enable */
+ u_int tnlmapen:1; /* Tunnel Map Enable */
+ u_int tnlalllookup:1; /* Tunnel All Lookup */
+ u_int hashtoeplitz:1; /* use Toeplitz hash */
+ } basicvirtual;
+ } u;
+};
+
+/*
+ * Maximum resources provisioned for a PCI VF.
+ */
+struct vf_resources {
+ unsigned int nvi; /* N virtual interfaces */
+ unsigned int neq; /* N egress Qs */
+ unsigned int nethctrl; /* N egress ETH or CTRL Qs */
+ unsigned int niqflint; /* N ingress Qs/w free list(s) & intr */
+ unsigned int niq; /* N ingress Qs */
+ unsigned int tc; /* PCI-E traffic class */
+ unsigned int pmask; /* port access rights mask */
+ unsigned int nexactf; /* N exact MPS filters */
+ unsigned int r_caps; /* read capabilities */
+ unsigned int wx_caps; /* write/execute capabilities */
+};
+
struct adapter_params {
struct sge_params sge;
- struct tp_params tp;
+ struct tp_params tp; /* PF-only */
struct vpd_params vpd;
struct pci_params pci;
- struct devlog_params devlog;
+ struct devlog_params devlog; /* PF-only */
+ struct rss_params rss; /* VF-only */
+ struct vf_resources vfres; /* VF-only */
unsigned int sf_size; /* serial flash size in bytes */
unsigned int sf_nsec; /* # of flash sectors */
@@ -509,6 +551,7 @@ int t4_get_fw_version(struct adapter *adapter, u32 *vers);
int t4_get_tp_version(struct adapter *adapter, u32 *vers);
int t4_get_exprom_version(struct adapter *adapter, u32 *vers);
int t4_init_hw(struct adapter *adapter, u32 fw_params);
+const struct chip_params *t4_get_chip_params(int chipid);
int t4_prep_adapter(struct adapter *adapter, u8 *buf);
int t4_shutdown_adapter(struct adapter *adapter);
int t4_init_devlog_params(struct adapter *adapter, int fw_attach);
@@ -716,4 +759,32 @@ int t4_config_watchdog(struct adapter *adapter, unsigned int mbox,
int t4_get_devlog_level(struct adapter *adapter, unsigned int *level);
int t4_set_devlog_level(struct adapter *adapter, unsigned int level);
void t4_sge_decode_idma_state(struct adapter *adapter, int state);
+
+static inline int t4vf_query_params(struct adapter *adapter,
+ unsigned int nparams, const u32 *params,
+ u32 *vals)
+{
+ return t4_query_params(adapter, 0, 0, 0, nparams, params, vals);
+}
+
+static inline int t4vf_set_params(struct adapter *adapter,
+ unsigned int nparams, const u32 *params,
+ const u32 *vals)
+{
+ return t4_set_params(adapter, 0, 0, 0, nparams, params, vals);
+}
+
+static inline int t4vf_wr_mbox(struct adapter *adap, const void *cmd,
+ int size, void *rpl)
+{
+ return t4_wr_mbox(adap, adap->mbox, cmd, size, rpl);
+}
+
+int t4vf_wait_dev_ready(struct adapter *adapter);
+int t4vf_fw_reset(struct adapter *adapter);
+int t4vf_get_sge_params(struct adapter *adapter);
+int t4vf_get_rss_glb_config(struct adapter *adapter);
+int t4vf_get_vfres(struct adapter *adapter);
+int t4vf_prep_adapter(struct adapter *adapter);
+
#endif /* __CHELSIO_COMMON_H */
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index 7ecdb81..6a2e65a 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -289,6 +289,14 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
if ((size & 15) || size > MBOX_LEN)
return -EINVAL;
+ if (adap->flags & IS_VF) {
+ if (is_t6(adap))
+ data_reg = FW_T6VF_MBDATA_BASE_ADDR;
+ else
+ data_reg = FW_T4VF_MBDATA_BASE_ADDR;
+ ctl_reg = VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL);
+ }
+
/*
* If we have a negative timeout, that implies that we can't sleep.
*/
@@ -343,6 +351,22 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
for (i = 0; i < size; i += 8, p++)
t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p));
+ if (adap->flags & IS_VF) {
+ /*
+ * For the VFs, the Mailbox Data "registers" are
+ * actually backed by T4's "MA" interface rather than
+ * PL Registers (as is the case for the PFs). Because
+ * these are in different coherency domains, the write
+ * to the VF's PL-register-backed Mailbox Control can
+ * race in front of the writes to the MA-backed VF
+ * Mailbox Data "registers". So we need to do a
+ * read-back on at least one byte of the VF Mailbox
+ * Data registers before doing the write to the VF
+ * Mailbox Control register.
+ */
+ t4_read_reg(adap, data_reg);
+ }
+
CH_DUMP_MBOX(adap, mbox, data_reg);
t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW));
@@ -355,10 +379,13 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd,
* Loop waiting for the reply; bail out if we time out or the firmware
* reports an error.
*/
- for (i = 0;
- !((pcie_fw = t4_read_reg(adap, A_PCIE_FW)) & F_PCIE_FW_ERR) &&
- i < timeout;
- i += ms) {
+ pcie_fw = 0;
+ for (i = 0; i < timeout; i += ms) {
+ if (!(adap->flags & IS_VF)) {
+ pcie_fw = t4_read_reg(adap, A_PCIE_FW);
+ if (pcie_fw & F_PCIE_FW_ERR)
+ break;
+ }
if (sleep_ok) {
ms = delay[delay_idx]; /* last element may repeat */
if (delay_idx < ARRAY_SIZE(delay) - 1)
@@ -698,10 +725,14 @@ unsigned int t4_get_regs_len(struct adapter *adapter)
switch (chip_version) {
case CHELSIO_T4:
+ if (adapter->flags & IS_VF)
+ return FW_T4VF_REGMAP_SIZE;
return T4_REGMAP_SIZE;
case CHELSIO_T5:
case CHELSIO_T6:
+ if (adapter->flags & IS_VF)
+ return FW_T4VF_REGMAP_SIZE;
return T5_REGMAP_SIZE;
}
@@ -1180,6 +1211,18 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size)
0x27e00, 0x27e04,
};
+ static const unsigned int t4vf_reg_ranges[] = {
+ VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS),
+ VF_MPS_REG(A_MPS_VF_CTL),
+ VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H),
+ VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_WHOAMI),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS),
+ FW_T4VF_MBDATA_BASE_ADDR,
+ FW_T4VF_MBDATA_BASE_ADDR +
+ ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4),
+ };
+
static const unsigned int t5_reg_ranges[] = {
0x1008, 0x10c0,
0x10cc, 0x10f8,
@@ -1955,6 +1998,18 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size)
0x51300, 0x51308,
};
+ static const unsigned int t5vf_reg_ranges[] = {
+ VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS),
+ VF_MPS_REG(A_MPS_VF_CTL),
+ VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H),
+ VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS),
+ FW_T4VF_MBDATA_BASE_ADDR,
+ FW_T4VF_MBDATA_BASE_ADDR +
+ ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4),
+ };
+
static const unsigned int t6_reg_ranges[] = {
0x1008, 0x101c,
0x1024, 0x10a8,
@@ -2532,6 +2587,18 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size)
0x51300, 0x51324,
};
+ static const unsigned int t6vf_reg_ranges[] = {
+ VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS),
+ VF_MPS_REG(A_MPS_VF_CTL),
+ VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H),
+ VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL),
+ VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS),
+ FW_T6VF_MBDATA_BASE_ADDR,
+ FW_T6VF_MBDATA_BASE_ADDR +
+ ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4),
+ };
+
u32 *buf_end = (u32 *)(buf + buf_size);
const unsigned int *reg_ranges;
int reg_ranges_size, range;
@@ -2543,18 +2610,33 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t buf_size)
*/
switch (chip_version) {
case CHELSIO_T4:
- reg_ranges = t4_reg_ranges;
- reg_ranges_size = ARRAY_SIZE(t4_reg_ranges);
+ if (adap->flags & IS_VF) {
+ reg_ranges = t4vf_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t4vf_reg_ranges);
+ } else {
+ reg_ranges = t4_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t4_reg_ranges);
+ }
break;
case CHELSIO_T5:
- reg_ranges = t5_reg_ranges;
- reg_ranges_size = ARRAY_SIZE(t5_reg_ranges);
+ if (adap->flags & IS_VF) {
+ reg_ranges = t5vf_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t5vf_reg_ranges);
+ } else {
+ reg_ranges = t5_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t5_reg_ranges);
+ }
break;
case CHELSIO_T6:
- reg_ranges = t6_reg_ranges;
- reg_ranges_size = ARRAY_SIZE(t6_reg_ranges);
+ if (adap->flags & IS_VF) {
+ reg_ranges = t6vf_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t6vf_reg_ranges);
+ } else {
+ reg_ranges = t6_reg_ranges;
+ reg_ranges_size = ARRAY_SIZE(t6_reg_ranges);
+ }
break;
default:
@@ -7416,7 +7498,7 @@ static void set_pcie_completion_timeout(struct adapter *adapter,
}
}
-static const struct chip_params *get_chip_params(int chipid)
+const struct chip_params *t4_get_chip_params(int chipid)
{
static const struct chip_params chip_params[] = {
{
@@ -7495,7 +7577,7 @@ int t4_prep_adapter(struct adapter *adapter, u8 *buf)
}
}
- adapter->chip_params = get_chip_params(chip_id(adapter));
+ adapter->chip_params = t4_get_chip_params(chip_id(adapter));
if (adapter->chip_params == NULL)
return -EINVAL;
@@ -7644,6 +7726,7 @@ int t4_init_sge_params(struct adapter *adapter)
{
u32 r;
struct sge_params *sp = &adapter->params.sge;
+ unsigned i;
r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD);
sp->counter_val[0] = G_THRESHOLD_0(r);
@@ -7686,6 +7769,7 @@ int t4_init_sge_params(struct adapter *adapter)
sp->page_shift = (r & M_HOSTPAGESIZEPF0) + 10;
r = t4_read_reg(adapter, A_SGE_CONTROL);
+ sp->sge_control = r;
sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64;
sp->fl_pktshift = G_PKTSHIFT(r);
sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5);
@@ -7698,6 +7782,9 @@ int t4_init_sge_params(struct adapter *adapter)
else
sp->pack_boundary = 1 << (G_INGPACKBOUNDARY(r) + 5);
}
+ for (i = 0; i < SGE_FLBUF_SIZES; i++)
+ sp->sge_fl_buffer_size[i] = t4_read_reg(adapter,
+ A_SGE_FL_BUFFER_SIZE0 + (4 * i));
return 0;
}
@@ -7851,15 +7938,26 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id)
} while ((adap->params.portvec & (1 << j)) == 0);
}
- c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) |
- F_FW_CMD_REQUEST | F_FW_CMD_READ |
- V_FW_PORT_CMD_PORTID(j));
- c.action_to_len16 = htonl(
- V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) |
- FW_LEN16(c));
- ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
- if (ret)
- return ret;
+ if (!(adap->flags & IS_VF) ||
+ adap->params.vfres.r_caps & FW_CMD_CAP_PORT) {
+ c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) |
+ F_FW_CMD_REQUEST | F_FW_CMD_READ |
+ V_FW_PORT_CMD_PORTID(j));
+ c.action_to_len16 = htonl(
+ V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) |
+ FW_LEN16(c));
+ ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
+ if (ret)
+ return ret;
+
+ ret = be32_to_cpu(c.u.info.lstatus_to_modtype);
+ p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ?
+ G_FW_PORT_CMD_MDIOADDR(ret) : -1;
+ p->port_type = G_FW_PORT_CMD_PTYPE(ret);
+ p->mod_type = G_FW_PORT_CMD_MODTYPE(ret);
+
+ init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap));
+ }
ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size);
if (ret < 0)
@@ -7872,14 +7970,6 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id)
p->vi[0].rss_size = rss_size;
t4_os_set_hw_addr(adap, p->port_id, addr);
- ret = be32_to_cpu(c.u.info.lstatus_to_modtype);
- p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ?
- G_FW_PORT_CMD_MDIOADDR(ret) : -1;
- p->port_type = G_FW_PORT_CMD_PTYPE(ret);
- p->mod_type = G_FW_PORT_CMD_MODTYPE(ret);
-
- init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap));
-
param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) |
V_FW_PARAMS_PARAM_YZ(p->vi[0].viid);
diff --git a/sys/dev/cxgbe/common/t4vf_hw.c b/sys/dev/cxgbe/common/t4vf_hw.c
new file mode 100644
index 0000000..adbeb0e
--- /dev/null
+++ b/sys/dev/cxgbe/common/t4vf_hw.c
@@ -0,0 +1,376 @@
+/*-
+ * Copyright (c) 2016 Chelsio Communications, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "common.h"
+#include "t4_regs.h"
+
+#undef msleep
+#define msleep(x) do { \
+ if (cold) \
+ DELAY((x) * 1000); \
+ else \
+ pause("t4hw", (x) * hz / 1000); \
+} while (0)
+
+/*
+ * Wait for the device to become ready (signified by our "who am I" register
+ * returning a value other than all 1's). Return an error if it doesn't
+ * become ready ...
+ */
+int t4vf_wait_dev_ready(struct adapter *adapter)
+{
+ const u32 whoami = VF_PL_REG(A_PL_VF_WHOAMI);
+ const u32 notready1 = 0xffffffff;
+ const u32 notready2 = 0xeeeeeeee;
+ u32 val;
+
+ val = t4_read_reg(adapter, whoami);
+ if (val != notready1 && val != notready2)
+ return 0;
+ msleep(500);
+ val = t4_read_reg(adapter, whoami);
+ if (val != notready1 && val != notready2)
+ return 0;
+ else
+ return -EIO;
+}
+
+
+/**
+ * t4vf_fw_reset - issue a reset to FW
+ * @adapter: the adapter
+ *
+ * Issues a reset command to FW. For a Physical Function this would
+ * result in the Firmware reseting all of its state. For a Virtual
+ * Function this just resets the state associated with the VF.
+ */
+int t4vf_fw_reset(struct adapter *adapter)
+{
+ struct fw_reset_cmd cmd;
+
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_RESET_CMD) |
+ F_FW_CMD_WRITE);
+ cmd.retval_len16 = cpu_to_be32(V_FW_CMD_LEN16(FW_LEN16(cmd)));
+ return t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), NULL);
+}
+
+/**
+ * t4vf_get_sge_params - retrieve adapter Scatter gather Engine parameters
+ * @adapter: the adapter
+ *
+ * Retrieves various core SGE parameters in the form of hardware SGE
+ * register values. The caller is responsible for decoding these as
+ * needed. The SGE parameters are stored in @adapter->params.sge.
+ */
+int t4vf_get_sge_params(struct adapter *adapter)
+{
+ struct sge_params *sp = &adapter->params.sge;
+ u32 params[7], vals[7];
+ u32 whoami;
+ unsigned int pf, s_hps;
+ int i, v;
+
+ params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_CONTROL));
+ params[1] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_HOST_PAGE_SIZE));
+ params[2] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_0_AND_1));
+ params[3] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_2_AND_3));
+ params[4] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_4_AND_5));
+ params[5] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_CONM_CTRL));
+ params[6] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_INGRESS_RX_THRESHOLD));
+ v = t4vf_query_params(adapter, 7, params, vals);
+ if (v != FW_SUCCESS)
+ return v;
+
+ sp->sge_control = vals[0];
+ sp->counter_val[0] = G_THRESHOLD_0(vals[6]);
+ sp->counter_val[1] = G_THRESHOLD_1(vals[6]);
+ sp->counter_val[2] = G_THRESHOLD_2(vals[6]);
+ sp->counter_val[3] = G_THRESHOLD_3(vals[6]);
+ sp->timer_val[0] = core_ticks_to_us(adapter, G_TIMERVALUE0(vals[2]));
+ sp->timer_val[1] = core_ticks_to_us(adapter, G_TIMERVALUE1(vals[2]));
+ sp->timer_val[2] = core_ticks_to_us(adapter, G_TIMERVALUE2(vals[3]));
+ sp->timer_val[3] = core_ticks_to_us(adapter, G_TIMERVALUE3(vals[3]));
+ sp->timer_val[4] = core_ticks_to_us(adapter, G_TIMERVALUE4(vals[4]));
+ sp->timer_val[5] = core_ticks_to_us(adapter, G_TIMERVALUE5(vals[4]));
+
+ sp->fl_starve_threshold = G_EGRTHRESHOLD(vals[5]) * 2 + 1;
+ if (is_t4(adapter))
+ sp->fl_starve_threshold2 = sp->fl_starve_threshold;
+ else
+ sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 +
+ 1;
+
+ /*
+ * We need the Queues/Page and Host Page Size for our VF.
+ * This is based on the PF from which we're instantiated.
+ */
+ whoami = t4_read_reg(adapter, VF_PL_REG(A_PL_VF_WHOAMI));
+ pf = G_SOURCEPF(whoami);
+
+ s_hps = (S_HOSTPAGESIZEPF0 +
+ (S_HOSTPAGESIZEPF1 - S_HOSTPAGESIZEPF0) * pf);
+ sp->page_shift = ((vals[1] >> s_hps) & M_HOSTPAGESIZEPF0) + 10;
+
+ for (i = 0; i < SGE_FLBUF_SIZES; i++) {
+ params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_FL_BUFFER_SIZE0 + (4 * i)));
+ v = t4vf_query_params(adapter, 1, params, vals);
+ if (v != FW_SUCCESS)
+ return v;
+
+ sp->sge_fl_buffer_size[i] = vals[0];
+ }
+
+ /*
+ * T4 uses a single control field to specify both the PCIe Padding and
+ * Packing Boundary. T5 introduced the ability to specify these
+ * separately with the Padding Boundary in SGE_CONTROL and and Packing
+ * Boundary in SGE_CONTROL2. So for T5 and later we need to grab
+ * SGE_CONTROL in order to determine how ingress packet data will be
+ * laid out in Packed Buffer Mode. Unfortunately, older versions of
+ * the firmware won't let us retrieve SGE_CONTROL2 so if we get a
+ * failure grabbing it we throw an error since we can't figure out the
+ * right value.
+ */
+ sp->spg_len = sp->sge_control & F_EGRSTATUSPAGESIZE ? 128 : 64;
+ sp->fl_pktshift = G_PKTSHIFT(sp->sge_control);
+ sp->pad_boundary = 1 << (G_INGPADBOUNDARY(sp->sge_control) + 5);
+ if (is_t4(adapter))
+ sp->pack_boundary = sp->pad_boundary;
+ else {
+ params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_CONTROL2));
+ v = t4vf_query_params(adapter, 1, params, vals);
+ if (v != FW_SUCCESS) {
+ CH_ERR(adapter, "Unable to get SGE Control2; "
+ "probably old firmware.\n");
+ return v;
+ }
+ if (G_INGPACKBOUNDARY(vals[0]) == 0)
+ sp->pack_boundary = 16;
+ else
+ sp->pack_boundary = 1 << (G_INGPACKBOUNDARY(vals[0]) +
+ 5);
+ }
+
+ /*
+ * For T5 and later we want to use the new BAR2 Doorbells.
+ * Unfortunately, older firmware didn't allow the this register to be
+ * read.
+ */
+ if (!is_t4(adapter)) {
+ unsigned int s_qpp;
+
+ params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_EGRESS_QUEUES_PER_PAGE_VF));
+ params[1] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) |
+ V_FW_PARAMS_PARAM_XYZ(A_SGE_INGRESS_QUEUES_PER_PAGE_VF));
+ v = t4vf_query_params(adapter, 2, params, vals);
+ if (v != FW_SUCCESS) {
+ CH_WARN(adapter, "Unable to get VF SGE Queues/Page; "
+ "probably old firmware.\n");
+ return v;
+ }
+
+ s_qpp = (S_QUEUESPERPAGEPF0 +
+ (S_QUEUESPERPAGEPF1 - S_QUEUESPERPAGEPF0) * pf);
+ sp->eq_s_qpp = ((vals[0] >> s_qpp) & M_QUEUESPERPAGEPF0);
+ sp->iq_s_qpp = ((vals[1] >> s_qpp) & M_QUEUESPERPAGEPF0);
+ }
+
+ return 0;
+}
+
+/**
+ * t4vf_get_rss_glb_config - retrieve adapter RSS Global Configuration
+ * @adapter: the adapter
+ *
+ * Retrieves global RSS mode and parameters with which we have to live
+ * and stores them in the @adapter's RSS parameters.
+ */
+int t4vf_get_rss_glb_config(struct adapter *adapter)
+{
+ struct rss_params *rss = &adapter->params.rss;
+ struct fw_rss_glb_config_cmd cmd, rpl;
+ int v;
+
+ /*
+ * Execute an RSS Global Configuration read command to retrieve
+ * our RSS configuration.
+ */
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_RSS_GLB_CONFIG_CMD) |
+ F_FW_CMD_REQUEST |
+ F_FW_CMD_READ);
+ cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd));
+ v = t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), &rpl);
+ if (v != FW_SUCCESS)
+ return v;
+
+ /*
+ * Transate the big-endian RSS Global Configuration into our
+ * cpu-endian format based on the RSS mode. We also do first level
+ * filtering at this point to weed out modes which don't support
+ * VF Drivers ...
+ */
+ rss->mode = G_FW_RSS_GLB_CONFIG_CMD_MODE(
+ be32_to_cpu(rpl.u.manual.mode_pkd));
+ switch (rss->mode) {
+ case FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL: {
+ u32 word = be32_to_cpu(
+ rpl.u.basicvirtual.synmapen_to_hashtoeplitz);
+
+ rss->u.basicvirtual.synmapen =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_SYNMAPEN) != 0);
+ rss->u.basicvirtual.syn4tupenipv6 =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6) != 0);
+ rss->u.basicvirtual.syn2tupenipv6 =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6) != 0);
+ rss->u.basicvirtual.syn4tupenipv4 =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4) != 0);
+ rss->u.basicvirtual.syn2tupenipv4 =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4) != 0);
+
+ rss->u.basicvirtual.ofdmapen =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_OFDMAPEN) != 0);
+
+ rss->u.basicvirtual.tnlmapen =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_TNLMAPEN) != 0);
+ rss->u.basicvirtual.tnlalllookup =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_TNLALLLKP) != 0);
+
+ rss->u.basicvirtual.hashtoeplitz =
+ ((word & F_FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ) != 0);
+
+ /* we need at least Tunnel Map Enable to be set */
+ if (!rss->u.basicvirtual.tnlmapen)
+ return -EINVAL;
+ break;
+ }
+
+ default:
+ /* all unknown/unsupported RSS modes result in an error */
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+/**
+ * t4vf_get_vfres - retrieve VF resource limits
+ * @adapter: the adapter
+ *
+ * Retrieves configured resource limits and capabilities for a virtual
+ * function. The results are stored in @adapter->vfres.
+ */
+int t4vf_get_vfres(struct adapter *adapter)
+{
+ struct vf_resources *vfres = &adapter->params.vfres;
+ struct fw_pfvf_cmd cmd, rpl;
+ int v;
+ u32 word;
+
+ /*
+ * Execute PFVF Read command to get VF resource limits; bail out early
+ * with error on command failure.
+ */
+ memset(&cmd, 0, sizeof(cmd));
+ cmd.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_PFVF_CMD) |
+ F_FW_CMD_REQUEST |
+ F_FW_CMD_READ);
+ cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd));
+ v = t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), &rpl);
+ if (v != FW_SUCCESS)
+ return v;
+
+ /*
+ * Extract VF resource limits and return success.
+ */
+ word = be32_to_cpu(rpl.niqflint_niq);
+ vfres->niqflint = G_FW_PFVF_CMD_NIQFLINT(word);
+ vfres->niq = G_FW_PFVF_CMD_NIQ(word);
+
+ word = be32_to_cpu(rpl.type_to_neq);
+ vfres->neq = G_FW_PFVF_CMD_NEQ(word);
+ vfres->pmask = G_FW_PFVF_CMD_PMASK(word);
+
+ word = be32_to_cpu(rpl.tc_to_nexactf);
+ vfres->tc = G_FW_PFVF_CMD_TC(word);
+ vfres->nvi = G_FW_PFVF_CMD_NVI(word);
+ vfres->nexactf = G_FW_PFVF_CMD_NEXACTF(word);
+
+ word = be32_to_cpu(rpl.r_caps_to_nethctrl);
+ vfres->r_caps = G_FW_PFVF_CMD_R_CAPS(word);
+ vfres->wx_caps = G_FW_PFVF_CMD_WX_CAPS(word);
+ vfres->nethctrl = G_FW_PFVF_CMD_NETHCTRL(word);
+
+ return 0;
+}
+
+/**
+ */
+int t4vf_prep_adapter(struct adapter *adapter)
+{
+ int err;
+
+ /*
+ * Wait for the device to become ready before proceeding ...
+ */
+ err = t4vf_wait_dev_ready(adapter);
+ if (err)
+ return err;
+
+ adapter->params.chipid = pci_get_device(adapter->dev) >> 12;
+ if (adapter->params.chipid >= 0xa) {
+ adapter->params.chipid -= (0xa - 0x4);
+ adapter->params.fpga = 1;
+ }
+
+ /*
+ * Default port and clock for debugging in case we can't reach
+ * firmware.
+ */
+ adapter->params.nports = 1;
+ adapter->params.vfres.pmask = 1;
+ adapter->params.vpd.cclk = 50000;
+
+ adapter->chip_params = t4_get_chip_params(chip_id(adapter));
+ if (adapter->chip_params == NULL)
+ return -EINVAL;
+
+ return 0;
+}
diff --git a/sys/dev/cxgbe/if_cxlv.c b/sys/dev/cxgbe/if_cxlv.c
new file mode 100644
index 0000000..5a169d0
--- /dev/null
+++ b/sys/dev/cxgbe/if_cxlv.c
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2015 Chelsio Communications, Inc.
+ * All rights reserved.
+ * Written by: Navdeep Parhar <np@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+static int
+mod_event(module_t mod, int cmd, void *arg)
+{
+
+ return (0);
+}
+static moduledata_t if_cxlv_mod = {"if_cxlv", mod_event};
+DECLARE_MODULE(if_cxlv, if_cxlv_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+MODULE_VERSION(if_cxlv, 1);
+MODULE_DEPEND(if_cxlv, cxlv, 1, 1, 1);
diff --git a/sys/dev/cxgbe/iw_cxgbe/cq.c b/sys/dev/cxgbe/iw_cxgbe/cq.c
index b40ffc7..5c040e9 100644
--- a/sys/dev/cxgbe/iw_cxgbe/cq.c
+++ b/sys/dev/cxgbe/iw_cxgbe/cq.c
@@ -172,7 +172,7 @@ create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
cq->gen = 1;
cq->gts = (void *)((unsigned long)rman_get_virtual(sc->regs_res) +
- MYPF_REG(SGE_PF_GTS));
+ sc->sge_gts_reg);
cq->rdev = rdev;
if (user) {
diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c
index d1be854..5311b2c 100644
--- a/sys/dev/cxgbe/iw_cxgbe/qp.c
+++ b/sys/dev/cxgbe/iw_cxgbe/qp.c
@@ -182,9 +182,9 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
pci_unmap_addr_set(&wq->rq, mapping, wq->rq.dma_addr);
wq->db = (void *)((unsigned long)rman_get_virtual(sc->regs_res) +
- MYPF_REG(SGE_PF_KDOORBELL));
+ sc->sge_kdoorbell_reg);
wq->gts = (void *)((unsigned long)rman_get_virtual(rdev->adap->regs_res)
- + MYPF_REG(SGE_PF_GTS));
+ + sc->sge_gts_reg);
if (user) {
wq->sq.udb = (u64)((char*)rman_get_virtual(rdev->adap->udbs_res) +
(wq->sq.qid << rdev->qpshift));
diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h
index 22612d5..cb0006c 100644
--- a/sys/dev/cxgbe/offload.h
+++ b/sys/dev/cxgbe/offload.h
@@ -147,6 +147,7 @@ struct tom_tunables {
int ddp;
int rx_coalesce;
int tx_align;
+ int tx_zcopy;
};
#ifdef TCP_OFFLOAD
diff --git a/sys/dev/cxgbe/t4_if.m b/sys/dev/cxgbe/t4_if.m
new file mode 100644
index 0000000..59e86bd
--- /dev/null
+++ b/sys/dev/cxgbe/t4_if.m
@@ -0,0 +1,65 @@
+#-
+# Copyright (c) 2015-2016 Chelsio Communications, Inc.
+# All rights reserved.
+# Written by: John Baldwin <jhb@FreeBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+#include <sys/bus.h>
+
+INTERFACE t4;
+
+# The "main" device of a T4/T5 NIC is the PF4 device. Drivers for other
+# functions on the NIC need to wait for the main device to be initialized
+# before finishing attach. These routines allow drivers for other devices
+# to coordinate with the main driver for the PF4.
+
+# Called by a driver during attach to determine if the PF4 driver is
+# initialized. If the main driver is not ready, the driver should defer
+# further initialization until 'attach_child'.
+METHOD int is_main_ready {
+ device_t dev;
+};
+
+# Called by the PF4 driver on each sibling device when the PF4 driver is
+# initialized.
+METHOD int attach_child {
+ device_t dev;
+};
+
+# Called by the PF4 driver on each sibling device when the PF4 driver is
+# preparing to detach.
+METHOD int detach_child {
+ device_t dev;
+};
+
+# Called by a driver to query the PF4 driver for the child device
+# associated with a given port. If the port is not enabled on the adapter,
+# this will fail.
+METHOD int read_port_device {
+ device_t dev;
+ int port;
+ device_t *child;
+};
diff --git a/sys/dev/cxgbe/t4_iov.c b/sys/dev/cxgbe/t4_iov.c
new file mode 100644
index 0000000..334d0ec
--- /dev/null
+++ b/sys/dev/cxgbe/t4_iov.c
@@ -0,0 +1,297 @@
+/*-
+ * Copyright (c) 2015-2016 Chelsio Communications, Inc.
+ * All rights reserved.
+ * Written by: John Baldwin <jhb@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/systm.h>
+#include <dev/pci/pcivar.h>
+
+#ifdef PCI_IOV
+#include <sys/nv.h>
+#include <sys/iov_schema.h>
+#include <dev/pci/pci_iov.h>
+#endif
+
+#include "t4_if.h"
+
+struct t4iov_softc {
+ device_t sc_dev;
+ device_t sc_main;
+ bool sc_attached;
+};
+
+struct {
+ uint16_t device;
+ char *desc;
+} t4iov_pciids[] = {
+ {0x4000, "Chelsio T440-dbg"},
+ {0x4001, "Chelsio T420-CR"},
+ {0x4002, "Chelsio T422-CR"},
+ {0x4003, "Chelsio T440-CR"},
+ {0x4004, "Chelsio T420-BCH"},
+ {0x4005, "Chelsio T440-BCH"},
+ {0x4006, "Chelsio T440-CH"},
+ {0x4007, "Chelsio T420-SO"},
+ {0x4008, "Chelsio T420-CX"},
+ {0x4009, "Chelsio T420-BT"},
+ {0x400a, "Chelsio T404-BT"},
+ {0x400e, "Chelsio T440-LP-CR"},
+}, t5iov_pciids[] = {
+ {0x5000, "Chelsio T580-dbg"},
+ {0x5001, "Chelsio T520-CR"}, /* 2 x 10G */
+ {0x5002, "Chelsio T522-CR"}, /* 2 x 10G, 2 X 1G */
+ {0x5003, "Chelsio T540-CR"}, /* 4 x 10G */
+ {0x5007, "Chelsio T520-SO"}, /* 2 x 10G, nomem */
+ {0x5009, "Chelsio T520-BT"}, /* 2 x 10GBaseT */
+ {0x500a, "Chelsio T504-BT"}, /* 4 x 1G */
+ {0x500d, "Chelsio T580-CR"}, /* 2 x 40G */
+ {0x500e, "Chelsio T540-LP-CR"}, /* 4 x 10G */
+ {0x5010, "Chelsio T580-LP-CR"}, /* 2 x 40G */
+ {0x5011, "Chelsio T520-LL-CR"}, /* 2 x 10G */
+ {0x5012, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */
+ {0x5014, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */
+ {0x5015, "Chelsio T502-BT"}, /* 2 x 1G */
+#ifdef notyet
+ {0x5004, "Chelsio T520-BCH"},
+ {0x5005, "Chelsio T540-BCH"},
+ {0x5006, "Chelsio T540-CH"},
+ {0x5008, "Chelsio T520-CX"},
+ {0x500b, "Chelsio B520-SR"},
+ {0x500c, "Chelsio B504-BT"},
+ {0x500f, "Chelsio Amsterdam"},
+ {0x5013, "Chelsio T580-CHR"},
+#endif
+};
+
+static int t4iov_attach_child(device_t dev);
+
+static int
+t4iov_probe(device_t dev)
+{
+ uint16_t d;
+ size_t i;
+
+ d = pci_get_device(dev);
+ for (i = 0; i < nitems(t4iov_pciids); i++) {
+ if (d == t4iov_pciids[i].device) {
+ device_set_desc(dev, t4iov_pciids[i].desc);
+ device_quiet(dev);
+ return (BUS_PROBE_DEFAULT);
+ }
+ }
+ return (ENXIO);
+}
+
+static int
+t5iov_probe(device_t dev)
+{
+ uint16_t d;
+ size_t i;
+
+ d = pci_get_device(dev);
+ for (i = 0; i < nitems(t5iov_pciids); i++) {
+ if (d == t5iov_pciids[i].device) {
+ device_set_desc(dev, t5iov_pciids[i].desc);
+ device_quiet(dev);
+ return (BUS_PROBE_DEFAULT);
+ }
+ }
+ return (ENXIO);
+}
+
+static int
+t4iov_attach(device_t dev)
+{
+ struct t4iov_softc *sc;
+
+ sc = device_get_softc(dev);
+ sc->sc_dev = dev;
+
+ sc->sc_main = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev),
+ pci_get_slot(dev), 4);
+ if (T4_IS_MAIN_READY(sc->sc_main) == 0)
+ return (t4iov_attach_child(dev));
+ return (0);
+}
+
+static int
+t4iov_attach_child(device_t dev)
+{
+ struct t4iov_softc *sc;
+#ifdef PCI_IOV
+ nvlist_t *pf_schema, *vf_schema;
+#endif
+ device_t pdev;
+ int error;
+
+ sc = device_get_softc(dev);
+ MPASS(!sc->sc_attached);
+
+ /*
+ * PF0-3 are associated with a specific port on the NIC (PF0
+ * with port 0, etc.). Ask the PF4 driver for the device for
+ * this function's associated port to determine if the port is
+ * present.
+ */
+ error = T4_READ_PORT_DEVICE(sc->sc_main, pci_get_function(dev), &pdev);
+ if (error)
+ return (0);
+
+#ifdef PCI_IOV
+ pf_schema = pci_iov_schema_alloc_node();
+ vf_schema = pci_iov_schema_alloc_node();
+ error = pci_iov_attach_name(dev, pf_schema, vf_schema, "%s",
+ device_get_nameunit(pdev));
+ if (error) {
+ device_printf(dev, "Failed to initialize SR-IOV: %d\n", error);
+ return (0);
+ }
+#endif
+
+ sc->sc_attached = true;
+ return (0);
+}
+
+static int
+t4iov_detach_child(device_t dev)
+{
+ struct t4iov_softc *sc;
+#ifdef PCI_IOV
+ int error;
+#endif
+
+ sc = device_get_softc(dev);
+ if (!sc->sc_attached)
+ return (0);
+
+#ifdef PCI_IOV
+ error = pci_iov_detach(dev);
+ if (error != 0) {
+ device_printf(dev, "Failed to disable SR-IOV\n");
+ return (error);
+ }
+#endif
+
+ sc->sc_attached = false;
+ return (0);
+}
+
+static int
+t4iov_detach(device_t dev)
+{
+ struct t4iov_softc *sc;
+ int error;
+
+ sc = device_get_softc(dev);
+ if (sc->sc_attached) {
+ error = t4iov_detach_child(dev);
+ if (error)
+ return (error);
+ }
+ return (0);
+}
+
+#ifdef PCI_IOV
+static int
+t4iov_iov_init(device_t dev, uint16_t num_vfs, const struct nvlist *config)
+{
+
+ /* XXX: The Linux driver sets up a vf_monitor task on T4 adapters. */
+ return (0);
+}
+
+static void
+t4iov_iov_uninit(device_t dev)
+{
+}
+
+static int
+t4iov_add_vf(device_t dev, uint16_t vfnum, const struct nvlist *config)
+{
+
+ return (0);
+}
+#endif
+
+static device_method_t t4iov_methods[] = {
+ DEVMETHOD(device_probe, t4iov_probe),
+ DEVMETHOD(device_attach, t4iov_attach),
+ DEVMETHOD(device_detach, t4iov_detach),
+
+#ifdef PCI_IOV
+ DEVMETHOD(pci_iov_init, t4iov_iov_init),
+ DEVMETHOD(pci_iov_uninit, t4iov_iov_uninit),
+ DEVMETHOD(pci_iov_add_vf, t4iov_add_vf),
+#endif
+
+ DEVMETHOD(t4_attach_child, t4iov_attach_child),
+ DEVMETHOD(t4_detach_child, t4iov_detach_child),
+
+ DEVMETHOD_END
+};
+
+static driver_t t4iov_driver = {
+ "t4iov",
+ t4iov_methods,
+ sizeof(struct t4iov_softc)
+};
+
+static device_method_t t5iov_methods[] = {
+ DEVMETHOD(device_probe, t5iov_probe),
+ DEVMETHOD(device_attach, t4iov_attach),
+ DEVMETHOD(device_detach, t4iov_detach),
+
+#ifdef PCI_IOV
+ DEVMETHOD(pci_iov_init, t4iov_iov_init),
+ DEVMETHOD(pci_iov_uninit, t4iov_iov_uninit),
+ DEVMETHOD(pci_iov_add_vf, t4iov_add_vf),
+#endif
+
+ DEVMETHOD(t4_attach_child, t4iov_attach_child),
+ DEVMETHOD(t4_detach_child, t4iov_detach_child),
+
+ DEVMETHOD_END
+};
+
+static driver_t t5iov_driver = {
+ "t5iov",
+ t5iov_methods,
+ sizeof(struct t4iov_softc)
+};
+
+static devclass_t t4iov_devclass, t5iov_devclass;
+
+DRIVER_MODULE(t4iov, pci, t4iov_driver, t4iov_devclass, 0, 0);
+MODULE_VERSION(t4iov, 1);
+
+DRIVER_MODULE(t5iov, pci, t5iov_driver, t5iov_devclass, 0, 0);
+MODULE_VERSION(t5iov, 1);
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 247175d..40c0d21 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -76,16 +76,22 @@ __FBSDID("$FreeBSD$");
#include "t4_ioctl.h"
#include "t4_l2t.h"
#include "t4_mp_ring.h"
+#include "t4_if.h"
/* T4 bus driver interface */
static int t4_probe(device_t);
static int t4_attach(device_t);
static int t4_detach(device_t);
+static int t4_ready(device_t);
+static int t4_read_port_device(device_t, int, device_t *);
static device_method_t t4_methods[] = {
DEVMETHOD(device_probe, t4_probe),
DEVMETHOD(device_attach, t4_attach),
DEVMETHOD(device_detach, t4_detach),
+ DEVMETHOD(t4_is_main_ready, t4_ready),
+ DEVMETHOD(t4_read_port_device, t4_read_port_device),
+
DEVMETHOD_END
};
static driver_t t4_driver = {
@@ -99,7 +105,7 @@ static driver_t t4_driver = {
static int cxgbe_probe(device_t);
static int cxgbe_attach(device_t);
static int cxgbe_detach(device_t);
-static device_method_t cxgbe_methods[] = {
+device_method_t cxgbe_methods[] = {
DEVMETHOD(device_probe, cxgbe_probe),
DEVMETHOD(device_attach, cxgbe_attach),
DEVMETHOD(device_detach, cxgbe_detach),
@@ -128,14 +134,9 @@ static driver_t vcxgbe_driver = {
};
static d_ioctl_t t4_ioctl;
-static d_open_t t4_open;
-static d_close_t t4_close;
static struct cdevsw t4_cdevsw = {
.d_version = D_VERSION,
- .d_flags = 0,
- .d_open = t4_open,
- .d_close = t4_close,
.d_ioctl = t4_ioctl,
.d_name = "t4nex",
};
@@ -147,6 +148,9 @@ static device_method_t t5_methods[] = {
DEVMETHOD(device_attach, t4_attach),
DEVMETHOD(device_detach, t4_detach),
+ DEVMETHOD(t4_is_main_ready, t4_ready),
+ DEVMETHOD(t4_read_port_device, t4_read_port_device),
+
DEVMETHOD_END
};
static driver_t t5_driver = {
@@ -170,15 +174,6 @@ static driver_t vcxl_driver = {
sizeof(struct vi_info)
};
-static struct cdevsw t5_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = 0,
- .d_open = t4_open,
- .d_close = t4_close,
- .d_ioctl = t4_ioctl,
- .d_name = "t5nex",
-};
-
/* ifnet + media interface */
static void cxgbe_init(void *);
static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t);
@@ -215,19 +210,19 @@ SLIST_HEAD(, uld_info) t4_uld_list;
* Number of queues for tx and rx, 10G and 1G, NIC and offload.
*/
#define NTXQ_10G 16
-static int t4_ntxq10g = -1;
+int t4_ntxq10g = -1;
TUNABLE_INT("hw.cxgbe.ntxq10g", &t4_ntxq10g);
#define NRXQ_10G 8
-static int t4_nrxq10g = -1;
+int t4_nrxq10g = -1;
TUNABLE_INT("hw.cxgbe.nrxq10g", &t4_nrxq10g);
#define NTXQ_1G 4
-static int t4_ntxq1g = -1;
+int t4_ntxq1g = -1;
TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1g);
#define NRXQ_1G 2
-static int t4_nrxq1g = -1;
+int t4_nrxq1g = -1;
TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g);
#define NTXQ_VI 1
@@ -281,34 +276,34 @@ TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi);
* Holdoff parameters for 10G and 1G ports.
*/
#define TMR_IDX_10G 1
-static int t4_tmr_idx_10g = TMR_IDX_10G;
+int t4_tmr_idx_10g = TMR_IDX_10G;
TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_10G", &t4_tmr_idx_10g);
#define PKTC_IDX_10G (-1)
-static int t4_pktc_idx_10g = PKTC_IDX_10G;
+int t4_pktc_idx_10g = PKTC_IDX_10G;
TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_10G", &t4_pktc_idx_10g);
#define TMR_IDX_1G 1
-static int t4_tmr_idx_1g = TMR_IDX_1G;
+int t4_tmr_idx_1g = TMR_IDX_1G;
TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_1G", &t4_tmr_idx_1g);
#define PKTC_IDX_1G (-1)
-static int t4_pktc_idx_1g = PKTC_IDX_1G;
+int t4_pktc_idx_1g = PKTC_IDX_1G;
TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_1G", &t4_pktc_idx_1g);
/*
* Size (# of entries) of each tx and rx queue.
*/
-static unsigned int t4_qsize_txq = TX_EQ_QSIZE;
+unsigned int t4_qsize_txq = TX_EQ_QSIZE;
TUNABLE_INT("hw.cxgbe.qsize_txq", &t4_qsize_txq);
-static unsigned int t4_qsize_rxq = RX_IQ_QSIZE;
+unsigned int t4_qsize_rxq = RX_IQ_QSIZE;
TUNABLE_INT("hw.cxgbe.qsize_rxq", &t4_qsize_rxq);
/*
* Interrupt types allowed (bits 0, 1, 2 = INTx, MSI, MSI-X respectively).
*/
-static int t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX;
+int t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX;
TUNABLE_INT("hw.cxgbe.interrupt_types", &t4_intr_types);
/*
@@ -419,8 +414,6 @@ struct filter_entry {
struct t4_filter_specification fs;
};
-static int map_bars_0_and_4(struct adapter *);
-static int map_bar_2(struct adapter *);
static void setup_memwin(struct adapter *);
static void position_memwin(struct adapter *, int, uint32_t);
static int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int);
@@ -445,7 +438,6 @@ static void t4_set_desc(struct adapter *);
static void build_medialist(struct port_info *, struct ifmedia *);
static int cxgbe_init_synchronized(struct vi_info *);
static int cxgbe_uninit_synchronized(struct vi_info *);
-static int setup_intr_handlers(struct adapter *);
static void quiesce_txq(struct adapter *, struct sge_txq *);
static void quiesce_wrq(struct adapter *, struct sge_wrq *);
static void quiesce_iq(struct adapter *, struct sge_iq *);
@@ -458,7 +450,6 @@ static void vi_refresh_stats(struct adapter *, struct vi_info *);
static void cxgbe_refresh_stats(struct adapter *, struct port_info *);
static void cxgbe_tick(void *);
static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t);
-static void t4_sysctls(struct adapter *);
static void cxgbe_sysctls(struct port_info *);
static int sysctl_int_array(SYSCTL_HANDLER_ARGS);
static int sysctl_bitfield(SYSCTL_HANDLER_ARGS);
@@ -527,12 +518,11 @@ static int get_sge_context(struct adapter *, struct t4_sge_context *);
static int load_fw(struct adapter *, struct t4_data *);
static int read_card_mem(struct adapter *, int, struct t4_mem_range *);
static int read_i2c(struct adapter *, struct t4_i2c_data *);
-static int set_sched_class(struct adapter *, struct t4_sched_params *);
-static int set_sched_queue(struct adapter *, struct t4_sched_queue *);
#ifdef TCP_OFFLOAD
static int toe_capability(struct vi_info *, int);
#endif
static int mod_event(module_t, int, void *);
+static int notify_siblings(device_t, int);
struct {
uint16_t device;
@@ -671,6 +661,7 @@ t4_attach(device_t dev)
{
struct adapter *sc;
int rc = 0, i, j, n10g, n1g, rqidx, tqidx;
+ struct make_dev_args mda;
struct intrs_and_queues iaq;
struct sge *s;
uint8_t *buf;
@@ -700,6 +691,8 @@ t4_attach(device_t dev)
sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5);
}
+ sc->sge_gts_reg = MYPF_REG(A_SGE_PF_GTS);
+ sc->sge_kdoorbell_reg = MYPF_REG(A_SGE_PF_KDOORBELL);
sc->traceq = -1;
mtx_init(&sc->ifp_lock, sc->ifp_lockname, 0, MTX_DEF);
snprintf(sc->ifp_lockname, sizeof(sc->ifp_lockname), "%s tracer",
@@ -708,9 +701,7 @@ t4_attach(device_t dev)
snprintf(sc->lockname, sizeof(sc->lockname), "%s",
device_get_nameunit(dev));
mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF);
- sx_xlock(&t4_list_lock);
- SLIST_INSERT_HEAD(&t4_list, sc, link);
- sx_xunlock(&t4_list_lock);
+ t4_add_adapter(sc);
mtx_init(&sc->sfl_lock, "starving freelists", 0, MTX_DEF);
TAILQ_INIT(&sc->sfl);
@@ -718,7 +709,7 @@ t4_attach(device_t dev)
mtx_init(&sc->reg_lock, "indirect register access", 0, MTX_DEF);
- rc = map_bars_0_and_4(sc);
+ rc = t4_map_bars_0_and_4(sc);
if (rc != 0)
goto done; /* error message displayed already */
@@ -750,13 +741,16 @@ t4_attach(device_t dev)
setup_memwin(sc);
if (t4_init_devlog_params(sc, 0) == 0)
fixup_devlog_params(sc);
- sc->cdev = make_dev(is_t4(sc) ? &t4_cdevsw : &t5_cdevsw,
- device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "%s",
- device_get_nameunit(dev));
- if (sc->cdev == NULL)
- device_printf(dev, "failed to create nexus char device.\n");
- else
- sc->cdev->si_drv1 = sc;
+ make_dev_args_init(&mda);
+ mda.mda_devsw = &t4_cdevsw;
+ mda.mda_uid = UID_ROOT;
+ mda.mda_gid = GID_WHEEL;
+ mda.mda_mode = 0600;
+ mda.mda_si_drv1 = sc;
+ rc = make_dev_s(&mda, &sc->cdev, "%s", device_get_nameunit(dev));
+ if (rc != 0)
+ device_printf(dev, "failed to create nexus char device: %d.\n",
+ rc);
/* Go no further if recovery mode has been requested. */
if (TUNABLE_INT_FETCH("hw.cxgbe.sos", &i) && i != 0) {
@@ -785,7 +779,7 @@ t4_attach(device_t dev)
if (rc != 0)
goto done; /* error message displayed already */
- rc = map_bar_2(sc);
+ rc = t4_map_bar_2(sc);
if (rc != 0)
goto done; /* error message displayed already */
@@ -1039,7 +1033,7 @@ t4_attach(device_t dev)
}
}
- rc = setup_intr_handlers(sc);
+ rc = t4_setup_intr_handlers(sc);
if (rc != 0) {
device_printf(dev,
"failed to setup interrupt handlers: %d\n", rc);
@@ -1062,6 +1056,8 @@ t4_attach(device_t dev)
t4_set_desc(sc);
+ notify_siblings(dev, 0);
+
done:
if (rc != 0 && sc->cdev) {
/* cdev was created and so cxgbetool works; recover that way. */
@@ -1071,13 +1067,64 @@ done:
}
if (rc != 0)
- t4_detach(dev);
+ t4_detach_common(dev);
else
t4_sysctls(sc);
return (rc);
}
+static int
+t4_ready(device_t dev)
+{
+ struct adapter *sc;
+
+ sc = device_get_softc(dev);
+ if (sc->flags & FW_OK)
+ return (0);
+ return (ENXIO);
+}
+
+static int
+t4_read_port_device(device_t dev, int port, device_t *child)
+{
+ struct adapter *sc;
+ struct port_info *pi;
+
+ sc = device_get_softc(dev);
+ if (port < 0 || port >= MAX_NPORTS)
+ return (EINVAL);
+ pi = sc->port[port];
+ if (pi == NULL || pi->dev == NULL)
+ return (ENXIO);
+ *child = pi->dev;
+ return (0);
+}
+
+static int
+notify_siblings(device_t dev, int detaching)
+{
+ device_t sibling;
+ int error, i;
+
+ error = 0;
+ for (i = 0; i < PCI_FUNCMAX; i++) {
+ if (i == pci_get_function(dev))
+ continue;
+ sibling = pci_find_dbsf(pci_get_domain(dev), pci_get_bus(dev),
+ pci_get_slot(dev), i);
+ if (sibling == NULL || !device_is_attached(sibling))
+ continue;
+ if (detaching)
+ error = T4_DETACH_CHILD(sibling);
+ else
+ (void)T4_ATTACH_CHILD(sibling);
+ if (error)
+ break;
+ }
+ return (error);
+}
+
/*
* Idempotent
*/
@@ -1085,24 +1132,46 @@ static int
t4_detach(device_t dev)
{
struct adapter *sc;
+ int rc;
+
+ sc = device_get_softc(dev);
+
+ rc = notify_siblings(dev, 1);
+ if (rc) {
+ device_printf(dev,
+ "failed to detach sibling devices: %d\n", rc);
+ return (rc);
+ }
+
+ return (t4_detach_common(dev));
+}
+
+int
+t4_detach_common(device_t dev)
+{
+ struct adapter *sc;
struct port_info *pi;
int i, rc;
sc = device_get_softc(dev);
- if (sc->flags & FULL_INIT_DONE)
- t4_intr_disable(sc);
+ if (sc->flags & FULL_INIT_DONE) {
+ if (!(sc->flags & IS_VF))
+ t4_intr_disable(sc);
+ }
if (sc->cdev) {
destroy_dev(sc->cdev);
sc->cdev = NULL;
}
- rc = bus_generic_detach(dev);
- if (rc) {
- device_printf(dev,
- "failed to detach child devices: %d\n", rc);
- return (rc);
+ if (device_is_attached(dev)) {
+ rc = bus_generic_detach(dev);
+ if (rc) {
+ device_printf(dev,
+ "failed to detach child devices: %d\n", rc);
+ return (rc);
+ }
}
for (i = 0; i < sc->intr_count; i++)
@@ -1125,7 +1194,7 @@ t4_detach(device_t dev)
if (sc->flags & FULL_INIT_DONE)
adapter_full_uninit(sc);
- if (sc->flags & FW_OK)
+ if ((sc->flags & (IS_VF | FW_OK)) == FW_OK)
t4_fw_bye(sc, sc->mbox);
if (sc->intr_type == INTR_MSI || sc->intr_type == INTR_MSIX)
@@ -1615,7 +1684,7 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
return (ENETDOWN);
}
- rc = parse_pkt(&m);
+ rc = parse_pkt(sc, &m);
if (__predict_false(rc != 0)) {
MPASS(m == NULL); /* was freed already */
atomic_add_int(&pi->tx_parse_error, 1); /* rare, atomic is ok */
@@ -1716,7 +1785,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c)
struct adapter *sc = pi->adapter;
struct port_stats *s = &pi->stats;
- if (pi->nvi > 1)
+ if (pi->nvi > 1 || sc->flags & IS_VF)
return (vi_get_counter(ifp, c));
cxgbe_refresh_stats(sc, pi);
@@ -1904,8 +1973,16 @@ t4_fatal_err(struct adapter *sc)
device_get_nameunit(sc->dev));
}
-static int
-map_bars_0_and_4(struct adapter *sc)
+void
+t4_add_adapter(struct adapter *sc)
+{
+ sx_xlock(&t4_list_lock);
+ SLIST_INSERT_HEAD(&t4_list, sc, link);
+ sx_xunlock(&t4_list_lock);
+}
+
+int
+t4_map_bars_0_and_4(struct adapter *sc)
{
sc->regs_rid = PCIR_BAR(0);
sc->regs_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY,
@@ -1930,8 +2007,8 @@ map_bars_0_and_4(struct adapter *sc)
return (0);
}
-static int
-map_bar_2(struct adapter *sc)
+int
+t4_map_bar_2(struct adapter *sc)
{
/*
@@ -3270,6 +3347,8 @@ get_params__post_init(struct adapter *sc)
sc->vres.iscsi.size = val[1] - val[0] + 1;
}
+ t4_init_sge_params(sc);
+
/*
* We've got the params we wanted to query via the firmware. Now grab
* some others directly from the chip.
@@ -3711,7 +3790,7 @@ cxgbe_init_synchronized(struct vi_info *vi)
ifp->if_drv_flags |= IFF_DRV_RUNNING;
pi->up_vis++;
- if (pi->nvi > 1)
+ if (pi->nvi > 1 || sc->flags & IS_VF)
callout_reset(&vi->tick, hz, vi_tick, vi);
else
callout_reset(&pi->tick, hz, cxgbe_tick, pi);
@@ -3763,10 +3842,10 @@ cxgbe_uninit_synchronized(struct vi_info *vi)
}
PORT_LOCK(pi);
- if (pi->nvi == 1)
- callout_stop(&pi->tick);
- else
+ if (pi->nvi > 1 || sc->flags & IS_VF)
callout_stop(&vi->tick);
+ else
+ callout_stop(&pi->tick);
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
PORT_UNLOCK(pi);
return (0);
@@ -3791,8 +3870,8 @@ cxgbe_uninit_synchronized(struct vi_info *vi)
* It is ok for this function to fail midway and return right away. t4_detach
* will walk the entire sc->irq list and clean up whatever is valid.
*/
-static int
-setup_intr_handlers(struct adapter *sc)
+int
+t4_setup_intr_handlers(struct adapter *sc)
{
int rc, rid, p, q, v;
char s[8];
@@ -3820,17 +3899,23 @@ setup_intr_handlers(struct adapter *sc)
return (t4_alloc_irq(sc, irq, rid, t4_intr_all, sc, "all"));
/* Multiple interrupts. */
- KASSERT(sc->intr_count >= T4_EXTRA_INTR + sc->params.nports,
- ("%s: too few intr.", __func__));
+ if (sc->flags & IS_VF)
+ KASSERT(sc->intr_count >= T4VF_EXTRA_INTR + sc->params.nports,
+ ("%s: too few intr.", __func__));
+ else
+ KASSERT(sc->intr_count >= T4_EXTRA_INTR + sc->params.nports,
+ ("%s: too few intr.", __func__));
- /* The first one is always error intr */
- rc = t4_alloc_irq(sc, irq, rid, t4_intr_err, sc, "err");
- if (rc != 0)
- return (rc);
- irq++;
- rid++;
+ /* The first one is always error intr on PFs */
+ if (!(sc->flags & IS_VF)) {
+ rc = t4_alloc_irq(sc, irq, rid, t4_intr_err, sc, "err");
+ if (rc != 0)
+ return (rc);
+ irq++;
+ rid++;
+ }
- /* The second one is always the firmware event queue */
+ /* The second one is always the firmware event queue (first on VFs) */
rc = t4_alloc_irq(sc, irq, rid, t4_intr_evt, &sge->fwq, "evt");
if (rc != 0)
return (rc);
@@ -3937,7 +4022,8 @@ adapter_full_init(struct adapter *sc)
device_get_nameunit(sc->dev), i);
}
- t4_intr_enable(sc);
+ if (!(sc->flags & IS_VF))
+ t4_intr_enable(sc);
sc->flags |= FULL_INIT_DONE;
done:
if (rc != 0)
@@ -4186,7 +4272,7 @@ vi_full_uninit(struct vi_info *vi)
/* Need to quiesce queues. */
/* XXX: Only for the first VI? */
- if (IS_MAIN_VI(vi))
+ if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF))
quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
for_each_txq(vi, i, txq) {
@@ -4353,10 +4439,16 @@ read_vf_stat(struct adapter *sc, unsigned int viid, int reg)
u32 stats[2];
mtx_assert(&sc->reg_lock, MA_OWNED);
- t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) |
- V_PL_VFID(G_FW_VIID_VIN(viid)) | V_PL_ADDR(VF_MPS_REG(reg)));
- stats[0] = t4_read_reg(sc, A_PL_INDIR_DATA);
- stats[1] = t4_read_reg(sc, A_PL_INDIR_DATA);
+ if (sc->flags & IS_VF) {
+ stats[0] = t4_read_reg(sc, VF_MPS_REG(reg));
+ stats[1] = t4_read_reg(sc, VF_MPS_REG(reg + 4));
+ } else {
+ t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) |
+ V_PL_VFID(G_FW_VIID_VIN(viid)) |
+ V_PL_ADDR(VF_MPS_REG(reg)));
+ stats[0] = t4_read_reg(sc, A_PL_INDIR_DATA);
+ stats[1] = t4_read_reg(sc, A_PL_INDIR_DATA);
+ }
return (((uint64_t)stats[1]) << 32 | stats[0]);
}
@@ -4505,7 +4597,7 @@ static char *caps_decoder[] = {
"\004PO_INITIATOR\005PO_TARGET",
};
-static void
+void
t4_sysctls(struct adapter *sc)
{
struct sysctl_ctx_list *ctx;
@@ -4528,30 +4620,55 @@ t4_sysctls(struct adapter *sc)
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nports", CTLFLAG_RD, NULL,
sc->params.nports, "# of ports");
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD,
- NULL, chip_rev(sc), "chip hardware revision");
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells",
+ CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells,
+ sysctl_bitfield, "A", "available doorbells");
+
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL,
+ sc->params.vpd.cclk, "core clock frequency (in KHz)");
+
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers",
+ CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val,
+ sizeof(sc->params.sge.timer_val), sysctl_int_array, "A",
+ "interrupt holdoff timer values (us)");
+
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts",
+ CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val,
+ sizeof(sc->params.sge.counter_val), sysctl_int_array, "A",
+ "interrupt holdoff packet counter values");
+
+ t4_sge_sysctls(sc, ctx, children);
+
+ sc->lro_timeout = 100;
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW,
+ &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)");
+
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW,
+ &sc->debug_flags, 0, "flags to enable runtime debugging");
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version",
CTLFLAG_RD, sc->tp_version, 0, "TP microcode version");
+ SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version",
+ CTLFLAG_RD, sc->fw_version, 0, "firmware version");
+
+ if (sc->flags & IS_VF)
+ return;
+
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD,
+ NULL, chip_rev(sc), "chip hardware revision");
+
if (sc->params.exprom_vers != 0) {
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "exprom_version",
CTLFLAG_RD, sc->exprom_version, 0, "expansion ROM version");
}
- SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version",
- CTLFLAG_RD, sc->fw_version, 0, "firmware version");
-
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf",
CTLFLAG_RD, sc->cfg_file, 0, "configuration file");
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, NULL,
sc->cfcsum, "config file checksum");
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells",
- CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells,
- sysctl_bitfield, "A", "available doorbells");
-
#define SYSCTL_CAP(name, n, text) \
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \
CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \
@@ -4568,19 +4685,6 @@ t4_sysctls(struct adapter *sc)
SYSCTL_CAP(fcoecaps, 8, "FCoE");
#undef SYSCTL_CAP
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL,
- sc->params.vpd.cclk, "core clock frequency (in KHz)");
-
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers",
- CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val,
- sizeof(sc->params.sge.timer_val), sysctl_int_array, "A",
- "interrupt holdoff timer values (us)");
-
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts",
- CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val,
- sizeof(sc->params.sge.counter_val), sysctl_int_array, "A",
- "interrupt holdoff packet counter values");
-
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD,
NULL, sc->tids.nftids, "number of filters");
@@ -4588,15 +4692,6 @@ t4_sysctls(struct adapter *sc)
CTLFLAG_RD, sc, 0, sysctl_temperature, "I",
"chip temperature (in Celsius)");
- t4_sge_sysctls(sc, ctx, children);
-
- sc->lro_timeout = 100;
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW,
- &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)");
-
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW,
- &sc->debug_flags, 0, "flags to enable runtime debugging");
-
#ifdef SBUF_DRAIN
/*
* dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload.
@@ -4794,6 +4889,11 @@ t4_sysctls(struct adapter *sc)
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align",
CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload");
+ sc->tt.tx_zcopy = 0;
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_zcopy",
+ CTLFLAG_RW, &sc->tt.tx_zcopy, 0,
+ "Enable zero-copy aio_write(2)");
+
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick",
CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A",
"TP timer tick (us)");
@@ -4959,6 +5059,9 @@ cxgbe_sysctls(struct port_info *pi)
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "max_speed", CTLFLAG_RD, NULL,
port_top_speed(pi), "max speed (in Gbps)");
+ if (sc->flags & IS_VF)
+ return;
+
/*
* dev.(cxgbe|cxl).X.tc.
*/
@@ -8454,8 +8557,8 @@ set_sched_class_params(struct adapter *sc, struct t4_sched_class_params *p,
return (rc);
}
-static int
-set_sched_class(struct adapter *sc, struct t4_sched_params *p)
+int
+t4_set_sched_class(struct adapter *sc, struct t4_sched_params *p)
{
if (p->type != SCHED_CLASS_TYPE_PACKET)
@@ -8470,8 +8573,8 @@ set_sched_class(struct adapter *sc, struct t4_sched_params *p)
return (EINVAL);
}
-static int
-set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
+int
+t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
{
struct port_info *pi = NULL;
struct vi_info *vi;
@@ -8651,18 +8754,6 @@ t4_iterate(void (*func)(struct adapter *, void *), void *arg)
}
static int
-t4_open(struct cdev *dev, int flags, int type, struct thread *td)
-{
- return (0);
-}
-
-static int
-t4_close(struct cdev *dev, int flags, int type, struct thread *td)
-{
- return (0);
-}
-
-static int
t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
struct thread *td)
{
@@ -8707,7 +8798,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
}
case CHELSIO_T4_REGDUMP: {
struct t4_regdump *regs = (struct t4_regdump *)data;
- int reglen = is_t4(sc) ? T4_REGDUMP_SIZE : T5_REGDUMP_SIZE;
+ int reglen = t4_get_regs_len(sc);
uint8_t *buf;
if (regs->len < reglen) {
@@ -8821,10 +8912,10 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
break;
}
case CHELSIO_T4_SCHED_CLASS:
- rc = set_sched_class(sc, (struct t4_sched_params *)data);
+ rc = t4_set_sched_class(sc, (struct t4_sched_params *)data);
break;
case CHELSIO_T4_SCHED_QUEUE:
- rc = set_sched_queue(sc, (struct t4_sched_queue *)data);
+ rc = t4_set_sched_queue(sc, (struct t4_sched_queue *)data);
break;
case CHELSIO_T4_GET_TRACER:
rc = t4_get_tracer(sc, (struct t4_tracer *)data);
@@ -8833,7 +8924,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
rc = t4_set_tracer(sc, (struct t4_tracer *)data);
break;
default:
- rc = EINVAL;
+ rc = ENOTTY;
}
return (rc);
diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c
index f6c96e1..d7356e0 100644
--- a/sys/dev/cxgbe/t4_netmap.c
+++ b/sys/dev/cxgbe/t4_netmap.c
@@ -204,7 +204,7 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong)
}
}
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
+ t4_write_reg(sc, sc->sge_gts_reg,
V_INGRESSQID(nm_rxq->iq_cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx)));
@@ -364,7 +364,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp,
MPASS((j & 7) == 0);
j /= 8; /* driver pidx to hardware pidx */
wmb();
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(j));
atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON);
@@ -537,7 +537,7 @@ ring_nm_txq_db(struct adapter *sc, struct sge_nm_txq *nm_txq)
break;
case DOORBELL_KDB:
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
V_QID(nm_txq->cntxt_id) | V_PIDX(n));
break;
}
@@ -818,7 +818,7 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
}
if (++dbinc == 8 && n >= 32) {
wmb();
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(dbinc));
dbinc = 0;
}
@@ -827,7 +827,7 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
if (dbinc > 0) {
wmb();
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(dbinc));
}
}
@@ -981,14 +981,14 @@ t4_nm_intr(void *arg)
fl_credits /= 8;
IDXINCR(nm_rxq->fl_pidx, fl_credits * 8,
nm_rxq->fl_sidx);
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(fl_credits));
fl_credits = fl_cidx & 7;
} else if (!black_hole) {
netmap_rx_irq(ifp, nm_rxq->nid, &work);
MPASS(work != 0);
}
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
+ t4_write_reg(sc, sc->sge_gts_reg,
V_CIDXINC(n) | V_INGRESSQID(nm_rxq->iq_cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX)));
n = 0;
@@ -999,12 +999,12 @@ t4_nm_intr(void *arg)
if (black_hole) {
fl_credits /= 8;
IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, nm_rxq->fl_sidx);
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
nm_rxq->fl_db_val | V_PIDX(fl_credits));
} else
netmap_rx_irq(ifp, nm_rxq->nid, &work);
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) |
+ t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(n) |
V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx)));
}
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 6bf8d22..d01d10a 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
+#include <machine/in_cksum.h>
#include <machine/md_var.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -81,7 +82,7 @@ __FBSDID("$FreeBSD$");
* Ethernet frames are DMA'd at this byte offset into the freelist buffer.
* 0-7 are valid values.
*/
-int fl_pktshift = 2;
+static int fl_pktshift = 2;
TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift);
/*
@@ -98,7 +99,7 @@ TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad);
* -1: driver should figure out a good value.
* 64 or 128 are the only other valid values.
*/
-int spg_len = -1;
+static int spg_len = -1;
TUNABLE_INT("hw.cxgbe.spg_len", &spg_len);
/*
@@ -223,10 +224,13 @@ static void add_fl_to_sfl(struct adapter *, struct sge_fl *);
static inline void get_pkt_gl(struct mbuf *, struct sglist *);
static inline u_int txpkt_len16(u_int, u_int);
+static inline u_int txpkt_vm_len16(u_int, u_int);
static inline u_int txpkts0_len16(u_int);
static inline u_int txpkts1_len16(void);
static u_int write_txpkt_wr(struct sge_txq *, struct fw_eth_tx_pkt_wr *,
struct mbuf *, u_int);
+static u_int write_txpkt_vm_wr(struct sge_txq *, struct fw_eth_tx_pkt_vm_wr *,
+ struct mbuf *, u_int);
static int try_txpkts(struct mbuf *, struct mbuf *, struct txpkts *, u_int);
static int add_to_txpkts(struct mbuf *, struct txpkts *, u_int);
static u_int write_txpkts_wr(struct sge_txq *, struct fw_eth_tx_pkts_wr *,
@@ -244,6 +248,7 @@ static int handle_sge_egr_update(struct sge_iq *, const struct rss_header *,
struct mbuf *);
static int handle_fw_msg(struct sge_iq *, const struct rss_header *,
struct mbuf *);
+static int t4_handle_wrerr_rpl(struct adapter *, const __be64 *);
static void wrq_tx_drain(void *, int);
static void drain_wrq_wr_list(struct adapter *, struct sge_wrq *);
@@ -402,6 +407,7 @@ t4_sge_modload(void)
t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update);
t4_register_cpl_handler(CPL_RX_PKT, t4_eth_rx);
t4_register_fw_msg_handler(FW6_TYPE_CMD_RPL, t4_handle_fw_rpl);
+ t4_register_fw_msg_handler(FW6_TYPE_WRERR_RPL, t4_handle_wrerr_rpl);
}
void
@@ -588,7 +594,7 @@ t4_tweak_chip_settings(struct adapter *sc)
/*
* SGE wants the buffer to be at least 64B and then a multiple of 16. If
- * padding is is use the buffer's start and end need to be aligned to the pad
+ * padding is in use, the buffer's start and end need to be aligned to the pad
* boundary as well. We'll just make sure that the size is a multiple of the
* boundary here, it is up to the buffer allocation code to make sure the start
* of the buffer is aligned as well.
@@ -623,11 +629,9 @@ t4_read_chip_settings(struct adapter *sc)
struct sw_zone_info *swz, *safe_swz;
struct hw_buf_info *hwb;
- t4_init_sge_params(sc);
-
m = F_RXPKTCPLMODE;
v = F_RXPKTCPLMODE;
- r = t4_read_reg(sc, A_SGE_CONTROL);
+ r = sc->params.sge.sge_control;
if ((r & m) != v) {
device_printf(sc->dev, "invalid SGE_CONTROL(0x%x)\n", r);
rc = EINVAL;
@@ -645,7 +649,7 @@ t4_read_chip_settings(struct adapter *sc)
/* Filter out unusable hw buffer sizes entirely (mark with -2). */
hwb = &s->hw_buf_info[0];
for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) {
- r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i));
+ r = sc->params.sge.sge_fl_buffer_size[i];
hwb->size = r;
hwb->zidx = hwsz_ok(sc, r) ? -1 : -2;
hwb->next = -1;
@@ -750,6 +754,9 @@ t4_read_chip_settings(struct adapter *sc)
}
}
+ if (sc->flags & IS_VF)
+ return (0);
+
v = V_HPZ0(0) | V_HPZ1(2) | V_HPZ2(4) | V_HPZ3(6);
r = t4_read_reg(sc, A_ULP_RX_TDDP_PSZ);
if (r != v) {
@@ -860,7 +867,8 @@ t4_setup_adapter_queues(struct adapter *sc)
* Management queue. This is just a control queue that uses the fwq as
* its associated iq.
*/
- rc = alloc_mgmtq(sc);
+ if (!(sc->flags & IS_VF))
+ rc = alloc_mgmtq(sc);
return (rc);
}
@@ -1166,7 +1174,7 @@ t4_setup_vi_queues(struct vi_info *vi)
/*
* Finally, the control queue.
*/
- if (!IS_MAIN_VI(vi))
+ if (!IS_MAIN_VI(vi) || sc->flags & IS_VF)
goto done;
oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD,
NULL, "ctrl queue");
@@ -1227,7 +1235,7 @@ t4_teardown_vi_queues(struct vi_info *vi)
* (for egress updates, etc.).
*/
- if (IS_MAIN_VI(vi))
+ if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF))
free_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
for_each_txq(vi, i, txq) {
@@ -1442,7 +1450,8 @@ service_iq(struct sge_iq *iq, int budget)
break;
}
- q = sc->sge.iqmap[lq - sc->sge.iq_start];
+ q = sc->sge.iqmap[lq - sc->sge.iq_start -
+ sc->sge.iq_base];
if (atomic_cmpset_int(&q->state, IQS_IDLE,
IQS_BUSY)) {
if (service_iq(q, q->qsize / 16) == 0) {
@@ -1472,7 +1481,7 @@ service_iq(struct sge_iq *iq, int budget)
d = &iq->desc[0];
}
if (__predict_false(++ndescs == limit)) {
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
+ t4_write_reg(sc, sc->sge_gts_reg,
V_CIDXINC(ndescs) |
V_INGRESSQID(iq->cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX)));
@@ -1527,7 +1536,7 @@ process_iql:
}
#endif
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(ndescs) |
+ t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) |
V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params));
if (iq->flags & IQ_HAS_FL) {
@@ -2072,7 +2081,7 @@ m_advance(struct mbuf **pm, int *poffset, int len)
MPASS(len > 0);
- while (len) {
+ for (;;) {
if (offset + len < m->m_len) {
offset += len;
p = mtod(m, uintptr_t) + offset;
@@ -2143,7 +2152,7 @@ count_mbuf_nsegs(struct mbuf *m)
* b) it may get defragged up if the gather list is too long for the hardware.
*/
int
-parse_pkt(struct mbuf **mp)
+parse_pkt(struct adapter *sc, struct mbuf **mp)
{
struct mbuf *m0 = *mp, *m;
int rc, nsegs, defragged = 0, offset;
@@ -2190,9 +2199,13 @@ restart:
goto restart;
}
set_mbuf_nsegs(m0, nsegs);
- set_mbuf_len16(m0, txpkt_len16(nsegs, needs_tso(m0)));
+ if (sc->flags & IS_VF)
+ set_mbuf_len16(m0, txpkt_vm_len16(nsegs, needs_tso(m0)));
+ else
+ set_mbuf_len16(m0, txpkt_len16(nsegs, needs_tso(m0)));
- if (!needs_tso(m0))
+ if (!needs_tso(m0) &&
+ !(sc->flags & IS_VF && (needs_l3_csum(m0) || needs_l4_csum(m0))))
return (0);
m = m0;
@@ -2215,7 +2228,7 @@ restart:
{
struct ip6_hdr *ip6 = l3hdr;
- MPASS(ip6->ip6_nxt == IPPROTO_TCP);
+ MPASS(!needs_tso(m0) || ip6->ip6_nxt == IPPROTO_TCP);
m0->m_pkthdr.l3hlen = sizeof(*ip6);
break;
@@ -2237,8 +2250,10 @@ restart:
}
#if defined(INET) || defined(INET6)
- tcp = m_advance(&m, &offset, m0->m_pkthdr.l3hlen);
- m0->m_pkthdr.l4hlen = tcp->th_off * 4;
+ if (needs_tso(m0)) {
+ tcp = m_advance(&m, &offset, m0->m_pkthdr.l3hlen);
+ m0->m_pkthdr.l4hlen = tcp->th_off * 4;
+ }
#endif
MPASS(m0 == *mp);
return (0);
@@ -2433,7 +2448,12 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx)
next_cidx = 0;
wr = (void *)&eq->desc[eq->pidx];
- if (remaining > 1 &&
+ if (sc->flags & IS_VF) {
+ total++;
+ remaining--;
+ ETHER_BPF_MTAP(ifp, m0);
+ n = write_txpkt_vm_wr(txq, (void *)wr, m0, available);
+ } else if (remaining > 1 &&
try_txpkts(m0, r->items[next_cidx], &txp, available) == 0) {
/* pkts at cidx, next_cidx should both be in txp. */
@@ -2764,7 +2784,7 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl,
FL_UNLOCK(fl);
}
- if (is_t5(sc) && cong >= 0) {
+ if (is_t5(sc) && !(sc->flags & IS_VF) && cong >= 0) {
uint32_t param, val;
param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
@@ -2791,7 +2811,7 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl,
/* Enable IQ interrupts */
atomic_store_rel_int(&iq->state, IQS_IDLE);
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_SEINTARM(iq->intr_params) |
+ t4_write_reg(sc, sc->sge_gts_reg, V_SEINTARM(iq->intr_params) |
V_INGRESSQID(iq->cntxt_id));
return (0);
@@ -2888,9 +2908,13 @@ alloc_fwq(struct adapter *sc)
init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE);
fwq->flags |= IQ_INTR; /* always */
- intr_idx = sc->intr_count > 1 ? 1 : 0;
- fwq->set_tcb_rpl = t4_filter_rpl;
- fwq->l2t_write_rpl = do_l2t_write_rpl;
+ if (sc->flags & IS_VF)
+ intr_idx = 0;
+ else {
+ intr_idx = sc->intr_count > 1 ? 1 : 0;
+ fwq->set_tcb_rpl = t4_filter_rpl;
+ fwq->l2t_write_rpl = do_l2t_write_rpl;
+ }
rc = alloc_iq_fl(&sc->port[0]->vi[0], fwq, NULL, intr_idx, -1);
if (rc != 0) {
device_printf(sc->dev,
@@ -2970,6 +2994,7 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int intr_idx, int idx,
struct sysctl_oid *oid)
{
int rc;
+ struct adapter *sc = vi->pi->adapter;
struct sysctl_oid_list *children;
char name[16];
@@ -2978,12 +3003,20 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int intr_idx, int idx,
if (rc != 0)
return (rc);
+ if (idx == 0)
+ sc->sge.iq_base = rxq->iq.abs_id - rxq->iq.cntxt_id;
+ else
+ KASSERT(rxq->iq.cntxt_id + sc->sge.iq_base == rxq->iq.abs_id,
+ ("iq_base mismatch"));
+ KASSERT(sc->sge.iq_base == 0 || sc->flags & IS_VF,
+ ("PF with non-zero iq_base"));
+
/*
* The freelist is just barely above the starvation threshold right now,
* fill it up a bit more.
*/
FL_LOCK(&rxq->fl);
- refill_fl(vi->pi->adapter, &rxq->fl, 128);
+ refill_fl(sc, &rxq->fl, 128);
FL_UNLOCK(&rxq->fl);
#if defined(INET) || defined(INET6)
@@ -3315,6 +3348,7 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq)
eq->flags |= EQ_ALLOCATED;
eq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd));
+ eq->abs_id = G_FW_EQ_ETH_CMD_PHYSEQID(be32toh(c.physeqid_pkd));
cntxt_id = eq->cntxt_id - sc->sge.eq_start;
if (cntxt_id >= sc->sge.neq)
panic("%s: eq->cntxt_id (%d) more than the max (%d)", __func__,
@@ -3555,12 +3589,24 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx,
/* Can't fail after this point. */
+ if (idx == 0)
+ sc->sge.eq_base = eq->abs_id - eq->cntxt_id;
+ else
+ KASSERT(eq->cntxt_id + sc->sge.eq_base == eq->abs_id,
+ ("eq_base mismatch"));
+ KASSERT(sc->sge.eq_base == 0 || sc->flags & IS_VF,
+ ("PF with non-zero eq_base"));
+
TASK_INIT(&txq->tx_reclaim_task, 0, tx_reclaim, eq);
txq->ifp = vi->ifp;
txq->gl = sglist_alloc(TX_SGL_SEGS, M_WAITOK);
- txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) |
- V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) |
- V_TXPKT_VF(vi->viid));
+ if (sc->flags & IS_VF)
+ txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT_XT) |
+ V_TXPKT_INTF(pi->tx_chan));
+ else
+ txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) |
+ V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) |
+ V_TXPKT_VF(vi->viid));
txq->tc_idx = -1;
txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE,
M_ZERO | M_WAITOK);
@@ -3570,6 +3616,8 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx,
NULL, "tx queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "abs_id", CTLFLAG_RD,
+ &eq->abs_id, 0, "absolute id of the queue");
SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
&eq->cntxt_id, 0, "SGE context id of the queue");
SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx",
@@ -3674,7 +3722,7 @@ ring_fl_db(struct adapter *sc, struct sge_fl *fl)
if (fl->udb)
*fl->udb = htole32(v);
else
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), v);
+ t4_write_reg(sc, sc->sge_kdoorbell_reg, v);
IDXINCR(fl->dbidx, n, fl->sidx);
}
@@ -3911,6 +3959,27 @@ txpkt_len16(u_int nsegs, u_int tso)
}
/*
+ * len16 for a txpkt_vm WR with a GL. Includes the firmware work
+ * request header.
+ */
+static inline u_int
+txpkt_vm_len16(u_int nsegs, u_int tso)
+{
+ u_int n;
+
+ MPASS(nsegs > 0);
+
+ nsegs--; /* first segment is part of ulptx_sgl */
+ n = sizeof(struct fw_eth_tx_pkt_vm_wr) +
+ sizeof(struct cpl_tx_pkt_core) +
+ sizeof(struct ulptx_sgl) + 8 * ((3 * nsegs) / 2 + (nsegs & 1));
+ if (tso)
+ n += sizeof(struct cpl_tx_pkt_lso_core);
+
+ return (howmany(n, 16));
+}
+
+/*
* len16 for a txpkts type 0 WR with a GL. Does not include the firmware work
* request header.
*/
@@ -3955,6 +4024,181 @@ imm_payload(u_int ndesc)
}
/*
+ * Write a VM txpkt WR for this packet to the hardware descriptors, update the
+ * software descriptor, and advance the pidx. It is guaranteed that enough
+ * descriptors are available.
+ *
+ * The return value is the # of hardware descriptors used.
+ */
+static u_int
+write_txpkt_vm_wr(struct sge_txq *txq, struct fw_eth_tx_pkt_vm_wr *wr,
+ struct mbuf *m0, u_int available)
+{
+ struct sge_eq *eq = &txq->eq;
+ struct tx_sdesc *txsd;
+ struct cpl_tx_pkt_core *cpl;
+ uint32_t ctrl; /* used in many unrelated places */
+ uint64_t ctrl1;
+ int csum_type, len16, ndesc, pktlen, nsegs;
+ caddr_t dst;
+
+ TXQ_LOCK_ASSERT_OWNED(txq);
+ M_ASSERTPKTHDR(m0);
+ MPASS(available > 0 && available < eq->sidx);
+
+ len16 = mbuf_len16(m0);
+ nsegs = mbuf_nsegs(m0);
+ pktlen = m0->m_pkthdr.len;
+ ctrl = sizeof(struct cpl_tx_pkt_core);
+ if (needs_tso(m0))
+ ctrl += sizeof(struct cpl_tx_pkt_lso_core);
+ ndesc = howmany(len16, EQ_ESIZE / 16);
+ MPASS(ndesc <= available);
+
+ /* Firmware work request header */
+ MPASS(wr == (void *)&eq->desc[eq->pidx]);
+ wr->op_immdlen = htobe32(V_FW_WR_OP(FW_ETH_TX_PKT_VM_WR) |
+ V_FW_ETH_TX_PKT_WR_IMMDLEN(ctrl));
+
+ ctrl = V_FW_WR_LEN16(len16);
+ wr->equiq_to_len16 = htobe32(ctrl);
+ wr->r3[0] = 0;
+ wr->r3[1] = 0;
+
+ /*
+ * Copy over ethmacdst, ethmacsrc, ethtype, and vlantci.
+ * vlantci is ignored unless the ethtype is 0x8100, so it's
+ * simpler to always copy it rather than making it
+ * conditional. Also, it seems that we do not have to set
+ * vlantci or fake the ethtype when doing VLAN tag insertion.
+ */
+ m_copydata(m0, 0, sizeof(struct ether_header) + 2, wr->ethmacdst);
+
+ csum_type = -1;
+ if (needs_tso(m0)) {
+ struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1);
+
+ KASSERT(m0->m_pkthdr.l2hlen > 0 && m0->m_pkthdr.l3hlen > 0 &&
+ m0->m_pkthdr.l4hlen > 0,
+ ("%s: mbuf %p needs TSO but missing header lengths",
+ __func__, m0));
+
+ ctrl = V_LSO_OPCODE(CPL_TX_PKT_LSO) | F_LSO_FIRST_SLICE |
+ F_LSO_LAST_SLICE | V_LSO_IPHDR_LEN(m0->m_pkthdr.l3hlen >> 2)
+ | V_LSO_TCPHDR_LEN(m0->m_pkthdr.l4hlen >> 2);
+ if (m0->m_pkthdr.l2hlen == sizeof(struct ether_vlan_header))
+ ctrl |= V_LSO_ETHHDR_LEN(1);
+ if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr))
+ ctrl |= F_LSO_IPV6;
+
+ lso->lso_ctrl = htobe32(ctrl);
+ lso->ipid_ofst = htobe16(0);
+ lso->mss = htobe16(m0->m_pkthdr.tso_segsz);
+ lso->seqno_offset = htobe32(0);
+ lso->len = htobe32(pktlen);
+
+ if (m0->m_pkthdr.l3hlen == sizeof(struct ip6_hdr))
+ csum_type = TX_CSUM_TCPIP6;
+ else
+ csum_type = TX_CSUM_TCPIP;
+
+ cpl = (void *)(lso + 1);
+
+ txq->tso_wrs++;
+ } else {
+ if (m0->m_pkthdr.csum_flags & CSUM_IP_TCP)
+ csum_type = TX_CSUM_TCPIP;
+ else if (m0->m_pkthdr.csum_flags & CSUM_IP_UDP)
+ csum_type = TX_CSUM_UDPIP;
+ else if (m0->m_pkthdr.csum_flags & CSUM_IP6_TCP)
+ csum_type = TX_CSUM_TCPIP6;
+ else if (m0->m_pkthdr.csum_flags & CSUM_IP6_UDP)
+ csum_type = TX_CSUM_UDPIP6;
+#if defined(INET)
+ else if (m0->m_pkthdr.csum_flags & CSUM_IP) {
+ /*
+ * XXX: The firmware appears to stomp on the
+ * fragment/flags field of the IP header when
+ * using TX_CSUM_IP. Fall back to doing
+ * software checksums.
+ */
+ u_short *sump;
+ struct mbuf *m;
+ int offset;
+
+ m = m0;
+ offset = 0;
+ sump = m_advance(&m, &offset, m0->m_pkthdr.l2hlen +
+ offsetof(struct ip, ip_sum));
+ *sump = in_cksum_skip(m0, m0->m_pkthdr.l2hlen +
+ m0->m_pkthdr.l3hlen, m0->m_pkthdr.l2hlen);
+ m0->m_pkthdr.csum_flags &= ~CSUM_IP;
+ }
+#endif
+
+ cpl = (void *)(wr + 1);
+ }
+
+ /* Checksum offload */
+ ctrl1 = 0;
+ if (needs_l3_csum(m0) == 0)
+ ctrl1 |= F_TXPKT_IPCSUM_DIS;
+ if (csum_type >= 0) {
+ KASSERT(m0->m_pkthdr.l2hlen > 0 && m0->m_pkthdr.l3hlen > 0,
+ ("%s: mbuf %p needs checksum offload but missing header lengths",
+ __func__, m0));
+
+ /* XXX: T6 */
+ ctrl1 |= V_TXPKT_ETHHDR_LEN(m0->m_pkthdr.l2hlen -
+ ETHER_HDR_LEN);
+ ctrl1 |= V_TXPKT_IPHDR_LEN(m0->m_pkthdr.l3hlen);
+ ctrl1 |= V_TXPKT_CSUM_TYPE(csum_type);
+ } else
+ ctrl1 |= F_TXPKT_L4CSUM_DIS;
+ if (m0->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TCP | CSUM_UDP |
+ CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO))
+ txq->txcsum++; /* some hardware assistance provided */
+
+ /* VLAN tag insertion */
+ if (needs_vlan_insertion(m0)) {
+ ctrl1 |= F_TXPKT_VLAN_VLD |
+ V_TXPKT_VLAN(m0->m_pkthdr.ether_vtag);
+ txq->vlan_insertion++;
+ }
+
+ /* CPL header */
+ cpl->ctrl0 = txq->cpl_ctrl0;
+ cpl->pack = 0;
+ cpl->len = htobe16(pktlen);
+ cpl->ctrl1 = htobe64(ctrl1);
+
+ /* SGL */
+ dst = (void *)(cpl + 1);
+
+ /*
+ * A packet using TSO will use up an entire descriptor for the
+ * firmware work request header, LSO CPL, and TX_PKT_XT CPL.
+ * If this descriptor is the last descriptor in the ring, wrap
+ * around to the front of the ring explicitly for the start of
+ * the sgl.
+ */
+ if (dst == (void *)&eq->desc[eq->sidx]) {
+ dst = (void *)&eq->desc[0];
+ write_gl_to_txd(txq, m0, &dst, 0);
+ } else
+ write_gl_to_txd(txq, m0, &dst, eq->sidx - ndesc < eq->pidx);
+ txq->sgl_wrs++;
+
+ txq->txpkt_wrs++;
+
+ txsd = &txq->sdesc[eq->pidx];
+ txsd->m = m0;
+ txsd->desc_used = ndesc;
+
+ return (ndesc);
+}
+
+/*
* Write a txpkt WR for this packet to the hardware descriptors, update the
* software descriptor, and advance the pidx. It is guaranteed that enough
* descriptors are available.
@@ -4407,7 +4651,7 @@ ring_eq_db(struct adapter *sc, struct sge_eq *eq, u_int n)
break;
case DOORBELL_KDB:
- t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL),
+ t4_write_reg(sc, sc->sge_kdoorbell_reg,
V_QID(eq->cntxt_id) | V_PIDX(n));
break;
}
@@ -4753,7 +4997,7 @@ handle_sge_egr_update(struct sge_iq *iq, const struct rss_header *rss,
KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__,
rss->opcode));
- eq = s->eqmap[qid - s->eq_start];
+ eq = s->eqmap[qid - s->eq_start - s->eq_base];
(*h[eq->flags & EQ_TYPEMASK])(sc, eq);
return (0);
@@ -4782,6 +5026,71 @@ handle_fw_msg(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
return (t4_fw_msg_handler[cpl->type](sc, &cpl->data[0]));
}
+/**
+ * t4_handle_wrerr_rpl - process a FW work request error message
+ * @adap: the adapter
+ * @rpl: start of the FW message
+ */
+static int
+t4_handle_wrerr_rpl(struct adapter *adap, const __be64 *rpl)
+{
+ u8 opcode = *(const u8 *)rpl;
+ const struct fw_error_cmd *e = (const void *)rpl;
+ unsigned int i;
+
+ if (opcode != FW_ERROR_CMD) {
+ log(LOG_ERR,
+ "%s: Received WRERR_RPL message with opcode %#x\n",
+ device_get_nameunit(adap->dev), opcode);
+ return (EINVAL);
+ }
+ log(LOG_ERR, "%s: FW_ERROR (%s) ", device_get_nameunit(adap->dev),
+ G_FW_ERROR_CMD_FATAL(be32toh(e->op_to_type)) ? "fatal" :
+ "non-fatal");
+ switch (G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type))) {
+ case FW_ERROR_TYPE_EXCEPTION:
+ log(LOG_ERR, "exception info:\n");
+ for (i = 0; i < nitems(e->u.exception.info); i++)
+ log(LOG_ERR, "%s%08x", i == 0 ? "\t" : " ",
+ be32toh(e->u.exception.info[i]));
+ log(LOG_ERR, "\n");
+ break;
+ case FW_ERROR_TYPE_HWMODULE:
+ log(LOG_ERR, "HW module regaddr %08x regval %08x\n",
+ be32toh(e->u.hwmodule.regaddr),
+ be32toh(e->u.hwmodule.regval));
+ break;
+ case FW_ERROR_TYPE_WR:
+ log(LOG_ERR, "WR cidx %d PF %d VF %d eqid %d hdr:\n",
+ be16toh(e->u.wr.cidx),
+ G_FW_ERROR_CMD_PFN(be16toh(e->u.wr.pfn_vfn)),
+ G_FW_ERROR_CMD_VFN(be16toh(e->u.wr.pfn_vfn)),
+ be32toh(e->u.wr.eqid));
+ for (i = 0; i < nitems(e->u.wr.wrhdr); i++)
+ log(LOG_ERR, "%s%02x", i == 0 ? "\t" : " ",
+ e->u.wr.wrhdr[i]);
+ log(LOG_ERR, "\n");
+ break;
+ case FW_ERROR_TYPE_ACL:
+ log(LOG_ERR, "ACL cidx %d PF %d VF %d eqid %d %s",
+ be16toh(e->u.acl.cidx),
+ G_FW_ERROR_CMD_PFN(be16toh(e->u.acl.pfn_vfn)),
+ G_FW_ERROR_CMD_VFN(be16toh(e->u.acl.pfn_vfn)),
+ be32toh(e->u.acl.eqid),
+ G_FW_ERROR_CMD_MV(be16toh(e->u.acl.mv_pkd)) ? "vlanid" :
+ "MAC");
+ for (i = 0; i < nitems(e->u.acl.val); i++)
+ log(LOG_ERR, " %02x", e->u.acl.val[i]);
+ log(LOG_ERR, "\n");
+ break;
+ default:
+ log(LOG_ERR, "type %#x\n",
+ G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type)));
+ return (EINVAL);
+ }
+ return (0);
+}
+
static int
sysctl_uint16(SYSCTL_HANDLER_ARGS)
{
diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c
new file mode 100644
index 0000000..057f485
--- /dev/null
+++ b/sys/dev/cxgbe/t4_vf.c
@@ -0,0 +1,950 @@
+/*-
+ * Copyright (c) 2016 Chelsio Communications, Inc.
+ * All rights reserved.
+ * Written by: John Baldwin <jhb@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_inet.h"
+#include "opt_inet6.h"
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/priv.h>
+#include <dev/pci/pcivar.h>
+#if defined(__i386__) || defined(__amd64__)
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#endif
+
+#include "common/common.h"
+#include "common/t4_regs.h"
+#include "t4_ioctl.h"
+#include "t4_mp_ring.h"
+
+/*
+ * Some notes:
+ *
+ * The Virtual Interfaces are connected to an internal switch on the chip
+ * which allows VIs attached to the same port to talk to each other even when
+ * the port link is down. As a result, we might want to always report a
+ * VF's link as being "up".
+ *
+ * XXX: Add a TUNABLE and possible per-device sysctl for this?
+ */
+
+struct intrs_and_queues {
+ uint16_t intr_type; /* MSI, or MSI-X */
+ uint16_t nirq; /* Total # of vectors */
+ uint16_t intr_flags_10g;/* Interrupt flags for each 10G port */
+ uint16_t intr_flags_1g; /* Interrupt flags for each 1G port */
+ uint16_t ntxq10g; /* # of NIC txq's for each 10G port */
+ uint16_t nrxq10g; /* # of NIC rxq's for each 10G port */
+ uint16_t ntxq1g; /* # of NIC txq's for each 1G port */
+ uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */
+};
+
+struct {
+ uint16_t device;
+ char *desc;
+} t4vf_pciids[] = {
+ {0x4800, "Chelsio T440-dbg VF"},
+ {0x4801, "Chelsio T420-CR VF"},
+ {0x4802, "Chelsio T422-CR VF"},
+ {0x4803, "Chelsio T440-CR VF"},
+ {0x4804, "Chelsio T420-BCH VF"},
+ {0x4805, "Chelsio T440-BCH VF"},
+ {0x4806, "Chelsio T440-CH VF"},
+ {0x4807, "Chelsio T420-SO VF"},
+ {0x4808, "Chelsio T420-CX VF"},
+ {0x4809, "Chelsio T420-BT VF"},
+ {0x480a, "Chelsio T404-BT VF"},
+ {0x480e, "Chelsio T440-LP-CR VF"},
+}, t5vf_pciids[] = {
+ {0x5800, "Chelsio T580-dbg VF"},
+ {0x5801, "Chelsio T520-CR VF"}, /* 2 x 10G */
+ {0x5802, "Chelsio T522-CR VF"}, /* 2 x 10G, 2 X 1G */
+ {0x5803, "Chelsio T540-CR VF"}, /* 4 x 10G */
+ {0x5807, "Chelsio T520-SO VF"}, /* 2 x 10G, nomem */
+ {0x5809, "Chelsio T520-BT VF"}, /* 2 x 10GBaseT */
+ {0x580a, "Chelsio T504-BT VF"}, /* 4 x 1G */
+ {0x580d, "Chelsio T580-CR VF"}, /* 2 x 40G */
+ {0x580e, "Chelsio T540-LP-CR VF"}, /* 4 x 10G */
+ {0x5810, "Chelsio T580-LP-CR VF"}, /* 2 x 40G */
+ {0x5811, "Chelsio T520-LL-CR VF"}, /* 2 x 10G */
+ {0x5812, "Chelsio T560-CR VF"}, /* 1 x 40G, 2 x 10G */
+ {0x5814, "Chelsio T580-LP-SO-CR VF"}, /* 2 x 40G, nomem */
+ {0x5815, "Chelsio T502-BT VF"}, /* 2 x 1G */
+#ifdef notyet
+ {0x5804, "Chelsio T520-BCH VF"},
+ {0x5805, "Chelsio T540-BCH VF"},
+ {0x5806, "Chelsio T540-CH VF"},
+ {0x5808, "Chelsio T520-CX VF"},
+ {0x580b, "Chelsio B520-SR VF"},
+ {0x580c, "Chelsio B504-BT VF"},
+ {0x580f, "Chelsio Amsterdam VF"},
+ {0x5813, "Chelsio T580-CHR VF"},
+#endif
+};
+
+static d_ioctl_t t4vf_ioctl;
+
+static struct cdevsw t4vf_cdevsw = {
+ .d_version = D_VERSION,
+ .d_ioctl = t4vf_ioctl,
+ .d_name = "t4vf",
+};
+
+static int
+t4vf_probe(device_t dev)
+{
+ uint16_t d;
+ size_t i;
+
+ d = pci_get_device(dev);
+ for (i = 0; i < nitems(t4vf_pciids); i++) {
+ if (d == t4vf_pciids[i].device) {
+ device_set_desc(dev, t4vf_pciids[i].desc);
+ return (BUS_PROBE_DEFAULT);
+ }
+ }
+ return (ENXIO);
+}
+
+static int
+t5vf_probe(device_t dev)
+{
+ uint16_t d;
+ size_t i;
+
+ d = pci_get_device(dev);
+ for (i = 0; i < nitems(t5vf_pciids); i++) {
+ if (d == t5vf_pciids[i].device) {
+ device_set_desc(dev, t5vf_pciids[i].desc);
+ return (BUS_PROBE_DEFAULT);
+ }
+ }
+ return (ENXIO);
+}
+
+#define FW_PARAM_DEV(param) \
+ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \
+ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param))
+#define FW_PARAM_PFVF(param) \
+ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) | \
+ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param))
+
+static int
+get_params__pre_init(struct adapter *sc)
+{
+ int rc;
+ uint32_t param[3], val[3];
+
+ param[0] = FW_PARAM_DEV(FWREV);
+ param[1] = FW_PARAM_DEV(TPREV);
+ param[2] = FW_PARAM_DEV(CCLK);
+ rc = -t4vf_query_params(sc, nitems(param), param, val);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "failed to query parameters (pre_init): %d.\n", rc);
+ return (rc);
+ }
+
+ sc->params.fw_vers = val[0];
+ sc->params.tp_vers = val[1];
+ sc->params.vpd.cclk = val[2];
+
+ snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
+ G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
+ G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
+ G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
+ G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
+
+ snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u",
+ G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers),
+ G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers),
+ G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers),
+ G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers));
+
+ return (0);
+}
+
+static int
+get_params__post_init(struct adapter *sc)
+{
+ int rc;
+
+ rc = -t4vf_get_sge_params(sc);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "unable to retrieve adapter SGE parameters: %d\n", rc);
+ return (rc);
+ }
+
+ rc = -t4vf_get_rss_glb_config(sc);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "unable to retrieve adapter RSS parameters: %d\n", rc);
+ return (rc);
+ }
+ if (sc->params.rss.mode != FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL) {
+ device_printf(sc->dev,
+ "unable to operate with global RSS mode %d\n",
+ sc->params.rss.mode);
+ return (EINVAL);
+ }
+
+ rc = t4_read_chip_settings(sc);
+ if (rc != 0)
+ return (rc);
+
+ /*
+ * Grab our Virtual Interface resource allocation, extract the
+ * features that we're interested in and do a bit of sanity testing on
+ * what we discover.
+ */
+ rc = -t4vf_get_vfres(sc);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "unable to get virtual interface resources: %d\n", rc);
+ return (rc);
+ }
+
+ /*
+ * Check for various parameter sanity issues.
+ */
+ if (sc->params.vfres.pmask == 0) {
+ device_printf(sc->dev, "no port access configured/usable!\n");
+ return (EINVAL);
+ }
+ if (sc->params.vfres.nvi == 0) {
+ device_printf(sc->dev,
+ "no virtual interfaces configured/usable!\n");
+ return (EINVAL);
+ }
+ sc->params.portvec = sc->params.vfres.pmask;
+
+ return (0);
+}
+
+static int
+set_params__post_init(struct adapter *sc)
+{
+ uint32_t param, val;
+
+ /* ask for encapsulated CPLs */
+ param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP);
+ val = 1;
+ (void)t4vf_set_params(sc, 1, &param, &val);
+
+ return (0);
+}
+
+#undef FW_PARAM_PFVF
+#undef FW_PARAM_DEV
+
+static int
+cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
+ struct intrs_and_queues *iaq)
+{
+ struct vf_resources *vfres;
+ int nrxq10g, nrxq1g, nrxq;
+ int ntxq10g, ntxq1g, ntxq;
+ int itype, iq_avail, navail, rc;
+
+ /*
+ * Figure out the layout of queues across our VIs and ensure
+ * we can allocate enough interrupts for our layout.
+ */
+ vfres = &sc->params.vfres;
+ bzero(iaq, sizeof(*iaq));
+
+ for (itype = INTR_MSIX; itype != 0; itype >>= 1) {
+ if (itype == INTR_INTX)
+ continue;
+
+ if (itype == INTR_MSIX)
+ navail = pci_msix_count(sc->dev);
+ else
+ navail = pci_msi_count(sc->dev);
+
+ if (navail == 0)
+ continue;
+
+ iaq->intr_type = itype;
+ iaq->intr_flags_10g = 0;
+ iaq->intr_flags_1g = 0;
+
+ /*
+ * XXX: The Linux driver reserves an Ingress Queue for
+ * forwarded interrupts when using MSI (but not MSI-X).
+ * It seems it just always asks for 2 interrupts and
+ * forwards all rxqs to the forwarded interrupt.
+ *
+ * We must reserve one IRQ for the for the firmware
+ * event queue.
+ *
+ * Every rxq requires an ingress queue with a free
+ * list and interrupts and an egress queue. Every txq
+ * requires an ETH egress queue.
+ */
+ iaq->nirq = T4VF_EXTRA_INTR;
+
+ /*
+ * First, determine how many queues we can allocate.
+ * Start by finding the upper bound on rxqs from the
+ * limit on ingress queues.
+ */
+ iq_avail = vfres->niqflint - iaq->nirq;
+ if (iq_avail < n10g + n1g) {
+ device_printf(sc->dev,
+ "Not enough ingress queues (%d) for %d ports\n",
+ vfres->niqflint, n10g + n1g);
+ return (ENXIO);
+ }
+
+ /*
+ * Try to honor the cap on interrupts. If there aren't
+ * enough interrupts for at least one interrupt per
+ * port, then don't bother, we will just forward all
+ * interrupts to one interrupt in that case.
+ */
+ if (iaq->nirq + n10g + n1g <= navail) {
+ if (iq_avail > navail - iaq->nirq)
+ iq_avail = navail - iaq->nirq;
+ }
+
+ nrxq10g = t4_nrxq10g;
+ nrxq1g = t4_nrxq1g;
+ nrxq = n10g * nrxq10g + n1g * nrxq1g;
+ if (nrxq > iq_avail && nrxq1g > 1) {
+ /* Too many ingress queues. Try just 1 for 1G. */
+ nrxq1g = 1;
+ nrxq = n10g * nrxq10g + n1g * nrxq1g;
+ }
+ if (nrxq > iq_avail) {
+ /*
+ * Still too many ingress queues. Use what we
+ * can for each 10G port.
+ */
+ nrxq10g = (iq_avail - n1g) / n10g;
+ nrxq = n10g * nrxq10g + n1g * nrxq1g;
+ }
+ KASSERT(nrxq <= iq_avail, ("too many ingress queues"));
+
+ /*
+ * Next, determine the upper bound on txqs from the limit
+ * on ETH queues.
+ */
+ if (vfres->nethctrl < n10g + n1g) {
+ device_printf(sc->dev,
+ "Not enough ETH queues (%d) for %d ports\n",
+ vfres->nethctrl, n10g + n1g);
+ return (ENXIO);
+ }
+
+ ntxq10g = t4_ntxq10g;
+ ntxq1g = t4_ntxq1g;
+ ntxq = n10g * ntxq10g + n1g * ntxq1g;
+ if (ntxq > vfres->nethctrl) {
+ /* Too many ETH queues. Try just 1 for 1G. */
+ ntxq1g = 1;
+ ntxq = n10g * ntxq10g + n1g * ntxq1g;
+ }
+ if (ntxq > vfres->nethctrl) {
+ /*
+ * Still too many ETH queues. Use what we
+ * can for each 10G port.
+ */
+ ntxq10g = (vfres->nethctrl - n1g) / n10g;
+ ntxq = n10g * ntxq10g + n1g * ntxq1g;
+ }
+ KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues"));
+
+ /*
+ * Finally, ensure we have enough egress queues.
+ */
+ if (vfres->neq < (n10g + n1g) * 2) {
+ device_printf(sc->dev,
+ "Not enough egress queues (%d) for %d ports\n",
+ vfres->neq, n10g + n1g);
+ return (ENXIO);
+ }
+ if (nrxq + ntxq > vfres->neq) {
+ /* Just punt and use 1 for everything. */
+ nrxq1g = ntxq1g = nrxq10g = ntxq10g = 1;
+ nrxq = n10g * nrxq10g + n1g * nrxq1g;
+ ntxq = n10g * ntxq10g + n1g * ntxq1g;
+ }
+ KASSERT(nrxq <= iq_avail, ("too many ingress queues"));
+ KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues"));
+ KASSERT(nrxq + ntxq <= vfres->neq, ("too many egress queues"));
+
+ /*
+ * Do we have enough interrupts? For MSI the interrupts
+ * have to be a power of 2 as well.
+ */
+ iaq->nirq += nrxq;
+ iaq->ntxq10g = ntxq10g;
+ iaq->ntxq1g = ntxq1g;
+ iaq->nrxq10g = nrxq10g;
+ iaq->nrxq1g = nrxq1g;
+ if (iaq->nirq <= navail &&
+ (itype != INTR_MSI || powerof2(iaq->nirq))) {
+ navail = iaq->nirq;
+ if (itype == INTR_MSIX)
+ rc = pci_alloc_msix(sc->dev, &navail);
+ else
+ rc = pci_alloc_msi(sc->dev, &navail);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "failed to allocate vectors:%d, type=%d, req=%d, rcvd=%d\n",
+ itype, rc, iaq->nirq, navail);
+ return (rc);
+ }
+ if (navail == iaq->nirq) {
+ iaq->intr_flags_10g = INTR_RXQ;
+ iaq->intr_flags_1g = INTR_RXQ;
+ return (0);
+ }
+ pci_release_msi(sc->dev);
+ }
+
+ /* Fall back to a single interrupt. */
+ iaq->nirq = 1;
+ navail = iaq->nirq;
+ if (itype == INTR_MSIX)
+ rc = pci_alloc_msix(sc->dev, &navail);
+ else
+ rc = pci_alloc_msi(sc->dev, &navail);
+ if (rc != 0)
+ device_printf(sc->dev,
+ "failed to allocate vectors:%d, type=%d, req=%d, rcvd=%d\n",
+ itype, rc, iaq->nirq, navail);
+ iaq->intr_flags_10g = 0;
+ iaq->intr_flags_1g = 0;
+ return (rc);
+ }
+
+ device_printf(sc->dev,
+ "failed to find a usable interrupt type. "
+ "allowed=%d, msi-x=%d, msi=%d, intx=1", t4_intr_types,
+ pci_msix_count(sc->dev), pci_msi_count(sc->dev));
+
+ return (ENXIO);
+}
+
+static int
+t4vf_attach(device_t dev)
+{
+ struct adapter *sc;
+ int rc = 0, i, j, n10g, n1g, rqidx, tqidx;
+ struct make_dev_args mda;
+ struct intrs_and_queues iaq;
+ struct sge *s;
+
+ sc = device_get_softc(dev);
+ sc->dev = dev;
+ pci_enable_busmaster(dev);
+ pci_set_max_read_req(dev, 4096);
+ sc->params.pci.mps = pci_get_max_payload(dev);
+
+ sc->flags |= IS_VF;
+
+ sc->sge_gts_reg = VF_SGE_REG(A_SGE_VF_GTS);
+ sc->sge_kdoorbell_reg = VF_SGE_REG(A_SGE_VF_KDOORBELL);
+ snprintf(sc->lockname, sizeof(sc->lockname), "%s",
+ device_get_nameunit(dev));
+ mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF);
+ t4_add_adapter(sc);
+
+ mtx_init(&sc->sfl_lock, "starving freelists", 0, MTX_DEF);
+ TAILQ_INIT(&sc->sfl);
+ callout_init_mtx(&sc->sfl_callout, &sc->sfl_lock, 0);
+
+ mtx_init(&sc->reg_lock, "indirect register access", 0, MTX_DEF);
+
+ rc = t4_map_bars_0_and_4(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ rc = -t4vf_prep_adapter(sc);
+ if (rc != 0)
+ goto done;
+
+ /*
+ * Leave the 'pf' and 'mbox' values as zero. This ensures
+ * that various firmware messages do not set the fields which
+ * is the correct thing to do for a VF.
+ */
+
+ memset(sc->chan_map, 0xff, sizeof(sc->chan_map));
+
+ make_dev_args_init(&mda);
+ mda.mda_devsw = &t4vf_cdevsw;
+ mda.mda_uid = UID_ROOT;
+ mda.mda_gid = GID_WHEEL;
+ mda.mda_mode = 0600;
+ mda.mda_si_drv1 = sc;
+ rc = make_dev_s(&mda, &sc->cdev, "%s", device_get_nameunit(dev));
+ if (rc != 0)
+ device_printf(dev, "failed to create nexus char device: %d.\n",
+ rc);
+
+#if defined(__i386__)
+ if ((cpu_feature & CPUID_CX8) == 0) {
+ device_printf(dev, "64 bit atomics not available.\n");
+ rc = ENOTSUP;
+ goto done;
+ }
+#endif
+
+ /*
+ * Some environments do not properly handle PCIE FLRs -- e.g. in Linux
+ * 2.6.31 and later we can't call pci_reset_function() in order to
+ * issue an FLR because of a self- deadlock on the device semaphore.
+ * Meanwhile, the OS infrastructure doesn't issue FLRs in all the
+ * cases where they're needed -- for instance, some versions of KVM
+ * fail to reset "Assigned Devices" when the VM reboots. Therefore we
+ * use the firmware based reset in order to reset any per function
+ * state.
+ */
+ rc = -t4vf_fw_reset(sc);
+ if (rc != 0) {
+ device_printf(dev, "FW reset failed: %d\n", rc);
+ goto done;
+ }
+ sc->flags |= FW_OK;
+
+ /*
+ * Grab basic operational parameters. These will predominantly have
+ * been set up by the Physical Function Driver or will be hard coded
+ * into the adapter. We just have to live with them ... Note that
+ * we _must_ get our VPD parameters before our SGE parameters because
+ * we need to know the adapter's core clock from the VPD in order to
+ * properly decode the SGE Timer Values.
+ */
+ rc = get_params__pre_init(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+ rc = get_params__post_init(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ rc = set_params__post_init(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ rc = t4_map_bar_2(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ rc = t4_create_dma_tag(sc);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ /*
+ * The number of "ports" which we support is equal to the number of
+ * Virtual Interfaces with which we've been provisioned.
+ */
+ sc->params.nports = imin(sc->params.vfres.nvi, MAX_NPORTS);
+
+ /*
+ * We may have been provisioned with more VIs than the number of
+ * ports we're allowed to access (our Port Access Rights Mask).
+ * Just use a single VI for each port.
+ */
+ sc->params.nports = imin(sc->params.nports,
+ bitcount32(sc->params.vfres.pmask));
+
+#ifdef notyet
+ /*
+ * XXX: The Linux VF driver will lower nports if it thinks there
+ * are too few resources in vfres (niqflint, nethctrl, neq).
+ */
+#endif
+
+ /*
+ * First pass over all the ports - allocate VIs and initialize some
+ * basic parameters like mac address, port type, etc. We also figure
+ * out whether a port is 10G or 1G and use that information when
+ * calculating how many interrupts to attempt to allocate.
+ */
+ n10g = n1g = 0;
+ for_each_port(sc, i) {
+ struct port_info *pi;
+
+ pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK);
+ sc->port[i] = pi;
+
+ /* These must be set before t4_port_init */
+ pi->adapter = sc;
+ pi->port_id = i;
+ pi->nvi = 1;
+ pi->vi = malloc(sizeof(struct vi_info) * pi->nvi, M_CXGBE,
+ M_ZERO | M_WAITOK);
+
+ /*
+ * Allocate the "main" VI and initialize parameters
+ * like mac addr.
+ */
+ rc = -t4_port_init(sc, sc->mbox, sc->pf, 0, i);
+ if (rc != 0) {
+ device_printf(dev, "unable to initialize port %d: %d\n",
+ i, rc);
+ free(pi->vi, M_CXGBE);
+ free(pi, M_CXGBE);
+ sc->port[i] = NULL;
+ goto done;
+ }
+
+ /* No t4_link_start. */
+
+ snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d",
+ device_get_nameunit(dev), i);
+ mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF);
+ sc->chan_map[pi->tx_chan] = i;
+
+ pi->tc = malloc(sizeof(struct tx_sched_class) *
+ sc->chip_params->nsched_cls, M_CXGBE, M_ZERO | M_WAITOK);
+
+ if (is_10G_port(pi) || is_40G_port(pi)) {
+ n10g++;
+ } else {
+ n1g++;
+ }
+
+ pi->linkdnrc = -1;
+
+ pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbev" : "cxlv",
+ -1);
+ if (pi->dev == NULL) {
+ device_printf(dev,
+ "failed to add device for port %d.\n", i);
+ rc = ENXIO;
+ goto done;
+ }
+ pi->vi[0].dev = pi->dev;
+ device_set_softc(pi->dev, pi);
+ }
+
+ /*
+ * Interrupt type, # of interrupts, # of rx/tx queues, etc.
+ */
+ rc = cfg_itype_and_nqueues(sc, n10g, n1g, &iaq);
+ if (rc != 0)
+ goto done; /* error message displayed already */
+
+ sc->intr_type = iaq.intr_type;
+ sc->intr_count = iaq.nirq;
+
+ s = &sc->sge;
+ s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g;
+ s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g;
+ s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */
+ s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */
+ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */
+
+ s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE,
+ M_ZERO | M_WAITOK);
+ s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE,
+ M_ZERO | M_WAITOK);
+ s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE,
+ M_ZERO | M_WAITOK);
+ s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE,
+ M_ZERO | M_WAITOK);
+
+ sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE,
+ M_ZERO | M_WAITOK);
+
+ /*
+ * Second pass over the ports. This time we know the number of rx and
+ * tx queues that each port should get.
+ */
+ rqidx = tqidx = 0;
+ for_each_port(sc, i) {
+ struct port_info *pi = sc->port[i];
+ struct vi_info *vi;
+
+ if (pi == NULL)
+ continue;
+
+ for_each_vi(pi, j, vi) {
+ vi->pi = pi;
+ vi->qsize_rxq = t4_qsize_rxq;
+ vi->qsize_txq = t4_qsize_txq;
+
+ vi->first_rxq = rqidx;
+ vi->first_txq = tqidx;
+ if (is_10G_port(pi) || is_40G_port(pi)) {
+ vi->tmr_idx = t4_tmr_idx_10g;
+ vi->pktc_idx = t4_pktc_idx_10g;
+ vi->flags |= iaq.intr_flags_10g & INTR_RXQ;
+ vi->nrxq = j == 0 ? iaq.nrxq10g : 1;
+ vi->ntxq = j == 0 ? iaq.ntxq10g : 1;
+ } else {
+ vi->tmr_idx = t4_tmr_idx_1g;
+ vi->pktc_idx = t4_pktc_idx_1g;
+ vi->flags |= iaq.intr_flags_1g & INTR_RXQ;
+ vi->nrxq = j == 0 ? iaq.nrxq1g : 1;
+ vi->ntxq = j == 0 ? iaq.ntxq1g : 1;
+ }
+ rqidx += vi->nrxq;
+ tqidx += vi->ntxq;
+
+ vi->rsrv_noflowq = 0;
+ }
+ }
+
+ rc = t4_setup_intr_handlers(sc);
+ if (rc != 0) {
+ device_printf(dev,
+ "failed to setup interrupt handlers: %d\n", rc);
+ goto done;
+ }
+
+ rc = bus_generic_attach(dev);
+ if (rc != 0) {
+ device_printf(dev,
+ "failed to attach all child ports: %d\n", rc);
+ goto done;
+ }
+
+ device_printf(dev,
+ "%d ports, %d %s interrupt%s, %d eq, %d iq\n",
+ sc->params.nports, sc->intr_count, sc->intr_type == INTR_MSIX ?
+ "MSI-X" : "MSI", sc->intr_count > 1 ? "s" : "", sc->sge.neq,
+ sc->sge.niq);
+
+done:
+ if (rc != 0)
+ t4_detach_common(dev);
+ else
+ t4_sysctls(sc);
+
+ return (rc);
+}
+
+static void
+get_regs(struct adapter *sc, struct t4_regdump *regs, uint8_t *buf)
+{
+
+ /* 0x3f is used as the revision for VFs. */
+ regs->version = chip_id(sc) | (0x3f << 10);
+ t4_get_regs(sc, buf, regs->len);
+}
+
+static void
+t4_clr_vi_stats(struct adapter *sc)
+{
+ int reg;
+
+ for (reg = A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L;
+ reg <= A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H; reg += 4)
+ t4_write_reg(sc, VF_MPS_REG(reg), 0);
+}
+
+static int
+t4vf_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
+ struct thread *td)
+{
+ int rc;
+ struct adapter *sc = dev->si_drv1;
+
+ rc = priv_check(td, PRIV_DRIVER);
+ if (rc != 0)
+ return (rc);
+
+ switch (cmd) {
+ case CHELSIO_T4_GETREG: {
+ struct t4_reg *edata = (struct t4_reg *)data;
+
+ if ((edata->addr & 0x3) != 0 || edata->addr >= sc->mmio_len)
+ return (EFAULT);
+
+ if (edata->size == 4)
+ edata->val = t4_read_reg(sc, edata->addr);
+ else if (edata->size == 8)
+ edata->val = t4_read_reg64(sc, edata->addr);
+ else
+ return (EINVAL);
+
+ break;
+ }
+ case CHELSIO_T4_SETREG: {
+ struct t4_reg *edata = (struct t4_reg *)data;
+
+ if ((edata->addr & 0x3) != 0 || edata->addr >= sc->mmio_len)
+ return (EFAULT);
+
+ if (edata->size == 4) {
+ if (edata->val & 0xffffffff00000000)
+ return (EINVAL);
+ t4_write_reg(sc, edata->addr, (uint32_t) edata->val);
+ } else if (edata->size == 8)
+ t4_write_reg64(sc, edata->addr, edata->val);
+ else
+ return (EINVAL);
+ break;
+ }
+ case CHELSIO_T4_REGDUMP: {
+ struct t4_regdump *regs = (struct t4_regdump *)data;
+ int reglen = t4_get_regs_len(sc);
+ uint8_t *buf;
+
+ if (regs->len < reglen) {
+ regs->len = reglen; /* hint to the caller */
+ return (ENOBUFS);
+ }
+
+ regs->len = reglen;
+ buf = malloc(reglen, M_CXGBE, M_WAITOK | M_ZERO);
+ get_regs(sc, regs, buf);
+ rc = copyout(buf, regs->data, reglen);
+ free(buf, M_CXGBE);
+ break;
+ }
+ case CHELSIO_T4_CLEAR_STATS: {
+ int i, v;
+ u_int port_id = *(uint32_t *)data;
+ struct port_info *pi;
+ struct vi_info *vi;
+
+ if (port_id >= sc->params.nports)
+ return (EINVAL);
+ pi = sc->port[port_id];
+
+ /* MAC stats */
+ pi->tx_parse_error = 0;
+ t4_clr_vi_stats(sc);
+
+ /*
+ * Since this command accepts a port, clear stats for
+ * all VIs on this port.
+ */
+ for_each_vi(pi, v, vi) {
+ if (vi->flags & VI_INIT_DONE) {
+ struct sge_rxq *rxq;
+ struct sge_txq *txq;
+
+ for_each_rxq(vi, i, rxq) {
+#if defined(INET) || defined(INET6)
+ rxq->lro.lro_queued = 0;
+ rxq->lro.lro_flushed = 0;
+#endif
+ rxq->rxcsum = 0;
+ rxq->vlan_extraction = 0;
+ }
+
+ for_each_txq(vi, i, txq) {
+ txq->txcsum = 0;
+ txq->tso_wrs = 0;
+ txq->vlan_insertion = 0;
+ txq->imm_wrs = 0;
+ txq->sgl_wrs = 0;
+ txq->txpkt_wrs = 0;
+ txq->txpkts0_wrs = 0;
+ txq->txpkts1_wrs = 0;
+ txq->txpkts0_pkts = 0;
+ txq->txpkts1_pkts = 0;
+ mp_ring_reset_stats(txq->r);
+ }
+ }
+ }
+ break;
+ }
+ case CHELSIO_T4_SCHED_CLASS:
+ rc = t4_set_sched_class(sc, (struct t4_sched_params *)data);
+ break;
+ case CHELSIO_T4_SCHED_QUEUE:
+ rc = t4_set_sched_queue(sc, (struct t4_sched_queue *)data);
+ break;
+ default:
+ rc = ENOTTY;
+ }
+
+ return (rc);
+}
+
+static device_method_t t4vf_methods[] = {
+ DEVMETHOD(device_probe, t4vf_probe),
+ DEVMETHOD(device_attach, t4vf_attach),
+ DEVMETHOD(device_detach, t4_detach_common),
+
+ DEVMETHOD_END
+};
+
+static driver_t t4vf_driver = {
+ "t4vf",
+ t4vf_methods,
+ sizeof(struct adapter)
+};
+
+static device_method_t t5vf_methods[] = {
+ DEVMETHOD(device_probe, t5vf_probe),
+ DEVMETHOD(device_attach, t4vf_attach),
+ DEVMETHOD(device_detach, t4_detach_common),
+
+ DEVMETHOD_END
+};
+
+static driver_t t5vf_driver = {
+ "t5vf",
+ t5vf_methods,
+ sizeof(struct adapter)
+};
+
+static driver_t cxgbev_driver = {
+ "cxgbev",
+ cxgbe_methods,
+ sizeof(struct port_info)
+};
+
+static driver_t cxlv_driver = {
+ "cxlv",
+ cxgbe_methods,
+ sizeof(struct port_info)
+};
+
+static devclass_t t4vf_devclass, t5vf_devclass;
+static devclass_t cxgbev_devclass, cxlv_devclass;
+
+DRIVER_MODULE(t4vf, pci, t4vf_driver, t4vf_devclass, 0, 0);
+MODULE_VERSION(t4vf, 1);
+MODULE_DEPEND(t4vf, t4nex, 1, 1, 1);
+
+DRIVER_MODULE(t5vf, pci, t5vf_driver, t5vf_devclass, 0, 0);
+MODULE_VERSION(t5vf, 1);
+MODULE_DEPEND(t5vf, t5nex, 1, 1, 1);
+
+DRIVER_MODULE(cxgbev, t4vf, cxgbev_driver, cxgbev_devclass, 0, 0);
+MODULE_VERSION(cxgbev, 1);
+
+DRIVER_MODULE(cxlv, t5vf, cxlv_driver, cxlv_devclass, 0, 0);
+MODULE_VERSION(cxlv, 1);
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index f7ef499..c7e0661 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -32,15 +32,18 @@ __FBSDID("$FreeBSD$");
#ifdef TCP_OFFLOAD
#include <sys/param.h>
-#include <sys/types.h>
+#include <sys/aio.h>
+#include <sys/file.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/module.h>
+#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/domain.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sglist.h>
+#include <sys/taskqueue.h>
#include <netinet/in.h>
#include <netinet/in_pcb.h>
#include <netinet/ip.h>
@@ -51,6 +54,14 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_var.h>
#include <netinet/toecore.h>
+#include <security/mac/mac_framework.h>
+
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <vm/pmap.h>
+#include <vm/vm_map.h>
+#include <vm/vm_page.h>
+
#include "common/common.h"
#include "common/t4_msg.h"
#include "common/t4_regs.h"
@@ -71,6 +82,34 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc);
VNET_DECLARE(int, tcp_autorcvbuf_max);
#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max)
+#define IS_AIOTX_MBUF(m) \
+ ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX)
+
+static void t4_aiotx_cancel(struct kaiocb *job);
+static void t4_aiotx_queue_toep(struct toepcb *toep);
+
+static size_t
+aiotx_mbuf_pgoff(struct mbuf *m)
+{
+ struct aiotx_buffer *ab;
+
+ MPASS(IS_AIOTX_MBUF(m));
+ ab = m->m_ext.ext_arg1;
+ return ((ab->ps.offset + (uintptr_t)m->m_ext.ext_arg2) % PAGE_SIZE);
+}
+
+static vm_page_t *
+aiotx_mbuf_pages(struct mbuf *m)
+{
+ struct aiotx_buffer *ab;
+ int npages;
+
+ MPASS(IS_AIOTX_MBUF(m));
+ ab = m->m_ext.ext_arg1;
+ npages = (ab->ps.offset + (uintptr_t)m->m_ext.ext_arg2) / PAGE_SIZE;
+ return (ab->ps.pages + npages);
+}
+
void
send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp)
{
@@ -519,7 +558,11 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbuf *stop, int nsegs, int n)
i = -1;
for (m = start; m != stop; m = m->m_next) {
- rc = sglist_append(&sg, mtod(m, void *), m->m_len);
+ if (IS_AIOTX_MBUF(m))
+ rc = sglist_append_vmpages(&sg, aiotx_mbuf_pages(m),
+ aiotx_mbuf_pgoff(m), m->m_len);
+ else
+ rc = sglist_append(&sg, mtod(m, void *), m->m_len);
if (__predict_false(rc != 0))
panic("%s: sglist_append %d", __func__, rc);
@@ -579,6 +622,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
struct sockbuf *sb = &so->so_snd;
int tx_credits, shove, compl, sowwakeup;
struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx];
+ bool aiotx_mbuf_seen;
INP_WLOCK_ASSERT(inp);
KASSERT(toep->flags & TPF_FLOWC_WR_SENT,
@@ -589,6 +633,10 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
toep->ulp_mode == ULP_MODE_RDMA,
("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep));
+#ifdef VERBOSE_TRACES
+ CTR4(KTR_CXGBE, "%s: tid %d toep flags %#x tp flags %#x drop %d",
+ __func__, toep->tid, toep->flags, tp->t_flags);
+#endif
if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN))
return;
@@ -618,8 +666,15 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
plen = 0;
nsegs = 0;
max_nsegs_1mbuf = 0; /* max # of SGL segments in any one mbuf */
+ aiotx_mbuf_seen = false;
for (m = sndptr; m != NULL; m = m->m_next) {
- int n = sglist_count(mtod(m, void *), m->m_len);
+ int n;
+
+ if (IS_AIOTX_MBUF(m))
+ n = sglist_count_vmpages(aiotx_mbuf_pages(m),
+ aiotx_mbuf_pgoff(m), m->m_len);
+ else
+ n = sglist_count(mtod(m, void *), m->m_len);
nsegs += n;
plen += m->m_len;
@@ -631,9 +686,13 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
if (plen == 0) {
/* Too few credits */
toep->flags |= TPF_TX_SUSPENDED;
- if (sowwakeup)
+ if (sowwakeup) {
+ if (!TAILQ_EMPTY(
+ &toep->aiotx_jobq))
+ t4_aiotx_queue_toep(
+ toep);
sowwakeup_locked(so);
- else
+ } else
SOCKBUF_UNLOCK(sb);
SOCKBUF_UNLOCK_ASSERT(sb);
return;
@@ -641,6 +700,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
break;
}
+ if (IS_AIOTX_MBUF(m))
+ aiotx_mbuf_seen = true;
if (max_nsegs_1mbuf < n)
max_nsegs_1mbuf = n;
sb_sndptr = m; /* new sb->sb_sndptr if all goes well */
@@ -670,9 +731,11 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
else
sowwakeup = 1; /* room available */
}
- if (sowwakeup)
+ if (sowwakeup) {
+ if (!TAILQ_EMPTY(&toep->aiotx_jobq))
+ t4_aiotx_queue_toep(toep);
sowwakeup_locked(so);
- else
+ } else
SOCKBUF_UNLOCK(sb);
SOCKBUF_UNLOCK_ASSERT(sb);
@@ -687,7 +750,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop)
panic("%s: excess tx.", __func__);
shove = m == NULL && !(tp->t_flags & TF_MORETOCOME);
- if (plen <= max_imm) {
+ if (plen <= max_imm && !aiotx_mbuf_seen) {
/* Immediate data tx */
@@ -1616,6 +1679,9 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
}
}
+#ifdef VERBOSE_TRACES
+ CTR3(KTR_CXGBE, "%s: tid %d credits %u", __func__, tid, credits);
+#endif
so = inp->inp_socket;
txsd = &toep->txsd[toep->txsd_cidx];
plen = 0;
@@ -1642,6 +1708,10 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
if (toep->flags & TPF_TX_SUSPENDED &&
toep->tx_credits >= toep->tx_total / 4) {
+#ifdef VERBOSE_TRACES
+ CTR2(KTR_CXGBE, "%s: tid %d calling t4_push_frames", __func__,
+ tid);
+#endif
toep->flags &= ~TPF_TX_SUSPENDED;
if (toep->ulp_mode == ULP_MODE_ISCSI)
t4_push_pdus(sc, toep, plen);
@@ -1668,7 +1738,13 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
sowwakeup_locked(so); /* unlocks so_snd */
rqdrop_locked(&toep->ulp_pdu_reclaimq, plen);
} else {
+#ifdef VERBOSE_TRACES
+ CTR3(KTR_CXGBE, "%s: tid %d dropped %d bytes", __func__,
+ tid, plen);
+#endif
sbdrop_locked(sb, plen);
+ if (!TAILQ_EMPTY(&toep->aiotx_jobq))
+ t4_aiotx_queue_toep(toep);
sowwakeup_locked(so); /* unlocks so_snd */
}
SOCKBUF_UNLOCK_ASSERT(sb);
@@ -1768,4 +1844,397 @@ t4_uninit_cpl_io_handlers(void)
t4_register_cpl_handler(CPL_RX_DATA, do_rx_data);
t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack);
}
+
+/*
+ * Use the 'backend3' field in AIO jobs to store the amount of data
+ * sent by the AIO job so far and the 'backend4' field to hold an
+ * error that should be reported when the job is completed.
+ */
+#define aio_sent backend3
+#define aio_error backend4
+
+#define jobtotid(job) \
+ (((struct toepcb *)(so_sototcpcb((job)->fd_file->f_data)->t_toe))->tid)
+
+static void
+free_aiotx_buffer(struct aiotx_buffer *ab)
+{
+ struct kaiocb *job;
+ long status;
+ int error;
+
+ if (refcount_release(&ab->refcount) == 0)
+ return;
+
+ job = ab->job;
+ error = job->aio_error;
+ status = job->aio_sent;
+ vm_page_unhold_pages(ab->ps.pages, ab->ps.npages);
+ free(ab, M_CXGBE);
+#ifdef VERBOSE_TRACES
+ CTR5(KTR_CXGBE, "%s: tid %d completed %p len %ld, error %d", __func__,
+ jobtotid(job), job, status, error);
+#endif
+ if (error == ECANCELED && status != 0)
+ error = 0;
+ if (error == ECANCELED)
+ aio_cancel(job);
+ else if (error)
+ aio_complete(job, -1, error);
+ else
+ aio_complete(job, status, 0);
+}
+
+static void
+t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg)
+{
+ struct aiotx_buffer *ab = buffer;
+
+#ifdef VERBOSE_TRACES
+ CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__,
+ m->m_len, jobtotid(ab->job));
+#endif
+ free_aiotx_buffer(ab);
+}
+
+/*
+ * Hold the buffer backing an AIO request and return an AIO transmit
+ * buffer.
+ */
+static int
+hold_aio(struct kaiocb *job)
+{
+ struct aiotx_buffer *ab;
+ struct vmspace *vm;
+ vm_map_t map;
+ vm_offset_t start, end, pgoff;
+ int n;
+
+ MPASS(job->backend1 == NULL);
+
+ /*
+ * The AIO subsystem will cancel and drain all requests before
+ * permitting a process to exit or exec, so p_vmspace should
+ * be stable here.
+ */
+ vm = job->userproc->p_vmspace;
+ map = &vm->vm_map;
+ start = (uintptr_t)job->uaiocb.aio_buf;
+ pgoff = start & PAGE_MASK;
+ end = round_page(start + job->uaiocb.aio_nbytes);
+ start = trunc_page(start);
+ n = atop(end - start);
+
+ ab = malloc(sizeof(*ab) + n * sizeof(vm_page_t), M_CXGBE, M_WAITOK |
+ M_ZERO);
+ refcount_init(&ab->refcount, 1);
+ ab->ps.pages = (vm_page_t *)(ab + 1);
+ ab->ps.npages = vm_fault_quick_hold_pages(map, start, end - start,
+ VM_PROT_WRITE, ab->ps.pages, n);
+ if (ab->ps.npages < 0) {
+ free(ab, M_CXGBE);
+ return (EFAULT);
+ }
+
+ KASSERT(ab->ps.npages == n,
+ ("hold_aio: page count mismatch: %d vs %d", ab->ps.npages, n));
+
+ ab->ps.offset = pgoff;
+ ab->ps.len = job->uaiocb.aio_nbytes;
+ ab->job = job;
+ job->backend1 = ab;
+#ifdef VERBOSE_TRACES
+ CTR5(KTR_CXGBE, "%s: tid %d, new pageset %p for job %p, npages %d",
+ __func__, jobtotid(job), &ab->ps, job, ab->ps.npages);
+#endif
+ return (0);
+}
+
+static void
+t4_aiotx_process_job(struct toepcb *toep, struct socket *so, struct kaiocb *job)
+{
+ struct adapter *sc;
+ struct sockbuf *sb;
+ struct file *fp;
+ struct aiotx_buffer *ab;
+ struct inpcb *inp;
+ struct tcpcb *tp;
+ struct mbuf *m;
+ int error;
+ bool moretocome, sendmore;
+
+ sc = td_adapter(toep->td);
+ sb = &so->so_snd;
+ SOCKBUF_UNLOCK(sb);
+ fp = job->fd_file;
+ ab = job->backend1;
+ m = NULL;
+
+#ifdef MAC
+ error = mac_socket_check_send(fp->f_cred, so);
+ if (error != 0)
+ goto out;
+#endif
+
+ if (ab == NULL) {
+ error = hold_aio(job);
+ if (error != 0)
+ goto out;
+ ab = job->backend1;
+ }
+
+ /* Inline sosend_generic(). */
+
+ job->msgsnd = 1;
+
+ error = sblock(sb, SBL_WAIT);
+ MPASS(error == 0);
+
+sendanother:
+ m = m_get(M_WAITOK, MT_DATA);
+
+ SOCKBUF_LOCK(sb);
+ if (so->so_snd.sb_state & SBS_CANTSENDMORE) {
+ SOCKBUF_UNLOCK(sb);
+ sbunlock(sb);
+ if ((so->so_options & SO_NOSIGPIPE) == 0) {
+ PROC_LOCK(job->userproc);
+ kern_psignal(job->userproc, SIGPIPE);
+ PROC_UNLOCK(job->userproc);
+ }
+ error = EPIPE;
+ goto out;
+ }
+ if (so->so_error) {
+ error = so->so_error;
+ so->so_error = 0;
+ SOCKBUF_UNLOCK(sb);
+ sbunlock(sb);
+ goto out;
+ }
+ if ((so->so_state & SS_ISCONNECTED) == 0) {
+ SOCKBUF_UNLOCK(sb);
+ sbunlock(sb);
+ error = ENOTCONN;
+ goto out;
+ }
+ if (sbspace(sb) < sb->sb_lowat) {
+ MPASS(job->aio_sent == 0 || !(so->so_state & SS_NBIO));
+
+ /*
+ * Don't block if there is too little room in the socket
+ * buffer. Instead, requeue the request.
+ */
+ if (!aio_set_cancel_function(job, t4_aiotx_cancel)) {
+ SOCKBUF_UNLOCK(sb);
+ sbunlock(sb);
+ error = ECANCELED;
+ goto out;
+ }
+ TAILQ_INSERT_HEAD(&toep->aiotx_jobq, job, list);
+ SOCKBUF_UNLOCK(sb);
+ sbunlock(sb);
+ goto out;
+ }
+
+ /*
+ * Write as much data as the socket permits, but no more than a
+ * a single sndbuf at a time.
+ */
+ m->m_len = sbspace(sb);
+ if (m->m_len > ab->ps.len - job->aio_sent) {
+ m->m_len = ab->ps.len - job->aio_sent;
+ moretocome = false;
+ } else
+ moretocome = true;
+ if (m->m_len > sc->tt.sndbuf) {
+ m->m_len = sc->tt.sndbuf;
+ sendmore = true;
+ } else
+ sendmore = false;
+
+ if (!TAILQ_EMPTY(&toep->aiotx_jobq))
+ moretocome = true;
+ SOCKBUF_UNLOCK(sb);
+ MPASS(m->m_len != 0);
+
+ /* Inlined tcp_usr_send(). */
+
+ inp = toep->inp;
+ INP_WLOCK(inp);
+ if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
+ INP_WUNLOCK(inp);
+ sbunlock(sb);
+ error = ECONNRESET;
+ goto out;
+ }
+
+ refcount_acquire(&ab->refcount);
+ m_extadd(m, NULL, ab->ps.len, t4_aiotx_mbuf_free, ab,
+ (void *)(uintptr_t)job->aio_sent, 0, EXT_NET_DRV);
+ m->m_ext.ext_flags |= EXT_FLAG_AIOTX;
+ job->aio_sent += m->m_len;
+
+ sbappendstream(sb, m, 0);
+ m = NULL;
+
+ if (!(inp->inp_flags & INP_DROPPED)) {
+ tp = intotcpcb(inp);
+ if (moretocome)
+ tp->t_flags |= TF_MORETOCOME;
+ error = tp->t_fb->tfb_tcp_output(tp);
+ if (moretocome)
+ tp->t_flags &= ~TF_MORETOCOME;
+ }
+
+ INP_WUNLOCK(inp);
+ if (sendmore)
+ goto sendanother;
+ sbunlock(sb);
+
+ if (error)
+ goto out;
+
+ /*
+ * If this is a non-blocking socket and the request has not
+ * been fully completed, requeue it until the socket is ready
+ * again.
+ */
+ if (job->aio_sent < job->uaiocb.aio_nbytes &&
+ !(so->so_state & SS_NBIO)) {
+ SOCKBUF_LOCK(sb);
+ if (!aio_set_cancel_function(job, t4_aiotx_cancel)) {
+ SOCKBUF_UNLOCK(sb);
+ error = ECANCELED;
+ goto out;
+ }
+ TAILQ_INSERT_HEAD(&toep->aiotx_jobq, job, list);
+ return;
+ }
+
+ /*
+ * If the request will not be requeued, drop a reference on
+ * the the aiotx buffer. Any mbufs in flight should still
+ * contain a reference, but this drops the reference that the
+ * job owns while it is waiting to queue mbufs to the socket.
+ */
+ free_aiotx_buffer(ab);
+
+out:
+ if (error) {
+ if (ab != NULL) {
+ job->aio_error = error;
+ free_aiotx_buffer(ab);
+ } else {
+ MPASS(job->aio_sent == 0);
+ aio_complete(job, -1, error);
+ }
+ }
+ if (m != NULL)
+ m_free(m);
+ SOCKBUF_LOCK(sb);
+}
+
+static void
+t4_aiotx_task(void *context, int pending)
+{
+ struct toepcb *toep = context;
+ struct inpcb *inp = toep->inp;
+ struct socket *so = inp->inp_socket;
+ struct kaiocb *job;
+
+ CURVNET_SET(so->so_vnet);
+ SOCKBUF_LOCK(&so->so_snd);
+ while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) {
+ job = TAILQ_FIRST(&toep->aiotx_jobq);
+ TAILQ_REMOVE(&toep->aiotx_jobq, job, list);
+ if (!aio_clear_cancel_function(job))
+ continue;
+
+ t4_aiotx_process_job(toep, so, job);
+ }
+ toep->aiotx_task_active = false;
+ SOCKBUF_UNLOCK(&so->so_snd);
+ CURVNET_RESTORE();
+
+ free_toepcb(toep);
+}
+
+static void
+t4_aiotx_queue_toep(struct toepcb *toep)
+{
+
+ SOCKBUF_LOCK_ASSERT(&toep->inp->inp_socket->so_snd);
+#ifdef VERBOSE_TRACES
+ CTR3(KTR_CXGBE, "%s: queueing aiotx task for tid %d, active = %s",
+ __func__, toep->tid, toep->aiotx_task_active ? "true" : "false");
+#endif
+ if (toep->aiotx_task_active)
+ return;
+ toep->aiotx_task_active = true;
+ hold_toepcb(toep);
+ soaio_enqueue(&toep->aiotx_task);
+}
+
+static void
+t4_aiotx_cancel(struct kaiocb *job)
+{
+ struct aiotx_buffer *ab;
+ struct socket *so;
+ struct sockbuf *sb;
+ struct tcpcb *tp;
+ struct toepcb *toep;
+
+ so = job->fd_file->f_data;
+ tp = so_sototcpcb(so);
+ toep = tp->t_toe;
+ MPASS(job->uaiocb.aio_lio_opcode == LIO_WRITE);
+ sb = &so->so_snd;
+
+ SOCKBUF_LOCK(sb);
+ if (!aio_cancel_cleared(job))
+ TAILQ_REMOVE(&toep->aiotx_jobq, job, list);
+ SOCKBUF_UNLOCK(sb);
+
+ ab = job->backend1;
+ if (ab != NULL)
+ free_aiotx_buffer(ab);
+ else
+ aio_cancel(job);
+}
+
+int
+t4_aio_queue_aiotx(struct socket *so, struct kaiocb *job)
+{
+ struct tcpcb *tp = so_sototcpcb(so);
+ struct toepcb *toep = tp->t_toe;
+ struct adapter *sc = td_adapter(toep->td);
+
+ /* This only handles writes. */
+ if (job->uaiocb.aio_lio_opcode != LIO_WRITE)
+ return (EOPNOTSUPP);
+
+ if (!sc->tt.tx_zcopy)
+ return (EOPNOTSUPP);
+
+ SOCKBUF_LOCK(&so->so_snd);
+#ifdef VERBOSE_TRACES
+ CTR2(KTR_CXGBE, "%s: queueing %p", __func__, job);
+#endif
+ if (!aio_set_cancel_function(job, t4_aiotx_cancel))
+ panic("new job was cancelled");
+ TAILQ_INSERT_TAIL(&toep->aiotx_jobq, job, list);
+ if (sowriteable(so))
+ t4_aiotx_queue_toep(toep);
+ SOCKBUF_UNLOCK(&so->so_snd);
+ return (0);
+}
+
+void
+aiotx_init_toep(struct toepcb *toep)
+{
+
+ TAILQ_INIT(&toep->aiotx_jobq);
+ TASK_INIT(&toep->aiotx_task, 0, t4_aiotx_task, toep);
+}
#endif
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index 2a8082e..56006d0 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -68,11 +68,11 @@ __FBSDID("$FreeBSD$");
#include "tom/t4_tom_l2t.h"
#include "tom/t4_tom.h"
-static struct protosw ddp_protosw;
-static struct pr_usrreqs ddp_usrreqs;
+static struct protosw toe_protosw;
+static struct pr_usrreqs toe_usrreqs;
-static struct protosw ddp6_protosw;
-static struct pr_usrreqs ddp6_usrreqs;
+static struct protosw toe6_protosw;
+static struct pr_usrreqs toe6_usrreqs;
/* Module ops */
static int t4_tom_mod_load(void);
@@ -167,6 +167,7 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags)
toep->txsd_avail = txsd_total;
toep->txsd_pidx = 0;
toep->txsd_cidx = 0;
+ aiotx_init_toep(toep);
ddp_init_toep(toep);
return (toep);
@@ -217,12 +218,10 @@ offload_socket(struct socket *so, struct toepcb *toep)
sb = &so->so_rcv;
SOCKBUF_LOCK(sb);
sb->sb_flags |= SB_NOCOALESCE;
- if (toep->ulp_mode == ULP_MODE_TCPDDP) {
- if (inp->inp_vflag & INP_IPV6)
- so->so_proto = &ddp6_protosw;
- else
- so->so_proto = &ddp_protosw;
- }
+ if (inp->inp_vflag & INP_IPV6)
+ so->so_proto = &toe6_protosw;
+ else
+ so->so_proto = &toe_protosw;
SOCKBUF_UNLOCK(sb);
/* Update TCP PCB */
@@ -1120,6 +1119,22 @@ t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp)
}
static int
+t4_aio_queue_tom(struct socket *so, struct kaiocb *job)
+{
+ struct tcpcb *tp = so_sototcpcb(so);
+ struct toepcb *toep = tp->t_toe;
+ int error;
+
+ if (toep->ulp_mode == ULP_MODE_TCPDDP) {
+ error = t4_aio_queue_ddp(so, job);
+ if (error != EOPNOTSUPP)
+ return (error);
+ }
+
+ return (t4_aio_queue_aiotx(so, job));
+}
+
+static int
t4_tom_mod_load(void)
{
int rc;
@@ -1137,18 +1152,18 @@ t4_tom_mod_load(void)
tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM);
if (tcp_protosw == NULL)
return (ENOPROTOOPT);
- bcopy(tcp_protosw, &ddp_protosw, sizeof(ddp_protosw));
- bcopy(tcp_protosw->pr_usrreqs, &ddp_usrreqs, sizeof(ddp_usrreqs));
- ddp_usrreqs.pru_aio_queue = t4_aio_queue_ddp;
- ddp_protosw.pr_usrreqs = &ddp_usrreqs;
+ bcopy(tcp_protosw, &toe_protosw, sizeof(toe_protosw));
+ bcopy(tcp_protosw->pr_usrreqs, &toe_usrreqs, sizeof(toe_usrreqs));
+ toe_usrreqs.pru_aio_queue = t4_aio_queue_tom;
+ toe_protosw.pr_usrreqs = &toe_usrreqs;
tcp6_protosw = pffindproto(PF_INET6, IPPROTO_TCP, SOCK_STREAM);
if (tcp6_protosw == NULL)
return (ENOPROTOOPT);
- bcopy(tcp6_protosw, &ddp6_protosw, sizeof(ddp6_protosw));
- bcopy(tcp6_protosw->pr_usrreqs, &ddp6_usrreqs, sizeof(ddp6_usrreqs));
- ddp6_usrreqs.pru_aio_queue = t4_aio_queue_ddp;
- ddp6_protosw.pr_usrreqs = &ddp6_usrreqs;
+ bcopy(tcp6_protosw, &toe6_protosw, sizeof(toe6_protosw));
+ bcopy(tcp6_protosw->pr_usrreqs, &toe6_usrreqs, sizeof(toe6_usrreqs));
+ toe6_usrreqs.pru_aio_queue = t4_aio_queue_tom;
+ toe6_protosw.pr_usrreqs = &toe6_usrreqs;
TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL);
ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event,
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
index f114a3d..bab9ef6 100644
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -102,6 +102,8 @@ TAILQ_HEAD(pagesetq, pageset);
#define PS_WIRED 0x0001 /* Pages wired rather than held. */
#define PS_PPODS_WRITTEN 0x0002 /* Page pods written to the card. */
+#define EXT_FLAG_AIOTX EXT_FLAG_VENDOR1
+
struct ddp_buffer {
struct pageset *ps;
@@ -109,6 +111,12 @@ struct ddp_buffer {
int cancel_pending;
};
+struct aiotx_buffer {
+ struct pageset ps;
+ struct kaiocb *job;
+ int refcount;
+};
+
struct toepcb {
TAILQ_ENTRY(toepcb) link; /* toep_list */
u_int flags; /* miscellaneous flags */
@@ -151,6 +159,10 @@ struct toepcb {
struct kaiocb *ddp_queueing;
struct mtx ddp_lock;
+ TAILQ_HEAD(, kaiocb) aiotx_jobq;
+ struct task aiotx_task;
+ bool aiotx_task_active;
+
/* Tx software descriptor */
uint8_t txsd_total;
uint8_t txsd_pidx;
@@ -313,6 +325,8 @@ int do_abort_rpl_synqe(struct sge_iq *, const struct rss_header *,
void t4_offload_socket(struct toedev *, void *, struct socket *);
/* t4_cpl_io.c */
+void aiotx_init_toep(struct toepcb *);
+int t4_aio_queue_aiotx(struct socket *, struct kaiocb *);
void t4_init_cpl_io_handlers(void);
void t4_uninit_cpl_io_handlers(void);
void send_abort_rpl(struct adapter *, struct sge_wrq *, int , int);
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 784dd00..fa807a6 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -195,7 +195,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(pci_alloc_devinfo, pci_alloc_devinfo_method),
DEVMETHOD(pci_child_added, pci_child_added_method),
#ifdef PCI_IOV
- DEVMETHOD(pci_iov_attach, pci_iov_attach_method),
+ DEVMETHOD(pci_iov_attach_name, pci_iov_attach_method),
DEVMETHOD(pci_iov_detach, pci_iov_detach_method),
DEVMETHOD(pci_create_iov_child, pci_create_iov_child_method),
#endif
@@ -3970,7 +3970,7 @@ pci_rescan_method(device_t dev)
if (hdrtype & PCIM_MFDEV)
pcifunchigh = PCIB_MAXFUNCS(pcib);
for (f = 0; f <= pcifunchigh; f++) {
- if (REG(PCIR_VENDOR, 2) == 0xfff)
+ if (REG(PCIR_VENDOR, 2) == 0xffff)
continue;
/*
@@ -4070,6 +4070,7 @@ pci_add_child(device_t bus, struct pci_devinfo *dinfo)
pci_print_verbose(dinfo);
pci_add_resources(bus, dinfo->cfg.dev, 0, 0);
pci_child_added(dinfo->cfg.dev);
+ EVENTHANDLER_INVOKE(pci_add_device, dinfo->cfg.dev);
}
void
@@ -5311,6 +5312,8 @@ pci_child_deleted(device_t dev, device_t child)
dinfo = device_get_ivars(child);
rl = &dinfo->resources;
+ EVENTHANDLER_INVOKE(pci_delete_device, child);
+
/* Turn off access to resources we're about to free */
if (bus_child_present(child) != 0) {
pci_write_config(child, PCIR_COMMAND, pci_read_config(child,
@@ -5888,3 +5891,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);
+}
diff --git a/sys/dev/pci/pci_if.m b/sys/dev/pci/pci_if.m
index 5f8415f..027e618 100644
--- a/sys/dev/pci/pci_if.m
+++ b/sys/dev/pci/pci_if.m
@@ -51,6 +51,14 @@ CODE {
device_printf(bus, "PCI_IOV not implemented on this bus.\n");
return (NULL);
}
+
+ static int
+ compat_iov_attach(device_t bus, device_t dev, struct nvlist *pf_schema,
+ struct nvlist *vf_schema)
+ {
+ return (PCI_IOV_ATTACH_NAME(bus, dev, pf_schema, vf_schema,
+ device_get_nameunit(dev)));
+ }
};
HEADER {
@@ -235,6 +243,14 @@ METHOD int iov_attach {
device_t child;
struct nvlist *pf_schema;
struct nvlist *vf_schema;
+} DEFAULT compat_iov_attach;
+
+METHOD int iov_attach_name {
+ device_t dev;
+ device_t child;
+ struct nvlist *pf_schema;
+ struct nvlist *vf_schema;
+ const char *name;
};
METHOD int iov_detach {
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
index bba99f6..19e51df 100644
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -98,8 +98,22 @@ static nvlist_t *pci_iov_get_pf_subsystem_schema(void);
static nvlist_t *pci_iov_get_vf_subsystem_schema(void);
int
+pci_iov_attach_name(device_t dev, struct nvlist *pf_schema,
+ struct nvlist *vf_schema, const char *fmt, ...)
+{
+ char buf[NAME_MAX + 1];
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return (PCI_IOV_ATTACH_NAME(device_get_parent(dev), dev, pf_schema,
+ vf_schema, buf));
+}
+
+int
pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema,
- nvlist_t *vf_schema)
+ nvlist_t *vf_schema, const char *name)
{
device_t pcib;
struct pci_devinfo *dinfo;
@@ -149,7 +163,7 @@ pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema,
iov->iov_schema = schema;
iov->iov_cdev = make_dev(&iov_cdevsw, device_get_unit(dev),
- UID_ROOT, GID_WHEEL, 0600, "iov/%s", device_get_nameunit(dev));
+ UID_ROOT, GID_WHEEL, 0600, "iov/%s", name);
if (iov->iov_cdev == NULL) {
error = ENOMEM;
diff --git a/sys/dev/pci/pci_iov.h b/sys/dev/pci/pci_iov.h
index fd2f8fb..09a182d 100644
--- a/sys/dev/pci/pci_iov.h
+++ b/sys/dev/pci/pci_iov.h
@@ -33,11 +33,14 @@
struct nvlist;
+int pci_iov_attach_name(device_t dev, struct nvlist *pf_schema,
+ struct nvlist *vf_schema, const char *fmt, ...) __printflike(4, 5);
+
static __inline int
pci_iov_attach(device_t dev, struct nvlist *pf_schema, struct nvlist *vf_schema)
{
- return (PCI_IOV_ATTACH(device_get_parent(dev), dev, pf_schema,
- vf_schema));
+ return (PCI_IOV_ATTACH_NAME(device_get_parent(dev), dev, pf_schema,
+ vf_schema, device_get_nameunit(dev)));
}
static __inline int
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
index a9958ca..b0f1481 100644
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -158,7 +158,8 @@ struct resource *pci_alloc_multi_resource(device_t dev, device_t child,
rman_res_t count, u_long num, u_int flags);
int pci_iov_attach_method(device_t bus, device_t dev,
- struct nvlist *pf_schema, struct nvlist *vf_schema);
+ struct nvlist *pf_schema, struct nvlist *vf_schema,
+ const char *name);
int pci_iov_detach_method(device_t bus, device_t dev);
device_t pci_create_iov_child_method(device_t bus, device_t pf,
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
index f5a921a..dba76d1 100644
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -708,10 +708,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
* 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, caddr_t data, int flag, struct thread *t
} 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++;
}
}
diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h
index d463b7a..291bb2e 100644
--- a/sys/dev/pci/pcireg.h
+++ b/sys/dev/pci/pcireg.h
@@ -885,10 +885,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
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 3180b4e..b5f00a0 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -31,6 +31,7 @@
#define _PCIVAR_H_
#include <sys/queue.h>
+#include <sys/eventhandler.h>
/* some PCI bus constants */
#define PCI_MAXMAPS_0 6 /* max. no. of memory/port maps */
@@ -594,7 +595,9 @@ uint32_t pcie_read_config(device_t dev, int reg, int width);
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)
@@ -631,4 +634,12 @@ void * vga_pci_map_bios(device_t dev, size_t *size);
void vga_pci_unmap_bios(device_t dev, void *bios);
int vga_pci_repost(device_t dev);
+/**
+ * Global eventhandlers invoked when PCI devices are added or removed
+ * from the system.
+ */
+typedef void (*pci_event_fn)(void *arg, device_t dev);
+EVENTHANDLER_DECLARE(pci_add_device, pci_event_fn);
+EVENTHANDLER_DECLARE(pci_delete_device, pci_event_fn);
+
#endif /* _PCIVAR_H_ */
diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c
index 9988347..a8ae9f2 100644
--- a/sys/dev/usb/serial/u3g.c
+++ b/sys/dev/usb/serial/u3g.c
@@ -312,6 +312,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),
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 5cd9174..8b10652f 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -2420,6 +2420,7 @@ product HUAWEI E3272_INIT 0x155b LTE modem initial
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
diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c
index c08b4af..4ee9dec 100644
--- a/sys/dev/usb/wlan/if_rsu.c
+++ b/sys/dev/usb/wlan/if_rsu.c
@@ -1270,9 +1270,12 @@ rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
default:
break;
}
- sc->sc_calibrating = 1;
- /* Start periodic calibration. */
- taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz);
+ if (startcal != 0) {
+ sc->sc_calibrating = 1;
+ /* Start periodic calibration. */
+ taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task,
+ hz);
+ }
RSU_UNLOCK(sc);
IEEE80211_LOCK(ic);
return (uvp->newstate(vap, nstate, arg));
diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c
index 6035f8d..33d36c5 100644
--- a/sys/fs/cuse/cuse.c
+++ b/sys/fs/cuse/cuse.c
@@ -63,6 +63,12 @@
MODULE_VERSION(cuse, 1);
+/*
+ * Prevent cuse4bsd.ko and cuse.ko from loading at the same time by
+ * declaring support for the cuse4bsd interface in cuse.ko:
+ */
+MODULE_VERSION(cuse4bsd, 1);
+
#define NBUSY ((uint8_t *)1)
#ifdef FEATURE
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 1a50ec8..ad77f5e 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -89,7 +89,7 @@ uint32_t nfscl_nfs4_done_probes[NFSV41_NPROCS + 1];
NFSSTATESPINLOCK;
NFSREQSPINLOCK;
NFSDLOCKMUTEX;
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsreqhead nfsd_reqq;
extern int nfscl_ticks;
extern void (*ncl_call_invalcaches)(struct vnode *);
@@ -642,7 +642,7 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
procnum = NFSV4PROC_COMPOUND;
if (nmp != NULL) {
- NFSINCRGLOBAL(newnfsstats.rpcrequests);
+ NFSINCRGLOBAL(nfsstatsv1.rpcrequests);
/* Map the procnum to the old NFSv2 one, as required. */
if ((nd->nd_flag & ND_NFSV2) != 0) {
@@ -762,18 +762,18 @@ tryagain:
if (stat == RPC_SUCCESS) {
error = 0;
} else if (stat == RPC_TIMEDOUT) {
- NFSINCRGLOBAL(newnfsstats.rpctimeouts);
+ NFSINCRGLOBAL(nfsstatsv1.rpctimeouts);
error = ETIMEDOUT;
} else if (stat == RPC_VERSMISMATCH) {
- NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+ NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EOPNOTSUPP;
} else if (stat == RPC_PROGVERSMISMATCH) {
- NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+ NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EPROTONOSUPPORT;
} else if (stat == RPC_INTR) {
error = EINTR;
} else {
- NFSINCRGLOBAL(newnfsstats.rpcinvalid);
+ NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
error = EACCES;
}
if (error) {
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c
index a22073f..23a861d 100644
--- a/sys/fs/nfs/nfs_commonport.c
+++ b/sys/fs/nfs/nfs_commonport.c
@@ -58,7 +58,7 @@ extern void (*nfsd_call_recall)(struct vnode *, int, struct ucred *,
extern int nfsrv_useacl;
struct mount nfsv4root_mnt;
int newnfs_numnfsd = 0;
-struct nfsstats newnfsstats;
+struct nfsstatsv1 nfsstatsv1;
int nfs_numnfscbd = 0;
int nfscl_debuglevel = 0;
char nfsv4_callbackaddr[INET6_ADDRSTRLEN];
@@ -69,6 +69,7 @@ void (*ncl_call_invalcaches)(struct vnode *) = NULL;
static int nfs_realign_test;
static int nfs_realign_count;
+static struct ext_nfsstats oldnfsstats;
SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem");
SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test,
@@ -446,9 +447,12 @@ nfssvc_nfscommon(struct thread *td, struct nfssvc_args *uap)
static int
nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
{
- int error = EINVAL;
+ int error = EINVAL, i, j;
struct nfsd_idargs nid;
struct nfsd_oidargs onid;
+ struct {
+ int vers; /* Just the first field of nfsstats. */
+ } nfsstatver;
if (uap->flag & NFSSVC_IDNAME) {
if ((uap->flag & NFSSVC_NEWSTRUCT) != 0)
@@ -472,63 +476,157 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
error = nfssvc_idname(&nid);
goto out;
} else if (uap->flag & NFSSVC_GETSTATS) {
- error = copyout(&newnfsstats,
- CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats));
+ if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) {
+ /* Copy fields to the old ext_nfsstat structure. */
+ oldnfsstats.attrcache_hits =
+ nfsstatsv1.attrcache_hits;
+ oldnfsstats.attrcache_misses =
+ nfsstatsv1.attrcache_misses;
+ oldnfsstats.lookupcache_hits =
+ nfsstatsv1.lookupcache_hits;
+ oldnfsstats.lookupcache_misses =
+ nfsstatsv1.lookupcache_misses;
+ oldnfsstats.direofcache_hits =
+ nfsstatsv1.direofcache_hits;
+ oldnfsstats.direofcache_misses =
+ nfsstatsv1.direofcache_misses;
+ oldnfsstats.accesscache_hits =
+ nfsstatsv1.accesscache_hits;
+ oldnfsstats.accesscache_misses =
+ nfsstatsv1.accesscache_misses;
+ oldnfsstats.biocache_reads =
+ nfsstatsv1.biocache_reads;
+ oldnfsstats.read_bios =
+ nfsstatsv1.read_bios;
+ oldnfsstats.read_physios =
+ nfsstatsv1.read_physios;
+ oldnfsstats.biocache_writes =
+ nfsstatsv1.biocache_writes;
+ oldnfsstats.write_bios =
+ nfsstatsv1.write_bios;
+ oldnfsstats.write_physios =
+ nfsstatsv1.write_physios;
+ oldnfsstats.biocache_readlinks =
+ nfsstatsv1.biocache_readlinks;
+ oldnfsstats.readlink_bios =
+ nfsstatsv1.readlink_bios;
+ oldnfsstats.biocache_readdirs =
+ nfsstatsv1.biocache_readdirs;
+ oldnfsstats.readdir_bios =
+ nfsstatsv1.readdir_bios;
+ for (i = 0; i < NFSV4_NPROCS; i++)
+ oldnfsstats.rpccnt[i] = nfsstatsv1.rpccnt[i];
+ oldnfsstats.rpcretries = nfsstatsv1.rpcretries;
+ for (i = 0; i < NFSV4OP_NOPS; i++)
+ oldnfsstats.srvrpccnt[i] =
+ nfsstatsv1.srvrpccnt[i];
+ for (i = NFSV42_NOPS, j = NFSV4OP_NOPS;
+ i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++)
+ oldnfsstats.srvrpccnt[j] =
+ nfsstatsv1.srvrpccnt[i];
+ oldnfsstats.srvrpc_errs = nfsstatsv1.srvrpc_errs;
+ oldnfsstats.srv_errs = nfsstatsv1.srv_errs;
+ oldnfsstats.rpcrequests = nfsstatsv1.rpcrequests;
+ oldnfsstats.rpctimeouts = nfsstatsv1.rpctimeouts;
+ oldnfsstats.rpcunexpected = nfsstatsv1.rpcunexpected;
+ oldnfsstats.rpcinvalid = nfsstatsv1.rpcinvalid;
+ oldnfsstats.srvcache_inproghits =
+ nfsstatsv1.srvcache_inproghits;
+ oldnfsstats.srvcache_idemdonehits =
+ nfsstatsv1.srvcache_idemdonehits;
+ oldnfsstats.srvcache_nonidemdonehits =
+ nfsstatsv1.srvcache_nonidemdonehits;
+ oldnfsstats.srvcache_misses =
+ nfsstatsv1.srvcache_misses;
+ oldnfsstats.srvcache_tcppeak =
+ nfsstatsv1.srvcache_tcppeak;
+ oldnfsstats.srvcache_size = nfsstatsv1.srvcache_size;
+ oldnfsstats.srvclients = nfsstatsv1.srvclients;
+ oldnfsstats.srvopenowners = nfsstatsv1.srvopenowners;
+ oldnfsstats.srvopens = nfsstatsv1.srvopens;
+ oldnfsstats.srvlockowners = nfsstatsv1.srvlockowners;
+ oldnfsstats.srvlocks = nfsstatsv1.srvlocks;
+ oldnfsstats.srvdelegates = nfsstatsv1.srvdelegates;
+ for (i = 0; i < NFSV4OP_CBNOPS; i++)
+ oldnfsstats.cbrpccnt[i] =
+ nfsstatsv1.cbrpccnt[i];
+ oldnfsstats.clopenowners = nfsstatsv1.clopenowners;
+ oldnfsstats.clopens = nfsstatsv1.clopens;
+ oldnfsstats.cllockowners = nfsstatsv1.cllockowners;
+ oldnfsstats.cllocks = nfsstatsv1.cllocks;
+ oldnfsstats.cldelegates = nfsstatsv1.cldelegates;
+ oldnfsstats.cllocalopenowners =
+ nfsstatsv1.cllocalopenowners;
+ oldnfsstats.cllocalopens = nfsstatsv1.cllocalopens;
+ oldnfsstats.cllocallockowners =
+ nfsstatsv1.cllocallockowners;
+ oldnfsstats.cllocallocks = nfsstatsv1.cllocallocks;
+ error = copyout(&oldnfsstats, uap->argp,
+ sizeof (oldnfsstats));
+ } else {
+ error = copyin(uap->argp, &nfsstatver,
+ sizeof(nfsstatver));
+ if (error == 0 && nfsstatver.vers != NFSSTATS_V1)
+ error = EPERM;
+ if (error == 0)
+ error = copyout(&nfsstatsv1, uap->argp,
+ sizeof (nfsstatsv1));
+ }
if (error == 0) {
if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) {
- newnfsstats.attrcache_hits = 0;
- newnfsstats.attrcache_misses = 0;
- newnfsstats.lookupcache_hits = 0;
- newnfsstats.lookupcache_misses = 0;
- newnfsstats.direofcache_hits = 0;
- newnfsstats.direofcache_misses = 0;
- newnfsstats.accesscache_hits = 0;
- newnfsstats.accesscache_misses = 0;
- newnfsstats.biocache_reads = 0;
- newnfsstats.read_bios = 0;
- newnfsstats.read_physios = 0;
- newnfsstats.biocache_writes = 0;
- newnfsstats.write_bios = 0;
- newnfsstats.write_physios = 0;
- newnfsstats.biocache_readlinks = 0;
- newnfsstats.readlink_bios = 0;
- newnfsstats.biocache_readdirs = 0;
- newnfsstats.readdir_bios = 0;
- newnfsstats.rpcretries = 0;
- newnfsstats.rpcrequests = 0;
- newnfsstats.rpctimeouts = 0;
- newnfsstats.rpcunexpected = 0;
- newnfsstats.rpcinvalid = 0;
- bzero(newnfsstats.rpccnt,
- sizeof(newnfsstats.rpccnt));
+ nfsstatsv1.attrcache_hits = 0;
+ nfsstatsv1.attrcache_misses = 0;
+ nfsstatsv1.lookupcache_hits = 0;
+ nfsstatsv1.lookupcache_misses = 0;
+ nfsstatsv1.direofcache_hits = 0;
+ nfsstatsv1.direofcache_misses = 0;
+ nfsstatsv1.accesscache_hits = 0;
+ nfsstatsv1.accesscache_misses = 0;
+ nfsstatsv1.biocache_reads = 0;
+ nfsstatsv1.read_bios = 0;
+ nfsstatsv1.read_physios = 0;
+ nfsstatsv1.biocache_writes = 0;
+ nfsstatsv1.write_bios = 0;
+ nfsstatsv1.write_physios = 0;
+ nfsstatsv1.biocache_readlinks = 0;
+ nfsstatsv1.readlink_bios = 0;
+ nfsstatsv1.biocache_readdirs = 0;
+ nfsstatsv1.readdir_bios = 0;
+ nfsstatsv1.rpcretries = 0;
+ nfsstatsv1.rpcrequests = 0;
+ nfsstatsv1.rpctimeouts = 0;
+ nfsstatsv1.rpcunexpected = 0;
+ nfsstatsv1.rpcinvalid = 0;
+ bzero(nfsstatsv1.rpccnt,
+ sizeof(nfsstatsv1.rpccnt));
}
if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) {
- newnfsstats.srvrpc_errs = 0;
- newnfsstats.srv_errs = 0;
- newnfsstats.srvcache_inproghits = 0;
- newnfsstats.srvcache_idemdonehits = 0;
- newnfsstats.srvcache_nonidemdonehits = 0;
- newnfsstats.srvcache_misses = 0;
- newnfsstats.srvcache_tcppeak = 0;
- newnfsstats.srvclients = 0;
- newnfsstats.srvopenowners = 0;
- newnfsstats.srvopens = 0;
- newnfsstats.srvlockowners = 0;
- newnfsstats.srvlocks = 0;
- newnfsstats.srvdelegates = 0;
- newnfsstats.clopenowners = 0;
- newnfsstats.clopens = 0;
- newnfsstats.cllockowners = 0;
- newnfsstats.cllocks = 0;
- newnfsstats.cldelegates = 0;
- newnfsstats.cllocalopenowners = 0;
- newnfsstats.cllocalopens = 0;
- newnfsstats.cllocallockowners = 0;
- newnfsstats.cllocallocks = 0;
- bzero(newnfsstats.srvrpccnt,
- sizeof(newnfsstats.srvrpccnt));
- bzero(newnfsstats.cbrpccnt,
- sizeof(newnfsstats.cbrpccnt));
+ nfsstatsv1.srvrpc_errs = 0;
+ nfsstatsv1.srv_errs = 0;
+ nfsstatsv1.srvcache_inproghits = 0;
+ nfsstatsv1.srvcache_idemdonehits = 0;
+ nfsstatsv1.srvcache_nonidemdonehits = 0;
+ nfsstatsv1.srvcache_misses = 0;
+ nfsstatsv1.srvcache_tcppeak = 0;
+ nfsstatsv1.srvclients = 0;
+ nfsstatsv1.srvopenowners = 0;
+ nfsstatsv1.srvopens = 0;
+ nfsstatsv1.srvlockowners = 0;
+ nfsstatsv1.srvlocks = 0;
+ nfsstatsv1.srvdelegates = 0;
+ nfsstatsv1.clopenowners = 0;
+ nfsstatsv1.clopens = 0;
+ nfsstatsv1.cllockowners = 0;
+ nfsstatsv1.cllocks = 0;
+ nfsstatsv1.cldelegates = 0;
+ nfsstatsv1.cllocalopenowners = 0;
+ nfsstatsv1.cllocalopens = 0;
+ nfsstatsv1.cllocallockowners = 0;
+ nfsstatsv1.cllocallocks = 0;
+ bzero(nfsstatsv1.srvrpccnt,
+ sizeof(nfsstatsv1.srvrpccnt));
+ bzero(nfsstatsv1.cbrpccnt,
+ sizeof(nfsstatsv1.cbrpccnt));
}
}
goto out;
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
index 6b41e2f..3bfbb1c 100644
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -55,6 +55,7 @@
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
+#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/protosw.h>
@@ -254,24 +255,26 @@
/*
* Must be one more than last op#.
+ * NFSv4.2 isn't implemented yet, but define the op# limit for it.
*/
#define NFSV41_NOPS 59
+#define NFSV42_NOPS 72
/* Quirky case if the illegal op code */
#define NFSV4OP_OPILLEGAL 10044
/*
- * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV4OP_NOPS.
+ * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV42_NOPS.
*/
-#define NFSV4OP_SYMLINK (NFSV4OP_NOPS)
-#define NFSV4OP_MKDIR (NFSV4OP_NOPS + 1)
-#define NFSV4OP_RMDIR (NFSV4OP_NOPS + 2)
-#define NFSV4OP_READDIRPLUS (NFSV4OP_NOPS + 3)
-#define NFSV4OP_MKNOD (NFSV4OP_NOPS + 4)
-#define NFSV4OP_FSSTAT (NFSV4OP_NOPS + 5)
-#define NFSV4OP_FSINFO (NFSV4OP_NOPS + 6)
-#define NFSV4OP_PATHCONF (NFSV4OP_NOPS + 7)
-#define NFSV4OP_V3CREATE (NFSV4OP_NOPS + 8)
+#define NFSV4OP_SYMLINK (NFSV42_NOPS)
+#define NFSV4OP_MKDIR (NFSV42_NOPS + 1)
+#define NFSV4OP_RMDIR (NFSV42_NOPS + 2)
+#define NFSV4OP_READDIRPLUS (NFSV42_NOPS + 3)
+#define NFSV4OP_MKNOD (NFSV42_NOPS + 4)
+#define NFSV4OP_FSSTAT (NFSV42_NOPS + 5)
+#define NFSV4OP_FSINFO (NFSV42_NOPS + 6)
+#define NFSV4OP_PATHCONF (NFSV42_NOPS + 7)
+#define NFSV4OP_V3CREATE (NFSV42_NOPS + 8)
/*
* This is the count of the fake operations listed above.
@@ -285,12 +288,12 @@
#define NFSV4OP_CBRECALL 4
/*
- * Must be one greater than the last Callback Operation#.
+ * Must be one greater than the last Callback Operation# for NFSv4.0.
*/
#define NFSV4OP_CBNOPS 5
/*
- * Additional Callback Ops for NFSv4.1 only. Not yet in nfsstats.
+ * Additional Callback Ops for NFSv4.1 only.
*/
#define NFSV4OP_CBLAYOUTRECALL 5
#define NFSV4OP_CBNOTIFY 6
@@ -303,6 +306,9 @@
#define NFSV4OP_CBNOTIFYLOCK 13
#define NFSV4OP_CBNOTIFYDEVID 14
+#define NFSV41_CBNOPS 15
+#define NFSV42_CBNOPS 16
+
/*
* The lower numbers -> 21 are used by NFSv2 and v3. These define higher
* numbers used by NFSv4.
@@ -360,7 +366,72 @@
#endif /* NFS_V3NPROCS */
/*
- * Stats structure
+ * New stats structure.
+ * The vers field will be set to NFSSTATS_V1 by the caller.
+ */
+#define NFSSTATS_V1 1
+struct nfsstatsv1 {
+ int vers; /* Set to version requested by caller. */
+ uint64_t attrcache_hits;
+ uint64_t attrcache_misses;
+ uint64_t lookupcache_hits;
+ uint64_t lookupcache_misses;
+ uint64_t direofcache_hits;
+ uint64_t direofcache_misses;
+ uint64_t accesscache_hits;
+ uint64_t accesscache_misses;
+ uint64_t biocache_reads;
+ uint64_t read_bios;
+ uint64_t read_physios;
+ uint64_t biocache_writes;
+ uint64_t write_bios;
+ uint64_t write_physios;
+ uint64_t biocache_readlinks;
+ uint64_t readlink_bios;
+ uint64_t biocache_readdirs;
+ uint64_t readdir_bios;
+ uint64_t rpccnt[NFSV41_NPROCS + 15];
+ uint64_t rpcretries;
+ uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS];
+ uint64_t srvrpc_errs;
+ uint64_t srv_errs;
+ uint64_t rpcrequests;
+ uint64_t rpctimeouts;
+ uint64_t rpcunexpected;
+ uint64_t rpcinvalid;
+ uint64_t srvcache_inproghits;
+ uint64_t srvcache_idemdonehits;
+ uint64_t srvcache_nonidemdonehits;
+ uint64_t srvcache_misses;
+ uint64_t srvcache_tcppeak;
+ int srvcache_size; /* Updated by atomic_xx_int(). */
+ uint64_t srvclients;
+ uint64_t srvopenowners;
+ uint64_t srvopens;
+ uint64_t srvlockowners;
+ uint64_t srvlocks;
+ uint64_t srvdelegates;
+ uint64_t cbrpccnt[NFSV42_CBNOPS];
+ uint64_t clopenowners;
+ uint64_t clopens;
+ uint64_t cllockowners;
+ uint64_t cllocks;
+ uint64_t cldelegates;
+ uint64_t cllocalopenowners;
+ uint64_t cllocalopens;
+ uint64_t cllocallockowners;
+ uint64_t cllocallocks;
+ uint64_t srvstartcnt;
+ uint64_t srvdonecnt;
+ uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS];
+ uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS];
+ struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS];
+ struct bintime busyfrom;
+ struct bintime busytime;
+};
+
+/*
+ * Old stats structure.
*/
struct ext_nfsstats {
int attrcache_hits;
@@ -416,11 +487,6 @@ struct ext_nfsstats {
#ifdef _KERNEL
/*
- * Define the ext_nfsstats as nfsstats for the kernel code.
- */
-#define nfsstats ext_nfsstats
-
-/*
* Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
*/
#ifndef NFS_NPROCS
diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h
index 08e7b24..daa49a0 100644
--- a/sys/fs/nfs/nfsproto.h
+++ b/sys/fs/nfs/nfsproto.h
@@ -345,10 +345,10 @@
/*
* NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure
- * or Operation#. Since the NFS V4 Op #s go higher, use NFSV41_NOPS, which
+ * or Operation#. Since the NFS V4 Op #s go higher, use NFSV42_NOPS, which
* is one greater than the highest Op#.
*/
-#define NFSPROC_NOOP NFSV41_NOPS
+#define NFSPROC_NOOP NFSV42_NOPS
/* Actual Version 2 procedure numbers */
#define NFSV2PROC_NULL 0
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index c804393..492a072 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
#include <fs/nfsclient/nfs_kdtrace.h>
extern int newnfs_directio_allow_mmap;
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct mtx ncl_iod_mutex;
extern int ncl_numasync;
extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
@@ -466,7 +466,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
switch (vp->v_type) {
case VREG:
- NFSINCRGLOBAL(newnfsstats.biocache_reads);
+ NFSINCRGLOBAL(nfsstatsv1.biocache_reads);
lbn = uio->uio_offset / biosize;
on = uio->uio_offset - (lbn * biosize);
@@ -543,7 +543,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
n = MIN((unsigned)(bcount - on), uio->uio_resid);
break;
case VLNK:
- NFSINCRGLOBAL(newnfsstats.biocache_readlinks);
+ NFSINCRGLOBAL(nfsstatsv1.biocache_readlinks);
bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td);
if (!bp) {
error = newnfs_sigintr(nmp, td);
@@ -563,7 +563,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
on = 0;
break;
case VDIR:
- NFSINCRGLOBAL(newnfsstats.biocache_readdirs);
+ NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs);
if (np->n_direofoffset
&& uio->uio_offset >= np->n_direofoffset) {
return (0);
@@ -992,7 +992,7 @@ ncl_write(struct vop_write_args *ap)
}
}
- NFSINCRGLOBAL(newnfsstats.biocache_writes);
+ NFSINCRGLOBAL(nfsstatsv1.biocache_writes);
lbn = uio->uio_offset / biosize;
on = uio->uio_offset - (lbn * biosize);
n = MIN((unsigned)(biosize - on), uio->uio_resid);
@@ -1606,7 +1606,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
switch (vp->v_type) {
case VREG:
uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE;
- NFSINCRGLOBAL(newnfsstats.read_bios);
+ NFSINCRGLOBAL(nfsstatsv1.read_bios);
error = ncl_readrpc(vp, uiop, cr);
if (!error) {
@@ -1641,11 +1641,11 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
break;
case VLNK:
uiop->uio_offset = (off_t)0;
- NFSINCRGLOBAL(newnfsstats.readlink_bios);
+ NFSINCRGLOBAL(nfsstatsv1.readlink_bios);
error = ncl_readlinkrpc(vp, uiop, cr);
break;
case VDIR:
- NFSINCRGLOBAL(newnfsstats.readdir_bios);
+ NFSINCRGLOBAL(nfsstatsv1.readdir_bios);
uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ;
if ((nmp->nm_flag & NFSMNT_RDIRPLUS) != 0) {
error = ncl_readdirplusrpc(vp, uiop, cr, td);
@@ -1707,7 +1707,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
+ bp->b_dirtyoff;
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
- NFSINCRGLOBAL(newnfsstats.write_bios);
+ NFSINCRGLOBAL(nfsstatsv1.write_bios);
if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | B_CLUSTER)) == B_ASYNC)
iomode = NFSWRITE_UNSTABLE;
diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c
index 1fc7d1b..e108b4b 100644
--- a/sys/fs/nfsclient/nfs_clcomsubs.c
+++ b/sys/fs/nfsclient/nfs_clcomsubs.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#ifndef APPLEKEXT
#include <fs/nfs/nfsport.h>
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS];
extern int ncl_mbuf_mlen;
extern enum vtype newnv2tov_type[8];
@@ -241,8 +241,8 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp,
} else {
(void) nfsm_fhtom(nd, nfhp, fhlen, 0);
}
- if (procnum < NFSV4_NPROCS)
- NFSINCRGLOBAL(newnfsstats.rpccnt[procnum]);
+ if (procnum < NFSV41_NPROCS)
+ NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]);
}
#ifndef APPLE
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 20adaf1..e5b871f 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$");
/*
* Global variables
*/
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsreqhead nfsd_reqq;
extern u_int32_t newnfs_false, newnfs_true;
extern int nfscl_debuglevel;
@@ -343,10 +343,10 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldeleg *dp,
nowp->nfsow_defunct = 0;
nfscl_lockinit(&nowp->nfsow_rwlock);
if (dp != NULL) {
- newnfsstats.cllocalopenowners++;
+ nfsstatsv1.cllocalopenowners++;
LIST_INSERT_HEAD(&dp->nfsdl_owner, nowp, nfsow_list);
} else {
- newnfsstats.clopenowners++;
+ nfsstatsv1.clopenowners++;
LIST_INSERT_HEAD(&clp->nfsc_owner, nowp, nfsow_list);
}
owp = *owpp = nowp;
@@ -380,9 +380,9 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldeleg *dp,
TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp,
nfsdl_list);
dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
- newnfsstats.cllocalopens++;
+ nfsstatsv1.cllocalopens++;
} else {
- newnfsstats.clopens++;
+ nfsstatsv1.clopens++;
}
LIST_INSERT_HEAD(&owp->nfsow_open, nop, nfso_list);
*opp = nop;
@@ -430,7 +430,7 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp,
LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp,
nfsdl_hash);
dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
- newnfsstats.cldelegates++;
+ nfsstatsv1.cldelegates++;
nfscl_delegcnt++;
} else {
/*
@@ -1071,10 +1071,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
LIST_INIT(&nlp->nfsl_lock);
if (donelocally) {
nlp->nfsl_open = NULL;
- newnfsstats.cllocallockowners++;
+ nfsstatsv1.cllocallockowners++;
} else {
nlp->nfsl_open = op;
- newnfsstats.cllockowners++;
+ nfsstatsv1.cllockowners++;
}
LIST_INSERT_HEAD(lhp, nlp, nfsl_list);
lp = nlp;
@@ -1402,9 +1402,9 @@ nfscl_freeopen(struct nfsclopen *op, int local)
nfscl_freealllocks(&op->nfso_lock, local);
FREE((caddr_t)op, M_NFSCLOPEN);
if (local)
- newnfsstats.cllocalopens--;
+ nfsstatsv1.cllocalopens--;
else
- newnfsstats.clopens--;
+ nfsstatsv1.clopens--;
}
/*
@@ -1483,9 +1483,9 @@ nfscl_freeopenowner(struct nfsclowner *owp, int local)
LIST_REMOVE(owp, nfsow_list);
FREE((caddr_t)owp, M_NFSCLOWNER);
if (local)
- newnfsstats.cllocalopenowners--;
+ nfsstatsv1.cllocalopenowners--;
else
- newnfsstats.clopenowners--;
+ nfsstatsv1.clopenowners--;
}
/*
@@ -1502,9 +1502,9 @@ nfscl_freelockowner(struct nfscllockowner *lp, int local)
}
FREE((caddr_t)lp, M_NFSCLLOCKOWNER);
if (local)
- newnfsstats.cllocallockowners--;
+ nfsstatsv1.cllocallockowners--;
else
- newnfsstats.cllockowners--;
+ nfsstatsv1.cllockowners--;
}
/*
@@ -1517,9 +1517,9 @@ nfscl_freelock(struct nfscllock *lop, int local)
LIST_REMOVE(lop, nfslo_list);
FREE((caddr_t)lop, M_NFSCLLOCK);
if (local)
- newnfsstats.cllocallocks--;
+ nfsstatsv1.cllocallocks--;
else
- newnfsstats.cllocks--;
+ nfsstatsv1.cllocks--;
}
/*
@@ -1553,7 +1553,7 @@ nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp)
TAILQ_REMOVE(hdp, dp, nfsdl_list);
LIST_REMOVE(dp, nfsdl_hash);
FREE((caddr_t)dp, M_NFSCLDELEG);
- newnfsstats.cldelegates--;
+ nfsstatsv1.cldelegates--;
nfscl_delegcnt--;
}
@@ -1621,18 +1621,18 @@ nfscl_expireclient(struct nfsclclient *clp, struct nfsmount *nmp,
LIST_REMOVE(op, nfso_list);
op->nfso_own = towp;
LIST_INSERT_HEAD(&towp->nfsow_open, op, nfso_list);
- newnfsstats.cllocalopens--;
- newnfsstats.clopens++;
+ nfsstatsv1.cllocalopens--;
+ nfsstatsv1.clopens++;
}
} else {
/* Just add the openowner to the client list */
LIST_REMOVE(owp, nfsow_list);
owp->nfsow_clp = clp;
LIST_INSERT_HEAD(&clp->nfsc_owner, owp, nfsow_list);
- newnfsstats.cllocalopenowners--;
- newnfsstats.clopenowners++;
- newnfsstats.cllocalopens--;
- newnfsstats.clopens++;
+ nfsstatsv1.cllocalopenowners--;
+ nfsstatsv1.clopenowners++;
+ nfsstatsv1.cllocalopens--;
+ nfsstatsv1.clopens++;
}
}
owp = nowp;
@@ -2282,9 +2282,9 @@ nfscl_insertlock(struct nfscllockowner *lp, struct nfscllock *new_lop,
else
LIST_INSERT_AFTER(insert_lop, new_lop, nfslo_list);
if (local)
- newnfsstats.cllocallocks++;
+ nfsstatsv1.cllocallocks++;
else
- newnfsstats.cllocks++;
+ nfsstatsv1.cllocks++;
}
/*
@@ -2571,7 +2571,7 @@ tryagain:
LIST_REMOVE(dp, nfsdl_hash);
TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
nfscl_delegcnt--;
- newnfsstats.cldelegates--;
+ nfsstatsv1.cldelegates--;
}
NFSLOCKCLSTATE();
}
@@ -2612,7 +2612,7 @@ tryagain:
LIST_REMOVE(dp, nfsdl_hash);
TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
nfscl_delegcnt--;
- newnfsstats.cldelegates--;
+ nfsstatsv1.cldelegates--;
}
}
dp = ndp;
@@ -3215,8 +3215,8 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p)
break;
}
nd->nd_procnum = op;
- if (op < NFSV4OP_CBNOPS)
- newnfsstats.cbrpccnt[nd->nd_procnum]++;
+ if (op < NFSV41_CBNOPS)
+ nfsstatsv1.cbrpccnt[nd->nd_procnum]++;
switch (op) {
case NFSV4OP_CBGETATTR:
NFSCL_DEBUG(4, "cbgetattr\n");
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
index 836a183..a8e94fc 100644
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -83,7 +83,7 @@ extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
extern int ncl_numasync;
extern unsigned int ncl_iodmax;
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
struct task ncl_nfsiodnew_task;
@@ -219,12 +219,12 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
if ((time_second - np->n_attrstamp) >= timeo &&
(mustflush != 0 || np->n_attrstamp == 0)) {
- newnfsstats.attrcache_misses++;
+ nfsstatsv1.attrcache_misses++;
mtx_unlock(&np->n_mtx);
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
- newnfsstats.attrcache_hits++;
+ nfsstatsv1.attrcache_hits++;
if (vap->va_size != np->n_size) {
if (vap->va_type == VREG) {
if (np->n_flag & NMODIFIED) {
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index a3e2c70..524a372 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -78,7 +78,6 @@ FEATURE(nfscl, "NFSv4 client");
extern int nfscl_ticks;
extern struct timeval nfsboottime;
-extern struct nfsstats newnfsstats;
extern int nfsrv_useacl;
extern int nfscl_debuglevel;
extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 55e514b..69c1fe7 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -100,7 +100,7 @@ uint32_t nfscl_accesscache_load_done_id;
#define TRUE 1
#define FALSE 0
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern int nfsrv_useacl;
extern int nfscl_debuglevel;
MALLOC_DECLARE(M_NEWNFSREQ);
@@ -258,14 +258,6 @@ int newnfs_directio_allow_mmap = 1;
SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW,
&newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens");
-#if 0
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD,
- &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count");
-
-SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD,
- &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count");
-#endif
-
#define NFSACCESS_ALL (NFSACCESS_READ | NFSACCESS_MODIFY \
| NFSACCESS_EXTEND | NFSACCESS_EXECUTE \
| NFSACCESS_DELETE | NFSACCESS_LOOKUP)
@@ -418,7 +410,7 @@ nfs_access(struct vop_access_args *ap)
if (time_second < (np->n_accesscache[i].stamp
+ nfsaccess_cache_timeout) &&
(np->n_accesscache[i].mode & mode) == mode) {
- NFSINCRGLOBAL(newnfsstats.accesscache_hits);
+ NFSINCRGLOBAL(nfsstatsv1.accesscache_hits);
gotahit = 1;
}
break;
@@ -437,7 +429,7 @@ nfs_access(struct vop_access_args *ap)
/*
* Either a no, or a don't know. Go to the wire.
*/
- NFSINCRGLOBAL(newnfsstats.accesscache_misses);
+ NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
error = nfs34_access_otw(vp, wmode, ap->a_td,
ap->a_cred, &rmode);
if (!error &&
@@ -857,7 +849,7 @@ nfs_getattr(struct vop_getattr_args *ap)
if (NFS_ISV34(vp) && nfs_prime_access_cache &&
nfsaccess_cache_timeout > 0) {
- NFSINCRGLOBAL(newnfsstats.accesscache_misses);
+ NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
nfs34_access_otw(vp, NFSACCESS_ALL, td, ap->a_cred, NULL);
if (ncl_getattrcache(vp, ap->a_vap) == 0) {
nfscl_deleggetmodtime(vp, &ap->a_vap->va_mtime);
@@ -1114,7 +1106,7 @@ nfs_lookup(struct vop_lookup_args *ap)
((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) &&
VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 &&
timespeccmp(&vattr.va_ctime, &nctime, ==))) {
- NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
+ NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits);
if (cnp->cn_nameiop != LOOKUP &&
(flags & ISLASTCN))
cnp->cn_flags |= SAVENAME;
@@ -1141,7 +1133,7 @@ nfs_lookup(struct vop_lookup_args *ap)
if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) &&
VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 &&
timespeccmp(&vattr.va_mtime, &nctime, ==)) {
- NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
+ NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits);
return (ENOENT);
}
cache_purge_negative(dvp);
@@ -1149,7 +1141,7 @@ nfs_lookup(struct vop_lookup_args *ap)
error = 0;
newvp = NULLVP;
- NFSINCRGLOBAL(newnfsstats.lookupcache_misses);
+ NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses);
error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
cnp->cn_cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag,
NULL);
@@ -2227,7 +2219,7 @@ nfs_readdir(struct vop_readdir_args *ap)
if ((NFS_ISV4(vp) && np->n_change == vattr.va_filerev) ||
!NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) {
mtx_unlock(&np->n_mtx);
- NFSINCRGLOBAL(newnfsstats.direofcache_hits);
+ NFSINCRGLOBAL(nfsstatsv1.direofcache_hits);
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
return (0);
@@ -2254,7 +2246,7 @@ nfs_readdir(struct vop_readdir_args *ap)
error = ncl_bioread(vp, uio, 0, ap->a_cred);
if (!error && uio->uio_resid == tresid) {
- NFSINCRGLOBAL(newnfsstats.direofcache_misses);
+ NFSINCRGLOBAL(nfsstatsv1.direofcache_misses);
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
}
diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c
index 0f78b3f..0b7bf8f 100644
--- a/sys/fs/nfsserver/nfs_nfsdcache.c
+++ b/sys/fs/nfsserver/nfs_nfsdcache.c
@@ -159,7 +159,7 @@ __FBSDID("$FreeBSD$");
#ifndef APPLEKEXT
#include <fs/nfs/nfsport.h>
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct mtx nfsrc_udpmtx;
extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE];
@@ -318,8 +318,8 @@ nfsrvd_initcache(void)
TAILQ_INIT(&nfsrvudplru);
nfsrc_tcpsavedreplies = 0;
nfsrc_udpcachesize = 0;
- newnfsstats.srvcache_tcppeak = 0;
- newnfsstats.srvcache_size = 0;
+ nfsstatsv1.srvcache_tcppeak = 0;
+ nfsstatsv1.srvcache_size = 0;
}
/*
@@ -395,14 +395,14 @@ loop:
TAILQ_REMOVE(&nfsrvudplru, rp, rc_lru);
TAILQ_INSERT_TAIL(&nfsrvudplru, rp, rc_lru);
if (rp->rc_flag & RC_INPROG) {
- newnfsstats.srvcache_inproghits++;
+ nfsstatsv1.srvcache_inproghits++;
mtx_unlock(mutex);
ret = RC_DROPIT;
} else if (rp->rc_flag & RC_REPSTATUS) {
/*
* V2 only.
*/
- newnfsstats.srvcache_nonidemdonehits++;
+ nfsstatsv1.srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nfsrvd_rephead(nd);
*(nd->nd_errp) = rp->rc_status;
@@ -410,7 +410,7 @@ loop:
rp->rc_timestamp = NFSD_MONOSEC +
NFSRVCACHE_UDPTIMEOUT;
} else if (rp->rc_flag & RC_REPMBUF) {
- newnfsstats.srvcache_nonidemdonehits++;
+ nfsstatsv1.srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nd->nd_mreq = m_copym(rp->rc_reply, 0,
M_COPYALL, M_WAITOK);
@@ -425,8 +425,8 @@ loop:
goto out;
}
}
- newnfsstats.srvcache_misses++;
- atomic_add_int(&newnfsstats.srvcache_size, 1);
+ nfsstatsv1.srvcache_misses++;
+ atomic_add_int(&nfsstatsv1.srvcache_size, 1);
nfsrc_udpcachesize++;
newrp->rc_flag |= RC_INPROG;
@@ -480,7 +480,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd)
* Reply from cache is a special case returned by nfsrv_checkseqid().
*/
if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) {
- newnfsstats.srvcache_nonidemdonehits++;
+ nfsstatsv1.srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nd->nd_repstat = 0;
if (nd->nd_mreq)
@@ -519,8 +519,8 @@ nfsrvd_updatecache(struct nfsrv_descript *nd)
if (!(rp->rc_flag & RC_UDP)) {
atomic_add_int(&nfsrc_tcpsavedreplies, 1);
if (nfsrc_tcpsavedreplies >
- newnfsstats.srvcache_tcppeak)
- newnfsstats.srvcache_tcppeak =
+ nfsstatsv1.srvcache_tcppeak)
+ nfsstatsv1.srvcache_tcppeak =
nfsrc_tcpsavedreplies;
}
mtx_unlock(mutex);
@@ -678,7 +678,7 @@ tryagain:
panic("nfs tcp cache0");
rp->rc_flag |= RC_LOCKED;
if (rp->rc_flag & RC_INPROG) {
- newnfsstats.srvcache_inproghits++;
+ nfsstatsv1.srvcache_inproghits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -687,7 +687,7 @@ tryagain:
/*
* V2 only.
*/
- newnfsstats.srvcache_nonidemdonehits++;
+ nfsstatsv1.srvcache_nonidemdonehits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -696,7 +696,7 @@ tryagain:
*(nd->nd_errp) = rp->rc_status;
rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
} else if (rp->rc_flag & RC_REPMBUF) {
- newnfsstats.srvcache_nonidemdonehits++;
+ nfsstatsv1.srvcache_nonidemdonehits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -711,8 +711,8 @@ tryagain:
free((caddr_t)newrp, M_NFSRVCACHE);
goto out;
}
- newnfsstats.srvcache_misses++;
- atomic_add_int(&newnfsstats.srvcache_size, 1);
+ nfsstatsv1.srvcache_misses++;
+ atomic_add_int(&nfsstatsv1.srvcache_size, 1);
/*
* For TCP, multiple entries for a key are allowed, so don't
@@ -801,7 +801,7 @@ nfsrc_freecache(struct nfsrvcache *rp)
atomic_add_int(&nfsrc_tcpsavedreplies, -1);
}
FREE((caddr_t)rp, M_NFSRVCACHE);
- atomic_add_int(&newnfsstats.srvcache_size, -1);
+ atomic_add_int(&nfsstatsv1.srvcache_size, -1);
}
/*
@@ -825,7 +825,7 @@ nfsrvd_cleancache(void)
nfsrc_freecache(rp);
}
}
- newnfsstats.srvcache_size = 0;
+ nfsstatsv1.srvcache_size = 0;
mtx_unlock(&nfsrc_udpmtx);
nfsrc_tcpsavedreplies = 0;
}
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 2f67829..52896a8 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -62,6 +62,7 @@ extern struct nfsclienthashhead *nfsclienthash;
extern struct nfslockhashhead *nfslockhash;
extern struct nfssessionhash *nfssessionhash;
extern int nfsrv_sessionhashsize;
+extern struct nfsstatsv1 nfsstatsv1;
struct vfsoptlist nfsv4root_opt, nfsv4root_newopt;
NFSDLOCKMUTEX;
struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
@@ -686,6 +687,8 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred,
uiop->uio_td = NULL;
nh = nfsrv_sequential_heuristic(uiop, vp);
ioflag |= nh->nh_seqcount << IO_SEQSHIFT;
+ /* XXX KDM make this more systematic? */
+ nfsstatsv1.srvbytes[NFSV4OP_READ] += uiop->uio_resid;
error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred);
FREE((caddr_t)iv2, M_TEMP);
if (error) {
@@ -758,6 +761,8 @@ nfsvno_write(struct vnode *vp, off_t off, int retlen, int cnt, int stable,
uiop->uio_offset = off;
nh = nfsrv_sequential_heuristic(uiop, vp);
ioflags |= nh->nh_seqcount << IO_SEQSHIFT;
+ /* XXX KDM make this more systematic? */
+ nfsstatsv1.srvbytes[NFSV4OP_WRITE] += uiop->uio_resid;
error = VOP_WRITE(vp, uiop, ioflags, cred);
if (error == 0)
nh->nh_nextoff = uiop->uio_offset;
diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c
index e09116c..f45bba4 100644
--- a/sys/fs/nfsserver/nfs_nfsdsocket.c
+++ b/sys/fs/nfsserver/nfs_nfsdsocket.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
#ifndef APPLEKEXT
#include <fs/nfs/nfsport.h>
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsrvfh nfs_pubfh, nfs_rootfh;
extern int nfs_pubfhset, nfs_rootfhset;
extern struct nfsv4lock nfsv4rootfs_lock;
@@ -400,6 +400,68 @@ static int nfsv3to4op[NFS_V3NPROCS] = {
NFSV4OP_COMMIT,
};
+static struct mtx nfsrvd_statmtx;
+MTX_SYSINIT(nfsst, &nfsrvd_statmtx, "NFSstat", MTX_DEF);
+
+static void
+nfsrvd_statstart(int op, struct bintime *now)
+{
+ if (op > (NFSV42_NOPS + NFSV4OP_FAKENOPS)) {
+ printf("%s: op %d invalid\n", __func__, op);
+ return;
+ }
+
+ mtx_lock(&nfsrvd_statmtx);
+ if (nfsstatsv1.srvstartcnt == nfsstatsv1.srvdonecnt) {
+ if (now != NULL)
+ nfsstatsv1.busyfrom = *now;
+ else
+ binuptime(&nfsstatsv1.busyfrom);
+
+ }
+ nfsstatsv1.srvrpccnt[op]++;
+ nfsstatsv1.srvstartcnt++;
+ mtx_unlock(&nfsrvd_statmtx);
+
+}
+
+static void
+nfsrvd_statend(int op, uint64_t bytes, struct bintime *now,
+ struct bintime *then)
+{
+ struct bintime dt, lnow;
+
+ if (op > (NFSV42_NOPS + NFSV4OP_FAKENOPS)) {
+ printf("%s: op %d invalid\n", __func__, op);
+ return;
+ }
+
+ if (now == NULL) {
+ now = &lnow;
+ binuptime(now);
+ }
+
+ mtx_lock(&nfsrvd_statmtx);
+
+ nfsstatsv1.srvbytes[op] += bytes;
+ nfsstatsv1.srvops[op]++;
+
+ if (then != NULL) {
+ dt = *now;
+ bintime_sub(&dt, then);
+ bintime_add(&nfsstatsv1.srvduration[op], &dt);
+ }
+
+ dt = *now;
+ bintime_sub(&dt, &nfsstatsv1.busyfrom);
+ bintime_add(&nfsstatsv1.busytime, &dt);
+ nfsstatsv1.busyfrom = *now;
+
+ nfsstatsv1.srvdonecnt++;
+
+ mtx_unlock(&nfsrvd_statmtx);
+}
+
/*
* Do an RPC. Basically, get the file handles translated to vnode pointers
* and then call the appropriate server routine. The server routines are
@@ -476,7 +538,9 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
*/
if (nd->nd_repstat && (nd->nd_flag & ND_NFSV2)) {
*nd->nd_errp = nfsd_errmap(nd);
- NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]);
+ nfsrvd_statstart(nfsv3to4op[nd->nd_procnum], /*now*/ NULL);
+ nfsrvd_statend(nfsv3to4op[nd->nd_procnum], /*bytes*/ 0,
+ /*now*/ NULL, /*then*/ NULL);
if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0)
vn_finished_write(mp);
goto out;
@@ -491,6 +555,11 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
if (nd->nd_flag & ND_NFSV4) {
nfsrvd_compound(nd, isdgram, tag, taglen, minorvers, p);
} else {
+ struct bintime start_time;
+
+ binuptime(&start_time);
+ nfsrvd_statstart(nfsv3to4op[nd->nd_procnum], &start_time);
+
if (nfs_retfh[nd->nd_procnum] == 1) {
if (vp)
NFSVOPUNLOCK(vp, 0);
@@ -505,7 +574,9 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, u_char *tag, int taglen,
}
if (mp != NULL && nfs_writerpc[nd->nd_procnum] != 0)
vn_finished_write(mp);
- NFSINCRGLOBAL(newnfsstats.srvrpccnt[nfsv3to4op[nd->nd_procnum]]);
+
+ nfsrvd_statend(nfsv3to4op[nd->nd_procnum], /*bytes*/ 0,
+ /*now*/ NULL, /*then*/ &start_time);
}
if (error) {
if (error != EBADRPC)
@@ -547,7 +618,7 @@ static void
nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
int taglen, u_int32_t minorvers, NFSPROC_T *p)
{
- int i, lktype, op, op0 = 0;
+ int i, lktype, op, op0 = 0, statsinprog = 0;
u_int32_t *tl;
struct nfsclient *clp, *nclp;
int numops, error = 0, igotlock;
@@ -559,6 +630,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
struct nfsexstuff nes, vpnes, savevpnes;
fsid_t cur_fsid, save_fsid;
static u_int64_t compref = 0;
+ struct bintime start_time;
NFSVNO_EXINIT(&vpnes);
NFSVNO_EXINIT(&savevpnes);
@@ -686,6 +758,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
*repp = *tl;
op = fxdr_unsigned(int, *tl);
NFSD_DEBUG(4, "op=%d\n", op);
+
+ binuptime(&start_time);
+ nfsrvd_statstart(op, &start_time);
+ statsinprog = 1;
+
if (op < NFSV4OP_ACCESS ||
(op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) ||
(op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) {
@@ -771,12 +848,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
}
if (nfsv4_opflag[op].savereply)
nd->nd_flag |= ND_SAVEREPLY;
- /*
- * For now, newnfsstats.srvrpccnt[] doesn't have entries
- * for the NFSv4.1 operations.
- */
- if (nd->nd_procnum < NFSV4OP_NOPS)
- NFSINCRGLOBAL(newnfsstats.srvrpccnt[nd->nd_procnum]);
switch (op) {
case NFSV4OP_PUTFH:
error = nfsrv_mtofh(nd, &fh);
@@ -1007,6 +1078,13 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
}
error = 0;
}
+
+ if (statsinprog != 0) {
+ nfsrvd_statend(op, /*bytes*/ 0, /*now*/ NULL,
+ /*then*/ &start_time);
+ statsinprog = 0;
+ }
+
retops++;
if (nd->nd_repstat) {
*repp = nfsd_errmap(nd);
@@ -1016,6 +1094,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
}
}
nfsmout:
+ if (statsinprog != 0) {
+ nfsrvd_statend(op, /*bytes*/ 0, /*now*/ NULL,
+ /*then*/ &start_time);
+ statsinprog = 0;
+ }
if (error) {
if (error == EBADRPC || error == NFSERR_BADXDR)
nd->nd_repstat = NFSERR_BADXDR;
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index b096501..1b90d02 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -37,7 +37,7 @@ int nfsrv_dolocallocks = 0;
struct nfsv4lock nfsv4rootfs_lock;
extern int newnfs_numnfsd;
-extern struct nfsstats newnfsstats;
+extern struct nfsstatsv1 nfsstatsv1;
extern int nfsrv_lease;
extern struct timeval nfsboottime;
extern u_int32_t newnfs_true, newnfs_false;
@@ -273,7 +273,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
LIST_INIT(&new_clp->lc_stateid[i]);
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- newnfsstats.srvclients++;
+ nfsstatsv1.srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
NFSLOCKV4ROOTMUTEX();
@@ -377,7 +377,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
}
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- newnfsstats.srvclients++;
+ nfsstatsv1.srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
NFSLOCKV4ROOTMUTEX();
@@ -441,7 +441,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
}
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- newnfsstats.srvclients++;
+ nfsstatsv1.srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
}
@@ -815,7 +815,7 @@ out:
/*
* Dump out stats for all clients. Called from nfssvc(2), that is used
- * newnfsstats.
+ * nfsstatsv1.
*/
APPLESTATIC void
nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt)
@@ -1219,7 +1219,7 @@ nfsrv_zapclient(struct nfsclient *clp, NFSPROC_T *p)
free(clp->lc_stateid, M_NFSDCLIENT);
free(clp, M_NFSDCLIENT);
NFSLOCKSTATE();
- newnfsstats.srvclients--;
+ nfsstatsv1.srvclients--;
nfsrv_openpluslock--;
nfsrv_clients--;
NFSUNLOCKSTATE();
@@ -1260,7 +1260,7 @@ nfsrv_freedeleg(struct nfsstate *stp)
nfsv4_testlock(&lfp->lf_locallock_lck) == 0)
nfsrv_freenfslockfile(lfp);
FREE((caddr_t)stp, M_NFSDSTATE);
- newnfsstats.srvdelegates--;
+ nfsstatsv1.srvdelegates--;
nfsrv_openpluslock--;
nfsrv_delegatecnt--;
}
@@ -1286,7 +1286,7 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p)
if (stp->ls_op)
nfsrvd_derefcache(stp->ls_op);
FREE((caddr_t)stp, M_NFSDSTATE);
- newnfsstats.srvopenowners--;
+ nfsstatsv1.srvopenowners--;
nfsrv_openpluslock--;
}
@@ -1336,7 +1336,7 @@ nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p)
if (cansleep != 0)
NFSUNLOCKSTATE();
FREE((caddr_t)stp, M_NFSDSTATE);
- newnfsstats.srvopens--;
+ nfsstatsv1.srvopens--;
nfsrv_openpluslock--;
return (ret);
}
@@ -1355,7 +1355,7 @@ nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep,
if (stp->ls_op)
nfsrvd_derefcache(stp->ls_op);
FREE((caddr_t)stp, M_NFSDSTATE);
- newnfsstats.srvlockowners--;
+ nfsstatsv1.srvlockowners--;
nfsrv_openpluslock--;
}
@@ -1430,7 +1430,7 @@ nfsrv_freenfslock(struct nfslock *lop)
if (lop->lo_lckfile.le_prev != NULL) {
LIST_REMOVE(lop, lo_lckfile);
- newnfsstats.srvlocks--;
+ nfsstatsv1.srvlocks--;
nfsrv_openpluslock--;
}
LIST_REMOVE(lop, lo_lckowner);
@@ -2200,7 +2200,7 @@ tryagain:
LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list);
*new_lopp = NULL;
*new_stpp = NULL;
- newnfsstats.srvlockowners++;
+ nfsstatsv1.srvlockowners++;
nfsrv_openpluslock++;
}
if (filestruct_locked != 0) {
@@ -2849,12 +2849,12 @@ tryagain:
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list);
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list);
*new_stpp = NULL;
- newnfsstats.srvopenowners++;
+ nfsstatsv1.srvopenowners++;
nfsrv_openpluslock++;
}
openstp = new_open;
new_open = NULL;
- newnfsstats.srvopens++;
+ nfsstatsv1.srvopens++;
nfsrv_openpluslock++;
break;
}
@@ -2913,7 +2913,7 @@ tryagain:
NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt) ||
!NFSVNO_DELEGOK(vp))
*rflagsp |= NFSV4OPEN_RECALL;
- newnfsstats.srvdelegates++;
+ nfsstatsv1.srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
@@ -2953,12 +2953,12 @@ tryagain:
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list);
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list);
*new_stpp = NULL;
- newnfsstats.srvopenowners++;
+ nfsstatsv1.srvopenowners++;
nfsrv_openpluslock++;
}
openstp = new_open;
new_open = NULL;
- newnfsstats.srvopens++;
+ nfsstatsv1.srvopens++;
nfsrv_openpluslock++;
} else {
error = NFSERR_RECLAIMCONFLICT;
@@ -3027,7 +3027,7 @@ tryagain:
new_deleg->ls_stateid), new_deleg, ls_hash);
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list);
new_deleg = NULL;
- newnfsstats.srvdelegates++;
+ nfsstatsv1.srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3049,7 +3049,7 @@ tryagain:
new_open, ls_hash);
openstp = new_open;
new_open = NULL;
- newnfsstats.srvopens++;
+ nfsstatsv1.srvopens++;
nfsrv_openpluslock++;
/*
@@ -3094,7 +3094,7 @@ tryagain:
new_deleg->ls_stateid), new_deleg, ls_hash);
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list);
new_deleg = NULL;
- newnfsstats.srvdelegates++;
+ nfsstatsv1.srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3173,7 +3173,7 @@ tryagain:
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg,
ls_list);
new_deleg = NULL;
- newnfsstats.srvdelegates++;
+ nfsstatsv1.srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3191,9 +3191,9 @@ tryagain:
openstp = new_open;
new_open = NULL;
*new_stpp = NULL;
- newnfsstats.srvopens++;
+ nfsstatsv1.srvopens++;
nfsrv_openpluslock++;
- newnfsstats.srvopenowners++;
+ nfsstatsv1.srvopenowners++;
nfsrv_openpluslock++;
}
if (!error) {
@@ -3645,7 +3645,7 @@ nfsrv_insertlock(struct nfslock *new_lop, struct nfslock *insert_lop,
else
LIST_INSERT_AFTER(insert_lop, new_lop, lo_lckowner);
if (stp != NULL) {
- newnfsstats.srvlocks++;
+ nfsstatsv1.srvlocks++;
nfsrv_openpluslock++;
}
}
@@ -3843,7 +3843,7 @@ out:
* just set lc_program to 0 to indicate no callbacks are possible.
* (For cases where the address can't be parsed or is 0.0.0.0.0.0, set
* the address to the client's transport address. This won't be used
- * for callbacks, but can be printed out by newnfsstats for info.)
+ * for callbacks, but can be printed out by nfsstats for info.)
* Return error if the xdr can't be parsed, 0 otherwise.
*/
APPLESTATIC int
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index d3a7906..9a4f578 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -896,7 +896,6 @@ null_vptocnp(struct vop_vptocnp_args *ap)
vn_lock(vp, locked | LK_RETRY);
return (ENOENT);
}
- vref(ldvp);
error = null_nodeget(vp->v_mount, ldvp, dvp);
if (error == 0) {
#ifdef DIAGNOSTIC
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index e4b1e14..8c3ec64 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -126,7 +126,6 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
if (error != 0)
return (error);
}
- pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;
if (dp->d_maxsize == 0) {
printf("WARNING: Disk drive %s%d has no d_maxsize\n",
@@ -143,6 +142,14 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
pp->stripeoffset = dp->d_stripeoffset;
pp->stripesize = dp->d_stripesize;
dp->d_flags |= DISKFLAG_OPEN;
+ /*
+ * Do not invoke resize event when initial size was zero.
+ * Some disks report its size only after first opening.
+ */
+ if (pp->mediasize == 0)
+ pp->mediasize = dp->d_mediasize;
+ else
+ g_resize_provider(pp, dp->d_mediasize);
} else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) {
if (dp->d_close != NULL) {
error = dp->d_close(dp);
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index f67b744..d0df840 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -636,7 +636,7 @@ g_resize_provider_event(void *arg, int flag)
LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) {
gp = cp->geom;
- if (gp->resize != NULL)
+ if ((gp->flags & G_GEOM_WITHER) == 0 && gp->resize != NULL)
gp->resize(cp);
}
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 1228079..e315f51 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -2663,8 +2663,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));
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index d40de0f..dad505a 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -4802,6 +4802,14 @@ retry:
* XXX: The exact number of bits to check and clear is a matter that
* should be tested and standardized at some point in the future for
* optimal aging of shared pages.
+ *
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits. This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified(). However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages. Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
*/
int
pmap_ts_referenced(vm_page_t m)
@@ -4828,6 +4836,14 @@ pmap_ts_referenced(vm_page_t m)
pmap = PV_PMAP(pv);
PMAP_LOCK(pmap);
pde = pmap_pde(pmap, pv->pv_va);
+ if ((*pde & (PG_M | PG_RW)) == (PG_M | PG_RW)) {
+ /*
+ * Although "*pde" is mapping a 2/4MB page, because
+ * this function is called at a 4KB page granularity,
+ * we only update the 4KB page under test.
+ */
+ vm_page_dirty(m);
+ }
if ((*pde & PG_A) != 0) {
/*
* Since this reference bit is shared by either 1024
@@ -4876,6 +4892,8 @@ small_mappings:
("pmap_ts_referenced: found a 4mpage in page %p's pv list",
m));
pte = pmap_pte_quick(pmap, pv->pv_va);
+ if ((*pte & (PG_M | PG_RW)) == (PG_M | PG_RW))
+ vm_page_dirty(m);
if ((*pte & PG_A) != 0) {
atomic_clear_int((u_int *)pte, PG_A);
pmap_invalidate_page(pmap, pv->pv_va);
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 818f44b..b288314 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -499,7 +499,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
* Increase reference counts on shared objects.
*/
p2->p_flag = P_INMEM;
- p2->p_flag2 = p1->p_flag2 & (P2_NOTRACE | P2_NOTRACE_EXEC);
+ p2->p_flag2 = p1->p_flag2 & (P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP);
p2->p_swtick = ticks;
if (p1->p_flag & P_PROFIL)
startprofclock(p2);
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c
index fcc8c57..c8a2345 100644
--- a/sys/kern/kern_lockf.c
+++ b/sys/kern/kern_lockf.c
@@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$");
#ifdef LOCKF_DEBUG
#include <sys/sysctl.h>
+#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
+#include <ufs/ufs/ufsmount.h>
#include <ufs/ufs/inode.h>
static int lockf_debug = 0; /* control debug output */
@@ -2500,7 +2502,7 @@ lf_print(char *tag, struct lockf_entry *lock)
if (lock->lf_inode != (struct inode *)0)
printf(" in ino %ju on dev <%s>,",
(uintmax_t)lock->lf_inode->i_number,
- devtoname(lock->lf_inode->i_dev));
+ devtoname(ITODEV(lock->lf_inode)));
printf(" %s, start %jd, end ",
lock->lf_type == F_RDLCK ? "shared" :
lock->lf_type == F_WRLCK ? "exclusive" :
@@ -2528,7 +2530,7 @@ lf_printlist(char *tag, struct lockf_entry *lock)
printf("%s: Lock list for ino %ju on dev <%s>:\n",
tag, (uintmax_t)lock->lf_inode->i_number,
- devtoname(lock->lf_inode->i_dev));
+ devtoname(ITODEV(lock->lf_inode)));
LIST_FOREACH(lf, &lock->lf_vnode->v_lockf->ls_active, lf_link) {
printf("\tlock %p for ",(void *)lf);
lf_print_owner(lock->lf_owner);
diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c
index 8ef72901..c3d290a 100644
--- a/sys/kern/kern_procctl.c
+++ b/sys/kern/kern_procctl.c
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 John Baldwin
- * Copyright (c) 2014 The FreeBSD Foundation
+ * Copyright (c) 2014, 2016 The FreeBSD Foundation
*
* Portions of this software were developed by Konstantin Belousov
* under sponsorship from the FreeBSD Foundation.
@@ -336,6 +336,34 @@ trace_status(struct thread *td, struct proc *p, int *data)
return (0);
}
+static int
+trapcap_ctl(struct thread *td, struct proc *p, int state)
+{
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+
+ switch (state) {
+ case PROC_TRAPCAP_CTL_ENABLE:
+ p->p_flag2 |= P2_TRAPCAP;
+ break;
+ case PROC_TRAPCAP_CTL_DISABLE:
+ p->p_flag2 &= ~P2_TRAPCAP;
+ break;
+ default:
+ return (EINVAL);
+ }
+ return (0);
+}
+
+static int
+trapcap_status(struct thread *td, struct proc *p, int *data)
+{
+
+ *data = (p->p_flag2 & P2_TRAPCAP) != 0 ? PROC_TRAPCAP_CTL_ENABLE :
+ PROC_TRAPCAP_CTL_DISABLE;
+ return (0);
+}
+
#ifndef _SYS_SYSPROTO_H_
struct procctl_args {
idtype_t idtype;
@@ -359,6 +387,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap)
switch (uap->com) {
case PROC_SPROTECT:
case PROC_TRACE_CTL:
+ case PROC_TRAPCAP_CTL:
error = copyin(uap->data, &flags, sizeof(flags));
if (error != 0)
return (error);
@@ -386,6 +415,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap)
data = &x.rk;
break;
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
data = &flags;
break;
default:
@@ -403,6 +433,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap)
error = error1;
break;
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
if (error == 0)
error = copyout(&flags, uap->data, sizeof(flags));
break;
@@ -432,6 +463,10 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data)
return (trace_ctl(td, p, *(int *)data));
case PROC_TRACE_STATUS:
return (trace_status(td, p, data));
+ case PROC_TRAPCAP_CTL:
+ return (trapcap_ctl(td, p, *(int *)data));
+ case PROC_TRAPCAP_STATUS:
+ return (trapcap_status(td, p, data));
default:
return (EINVAL);
}
@@ -452,6 +487,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data)
case PROC_REAP_GETPIDS:
case PROC_REAP_KILL:
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
if (idtype != P_PID)
return (EINVAL);
}
@@ -462,6 +498,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data)
case PROC_REAP_GETPIDS:
case PROC_REAP_KILL:
case PROC_TRACE_CTL:
+ case PROC_TRAPCAP_CTL:
sx_slock(&proctree_lock);
tree_locked = true;
break;
@@ -471,6 +508,7 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data)
tree_locked = true;
break;
case PROC_TRACE_STATUS:
+ case PROC_TRAPCAP_STATUS:
tree_locked = false;
break;
default:
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index 7ee7780..05be5f6 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -656,10 +656,18 @@ retry_space:
if (hdr_uio != NULL && hdr_uio->uio_resid > 0) {
hdr_uio->uio_td = td;
hdr_uio->uio_rw = UIO_WRITE;
- hdr_uio->uio_resid = min(hdr_uio->uio_resid, space);
- mh = m_uiotombuf(hdr_uio, M_WAITOK, 0, 0, 0);
+ mh = m_uiotombuf(hdr_uio, M_WAITOK, space, 0, 0);
hdrlen = m_length(mh, &mhtail);
space -= hdrlen;
+ /*
+ * If header consumed all the socket buffer space,
+ * don't waste CPU cycles and jump to the end.
+ */
+ if (space == 0) {
+ sfio = NULL;
+ nios = 0;
+ goto prepend_header;
+ }
hdr_uio = NULL;
}
@@ -806,6 +814,7 @@ retry_space:
/* Prepend header, if any. */
if (hdrlen) {
+prepend_header:
mhtail->m_next = m;
m = mh;
mh = NULL;
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index af3ca57..b28a8cb 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -2146,6 +2146,12 @@ device_probe_child(device_t dev, device_t child)
}
/*
+ * Reset DF_QUIET in case this driver doesn't
+ * end up as the best driver.
+ */
+ device_verbose(child);
+
+ /*
* Probes that return BUS_PROBE_NOWILDCARD or lower
* only match on devices whose driver was explicitly
* specified.
@@ -2970,6 +2976,7 @@ device_detach(device_t dev)
if (!(dev->flags & DF_FIXEDCLASS))
devclass_delete_device(dev->devclass, dev);
+ device_verbose(dev);
dev->state = DS_NOTPRESENT;
(void)device_set_driver(dev, NULL);
device_sysctl_fini(dev);
@@ -5427,6 +5434,7 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
case DEV_SUSPEND:
case DEV_RESUME:
case DEV_SET_DRIVER:
+ case DEV_CLEAR_DRIVER:
case DEV_RESCAN:
case DEV_DELETE:
error = priv_check(td, PRIV_DRIVER);
@@ -5592,6 +5600,25 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
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;
case DEV_RESCAN:
if (!device_is_attached(dev)) {
error = ENXIO;
diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c
index 4bac324..dee839d 100644
--- a/sys/kern/subr_rtc.c
+++ b/sys/kern/subr_rtc.c
@@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$");
static device_t clock_dev = NULL;
static long clock_res;
static struct timespec clock_adj;
-static struct mtx resettodr_lock;
+struct mtx resettodr_lock;
MTX_SYSINIT(resettodr_init, &resettodr_lock, "tod2rl", MTX_DEF);
/* XXX: should be kern. now, it's no longer machdep. */
@@ -132,7 +132,9 @@ inittodr(time_t base)
goto wrong_time;
}
/* XXX: We should poll all registered RTCs in case of failure */
+ mtx_lock(&resettodr_lock);
error = CLOCK_GETTIME(clock_dev, &ts);
+ mtx_unlock(&resettodr_lock);
if (error != 0 && error != EINVAL) {
printf("warning: clock_gettime failed (%d), the system time "
"will not be set accurately\n", error);
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
index 3e2a3b3..822976e 100644
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -165,12 +165,25 @@ static inline void
syscallret(struct thread *td, int error, struct syscall_args *sa)
{
struct proc *p, *p2;
- int traced;
+ ksiginfo_t ksi;
+ int traced, error1;
KASSERT((td->td_pflags & TDP_FORKING) == 0,
("fork() did not clear TDP_FORKING upon completion"));
p = td->td_proc;
+ if ((trap_enotcap || (p->p_flag2 & P2_TRAPCAP) != 0) &&
+ IN_CAPABILITY_MODE(td)) {
+ error1 = (td->td_pflags & TDP_NERRNO) == 0 ? error :
+ td->td_errno;
+ if (error1 == ENOTCAPABLE || error1 == ECAPMODE) {
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = SIGTRAP;
+ ksi.ksi_errno = error1;
+ ksi.ksi_code = TRAP_CAP;
+ trapsignal(td, &ksi);
+ }
+ }
/*
* Handle reschedule and other end-of-syscall issues
diff --git a/sys/kern/sys_capability.c b/sys/kern/sys_capability.c
index e87f0b1..584d7ee 100644
--- a/sys/kern/sys_capability.c
+++ b/sys/kern/sys_capability.c
@@ -83,6 +83,10 @@ __FBSDID("$FreeBSD$");
#include <vm/uma.h>
#include <vm/vm.h>
+int trap_enotcap;
+SYSCTL_INT(_kern, OID_AUTO, trap_enotcap, CTLFLAG_RW, &trap_enotcap, 0,
+ "Deliver SIGTRAP on ENOTCAPABLE");
+
#ifdef CAPABILITY_MODE
FEATURE(security_capability_mode, "Capsicum Capability Mode");
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 87cd84d..f3d2435 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -102,6 +102,7 @@ SUBDIR= \
${_drm2} \
dummynet \
${_ed} \
+ ${_efirt} \
${_elink} \
${_em} \
en \
@@ -666,6 +667,7 @@ _x86bios= x86bios
.endif
.if ${MACHINE_CPUARCH} == "amd64"
+_efirt= efirt
_ioat= ioat
_ixl= ixl
_ixlv= ixlv
diff --git a/sys/modules/cxgbe/Makefile b/sys/modules/cxgbe/Makefile
index 23a823f..57409db 100644
--- a/sys/modules/cxgbe/Makefile
+++ b/sys/modules/cxgbe/Makefile
@@ -7,6 +7,8 @@ SYSDIR?=${.CURDIR}/../..
SUBDIR= if_cxgbe
SUBDIR+= if_cxl
+SUBDIR+= if_cxgbev
+SUBDIR+= if_cxlv
SUBDIR+= t4_firmware
SUBDIR+= t5_firmware
SUBDIR+= ${_tom}
diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile
index 967683b..a86b145 100644
--- a/sys/modules/cxgbe/if_cxgbe/Makefile
+++ b/sys/modules/cxgbe/if_cxgbe/Makefile
@@ -13,8 +13,10 @@ SRCS+= opt_inet.h
SRCS+= opt_inet6.h
SRCS+= opt_ofed.h
SRCS+= opt_rss.h
-SRCS+= pci_if.h
+SRCS+= pci_if.h pci_iov_if.h
+SRCS+= t4_if.c t4_if.h
SRCS+= t4_hw.c
+SRCS+= t4_iov.c
SRCS+= t4_l2t.c
SRCS+= t4_main.c
SRCS+= t4_mp_ring.c
diff --git a/sys/modules/cxgbe/if_cxgbev/Makefile b/sys/modules/cxgbe/if_cxgbev/Makefile
new file mode 100644
index 0000000..9c72a7a
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxgbev/Makefile
@@ -0,0 +1,21 @@
+#
+# $FreeBSD$
+#
+
+CXGBE= ${.CURDIR}/../../../dev/cxgbe
+.PATH: ${CXGBE} ${CXGBE}/common
+
+KMOD= if_cxgbev
+SRCS= bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= opt_ofed.h
+SRCS+= opt_rss.h
+SRCS+= pci_if.h pci_iov_if.h
+SRCS+= t4_vf.c
+SRCS+= t4vf_hw.c
+
+CFLAGS+= -I${CXGBE}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cxlv/Makefile b/sys/modules/cxgbe/if_cxlv/Makefile
new file mode 100644
index 0000000..943ea58
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxlv/Makefile
@@ -0,0 +1,11 @@
+#
+# $FreeBSD$
+#
+
+CXGBE= ${.CURDIR}/../../../dev/cxgbe
+.PATH: ${CXGBE}
+
+KMOD= if_cxlv
+SRCS= if_cxlv.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/efirt/Makefile b/sys/modules/efirt/Makefile
new file mode 100644
index 0000000..2dff20d
--- /dev/null
+++ b/sys/modules/efirt/Makefile
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE}
+
+KMOD= efirt
+SRCS= efirt.c
+SRCS+= device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile
index 1620ab9..c22c64c 100644
--- a/sys/modules/opensolaris/Makefile
+++ b/sys/modules/opensolaris/Makefile
@@ -9,6 +9,7 @@ SRCS= opensolaris.c \
opensolaris_cmn_err.c \
opensolaris_kmem.c \
opensolaris_misc.c \
+ opensolaris_proc.c \
opensolaris_sunddi.c
_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 3b723c1..b484191 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -333,7 +333,7 @@ static int bridge_ip_checkbasic(struct mbuf **mp);
#ifdef INET6
static int bridge_ip6_checkbasic(struct mbuf **mp);
#endif /* INET6 */
-static int bridge_fragment(struct ifnet *, struct mbuf *,
+static int bridge_fragment(struct ifnet *, struct mbuf **mp,
struct ether_header *, int, struct llc *);
static void bridge_linkstate(struct ifnet *ifp);
static void bridge_linkcheck(struct bridge_softc *sc);
@@ -1921,6 +1921,7 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m)
m->m_flags &= ~M_VLANTAG;
}
+ M_ASSERTPKTHDR(m); /* We shouldn't transmit mbuf without pkthdr */
if ((err = dst_ifp->if_transmit(dst_ifp, m))) {
m_freem(m0);
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
@@ -3238,10 +3239,12 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
break;
/* check if we need to fragment the packet */
+ /* bridge_fragment generates a mbuf chain of packets */
+ /* that already include eth headers */
if (V_pfil_member && ifp != NULL && dir == PFIL_OUT) {
i = (*mp)->m_pkthdr.len;
if (i > ifp->if_mtu) {
- error = bridge_fragment(ifp, *mp, &eh2, snap,
+ error = bridge_fragment(ifp, mp, &eh2, snap,
&llc1);
return (error);
}
@@ -3480,56 +3483,77 @@ bad:
/*
* bridge_fragment:
*
- * Return a fragmented mbuf chain.
+ * Fragment mbuf chain in multiple packets and prepend ethernet header.
*/
static int
-bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh,
+bridge_fragment(struct ifnet *ifp, struct mbuf **mp, struct ether_header *eh,
int snap, struct llc *llc)
{
- struct mbuf *m0;
+ struct mbuf *m = *mp, *nextpkt = NULL, *mprev = NULL, *mcur = NULL;
struct ip *ip;
int error = -1;
if (m->m_len < sizeof(struct ip) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
- goto out;
+ goto dropit;
ip = mtod(m, struct ip *);
m->m_pkthdr.csum_flags |= CSUM_IP;
error = ip_fragment(ip, &m, ifp->if_mtu, ifp->if_hwassist);
if (error)
- goto out;
+ goto dropit;
- /* walk the chain and re-add the Ethernet header */
- for (m0 = m; m0; m0 = m0->m_nextpkt) {
- if (error == 0) {
- if (snap) {
- M_PREPEND(m0, sizeof(struct llc), M_NOWAIT);
- if (m0 == NULL) {
- error = ENOBUFS;
- continue;
- }
- bcopy(llc, mtod(m0, caddr_t),
- sizeof(struct llc));
- }
- M_PREPEND(m0, ETHER_HDR_LEN, M_NOWAIT);
- if (m0 == NULL) {
+ /*
+ * Walk the chain and re-add the Ethernet header for
+ * each mbuf packet.
+ */
+ for (mcur = m; mcur; mcur = mcur->m_nextpkt) {
+ nextpkt = mcur->m_nextpkt;
+ mcur->m_nextpkt = NULL;
+ if (snap) {
+ M_PREPEND(mcur, sizeof(struct llc), M_NOWAIT);
+ if (mcur == NULL) {
error = ENOBUFS;
- continue;
+ if (mprev != NULL)
+ mprev->m_nextpkt = nextpkt;
+ goto dropit;
}
- bcopy(eh, mtod(m0, caddr_t), ETHER_HDR_LEN);
- } else
- m_freem(m);
- }
+ bcopy(llc, mtod(mcur, caddr_t),sizeof(struct llc));
+ }
+
+ M_PREPEND(mcur, ETHER_HDR_LEN, M_NOWAIT);
+ if (mcur == NULL) {
+ error = ENOBUFS;
+ if (mprev != NULL)
+ mprev->m_nextpkt = nextpkt;
+ goto dropit;
+ }
+ bcopy(eh, mtod(mcur, caddr_t), ETHER_HDR_LEN);
- if (error == 0)
- KMOD_IPSTAT_INC(ips_fragmented);
+ /*
+ * The previous two M_PREPEND could have inserted one or two
+ * mbufs in front so we have to update the previous packet's
+ * m_nextpkt.
+ */
+ mcur->m_nextpkt = nextpkt;
+ if (mprev != NULL)
+ mprev->m_nextpkt = mcur;
+ else {
+ /* The first mbuf in the original chain needs to be
+ * updated. */
+ *mp = mcur;
+ }
+ mprev = mcur;
+ }
+ KMOD_IPSTAT_INC(ips_fragmented);
return (error);
-out:
- if (m != NULL)
- m_freem(m);
+dropit:
+ for (mcur = *mp; mcur; mcur = m) { /* droping the full packet chain */
+ m = mcur->m_nextpkt;
+ m_freem(mcur);
+ }
return (error);
}
diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h
index 61fd0c1..5423e1f 100644
--- a/sys/netinet/tcp_fsm.h
+++ b/sys/netinet/tcp_fsm.h
@@ -73,7 +73,8 @@
#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED)
#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED)
-#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT)
+#define TCPS_HAVERCVDFIN(s) \
+ ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2))
#ifdef TCPOUTFLAGS
/*
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 6b6c92e..eea44a8 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -734,36 +734,19 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
goto badcode;
if (icmp6len < sizeof(struct nd_router_solicit))
goto badlen;
- if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) {
- /* give up local */
-
- /* Send incoming SeND packet to user space. */
- if (send_sendso_input_hook != NULL) {
- IP6_EXTHDR_CHECK(m, off,
- icmp6len, IPPROTO_DONE);
- error = send_sendso_input_hook(m, ifp,
- SND_IN, ip6len);
- /* -1 == no app on SEND socket */
- if (error == 0)
- return (IPPROTO_DONE);
- nd6_rs_input(m, off, icmp6len);
- } else
- nd6_rs_input(m, off, icmp6len);
- m = NULL;
- goto freeit;
- }
if (send_sendso_input_hook != NULL) {
- IP6_EXTHDR_CHECK(n, off,
- icmp6len, IPPROTO_DONE);
- error = send_sendso_input_hook(n, ifp,
- SND_IN, ip6len);
- if (error == 0)
+ IP6_EXTHDR_CHECK(m, off, icmp6len, IPPROTO_DONE);
+ error = send_sendso_input_hook(m, ifp, SND_IN, ip6len);
+ if (error == 0) {
+ m = NULL;
goto freeit;
- /* -1 == no app on SEND socket */
- nd6_rs_input(n, off, icmp6len);
- } else
- nd6_rs_input(n, off, icmp6len);
- /* m stays. */
+ }
+ }
+ n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+ nd6_rs_input(m, off, icmp6len);
+ m = n;
+ if (m == NULL)
+ goto freeit;
break;
case ND_ROUTER_ADVERT:
@@ -772,29 +755,18 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
goto badcode;
if (icmp6len < sizeof(struct nd_router_advert))
goto badlen;
- if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) {
-
- /* Send incoming SeND-protected/ND packet to user space. */
- if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(m, ifp,
- SND_IN, ip6len);
- if (error == 0)
- return (IPPROTO_DONE);
- nd6_ra_input(m, off, icmp6len);
- } else
- nd6_ra_input(m, off, icmp6len);
- m = NULL;
- goto freeit;
- }
if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(n, ifp,
- SND_IN, ip6len);
- if (error == 0)
+ error = send_sendso_input_hook(m, ifp, SND_IN, ip6len);
+ if (error == 0) {
+ m = NULL;
goto freeit;
- nd6_ra_input(n, off, icmp6len);
- } else
- nd6_ra_input(n, off, icmp6len);
- /* m stays. */
+ }
+ }
+ n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+ nd6_ra_input(m, off, icmp6len);
+ m = n;
+ if (m == NULL)
+ goto freeit;
break;
case ND_NEIGHBOR_SOLICIT:
@@ -803,27 +775,18 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
goto badcode;
if (icmp6len < sizeof(struct nd_neighbor_solicit))
goto badlen;
- if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) {
- if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(m, ifp,
- SND_IN, ip6len);
- if (error == 0)
- return (IPPROTO_DONE);
- nd6_ns_input(m, off, icmp6len);
- } else
- nd6_ns_input(m, off, icmp6len);
- m = NULL;
- goto freeit;
- }
if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(n, ifp,
- SND_IN, ip6len);
- if (error == 0)
+ error = send_sendso_input_hook(m, ifp, SND_IN, ip6len);
+ if (error == 0) {
+ m = NULL;
goto freeit;
- nd6_ns_input(n, off, icmp6len);
- } else
- nd6_ns_input(n, off, icmp6len);
- /* m stays. */
+ }
+ }
+ n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+ nd6_ns_input(m, off, icmp6len);
+ m = n;
+ if (m == NULL)
+ goto freeit;
break;
case ND_NEIGHBOR_ADVERT:
@@ -832,29 +795,18 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
goto badcode;
if (icmp6len < sizeof(struct nd_neighbor_advert))
goto badlen;
- if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) {
-
- /* Send incoming SeND-protected/ND packet to user space. */
- if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(m, ifp,
- SND_IN, ip6len);
- if (error == 0)
- return (IPPROTO_DONE);
- nd6_na_input(m, off, icmp6len);
- } else
- nd6_na_input(m, off, icmp6len);
- m = NULL;
- goto freeit;
- }
if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(n, ifp,
- SND_IN, ip6len);
- if (error == 0)
+ error = send_sendso_input_hook(m, ifp, SND_IN, ip6len);
+ if (error == 0) {
+ m = NULL;
goto freeit;
- nd6_na_input(n, off, icmp6len);
- } else
- nd6_na_input(n, off, icmp6len);
- /* m stays. */
+ }
+ }
+ n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+ nd6_na_input(m, off, icmp6len);
+ m = n;
+ if (m == NULL)
+ goto freeit;
break;
case ND_REDIRECT:
@@ -863,27 +815,18 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
goto badcode;
if (icmp6len < sizeof(struct nd_redirect))
goto badlen;
- if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) {
- if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(m, ifp,
- SND_IN, ip6len);
- if (error == 0)
- return (IPPROTO_DONE);
- icmp6_redirect_input(m, off);
- } else
- icmp6_redirect_input(m, off);
- m = NULL;
- goto freeit;
- }
if (send_sendso_input_hook != NULL) {
- error = send_sendso_input_hook(n, ifp,
- SND_IN, ip6len);
- if (error == 0)
+ error = send_sendso_input_hook(m, ifp, SND_IN, ip6len);
+ if (error == 0) {
+ m = NULL;
goto freeit;
- icmp6_redirect_input(n, off);
- } else
- icmp6_redirect_input(n, off);
- /* m stays. */
+ }
+ }
+ n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+ icmp6_redirect_input(m, off);
+ m = n;
+ if (m == NULL)
+ goto freeit;
break;
case ICMP6_ROUTER_RENUMBERING:
@@ -2203,7 +2146,7 @@ icmp6_reflect(struct mbuf *m, size_t off)
* that we do not own. Select a source address based on the
* source address of the erroneous packet.
*/
- in6_splitscope(&ip6->ip6_dst, &dst6, &scopeid);
+ in6_splitscope(&ip6->ip6_src, &dst6, &scopeid);
error = in6_selectsrc_addr(RT_DEFAULT_FIB, &dst6,
scopeid, NULL, &src6, &hlim);
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 4191782..2075db6 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -630,7 +630,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
/* relate the address to the prefix */
if (ia->ia6_ndpr == NULL) {
ia->ia6_ndpr = pr;
- pr->ndpr_refcnt++;
+ pr->ndpr_addrcnt++;
/*
* If this is the first autoconf address from the
@@ -638,7 +638,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
* (when required).
*/
if ((ia->ia6_flags & IN6_IFF_AUTOCONF) &&
- V_ip6_use_tempaddr && pr->ndpr_refcnt == 1) {
+ V_ip6_use_tempaddr && pr->ndpr_addrcnt == 1) {
int e;
if ((e = in6_tmpifadd(ia, 1, 0)) != 0) {
log(LOG_NOTICE, "in6_control: failed "
@@ -690,11 +690,11 @@ aifaddr_out:
* and the prefix management. We do this, however, to provide
* as much backward compatibility as possible in terms of
* the ioctl operation.
- * Note that in6_purgeaddr() will decrement ndpr_refcnt.
+ * Note that in6_purgeaddr() will decrement ndpr_addrcnt.
*/
pr = ia->ia6_ndpr;
in6_purgeaddr(&ia->ia_ifa);
- if (pr && pr->ndpr_refcnt == 0)
+ if (pr && pr->ndpr_addrcnt == 0)
prelist_remove(pr);
EVENTHANDLER_INVOKE(ifaddr_event, ifp);
break;
@@ -1305,9 +1305,9 @@ in6_unlink_ifa(struct in6_ifaddr *ia, struct ifnet *ifp)
"in6_unlink_ifa: autoconf'ed address "
"%s has no prefix\n", ip6_sprintf(ip6buf, IA6_IN6(ia))));
} else {
- ia->ia6_ndpr->ndpr_refcnt--;
+ ia->ia6_ndpr->ndpr_addrcnt--;
/* Do not delete lles within prefix if refcont != 0 */
- if (ia->ia6_ndpr->ndpr_refcnt == 0)
+ if (ia->ia6_ndpr->ndpr_addrcnt == 0)
remove_lle = 1;
ia->ia6_ndpr = NULL;
}
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 3decb70..ef9e374 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1159,7 +1159,7 @@ nd6_purge(struct ifnet *ifp)
* still be above zero. We therefore reset it to
* make sure that the prefix really gets purged.
*/
- pr->ndpr_refcnt = 0;
+ pr->ndpr_addrcnt = 0;
prelist_remove(pr);
}
@@ -2674,7 +2674,7 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS)
else
p.expire = maxexpire;
}
- p.refcnt = pr->ndpr_refcnt;
+ p.refcnt = pr->ndpr_addrcnt;
p.flags = pr->ndpr_stateflags;
p.advrtrs = 0;
LIST_FOREACH(pfr, &pr->ndpr_advrtrs, pfr_entry)
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 33ac438..24dbef5 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -275,7 +275,7 @@ struct nd_prefix {
/* list of routers that advertise the prefix: */
LIST_HEAD(pr_rtrhead, nd_pfxrouter) ndpr_advrtrs;
u_char ndpr_plen;
- int ndpr_refcnt; /* reference couter from addresses */
+ int ndpr_addrcnt; /* count of derived addresses */
};
#define ndpr_raf ndpr_flags
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 8f19406..c9c7056 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1053,7 +1053,7 @@ prelist_remove(struct nd_prefix *pr)
/* what should we do? */
}
- if (pr->ndpr_refcnt > 0)
+ if (pr->ndpr_addrcnt > 0)
return; /* notice here? */
/* unlink ndpr_entry from nd_prefix list */
@@ -1356,7 +1356,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
/*
* note that we should use pr (not new) for reference.
*/
- pr->ndpr_refcnt++;
+ pr->ndpr_addrcnt++;
ia6->ia6_ndpr = pr;
/*
@@ -2114,7 +2114,7 @@ in6_tmpifadd(const struct in6_ifaddr *ia0, int forcegen, int delay)
return (EINVAL); /* XXX */
}
newia->ia6_ndpr = ia0->ia6_ndpr;
- newia->ia6_ndpr->ndpr_refcnt++;
+ newia->ia6_ndpr->ndpr_addrcnt++;
ifa_free(&newia->ia_ifa);
/*
diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c
index 315da74..a80d1e5 100644
--- a/sys/netpfil/ipfw/ip_fw2.c
+++ b/sys/netpfil/ipfw/ip_fw2.c
@@ -2691,6 +2691,7 @@ ipfw_init(void)
default_fw_tables = IPFW_TABLES_MAX;
ipfw_init_sopt_handler();
+ ipfw_init_obj_rewriter();
ipfw_iface_init();
return (error);
}
@@ -2704,6 +2705,7 @@ ipfw_destroy(void)
ipfw_iface_destroy();
ipfw_destroy_sopt_handler();
+ ipfw_destroy_obj_rewriter();
printf("IP firewall unloaded\n");
}
@@ -2738,7 +2740,6 @@ vnet_ipfw_init(const void *unused)
/* Init shared services hash table */
ipfw_init_srv(chain);
- ipfw_init_obj_rewriter();
ipfw_init_counters();
/* insert the default rule and create the initial map */
chain->n_rules = 1;
@@ -2845,7 +2846,6 @@ vnet_ipfw_uninit(const void *unused)
IPFW_LOCK_DESTROY(chain);
ipfw_dyn_uninit(1); /* free the remaining parts */
ipfw_destroy_counters();
- ipfw_destroy_obj_rewriter();
return (0);
}
diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES
index fbceea7..553dee5 100644
--- a/sys/powerpc/conf/NOTES
+++ b/sys/powerpc/conf/NOTES
@@ -77,6 +77,7 @@ device adm1030 # Apple G4 MDD fan controller
nodevice bktr
nodevice cxgbe # XXX: builds on powerpc64 only.
+nodevice cxgbev
nodevice fdc
nodevice ppc
nodevice splash
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 21800dd..0f06fd1 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -2106,6 +2106,8 @@ pmap_page_is_mapped(vm_page_t m)
return (rv);
}
+#define PMAP_TS_REFERENCED_MAX 5
+
/*
* Return a count of reference bits for a page, clearing those bits.
* It is not necessary for every reference bit to be cleared, but it
@@ -2115,6 +2117,14 @@ pmap_page_is_mapped(vm_page_t m)
* XXX: The exact number of bits to check and clear is a matter that
* should be tested and standardized at some point in the future for
* optimal aging of shared pages.
+ *
+ * As an optimization, update the page's dirty field if a modified bit is
+ * found while counting reference bits. This opportunistic update can be
+ * performed at low cost and can eliminate the need for some future calls
+ * to pmap_is_modified(). However, since this function stops after
+ * finding PMAP_TS_REFERENCED_MAX reference bits, it may not detect some
+ * dirty pages. Those dirty pages will only be detected by a future call
+ * to pmap_is_modified().
*/
int
pmap_ts_referenced(vm_page_t m)
@@ -2138,7 +2148,10 @@ pmap_ts_referenced(vm_page_t m)
if ((tp->tte_data & TD_PV) == 0)
continue;
data = atomic_clear_long(&tp->tte_data, TD_REF);
- if ((data & TD_REF) != 0 && ++count > 4)
+ if ((data & TD_W) != 0)
+ vm_page_dirty(m);
+ if ((data & TD_REF) != 0 && ++count >=
+ PMAP_TS_REFERENCED_MAX)
break;
} while ((tp = tpn) != NULL && tp != tpf);
}
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 1d5f683..e6091a5 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -117,6 +117,7 @@ struct devreq {
#define DEV_SUSPEND _IOW('D', 5, struct devreq)
#define DEV_RESUME _IOW('D', 6, struct devreq)
#define DEV_SET_DRIVER _IOW('D', 7, struct devreq)
+#define DEV_CLEAR_DRIVER _IOW('D', 8, struct devreq)
#define DEV_RESCAN _IOW('D', 9, struct devreq)
#define DEV_DELETE _IOW('D', 10, struct devreq)
@@ -126,6 +127,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. */
+
/* Flags for DEV_DELETE. */
#define DEVF_FORCE_DELETE 0x0000001
diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h
index 8720166..0675100 100644
--- a/sys/sys/capsicum.h
+++ b/sys/sys/capsicum.h
@@ -368,6 +368,8 @@ int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd);
int cap_fcntl_check_fde(struct filedescent *fde, int cmd);
int cap_fcntl_check(struct filedesc *fdp, int fd, int cmd);
+extern int trap_enotcap;
+
#else /* !_KERNEL */
__BEGIN_DECLS
diff --git a/sys/sys/clock.h b/sys/sys/clock.h
index b484bc8..f1809db 100644
--- a/sys/sys/clock.h
+++ b/sys/sys/clock.h
@@ -54,6 +54,7 @@
*/
extern int tz_minuteswest;
extern int tz_dsttime;
+extern struct mtx resettodr_lock;
int utc_offset(void);
diff --git a/sys/sys/efi.h b/sys/sys/efi.h
index 2d73d89..50f4abe 100644
--- a/sys/sys/efi.h
+++ b/sys/sys/efi.h
@@ -30,6 +30,7 @@
#define _SYS_EFI_H_
#include <sys/uuid.h>
+#include <machine/efi.h>
#define EFI_PAGE_SHIFT 12
#define EFI_PAGE_SIZE (1 << EFI_PAGE_SHIFT)
@@ -118,22 +119,25 @@ struct efi_tblhdr {
struct efi_rt {
struct efi_tblhdr rt_hdr;
- efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *);
- efi_status (*rt_settime)(struct efi_tm *);
+ efi_status (*rt_gettime)(struct efi_tm *, struct efi_tmcap *)
+ EFIABI_ATTR;
+ efi_status (*rt_settime)(struct efi_tm *) EFIABI_ATTR;
efi_status (*rt_getwaketime)(uint8_t *, uint8_t *,
- struct efi_tm *);
- efi_status (*rt_setwaketime)(uint8_t, struct efi_tm *);
+ struct efi_tm *) EFIABI_ATTR;
+ efi_status (*rt_setwaketime)(uint8_t, struct efi_tm *)
+ EFIABI_ATTR;
efi_status (*rt_setvirtual)(u_long, u_long, uint32_t,
- struct efi_md *);
- efi_status (*rt_cvtptr)(u_long, void **);
+ struct efi_md *) EFIABI_ATTR;
+ efi_status (*rt_cvtptr)(u_long, void **) EFIABI_ATTR;
efi_status (*rt_getvar)(efi_char *, struct uuid *, uint32_t *,
- u_long *, void *);
- efi_status (*rt_scanvar)(u_long *, efi_char *, struct uuid *);
+ u_long *, void *) EFIABI_ATTR;
+ efi_status (*rt_scanvar)(u_long *, efi_char *, struct uuid *)
+ EFIABI_ATTR;
efi_status (*rt_setvar)(efi_char *, struct uuid *, uint32_t,
- u_long, void *);
- efi_status (*rt_gethicnt)(uint32_t *);
+ u_long, void *) EFIABI_ATTR;
+ efi_status (*rt_gethicnt)(uint32_t *) EFIABI_ATTR;
efi_status (*rt_reset)(enum efi_reset, efi_status, u_long,
- efi_char *);
+ efi_char *) EFIABI_ATTR;
};
struct efi_systbl {
@@ -154,5 +158,8 @@ struct efi_systbl {
uint64_t st_cfgtbl;
};
-extern vm_paddr_t efi_systbl;
+#ifdef _KERNEL
+extern vm_paddr_t efi_systbl_phys;
+#endif /* _KERNEL */
+
#endif /* _SYS_EFI_H_ */
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 6252ad0..ebe8302 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -716,6 +716,7 @@ struct proc {
#define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */
#define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */
#define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not yet handled. */
+#define P2_TRAPCAP 0x00000020 /* SIGTRAP on ENOTCAPABLE */
/* Flags protected by proctree_lock, kept in p_treeflags. */
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */
diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h
index c6f1e94..53bb6ca 100644
--- a/sys/sys/procctl.h
+++ b/sys/sys/procctl.h
@@ -1,8 +1,12 @@
/*-
* Copyright (c) 2013 Hudson River Trading LLC
+ * Copyright (c) 2014, 2016 The FreeBSD Foundation
* Written by: John H. Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -43,6 +47,8 @@
#define PROC_REAP_KILL 6 /* kill descendants */
#define PROC_TRACE_CTL 7 /* en/dis ptrace and coredumps */
#define PROC_TRACE_STATUS 8 /* query tracing status */
+#define PROC_TRAPCAP_CTL 9 /* trap capability errors */
+#define PROC_TRAPCAP_STATUS 10 /* query trap capability status */
/* Operations for PROC_SPROTECT (passed in integer arg). */
#define PPROT_OP(x) ((x) & 0xf)
@@ -102,6 +108,9 @@ struct procctl_reaper_kill {
#define PROC_TRACE_CTL_DISABLE 2
#define PROC_TRACE_CTL_DISABLE_EXEC 3
+#define PROC_TRAPCAP_CTL_ENABLE 1
+#define PROC_TRAPCAP_CTL_DISABLE 2
+
#ifndef _KERNEL
__BEGIN_DECLS
int procctl(idtype_t, id_t, int, void *);
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 86a07e1..a844465 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -291,6 +291,7 @@ typedef struct __siginfo {
#define TRAP_BRKPT 1 /* Process breakpoint. */
#define TRAP_TRACE 2 /* Process trace trap. */
#define TRAP_DTRACE 3 /* DTrace induced trap. */
+#define TRAP_CAP 4 /* Capabilities protective trap. */
/* codes for SIGCHLD */
#define CLD_EXITED 1 /* Child has exited */
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 0e4dc03..fb719cfb 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -163,13 +163,13 @@ ffs_alloc(ip, lbn, bpref, size, flags, cred, bnp)
#endif
*bnp = 0;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
mtx_assert(UFS_MTX(ump), MA_OWNED);
#ifdef INVARIANTS
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = %s, bsize = %ld, size = %d, fs = %s\n",
- devtoname(ip->i_dev), (long)fs->fs_bsize, size,
+ devtoname(ump->um_dev), (long)fs->fs_bsize, size,
fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
@@ -260,9 +260,9 @@ ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, flags, cred, bpp)
int64_t delta;
vp = ITOV(ip);
- fs = ip->i_fs;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
bp = NULL;
- ump = ip->i_ump;
gbflags = (flags & BA_UNMAPPED) != 0 ? GB_UNMAPPED : 0;
mtx_assert(UFS_MTX(ump), MA_OWNED);
@@ -273,7 +273,7 @@ ffs_realloccg(ip, lbprev, bprev, bpref, osize, nsize, flags, cred, bpp)
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
"dev = %s, bsize = %ld, osize = %d, nsize = %d, fs = %s\n",
- devtoname(ip->i_dev), (long)fs->fs_bsize, osize,
+ devtoname(ump->um_dev), (long)fs->fs_bsize, osize,
nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
@@ -288,7 +288,7 @@ retry:
}
if (bprev == 0) {
printf("dev = %s, bsize = %ld, bprev = %jd, fs = %s\n",
- devtoname(ip->i_dev), (long)fs->fs_bsize, (intmax_t)bprev,
+ devtoname(ump->um_dev), (long)fs->fs_bsize, (intmax_t)bprev,
fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
}
@@ -383,7 +383,7 @@ retry:
break;
default:
printf("dev = %s, optim = %ld, fs = %s\n",
- devtoname(ip->i_dev), (long)fs->fs_optim, fs->fs_fsmnt);
+ devtoname(ump->um_dev), (long)fs->fs_optim, fs->fs_fsmnt);
panic("ffs_realloccg: bad optim");
/* NOTREACHED */
}
@@ -391,7 +391,7 @@ retry:
if (bno > 0) {
bp->b_blkno = fsbtodb(fs, bno);
if (!DOINGSOFTDEP(vp))
- ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize,
+ ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize,
ip->i_number, vp->v_type, NULL);
delta = btodb(nsize - osize);
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta);
@@ -490,7 +490,7 @@ ffs_reallocblks(ap)
* These devices are flash and therefore work less well with this
* optimization. Also skip if reallocblks has been disabled globally.
*/
- ump = VTOI(ap->a_vp)->i_ump;
+ ump = ap->a_vp->v_mount->mnt_data;
if (ump->um_candelete || doreallocblks == 0)
return (ENOSPC);
@@ -529,8 +529,8 @@ ffs_reallocblks_ufs1(ap)
vp = ap->a_vp;
ip = VTOI(vp);
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
/*
* If we are not tracking block clusters or if we have less than 4%
* free blocks left, then do not attempt to cluster. Running with
@@ -727,7 +727,7 @@ ffs_reallocblks_ufs1(ap)
#endif
for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) {
if (!DOINGSOFTDEP(vp))
- ffs_blkfree(ump, fs, ip->i_devvp,
+ ffs_blkfree(ump, fs, ump->um_devvp,
dbtofsb(fs, buflist->bs_children[i]->b_blkno),
fs->fs_bsize, ip->i_number, vp->v_type, NULL);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
@@ -778,8 +778,8 @@ ffs_reallocblks_ufs2(ap)
vp = ap->a_vp;
ip = VTOI(vp);
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
/*
* If we are not tracking block clusters or if we have less than 4%
* free blocks left, then do not attempt to cluster. Running with
@@ -975,7 +975,7 @@ ffs_reallocblks_ufs2(ap)
#endif
for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) {
if (!DOINGSOFTDEP(vp))
- ffs_blkfree(ump, fs, ip->i_devvp,
+ ffs_blkfree(ump, fs, ump->um_devvp,
dbtofsb(fs, buflist->bs_children[i]->b_blkno),
fs->fs_bsize, ip->i_number, vp->v_type, NULL);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
@@ -1040,8 +1040,8 @@ ffs_valloc(pvp, mode, cred, vpp)
*vpp = NULL;
pip = VTOI(pvp);
- fs = pip->i_fs;
- ump = pip->i_ump;
+ ump = ITOUMP(pip);
+ fs = ump->um_fs;
UFS_LOCK(ump);
reclaimed = 0;
@@ -1114,10 +1114,12 @@ dup_alloc:
ip->i_flag = 0;
(*vpp)->v_vflag = 0;
(*vpp)->v_type = VNON;
- if (fs->fs_magic == FS_UFS2_MAGIC)
+ if (fs->fs_magic == FS_UFS2_MAGIC) {
(*vpp)->v_op = &ffs_vnodeops2;
- else
+ ip->i_flag |= IN_UFS2;
+ } else {
(*vpp)->v_op = &ffs_vnodeops1;
+ }
return (0);
noinodes:
if (reclaimed == 0) {
@@ -1158,8 +1160,8 @@ ffs_dirpref(pip)
u_int mincg, minndir;
u_int maxcontigdirs;
- mtx_assert(UFS_MTX(pip->i_ump), MA_OWNED);
- fs = pip->i_fs;
+ mtx_assert(UFS_MTX(ITOUMP(pip)), MA_OWNED);
+ fs = ITOFS(pip);
avgifree = fs->fs_cstotal.cs_nifree / fs->fs_ncg;
avgbfree = fs->fs_cstotal.cs_nbfree / fs->fs_ncg;
@@ -1307,8 +1309,8 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap)
ufs2_daddr_t pref;
KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap"));
- mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED);
- fs = ip->i_fs;
+ mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED);
+ fs = ITOFS(ip);
/*
* Allocation of indirect blocks is indicated by passing negative
* values in indx: -1 for single indirect, -2 for double indirect,
@@ -1412,8 +1414,8 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap)
ufs2_daddr_t pref;
KASSERT(indx <= 0 || bap != NULL, ("need non-NULL bap"));
- mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED);
- fs = ip->i_fs;
+ mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED);
+ fs = ITOFS(ip);
/*
* Allocation of indirect blocks is indicated by passing negative
* values in indx: -1 for single indirect, -2 for double indirect,
@@ -1526,12 +1528,12 @@ ffs_hashalloc(ip, cg, pref, size, rsize, allocator)
ufs2_daddr_t result;
u_int i, icg = cg;
- mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED);
+ mtx_assert(UFS_MTX(ITOUMP(ip)), MA_OWNED);
#ifdef INVARIANTS
if (ITOV(ip)->v_mount->mnt_kern_flag & MNTK_SUSPENDED)
panic("ffs_hashalloc: allocation on suspended filesystem");
#endif
- fs = ip->i_fs;
+ fs = ITOFS(ip);
/*
* 1: preferred cylinder group
*/
@@ -1589,8 +1591,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsize)
int i, error;
u_int8_t *blksfree;
- ump = ip->i_ump;
- fs = ip->i_fs;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
if (fs->fs_cs(fs, cg).cs_nffree < numfrags(fs, nsize - osize))
return (0);
frags = numfrags(fs, nsize);
@@ -1600,8 +1602,8 @@ ffs_fragextend(ip, cg, bprev, osize, nsize)
return (0);
}
UFS_UNLOCK(ump);
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
- (int)fs->fs_cgsize, NOCRED, &bp);
+ error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)),
+ (int)fs->fs_cgsize, NOCRED, &bp);
if (error)
goto fail;
cgp = (struct cg *)bp->b_data;
@@ -1673,13 +1675,13 @@ ffs_alloccg(ip, cg, bpref, size, rsize)
int i, allocsiz, error, frags;
u_int8_t *blksfree;
- ump = ip->i_ump;
- fs = ip->i_fs;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
if (fs->fs_cs(fs, cg).cs_nbfree == 0 && size == fs->fs_bsize)
return (0);
UFS_UNLOCK(ump);
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
- (int)fs->fs_cgsize, NOCRED, &bp);
+ error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)),
+ (int)fs->fs_cgsize, NOCRED, &bp);
if (error)
goto fail;
cgp = (struct cg *)bp->b_data;
@@ -1775,8 +1777,8 @@ ffs_alloccgblk(ip, bp, bpref, size)
u_int8_t *blksfree;
int i, cgbpref;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
mtx_assert(UFS_MTX(ump), MA_OWNED);
cgp = (struct cg *)bp->b_data;
blksfree = cg_blksfree(cgp);
@@ -1861,12 +1863,12 @@ ffs_clusteralloc(ip, cg, bpref, len)
int32_t *lp;
u_int8_t *blksfree;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
if (fs->fs_maxcluster[cg] < len)
return (0);
UFS_UNLOCK(ump);
- if (bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize,
+ if (bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize,
NOCRED, &bp))
goto fail_lock;
cgp = (struct cg *)bp->b_data;
@@ -1965,8 +1967,8 @@ getinobuf(struct inode *ip, u_int cg, u_int32_t cginoblk, int gbflags)
{
struct fs *fs;
- fs = ip->i_fs;
- return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs,
+ fs = ITOFS(ip);
+ return (getblk(ITODEVVP(ip), fsbtodb(fs, ino_to_fsba(fs,
cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0,
gbflags));
}
@@ -1997,13 +1999,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unused)
int error, start, len, i;
u_int32_t old_initediblk;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
check_nifree:
if (fs->fs_cs(fs, cg).cs_nifree == 0)
return (0);
UFS_UNLOCK(ump);
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
+ error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NOCRED, &bp);
if (error) {
brelse(bp);
@@ -2101,7 +2103,7 @@ gotit:
* to it, then leave it unchanged as the other thread
* has already set it correctly.
*/
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
+ error = bread(ump->um_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NOCRED, &bp);
UFS_LOCK(ump);
ACTIVECLEAR(fs, cg);
@@ -2166,14 +2168,16 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
cg = dtog(fs, bno);
if (devvp->v_type == VREG) {
/* devvp is a snapshot */
- dev = VTOI(devvp)->i_devvp->v_rdev;
+ MPASS(devvp->v_mount->mnt_data == ump);
+ dev = ump->um_devvp->v_rdev;
cgblkno = fragstoblks(fs, cgtod(fs, cg));
- } else {
+ } else if (devvp->v_type == VCHR) {
/* devvp is a normal disk device */
dev = devvp->v_rdev;
cgblkno = fsbtodb(fs, cgtod(fs, cg));
ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg");
- }
+ } else
+ return;
#ifdef INVARIANTS
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
fragnum(fs, bno) + numfrags(fs, size) > fs->fs_frag) {
@@ -2267,7 +2271,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
ACTIVECLEAR(fs, cg);
UFS_UNLOCK(ump);
mp = UFSTOVFS(ump);
- if (MOUNTEDSOFTDEP(mp) && devvp->v_type != VREG)
+ if (MOUNTEDSOFTDEP(mp) && devvp->v_type == VCHR)
softdep_setup_blkfree(UFSTOVFS(ump), bp, bno,
numfrags(fs, size), dephd);
bdwrite(bp);
@@ -2332,7 +2336,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd)
* it has a snapshot(s) associated with it, and one of the
* snapshots wants to claim the block.
*/
- if (devvp->v_type != VREG &&
+ if (devvp->v_type == VCHR &&
(devvp->v_vflag & VV_COPYONWRITE) &&
ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, dephd)) {
return;
@@ -2396,7 +2400,7 @@ ffs_checkblk(ip, bno, size)
int i, error, frags, free;
u_int8_t *blksfree;
- fs = ip->i_fs;
+ fs = ITOFS(ip);
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("bsize = %ld, size = %ld, fs = %s\n",
(long)fs->fs_bsize, size, fs->fs_fsmnt);
@@ -2404,7 +2408,7 @@ ffs_checkblk(ip, bno, size)
}
if ((u_int)bno >= fs->fs_size)
panic("ffs_checkblk: bad block %jd", (intmax_t)bno);
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))),
+ error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, dtog(fs, bno))),
(int)fs->fs_cgsize, NOCRED, &bp);
if (error)
panic("ffs_checkblk: cg bread failed");
@@ -2438,6 +2442,7 @@ ffs_vfree(pvp, ino, mode)
ino_t ino;
int mode;
{
+ struct ufsmount *ump;
struct inode *ip;
if (DOINGSOFTDEP(pvp)) {
@@ -2445,8 +2450,8 @@ ffs_vfree(pvp, ino, mode)
return (0);
}
ip = VTOI(pvp);
- return (ffs_freefile(ip->i_ump, ip->i_fs, ip->i_devvp, ino, mode,
- NULL));
+ ump = VFSTOUFS(pvp->v_mount);
+ return (ffs_freefile(ump, ump->um_fs, ump->um_devvp, ino, mode, NULL));
}
/*
@@ -2473,12 +2478,16 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd)
cg = ino_to_cg(fs, ino);
if (devvp->v_type == VREG) {
/* devvp is a snapshot */
- dev = VTOI(devvp)->i_devvp->v_rdev;
+ MPASS(devvp->v_mount->mnt_data == ump);
+ dev = ump->um_devvp->v_rdev;
cgbno = fragstoblks(fs, cgtod(fs, cg));
- } else {
+ } else if (devvp->v_type == VCHR) {
/* devvp is a normal disk device */
dev = devvp->v_rdev;
cgbno = fsbtodb(fs, cgtod(fs, cg));
+ } else {
+ bp = NULL;
+ return (0);
}
if (ino >= fs->fs_ipg * fs->fs_ncg)
panic("ffs_freefile: range: dev = %s, ino = %ju, fs = %s",
@@ -2517,7 +2526,7 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd)
fs->fs_fmod = 1;
ACTIVECLEAR(fs, cg);
UFS_UNLOCK(ump);
- if (MOUNTEDSOFTDEP(UFSTOVFS(ump)) && devvp->v_type != VREG)
+ if (MOUNTEDSOFTDEP(UFSTOVFS(ump)) && devvp->v_type == VCHR)
softdep_setup_inofree(UFSTOVFS(ump), bp,
ino + cg * fs->fs_ipg, wkhd);
bdwrite(bp);
@@ -2544,9 +2553,11 @@ ffs_checkfreefile(fs, devvp, ino)
if (devvp->v_type == VREG) {
/* devvp is a snapshot */
cgbno = fragstoblks(fs, cgtod(fs, cg));
- } else {
+ } else if (devvp->v_type == VCHR) {
/* devvp is a normal disk device */
cgbno = fsbtodb(fs, cgtod(fs, cg));
+ } else {
+ return (1);
}
if (ino >= fs->fs_ipg * fs->fs_ncg)
return (1);
@@ -3056,7 +3067,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
break;
AUDIT_ARG_VNODE1(vp);
ip = VTOI(vp);
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
error = copyin((void *)(intptr_t)cmd.size, ip->i_din1,
sizeof(struct ufs1_dinode));
else
@@ -3076,7 +3087,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
error = EPERM;
break;
}
- if (VTOI(vp)->i_ump != ump) {
+ if (ITOUMP(VTOI(vp)) != ump) {
error = EINVAL;
break;
}
@@ -3173,11 +3184,11 @@ buffered_write(fp, uio, active_cred, flags, td)
return (EINVAL);
}
ip = VTOI(vp);
- if (ip->i_devvp != devvp) {
+ if (ITODEVVP(ip) != devvp) {
vput(vp);
return (EINVAL);
}
- fs = ip->i_fs;
+ fs = ITOFS(ip);
vput(vp);
foffset_lock_uio(fp, uio, flags);
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c
index 04e0ae9..64211d9 100644
--- a/sys/ufs/ffs/ffs_balloc.c
+++ b/sys/ufs/ffs/ffs_balloc.c
@@ -111,8 +111,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
ip = VTOI(vp);
dp = ip->i_din1;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ fs = ITOFS(ip);
+ ump = ITOUMP(ip);
lbn = lblkno(fs, startoffset);
size = blkoff(fs, startoffset) + size;
reclaimed = 0;
@@ -548,7 +548,7 @@ fail:
}
lbns_remfree++;
#endif
- ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
+ ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize,
ip->i_number, vp->v_type, NULL);
}
return (error);
@@ -584,8 +584,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
ip = VTOI(vp);
dp = ip->i_din2;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ fs = ITOFS(ip);
+ ump = ITOUMP(ip);
lbn = lblkno(fs, startoffset);
size = blkoff(fs, startoffset) + size;
reclaimed = 0;
@@ -1143,7 +1143,7 @@ fail:
}
lbns_remfree++;
#endif
- ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
+ ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize,
ip->i_number, vp->v_type, NULL);
}
return (error);
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 50b456b..f6f0eb1 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -92,8 +92,8 @@ ffs_update(vp, waitfor)
if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0)
return (0);
ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
- fs = ip->i_fs;
- if (fs->fs_ronly && ip->i_ump->um_fsckpid == 0)
+ fs = ITOFS(ip);
+ if (fs->fs_ronly && ITOUMP(ip)->um_fsckpid == 0)
return (0);
/*
* If we are updating a snapshot and another process is currently
@@ -110,7 +110,7 @@ ffs_update(vp, waitfor)
if (IS_SNAPSHOT(ip))
flags = GB_LOCK_NOWAIT;
loop:
- error = breadn_flags(ip->i_devvp,
+ error = breadn_flags(ITODEVVP(ip),
fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
(int) fs->fs_bsize, 0, 0, 0, NOCRED, flags, &bp);
if (error != 0) {
@@ -143,7 +143,7 @@ loop:
softdep_update_inodeblock(ip, bp, waitfor);
else if (ip->i_effnlink != ip->i_nlink)
panic("ffs_update: bad link cnt");
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
*((struct ufs1_dinode *)bp->b_data +
ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1;
/* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */
@@ -197,8 +197,8 @@ ffs_truncate(vp, length, flags, cred)
off_t osize;
ip = VTOI(vp);
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = VFSTOUFS(vp->v_mount);
+ fs = ump->um_fs;
bo = &vp->v_bufobj;
ASSERT_VOP_LOCKED(vp, "ffs_truncate");
@@ -269,7 +269,7 @@ ffs_truncate(vp, length, flags, cred)
for (i = 0; i < NXADDR; i++) {
if (oldblks[i] == 0)
continue;
- ffs_blkfree(ump, fs, ip->i_devvp, oldblks[i],
+ ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i],
sblksize(fs, osize, i), ip->i_number,
vp->v_type, NULL);
}
@@ -345,7 +345,7 @@ ffs_truncate(vp, length, flags, cred)
if (error)
return (error);
indiroff = (lbn - NDADDR) % NINDIR(fs);
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
blkno = ((ufs1_daddr_t *)(bp->b_data))[indiroff];
else
blkno = ((ufs2_daddr_t *)(bp->b_data))[indiroff];
@@ -517,7 +517,7 @@ ffs_truncate(vp, length, flags, cred)
blocksreleased += count;
if (lastiblock[level] < 0) {
DIP_SET(ip, i_ib[level], 0);
- ffs_blkfree(ump, fs, ip->i_devvp, bn,
+ ffs_blkfree(ump, fs, ump->um_devvp, bn,
fs->fs_bsize, ip->i_number,
vp->v_type, NULL);
blocksreleased += nblocks;
@@ -538,7 +538,7 @@ ffs_truncate(vp, length, flags, cred)
continue;
DIP_SET(ip, i_db[i], 0);
bsize = blksize(fs, ip, i);
- ffs_blkfree(ump, fs, ip->i_devvp, bn, bsize, ip->i_number,
+ ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number,
vp->v_type, NULL);
blocksreleased += btodb(bsize);
}
@@ -570,7 +570,7 @@ ffs_truncate(vp, length, flags, cred)
* required for the storage we're keeping.
*/
bn += numfrags(fs, newspace);
- ffs_blkfree(ump, fs, ip->i_devvp, bn,
+ ffs_blkfree(ump, fs, ump->um_devvp, bn,
oldspace - newspace, ip->i_number, vp->v_type, NULL);
blocksreleased += btodb(oldspace - newspace);
}
@@ -629,7 +629,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
ufs2_daddr_t *countp;
{
struct buf *bp;
- struct fs *fs = ip->i_fs;
+ struct fs *fs;
struct vnode *vp;
caddr_t copy = NULL;
int i, nblocks, error = 0, allerror = 0;
@@ -637,7 +637,9 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
ufs2_daddr_t blkcount, factor, blocksreleased = 0;
ufs1_daddr_t *bap1 = NULL;
ufs2_daddr_t *bap2 = NULL;
-# define BAP(ip, i) (((ip)->i_ump->um_fstype == UFS1) ? bap1[i] : bap2[i])
+#define BAP(ip, i) (I_IS_UFS1(ip) ? bap1[i] : bap2[i])
+
+ fs = ITOFS(ip);
/*
* Calculate index in current block of last
@@ -685,7 +687,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
return (error);
}
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
bap1 = (ufs1_daddr_t *)bp->b_data;
else
bap2 = (ufs2_daddr_t *)bp->b_data;
@@ -693,7 +695,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
copy = malloc(fs->fs_bsize, M_TEMP, M_WAITOK);
bcopy((caddr_t)bp->b_data, copy, (u_int)fs->fs_bsize);
for (i = last + 1; i < NINDIR(fs); i++)
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
bap1[i] = 0;
else
bap2[i] = 0;
@@ -704,7 +706,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
if (error)
allerror = error;
}
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
bap1 = (ufs1_daddr_t *)copy;
else
bap2 = (ufs2_daddr_t *)copy;
@@ -724,7 +726,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
allerror = error;
blocksreleased += blkcount;
}
- ffs_blkfree(ip->i_ump, fs, ip->i_devvp, nb, fs->fs_bsize,
+ ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize,
ip->i_number, vp->v_type, NULL);
blocksreleased += nblocks;
}
@@ -758,6 +760,6 @@ int
ffs_rdonly(struct inode *ip)
{
- return (ip->i_ump->um_fs->fs_ronly != 0);
+ return (ITOFS(ip)->fs_ronly != 0);
}
diff --git a/sys/ufs/ffs/ffs_rawread.c b/sys/ufs/ffs/ffs_rawread.c
index 84fa0db..e1fc346 100644
--- a/sys/ufs/ffs/ffs_rawread.c
+++ b/sys/ufs/ffs/ffs_rawread.c
@@ -204,7 +204,7 @@ ffs_rawread_readahead(struct vnode *vp,
bsize = vp->v_mount->mnt_stat.f_iosize;
ip = VTOI(vp);
- dp = ip->i_devvp;
+ dp = ITODEVVP(ip);
iolen = ((vm_offset_t) udata) & PAGE_MASK;
bp->b_bcount = len;
@@ -440,7 +440,7 @@ ffs_rawread(struct vnode *vp,
/* Only handle sector aligned reads */
ip = VTOI(vp);
- secsize = ip->i_devvp->v_bufobj.bo_bsize;
+ secsize = ITODEVVP(ip)->v_bufobj.bo_bsize;
if ((uio->uio_offset & (secsize - 1)) == 0 &&
(uio->uio_resid & (secsize - 1)) == 0) {
@@ -460,7 +460,7 @@ ffs_rawread(struct vnode *vp,
}
partialbytes = ((unsigned int) ip->i_size) %
- ip->i_fs->fs_bsize;
+ ITOFS(ip)->fs_bsize;
blockbytes = (int) filebytes - partialbytes;
if (blockbytes > 0) {
skipbytes = uio->uio_resid -
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 5ef439f..a303c8d 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -302,7 +302,7 @@ restart:
vp = nd.ni_vp;
vp->v_vflag |= VV_SYSTEM;
ip = VTOI(vp);
- devvp = ip->i_devvp;
+ devvp = ITODEVVP(ip);
/*
* Allocate and copy the last block contents so as to be able
* to set size to that of the filesystem.
@@ -587,7 +587,7 @@ loop:
}
}
snaplistsize += 1;
- if (xp->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(xp))
error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1,
BLK_NOCOPY, 1);
else
@@ -620,7 +620,7 @@ loop:
goto out1;
}
xp = VTOI(xvp);
- if (xp->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(xp))
error = expunge_ufs1(vp, xp, copy_fs, fullacct_ufs1,
BLK_NOCOPY, 0);
else
@@ -706,7 +706,7 @@ out1:
TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap) {
if (xp == ip)
break;
- if (xp->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(xp))
error = expunge_ufs1(vp, xp, fs, snapacct_ufs1,
BLK_SNAP, 0);
else
@@ -735,7 +735,7 @@ out1:
* blocks marked as used in the snapshot bitmaps. Also, collect
* the list of allocated blocks in i_snapblklist.
*/
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
error = expunge_ufs1(vp, ip, copy_fs, mapacct_ufs1,
BLK_SNAP, 0);
else
@@ -887,9 +887,9 @@ cgaccount(cg, vp, nbp, passno)
int error, len, loc, indiroff;
ip = VTOI(vp);
- fs = ip->i_fs;
- error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
- (int)fs->fs_cgsize, KERNCRED, &bp);
+ fs = ITOFS(ip);
+ error = bread(ITODEVVP(ip), fsbtodb(fs, cgtod(fs, cg)),
+ (int)fs->fs_cgsize, KERNCRED, &bp);
if (error) {
brelse(bp);
return (error);
@@ -899,7 +899,7 @@ cgaccount(cg, vp, nbp, passno)
brelse(bp);
return (EIO);
}
- UFS_LOCK(ip->i_ump);
+ UFS_LOCK(ITOUMP(ip));
ACTIVESET(fs, cg);
/*
* Recomputation of summary information might not have been performed
@@ -908,7 +908,7 @@ cgaccount(cg, vp, nbp, passno)
* fsck is slightly more consistent.
*/
fs->fs_cs(fs, cg) = cgp->cg_cs;
- UFS_UNLOCK(ip->i_ump);
+ UFS_UNLOCK(ITOUMP(ip));
bcopy(bp->b_data, nbp->b_data, fs->fs_cgsize);
if (fs->fs_cgsize < fs->fs_bsize)
bzero(&nbp->b_data[fs->fs_cgsize],
@@ -952,7 +952,7 @@ cgaccount(cg, vp, nbp, passno)
}
indiroff = 0;
}
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
if (ffs_isblock(fs, cg_blksfree(cgp), loc))
((ufs1_daddr_t *)(ibp->b_data))[indiroff] =
BLK_NOCOPY;
@@ -1257,7 +1257,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
*ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
- ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum,
+ ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum,
vp->v_type, NULL);
}
return (0);
@@ -1541,7 +1541,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
*ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
- ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum,
+ ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum,
vp->v_type, NULL);
}
return (0);
@@ -1565,7 +1565,7 @@ ffs_snapgone(ip)
* Find snapshot in incore list.
*/
xp = NULL;
- sn = ip->i_devvp->v_rdev->si_snapdata;
+ sn = ITODEVVP(ip)->v_rdev->si_snapdata;
if (sn != NULL)
TAILQ_FOREACH(xp, &sn->sn_head, i_nextsnap)
if (xp == ip)
@@ -1578,8 +1578,8 @@ ffs_snapgone(ip)
/*
* Delete snapshot inode from superblock. Keep list dense.
*/
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
UFS_LOCK(ump);
for (snaploc = 0; snaploc < FSMAXSNAP; snaploc++)
if (fs->fs_snapinum[snaploc] == ip->i_number)
@@ -1611,8 +1611,8 @@ ffs_snapremove(vp)
struct snapdata *sn;
ip = VTOI(vp);
- fs = ip->i_fs;
- devvp = ip->i_devvp;
+ fs = ITOFS(ip);
+ devvp = ITODEVVP(ip);
/*
* If active, delete from incore list (this snapshot may
* already have been in the process of being deleted, so
@@ -1646,7 +1646,7 @@ ffs_snapremove(vp)
if (dblk == BLK_NOCOPY || dblk == BLK_SNAP)
DIP_SET(ip, i_db[blkno], 0);
else if ((dblk == blkstofrags(fs, blkno) &&
- ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize,
+ ffs_snapblkfree(fs, ITODEVVP(ip), dblk, fs->fs_bsize,
ip->i_number, vp->v_type, NULL))) {
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) -
btodb(fs->fs_bsize));
@@ -1664,14 +1664,14 @@ ffs_snapremove(vp)
else
last = fs->fs_size - blkno;
for (loc = 0; loc < last; loc++) {
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
dblk = ((ufs1_daddr_t *)(ibp->b_data))[loc];
if (dblk == 0)
continue;
if (dblk == BLK_NOCOPY || dblk == BLK_SNAP)
((ufs1_daddr_t *)(ibp->b_data))[loc]= 0;
else if ((dblk == blkstofrags(fs, blkno) &&
- ffs_snapblkfree(fs, ip->i_devvp, dblk,
+ ffs_snapblkfree(fs, ITODEVVP(ip), dblk,
fs->fs_bsize, ip->i_number, vp->v_type,
NULL))) {
ip->i_din1->di_blocks -=
@@ -1686,7 +1686,7 @@ ffs_snapremove(vp)
if (dblk == BLK_NOCOPY || dblk == BLK_SNAP)
((ufs2_daddr_t *)(ibp->b_data))[loc] = 0;
else if ((dblk == blkstofrags(fs, blkno) &&
- ffs_snapblkfree(fs, ip->i_devvp, dblk,
+ ffs_snapblkfree(fs, ITODEVVP(ip), dblk,
fs->fs_bsize, ip->i_number, vp->v_type, NULL))) {
ip->i_din2->di_blocks -= btodb(fs->fs_bsize);
((ufs2_daddr_t *)(ibp->b_data))[loc] = 0;
@@ -1781,7 +1781,7 @@ retry:
if (error)
break;
indiroff = (lbn - NDADDR) % NINDIR(fs);
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff];
else
blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff];
@@ -1806,7 +1806,7 @@ retry:
if (lbn < NDADDR) {
DIP_SET(ip, i_db[lbn], BLK_NOCOPY);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- } else if (ip->i_ump->um_fstype == UFS1) {
+ } else if (I_IS_UFS1(ip)) {
((ufs1_daddr_t *)(ibp->b_data))[indiroff] =
BLK_NOCOPY;
bdwrite(ibp);
@@ -1854,7 +1854,7 @@ retry:
}
if (lbn < NDADDR) {
DIP_SET(ip, i_db[lbn], bno);
- } else if (ip->i_ump->um_fstype == UFS1) {
+ } else if (I_IS_UFS1(ip)) {
((ufs1_daddr_t *)(ibp->b_data))[indiroff] = bno;
bdwrite(ibp);
} else {
@@ -2136,7 +2136,7 @@ ffs_bp_snapblk(devvp, bp)
sn = devvp->v_rdev->si_snapdata;
if (sn == NULL || TAILQ_FIRST(&sn->sn_head) == NULL)
return (0);
- fs = TAILQ_FIRST(&sn->sn_head)->i_fs;
+ fs = ITOFS(TAILQ_FIRST(&sn->sn_head));
lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno));
snapblklist = sn->sn_blklist;
upper = sn->sn_listsize - 1;
@@ -2263,7 +2263,7 @@ ffs_copyonwrite(devvp, bp)
return (0); /* No snapshot */
}
ip = TAILQ_FIRST(&sn->sn_head);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
lbn = fragstoblks(fs, dbtofsb(fs, bp->b_blkno));
snapblklist = sn->sn_blklist;
upper = sn->sn_listsize - 1;
@@ -2337,7 +2337,7 @@ ffs_copyonwrite(devvp, bp)
if (error)
break;
indiroff = (lbn - NDADDR) % NINDIR(fs);
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
blkno=((ufs1_daddr_t *)(ibp->b_data))[indiroff];
else
blkno=((ufs2_daddr_t *)(ibp->b_data))[indiroff];
@@ -2493,15 +2493,19 @@ readblock(vp, bp, lbn)
{
struct inode *ip = VTOI(vp);
struct bio *bip;
+ struct fs *fs;
+
+ ip = VTOI(vp);
+ fs = ITOFS(ip);
bip = g_alloc_bio();
bip->bio_cmd = BIO_READ;
- bip->bio_offset = dbtob(fsbtodb(ip->i_fs, blkstofrags(ip->i_fs, lbn)));
+ bip->bio_offset = dbtob(fsbtodb(fs, blkstofrags(fs, lbn)));
bip->bio_data = bp->b_data;
bip->bio_length = bp->b_bcount;
bip->bio_done = NULL;
- g_io_request(bip, ip->i_devvp->v_bufobj.bo_private);
+ g_io_request(bip, ITODEVVP(ip)->v_bufobj.bo_private);
bp->b_error = biowait(bip, "snaprdb");
g_destroy_bio(bip);
return (bp->b_error);
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 9819cf7..494ec1b 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -3998,7 +3998,7 @@ newjmvref(dp, ino, oldoff, newoff)
struct jmvref *jmvref;
jmvref = malloc(sizeof(*jmvref), M_JMVREF, M_SOFTDEP_FLAGS);
- workitem_alloc(&jmvref->jm_list, D_JMVREF, UFSTOVFS(dp->i_ump));
+ workitem_alloc(&jmvref->jm_list, D_JMVREF, ITOVFS(dp));
jmvref->jm_list.wk_state = ATTACHED | DEPCOMPLETE;
jmvref->jm_parent = dp->i_number;
jmvref->jm_ino = ino;
@@ -4025,7 +4025,7 @@ newjremref(struct dirrem *dirrem, struct inode *dp, struct inode *ip,
struct jremref *jremref;
jremref = malloc(sizeof(*jremref), M_JREMREF, M_SOFTDEP_FLAGS);
- workitem_alloc(&jremref->jr_list, D_JREMREF, UFSTOVFS(dp->i_ump));
+ workitem_alloc(&jremref->jr_list, D_JREMREF, ITOVFS(dp));
jremref->jr_state = ATTACHED;
newinoref(&jremref->jr_ref, ip->i_number, dp->i_number, diroff,
nlink, ip->i_mode);
@@ -4061,7 +4061,7 @@ newjaddref(struct inode *dp, ino_t ino, off_t diroff, int16_t nlink,
struct jaddref *jaddref;
jaddref = malloc(sizeof(*jaddref), M_JADDREF, M_SOFTDEP_FLAGS);
- workitem_alloc(&jaddref->ja_list, D_JADDREF, UFSTOVFS(dp->i_ump));
+ workitem_alloc(&jaddref->ja_list, D_JADDREF, ITOVFS(dp));
jaddref->ja_state = ATTACHED;
jaddref->ja_mkdir = NULL;
newinoref(&jaddref->ja_ref, ino, dp->i_number, diroff, nlink, mode);
@@ -4649,7 +4649,7 @@ inodedep_lookup_ip(ip)
KASSERT(ip->i_nlink >= ip->i_effnlink,
("inodedep_lookup_ip: bad delta"));
- (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
+ (void) inodedep_lookup(ITOVFS(ip), ip->i_number, DEPALLOC,
&inodedep);
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked"));
@@ -4672,12 +4672,12 @@ softdep_setup_create(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_create called on non-softdep filesystem"));
KASSERT(ip->i_nlink == 1,
("softdep_setup_create: Invalid link count."));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(ip);
if (DOINGSUJ(dvp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
@@ -4686,7 +4686,7 @@ softdep_setup_create(dp, ip)
("softdep_setup_create: No addref structure present."));
}
softdep_prelink(dvp, NULL);
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4704,7 +4704,7 @@ softdep_setup_dotdot_link(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_dotdot_link called on non-softdep filesystem"));
dvp = ITOV(dp);
jaddref = NULL;
@@ -4715,13 +4715,13 @@ softdep_setup_dotdot_link(dp, ip)
if (DOINGSUJ(dvp))
jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET,
dp->i_effnlink - 1, dp->i_mode);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(dp);
if (jaddref)
TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref,
if_deps);
softdep_prelink(dvp, ITOV(ip));
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4739,20 +4739,20 @@ softdep_setup_link(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_link called on non-softdep filesystem"));
dvp = ITOV(dp);
jaddref = NULL;
if (DOINGSUJ(dvp))
jaddref = newjaddref(dp, ip->i_number, 0, ip->i_effnlink - 1,
ip->i_mode);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(ip);
if (jaddref)
TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref,
if_deps);
softdep_prelink(dvp, ITOV(ip));
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4772,7 +4772,7 @@ softdep_setup_mkdir(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_mkdir called on non-softdep filesystem"));
dvp = ITOV(dp);
dotaddref = dotdotaddref = NULL;
@@ -4784,7 +4784,7 @@ softdep_setup_mkdir(dp, ip)
dp->i_effnlink - 1, dp->i_mode);
dotdotaddref->ja_state |= MKDIR_PARENT;
}
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(ip);
if (DOINGSUJ(dvp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
@@ -4802,7 +4802,7 @@ softdep_setup_mkdir(dp, ip)
TAILQ_INSERT_TAIL(&inodedep->id_inoreflst,
&dotdotaddref->ja_ref, if_deps);
softdep_prelink(ITOV(dp), NULL);
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4816,14 +4816,14 @@ softdep_setup_rmdir(dp, ip)
{
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_rmdir called on non-softdep filesystem"));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
(void) inodedep_lookup_ip(ip);
(void) inodedep_lookup_ip(dp);
softdep_prelink(dvp, ITOV(ip));
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4837,14 +4837,14 @@ softdep_setup_unlink(dp, ip)
{
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_setup_unlink called on non-softdep filesystem"));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
(void) inodedep_lookup_ip(ip);
(void) inodedep_lookup_ip(dp);
softdep_prelink(dvp, ITOV(ip));
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4860,10 +4860,10 @@ softdep_revert_create(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS((dp))) != 0,
("softdep_revert_create called on non-softdep filesystem"));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(ip);
if (DOINGSUJ(dvp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
@@ -4872,7 +4872,7 @@ softdep_revert_create(dp, ip)
("softdep_revert_create: addref parent mismatch"));
cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait);
}
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4888,10 +4888,10 @@ softdep_revert_link(dp, ip)
struct jaddref *jaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_revert_link called on non-softdep filesystem"));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(ip);
if (DOINGSUJ(dvp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
@@ -4900,7 +4900,7 @@ softdep_revert_link(dp, ip)
("softdep_revert_link: addref parent mismatch"));
cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait);
}
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4917,11 +4917,11 @@ softdep_revert_mkdir(dp, ip)
struct jaddref *dotaddref;
struct vnode *dvp;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_revert_mkdir called on non-softdep filesystem"));
dvp = ITOV(dp);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
inodedep = inodedep_lookup_ip(dp);
if (DOINGSUJ(dvp)) {
jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst,
@@ -4943,7 +4943,7 @@ softdep_revert_mkdir(dp, ip)
("softdep_revert_mkdir: dot addref parent mismatch"));
cancel_jaddref(dotaddref, inodedep, &inodedep->id_inowait);
}
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -4955,12 +4955,12 @@ softdep_revert_rmdir(dp, ip)
struct inode *ip;
{
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0,
("softdep_revert_rmdir called on non-softdep filesystem"));
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ITOUMP(dp));
(void) inodedep_lookup_ip(ip);
(void) inodedep_lookup_ip(dp);
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ITOUMP(dp));
}
/*
@@ -5011,10 +5011,10 @@ softdep_setup_inomapdep(bp, ip, newinum, mode)
struct mount *mp;
struct fs *fs;
- mp = UFSTOVFS(ip->i_ump);
+ mp = ITOVFS(ip);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_inomapdep called on non-softdep filesystem"));
- fs = ip->i_ump->um_fs;
+ fs = VFSTOUFS(mp)->um_fs;
jaddref = NULL;
/*
@@ -5046,7 +5046,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode)
bmsafemap = malloc(sizeof(struct bmsafemap),
M_BMSAFEMAP, M_SOFTDEP_FLAGS);
workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp);
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ITOUMP(ip));
if ((inodedep_lookup(mp, newinum, DEPALLOC, &inodedep)))
panic("softdep_setup_inomapdep: dependency %p for new"
"inode already exists", inodedep);
@@ -5061,7 +5061,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode)
}
inodedep->id_bmsafemap = bmsafemap;
inodedep->id_state &= ~DEPCOMPLETE;
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ITOUMP(ip));
}
/*
@@ -5283,7 +5283,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
ufs_lbn_t lbn;
lbn = bp->b_lblkno;
- mp = UFSTOVFS(ip->i_ump);
+ mp = ITOVFS(ip);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_allocdirect called on non-softdep filesystem"));
if (oldblkno && oldblkno != newblkno)
@@ -5295,7 +5295,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
"softdep_setup_allocdirect: ino %d blkno %jd oldblkno %jd "
"off %jd newsize %ld oldsize %d",
ip->i_number, newblkno, oldblkno, off, newsize, oldsize);
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ITOUMP(ip));
if (off >= NDADDR) {
if (lbn > 0)
panic("softdep_setup_allocdirect: bad lbn %jd, off %jd",
@@ -5367,7 +5367,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
TAILQ_INSERT_TAIL(adphead, adp, ad_next);
if (oldadp != NULL && oldadp->ad_offset == off)
allocdirect_merge(adphead, adp, oldadp);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ITOUMP(ip));
return;
}
TAILQ_FOREACH(oldadp, adphead, ad_next) {
@@ -5381,7 +5381,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
if (oldadp->ad_offset == off)
allocdirect_merge(adphead, adp, oldadp);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ITOUMP(ip));
}
/*
@@ -5545,10 +5545,10 @@ newjfreefrag(freefrag, ip, blkno, size, lbn)
struct jfreefrag *jfreefrag;
struct fs *fs;
- fs = ip->i_fs;
+ fs = ITOFS(ip);
jfreefrag = malloc(sizeof(struct jfreefrag), M_JFREEFRAG,
M_SOFTDEP_FLAGS);
- workitem_alloc(&jfreefrag->fr_list, D_JFREEFRAG, UFSTOVFS(ip->i_ump));
+ workitem_alloc(&jfreefrag->fr_list, D_JFREEFRAG, ITOVFS(ip));
jfreefrag->fr_jsegdep = newjsegdep(&jfreefrag->fr_list);
jfreefrag->fr_state = ATTACHED | DEPCOMPLETE;
jfreefrag->fr_ino = ip->i_number;
@@ -5571,16 +5571,18 @@ newfreefrag(ip, blkno, size, lbn)
ufs_lbn_t lbn;
{
struct freefrag *freefrag;
+ struct ufsmount *ump;
struct fs *fs;
CTR4(KTR_SUJ, "newfreefrag: ino %d blkno %jd size %ld lbn %jd",
ip->i_number, blkno, size, lbn);
- fs = ip->i_fs;
+ ump = ITOUMP(ip);
+ fs = ump->um_fs;
if (fragnum(fs, blkno) + numfrags(fs, size) > fs->fs_frag)
panic("newfreefrag: frag size");
freefrag = malloc(sizeof(struct freefrag),
M_FREEFRAG, M_SOFTDEP_FLAGS);
- workitem_alloc(&freefrag->ff_list, D_FREEFRAG, UFSTOVFS(ip->i_ump));
+ workitem_alloc(&freefrag->ff_list, D_FREEFRAG, UFSTOVFS(ump));
freefrag->ff_state = ATTACHED;
LIST_INIT(&freefrag->ff_jwork);
freefrag->ff_inum = ip->i_number;
@@ -5588,7 +5590,7 @@ newfreefrag(ip, blkno, size, lbn)
freefrag->ff_blkno = blkno;
freefrag->ff_fragsize = size;
- if (MOUNTEDSUJ(UFSTOVFS(ip->i_ump))) {
+ if (MOUNTEDSUJ(UFSTOVFS(ump))) {
freefrag->ff_jdep = (struct worklist *)
newjfreefrag(freefrag, ip, blkno, size, lbn);
} else {
@@ -5660,9 +5662,11 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
struct jnewblk *jnewblk;
struct newblk *newblk;
struct mount *mp;
+ struct ufsmount *ump;
ufs_lbn_t lbn;
- mp = UFSTOVFS(ip->i_ump);
+ mp = ITOVFS(ip);
+ ump = VFSTOUFS(mp);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_allocext called on non-softdep filesystem"));
KASSERT(off < NXADDR, ("softdep_setup_allocext: lbn %lld > NXADDR",
@@ -5674,7 +5678,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
else
freefrag = NULL;
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ump);
if (newblk_lookup(mp, newblkno, 0, &newblk) == 0)
panic("softdep_setup_allocext: lost block");
KASSERT(newblk->nb_list.wk_type == D_NEWBLK,
@@ -5725,7 +5729,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
TAILQ_INSERT_TAIL(adphead, adp, ad_next);
if (oldadp != NULL && oldadp->ad_offset == off)
allocdirect_merge(adphead, adp, oldadp);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
return;
}
TAILQ_FOREACH(oldadp, adphead, ad_next) {
@@ -5738,7 +5742,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
TAILQ_INSERT_BEFORE(oldadp, adp, ad_next);
if (oldadp->ad_offset == off)
allocdirect_merge(adphead, adp, oldadp);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -5783,11 +5787,11 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn)
struct jnewblk *jnewblk;
if (oldblkno)
- freefrag = newfreefrag(ip, oldblkno, ip->i_fs->fs_bsize, lbn);
+ freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn);
else
freefrag = NULL;
- ACQUIRE_LOCK(ip->i_ump);
- if (newblk_lookup(UFSTOVFS(ip->i_ump), newblkno, 0, &newblk) == 0)
+ ACQUIRE_LOCK(ITOUMP(ip));
+ if (newblk_lookup(ITOVFS(ip), newblkno, 0, &newblk) == 0)
panic("new_allocindir: lost block");
KASSERT(newblk->nb_list.wk_type == D_NEWBLK,
("newallocindir: newblk already initialized"));
@@ -5827,8 +5831,10 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
struct allocindir *aip;
struct pagedep *pagedep;
struct mount *mp;
+ struct ufsmount *ump;
- mp = UFSTOVFS(ip->i_ump);
+ mp = ITOVFS(ip);
+ ump = VFSTOUFS(mp);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_allocindir_page called on non-softdep filesystem"));
KASSERT(lbn == nbp->b_lblkno,
@@ -5849,7 +5855,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
pagedep_lookup(mp, nbp, ip->i_number, lbn, DEPALLOC, &pagedep);
WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list);
freefrag = setup_allocindir_phase2(bp, ip, inodedep, aip, lbn);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
if (freefrag)
handle_workitem_freefrag(freefrag);
}
@@ -5868,9 +5874,11 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
{
struct inodedep *inodedep;
struct allocindir *aip;
+ struct ufsmount *ump;
ufs_lbn_t lbn;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_setup_allocindir_meta called on non-softdep filesystem"));
CTR3(KTR_SUJ,
"softdep_setup_allocindir_meta: ino %d blkno %jd ptrno %d",
@@ -5878,12 +5886,11 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
lbn = nbp->b_lblkno;
ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_meta");
aip = newallocindir(ip, ptrno, newblkno, 0, lbn);
- inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
- &inodedep);
+ inodedep_lookup(UFSTOVFS(ump), ip->i_number, DEPALLOC, &inodedep);
WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list);
if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn))
panic("softdep_setup_allocindir_meta: Block already existed");
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
}
static void
@@ -5925,7 +5932,7 @@ indirdep_lookup(mp, ip, bp)
LOCK_OWNED(ump);
indirdep = NULL;
newindirdep = NULL;
- fs = ip->i_fs;
+ fs = ump->um_fs;
for (;;) {
LIST_FOREACH(wk, &bp->b_dep, wk_list) {
if (wk->wk_type != D_INDIRDEP)
@@ -5947,7 +5954,7 @@ indirdep_lookup(mp, ip, bp)
M_INDIRDEP, M_SOFTDEP_FLAGS);
workitem_alloc(&newindirdep->ir_list, D_INDIRDEP, mp);
newindirdep->ir_state = ATTACHED;
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
newindirdep->ir_state |= UFS1FMT;
TAILQ_INIT(&newindirdep->ir_trunc);
newindirdep->ir_saveddata = NULL;
@@ -5962,7 +5969,7 @@ indirdep_lookup(mp, ip, bp)
}
newindirdep->ir_freeblks = NULL;
newindirdep->ir_savebp =
- getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0, 0);
+ getblk(ump->um_devvp, bp->b_blkno, bp->b_bcount, 0, 0, 0);
newindirdep->ir_bp = bp;
BUF_KERNPROC(newindirdep->ir_savebp);
bcopy(bp->b_data, newindirdep->ir_savebp->b_data, bp->b_bcount);
@@ -6000,10 +6007,12 @@ setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)
struct allocindir *oldaip;
struct freefrag *freefrag;
struct mount *mp;
+ struct ufsmount *ump;
- LOCK_OWNED(ip->i_ump);
- mp = UFSTOVFS(ip->i_ump);
- fs = ip->i_fs;
+ mp = ITOVFS(ip);
+ ump = VFSTOUFS(mp);
+ LOCK_OWNED(ump);
+ fs = ump->um_fs;
if (bp->b_lblkno >= 0)
panic("setup_allocindir_phase2: not indir blk");
KASSERT(aip->ai_offset >= 0 && aip->ai_offset < NINDIR(fs),
@@ -6088,6 +6097,7 @@ setup_freedirect(freeblks, ip, i, needj)
int i;
int needj;
{
+ struct ufsmount *ump;
ufs2_daddr_t blkno;
int frags;
@@ -6095,9 +6105,10 @@ setup_freedirect(freeblks, ip, i, needj)
if (blkno == 0)
return;
DIP_SET(ip, i_db[i], 0);
- frags = sblksize(ip->i_fs, ip->i_size, i);
- frags = numfrags(ip->i_fs, frags);
- newfreework(ip->i_ump, freeblks, NULL, i, blkno, frags, 0, needj);
+ ump = ITOUMP(ip);
+ frags = sblksize(ump->um_fs, ip->i_size, i);
+ frags = numfrags(ump->um_fs, frags);
+ newfreework(ump, freeblks, NULL, i, blkno, frags, 0, needj);
}
static inline void
@@ -6107,6 +6118,7 @@ setup_freeext(freeblks, ip, i, needj)
int i;
int needj;
{
+ struct ufsmount *ump;
ufs2_daddr_t blkno;
int frags;
@@ -6114,9 +6126,10 @@ setup_freeext(freeblks, ip, i, needj)
if (blkno == 0)
return;
ip->i_din2->di_extb[i] = 0;
- frags = sblksize(ip->i_fs, ip->i_din2->di_extsize, i);
- frags = numfrags(ip->i_fs, frags);
- newfreework(ip->i_ump, freeblks, NULL, -1 - i, blkno, frags, 0, needj);
+ ump = ITOUMP(ip);
+ frags = sblksize(ump->um_fs, ip->i_din2->di_extsize, i);
+ frags = numfrags(ump->um_fs, frags);
+ newfreework(ump, freeblks, NULL, -1 - i, blkno, frags, 0, needj);
}
static inline void
@@ -6127,13 +6140,15 @@ setup_freeindir(freeblks, ip, i, lbn, needj)
ufs_lbn_t lbn;
int needj;
{
+ struct ufsmount *ump;
ufs2_daddr_t blkno;
blkno = DIP(ip, i_ib[i]);
if (blkno == 0)
return;
DIP_SET(ip, i_ib[i], 0);
- newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, ip->i_fs->fs_frag,
+ ump = ITOUMP(ip);
+ newfreework(ump, freeblks, NULL, lbn, blkno, ump->um_fs->fs_frag,
0, needj);
}
@@ -6156,7 +6171,7 @@ newfreeblks(mp, ip)
freeblks->fb_inum = ip->i_number;
freeblks->fb_vtype = ITOV(ip)->v_type;
freeblks->fb_modrev = DIP(ip, i_modrev);
- freeblks->fb_devvp = ip->i_devvp;
+ freeblks->fb_devvp = ITODEVVP(ip);
freeblks->fb_chkcnt = 0;
freeblks->fb_len = 0;
@@ -6211,6 +6226,7 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
struct freework *freework;
struct newblk *newblk;
struct mount *mp;
+ struct ufsmount *ump;
struct buf *bp;
uint8_t *start;
uint8_t *end;
@@ -6224,6 +6240,7 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
if (blkno == 0)
return (0);
mp = freeblks->fb_list.wk_mp;
+ ump = VFSTOUFS(mp);
bp = getblk(ITOV(ip), lbn, mp->mnt_stat.f_iosize, 0, 0, 0);
if ((bp->b_flags & B_CACHE) == 0) {
bp->b_blkno = blkptrtodb(VFSTOUFS(mp), blkno);
@@ -6248,22 +6265,21 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
}
}
level = lbn_level(lbn);
- lbnadd = lbn_offset(ip->i_fs, level);
+ lbnadd = lbn_offset(ump->um_fs, level);
/*
* Compute the offset of the last block we want to keep. Store
* in the freework the first block we want to completely free.
*/
off = (lastlbn - -(lbn + level)) / lbnadd;
- if (off + 1 == NINDIR(ip->i_fs))
+ if (off + 1 == NINDIR(ump->um_fs))
goto nowork;
- freework = newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, 0, off+1,
- 0);
+ freework = newfreework(ump, freeblks, NULL, lbn, blkno, 0, off + 1, 0);
/*
* Link the freework into the indirdep. This will prevent any new
* allocations from proceeding until we are finished with the
* truncate and the block is written.
*/
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ump);
indirdep = indirdep_lookup(mp, ip, bp);
if (indirdep->ir_freeblks)
panic("setup_trunc_indir: indirdep already truncated.");
@@ -6275,12 +6291,12 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
* live on this newblk.
*/
if ((indirdep->ir_state & DEPCOMPLETE) == 0) {
- newblk_lookup(mp, dbtofsb(ip->i_fs, bp->b_blkno), 0, &newblk);
+ newblk_lookup(mp, dbtofsb(ump->um_fs, bp->b_blkno), 0, &newblk);
LIST_FOREACH(indirn, &newblk->nb_indirdeps, ir_next)
trunc_indirdep(indirn, freeblks, bp, off);
} else
trunc_indirdep(indirdep, freeblks, bp, off);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
/*
* Creation is protected by the buf lock. The saveddata is only
* needed if a full truncation follows a partial truncation but it
@@ -6291,7 +6307,7 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
M_SOFTDEP_FLAGS);
nowork:
/* Fetch the blkno of the child and the zero start offset. */
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
blkno = ((ufs1_daddr_t *)bp->b_data)[off];
start = (uint8_t *)&((ufs1_daddr_t *)bp->b_data)[off+1];
} else {
@@ -6501,9 +6517,9 @@ softdep_journal_freeblocks(ip, cred, length, flags)
ufs_lbn_t tmpval, lbn, lastlbn;
int frags, lastoff, iboff, allocblock, needj, error, i;
- fs = ip->i_fs;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
mp = UFSTOVFS(ump);
+ fs = ump->um_fs;
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_journal_freeblocks called on non-softdep filesystem"));
vp = ITOV(ip);
@@ -6583,13 +6599,13 @@ softdep_journal_freeblocks(ip, cred, length, flags)
blkno = DIP(ip, i_db[lastlbn]);
if (blkno && oldfrags != frags) {
oldfrags -= frags;
- oldfrags = numfrags(ip->i_fs, oldfrags);
- blkno += numfrags(ip->i_fs, frags);
+ oldfrags = numfrags(fs, oldfrags);
+ blkno += numfrags(fs, frags);
newfreework(ump, freeblks, NULL, lastlbn,
blkno, oldfrags, 0, needj);
if (needj)
adjust_newfreework(freeblks,
- numfrags(ip->i_fs, frags));
+ numfrags(fs, frags));
} else if (blkno == 0)
allocblock = 1;
}
@@ -6606,7 +6622,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
DIP_SET(ip, i_size, ip->i_size);
datablocks = DIP(ip, i_blocks) - extblocks;
if (length != 0)
- datablocks = blkcount(ip->i_fs, datablocks, length);
+ datablocks = blkcount(fs, datablocks, length);
freeblks->fb_len = length;
}
if ((flags & IO_EXT) != 0) {
@@ -6633,7 +6649,7 @@ softdep_journal_freeblocks(ip, cred, length, flags)
*/
ufs_itimes(vp);
ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
- error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
+ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
(int)fs->fs_bsize, cred, &bp);
if (error) {
brelse(bp);
@@ -6773,20 +6789,22 @@ softdep_journal_fsync(ip)
struct inode *ip;
{
struct jfsync *jfsync;
+ struct ufsmount *ump;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_journal_fsync called on non-softdep filesystem"));
if ((ip->i_flag & IN_TRUNCATED) == 0)
return;
ip->i_flag &= ~IN_TRUNCATED;
jfsync = malloc(sizeof(*jfsync), M_JFSYNC, M_SOFTDEP_FLAGS | M_ZERO);
- workitem_alloc(&jfsync->jfs_list, D_JFSYNC, UFSTOVFS(ip->i_ump));
+ workitem_alloc(&jfsync->jfs_list, D_JFSYNC, UFSTOVFS(ump));
jfsync->jfs_size = ip->i_size;
jfsync->jfs_ino = ip->i_number;
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ump);
add_to_journal(&jfsync->jfs_list);
jwait(&jfsync->jfs_list, MNT_WAIT);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -6838,15 +6856,15 @@ softdep_setup_freeblocks(ip, length, flags)
ufs_lbn_t tmpval;
ufs_lbn_t lbn;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
mp = UFSTOVFS(ump);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_freeblocks called on non-softdep filesystem"));
CTR2(KTR_SUJ, "softdep_setup_freeblks: ip %d length %ld",
ip->i_number, length);
KASSERT(length == 0, ("softdep_setup_freeblocks: non-zero length"));
- fs = ip->i_fs;
- if ((error = bread(ip->i_devvp,
+ fs = ump->um_fs;
+ if ((error = bread(ump->um_devvp,
fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
(int)fs->fs_bsize, NOCRED, &bp)) != 0) {
brelse(bp);
@@ -6981,7 +6999,7 @@ trunc_pages(ip, length, extblocks, flags)
off_t end, extend;
vp = ITOV(ip);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
extend = OFF_TO_IDX(lblktosize(fs, -extblocks));
if ((flags & IO_EXT) != 0)
vn_pages_remove(vp, extend, 0);
@@ -7517,7 +7535,7 @@ softdep_freefile(pvp, ino, mode)
struct freeblks *freeblks;
struct ufsmount *ump;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_freefile called on non-softdep filesystem"));
/*
@@ -7528,10 +7546,10 @@ softdep_freefile(pvp, ino, mode)
workitem_alloc(&freefile->fx_list, D_FREEFILE, pvp->v_mount);
freefile->fx_mode = mode;
freefile->fx_oldinum = ino;
- freefile->fx_devvp = ip->i_devvp;
+ freefile->fx_devvp = ump->um_devvp;
LIST_INIT(&freefile->fx_jwork);
UFS_LOCK(ump);
- ip->i_fs->fs_pendinginodes += 1;
+ ump->um_fs->fs_pendinginodes += 1;
UFS_UNLOCK(ump);
/*
@@ -8451,8 +8469,8 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
struct mount *mp;
int isindir;
- ump = dp->i_ump;
- mp = UFSTOVFS(ump);
+ mp = ITOVFS(dp);
+ ump = VFSTOUFS(mp);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_directory_add called on non-softdep filesystem"));
/*
@@ -8465,7 +8483,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
}
jaddref = NULL;
mkdir1 = mkdir2 = NULL;
- fs = dp->i_fs;
+ fs = ump->um_fs;
lbn = lblkno(fs, diroffset);
offset = blkoff(fs, diroffset);
dap = malloc(sizeof(struct diradd), M_DIRADD,
@@ -8618,10 +8636,12 @@ softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize)
struct diradd *dap;
struct direct *de;
struct mount *mp;
+ struct ufsmount *ump;
ufs_lbn_t lbn;
int flags;
- mp = UFSTOVFS(dp->i_ump);
+ mp = ITOVFS(dp);
+ ump = VFSTOUFS(mp);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_change_directoryentry_offset called on "
"non-softdep filesystem"));
@@ -8639,11 +8659,11 @@ softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize)
dp->i_offset + (oldloc - base),
dp->i_offset + (newloc - base));
}
- lbn = lblkno(dp->i_fs, dp->i_offset);
- offset = blkoff(dp->i_fs, dp->i_offset);
+ lbn = lblkno(ump->um_fs, dp->i_offset);
+ offset = blkoff(ump->um_fs, dp->i_offset);
oldoffset = offset + (oldloc - base);
newoffset = offset + (newloc - base);
- ACQUIRE_LOCK(dp->i_ump);
+ ACQUIRE_LOCK(ump);
if (pagedep_lookup(mp, bp, dp->i_number, lbn, flags, &pagedep) == 0)
goto done;
dap = diradd_lookup(pagedep, oldoffset);
@@ -8665,7 +8685,7 @@ done:
add_to_journal(&jmvref->jm_list);
}
bcopy(oldloc, newloc, entrysize);
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -8908,9 +8928,11 @@ softdep_setup_remove(bp, dp, ip, isrmdir)
{
struct dirrem *dirrem, *prevdirrem;
struct inodedep *inodedep;
+ struct ufsmount *ump;
int direct;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_setup_remove called on non-softdep filesystem"));
/*
* Allocate a new dirrem if appropriate and ACQUIRE_LOCK. We want
@@ -8922,8 +8944,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir)
* Add the dirrem to the inodedep's pending remove list for quick
* discovery later.
*/
- if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0,
- &inodedep) == 0)
+ if (inodedep_lookup(UFSTOVFS(ump), ip->i_number, 0, &inodedep) == 0)
panic("softdep_setup_remove: Lost inodedep.");
KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked"));
dirrem->dm_state |= ONDEPLIST;
@@ -8943,14 +8964,14 @@ softdep_setup_remove(bp, dp, ip, isrmdir)
if ((dirrem->dm_state & COMPLETE) == 0) {
LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd, dirrem,
dm_next);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
} else {
if (prevdirrem != NULL)
LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd,
prevdirrem, dm_next);
dirrem->dm_dirinum = dirrem->dm_pagedep->pd_ino;
direct = LIST_EMPTY(&dirrem->dm_jremrefhd);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
if (direct)
handle_workitem_remove(dirrem, 0);
}
@@ -8992,8 +9013,7 @@ cancel_diradd_dotdot(ip, dirrem, jremref)
struct diradd *dap;
struct worklist *wk;
- if (pagedep_lookup(UFSTOVFS(ip->i_ump), NULL, ip->i_number, 0, 0,
- &pagedep) == 0)
+ if (pagedep_lookup(ITOVFS(ip), NULL, ip->i_number, 0, 0, &pagedep) == 0)
return (jremref);
dap = diradd_lookup(pagedep, DOTDOT_OFFSET);
if (dap == NULL)
@@ -9025,9 +9045,10 @@ cancel_mkdir_dotdot(ip, dirrem, jremref)
struct ufsmount *ump;
struct mkdir *mkdir;
struct diradd *dap;
+ struct mount *mp;
- if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0,
- &inodedep) == 0)
+ mp = ITOVFS(ip);
+ if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0)
return (jremref);
dap = inodedep->id_mkdiradd;
if (dap == NULL || (dap->da_state & MKDIR_PARENT) == 0)
@@ -9042,8 +9063,7 @@ cancel_mkdir_dotdot(ip, dirrem, jremref)
if ((jaddref = mkdir->md_jaddref) != NULL) {
mkdir->md_jaddref = NULL;
jaddref->ja_state &= ~MKDIR_PARENT;
- if (inodedep_lookup(UFSTOVFS(ip->i_ump), jaddref->ja_ino, 0,
- &inodedep) == 0)
+ if (inodedep_lookup(mp, jaddref->ja_ino, 0, &inodedep) == 0)
panic("cancel_mkdir_dotdot: Lost parent inodedep");
if (cancel_jaddref(jaddref, inodedep, &dirrem->dm_jwork)) {
journal_jremref(dirrem, jremref, inodedep);
@@ -9114,6 +9134,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
struct jremref *dotremref;
struct jremref *dotdotremref;
struct vnode *dvp;
+ struct ufsmount *ump;
/*
* Whiteouts have no deletion dependencies.
@@ -9121,6 +9142,8 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
if (ip == NULL)
panic("newdirrem: whiteout");
dvp = ITOV(dp);
+ ump = ITOUMP(dp);
+
/*
* If the system is over its limit and our filesystem is
* responsible for more than our share of that usage and
@@ -9128,11 +9151,11 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
* Limiting the number of dirrem structures will also limit
* the number of freefile and freeblks structures.
*/
- ACQUIRE_LOCK(ip->i_ump);
- if (!IS_SNAPSHOT(ip) && softdep_excess_items(ip->i_ump, D_DIRREM))
- schedule_cleanup(ITOV(dp)->v_mount);
+ ACQUIRE_LOCK(ump);
+ if (!IS_SNAPSHOT(ip) && softdep_excess_items(ump, D_DIRREM))
+ schedule_cleanup(UFSTOVFS(ump));
else
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
dirrem = malloc(sizeof(struct dirrem), M_DIRREM, M_SOFTDEP_FLAGS |
M_ZERO);
workitem_alloc(&dirrem->dm_list, D_DIRREM, dvp->v_mount);
@@ -9162,10 +9185,10 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
jremref = newjremref(dirrem, dp, ip, dp->i_offset,
ip->i_effnlink + 1);
}
- ACQUIRE_LOCK(ip->i_ump);
- lbn = lblkno(dp->i_fs, dp->i_offset);
- offset = blkoff(dp->i_fs, dp->i_offset);
- pagedep_lookup(UFSTOVFS(dp->i_ump), bp, dp->i_number, lbn, DEPALLOC,
+ ACQUIRE_LOCK(ump);
+ lbn = lblkno(ump->um_fs, dp->i_offset);
+ offset = blkoff(ump->um_fs, dp->i_offset);
+ pagedep_lookup(UFSTOVFS(ump), bp, dp->i_number, lbn, DEPALLOC,
&pagedep);
dirrem->dm_pagedep = pagedep;
dirrem->dm_offset = offset;
@@ -9272,9 +9295,11 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
struct inodedep *inodedep;
struct jaddref *jaddref;
struct mount *mp;
+ struct ufsmount *ump;
- offset = blkoff(dp->i_fs, dp->i_offset);
- mp = UFSTOVFS(dp->i_ump);
+ mp = ITOVFS(dp);
+ ump = VFSTOUFS(mp);
+ offset = blkoff(ump->um_fs, dp->i_offset);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_setup_directory_change called on non-softdep filesystem"));
@@ -9324,7 +9349,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
if (LIST_EMPTY(&dirrem->dm_jremrefhd))
add_to_worklist(&dirrem->dm_list, 0);
}
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ump);
return;
}
/*
@@ -9398,7 +9423,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
*/
if (inodedep->id_mkdiradd && dp->i_offset != DOTDOT_OFFSET)
merge_diradd(inodedep, dap);
- FREE_LOCK(dp->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -9412,16 +9437,17 @@ softdep_change_linkcnt(ip)
struct inode *ip; /* the inode with the increased link count */
{
struct inodedep *inodedep;
+ struct ufsmount *ump;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_change_linkcnt called on non-softdep filesystem"));
- ACQUIRE_LOCK(ip->i_ump);
- inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC,
- &inodedep);
+ ACQUIRE_LOCK(ump);
+ inodedep_lookup(UFSTOVFS(ump), ip->i_number, DEPALLOC, &inodedep);
if (ip->i_nlink < ip->i_effnlink)
panic("softdep_change_linkcnt: bad delta");
inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -12014,21 +12040,22 @@ softdep_load_inodeblock(ip)
struct inode *ip; /* the "in_core" copy of the inode */
{
struct inodedep *inodedep;
+ struct ufsmount *ump;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_load_inodeblock called on non-softdep filesystem"));
/*
* Check for alternate nlink count.
*/
ip->i_effnlink = ip->i_nlink;
- ACQUIRE_LOCK(ip->i_ump);
- if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0,
- &inodedep) == 0) {
- FREE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(ump);
+ if (inodedep_lookup(UFSTOVFS(ump), ip->i_number, 0, &inodedep) == 0) {
+ FREE_LOCK(ump);
return;
}
ip->i_effnlink -= inodedep->id_nlinkdelta;
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(ump);
}
/*
@@ -12056,11 +12083,11 @@ softdep_update_inodeblock(ip, bp, waitfor)
struct fs *fs;
int error;
- ump = ip->i_ump;
+ ump = ITOUMP(ip);
mp = UFSTOVFS(ump);
KASSERT(MOUNTEDSOFTDEP(mp) != 0,
("softdep_update_inodeblock called on non-softdep filesystem"));
- fs = ip->i_fs;
+ fs = ump->um_fs;
/*
* Preserve the freelink that is on disk. clear_unlinked_inodedep()
* does not have access to the in-core ip so must write directly into
@@ -12225,9 +12252,9 @@ softdep_fsync(vp)
ufs_lbn_t lbn;
ip = VTOI(vp);
- fs = ip->i_fs;
- ump = ip->i_ump;
mp = vp->v_mount;
+ ump = VFSTOUFS(mp);
+ fs = ump->um_fs;
if (MOUNTEDSOFTDEP(mp) == 0)
return (0);
ACQUIRE_LOCK(ump);
@@ -12500,13 +12527,13 @@ softdep_sync_metadata(struct vnode *vp)
int error;
ip = VTOI(vp);
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0,
("softdep_sync_metadata called on non-softdep filesystem"));
/*
* Ensure that any direct block dependencies have been cleared,
* truncations are started, and inode references are journaled.
*/
- ACQUIRE_LOCK(ip->i_ump);
+ ACQUIRE_LOCK(VFSTOUFS(vp->v_mount));
/*
* Write all journal records to prevent rollbacks on devvp.
*/
@@ -12518,7 +12545,7 @@ softdep_sync_metadata(struct vnode *vp)
* indirect blocks.
*/
process_truncates(vp);
- FREE_LOCK(ip->i_ump);
+ FREE_LOCK(VFSTOUFS(vp->v_mount));
return (error);
}
@@ -12553,7 +12580,7 @@ softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor)
return (EBUSY);
return (0);
}
- ump = VTOI(vp)->i_ump;
+ ump = VFSTOUFS(vp->v_mount);
ACQUIRE_LOCK(ump);
/*
* As we hold the buffer locked, none of its dependencies
@@ -13674,12 +13701,14 @@ softdep_inode_append(ip, cred, wkhd)
{
struct buf *bp;
struct fs *fs;
+ struct ufsmount *ump;
int error;
- KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0,
+ ump = ITOUMP(ip);
+ KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0,
("softdep_inode_append called on non-softdep filesystem"));
- fs = ip->i_fs;
- error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
+ fs = ump->um_fs;
+ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
(int)fs->fs_bsize, cred, &bp);
if (error) {
bqrelse(bp);
diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c
index 67f7e5c..cabed2b 100644
--- a/sys/ufs/ffs/ffs_subr.c
+++ b/sys/ufs/ffs/ffs_subr.c
@@ -74,7 +74,7 @@ ffs_blkatoff(vp, offset, res, bpp)
int bsize, error;
ip = VTOI(vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
lbn = lblkno(fs, offset);
bsize = blksize(fs, ip, lbn);
@@ -102,7 +102,7 @@ ffs_load_inode(bp, ip, fs, ino)
ino_t ino;
{
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
*ip->i_din1 =
*((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ino));
ip->i_mode = ip->i_din1->di_mode;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index b28b742..d8790d1 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1652,7 +1652,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
struct ufsmount *ump;
struct buf *bp;
struct vnode *vp;
- struct cdev *dev;
int error;
error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL);
@@ -1676,7 +1675,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
*/
ump = VFSTOUFS(mp);
- dev = ump->um_dev;
fs = ump->um_fs;
ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO);
@@ -1697,11 +1695,10 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
vp->v_bufobj.bo_bsize = fs->fs_bsize;
ip->i_vnode = vp;
ip->i_ump = ump;
- ip->i_fs = fs;
- ip->i_dev = dev;
ip->i_number = ino;
ip->i_ea_refs = 0;
ip->i_nextclustercg = -1;
+ ip->i_flag = fs->fs_magic == FS_UFS1_MAGIC ? 0 : IN_UFS2;
#ifdef QUOTA
{
int i;
@@ -1738,7 +1735,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
*vpp = NULL;
return (error);
}
- if (ip->i_ump->um_fstype == UFS1)
+ if (I_IS_UFS1(ip))
ip->i_din1 = uma_zalloc(uma_ufs1, M_WAITOK);
else
ip->i_din2 = uma_zalloc(uma_ufs2, M_WAITOK);
@@ -1753,10 +1750,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
* Initialize the vnode from the inode, check for aliases.
* Note that the underlying vnode may have changed.
*/
- if (ip->i_ump->um_fstype == UFS1)
- error = ufs_vinit(mp, &ffs_fifoops1, &vp);
- else
- error = ufs_vinit(mp, &ffs_fifoops2, &vp);
+ error = ufs_vinit(mp, I_IS_UFS1(ip) ? &ffs_fifoops1 : &ffs_fifoops2,
+ &vp);
if (error) {
vput(vp);
*vpp = NULL;
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 2765480..cdcff7e 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -244,7 +244,7 @@ ffs_syncvnode(struct vnode *vp, int waitfor, int flags)
error = 0;
passes = 0;
wait = false; /* Always do an async pass first. */
- lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1));
+ lbn = lblkno(ITOFS(ip), (ip->i_size + ITOFS(ip)->fs_bsize - 1));
BO_LOCK(bo);
loop:
TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs)
@@ -518,7 +518,7 @@ ffs_read(ap)
if (orig_resid == 0)
return (0);
KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0"));
- fs = ip->i_fs;
+ fs = ITOFS(ip);
if (uio->uio_offset < ip->i_size &&
uio->uio_offset >= fs->fs_maxfilesize)
return (EOVERFLOW);
@@ -741,7 +741,7 @@ ffs_write(ap)
KASSERT(uio->uio_resid >= 0, ("ffs_write: uio->uio_resid < 0"));
KASSERT(uio->uio_offset >= 0, ("ffs_write: uio->uio_offset < 0"));
- fs = ip->i_fs;
+ fs = ITOFS(ip);
if ((uoff_t)uio->uio_offset + uio->uio_resid > fs->fs_maxfilesize)
return (EFBIG);
/*
@@ -905,7 +905,7 @@ ffs_extread(struct vnode *vp, struct uio *uio, int ioflag)
int error;
ip = VTOI(vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
dp = ip->i_din2;
#ifdef INVARIANTS
@@ -1059,7 +1059,7 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred)
int blkoffset, error, flags, size, xfersize;
ip = VTOI(vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
dp = ip->i_din2;
#ifdef INVARIANTS
@@ -1231,7 +1231,7 @@ ffs_rdextattr(u_char **p, struct vnode *vp, struct thread *td, int extra)
u_char *eae;
ip = VTOI(vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
dp = ip->i_din2;
easize = dp->di_extsize;
if ((uoff_t)easize + extra > NXADDR * fs->fs_bsize)
@@ -1385,8 +1385,7 @@ struct vop_strategy_args {
vp = ap->a_vp;
lbn = ap->a_bp->b_lblkno;
- if (VTOI(vp)->i_fs->fs_magic == FS_UFS2_MAGIC &&
- lbn < 0 && lbn >= -NXADDR)
+ if (I_IS_UFS2(VTOI(vp)) && lbn < 0 && lbn >= -NXADDR)
return (VOP_STRATEGY_APV(&ufs_vnodeops, ap));
if (vp->v_type == VFIFO)
return (VOP_STRATEGY_APV(&ufs_fifoops, ap));
@@ -1462,7 +1461,7 @@ vop_deleteextattr {
u_char *eae, *p;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -1665,7 +1664,7 @@ vop_setextattr {
u_char *eae, *p;
ip = VTOI(ap->a_vp);
- fs = ip->i_fs;
+ fs = ITOFS(ip);
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
diff --git a/sys/ufs/ufs/extattr.h b/sys/ufs/ufs/extattr.h
index 1e5152c..6b4987c 100644
--- a/sys/ufs/ufs/extattr.h
+++ b/sys/ufs/ufs/extattr.h
@@ -133,6 +133,10 @@ struct ufs_extattr_per_mount {
int uepm_flags;
};
+struct vop_getextattr_args;
+struct vop_deleteextattr_args;
+struct vop_setextattr_args;
+
void ufs_extattr_uepm_init(struct ufs_extattr_per_mount *uepm);
void ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm);
int ufs_extattr_start(struct mount *mp, struct thread *td);
diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h
index cd7c472..e44cae5 100644
--- a/sys/ufs/ufs/inode.h
+++ b/sys/ufs/ufs/inode.h
@@ -66,14 +66,25 @@
struct inode {
TAILQ_ENTRY(inode) i_nextsnap; /* snapshot file list. */
struct vnode *i_vnode;/* Vnode associated with this inode. */
- struct ufsmount *i_ump;/* Ufsmount point associated with this inode. */
- u_int32_t i_flag; /* flags, see below */
- struct cdev *i_dev; /* Device associated with the inode. */
+ struct ufsmount *i_ump;/* Ufsmount point associated with this inode. */
+ struct dquot *i_dquot[MAXQUOTAS]; /* Dquot structures. */
+ union {
+ struct dirhash *dirhash; /* Hashing for large directories. */
+ daddr_t *snapblklist; /* Collect expunged snapshot blocks. */
+ } i_un;
+ /*
+ * The real copy of the on-disk inode.
+ */
+ union {
+ struct ufs1_dinode *din1; /* UFS1 on-disk dinode. */
+ struct ufs2_dinode *din2; /* UFS2 on-disk dinode. */
+ } dinode_u;
+
ino_t i_number; /* The identity of the inode. */
+ u_int32_t i_flag; /* flags, see below */
int i_effnlink; /* i_nlink when I/O completes */
- struct fs *i_fs; /* Associated filesystem superblock. */
- struct dquot *i_dquot[MAXQUOTAS]; /* Dquot structures. */
+
/*
* Side effects; used during directory lookup.
*/
@@ -82,11 +93,6 @@ struct inode {
doff_t i_diroff; /* Offset in dir, where we found last entry. */
doff_t i_offset; /* Offset of free space in directory. */
- union {
- struct dirhash *dirhash; /* Hashing for large directories. */
- daddr_t *snapblklist; /* Collect expunged snapshot blocks. */
- } i_un;
-
int i_nextclustercg; /* last cg searched for cluster */
/*
@@ -100,20 +106,13 @@ struct inode {
/*
* Copies from the on-disk dinode itself.
*/
- u_int16_t i_mode; /* IFMT, permissions; see below. */
- int16_t i_nlink; /* File link count. */
u_int64_t i_size; /* File byte count. */
- u_int32_t i_flags; /* Status flags (chflags). */
u_int64_t i_gen; /* Generation number. */
+ u_int32_t i_flags; /* Status flags (chflags). */
u_int32_t i_uid; /* File owner. */
u_int32_t i_gid; /* File group. */
- /*
- * The real copy of the on-disk inode.
- */
- union {
- struct ufs1_dinode *din1; /* UFS1 on-disk dinode. */
- struct ufs2_dinode *din2; /* UFS2 on-disk dinode. */
- } dinode_u;
+ u_int16_t i_mode; /* IFMT, permissions; see below. */
+ int16_t i_nlink; /* File link count. */
};
/*
* These flags are kept in i_flag.
@@ -123,39 +122,58 @@ struct inode {
#define IN_UPDATE 0x0004 /* Modification time update request. */
#define IN_MODIFIED 0x0008 /* Inode has been modified. */
#define IN_NEEDSYNC 0x0010 /* Inode requires fsync. */
-#define IN_LAZYMOD 0x0040 /* Modified, but don't write yet. */
-#define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the
+#define IN_LAZYMOD 0x0020 /* Modified, but don't write yet. */
+#define IN_LAZYACCESS 0x0040 /* Process IN_ACCESS after the
suspension finished */
-#define IN_EA_LOCKED 0x0200
-#define IN_EA_LOCKWAIT 0x0400
+#define IN_EA_LOCKED 0x0080
+#define IN_EA_LOCKWAIT 0x0100
-#define IN_TRUNCATED 0x0800 /* Journaled truncation pending. */
+#define IN_TRUNCATED 0x0200 /* Journaled truncation pending. */
+
+#define IN_UFS2 0x0400 /* UFS2 vs UFS1 */
-#define i_devvp i_ump->um_devvp
-#define i_umbufobj i_ump->um_bo
#define i_dirhash i_un.dirhash
#define i_snapblklist i_un.snapblklist
#define i_din1 dinode_u.din1
#define i_din2 dinode_u.din2
#ifdef _KERNEL
+
+#define ITOUMP(ip) ((ip)->i_ump)
+#define ITODEV(ip) (ITOUMP(ip)->um_dev)
+#define ITODEVVP(ip) (ITOUMP(ip)->um_devvp)
+#define ITOFS(ip) (ITOUMP(ip)->um_fs)
+#define ITOVFS(ip) ((ip)->i_vnode->v_mount)
+
+static inline _Bool
+I_IS_UFS1(const struct inode *ip)
+{
+
+ return ((ip->i_flag & IN_UFS2) == 0);
+}
+
+static inline _Bool
+I_IS_UFS2(const struct inode *ip)
+{
+
+ return ((ip->i_flag & IN_UFS2) != 0);
+}
+
/*
* The DIP macro is used to access fields in the dinode that are
* not cached in the inode itself.
*/
-#define DIP(ip, field) \
- (((ip)->i_ump->um_fstype == UFS1) ? \
- (ip)->i_din1->d##field : (ip)->i_din2->d##field)
-#define DIP_SET(ip, field, val) do { \
- if ((ip)->i_ump->um_fstype == UFS1) \
- (ip)->i_din1->d##field = (val); \
- else \
- (ip)->i_din2->d##field = (val); \
+#define DIP(ip, field) (I_IS_UFS1(ip) ? (ip)->i_din1->d##field : \
+ (ip)->i_din2->d##field)
+#define DIP_SET(ip, field, val) do { \
+ if (I_IS_UFS1(ip)) \
+ (ip)->i_din1->d##field = (val); \
+ else \
+ (ip)->i_din2->d##field = (val); \
} while (0)
-#define SHORTLINK(ip) \
- (((ip)->i_ump->um_fstype == UFS1) ? \
- (caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db)
+#define SHORTLINK(ip) (I_IS_UFS1(ip) ? \
+ (caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db)
#define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT)
/*
diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c
index 836b2c0..86f4270 100644
--- a/sys/ufs/ufs/ufs_acl.c
+++ b/sys/ufs/ufs/ufs_acl.c
@@ -184,7 +184,7 @@ ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td)
*/
printf("ufs_getacl_nfs4(): Loaded invalid ACL ("
"%d bytes), inumber %ju on %s\n", len,
- (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt);
+ (uintmax_t)ip->i_number, ITOFS(ip)->fs_fsmnt);
return (EPERM);
}
@@ -193,7 +193,7 @@ ufs_getacl_nfs4_internal(struct vnode *vp, struct acl *aclp, struct thread *td)
if (error) {
printf("ufs_getacl_nfs4(): Loaded invalid ACL "
"(failed acl_nfs4_check), inumber %ju on %s\n",
- (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt);
+ (uintmax_t)ip->i_number, ITOFS(ip)->fs_fsmnt);
return (EPERM);
}
@@ -261,7 +261,7 @@ ufs_get_oldacl(acl_type_t type, struct oldacl *old, struct vnode *vp,
*/
printf("ufs_get_oldacl(): Loaded invalid ACL "
"(len = %d), inumber %ju on %s\n", len,
- (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt);
+ (uintmax_t)ip->i_number, ITOFS(ip)->fs_fsmnt);
return (EPERM);
}
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 768298f..f6a774a 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -78,7 +78,7 @@ ufs_bmap(ap)
* to physical mapping is requested.
*/
if (ap->a_bop != NULL)
- *ap->a_bop = &VTOI(ap->a_vp)->i_devvp->v_bufobj;
+ *ap->a_bop = &VFSTOUFS(ap->a_vp->v_mount)->um_devvp->v_bufobj;
if (ap->a_bnp == NULL)
return (0);
@@ -239,7 +239,7 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb)
}
}
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off];
if (num == 1 && daddr && runp) {
for (bn = ap->in_off + 1;
diff --git a/sys/ufs/ufs/ufs_gjournal.c b/sys/ufs/ufs/ufs_gjournal.c
index 4d6fb0e..807393d 100644
--- a/sys/ufs/ufs/ufs_gjournal.c
+++ b/sys/ufs/ufs/ufs_gjournal.c
@@ -65,20 +65,23 @@ ufs_gjournal_modref(struct vnode *vp, int count)
ino_t ino;
ip = VTOI(vp);
- ump = ip->i_ump;
- fs = ip->i_fs;
- devvp = ip->i_devvp;
+ ump = VFSTOUFS(vp->v_mount);
+ fs = ump->um_fs;
+ devvp = ump->um_devvp;
ino = ip->i_number;
cg = ino_to_cg(fs, ino);
- if (devvp->v_type != VCHR) {
+ if (devvp->v_type == VREG) {
/* devvp is a snapshot */
- dev = VTOI(devvp)->i_devvp->v_rdev;
+ dev = VFSTOUFS(devvp->v_mount)->um_devvp->v_rdev;
cgbno = fragstoblks(fs, cgtod(fs, cg));
- } else {
+ } else if (devvp->v_type == VCHR) {
/* devvp is a normal disk device */
dev = devvp->v_rdev;
cgbno = fsbtodb(fs, cgtod(fs, cg));
+ } else {
+ bp = NULL;
+ return (EIO);
}
if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg)
panic("ufs_gjournal_modref: range: dev = %s, ino = %lu, fs = %s",
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index e2825b5..aeaa7c8 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -125,7 +125,7 @@ ufs_inactive(ap)
}
}
isize = ip->i_size;
- if (ip->i_ump->um_fstype == UFS2)
+ if (I_IS_UFS2(ip))
isize += ip->i_din2->di_extsize;
if (ip->i_effnlink <= 0 && isize && !UFS_RDONLY(ip))
error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL, NOCRED);
@@ -214,7 +214,6 @@ ufs_reclaim(ap)
{
struct vnode *vp = ap->a_vp;
struct inode *ip = VTOI(vp);
- struct ufsmount *ump = ip->i_ump;
ufs_prepare_reclaim(vp);
@@ -233,6 +232,6 @@ ufs_reclaim(ap)
VI_LOCK(vp);
vp->v_data = 0;
VI_UNLOCK(vp);
- UFS_IFREE(ump, ip);
+ UFS_IFREE(ITOUMP(ip), ip);
return (0);
}
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index ccc4962..fe8a283 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -232,13 +232,13 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct ucred *cred, int flags)
/* Reset timer when crossing soft limit */
if (dq->dq_curblocks + change >= dq->dq_bsoftlimit &&
dq->dq_curblocks < dq->dq_bsoftlimit)
- dq->dq_btime = time_second + ip->i_ump->um_btime[i];
+ dq->dq_btime = time_second + ITOUMP(ip)->um_btime[i];
dq->dq_curblocks += change;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
if (warn)
uprintf("\n%s: warning, %s disk quota exceeded\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[i]);
}
return (0);
@@ -264,7 +264,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t change, struct ucred *cred,
dq->dq_flags |= DQ_BLKS;
DQI_UNLOCK(dq);
uprintf("\n%s: write failed, %s disk limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[type]);
return (EDQUOT);
}
@@ -277,7 +277,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t change, struct ucred *cred,
*/
if (ncurblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) {
if (dq->dq_curblocks < dq->dq_bsoftlimit) {
- dq->dq_btime = time_second + ip->i_ump->um_btime[type];
+ dq->dq_btime = time_second + ITOUMP(ip)->um_btime[type];
if (ip->i_uid == cred->cr_uid)
*warn = 1;
return (0);
@@ -289,7 +289,7 @@ chkdqchg(struct inode *ip, ufs2_daddr_t change, struct ucred *cred,
DQI_UNLOCK(dq);
uprintf("\n%s: write failed, %s "
"disk quota exceeded for too long\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[type]);
return (EDQUOT);
}
@@ -370,13 +370,13 @@ chkiq(struct inode *ip, int change, struct ucred *cred, int flags)
/* Reset timer when crossing soft limit */
if (dq->dq_curinodes + change >= dq->dq_isoftlimit &&
dq->dq_curinodes < dq->dq_isoftlimit)
- dq->dq_itime = time_second + ip->i_ump->um_itime[i];
+ dq->dq_itime = time_second + ITOUMP(ip)->um_itime[i];
dq->dq_curinodes += change;
dq->dq_flags |= DQ_MOD;
DQI_UNLOCK(dq);
if (warn)
uprintf("\n%s: warning, %s inode quota exceeded\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[i]);
}
return (0);
@@ -401,7 +401,7 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
dq->dq_flags |= DQ_INODS;
DQI_UNLOCK(dq);
uprintf("\n%s: write failed, %s inode limit reached\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[type]);
return (EDQUOT);
}
@@ -414,7 +414,7 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
*/
if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
if (dq->dq_curinodes < dq->dq_isoftlimit) {
- dq->dq_itime = time_second + ip->i_ump->um_itime[type];
+ dq->dq_itime = time_second + ITOUMP(ip)->um_itime[type];
if (ip->i_uid == cred->cr_uid)
*warn = 1;
return (0);
@@ -426,7 +426,7 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
DQI_UNLOCK(dq);
uprintf("\n%s: write failed, %s "
"inode quota exceeded for too long\n",
- ITOV(ip)->v_mount->mnt_stat.f_mntonname,
+ ITOVFS(ip)->mnt_stat.f_mntonname,
quotatypes[type]);
return (EDQUOT);
}
@@ -445,10 +445,13 @@ chkiqchg(struct inode *ip, int change, struct ucred *cred, int type, int *warn)
static void
chkdquot(struct inode *ip)
{
- struct ufsmount *ump = ip->i_ump;
- struct vnode *vp = ITOV(ip);
+ struct ufsmount *ump;
+ struct vnode *vp;
int i;
+ ump = ITOUMP(ip);
+ vp = ITOV(ip);
+
/*
* Disk quotas must be turned off for system files. Currently
* these are snapshots and quota files.
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 07e59aa..5d5a93d 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -456,7 +456,7 @@ ufs_getattr(ap)
VI_LOCK(vp);
ufs_itimes_locked(vp);
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
vap->va_atime.tv_sec = ip->i_din1->di_atime;
vap->va_atime.tv_nsec = ip->i_din1->di_atimensec;
} else {
@@ -467,13 +467,13 @@ ufs_getattr(ap)
/*
* Copy from inode table
*/
- vap->va_fsid = dev2udev(ip->i_dev);
+ vap->va_fsid = dev2udev(ITOUMP(ip)->um_dev);
vap->va_fileid = ip->i_number;
vap->va_mode = ip->i_mode & ~IFMT;
vap->va_nlink = ip->i_effnlink;
vap->va_uid = ip->i_uid;
vap->va_gid = ip->i_gid;
- if (ip->i_ump->um_fstype == UFS1) {
+ if (I_IS_UFS1(ip)) {
vap->va_rdev = ip->i_din1->di_rdev;
vap->va_size = ip->i_din1->di_size;
vap->va_mtime.tv_sec = ip->i_din1->di_mtime;
@@ -651,8 +651,7 @@ ufs_setattr(ap)
DIP_SET(ip, i_mtime, vap->va_mtime.tv_sec);
DIP_SET(ip, i_mtimensec, vap->va_mtime.tv_nsec);
}
- if (vap->va_birthtime.tv_sec != VNOVAL &&
- ip->i_ump->um_fstype == UFS2) {
+ if (vap->va_birthtime.tv_sec != VNOVAL && I_IS_UFS2(ip)) {
ip->i_din2->di_birthtime = vap->va_birthtime.tv_sec;
ip->i_din2->di_birthnsec = vap->va_birthtime.tv_nsec;
}
@@ -1347,7 +1346,7 @@ relock:
* expunge the original entry's existence.
*/
if (tip == NULL) {
- if (tdp->i_dev != fip->i_dev)
+ if (ITODEV(tdp) != ITODEV(fip))
panic("ufs_rename: EXDEV");
if (doingdirectory && newparent) {
/*
@@ -1371,7 +1370,7 @@ relock:
tdp->i_endoff < tdp->i_size)
endoff = tdp->i_endoff;
} else {
- if (tip->i_dev != tdp->i_dev || tip->i_dev != fip->i_dev)
+ if (ITODEV(tip) != ITODEV(tdp) || ITODEV(tip) != ITODEV(fip))
panic("ufs_rename: EXDEV");
/*
* Short circuit rename(foo, foo).
@@ -2301,12 +2300,9 @@ ufs_strategy(ap)
{
struct buf *bp = ap->a_bp;
struct vnode *vp = ap->a_vp;
- struct bufobj *bo;
- struct inode *ip;
ufs2_daddr_t blkno;
int error;
- ip = VTOI(vp);
if (bp->b_blkno == bp->b_lblkno) {
error = ufs_bmaparray(vp, bp->b_lblkno, &blkno, bp, NULL, NULL);
bp->b_blkno = blkno;
@@ -2324,8 +2320,7 @@ ufs_strategy(ap)
return (0);
}
bp->b_iooffset = dbtob(bp->b_blkno);
- bo = ip->i_umbufobj;
- BO_STRATEGY(bo, bp);
+ BO_STRATEGY(VFSTOUFS(vp->v_mount)->um_bo, bp);
return (0);
}
@@ -2342,7 +2337,7 @@ ufs_print(ap)
struct inode *ip = VTOI(vp);
printf("\tino %lu, on dev %s", (u_long)ip->i_number,
- devtoname(ip->i_dev));
+ devtoname(ITODEV(ip)));
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
printf("\n");
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 838c1e3..e0212e0 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -108,8 +108,8 @@ struct ufsmount {
#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
#define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb))
-#define UFS_RDONLY(aa) ((aa)->i_ump->um_rdonly(aa))
-#define UFS_SNAPGONE(aa) ((aa)->i_ump->um_snapgone(aa))
+#define UFS_RDONLY(aa) (ITOUMP(aa)->um_rdonly(aa))
+#define UFS_SNAPGONE(aa) (ITOUMP(aa)->um_snapgone(aa))
#define UFS_LOCK(aa) mtx_lock(&(aa)->um_lock)
#define UFS_UNLOCK(aa) mtx_unlock(&(aa)->um_lock)
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 17d722f..04cd349 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -990,22 +990,21 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dstobject,
* page and return TRUE if it does, FALSE if it doesn't.
*
* If TRUE, we also try to determine how much valid, contiguous backing
- * store exists before and after the requested page within a reasonable
- * distance. We do not try to restrict it to the swap device stripe
- * (that is handled in getpages/putpages). It probably isn't worth
- * doing here.
+ * store exists before and after the requested page.
*/
static boolean_t
-swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after)
+swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
+ int *after)
{
- daddr_t blk0;
+ daddr_t blk, blk0;
+ int i;
VM_OBJECT_ASSERT_LOCKED(object);
+
/*
* do we have good backing store at the requested index ?
*/
blk0 = swp_pager_meta_ctl(object, pindex, 0);
-
if (blk0 == SWAPBLK_NONE) {
if (before)
*before = 0;
@@ -1018,34 +1017,26 @@ swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *aft
* find backwards-looking contiguous good backing store
*/
if (before != NULL) {
- int i;
-
- for (i = 1; i < (SWB_NPAGES/2); ++i) {
- daddr_t blk;
-
+ for (i = 1; i < SWB_NPAGES; i++) {
if (i > pindex)
break;
blk = swp_pager_meta_ctl(object, pindex - i, 0);
if (blk != blk0 - i)
break;
}
- *before = (i - 1);
+ *before = i - 1;
}
/*
* find forward-looking contiguous good backing store
*/
if (after != NULL) {
- int i;
-
- for (i = 1; i < (SWB_NPAGES/2); ++i) {
- daddr_t blk;
-
+ for (i = 1; i < SWB_NPAGES; i++) {
blk = swp_pager_meta_ctl(object, pindex + i, 0);
if (blk != blk0 + i)
break;
}
- *after = (i - 1);
+ *after = i - 1;
}
return (TRUE);
}
@@ -1077,62 +1068,108 @@ swap_pager_unswapped(vm_page_t m)
}
/*
- * SWAP_PAGER_GETPAGES() - bring pages in from swap
+ * swap_pager_getpages() - bring pages in from swap
*
- * Attempt to retrieve (m, count) pages from backing store, but make
- * sure we retrieve at least m[reqpage]. We try to load in as large
- * a chunk surrounding m[reqpage] as is contiguous in swap and which
- * belongs to the same object.
+ * Attempt to page in the pages in array "m" of length "count". The caller
+ * may optionally specify that additional pages preceding and succeeding
+ * the specified range be paged in. The number of such pages is returned
+ * in the "rbehind" and "rahead" parameters, and they will be in the
+ * inactive queue upon return.
*
- * The code is designed for asynchronous operation and
- * immediate-notification of 'reqpage' but tends not to be
- * used that way. Please do not optimize-out this algorithmic
- * feature, I intend to improve on it in the future.
- *
- * The parent has a single vm_object_pip_add() reference prior to
- * calling us and we should return with the same.
- *
- * The parent has BUSY'd the pages. We should return with 'm'
- * left busy, but the others adjusted.
+ * The pages in "m" must be busied and will remain busied upon return.
*/
static int
swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
int *rahead)
{
struct buf *bp;
+ vm_page_t mpred, msucc, p;
+ vm_pindex_t pindex;
daddr_t blk;
+ int i, j, maxahead, maxbehind, reqcount, shift;
- /*
- * Calculate range to retrieve. The pages have already been assigned
- * their swapblks. We require a *contiguous* range but we know it to
- * not span devices. If we do not supply it, bad things
- * happen. Note that blk, iblk & jblk can be SWAPBLK_NONE, but the
- * loops are set up such that the case(s) are handled implicitly.
- *
- * The swp_*() calls must be made with the object locked.
- */
- blk = swp_pager_meta_ctl(m[0]->object, m[0]->pindex, 0);
+ reqcount = count;
- if (blk == SWAPBLK_NONE)
- return (VM_PAGER_FAIL);
+ VM_OBJECT_WUNLOCK(object);
+ bp = getpbuf(&nsw_rcount);
+ VM_OBJECT_WLOCK(object);
-#ifdef INVARIANTS
- for (int i = 0; i < count; i++)
- KASSERT(blk + i ==
- swp_pager_meta_ctl(m[i]->object, m[i]->pindex, 0),
- ("%s: range is not contiguous", __func__));
-#endif
+ if (!swap_pager_haspage(object, m[0]->pindex, &maxbehind, &maxahead)) {
+ relpbuf(bp, &nsw_rcount);
+ return (VM_PAGER_FAIL);
+ }
/*
- * Getpbuf() can sleep.
+ * Clip the readahead and readbehind ranges to exclude resident pages.
*/
- VM_OBJECT_WUNLOCK(object);
+ if (rahead != NULL) {
+ KASSERT(reqcount - 1 <= maxahead,
+ ("page count %d extends beyond swap block", reqcount));
+ *rahead = imin(*rahead, maxahead - (reqcount - 1));
+ pindex = m[reqcount - 1]->pindex;
+ msucc = TAILQ_NEXT(m[reqcount - 1], listq);
+ if (msucc != NULL && msucc->pindex - pindex - 1 < *rahead)
+ *rahead = msucc->pindex - pindex - 1;
+ }
+ if (rbehind != NULL) {
+ *rbehind = imin(*rbehind, maxbehind);
+ pindex = m[0]->pindex;
+ mpred = TAILQ_PREV(m[0], pglist, listq);
+ if (mpred != NULL && pindex - mpred->pindex - 1 < *rbehind)
+ *rbehind = pindex - mpred->pindex - 1;
+ }
+
/*
- * Get a swap buffer header to perform the IO
+ * Allocate readahead and readbehind pages.
*/
- bp = getpbuf(&nsw_rcount);
- bp->b_flags |= B_PAGING;
+ shift = rbehind != NULL ? *rbehind : 0;
+ if (shift != 0) {
+ for (i = 1; i <= shift; i++) {
+ p = vm_page_alloc(object, m[0]->pindex - i,
+ VM_ALLOC_NORMAL | VM_ALLOC_IFNOTCACHED);
+ if (p == NULL) {
+ /* Shift allocated pages to the left. */
+ for (j = 0; j < i - 1; j++)
+ bp->b_pages[j] =
+ bp->b_pages[j + shift - i + 1];
+ break;
+ }
+ bp->b_pages[shift - i] = p;
+ }
+ shift = i - 1;
+ *rbehind = shift;
+ }
+ for (i = 0; i < reqcount; i++)
+ bp->b_pages[i + shift] = m[i];
+ if (rahead != NULL) {
+ for (i = 0; i < *rahead; i++) {
+ p = vm_page_alloc(object,
+ m[reqcount - 1]->pindex + i + 1,
+ VM_ALLOC_NORMAL | VM_ALLOC_IFNOTCACHED);
+ if (p == NULL)
+ break;
+ bp->b_pages[shift + reqcount + i] = p;
+ }
+ *rahead = i;
+ }
+ if (rbehind != NULL)
+ count += *rbehind;
+ if (rahead != NULL)
+ count += *rahead;
+
+ vm_object_pip_add(object, count);
+
+ for (i = 0; i < count; i++)
+ bp->b_pages[i]->oflags |= VPO_SWAPINPROG;
+
+ pindex = bp->b_pages[0]->pindex;
+ blk = swp_pager_meta_ctl(object, pindex, 0);
+ KASSERT(blk != SWAPBLK_NONE,
+ ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex));
+ VM_OBJECT_WUNLOCK(object);
+
+ bp->b_flags |= B_PAGING;
bp->b_iocmd = BIO_READ;
bp->b_iodone = swp_pager_async_iodone;
bp->b_rcred = crhold(thread0.td_ucred);
@@ -1141,22 +1178,11 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
bp->b_bcount = PAGE_SIZE * count;
bp->b_bufsize = PAGE_SIZE * count;
bp->b_npages = count;
-
- VM_OBJECT_WLOCK(object);
- for (int i = 0; i < count; i++) {
- bp->b_pages[i] = m[i];
- m[i]->oflags |= VPO_SWAPINPROG;
- }
+ bp->b_pgbefore = rbehind != NULL ? *rbehind : 0;
+ bp->b_pgafter = rahead != NULL ? *rahead : 0;
PCPU_INC(cnt.v_swapin);
- PCPU_ADD(cnt.v_swappgsin, bp->b_npages);
-
- /*
- * We still hold the lock on mreq, and our automatic completion routine
- * does not remove it.
- */
- vm_object_pip_add(object, bp->b_npages);
- VM_OBJECT_WUNLOCK(object);
+ PCPU_ADD(cnt.v_swappgsin, count);
/*
* perform the I/O. NOTE!!! bp cannot be considered valid after
@@ -1173,9 +1199,9 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
swp_pager_strategy(bp);
/*
- * wait for the page we want to complete. VPO_SWAPINPROG is always
+ * Wait for the pages we want to complete. VPO_SWAPINPROG is always
* cleared on completion. If an I/O error occurs, SWAPBLK_NONE
- * is set in the meta-data.
+ * is set in the metadata for each page in the request.
*/
VM_OBJECT_WLOCK(object);
while ((m[0]->oflags & VPO_SWAPINPROG) != 0) {
@@ -1192,15 +1218,10 @@ swap_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
/*
* If we had an unrecoverable read error pages will not be valid.
*/
- for (int i = 0; i < count; i++)
+ for (i = 0; i < reqcount; i++)
if (m[i]->valid != VM_PAGE_BITS_ALL)
return (VM_PAGER_ERROR);
- if (rbehind)
- *rbehind = 0;
- if (rahead)
- *rahead = 0;
-
return (VM_PAGER_OK);
/*
@@ -1518,7 +1539,11 @@ swp_pager_async_iodone(struct buf *bp)
("swp_pager_async_iodone: page %p is mapped", m));
KASSERT(m->dirty == 0,
("swp_pager_async_iodone: page %p is dirty", m));
+
m->valid = VM_PAGE_BITS_ALL;
+ if (i < bp->b_pgbefore ||
+ i >= bp->b_npages - bp->b_pgafter)
+ vm_page_readahead_finish(m);
} else {
/*
* For write success, clear the dirty
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index b64e911..47cdc6c 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1030,8 +1030,8 @@ vm_page_free_zero(vm_page_t m)
}
/*
- * Unbusy and handle the page queueing for a page from the VOP_GETPAGES()
- * array which was optionally read ahead or behind.
+ * Unbusy and handle the page queueing for a page from a getpages request that
+ * was optionally read ahead or behind.
*/
void
vm_page_readahead_finish(vm_page_t m)
diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 241a769..e884c86 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -135,10 +135,11 @@ madt_setup_local(void)
const char *reason;
char *hw_vendor;
u_int p[4];
+ int user_x2apic;
+ bool bios_x2apic;
madt = pmap_mapbios(madt_physaddr, madt_length);
if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
- x2apic_mode = 1;
reason = NULL;
/*
@@ -150,21 +151,17 @@ madt_setup_local(void)
if (dmartbl_physaddr != 0) {
dmartbl = acpi_map_table(dmartbl_physaddr,
ACPI_SIG_DMAR);
- if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0) {
- x2apic_mode = 0;
+ if ((dmartbl->Flags & ACPI_DMAR_X2APIC_OPT_OUT) != 0)
reason = "by DMAR table";
- }
acpi_unmap_table(dmartbl);
}
if (vm_guest == VM_GUEST_VMWARE) {
vmware_hvcall(VMW_HVCMD_GETVCPU_INFO, p);
if ((p[0] & VMW_VCPUINFO_VCPU_RESERVED) != 0 ||
- (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0) {
- x2apic_mode = 0;
- reason = "inside VMWare without intr redirection";
- }
+ (p[0] & VMW_VCPUINFO_LEGACY_X2APIC) == 0)
+ reason =
+ "inside VMWare without intr redirection";
} else if (vm_guest == VM_GUEST_XEN) {
- x2apic_mode = 0;
reason = "due to running under XEN";
} else if (vm_guest == VM_GUEST_NO &&
CPUID_TO_FAMILY(cpu_id) == 0x6 &&
@@ -184,16 +181,33 @@ madt_setup_local(void)
if (!strcmp(hw_vendor, "LENOVO") ||
!strcmp(hw_vendor,
"ASUSTeK Computer Inc.")) {
- x2apic_mode = 0;
reason =
"for a suspected SandyBridge BIOS bug";
}
freeenv(hw_vendor);
}
}
- TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode);
- if (!x2apic_mode && reason != NULL && bootverbose)
+ bios_x2apic = lapic_is_x2apic();
+ if (reason != NULL && bios_x2apic) {
+ if (bootverbose)
+ printf("x2APIC should be disabled %s but "
+ "already enabled by BIOS; enabling.\n",
+ reason);
+ reason = NULL;
+ }
+ if (reason == NULL)
+ x2apic_mode = 1;
+ else if (bootverbose)
printf("x2APIC available but disabled %s\n", reason);
+ user_x2apic = x2apic_mode;
+ TUNABLE_INT_FETCH("hw.x2apic_enable", &user_x2apic);
+ if (user_x2apic != x2apic_mode) {
+ if (bios_x2apic && !user_x2apic)
+ printf("x2APIC disabled by tunable and "
+ "enabled by BIOS; ignoring tunable.");
+ else
+ x2apic_mode = user_x2apic;
+ }
}
lapic_init(madt->Address);
diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 1ddb69e..09c3a63 100644
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -206,6 +206,7 @@ struct apic_ops {
void (*create)(u_int, int);
void (*init)(vm_paddr_t);
void (*xapic_mode)(void);
+ bool (*is_x2apic)(void);
void (*setup)(int);
void (*dump)(const char *);
void (*disable)(void);
@@ -268,6 +269,13 @@ lapic_xapic_mode(void)
apic_ops.xapic_mode();
}
+static inline bool
+lapic_is_x2apic(void)
+{
+
+ return (apic_ops.is_x2apic());
+}
+
static inline void
lapic_setup(int boot)
{
diff --git a/sys/x86/iommu/intel_reg.h b/sys/x86/iommu/intel_reg.h
index 33e37ac..b9a70b6 100644
--- a/sys/x86/iommu/intel_reg.h
+++ b/sys/x86/iommu/intel_reg.h
@@ -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
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index cd774df..d9a3453 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -269,6 +269,16 @@ native_lapic_enable_x2apic(void)
wrmsr(MSR_APICBASE, apic_base);
}
+static bool
+native_lapic_is_x2apic(void)
+{
+ uint64_t apic_base;
+
+ apic_base = rdmsr(MSR_APICBASE);
+ return ((apic_base & (APICBASE_X2APIC | APICBASE_ENABLED)) ==
+ (APICBASE_X2APIC | APICBASE_ENABLED));
+}
+
static void lapic_enable(void);
static void lapic_resume(struct pic *pic, bool suspend_cancelled);
static void lapic_timer_oneshot(struct lapic *);
@@ -329,6 +339,7 @@ struct apic_ops apic_ops = {
.create = native_lapic_create,
.init = native_lapic_init,
.xapic_mode = native_lapic_xapic_mode,
+ .is_x2apic = native_lapic_is_x2apic,
.setup = native_lapic_setup,
.dump = native_lapic_dump,
.disable = native_lapic_disable,
diff --git a/sys/x86/xen/xen_apic.c b/sys/x86/xen/xen_apic.c
index 4d7a39b..45c3c18 100644
--- a/sys/x86/xen/xen_apic.c
+++ b/sys/x86/xen/xen_apic.c
@@ -139,6 +139,13 @@ xen_pv_lapic_disable(void)
}
+static bool
+xen_pv_lapic_is_x2apic(void)
+{
+
+ return (false);
+}
+
static void
xen_pv_lapic_eoi(void)
{
@@ -351,6 +358,7 @@ struct apic_ops xen_apic_ops = {
.create = xen_pv_lapic_create,
.init = xen_pv_lapic_init,
.xapic_mode = xen_pv_lapic_disable,
+ .is_x2apic = xen_pv_lapic_is_x2apic,
.setup = xen_pv_lapic_setup,
.dump = xen_pv_lapic_dump,
.disable = xen_pv_lapic_disable,
diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend
index 2b1d3d3..f12f240 100644
--- a/targets/pseudo/userland/Makefile.depend
+++ b/targets/pseudo/userland/Makefile.depend
@@ -325,6 +325,7 @@ DIRDEPS+= \
usr.bin/pr \
usr.bin/printenv \
usr.bin/printf \
+ usr.bin/proccontrol \
usr.bin/procstat \
usr.bin/protect \
usr.bin/quota \
diff --git a/tools/tools/dmardump/Makefile b/tools/tools/dmardump/Makefile
new file mode 100644
index 0000000..67b3243
--- /dev/null
+++ b/tools/tools/dmardump/Makefile
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+PROG= dmardump
+SRCS= dmardump.c
+MAN=
+
+# Pull in bits from acpidump
+ACPIDUMP=${.CURDIR}/../../../usr.sbin/acpi/acpidump
+.PATH: ${ACPIDUMP}
+SRCS+= acpi_user.c acpi.c
+CFLAGS+= -I${ACPIDUMP}
+
+CFLAGS+= -I${.CURDIR}/../../../sys
+
+.include <bsd.prog.mk>
diff --git a/tools/tools/dmardump/dmardump.c b/tools/tools/dmardump/dmardump.c
new file mode 100644
index 0000000..43a2779
--- /dev/null
+++ b/tools/tools/dmardump/dmardump.c
@@ -0,0 +1,292 @@
+/*-
+ * Copyright (c) 2016 Chelsio Communications, Inc.
+ * All rights reserved.
+ * Written by: John Baldwin <jhb@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/endian.h>
+#include <sys/pciio.h>
+#include <sys/queue.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <x86/iommu/intel_reg.h>
+
+#include "acpidump.h"
+
+int tflag;
+int vflag;
+
+static uint32_t
+read_4(char *regs, size_t offset)
+{
+ return *(uint32_t *)(regs + offset);
+}
+
+static uint64_t
+read_8(char *regs, size_t offset)
+{
+ return *(uint64_t *)(regs + offset);
+}
+
+static struct pci_conf *
+pci_find_conf(int segment, int bus, int slot, int func)
+{
+ static int pcifd = -1;
+ static struct pci_conf conf;
+ struct pci_conf_io pc;
+ struct pci_match_conf patterns[1];
+
+ if (pcifd == -1) {
+ pcifd = open("/dev/pci", O_RDONLY);
+ if (pcifd < 0)
+ err(1, "Failed to open /dev/pci");
+ }
+
+ bzero(&pc, sizeof(pc));
+ pc.match_buf_len = sizeof(conf);
+ pc.matches = &conf;
+ bzero(&patterns, sizeof(patterns));
+ patterns[0].pc_sel.pc_domain = segment;
+ patterns[0].pc_sel.pc_bus = bus;
+ patterns[0].pc_sel.pc_dev = slot;
+ patterns[0].pc_sel.pc_func = func;
+ patterns[0].flags = PCI_GETCONF_MATCH_DOMAIN |
+ PCI_GETCONF_MATCH_BUS | PCI_GETCONF_MATCH_DEV |
+ PCI_GETCONF_MATCH_FUNC;
+ pc.num_patterns = 1;
+ pc.pat_buf_len = sizeof(patterns);
+ pc.patterns = patterns;
+ if (ioctl(pcifd, PCIOCGETCONF, &pc) == -1)
+ err(1, "ioctl(PCIOCGETCONF)");
+
+ if (pc.status != PCI_GETCONF_LAST_DEVICE ||
+ pc.num_matches == 0)
+ return (NULL);
+
+ return (&conf);
+}
+
+static void
+dump_context_table(int segment, int bus, uint64_t base_addr)
+{
+ struct dmar_ctx_entry *ctx;
+ struct pci_conf *conf;
+ bool printed;
+ int idx;
+
+ printed = false;
+ ctx = acpi_map_physical(base_addr, DMAR_PAGE_SIZE);
+ for (idx = 0; idx < DMAR_CTX_CNT; idx++) {
+ if (!(ctx[idx].ctx1 & DMAR_CTX1_P))
+ continue;
+ if (!printed) {
+ printf("\tPCI bus %d:\n", bus);
+ printed = true;
+ }
+
+ /* Check for ARI device first. */
+ conf = pci_find_conf(segment, bus, 0, idx);
+ if (conf == NULL)
+ conf = pci_find_conf(segment, bus, idx >> 3, idx & 7);
+ if (conf != NULL) {
+ printf("\t { %d,%d }", conf->pc_sel.pc_dev,
+ conf->pc_sel.pc_func);
+ if (conf->pd_name[0] != '\0')
+ printf(" (%s%lu)", conf->pd_name,
+ conf->pd_unit);
+ } else
+ printf("\t { %d,%d } (absent)", idx >> 3,
+ idx & 7);
+ if (ctx[idx].ctx1 & DMAR_CTX1_FPD)
+ printf(" FPD");
+ switch (ctx[idx].ctx1 & 0xc) {
+ case DMAR_CTX1_T_UNTR:
+ printf(" UNTR");
+ break;
+ case DMAR_CTX1_T_TR:
+ printf(" TR");
+ break;
+ case DMAR_CTX1_T_PASS:
+ printf(" PASS");
+ break;
+ default:
+ printf(" TT3?");
+ break;
+ }
+ printf(" SLPT %#jx", (uintmax_t)(ctx[idx].ctx1 &
+ DMAR_CTX1_ASR_MASK));
+ printf(" domain %d", (int)DMAR_CTX2_GET_DID(ctx[idx].ctx2));
+ printf("\n");
+ }
+}
+
+static void
+handle_drhd(int segment, uint64_t base_addr)
+{
+ struct dmar_root_entry *root_table;
+ char *regs;
+ uint64_t rtaddr;
+ uint32_t gsts, ver;
+ bool extended;
+ int bus;
+
+ regs = acpi_map_physical(base_addr, 4096);
+
+ ver = read_4(regs, DMAR_VER_REG);
+ gsts = read_4(regs, DMAR_GSTS_REG);
+ printf("drhd @ %#jx (version %d.%d) PCI segment %d%s:\n",
+ (uintmax_t)base_addr, DMAR_MAJOR_VER(ver), DMAR_MINOR_VER(ver),
+ segment, gsts & DMAR_GSTS_TES ? "" : " (disabled)");
+ if ((gsts & (DMAR_GSTS_TES | DMAR_GSTS_RTPS)) !=
+ (DMAR_GSTS_TES | DMAR_GSTS_RTPS))
+ return;
+ rtaddr = read_8(regs, DMAR_RTADDR_REG);
+ extended = (rtaddr & DMAR_RTADDR_RTT) != 0;
+ printf(" %sroot table @ 0x%#jx\n", extended ? "extended " : "",
+ rtaddr & DMAR_RTADDR_RTA_MASK);
+ root_table = acpi_map_physical(rtaddr & DMAR_RTADDR_RTA_MASK, 4096);
+ for (bus = 0; bus < 255; bus++) {
+ if (extended) {
+#ifdef notyet
+ if (root_table[bus].r1 & DMAR_ROOT_R1_P)
+ dump_ext_context_table(segment, bus,
+ root_table[bus].r1 & DMAR_ROOT_R1_CTP_MASK,
+ false);
+ if (root_table[bus].r2 & DMAR_ROOT_R1_P)
+ dump_ext_context_table(segment, bus,
+ root_table[bus].r2 & DMAR_ROOT_R1_CTP_MASK,
+ true);
+#endif
+ } else if (root_table[bus].r1 & DMAR_ROOT_R1_P)
+ dump_context_table(segment, bus, root_table[bus].r1 &
+ DMAR_ROOT_R1_CTP_MASK);
+ }
+}
+
+/* Borrowed from acpi.c in acpidump: */
+
+static void
+acpi_handle_dmar_drhd(ACPI_DMAR_HARDWARE_UNIT *drhd)
+{
+
+ handle_drhd(drhd->Segment, drhd->Address);
+}
+
+static int
+acpi_handle_dmar_remapping_structure(void *addr, int remaining)
+{
+ ACPI_DMAR_HEADER *hdr = addr;
+
+ if (remaining < (int)sizeof(ACPI_DMAR_HEADER))
+ return (-1);
+
+ if (remaining < hdr->Length)
+ return (-1);
+
+ switch (hdr->Type) {
+ case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+ acpi_handle_dmar_drhd(addr);
+ break;
+ }
+ return (hdr->Length);
+}
+
+static void
+acpi_handle_dmar(ACPI_TABLE_HEADER *sdp)
+{
+ char *cp;
+ int remaining, consumed;
+ ACPI_TABLE_DMAR *dmar;
+
+ dmar = (ACPI_TABLE_DMAR *)sdp;
+ remaining = sdp->Length - sizeof(ACPI_TABLE_DMAR);
+ while (remaining > 0) {
+ cp = (char *)sdp + sdp->Length - remaining;
+ consumed = acpi_handle_dmar_remapping_structure(cp, remaining);
+ if (consumed <= 0)
+ break;
+ else
+ remaining -= consumed;
+ }
+}
+
+static ACPI_TABLE_HEADER *
+acpi_map_sdt(vm_offset_t pa)
+{
+ ACPI_TABLE_HEADER *sp;
+
+ sp = acpi_map_physical(pa, sizeof(ACPI_TABLE_HEADER));
+ sp = acpi_map_physical(pa, sp->Length);
+ return (sp);
+}
+
+static void
+walk_rsdt(ACPI_TABLE_HEADER *rsdp)
+{
+ ACPI_TABLE_HEADER *sdp;
+ ACPI_TABLE_RSDT *rsdt;
+ ACPI_TABLE_XSDT *xsdt;
+ vm_offset_t addr;
+ int addr_size, entries, i;
+
+ if (memcmp(rsdp->Signature, "RSDT", 4) != 0)
+ addr_size = sizeof(uint32_t);
+ else
+ addr_size = sizeof(uint64_t);
+ rsdt = (ACPI_TABLE_RSDT *)rsdp;
+ xsdt = (ACPI_TABLE_XSDT *)rsdp;
+ entries = (rsdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size;
+ for (i = 0; i < entries; i++) {
+ if (addr_size == 4)
+ addr = le32toh(rsdt->TableOffsetEntry[i]);
+ else
+ addr = le64toh(xsdt->TableOffsetEntry[i]);
+ if (addr == 0)
+ continue;
+ sdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(addr);
+ if (acpi_checksum(sdp, sdp->Length)) {
+ continue;
+ }
+ if (!memcmp(sdp->Signature, ACPI_SIG_DMAR, 4))
+ acpi_handle_dmar(sdp);
+ }
+}
+
+int
+main(int argc __unused, char *argv[] __unused)
+{
+ ACPI_TABLE_HEADER *rsdt;
+
+ rsdt = sdt_load_devmem();
+ walk_rsdt(rsdt);
+ return 0;
+}
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 1f0c664..b87c26a 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -122,6 +122,7 @@ SUBDIR= alias \
pr \
printenv \
printf \
+ proccontrol \
procstat \
protect \
rctl \
diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1
index 246a397..856818a 100644
--- a/usr.bin/mkimg/mkimg.1
+++ b/usr.bin/mkimg/mkimg.1
@@ -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 .
diff --git a/usr.bin/nfsstat/Makefile b/usr.bin/nfsstat/Makefile
index e45b5e2..c74815a 100644
--- a/usr.bin/nfsstat/Makefile
+++ b/usr.bin/nfsstat/Makefile
@@ -4,4 +4,6 @@
PROG= nfsstat
CFLAGS+=-DNFS
+LIBADD+= devstat
+
.include <bsd.prog.mk>
diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1
index 6568c6a..15d3eff 100644
--- a/usr.bin/nfsstat/nfsstat.1
+++ b/usr.bin/nfsstat/nfsstat.1
@@ -28,7 +28,7 @@
.\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 23, 2015
+.Dd August 13, 2016
.Dt NFSSTAT 1
.Os
.Sh NAME
@@ -38,7 +38,7 @@
statistics
.Sh SYNOPSIS
.Nm
-.Op Fl cemszW
+.Op Fl cdemszW
.Op Fl M Ar core
.Op Fl N Ar system
.Op Fl w Ar wait
@@ -57,6 +57,28 @@ The options are as follows:
.Bl -tag -width indent
.It Fl c
Only display client side statistics.
+.It Fl d
+Display statistics for the new NFS server that are similar to those
+displayed by
+.Xr iostat 8 .
+This includes kilobytes per transfer, transfers per second, and megabytes per
+second for read, write, and all operations.
+It also includes the current queue depth, the busy percentage, and latency
+for all operations.
+If the
+.Fl W
+flag is added, commits per second, commit latency, read latency, and write
+latency are also added to the display.
+The busy percentage shown can exceed 100 at times.
+This is because of the way busy percentages are calculated.
+The busy time is calculated by adding the elapsed time between the
+last time an operation started or finished,
+and the current time.
+If there is only one operation outstanding, the "busy time" time
+will get updated with the total time of that operation.
+That means that the difference in the busy time between the two
+measurement intervals (often 1 second)
+will increase by more than the measurement interval.
.It Fl e
Report the extra statistics collected by the NFS client and
server for NFSv4.
@@ -79,7 +101,8 @@ Only display server side statistics.
Use wide format with interval short summary.
This option is especially
useful when combined with
-.Fl c
+.Fl c ,
+.Fl d ,
or
.Fl s
and a time delay.
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index 896a05b..90be295 100644
--- a/usr.bin/nfsstat/nfsstat.c
+++ b/usr.bin/nfsstat/nfsstat.c
@@ -29,6 +29,36 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+/*-
+ * Copyright (c) 2004, 2008, 2009 Silicon Graphics International Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
#ifndef lint
static const char copyright[] =
@@ -64,33 +94,58 @@ static const char rcsid[] =
#include <nlist.h>
#include <unistd.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
+#include <devstat.h>
#include <err.h>
static int widemode = 0;
static int zflag = 0;
static int printtitle = 1;
-static struct ext_nfsstats ext_nfsstats;
+static struct nfsstatsv1 ext_nfsstats;
static int extra_output = 0;
static void intpr(int, int);
-static void printhdr(int, int);
+static void printhdr(int, int, int);
static void usage(void);
static char *sperc1(int, int);
static char *sperc2(int, int);
static void exp_intpr(int, int);
-static void exp_sidewaysintpr(u_int, int, int);
+static void exp_sidewaysintpr(u_int, int, int, int);
+static void compute_new_stats(struct nfsstatsv1 *cur_stats,
+ struct nfsstatsv1 *prev_stats, int curop, long double etime,
+ long double *mbsec, long double *kb_per_transfer,
+ long double *transfers_per_second, long double *ms_per_transfer,
+ uint64_t *queue_len, long double *busy_pct);
#define DELTA(field) (nfsstats.field - lastst.field)
+#define STAT_TYPE_READ 0
+#define STAT_TYPE_WRITE 1
+#define STAT_TYPE_COMMIT 2
+#define NUM_STAT_TYPES 3
+
+struct stattypes {
+ int stat_type;
+ int nfs_type;
+};
+static struct stattypes statstruct[] = {
+ {STAT_TYPE_READ, NFSV4OP_READ},
+ {STAT_TYPE_WRITE, NFSV4OP_WRITE},
+ {STAT_TYPE_COMMIT, NFSV4OP_COMMIT}
+};
+
+#define STAT_TYPE_TO_NFS(stat_type) statstruct[stat_type].nfs_type
+
int
main(int argc, char **argv)
{
u_int interval;
int clientOnly = -1;
int serverOnly = -1;
+ int newStats = 0;
int ch;
char *memf, *nlistf;
int mntlen, i;
@@ -100,7 +155,7 @@ main(int argc, char **argv)
interval = 0;
memf = nlistf = NULL;
- while ((ch = getopt(argc, argv, "cesWM:mN:w:z")) != -1)
+ while ((ch = getopt(argc, argv, "cdesWM:mN:w:z")) != -1)
switch(ch) {
case 'M':
memf = optarg;
@@ -140,6 +195,11 @@ main(int argc, char **argv)
if (serverOnly < 0)
serverOnly = 0;
break;
+ case 'd':
+ newStats = 1;
+ if (interval == 0)
+ interval = 1;
+ break;
case 's':
serverOnly = 1;
if (clientOnly < 0)
@@ -173,7 +233,8 @@ main(int argc, char **argv)
errx(1, "NFS client/server not loaded");
if (interval) {
- exp_sidewaysintpr(interval, clientOnly, serverOnly);
+ exp_sidewaysintpr(interval, clientOnly, serverOnly,
+ newStats);
} else {
if (extra_output != 0)
exp_intpr(clientOnly, serverOnly);
@@ -191,13 +252,14 @@ intpr(int clientOnly, int serverOnly)
{
int nfssvc_flag;
- nfssvc_flag = NFSSVC_GETSTATS;
+ nfssvc_flag = NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT;
if (zflag != 0) {
if (clientOnly != 0)
nfssvc_flag |= NFSSVC_ZEROCLTSTATS;
if (serverOnly != 0)
nfssvc_flag |= NFSSVC_ZEROSRVSTATS;
}
+ ext_nfsstats.vers = NFSSTATS_V1;
if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0)
err(1, "Can't get stats");
if (clientOnly) {
@@ -206,124 +268,124 @@ intpr(int clientOnly, int serverOnly)
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Getattr", "Setattr", "Lookup", "Readlink", "Read",
"Write", "Create", "Remove");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_GETATTR],
- ext_nfsstats.rpccnt[NFSPROC_SETATTR],
- ext_nfsstats.rpccnt[NFSPROC_LOOKUP],
- ext_nfsstats.rpccnt[NFSPROC_READLINK],
- ext_nfsstats.rpccnt[NFSPROC_READ],
- ext_nfsstats.rpccnt[NFSPROC_WRITE],
- ext_nfsstats.rpccnt[NFSPROC_CREATE],
- ext_nfsstats.rpccnt[NFSPROC_REMOVE]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETATTR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETATTR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUP],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READLINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READ],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITE],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATE],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_REMOVE]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Rename", "Link", "Symlink", "Mkdir", "Rmdir",
"Readdir", "RdirPlus", "Access");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_RENAME],
- ext_nfsstats.rpccnt[NFSPROC_LINK],
- ext_nfsstats.rpccnt[NFSPROC_SYMLINK],
- ext_nfsstats.rpccnt[NFSPROC_MKDIR],
- ext_nfsstats.rpccnt[NFSPROC_RMDIR],
- ext_nfsstats.rpccnt[NFSPROC_READDIR],
- ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS],
- ext_nfsstats.rpccnt[NFSPROC_ACCESS]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RENAME],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SYMLINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_ACCESS]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit");
- printf("%9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_MKNOD],
- ext_nfsstats.rpccnt[NFSPROC_FSSTAT],
- ext_nfsstats.rpccnt[NFSPROC_FSINFO],
- ext_nfsstats.rpccnt[NFSPROC_PATHCONF],
- ext_nfsstats.rpccnt[NFSPROC_COMMIT]);
+ printf("%9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKNOD],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSSTAT],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSINFO],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_PATHCONF],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMIT]);
printf("Rpc Info:\n");
printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n",
"TimedOut", "Invalid", "X Replies", "Retries",
"Requests");
- printf("%9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpctimeouts,
- ext_nfsstats.rpcinvalid,
- ext_nfsstats.rpcunexpected,
- ext_nfsstats.rpcretries,
- ext_nfsstats.rpcrequests);
+ printf("%9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpctimeouts,
+ (uintmax_t)ext_nfsstats.rpcinvalid,
+ (uintmax_t)ext_nfsstats.rpcunexpected,
+ (uintmax_t)ext_nfsstats.rpcretries,
+ (uintmax_t)ext_nfsstats.rpcrequests);
printf("Cache Info:\n");
printf("%9.9s %9.9s %9.9s %9.9s",
"Attr Hits", "Misses", "Lkup Hits", "Misses");
printf(" %9.9s %9.9s %9.9s %9.9s\n",
"BioR Hits", "Misses", "BioW Hits", "Misses");
- printf("%9d %9d %9d %9d",
- ext_nfsstats.attrcache_hits,
- ext_nfsstats.attrcache_misses,
- ext_nfsstats.lookupcache_hits,
- ext_nfsstats.lookupcache_misses);
- printf(" %9d %9d %9d %9d\n",
- ext_nfsstats.biocache_reads -
- ext_nfsstats.read_bios,
- ext_nfsstats.read_bios,
- ext_nfsstats.biocache_writes -
- ext_nfsstats.write_bios,
- ext_nfsstats.write_bios);
+ printf("%9ju %9ju %9ju %9ju",
+ (uintmax_t)ext_nfsstats.attrcache_hits,
+ (uintmax_t)ext_nfsstats.attrcache_misses,
+ (uintmax_t)ext_nfsstats.lookupcache_hits,
+ (uintmax_t)ext_nfsstats.lookupcache_misses);
+ printf(" %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)(ext_nfsstats.biocache_reads -
+ ext_nfsstats.read_bios),
+ (uintmax_t)ext_nfsstats.read_bios,
+ (uintmax_t)(ext_nfsstats.biocache_writes -
+ ext_nfsstats.write_bios),
+ (uintmax_t)ext_nfsstats.write_bios);
printf("%9.9s %9.9s %9.9s %9.9s",
"BioRLHits", "Misses", "BioD Hits", "Misses");
printf(" %9.9s %9.9s %9.9s %9.9s\n", "DirE Hits", "Misses", "Accs Hits", "Misses");
- printf("%9d %9d %9d %9d",
- ext_nfsstats.biocache_readlinks -
- ext_nfsstats.readlink_bios,
- ext_nfsstats.readlink_bios,
- ext_nfsstats.biocache_readdirs -
- ext_nfsstats.readdir_bios,
- ext_nfsstats.readdir_bios);
- printf(" %9d %9d %9d %9d\n",
- ext_nfsstats.direofcache_hits,
- ext_nfsstats.direofcache_misses,
- ext_nfsstats.accesscache_hits,
- ext_nfsstats.accesscache_misses);
+ printf("%9ju %9ju %9ju %9ju",
+ (uintmax_t)(ext_nfsstats.biocache_readlinks -
+ ext_nfsstats.readlink_bios),
+ (uintmax_t)ext_nfsstats.readlink_bios,
+ (uintmax_t)(ext_nfsstats.biocache_readdirs -
+ ext_nfsstats.readdir_bios),
+ (uintmax_t)ext_nfsstats.readdir_bios);
+ printf(" %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.direofcache_hits,
+ (uintmax_t)ext_nfsstats.direofcache_misses,
+ (uintmax_t)ext_nfsstats.accesscache_hits,
+ (uintmax_t)ext_nfsstats.accesscache_misses);
}
if (serverOnly) {
printf("\nServer Info:\n");
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Getattr", "Setattr", "Lookup", "Readlink", "Read",
"Write", "Create", "Remove");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR],
- ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR],
- ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP],
- ext_nfsstats.srvrpccnt[NFSV4OP_READLINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_READ],
- ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
- ext_nfsstats.srvrpccnt[NFSV4OP_CREATE],
- ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READLINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READ],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CREATE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Rename", "Link", "Symlink", "Mkdir", "Rmdir",
"Readdir", "RdirPlus", "Access");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_RENAME],
- ext_nfsstats.srvrpccnt[NFSV4OP_LINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_READDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS],
- ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENAME],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit");
- printf("%9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD],
- ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT],
- ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO],
- ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF],
- ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT]);
+ printf("%9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT]);
printf("Server Ret-Failed\n");
- printf("%17d\n", ext_nfsstats.srvrpc_errs);
+ printf("%17ju\n", (uintmax_t)ext_nfsstats.srvrpc_errs);
printf("Server Faults\n");
- printf("%13d\n", ext_nfsstats.srv_errs);
+ printf("%13ju\n", (uintmax_t)ext_nfsstats.srv_errs);
printf("Server Cache Stats:\n");
printf("%9.9s %9.9s %9.9s %9.9s\n",
"Inprog", "Idem", "Non-idem", "Misses");
- printf("%9d %9d %9d %9d\n",
- ext_nfsstats.srvcache_inproghits,
- ext_nfsstats.srvcache_idemdonehits,
- ext_nfsstats.srvcache_nonidemdonehits,
- ext_nfsstats.srvcache_misses);
+ printf("%9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvcache_inproghits,
+ (uintmax_t)ext_nfsstats.srvcache_idemdonehits,
+ (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits,
+ (uintmax_t)ext_nfsstats.srvcache_misses);
printf("Server Write Gathering:\n");
printf("%9.9s %9.9s %9.9s\n",
"WriteOps", "WriteRPC", "Opsaved");
@@ -331,21 +393,37 @@ intpr(int clientOnly, int serverOnly)
* The new client doesn't do write gathering. It was
* only useful for NFSv2.
*/
- printf("%9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
- ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], 0);
+ printf("%9ju %9ju %9d\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE], 0);
}
}
static void
-printhdr(int clientOnly, int serverOnly)
+printhdr(int clientOnly, int serverOnly, int newStats)
{
- printf("%s%6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s",
- ((serverOnly && clientOnly) ? " " : " "),
- "GtAttr", "Lookup", "Rdlink", "Read", "Write", "Rename",
- "Access", "Rddir");
- if (widemode && clientOnly) {
- printf(" Attr Lkup BioR BioW Accs BioD");
+
+ if (newStats) {
+ printf(" [%s Read %s] [%s Write %s] "
+ "%s[=========== Total ============]\n"
+ " KB/t tps MB/s%s KB/t tps MB/s%s "
+ "%sKB/t tps MB/s ms ql %%b",
+ widemode ? "========" : "=====",
+ widemode ? "========" : "=====",
+ widemode ? "========" : "=====",
+ widemode ? "=======" : "====",
+ widemode ? "[Commit ] " : "",
+ widemode ? " ms" : "",
+ widemode ? " ms" : "",
+ widemode ? "tps ms " : "");
+ } else {
+ printf("%s%6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s",
+ ((serverOnly && clientOnly) ? " " : " "),
+ "GtAttr", "Lookup", "Rdlink", "Read", "Write", "Rename",
+ "Access", "Rddir");
+ if (widemode && clientOnly) {
+ printf(" Attr Lkup BioR BioW Accs BioD");
+ }
}
printf("\n");
fflush(stdout);
@@ -355,7 +433,7 @@ static void
usage(void)
{
(void)fprintf(stderr,
- "usage: nfsstat [-cemszW] [-M core] [-N system] [-w wait]\n");
+ "usage: nfsstat [-cdemszW] [-M core] [-N system] [-w wait]\n");
exit(1);
}
@@ -392,6 +470,75 @@ sperc2(int ttl, int misses)
return(p);
}
+#define DELTA_T(field) \
+ devstat_compute_etime(&cur_stats->field, \
+ (prev_stats ? &prev_stats->field : NULL))
+
+/*
+ * XXX KDM mostly copied from ctlstat. We should commonize the code (and
+ * the devstat code) somehow.
+ */
+static void
+compute_new_stats(struct nfsstatsv1 *cur_stats,
+ struct nfsstatsv1 *prev_stats, int curop,
+ long double etime, long double *mbsec,
+ long double *kb_per_transfer,
+ long double *transfers_per_second,
+ long double *ms_per_transfer, uint64_t *queue_len,
+ long double *busy_pct)
+{
+ uint64_t total_bytes = 0, total_operations = 0;
+ struct bintime total_time_bt;
+ struct timespec total_time_ts;
+
+ bzero(&total_time_bt, sizeof(total_time_bt));
+ bzero(&total_time_ts, sizeof(total_time_ts));
+
+ total_bytes = cur_stats->srvbytes[curop];
+ total_operations = cur_stats->srvops[curop];
+ if (prev_stats != NULL) {
+ total_bytes -= prev_stats->srvbytes[curop];
+ total_operations -= prev_stats->srvops[curop];
+ }
+
+ *mbsec = total_bytes;
+ *mbsec /= 1024 * 1024;
+ if (etime > 0.0) {
+ *busy_pct = DELTA_T(busytime);
+ if (*busy_pct < 0)
+ *busy_pct = 0;
+ *busy_pct /= etime;
+ *busy_pct *= 100;
+ if (*busy_pct < 0)
+ *busy_pct = 0;
+ *mbsec /= etime;
+ } else {
+ *busy_pct = 0;
+ *mbsec = 0;
+ }
+ *kb_per_transfer = total_bytes;
+ *kb_per_transfer /= 1024;
+ if (total_operations > 0)
+ *kb_per_transfer /= total_operations;
+ else
+ *kb_per_transfer = 0;
+ if (etime > 0.0) {
+ *transfers_per_second = total_operations;
+ *transfers_per_second /= etime;
+ } else {
+ *transfers_per_second = 0.0;
+ }
+
+ if (total_operations > 0) {
+ *ms_per_transfer = DELTA_T(srvduration[curop]);
+ *ms_per_transfer /= total_operations;
+ *ms_per_transfer *= 1000;
+ } else
+ *ms_per_transfer = 0.0;
+
+ *queue_len = cur_stats->srvstartcnt - cur_stats->srvdonecnt;
+}
+
/*
* Print a description of the nfs stats for the experimental client/server.
*/
@@ -400,13 +547,14 @@ exp_intpr(int clientOnly, int serverOnly)
{
int nfssvc_flag;
- nfssvc_flag = NFSSVC_GETSTATS;
+ nfssvc_flag = NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT;
if (zflag != 0) {
if (clientOnly != 0)
nfssvc_flag |= NFSSVC_ZEROCLTSTATS;
if (serverOnly != 0)
nfssvc_flag |= NFSSVC_ZEROSRVSTATS;
}
+ ext_nfsstats.vers = NFSSTATS_V1;
if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0)
err(1, "Can't get stats");
if (clientOnly != 0) {
@@ -418,81 +566,81 @@ exp_intpr(int clientOnly, int serverOnly)
, "Getattr", "Setattr", "Lookup", "Readlink",
"Read", "Write", "Create", "Remove");
}
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_GETATTR],
- ext_nfsstats.rpccnt[NFSPROC_SETATTR],
- ext_nfsstats.rpccnt[NFSPROC_LOOKUP],
- ext_nfsstats.rpccnt[NFSPROC_READLINK],
- ext_nfsstats.rpccnt[NFSPROC_READ],
- ext_nfsstats.rpccnt[NFSPROC_WRITE],
- ext_nfsstats.rpccnt[NFSPROC_CREATE],
- ext_nfsstats.rpccnt[NFSPROC_REMOVE]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETATTR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETATTR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUP],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READLINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READ],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITE],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATE],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_REMOVE]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "Rename", "Link", "Symlink", "Mkdir", "Rmdir",
"Readdir", "RdirPlus", "Access");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_RENAME],
- ext_nfsstats.rpccnt[NFSPROC_LINK],
- ext_nfsstats.rpccnt[NFSPROC_SYMLINK],
- ext_nfsstats.rpccnt[NFSPROC_MKDIR],
- ext_nfsstats.rpccnt[NFSPROC_RMDIR],
- ext_nfsstats.rpccnt[NFSPROC_READDIR],
- ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS],
- ext_nfsstats.rpccnt[NFSPROC_ACCESS]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RENAME],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SYMLINK],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIR],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_READDIRPLUS],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_ACCESS]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "Mknod", "Fsstat", "Fsinfo", "PathConf",
"Commit", "SetClId", "SetClIdCf", "Lock");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_MKNOD],
- ext_nfsstats.rpccnt[NFSPROC_FSSTAT],
- ext_nfsstats.rpccnt[NFSPROC_FSINFO],
- ext_nfsstats.rpccnt[NFSPROC_PATHCONF],
- ext_nfsstats.rpccnt[NFSPROC_COMMIT],
- ext_nfsstats.rpccnt[NFSPROC_SETCLIENTID],
- ext_nfsstats.rpccnt[NFSPROC_SETCLIENTIDCFRM],
- ext_nfsstats.rpccnt[NFSPROC_LOCK]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_MKNOD],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSSTAT],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FSINFO],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_PATHCONF],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMIT],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETCLIENTID],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETCLIENTIDCFRM],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCK]);
if (printtitle)
printf("%9.9s %9.9s %9.9s %9.9s\n",
"LockT", "LockU", "Open", "OpenCfr");
- printf("%9d %9d %9d %9d\n",
- ext_nfsstats.rpccnt[NFSPROC_LOCKT],
- ext_nfsstats.rpccnt[NFSPROC_LOCKU],
- ext_nfsstats.rpccnt[NFSPROC_OPEN],
- ext_nfsstats.rpccnt[NFSPROC_OPENCONFIRM]);
+ printf("%9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCKT],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOCKU],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPEN],
+ (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPENCONFIRM]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "OpenOwner", "Opens", "LockOwner",
"Locks", "Delegs", "LocalOwn",
"LocalOpen", "LocalLOwn");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.clopenowners,
- ext_nfsstats.clopens,
- ext_nfsstats.cllockowners,
- ext_nfsstats.cllocks,
- ext_nfsstats.cldelegates,
- ext_nfsstats.cllocalopenowners,
- ext_nfsstats.cllocalopens,
- ext_nfsstats.cllocallockowners);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.clopenowners,
+ (uintmax_t)ext_nfsstats.clopens,
+ (uintmax_t)ext_nfsstats.cllockowners,
+ (uintmax_t)ext_nfsstats.cllocks,
+ (uintmax_t)ext_nfsstats.cldelegates,
+ (uintmax_t)ext_nfsstats.cllocalopenowners,
+ (uintmax_t)ext_nfsstats.cllocalopens,
+ (uintmax_t)ext_nfsstats.cllocallockowners);
if (printtitle)
printf("%9.9s\n", "LocalLock");
- printf("%9d\n", ext_nfsstats.cllocallocks);
+ printf("%9ju\n", (uintmax_t)ext_nfsstats.cllocallocks);
if (printtitle) {
printf("Rpc Info:\n");
printf("%9.9s %9.9s %9.9s %9.9s %9.9s\n",
"TimedOut", "Invalid", "X Replies", "Retries",
"Requests");
}
- printf("%9d %9d %9d %9d %9d\n",
- ext_nfsstats.rpctimeouts,
- ext_nfsstats.rpcinvalid,
- ext_nfsstats.rpcunexpected,
- ext_nfsstats.rpcretries,
- ext_nfsstats.rpcrequests);
+ printf("%9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.rpctimeouts,
+ (uintmax_t)ext_nfsstats.rpcinvalid,
+ (uintmax_t)ext_nfsstats.rpcunexpected,
+ (uintmax_t)ext_nfsstats.rpcretries,
+ (uintmax_t)ext_nfsstats.rpcrequests);
if (printtitle) {
printf("Cache Info:\n");
printf("%9.9s %9.9s %9.9s %9.9s",
@@ -500,31 +648,33 @@ exp_intpr(int clientOnly, int serverOnly)
printf(" %9.9s %9.9s %9.9s %9.9s\n",
"BioR Hits", "Misses", "BioW Hits", "Misses");
}
- printf("%9d %9d %9d %9d",
- ext_nfsstats.attrcache_hits,
- ext_nfsstats.attrcache_misses,
- ext_nfsstats.lookupcache_hits,
- ext_nfsstats.lookupcache_misses);
- printf(" %9d %9d %9d %9d\n",
- ext_nfsstats.biocache_reads - ext_nfsstats.read_bios,
- ext_nfsstats.read_bios,
- ext_nfsstats.biocache_writes - ext_nfsstats.write_bios,
- ext_nfsstats.write_bios);
+ printf("%9ju %9ju %9ju %9ju",
+ (uintmax_t)ext_nfsstats.attrcache_hits,
+ (uintmax_t)ext_nfsstats.attrcache_misses,
+ (uintmax_t)ext_nfsstats.lookupcache_hits,
+ (uintmax_t)ext_nfsstats.lookupcache_misses);
+ printf(" %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)(ext_nfsstats.biocache_reads -
+ ext_nfsstats.read_bios),
+ (uintmax_t)ext_nfsstats.read_bios,
+ (uintmax_t)(ext_nfsstats.biocache_writes -
+ ext_nfsstats.write_bios),
+ (uintmax_t)ext_nfsstats.write_bios);
if (printtitle) {
printf("%9.9s %9.9s %9.9s %9.9s",
"BioRLHits", "Misses", "BioD Hits", "Misses");
printf(" %9.9s %9.9s\n", "DirE Hits", "Misses");
}
- printf("%9d %9d %9d %9d",
- ext_nfsstats.biocache_readlinks -
- ext_nfsstats.readlink_bios,
- ext_nfsstats.readlink_bios,
- ext_nfsstats.biocache_readdirs -
- ext_nfsstats.readdir_bios,
- ext_nfsstats.readdir_bios);
- printf(" %9d %9d\n",
- ext_nfsstats.direofcache_hits,
- ext_nfsstats.direofcache_misses);
+ printf("%9ju %9ju %9ju %9ju",
+ (uintmax_t)(ext_nfsstats.biocache_readlinks -
+ ext_nfsstats.readlink_bios),
+ (uintmax_t)ext_nfsstats.readlink_bios,
+ (uintmax_t)(ext_nfsstats.biocache_readdirs -
+ ext_nfsstats.readdir_bios),
+ (uintmax_t)ext_nfsstats.readdir_bios);
+ printf(" %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.direofcache_hits,
+ (uintmax_t)ext_nfsstats.direofcache_misses);
}
if (serverOnly != 0) {
if (printtitle) {
@@ -534,116 +684,136 @@ exp_intpr(int clientOnly, int serverOnly)
, "Getattr", "Setattr", "Lookup", "Readlink",
"Read", "Write", "Create", "Remove");
}
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR],
- ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR],
- ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP],
- ext_nfsstats.srvrpccnt[NFSV4OP_READLINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_READ],
- ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
- ext_nfsstats.srvrpccnt[NFSV4OP_V3CREATE],
- ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETATTR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETATTR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUP],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READLINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READ],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_WRITE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_V3CREATE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_REMOVE]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "Rename", "Link", "Symlink", "Mkdir", "Rmdir",
"Readdir", "RdirPlus", "Access");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_RENAME],
- ext_nfsstats.srvrpccnt[NFSV4OP_LINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK],
- ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_READDIR],
- ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS],
- ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENAME],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SYMLINK],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RMDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_ACCESS]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "Mknod", "Fsstat", "Fsinfo", "PathConf",
"Commit", "LookupP", "SetClId", "SetClIdCf");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD],
- ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT],
- ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO],
- ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF],
- ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT],
- ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUPP],
- ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTID],
- ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTIDCFRM]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_MKNOD],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSSTAT],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_FSINFO],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PATHCONF],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_COMMIT],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOOKUPP],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTID],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SETCLIENTIDCFRM]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "Open", "OpenAttr", "OpenDwnGr", "OpenCfrm",
"DelePurge", "DeleRet", "GetFH", "Lock");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_OPEN],
- ext_nfsstats.srvrpccnt[NFSV4OP_OPENATTR],
- ext_nfsstats.srvrpccnt[NFSV4OP_OPENDOWNGRADE],
- ext_nfsstats.srvrpccnt[NFSV4OP_OPENCONFIRM],
- ext_nfsstats.srvrpccnt[NFSV4OP_DELEGPURGE],
- ext_nfsstats.srvrpccnt[NFSV4OP_DELEGRETURN],
- ext_nfsstats.srvrpccnt[NFSV4OP_GETFH],
- ext_nfsstats.srvrpccnt[NFSV4OP_LOCK]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPEN],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENATTR],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENDOWNGRADE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_OPENCONFIRM],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_DELEGPURGE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_DELEGRETURN],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_GETFH],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCK]);
if (printtitle)
printf(
"%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n"
, "LockT", "LockU", "Close", "Verify", "NVerify",
"PutFH", "PutPubFH", "PutRootFH");
- printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_LOCKT],
- ext_nfsstats.srvrpccnt[NFSV4OP_LOCKU],
- ext_nfsstats.srvrpccnt[NFSV4OP_CLOSE],
- ext_nfsstats.srvrpccnt[NFSV4OP_VERIFY],
- ext_nfsstats.srvrpccnt[NFSV4OP_NVERIFY],
- ext_nfsstats.srvrpccnt[NFSV4OP_PUTFH],
- ext_nfsstats.srvrpccnt[NFSV4OP_PUTPUBFH],
- ext_nfsstats.srvrpccnt[NFSV4OP_PUTROOTFH]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCKT],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_LOCKU],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CLOSE],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_VERIFY],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_NVERIFY],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTFH],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTPUBFH],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_PUTROOTFH]);
if (printtitle)
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Renew", "RestoreFH", "SaveFH", "Secinfo",
"RelLckOwn", "V4Create");
- printf("%9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvrpccnt[NFSV4OP_RENEW],
- ext_nfsstats.srvrpccnt[NFSV4OP_RESTOREFH],
- ext_nfsstats.srvrpccnt[NFSV4OP_SAVEFH],
- ext_nfsstats.srvrpccnt[NFSV4OP_SECINFO],
- ext_nfsstats.srvrpccnt[NFSV4OP_RELEASELCKOWN],
- ext_nfsstats.srvrpccnt[NFSV4OP_CREATE]);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RENEW],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RESTOREFH],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SAVEFH],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_SECINFO],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_RELEASELCKOWN],
+ (uintmax_t)ext_nfsstats.srvrpccnt[NFSV4OP_CREATE]);
if (printtitle) {
printf("Server:\n");
printf("%9.9s %9.9s %9.9s\n",
"Retfailed", "Faults", "Clients");
}
- printf("%9d %9d %9d\n",
- ext_nfsstats.srv_errs, ext_nfsstats.srvrpc_errs,
- ext_nfsstats.srvclients);
+ printf("%9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srv_errs,
+ (uintmax_t)ext_nfsstats.srvrpc_errs,
+ (uintmax_t)ext_nfsstats.srvclients);
if (printtitle)
printf("%9.9s %9.9s %9.9s %9.9s %9.9s \n",
"OpenOwner", "Opens", "LockOwner",
"Locks", "Delegs");
- printf("%9d %9d %9d %9d %9d \n",
- ext_nfsstats.srvopenowners,
- ext_nfsstats.srvopens,
- ext_nfsstats.srvlockowners,
- ext_nfsstats.srvlocks,
- ext_nfsstats.srvdelegates);
+ printf("%9ju %9ju %9ju %9ju %9ju \n",
+ (uintmax_t)ext_nfsstats.srvopenowners,
+ (uintmax_t)ext_nfsstats.srvopens,
+ (uintmax_t)ext_nfsstats.srvlockowners,
+ (uintmax_t)ext_nfsstats.srvlocks,
+ (uintmax_t)ext_nfsstats.srvdelegates);
if (printtitle) {
printf("Server Cache Stats:\n");
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Inprog", "Idem", "Non-idem", "Misses",
"CacheSize", "TCPPeak");
}
- printf("%9d %9d %9d %9d %9d %9d\n",
- ext_nfsstats.srvcache_inproghits,
- ext_nfsstats.srvcache_idemdonehits,
- ext_nfsstats.srvcache_nonidemdonehits,
- ext_nfsstats.srvcache_misses,
- ext_nfsstats.srvcache_size,
- ext_nfsstats.srvcache_tcppeak);
+ printf("%9ju %9ju %9ju %9ju %9ju %9ju\n",
+ (uintmax_t)ext_nfsstats.srvcache_inproghits,
+ (uintmax_t)ext_nfsstats.srvcache_idemdonehits,
+ (uintmax_t)ext_nfsstats.srvcache_nonidemdonehits,
+ (uintmax_t)ext_nfsstats.srvcache_misses,
+ (uintmax_t)ext_nfsstats.srvcache_size,
+ (uintmax_t)ext_nfsstats.srvcache_tcppeak);
}
}
+static void
+compute_totals(struct nfsstatsv1 *total_stats, struct nfsstatsv1 *cur_stats)
+{
+ int i;
+
+ bzero(total_stats, sizeof(*total_stats));
+ for (i = 0; i < (NFSV42_NOPS + NFSV4OP_FAKENOPS); i++) {
+ total_stats->srvbytes[0] += cur_stats->srvbytes[i];
+ total_stats->srvops[0] += cur_stats->srvops[i];
+ bintime_add(&total_stats->srvduration[0],
+ &cur_stats->srvduration[i]);
+ total_stats->srvrpccnt[i] = cur_stats->srvrpccnt[i];
+ }
+ total_stats->srvstartcnt = cur_stats->srvstartcnt;
+ total_stats->srvdonecnt = cur_stats->srvdonecnt;
+ total_stats->busytime = cur_stats->busytime;
+
+}
+
/*
* Print a running summary of nfs statistics for the experimental client and/or
* server.
@@ -652,40 +822,51 @@ exp_intpr(int clientOnly, int serverOnly)
* First line printed at top of screen is always cumulative.
*/
static void
-exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly)
+exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly,
+ int newStats)
{
- struct ext_nfsstats nfsstats, lastst, *ext_nfsstatsp;
+ struct nfsstatsv1 nfsstats, lastst, *ext_nfsstatsp;
+ struct nfsstatsv1 curtotal, lasttotal;
+ struct timespec ts, lastts;
int hdrcnt = 1;
ext_nfsstatsp = &lastst;
- if (nfssvc(NFSSVC_GETSTATS, ext_nfsstatsp) < 0)
+ ext_nfsstatsp->vers = NFSSTATS_V1;
+ if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp) < 0)
err(1, "Can't get stats");
+ clock_gettime(CLOCK_MONOTONIC, &lastts);
+ compute_totals(&lasttotal, ext_nfsstatsp);
sleep(interval);
for (;;) {
ext_nfsstatsp = &nfsstats;
- if (nfssvc(NFSSVC_GETSTATS, ext_nfsstatsp) < 0)
+ ext_nfsstatsp->vers = NFSSTATS_V1;
+ if (nfssvc(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT, ext_nfsstatsp)
+ < 0)
err(1, "Can't get stats");
+ clock_gettime(CLOCK_MONOTONIC, &ts);
if (--hdrcnt == 0) {
- printhdr(clientOnly, serverOnly);
- if (clientOnly && serverOnly)
+ printhdr(clientOnly, serverOnly, newStats);
+ if (newStats)
+ hdrcnt = 20;
+ else if (clientOnly && serverOnly)
hdrcnt = 10;
else
hdrcnt = 20;
}
- if (clientOnly) {
- printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
+ if (clientOnly && newStats == 0) {
+ printf("%s %6ju %6ju %6ju %6ju %6ju %6ju %6ju %6ju",
((clientOnly && serverOnly) ? "Client:" : ""),
- DELTA(rpccnt[NFSPROC_GETATTR]),
- DELTA(rpccnt[NFSPROC_LOOKUP]),
- DELTA(rpccnt[NFSPROC_READLINK]),
- DELTA(rpccnt[NFSPROC_READ]),
- DELTA(rpccnt[NFSPROC_WRITE]),
- DELTA(rpccnt[NFSPROC_RENAME]),
- DELTA(rpccnt[NFSPROC_ACCESS]),
- DELTA(rpccnt[NFSPROC_READDIR]) +
- DELTA(rpccnt[NFSPROC_READDIRPLUS])
+ (uintmax_t)DELTA(rpccnt[NFSPROC_GETATTR]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_LOOKUP]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_READLINK]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_READ]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_WRITE]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_RENAME]),
+ (uintmax_t)DELTA(rpccnt[NFSPROC_ACCESS]),
+ (uintmax_t)(DELTA(rpccnt[NFSPROC_READDIR]) +
+ DELTA(rpccnt[NFSPROC_READDIRPLUS]))
);
if (widemode) {
printf(" %s %s %s %s %s %s",
@@ -705,21 +886,74 @@ exp_sidewaysintpr(u_int interval, int clientOnly, int serverOnly)
}
printf("\n");
}
- if (serverOnly) {
- printf("%s %6d %6d %6d %6d %6d %6d %6d %6d",
+
+ if (serverOnly && newStats) {
+ long double cur_secs, last_secs, etime;
+ long double mbsec;
+ long double kb_per_transfer;
+ long double transfers_per_second;
+ long double ms_per_transfer;
+ uint64_t queue_len;
+ long double busy_pct;
+ int i;
+
+ cur_secs = ts.tv_sec +
+ ((long double)ts.tv_nsec / 1000000000);
+ last_secs = lastts.tv_sec +
+ ((long double)lastts.tv_nsec / 1000000000);
+ etime = cur_secs - last_secs;
+
+ compute_totals(&curtotal, &nfsstats);
+
+ for (i = 0; i < NUM_STAT_TYPES; i++) {
+ compute_new_stats(&nfsstats, &lastst,
+ STAT_TYPE_TO_NFS(i), etime, &mbsec,
+ &kb_per_transfer,
+ &transfers_per_second,
+ &ms_per_transfer, &queue_len,
+ &busy_pct);
+
+ if (i == STAT_TYPE_COMMIT) {
+ if (widemode == 0)
+ continue;
+
+ printf("%2.0Lf %7.2Lf ",
+ transfers_per_second,
+ ms_per_transfer);
+ } else {
+ printf("%5.2Lf %5.0Lf %7.2Lf ",
+ kb_per_transfer,
+ transfers_per_second, mbsec);
+ if (widemode)
+ printf("%5.2Lf ",
+ ms_per_transfer);
+ }
+ }
+
+ compute_new_stats(&curtotal, &lasttotal, 0, etime,
+ &mbsec, &kb_per_transfer, &transfers_per_second,
+ &ms_per_transfer, &queue_len, &busy_pct);
+
+ printf("%5.2Lf %5.0Lf %7.2Lf %5.2Lf %3ju %3.0Lf\n",
+ kb_per_transfer, transfers_per_second, mbsec,
+ ms_per_transfer, queue_len, busy_pct);
+ } else if (serverOnly) {
+ printf("%s %6ju %6ju %6ju %6ju %6ju %6ju %6ju %6ju",
((clientOnly && serverOnly) ? "Server:" : ""),
- DELTA(srvrpccnt[NFSV4OP_GETATTR]),
- DELTA(srvrpccnt[NFSV4OP_LOOKUP]),
- DELTA(srvrpccnt[NFSV4OP_READLINK]),
- DELTA(srvrpccnt[NFSV4OP_READ]),
- DELTA(srvrpccnt[NFSV4OP_WRITE]),
- DELTA(srvrpccnt[NFSV4OP_RENAME]),
- DELTA(srvrpccnt[NFSV4OP_ACCESS]),
- DELTA(srvrpccnt[NFSV4OP_READDIR]) +
- DELTA(srvrpccnt[NFSV4OP_READDIRPLUS]));
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_GETATTR]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_LOOKUP]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_READLINK]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_READ]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_WRITE]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_RENAME]),
+ (uintmax_t)DELTA(srvrpccnt[NFSV4OP_ACCESS]),
+ (uintmax_t)(DELTA(srvrpccnt[NFSV4OP_READDIR]) +
+ DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])));
printf("\n");
}
- lastst = nfsstats;
+ bcopy(&nfsstats, &lastst, sizeof(lastst));
+ bcopy(&curtotal, &lasttotal, sizeof(lasttotal));
+ lastts = ts;
fflush(stdout);
sleep(interval);
}
diff --git a/usr.bin/proccontrol/Makefile b/usr.bin/proccontrol/Makefile
new file mode 100644
index 0000000..c11c412
--- /dev/null
+++ b/usr.bin/proccontrol/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+PROG= proccontrol
+WARNS?= 6
+MK_MAN=no
+
+.include <bsd.prog.mk>
diff --git a/usr.bin/proccontrol/Makefile.depend b/usr.bin/proccontrol/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.bin/proccontrol/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c
new file mode 100644
index 0000000..4cb3701
--- /dev/null
+++ b/usr.bin/proccontrol/proccontrol.c
@@ -0,0 +1,180 @@
+/*-
+ * Copyright (c) 2016 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/procctl.h>
+#include <err.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+enum {
+ MODE_INVALID,
+ MODE_TRACE,
+ MODE_TRAPCAP,
+};
+
+static pid_t
+str2pid(const char *str)
+{
+ pid_t res;
+ char *tail;
+
+ res = strtol(str, &tail, 0);
+ if (*tail != '\0') {
+ warnx("non-numeric pid");
+ return (-1);
+ }
+ return (res);
+}
+
+static void __dead2
+usage(void)
+{
+
+ fprintf(stderr, "Usage: proccontrol -m (trace|trapcap) [-q] "
+ "[-s (enable|disable)] [-p pid | command]\n");
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int arg, ch, error, mode;
+ pid_t pid;
+ bool enable, do_command, query;
+
+ mode = MODE_INVALID;
+ enable = true;
+ pid = -1;
+ query = false;
+ while ((ch = getopt(argc, argv, "m:qs:p:")) != -1) {
+ switch (ch) {
+ case 'm':
+ if (strcmp(optarg, "trace") == 0)
+ mode = MODE_TRACE;
+ else if (strcmp(optarg, "trapcap") == 0)
+ mode = MODE_TRAPCAP;
+ else
+ usage();
+ break;
+ case 's':
+ if (strcmp(optarg, "enable") == 0)
+ enable = true;
+ else if (strcmp(optarg, "disable") == 0)
+ enable = false;
+ else
+ usage();
+ break;
+ case 'p':
+ pid = str2pid(optarg);
+ break;
+ case 'q':
+ query = true;
+ break;
+ case '?':
+ default:
+ usage();
+ break;
+ }
+ }
+ argc -= optind;
+ argv += optind;
+ do_command = argc != 0;
+ if (do_command) {
+ if (pid != -1 || query)
+ usage();
+ pid = getpid();
+ } else if (pid == -1) {
+ pid = getpid();
+ }
+
+ if (query) {
+ switch (mode) {
+ case MODE_TRACE:
+ error = procctl(P_PID, pid, PROC_TRACE_STATUS, &arg);
+ break;
+ case MODE_TRAPCAP:
+ error = procctl(P_PID, pid, PROC_TRAPCAP_STATUS, &arg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ if (error != 0)
+ err(1, "procctl status");
+ switch (mode) {
+ case MODE_TRACE:
+ if (arg == -1)
+ printf("disabled\n");
+ else if (arg == 0)
+ printf("enabled, no debugger\n");
+ else
+ printf("enabled, traced by %d\n", arg);
+ break;
+ case MODE_TRAPCAP:
+ switch (arg) {
+ case PROC_TRAPCAP_CTL_ENABLE:
+ printf("enabled\n");
+ break;
+ case PROC_TRAPCAP_CTL_DISABLE:
+ printf("disabled\n");
+ break;
+ }
+ break;
+ }
+ } else {
+ switch (mode) {
+ case MODE_TRACE:
+ arg = enable ? PROC_TRACE_CTL_ENABLE :
+ PROC_TRACE_CTL_DISABLE;
+ error = procctl(P_PID, pid, PROC_TRACE_CTL, &arg);
+ break;
+ case MODE_TRAPCAP:
+ arg = enable ? PROC_TRAPCAP_CTL_ENABLE :
+ PROC_TRAPCAP_CTL_DISABLE;
+ error = procctl(P_PID, pid, PROC_TRAPCAP_CTL, &arg);
+ break;
+ default:
+ usage();
+ break;
+ }
+ if (error != 0)
+ err(1, "procctl ctl");
+ if (do_command) {
+ error = execvp(argv[0], argv);
+ err(1, "exec");
+ }
+ }
+ exit(0);
+}
diff --git a/usr.sbin/devctl/devctl.8 b/usr.sbin/devctl/devctl.8
index ec8abaf..67b8709 100644
--- a/usr.sbin/devctl/devctl.8
+++ b/usr.sbin/devctl/devctl.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 27, 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
@@ -133,6 +137,21 @@ If the device is already attached to a device driver and the
.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.
.It Cm rescan Ar device
Rescan a bus device checking for devices that have been added or
removed.
diff --git a/usr.sbin/devctl/devctl.c b/usr.sbin/devctl/devctl.c
index 824b907..6b266f4 100644
--- a/usr.sbin/devctl/devctl.c
+++ b/usr.sbin/devctl/devctl.c
@@ -65,12 +65,13 @@ static int devctl_table_handler(struct devctl_command **start,
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%s\n%s\n%s\n%s\n",
+ fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
"usage: devctl attach device",
" devctl detach [-f] device",
" devctl disable [-f] device",
@@ -78,6 +79,7 @@ usage(void)
" devctl suspend device",
" devctl resume device",
" devctl set driver [-f] device driver",
+ " devctl clear driver [-f] device",
" devctl rescan device",
" devctl delete [-f] device");
exit(1);
@@ -261,6 +263,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);
+
static int
rescan(int ac, char **av)
{
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh
index 3dcf618..501c530 100644
--- a/usr.sbin/portsnap/portsnap/portsnap.sh
+++ b/usr.sbin/portsnap/portsnap/portsnap.sh
@@ -691,6 +691,13 @@ fetch_snapshot() {
fetch_index_sanity || return 1
# Verify the snapshot contents
cut -f 2 -d '|' INDEX.new | fetch_snapshot_verify || return 1
+ cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u > files.expected
+ find snap -mindepth 1 | sed -E 's^snap/(.*)\.gz^\1^' | sort > files.snap
+ if ! cmp -s files.expected files.snap; then
+ echo "unexpected files in snapshot."
+ return 1
+ fi
+ rm files.expected files.snap
echo "done."
# Move files into their proper locations
OpenPOWER on IntegriCloud