From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 00:40:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DCE0106564A; Sun, 8 Apr 2012 00:40:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDFD78FC12; Sun, 8 Apr 2012 00:40:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q380eGlx085506; Sun, 8 Apr 2012 00:40:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q380eGQP085504; Sun, 8 Apr 2012 00:40:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204080040.q380eGQP085504@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 Apr 2012 00:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234009 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 00:40:17 -0000 Author: adrian Date: Sun Apr 8 00:40:16 2012 New Revision: 234009 URL: http://svn.freebsd.org/changeset/base/234009 Log: After reviewing the mcast/sleep station code a little, undo some brain damage which I committed when I had less clue about such things. Don't ever put normal data frames on the mcast software queue. Just put mcast frames there if needed. Pass the txq decision into ath_tx_normal_setup(), as we've already made the decision. Don't re-do it. Whilst i'm here, add another random debugging statement. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Apr 8 00:14:15 2012 (r234008) +++ head/sys/dev/ath/if_ath_tx.c Sun Apr 8 00:40:16 2012 (r234009) @@ -205,6 +205,8 @@ ath_txfrag_setup(struct ath_softc *sc, a for (m = m0->m_nextpkt; m != NULL; m = m->m_nextpkt) { bf = _ath_getbuf_locked(sc); if (bf == NULL) { /* out of buffers, cleanup */ + device_printf(sc->sc_dev, "%s: no buffer?\n", + __func__); ath_txfrag_cleanup(sc, frags, ni); break; } @@ -1150,10 +1152,9 @@ ath_tx_xmit_normal(struct ath_softc *sc, static int ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, - struct ath_buf *bf, struct mbuf *m0) + struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq) { struct ieee80211vap *vap = ni->ni_vap; - struct ath_vap *avp = ATH_VAP(vap); struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -1162,7 +1163,6 @@ ath_tx_normal_setup(struct ath_softc *sc int keyix, hdrlen, pktlen, try0 = 0; u_int8_t rix = 0, txrate = 0; struct ath_desc *ds; - struct ath_txq *txq; struct ieee80211_frame *wh; u_int subtype, flags; HAL_PKT_TYPE atype; @@ -1297,21 +1297,6 @@ ath_tx_normal_setup(struct ath_softc *sc ath_freetx(m0); return EIO; } - txq = sc->sc_ac2q[pri]; - - /* - * When servicing one or more stations in power-save mode - * (or) if there is some mcast data waiting on the mcast - * queue (to prevent out of order delivery) multicast - * frames must be buffered until after the beacon. - * - * XXX This likely means that if there's a station in power - * save mode, we won't be doing any kind of aggregation towards - * anyone. This is likely a very suboptimal way of dealing - * with things. - */ - if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) - txq = &avp->av_mcastq; /* * Calculate miscellaneous flags. @@ -1445,8 +1430,8 @@ ath_tx_start(struct ath_softc *sc, struc /* * Determine the target hardware queue. * - * For multicast frames, the txq gets overridden to be the - * software TXQ and it's done via direct-dispatch. + * For multicast frames, the txq gets overridden appropriately + * depending upon the state of PS. * * For any other frame, we do a TID/QoS lookup inside the frame * to see what the TID should be. If it's a non-QoS frame, the @@ -1495,17 +1480,15 @@ ath_tx_start(struct ath_softc *sc, struc "%s: bf=%p, tid=%d, ac=%d, is_ampdu=%d\n", __func__, bf, tid, pri, is_ampdu); - /* Multicast frames go onto the software multicast queue */ - if (ismcast) - txq = &avp->av_mcastq; - /* - * XXX This likely means that if there's a station in power - * save mode, we won't be doing any kind of aggregation towards - * anyone. This is likely a very suboptimal way of dealing - * with things. + * When servicing one or more stations in power-save mode + * (or) if there is some mcast data waiting on the mcast + * queue (to prevent out of order delivery) multicast frames + * must be bufferd until after the beacon. + * + * TODO: we should lock the mcastq before we check the length. */ - if ((! is_ampdu) && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) + if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) txq = &avp->av_mcastq; /* Do the generic frame setup */ @@ -1555,7 +1538,7 @@ ath_tx_start(struct ath_softc *sc, struc __func__, tid, M_SEQNO_GET(m0)); /* This also sets up the DMA map */ - r = ath_tx_normal_setup(sc, ni, bf, m0); + r = ath_tx_normal_setup(sc, ni, bf, m0, txq); if (r != 0) return r; From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 03:55:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29A67106564A; Sun, 8 Apr 2012 03:55:26 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14BDB8FC0A; Sun, 8 Apr 2012 03:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q383tPFM091700; Sun, 8 Apr 2012 03:55:25 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q383tPxa091698; Sun, 8 Apr 2012 03:55:25 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204080355.q383tPxa091698@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 8 Apr 2012 03:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234011 - head/lib/libgssapi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 03:55:26 -0000 Author: stas Date: Sun Apr 8 03:55:25 2012 New Revision: 234011 URL: http://svn.freebsd.org/changeset/base/234011 Log: - Use __NO_TLS preprocessor value to make assumptions about TLS support on a platform. Modified: head/lib/libgssapi/gss_display_status.c Modified: head/lib/libgssapi/gss_display_status.c ============================================================================== --- head/lib/libgssapi/gss_display_status.c Sun Apr 8 01:43:41 2012 (r234010) +++ head/lib/libgssapi/gss_display_status.c Sun Apr 8 03:55:25 2012 (r234011) @@ -173,7 +173,7 @@ supplementary_error(OM_uint32 v) return msgs[v]; } -#if defined(__sparc64__) || defined(__arm__) || defined(__mips__) +#if defined(__NO_TLS) /* * These platforms don't support TLS on FreeBSD - threads will just From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:22:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 218261065670; Sun, 8 Apr 2012 04:22:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE5C8FC0A; Sun, 8 Apr 2012 04:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q384M9ti092656; Sun, 8 Apr 2012 04:22:09 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q384M98s092652; Sun, 8 Apr 2012 04:22:09 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204080422.q384M98s092652@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 8 Apr 2012 04:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234013 - in head/kerberos5/lib: libasn1 libkafs5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:22:10 -0000 Author: stas Date: Sun Apr 8 04:22:09 2012 New Revision: 234013 URL: http://svn.freebsd.org/changeset/base/234013 Log: - Add a "real" symbol version map to libasn1. The upstream version of the version map just exported all the symbols, which caused a binutils bug being triggered when ld fails to link two objects, one of which exports a versioned version of the symbol, and another -- unversioned. [1] - Also add version map for libkafs5. Submitted by: jchandra@ (based on) Added: head/kerberos5/lib/libasn1/version.map (contents, props changed) head/kerberos5/lib/libkafs5/version.map (contents, props changed) Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libkafs5/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Sun Apr 8 04:09:55 2012 (r234012) +++ head/kerberos5/lib/libasn1/Makefile Sun Apr 8 04:22:09 2012 (r234013) @@ -5,7 +5,7 @@ LDFLAGS= -Wl,--no-undefined INCS= asn1_err.h asn1-common.h heim_asn1.h der.h der-protos.h der-private.h LDADD= -lcom_err -lroken DPADD= ${LIBCOM_ERR} ${LIBROKEN} -VERSION_MAP= ${KRB5DIR}/lib/asn1/version-script.map +VERSION_MAP= ${.CURDIR}/version.map SRCS= asn1_err.c \ asn1_err.h \ Added: head/kerberos5/lib/libasn1/version.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/kerberos5/lib/libasn1/version.map Sun Apr 8 04:22:09 2012 (r234013) @@ -0,0 +1,1592 @@ +# +# Export all symbols but _init and _fini. +# +# $FreeBSD$ +# +HEIMDAL_ASN1_1.0 { + global: + APOptions2int; + DigestTypes2int; + DistributionPointReasonFlags2int; + FastOptions2int; + KDCOptions2int; + KeyUsage2int; + SAMFlags2int; + TicketFlags2int; + _asn1_copy; + _asn1_copy_top; + _asn1_decode; + _asn1_decode_top; + _asn1_encode; + _asn1_free; + _asn1_length; + _der_gmtime; + _der_timegm; + _heim_der_set_sort; + _heim_fix_dce; + _heim_len_int; + _heim_len_unsigned; + _heim_time2generalizedtime; + add_AuthorizationData; + add_CRLDistributionPoints; + add_DigestAlgorithmIdentifiers; + add_ETYPE_INFO; + add_ETYPE_INFO2; + add_Extensions; + add_GeneralNames; + add_METHOD_DATA; + add_Principals; + asn1_APOptions_units; + asn1_DigestTypes_units; + asn1_DistributionPointReasonFlags_units; + asn1_FastOptions_units; + asn1_KDCOptions_units; + asn1_KeyUsage_units; + asn1_SAMFlags_units; + asn1_TicketFlags_units; + asn1_oid_id_Userid; + asn1_oid_id_aes_128_cbc; + asn1_oid_id_aes_192_cbc; + asn1_oid_id_aes_256_cbc; + asn1_oid_id_at_commonName; + asn1_oid_id_at_countryName; + asn1_oid_id_at_generationQualifier; + asn1_oid_id_at_givenName; + asn1_oid_id_at_initials; + asn1_oid_id_at_localityName; + asn1_oid_id_at_name; + asn1_oid_id_at_organizationName; + asn1_oid_id_at_organizationalUnitName; + asn1_oid_id_at_pseudonym; + asn1_oid_id_at_serialNumber; + asn1_oid_id_at_stateOrProvinceName; + asn1_oid_id_at_streetAddress; + asn1_oid_id_at_surname; + asn1_oid_id_dhpublicnumber; + asn1_oid_id_domainComponent; + asn1_oid_id_dsa; + asn1_oid_id_dsa_with_sha1; + asn1_oid_id_ecDH; + asn1_oid_id_ecMQV; + asn1_oid_id_ecPublicKey; + asn1_oid_id_ec_group_secp160r1; + asn1_oid_id_ec_group_secp160r2; + asn1_oid_id_ec_group_secp256r1; + asn1_oid_id_ecdsa_with_SHA1; + asn1_oid_id_ecdsa_with_SHA256; + asn1_oid_id_heim_rsa_pkcs1_x509; + asn1_oid_id_ms_cert_enroll_domaincontroller; + asn1_oid_id_ms_client_authentication; + asn1_oid_id_netscape; + asn1_oid_id_netscape_cert_comment; + asn1_oid_id_nistAlgorithm; + asn1_oid_id_nist_aes_algs; + asn1_oid_id_nist_sha_algs; + asn1_oid_id_pbeWithSHAAnd128BitRC2_CBC; + asn1_oid_id_pbeWithSHAAnd128BitRC4; + asn1_oid_id_pbeWithSHAAnd2_KeyTripleDES_CBC; + asn1_oid_id_pbeWithSHAAnd3_KeyTripleDES_CBC; + asn1_oid_id_pbeWithSHAAnd40BitRC4; + asn1_oid_id_pbewithSHAAnd40BitRC2_CBC; + asn1_oid_id_pkauthdata; + asn1_oid_id_pkcs12_bagtypes; + asn1_oid_id_pkcs12_certBag; + asn1_oid_id_pkcs12_crlBag; + asn1_oid_id_pkcs12_keyBag; + asn1_oid_id_pkcs12_pkcs8ShroudedKeyBag; + asn1_oid_id_pkcs12_safeContentsBag; + asn1_oid_id_pkcs12_secretBag; + asn1_oid_id_pkcs1_md2WithRSAEncryption; + asn1_oid_id_pkcs1_md5WithRSAEncryption; + asn1_oid_id_pkcs1_rsaEncryption; + asn1_oid_id_pkcs1_sha1WithRSAEncryption; + asn1_oid_id_pkcs1_sha256WithRSAEncryption; + asn1_oid_id_pkcs1_sha384WithRSAEncryption; + asn1_oid_id_pkcs1_sha512WithRSAEncryption; + asn1_oid_id_pkcs2_md2; + asn1_oid_id_pkcs2_md4; + asn1_oid_id_pkcs2_md5; + asn1_oid_id_pkcs3_des_ede3_cbc; + asn1_oid_id_pkcs3_rc2_cbc; + asn1_oid_id_pkcs3_rc4; + asn1_oid_id_pkcs7; + asn1_oid_id_pkcs7_data; + asn1_oid_id_pkcs7_digestedData; + asn1_oid_id_pkcs7_encryptedData; + asn1_oid_id_pkcs7_envelopedData; + asn1_oid_id_pkcs7_signedAndEnvelopedData; + asn1_oid_id_pkcs7_signedData; + asn1_oid_id_pkcs9_contentType; + asn1_oid_id_pkcs9_countersignature; + asn1_oid_id_pkcs9_emailAddress; + asn1_oid_id_pkcs9_messageDigest; + asn1_oid_id_pkcs9_signingTime; + asn1_oid_id_pkcs_1; + asn1_oid_id_pkcs_12; + asn1_oid_id_pkcs_12PbeIds; + asn1_oid_id_pkcs_2; + asn1_oid_id_pkcs_3; + asn1_oid_id_pkcs_9; + asn1_oid_id_pkcs_9_at_certTypes; + asn1_oid_id_pkcs_9_at_certTypes_x509; + asn1_oid_id_pkcs_9_at_friendlyName; + asn1_oid_id_pkcs_9_at_localKeyId; + asn1_oid_id_pkdhkeydata; + asn1_oid_id_pkekuoid; + asn1_oid_id_pkinit; + asn1_oid_id_pkinit_kdf; + asn1_oid_id_pkinit_kdf_ah_sha1; + asn1_oid_id_pkinit_kdf_ah_sha256; + asn1_oid_id_pkinit_kdf_ah_sha512; + asn1_oid_id_pkinit_ms_eku; + asn1_oid_id_pkinit_ms_san; + asn1_oid_id_pkinit_san; + asn1_oid_id_pkix; + asn1_oid_id_pkix_kp; + asn1_oid_id_pkix_kp_OCSPSigning; + asn1_oid_id_pkix_kp_clientAuth; + asn1_oid_id_pkix_kp_emailProtection; + asn1_oid_id_pkix_kp_serverAuth; + asn1_oid_id_pkix_kp_timeStamping; + asn1_oid_id_pkix_on; + asn1_oid_id_pkix_on_dnsSRV; + asn1_oid_id_pkix_on_xmppAddr; + asn1_oid_id_pkix_pe; + asn1_oid_id_pkix_pe_authorityInfoAccess; + asn1_oid_id_pkix_pe_proxyCertInfo; + asn1_oid_id_pkix_ppl; + asn1_oid_id_pkix_ppl_anyLanguage; + asn1_oid_id_pkix_ppl_independent; + asn1_oid_id_pkix_ppl_inheritAll; + asn1_oid_id_pkkdcekuoid; + asn1_oid_id_pkrkeydata; + asn1_oid_id_rsa_digestAlgorithm; + asn1_oid_id_rsa_digest_md2; + asn1_oid_id_rsa_digest_md4; + asn1_oid_id_rsa_digest_md5; + asn1_oid_id_rsadsi_des_ede3_cbc; + asn1_oid_id_rsadsi_encalg; + asn1_oid_id_rsadsi_rc2_cbc; + asn1_oid_id_secsig_sha_1; + asn1_oid_id_secsig_sha_1WithRSAEncryption; + asn1_oid_id_sha224; + asn1_oid_id_sha256; + asn1_oid_id_sha384; + asn1_oid_id_sha512; + asn1_oid_id_uspkicommon_card_id; + asn1_oid_id_uspkicommon_piv_interim; + asn1_oid_id_x509_ce; + asn1_oid_id_x509_ce_authorityKeyIdentifier; + asn1_oid_id_x509_ce_basicConstraints; + asn1_oid_id_x509_ce_cRLDistributionPoints; + asn1_oid_id_x509_ce_cRLNumber; + asn1_oid_id_x509_ce_cRLReason; + asn1_oid_id_x509_ce_certificateIssuer; + asn1_oid_id_x509_ce_certificatePolicies; + asn1_oid_id_x509_ce_deltaCRLIndicator; + asn1_oid_id_x509_ce_extKeyUsage; + asn1_oid_id_x509_ce_freshestCRL; + asn1_oid_id_x509_ce_holdInstructionCode; + asn1_oid_id_x509_ce_inhibitAnyPolicy; + asn1_oid_id_x509_ce_invalidityDate; + asn1_oid_id_x509_ce_issuerAltName; + asn1_oid_id_x509_ce_issuingDistributionPoint; + asn1_oid_id_x509_ce_keyUsage; + asn1_oid_id_x509_ce_nameConstraints; + asn1_oid_id_x509_ce_policyConstraints; + asn1_oid_id_x509_ce_policyMappings; + asn1_oid_id_x509_ce_privateKeyUsagePeriod; + asn1_oid_id_x509_ce_subjectAltName; + asn1_oid_id_x509_ce_subjectDirectoryAttributes; + asn1_oid_id_x509_ce_subjectKeyIdentifier; + asn1_oid_id_x520_at; + asn1_oid_id_x9_57; + copy_AD_AND_OR; + copy_AD_IF_RELEVANT; + copy_AD_INITIAL_VERIFIED_CAS; + copy_AD_KDCIssued; + copy_AD_LoginAlias; + copy_AD_MANDATORY_FOR_KDC; + copy_APOptions; + copy_AP_REP; + copy_AP_REQ; + copy_AS_REP; + copy_AS_REQ; + copy_AUTHDATA_TYPE; + copy_AccessDescription; + copy_AlgorithmIdentifier; + copy_Attribute; + copy_AttributeType; + copy_AttributeTypeAndValue; + copy_AttributeValue; + copy_AuthPack; + copy_AuthPack_Win2k; + copy_Authenticator; + copy_AuthorityInfoAccessSyntax; + copy_AuthorityKeyIdentifier; + copy_AuthorizationData; + copy_AuthorizationDataElement; + copy_BaseDistance; + copy_BasicConstraints; + copy_CKSUMTYPE; + copy_CMSAttributes; + copy_CMSCBCParameter; + copy_CMSEncryptedData; + copy_CMSIdentifier; + copy_CMSRC2CBCParameter; + copy_CMSVersion; + copy_CRLCertificateList; + copy_CRLDistributionPoints; + copy_CRLReason; + copy_Certificate; + copy_CertificateList; + copy_CertificateRevocationLists; + copy_CertificateSerialNumber; + copy_CertificateSet; + copy_Certificates; + copy_ChangePasswdDataMS; + copy_Checksum; + copy_ContentEncryptionAlgorithmIdentifier; + copy_ContentInfo; + copy_ContentType; + copy_DHNonce; + copy_DHParameter; + copy_DHPublicKey; + copy_DHRepInfo; + copy_DSAParams; + copy_DSAPublicKey; + copy_DSASigValue; + copy_DigestAlgorithmIdentifier; + copy_DigestAlgorithmIdentifiers; + copy_DigestError; + copy_DigestInfo; + copy_DigestInit; + copy_DigestInitReply; + copy_DigestREP; + copy_DigestREQ; + copy_DigestRepInner; + copy_DigestReqInner; + copy_DigestRequest; + copy_DigestResponse; + copy_DigestTypes; + copy_DirectoryString; + copy_DistributionPoint; + copy_DistributionPointName; + copy_DistributionPointReasonFlags; + copy_DomainParameters; + copy_ECDSA_Sig_Value; + copy_ECParameters; + copy_ECPoint; + copy_ENCTYPE; + copy_ETYPE_INFO; + copy_ETYPE_INFO2; + copy_ETYPE_INFO2_ENTRY; + copy_ETYPE_INFO_ENTRY; + copy_EncAPRepPart; + copy_EncASRepPart; + copy_EncKDCRepPart; + copy_EncKrbCredPart; + copy_EncKrbPrivPart; + copy_EncTGSRepPart; + copy_EncTicketPart; + copy_EncapsulatedContentInfo; + copy_EncryptedContent; + copy_EncryptedContentInfo; + copy_EncryptedData; + copy_EncryptedKey; + copy_EncryptionKey; + copy_EnvelopedData; + copy_EtypeList; + copy_ExtKeyUsage; + copy_Extension; + copy_Extensions; + copy_ExternalPrincipalIdentifier; + copy_ExternalPrincipalIdentifiers; + copy_FastOptions; + copy_GeneralName; + copy_GeneralNames; + copy_GeneralSubtree; + copy_GeneralSubtrees; + copy_HostAddress; + copy_HostAddresses; + copy_IssuerAndSerialNumber; + copy_KDCDHKeyInfo; + copy_KDCDHKeyInfo_Win2k; + copy_KDCOptions; + copy_KDC_REP; + copy_KDC_REQ; + copy_KDC_REQ_BODY; + copy_KDFAlgorithmId; + copy_KRB5PrincipalName; + copy_KRB5SignedPath; + copy_KRB5SignedPathData; + copy_KRB_CRED; + copy_KRB_ERROR; + copy_KRB_PRIV; + copy_KRB_SAFE; + copy_KRB_SAFE_BODY; + copy_KX509_ERROR_CODE; + copy_KerberosString; + copy_KerberosTime; + copy_KeyEncryptionAlgorithmIdentifier; + copy_KeyIdentifier; + copy_KeyTransRecipientInfo; + copy_KeyUsage; + copy_KrbCredInfo; + copy_KrbFastArmor; + copy_KrbFastArmoredRep; + copy_KrbFastArmoredReq; + copy_KrbFastFinished; + copy_KrbFastReq; + copy_KrbFastResponse; + copy_Kx509Request; + copy_Kx509Response; + copy_LR_TYPE; + copy_LastReq; + copy_MESSAGE_TYPE; + copy_METHOD_DATA; + copy_MS_UPN_SAN; + copy_MessageDigest; + copy_NAME_TYPE; + copy_NTLMInit; + copy_NTLMInitReply; + copy_NTLMReply; + copy_NTLMRequest; + copy_NTLMRequest2; + copy_NTLMResponse; + copy_Name; + copy_NameConstraints; + copy_OriginatorInfo; + copy_OtherName; + copy_PADATA_TYPE; + copy_PA_ClientCanonicalized; + copy_PA_ClientCanonicalizedNames; + copy_PA_DATA; + copy_PA_ENC_SAM_RESPONSE_ENC; + copy_PA_ENC_TS_ENC; + copy_PA_FX_FAST_REPLY; + copy_PA_FX_FAST_REQUEST; + copy_PA_PAC_REQUEST; + copy_PA_PK_AS_REP; + copy_PA_PK_AS_REP_BTMM; + copy_PA_PK_AS_REP_Win2k; + copy_PA_PK_AS_REQ; + copy_PA_PK_AS_REQ_Win2k; + copy_PA_S4U2Self; + copy_PA_SAM_CHALLENGE_2; + copy_PA_SAM_CHALLENGE_2_BODY; + copy_PA_SAM_REDIRECT; + copy_PA_SAM_RESPONSE_2; + copy_PA_SAM_TYPE; + copy_PA_SERVER_REFERRAL_DATA; + copy_PA_ServerReferralData; + copy_PA_SvrReferralData; + copy_PKAuthenticator; + copy_PKAuthenticator_Win2k; + copy_PKCS12_Attribute; + copy_PKCS12_Attributes; + copy_PKCS12_AuthenticatedSafe; + copy_PKCS12_CertBag; + copy_PKCS12_MacData; + copy_PKCS12_OctetString; + copy_PKCS12_PBEParams; + copy_PKCS12_PFX; + copy_PKCS12_SafeBag; + copy_PKCS12_SafeContents; + copy_PKCS8Attributes; + copy_PKCS8EncryptedData; + copy_PKCS8EncryptedPrivateKeyInfo; + copy_PKCS8PrivateKey; + copy_PKCS8PrivateKeyAlgorithmIdentifier; + copy_PKCS8PrivateKeyInfo; + copy_PKCS9_BMPString; + copy_PKCS9_friendlyName; + copy_PKIXXmppAddr; + copy_PROV_SRV_LOCATION; + copy_PkinitSP80056AOtherInfo; + copy_PkinitSuppPubInfo; + copy_Principal; + copy_PrincipalName; + copy_Principals; + copy_ProxyCertInfo; + copy_ProxyPolicy; + copy_RDNSequence; + copy_RSAPrivateKey; + copy_RSAPublicKey; + copy_Realm; + copy_RecipientIdentifier; + copy_RecipientInfo; + copy_RecipientInfos; + copy_RelativeDistinguishedName; + copy_ReplyKeyPack; + copy_ReplyKeyPack_Win2k; + copy_SAMFlags; + copy_SignatureAlgorithmIdentifier; + copy_SignatureValue; + copy_SignedData; + copy_SignerIdentifier; + copy_SignerInfo; + copy_SignerInfos; + copy_SubjectKeyIdentifier; + copy_SubjectPublicKeyInfo; + copy_TBSCRLCertList; + copy_TBSCertificate; + copy_TD_DH_PARAMETERS; + copy_TD_INVALID_CERTIFICATES; + copy_TD_TRUSTED_CERTIFIERS; + copy_TGS_REP; + copy_TGS_REQ; + copy_TYPED_DATA; + copy_Ticket; + copy_TicketFlags; + copy_Time; + copy_TransitedEncoding; + copy_TrustedCA; + copy_TrustedCA_Win2k; + copy_TypedData; + copy_UniqueIdentifier; + copy_UnprotectedAttributes; + copy_ValidationParms; + copy_Validity; + copy_Version; + copy_heim_any; + copy_heim_any_set; + copy_krb5int32; + copy_krb5uint32; + decode_AD_AND_OR; + decode_AD_IF_RELEVANT; + decode_AD_INITIAL_VERIFIED_CAS; + decode_AD_KDCIssued; + decode_AD_LoginAlias; + decode_AD_MANDATORY_FOR_KDC; + decode_APOptions; + decode_AP_REP; + decode_AP_REQ; + decode_AS_REP; + decode_AS_REQ; + decode_AUTHDATA_TYPE; + decode_AccessDescription; + decode_AlgorithmIdentifier; + decode_Attribute; + decode_AttributeType; + decode_AttributeTypeAndValue; + decode_AttributeValue; + decode_AuthPack; + decode_AuthPack_Win2k; + decode_Authenticator; + decode_AuthorityInfoAccessSyntax; + decode_AuthorityKeyIdentifier; + decode_AuthorizationData; + decode_AuthorizationDataElement; + decode_BaseDistance; + decode_BasicConstraints; + decode_CKSUMTYPE; + decode_CMSAttributes; + decode_CMSCBCParameter; + decode_CMSEncryptedData; + decode_CMSIdentifier; + decode_CMSRC2CBCParameter; + decode_CMSVersion; + decode_CRLCertificateList; + decode_CRLDistributionPoints; + decode_CRLReason; + decode_Certificate; + decode_CertificateList; + decode_CertificateRevocationLists; + decode_CertificateSerialNumber; + decode_CertificateSet; + decode_Certificates; + decode_ChangePasswdDataMS; + decode_Checksum; + decode_ContentEncryptionAlgorithmIdentifier; + decode_ContentInfo; + decode_ContentType; + decode_DHNonce; + decode_DHParameter; + decode_DHPublicKey; + decode_DHRepInfo; + decode_DSAParams; + decode_DSAPublicKey; + decode_DSASigValue; + decode_DigestAlgorithmIdentifier; + decode_DigestAlgorithmIdentifiers; + decode_DigestError; + decode_DigestInfo; + decode_DigestInit; + decode_DigestInitReply; + decode_DigestREP; + decode_DigestREQ; + decode_DigestRepInner; + decode_DigestReqInner; + decode_DigestRequest; + decode_DigestResponse; + decode_DigestTypes; + decode_DirectoryString; + decode_DistributionPoint; + decode_DistributionPointName; + decode_DistributionPointReasonFlags; + decode_DomainParameters; + decode_ECDSA_Sig_Value; + decode_ECParameters; + decode_ECPoint; + decode_ENCTYPE; + decode_ETYPE_INFO; + decode_ETYPE_INFO2; + decode_ETYPE_INFO2_ENTRY; + decode_ETYPE_INFO_ENTRY; + decode_EncAPRepPart; + decode_EncASRepPart; + decode_EncKDCRepPart; + decode_EncKrbCredPart; + decode_EncKrbPrivPart; + decode_EncTGSRepPart; + decode_EncTicketPart; + decode_EncapsulatedContentInfo; + decode_EncryptedContent; + decode_EncryptedContentInfo; + decode_EncryptedData; + decode_EncryptedKey; + decode_EncryptionKey; + decode_EnvelopedData; + decode_EtypeList; + decode_ExtKeyUsage; + decode_Extension; + decode_Extensions; + decode_ExternalPrincipalIdentifier; + decode_ExternalPrincipalIdentifiers; + decode_FastOptions; + decode_GeneralName; + decode_GeneralNames; + decode_GeneralSubtree; + decode_GeneralSubtrees; + decode_HostAddress; + decode_HostAddresses; + decode_IssuerAndSerialNumber; + decode_KDCDHKeyInfo; + decode_KDCDHKeyInfo_Win2k; + decode_KDCOptions; + decode_KDC_REP; + decode_KDC_REQ; + decode_KDC_REQ_BODY; + decode_KDFAlgorithmId; + decode_KRB5PrincipalName; + decode_KRB5SignedPath; + decode_KRB5SignedPathData; + decode_KRB_CRED; + decode_KRB_ERROR; + decode_KRB_PRIV; + decode_KRB_SAFE; + decode_KRB_SAFE_BODY; + decode_KX509_ERROR_CODE; + decode_KerberosString; + decode_KerberosTime; + decode_KeyEncryptionAlgorithmIdentifier; + decode_KeyIdentifier; + decode_KeyTransRecipientInfo; + decode_KeyUsage; + decode_KrbCredInfo; + decode_KrbFastArmor; + decode_KrbFastArmoredRep; + decode_KrbFastArmoredReq; + decode_KrbFastFinished; + decode_KrbFastReq; + decode_KrbFastResponse; + decode_Kx509Request; + decode_Kx509Response; + decode_LR_TYPE; + decode_LastReq; + decode_MESSAGE_TYPE; + decode_METHOD_DATA; + decode_MS_UPN_SAN; + decode_MessageDigest; + decode_NAME_TYPE; + decode_NTLMInit; + decode_NTLMInitReply; + decode_NTLMReply; + decode_NTLMRequest; + decode_NTLMRequest2; + decode_NTLMResponse; + decode_Name; + decode_NameConstraints; + decode_OriginatorInfo; + decode_OtherName; + decode_PADATA_TYPE; + decode_PA_ClientCanonicalized; + decode_PA_ClientCanonicalizedNames; + decode_PA_DATA; + decode_PA_ENC_SAM_RESPONSE_ENC; + decode_PA_ENC_TS_ENC; + decode_PA_FX_FAST_REPLY; + decode_PA_FX_FAST_REQUEST; + decode_PA_PAC_REQUEST; + decode_PA_PK_AS_REP; + decode_PA_PK_AS_REP_BTMM; + decode_PA_PK_AS_REP_Win2k; + decode_PA_PK_AS_REQ; + decode_PA_PK_AS_REQ_Win2k; + decode_PA_S4U2Self; + decode_PA_SAM_CHALLENGE_2; + decode_PA_SAM_CHALLENGE_2_BODY; + decode_PA_SAM_REDIRECT; + decode_PA_SAM_RESPONSE_2; + decode_PA_SAM_TYPE; + decode_PA_SERVER_REFERRAL_DATA; + decode_PA_ServerReferralData; + decode_PA_SvrReferralData; + decode_PKAuthenticator; + decode_PKAuthenticator_Win2k; + decode_PKCS12_Attribute; + decode_PKCS12_Attributes; + decode_PKCS12_AuthenticatedSafe; + decode_PKCS12_CertBag; + decode_PKCS12_MacData; + decode_PKCS12_OctetString; + decode_PKCS12_PBEParams; + decode_PKCS12_PFX; + decode_PKCS12_SafeBag; + decode_PKCS12_SafeContents; + decode_PKCS8Attributes; + decode_PKCS8EncryptedData; + decode_PKCS8EncryptedPrivateKeyInfo; + decode_PKCS8PrivateKey; + decode_PKCS8PrivateKeyAlgorithmIdentifier; + decode_PKCS8PrivateKeyInfo; + decode_PKCS9_BMPString; + decode_PKCS9_friendlyName; + decode_PKIXXmppAddr; + decode_PROV_SRV_LOCATION; + decode_PkinitSP80056AOtherInfo; + decode_PkinitSuppPubInfo; + decode_Principal; + decode_PrincipalName; + decode_Principals; + decode_ProxyCertInfo; + decode_ProxyPolicy; + decode_RDNSequence; + decode_RSAPrivateKey; + decode_RSAPublicKey; + decode_Realm; + decode_RecipientIdentifier; + decode_RecipientInfo; + decode_RecipientInfos; + decode_RelativeDistinguishedName; + decode_ReplyKeyPack; + decode_ReplyKeyPack_Win2k; + decode_SAMFlags; + decode_SignatureAlgorithmIdentifier; + decode_SignatureValue; + decode_SignedData; + decode_SignerIdentifier; + decode_SignerInfo; + decode_SignerInfos; + decode_SubjectKeyIdentifier; + decode_SubjectPublicKeyInfo; + decode_TBSCRLCertList; + decode_TBSCertificate; + decode_TD_DH_PARAMETERS; + decode_TD_INVALID_CERTIFICATES; + decode_TD_TRUSTED_CERTIFIERS; + decode_TGS_REP; + decode_TGS_REQ; + decode_TYPED_DATA; + decode_Ticket; + decode_TicketFlags; + decode_Time; + decode_TransitedEncoding; + decode_TrustedCA; + decode_TrustedCA_Win2k; + decode_TypedData; + decode_UniqueIdentifier; + decode_UnprotectedAttributes; + decode_ValidationParms; + decode_Validity; + decode_Version; + decode_heim_any; + decode_heim_any_set; + decode_krb5int32; + decode_krb5uint32; + der_copy_bit_string; + der_copy_bmp_string; + der_copy_general_string; + der_copy_generalized_time; + der_copy_heim_integer; + der_copy_ia5_string; + der_copy_integer; + der_copy_octet_string; + der_copy_oid; + der_copy_printable_string; + der_copy_universal_string; + der_copy_unsigned; + der_copy_utctime; + der_copy_utf8string; + der_copy_visible_string; + der_free_bit_string; + der_free_bmp_string; + der_free_general_string; + der_free_generalized_time; + der_free_heim_integer; + der_free_ia5_string; + der_free_integer; + der_free_octet_string; + der_free_oid; + der_free_printable_string; + der_free_universal_string; + der_free_unsigned; + der_free_utctime; + der_free_utf8string; + der_free_visible_string; + der_get_bit_string; + der_get_bmp_string; + der_get_boolean; + der_get_class_name; + der_get_class_num; + der_get_general_string; + der_get_generalized_time; + der_get_heim_integer; + der_get_ia5_string; + der_get_integer; + der_get_length; + der_get_octet_string; + der_get_octet_string_ber; + der_get_oid; + der_get_printable_string; + der_get_tag; + der_get_tag_name; + der_get_tag_num; + der_get_type_name; + der_get_type_num; + der_get_universal_string; + der_get_unsigned; + der_get_utctime; + der_get_utf8string; + der_get_visible_string; + der_heim_bit_string_cmp; + der_heim_bmp_string_cmp; + der_heim_integer_cmp; + der_heim_octet_string_cmp; + der_heim_oid_cmp; + der_heim_universal_string_cmp; + der_ia5_string_cmp; + der_length_bit_string; + der_length_bmp_string; + der_length_boolean; + der_length_enumerated; + der_length_general_string; + der_length_generalized_time; + der_length_heim_integer; + der_length_ia5_string; + der_length_integer; + der_length_len; + der_length_octet_string; + der_length_oid; + der_length_printable_string; + der_length_tag; + der_length_universal_string; + der_length_unsigned; + der_length_utctime; + der_length_utf8string; + der_length_visible_string; + der_match_tag; + der_match_tag2; + der_match_tag_and_length; + der_parse_heim_oid; + der_parse_hex_heim_integer; + der_print_heim_oid; + der_print_hex_heim_integer; + der_printable_string_cmp; + der_put_bit_string; + der_put_bmp_string; + der_put_boolean; + der_put_general_string; + der_put_generalized_time; + der_put_heim_integer; + der_put_ia5_string; + der_put_integer; + der_put_length; + der_put_length_and_tag; + der_put_octet_string; + der_put_oid; + der_put_printable_string; + der_put_tag; + der_put_universal_string; + der_put_unsigned; + der_put_utctime; + der_put_utf8string; + der_put_visible_string; + encode_AD_AND_OR; + encode_AD_IF_RELEVANT; + encode_AD_INITIAL_VERIFIED_CAS; + encode_AD_KDCIssued; + encode_AD_LoginAlias; + encode_AD_MANDATORY_FOR_KDC; + encode_APOptions; + encode_AP_REP; + encode_AP_REQ; + encode_AS_REP; + encode_AS_REQ; + encode_AUTHDATA_TYPE; + encode_AccessDescription; + encode_AlgorithmIdentifier; + encode_Attribute; + encode_AttributeType; + encode_AttributeTypeAndValue; + encode_AttributeValue; + encode_AuthPack; + encode_AuthPack_Win2k; + encode_Authenticator; + encode_AuthorityInfoAccessSyntax; + encode_AuthorityKeyIdentifier; + encode_AuthorizationData; + encode_AuthorizationDataElement; + encode_BaseDistance; + encode_BasicConstraints; + encode_CKSUMTYPE; + encode_CMSAttributes; + encode_CMSCBCParameter; + encode_CMSEncryptedData; + encode_CMSIdentifier; + encode_CMSRC2CBCParameter; + encode_CMSVersion; + encode_CRLCertificateList; + encode_CRLDistributionPoints; + encode_CRLReason; + encode_Certificate; + encode_CertificateList; + encode_CertificateRevocationLists; + encode_CertificateSerialNumber; + encode_CertificateSet; + encode_Certificates; + encode_ChangePasswdDataMS; + encode_Checksum; + encode_ContentEncryptionAlgorithmIdentifier; + encode_ContentInfo; + encode_ContentType; + encode_DHNonce; + encode_DHParameter; + encode_DHPublicKey; + encode_DHRepInfo; + encode_DSAParams; + encode_DSAPublicKey; + encode_DSASigValue; + encode_DigestAlgorithmIdentifier; + encode_DigestAlgorithmIdentifiers; + encode_DigestError; + encode_DigestInfo; + encode_DigestInit; + encode_DigestInitReply; + encode_DigestREP; + encode_DigestREQ; + encode_DigestRepInner; + encode_DigestReqInner; + encode_DigestRequest; + encode_DigestResponse; + encode_DigestTypes; + encode_DirectoryString; + encode_DistributionPoint; + encode_DistributionPointName; + encode_DistributionPointReasonFlags; + encode_DomainParameters; + encode_ECDSA_Sig_Value; + encode_ECParameters; + encode_ECPoint; + encode_ENCTYPE; + encode_ETYPE_INFO; + encode_ETYPE_INFO2; + encode_ETYPE_INFO2_ENTRY; + encode_ETYPE_INFO_ENTRY; + encode_EncAPRepPart; + encode_EncASRepPart; + encode_EncKDCRepPart; + encode_EncKrbCredPart; + encode_EncKrbPrivPart; + encode_EncTGSRepPart; + encode_EncTicketPart; + encode_EncapsulatedContentInfo; + encode_EncryptedContent; + encode_EncryptedContentInfo; + encode_EncryptedData; + encode_EncryptedKey; + encode_EncryptionKey; + encode_EnvelopedData; + encode_EtypeList; + encode_ExtKeyUsage; + encode_Extension; + encode_Extensions; + encode_ExternalPrincipalIdentifier; + encode_ExternalPrincipalIdentifiers; + encode_FastOptions; + encode_GeneralName; + encode_GeneralNames; + encode_GeneralSubtree; + encode_GeneralSubtrees; + encode_HostAddress; + encode_HostAddresses; + encode_IssuerAndSerialNumber; + encode_KDCDHKeyInfo; + encode_KDCDHKeyInfo_Win2k; + encode_KDCOptions; + encode_KDC_REP; + encode_KDC_REQ; + encode_KDC_REQ_BODY; + encode_KDFAlgorithmId; + encode_KRB5PrincipalName; + encode_KRB5SignedPath; + encode_KRB5SignedPathData; + encode_KRB_CRED; + encode_KRB_ERROR; + encode_KRB_PRIV; + encode_KRB_SAFE; + encode_KRB_SAFE_BODY; + encode_KX509_ERROR_CODE; + encode_KerberosString; + encode_KerberosTime; + encode_KeyEncryptionAlgorithmIdentifier; + encode_KeyIdentifier; + encode_KeyTransRecipientInfo; + encode_KeyUsage; + encode_KrbCredInfo; + encode_KrbFastArmor; + encode_KrbFastArmoredRep; + encode_KrbFastArmoredReq; + encode_KrbFastFinished; + encode_KrbFastReq; + encode_KrbFastResponse; + encode_Kx509Request; + encode_Kx509Response; + encode_LR_TYPE; + encode_LastReq; + encode_MESSAGE_TYPE; + encode_METHOD_DATA; + encode_MS_UPN_SAN; + encode_MessageDigest; + encode_NAME_TYPE; + encode_NTLMInit; + encode_NTLMInitReply; + encode_NTLMReply; + encode_NTLMRequest; + encode_NTLMRequest2; + encode_NTLMResponse; + encode_Name; + encode_NameConstraints; + encode_OriginatorInfo; + encode_OtherName; + encode_PADATA_TYPE; + encode_PA_ClientCanonicalized; + encode_PA_ClientCanonicalizedNames; + encode_PA_DATA; + encode_PA_ENC_SAM_RESPONSE_ENC; + encode_PA_ENC_TS_ENC; + encode_PA_FX_FAST_REPLY; + encode_PA_FX_FAST_REQUEST; + encode_PA_PAC_REQUEST; + encode_PA_PK_AS_REP; + encode_PA_PK_AS_REP_BTMM; + encode_PA_PK_AS_REP_Win2k; + encode_PA_PK_AS_REQ; + encode_PA_PK_AS_REQ_Win2k; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:36:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF1641065670; Sun, 8 Apr 2012 04:36:27 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA9F88FC12; Sun, 8 Apr 2012 04:36:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q384aRlR093118; Sun, 8 Apr 2012 04:36:27 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q384aRXS093116; Sun, 8 Apr 2012 04:36:27 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201204080436.q384aRXS093116@svn.freebsd.org> From: Andrew Turner Date: Sun, 8 Apr 2012 04:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:36:28 -0000 Author: andrew Date: Sun Apr 8 04:36:27 2012 New Revision: 234014 URL: http://svn.freebsd.org/changeset/base/234014 Log: Unlike other functions __aeabi_read_tp function must preserve r1-r3. The currently generated code clobbers r3. Fix this by loading ARM_TP_ADDRESS using inline assembly. Approved by: imp (mentor) Modified: head/lib/libc/arm/gen/__aeabi_read_tp.c Modified: head/lib/libc/arm/gen/__aeabi_read_tp.c ============================================================================== --- head/lib/libc/arm/gen/__aeabi_read_tp.c Sun Apr 8 04:22:09 2012 (r234013) +++ head/lib/libc/arm/gen/__aeabi_read_tp.c Sun Apr 8 04:36:27 2012 (r234014) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +37,9 @@ __FBSDID("$FreeBSD$"); void * __aeabi_read_tp() { - void **_tp = (void **)ARM_TP_ADDRESS; + void *_tp; - return (*_tp); + asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS)); + + return _tp; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:42:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64107106566C; Sun, 8 Apr 2012 04:42:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EEEA8FC08; Sun, 8 Apr 2012 04:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q384gsPN093346; Sun, 8 Apr 2012 04:42:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q384gsFs093344; Sun, 8 Apr 2012 04:42:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204080442.q384gsFs093344@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 Apr 2012 04:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234015 - head/tools/tools/ath/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:42:54 -0000 Author: adrian Date: Sun Apr 8 04:42:53 2012 New Revision: 234015 URL: http://svn.freebsd.org/changeset/base/234015 Log: Add AR_ISR_S5 and AR_ISR_S5_S. Modified: head/tools/tools/ath/common/dumpregs_5416.c Modified: head/tools/tools/ath/common/dumpregs_5416.c ============================================================================== --- head/tools/tools/ath/common/dumpregs_5416.c Sun Apr 8 04:36:27 2012 (r234014) +++ head/tools/tools/ath/common/dumpregs_5416.c Sun Apr 8 04:42:53 2012 (r234015) @@ -76,6 +76,7 @@ static struct dumpreg ar5416regs[] = { "\30CABTO\31DTIM"), DEFINT(AR_ISR_S3, "ISR_S3"), DEFINT(AR_ISR_S4, "ISR_S4"), + DEFINT(AR_ISR_S5, "ISR_S5"), DEFINTfmt(AR_IMR, "IMR", "\20\1RXOK\2RXDESC\3RXERR\4RXNOPKT\5RXEOL\6RXORN\7TXOK\10TXDESC" "\11TXERR\12TXNOPKT\13TXEOL\14TXURN\15MIB\16SWI\17RXPHY\20RXKCM" @@ -95,6 +96,7 @@ static struct dumpreg ar5416regs[] = { DEFINT(AR_ISR_S2_S, "ISR_S2_S"), DEFINT(AR_ISR_S3_S, "ISR_S3_S"), DEFINT(AR_ISR_S4_S, "ISR_S4_S"), + DEFINT(AR_ISR_S5_S, "ISR_S5_S"), DEFBASIC(AR_DMADBG_0, "DMADBG0"), DEFBASIC(AR_DMADBG_1, "DMADBG1"), From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:46:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D36106564A; Sun, 8 Apr 2012 04:46:42 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mailfilter7.ihug.co.nz (mailfilter7.ihug.co.nz [203.109.136.7]) by mx1.freebsd.org (Postfix) with ESMTP id BF1E78FC18; Sun, 8 Apr 2012 04:46:41 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=DE6nE7g822sA:10 a=kj9zAlcOel0A:10 a=f/SxzVRvWQdBqo0nlH1VRA==:17 a=6I5d2MoRAAAA:8 a=6aGdb0JzarhYoHAFRQ4A:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0IADIXgU/Ldqol/2dsb2JhbABFuDJygQiCCQEBBAE6HCMFCwgDFDI5HhmICQQMuUeLMYUpBJVrAZA2gnyBQA X-IronPort-AV: E=Sophos;i="4.75,389,1330858800"; d="scan'208";a="183847805" Received: from 203-118-170-37.adsl.ihug.co.nz (HELO localhost) ([203.118.170.37]) by cust.filter7.content.vf.net.nz with SMTP; 08 Apr 2012 16:45:32 +1200 Date: Sun, 8 Apr 2012 16:45:21 +1200 From: Andrew Turner Message-ID: <20120408164521.55aecdd1@fubar.geek.nz> In-Reply-To: <201204080436.q384aRXS093116@svn.freebsd.org> References: <201204080436.q384aRXS093116@svn.freebsd.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:46:42 -0000 On Sun, 8 Apr 2012 04:36:27 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Sun Apr 8 04:36:27 2012 > New Revision: 234014 > URL: http://svn.freebsd.org/changeset/base/234014 > > Log: > Unlike other functions __aeabi_read_tp function must preserve > r1-r3. The currently generated code clobbers r3. Fix this by loading > ARM_TP_ADDRESS using inline assembly. > > Approved by: imp (mentor) This fixes thread local storage on ARM in cases when the compiler loads the offset of the variable in r3 before calling __aeabi_read_tp as has been observed when the variable is in a shared library. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:51:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AE64106564A; Sun, 8 Apr 2012 04:51:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E16808FC08; Sun, 8 Apr 2012 04:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q384pP3o093889; Sun, 8 Apr 2012 04:51:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q384pPEW093886; Sun, 8 Apr 2012 04:51:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204080451.q384pPEW093886@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 Apr 2012 04:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234018 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:51:26 -0000 Author: adrian Date: Sun Apr 8 04:51:25 2012 New Revision: 234018 URL: http://svn.freebsd.org/changeset/base/234018 Log: Add some statistics to track BAR TX. Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Apr 8 04:48:59 2012 (r234017) +++ head/sys/net80211/ieee80211_ht.c Sun Apr 8 04:51:25 2012 (r234018) @@ -2182,10 +2182,13 @@ bar_timeout(void *arg) if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) == 0) return; /* XXX ? */ - if (tap->txa_attempts >= ieee80211_bar_maxtries) + if (tap->txa_attempts >= ieee80211_bar_maxtries) { + ni->ni_vap->iv_stats.is_ampdu_bar_tx_fail++; ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); - else + } else { + ni->ni_vap->iv_stats.is_ampdu_bar_tx_retry++; ieee80211_send_bar(ni, tap, tap->txa_seqpending); + } } static void @@ -2210,6 +2213,7 @@ bar_tx_complete(struct ieee80211_node *n __func__, tap->txa_ac, tap->txa_flags, callout_pending(&tap->txa_timer), status); + ni->ni_vap->iv_stats.is_ampdu_bar_tx++; /* XXX locking */ if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) && callout_pending(&tap->txa_timer)) { @@ -2325,6 +2329,7 @@ ieee80211_send_bar(struct ieee80211_node if (ret != 0) { /* xmit failed, clear state flag */ tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; + vap->iv_stats.is_ampdu_bar_tx_fail++; return ret; } /* XXX hack against tx complete happening before timer is started */ @@ -2332,6 +2337,7 @@ ieee80211_send_bar(struct ieee80211_node bar_start_timer(tap); return 0; bad: + vap->iv_stats.is_ampdu_bar_tx_fail++; ieee80211_free_node(ni); return ret; #undef senderr Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Sun Apr 8 04:48:59 2012 (r234017) +++ head/sys/net80211/ieee80211_ioctl.h Sun Apr 8 04:51:25 2012 (r234018) @@ -242,8 +242,11 @@ struct ieee80211_stats { uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ uint32_t is_hwmp_proxy; /* PREP for proxy route */ uint32_t is_beacon_bad; /* Number of bad beacons */ - - uint32_t is_spare[10]; + uint32_t is_ampdu_bar_tx; /* A-MPDU BAR frames TXed */ + uint32_t is_ampdu_bar_tx_retry; /* A-MPDU BAR frames TX rtry */ + uint32_t is_ampdu_bar_tx_fail; /* A-MPDU BAR frames TX fail */ + + uint32_t is_spare[7]; }; /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 04:51:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C0110656AE; Sun, 8 Apr 2012 04:51:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74F208FC12; Sun, 8 Apr 2012 04:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q384piFF093934; Sun, 8 Apr 2012 04:51:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q384piWh093932; Sun, 8 Apr 2012 04:51:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204080451.q384piWh093932@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 Apr 2012 04:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234019 - head/tools/tools/net80211/wlanstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 04:51:44 -0000 Author: adrian Date: Sun Apr 8 04:51:43 2012 New Revision: 234019 URL: http://svn.freebsd.org/changeset/base/234019 Log: Teach wlanstats about the new BAR TX statistics. Modified: head/tools/tools/net80211/wlanstats/wlanstats.c Modified: head/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.c Sun Apr 8 04:51:25 2012 (r234018) +++ head/tools/tools/net80211/wlanstats/wlanstats.c Sun Apr 8 04:51:43 2012 (r234019) @@ -372,6 +372,12 @@ static const struct fmt wlanstats[] = { { 5, "signal", "sig", "current signal (dBm)" }, #define S_BEACON_BAD AFTER(S_SIGNAL) { 9, "beacon_bad", "beaconbad", "bad beacons received" }, +#define S_AMPDU_BARTX AFTER(S_BEACON_BAD) + { 5, "ampdu_bartx", "bartx", "BAR frames sent" }, +#define S_AMPDU_BARTX_FAIL AFTER(S_AMPDU_BARTX) + { 9, "ampdu_bartxfail", "bartx_fail", "BAR frames failed to send" }, +#define S_AMPDU_BARTX_RETRY AFTER(S_AMPDU_BARTX_FAIL) + { 10, "ampdu_bartxretry", "bartx_retry", "BAR frames retried" }, }; struct wlanstatfoo_p { @@ -817,6 +823,9 @@ wlan_get_curstat(struct statfoo *sf, int case S_TX_UCAST: NSTAT(tx_ucast); case S_TX_MCAST: NSTAT(tx_mcast); case S_BEACON_BAD: STAT(beacon_bad); + case S_AMPDU_BARTX: STAT(ampdu_bar_tx); + case S_AMPDU_BARTX_RETRY: STAT(ampdu_bar_tx_retry); + case S_AMPDU_BARTX_FAIL: STAT(ampdu_bar_tx_fail); } return wlan_getinfo(wf, s, b, bs); #undef NSTAT @@ -976,6 +985,9 @@ wlan_get_totstat(struct statfoo *sf, int case S_TX_UCAST: NSTAT(tx_ucast); case S_TX_MCAST: NSTAT(tx_mcast); case S_BEACON_BAD: STAT(beacon_bad); + case S_AMPDU_BARTX: STAT(ampdu_bar_tx); + case S_AMPDU_BARTX_RETRY: STAT(ampdu_bar_tx_retry); + case S_AMPDU_BARTX_FAIL: STAT(ampdu_bar_tx_fail); } return wlan_getinfo(wf, s, b, bs); #undef NSTAT From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 06:14:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98865106564A; Sun, 8 Apr 2012 06:14:50 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 831E88FC12; Sun, 8 Apr 2012 06:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q386EoVF096738; Sun, 8 Apr 2012 06:14:50 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q386EovR096736; Sun, 8 Apr 2012 06:14:50 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204080614.q386EovR096736@svn.freebsd.org> From: Kirk McKusick Date: Sun, 8 Apr 2012 06:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234024 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 06:14:50 -0000 Author: mckusick Date: Sun Apr 8 06:14:49 2012 New Revision: 234024 URL: http://svn.freebsd.org/changeset/base/234024 Log: Drop an unnecessary setting of si_mountpt when updating a UFS mount point. Clearly it must have been set when the mount was done. Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Apr 8 05:36:40 2012 (r234023) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Apr 8 06:14:49 2012 (r234024) @@ -407,8 +407,6 @@ ffs_mount(struct mount *mp) vn_finished_write(mp); return (error); } - if (devvp->v_type == VCHR && devvp->v_rdev != NULL) - devvp->v_rdev->si_mountpt = mp; if (fs->fs_snapinum[0] != 0) ffs_snapshot_mount(mp); vn_finished_write(mp); From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 06:18:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C349106566B; Sun, 8 Apr 2012 06:18:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 277BD8FC12; Sun, 8 Apr 2012 06:18:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q386IJMi096879; Sun, 8 Apr 2012 06:18:19 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q386IIqU096877; Sun, 8 Apr 2012 06:18:18 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204080618.q386IIqU096877@svn.freebsd.org> From: Kirk McKusick Date: Sun, 8 Apr 2012 06:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234025 - head/sys/fs/msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 06:18:19 -0000 Author: mckusick Date: Sun Apr 8 06:18:18 2012 New Revision: 234025 URL: http://svn.freebsd.org/changeset/base/234025 Log: Add I/O accounting to msdos filesystem. Suggested and reviewed by: kib Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Apr 8 06:14:49 2012 (r234024) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Apr 8 06:18:18 2012 (r234025) @@ -401,6 +401,8 @@ msdosfs_mount(struct mount *mp) return error; } + if (devvp->v_type == VCHR && devvp->v_rdev != NULL) + devvp->v_rdev->si_mountpt = mp; vfs_mountedfrom(mp, from); #ifdef MSDOSFS_DEBUG printf("msdosfs_mount(): mp %p, pmp %p, inusemap %p\n", mp, pmp, pmp->pm_inusemap); @@ -843,6 +845,8 @@ msdosfs_unmount(struct mount *mp, int mn } #endif DROP_GIANT(); + if (pmp->pm_devvp->v_type == VCHR && pmp->pm_devvp->v_rdev != NULL) + pmp->pm_devvp->v_rdev->si_mountpt = NULL; g_topology_lock(); g_vfs_close(pmp->pm_cp); g_topology_unlock(); From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 06:20:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 164DC106566B; Sun, 8 Apr 2012 06:20:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 021D58FC0C; Sun, 8 Apr 2012 06:20:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q386KLPW096982; Sun, 8 Apr 2012 06:20:21 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q386KL2E096980; Sun, 8 Apr 2012 06:20:21 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204080620.q386KL2E096980@svn.freebsd.org> From: Kirk McKusick Date: Sun, 8 Apr 2012 06:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234026 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 06:20:22 -0000 Author: mckusick Date: Sun Apr 8 06:20:21 2012 New Revision: 234026 URL: http://svn.freebsd.org/changeset/base/234026 Log: Expand locking around identification of filesystem mount point when accounting for I/O counts at completion of I/O operation. Also switch from using global devmtx to vnode mutex to reduce contention. Suggested and reviewed by: kib Modified: head/sys/geom/geom_vfs.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Sun Apr 8 06:18:18 2012 (r234025) +++ head/sys/geom/geom_vfs.c Sun Apr 8 06:20:21 2012 (r234026) @@ -97,6 +97,7 @@ g_vfs_done(struct bio *bip) int vfslocked, destroy; struct mount *mp; struct vnode *vp; + struct cdev *cdevp; /* * Collect statistics on synchronous and asynchronous read @@ -106,12 +107,23 @@ g_vfs_done(struct bio *bip) */ bp = bip->bio_caller2; vp = bp->b_vp; - if (vp == NULL) + if (vp == NULL) { mp = NULL; - else if (vn_isdisk(vp, NULL)) - mp = vp->v_rdev->si_mountpt; - else - mp = vp->v_mount; + } else { + /* + * If not a disk vnode, use its associated mount point + * otherwise use the mountpoint associated with the disk. + */ + VI_LOCK(vp); + if (vp->v_type != VCHR || + (cdevp = vp->v_rdev) == NULL || + cdevp->si_devsw == NULL || + (cdevp->si_devsw->d_flags & D_DISK) == 0) + mp = vp->v_mount; + else + mp = cdevp->si_mountpt; + VI_UNLOCK(vp); + } if (mp != NULL) { if (bp->b_iocmd == BIO_WRITE) { if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 08:19:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88EB106564A; Sun, 8 Apr 2012 08:19:19 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD8B98FC12; Sun, 8 Apr 2012 08:19:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q388JJJt001782; Sun, 8 Apr 2012 08:19:19 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q388JH3H001687; Sun, 8 Apr 2012 08:19:17 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204080819.q388JH3H001687@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 8 Apr 2012 08:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234027 - in head: crypto/heimdal crypto/heimdal/appl/telnet/libtelnet crypto/heimdal/doc crypto/heimdal/doc/doxyout/gssapi/html crypto/heimdal/doc/doxyout/gssapi/man/man3 crypto/heimda... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 08:19:19 -0000 Author: stas Date: Sun Apr 8 08:19:17 2012 New Revision: 234027 URL: http://svn.freebsd.org/changeset/base/234027 Log: - Update FreeBSD's Heimdal distribution to 1.5.2. This is a bugfix release, which fixes a DoS issue in libkrb5. Modified: head/crypto/heimdal/NEWS head/crypto/heimdal/appl/telnet/libtelnet/encrypt.c head/crypto/heimdal/configure head/crypto/heimdal/doc/doxyout/gssapi/html/graph_legend.html head/crypto/heimdal/doc/doxyout/gssapi/html/group__gssapi.html head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_mechs_intro.html head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_services_intro.html head/crypto/heimdal/doc/doxyout/gssapi/html/index.html head/crypto/heimdal/doc/doxyout/gssapi/html/internalvsmechname.html head/crypto/heimdal/doc/doxyout/gssapi/html/modules.html head/crypto/heimdal/doc/doxyout/gssapi/html/pages.html head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi.3 head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_mechs_intro.3 head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_services_intro.3 head/crypto/heimdal/doc/doxyout/gssapi/man/man3/internalvsmechname.3 head/crypto/heimdal/doc/doxyout/hcrypto/html/example__evp__cipher_8c-example.html head/crypto/heimdal/doc/doxyout/hcrypto/html/examples.html head/crypto/heimdal/doc/doxyout/hcrypto/html/graph_legend.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__core.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__des.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__dh.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__evp.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__misc.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rand.html head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rsa.html head/crypto/heimdal/doc/doxyout/hcrypto/html/index.html head/crypto/heimdal/doc/doxyout/hcrypto/html/modules.html head/crypto/heimdal/doc/doxyout/hcrypto/html/page_des.html head/crypto/heimdal/doc/doxyout/hcrypto/html/page_dh.html head/crypto/heimdal/doc/doxyout/hcrypto/html/page_evp.html head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rand.html head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rsa.html head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_core.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_des.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_dh.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_evp.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_misc.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rsa.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_des.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_dh.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_evp.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rand.3 head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rsa.3 head/crypto/heimdal/doc/doxyout/hdb/html/annotated.html head/crypto/heimdal/doc/doxyout/hdb/html/functions.html head/crypto/heimdal/doc/doxyout/hdb/html/functions_vars.html head/crypto/heimdal/doc/doxyout/hdb/html/graph_legend.html head/crypto/heimdal/doc/doxyout/hdb/html/index.html head/crypto/heimdal/doc/doxyout/hdb/html/struct_h_d_b.html head/crypto/heimdal/doc/doxyout/hdb/html/structhdb__entry__ex.html head/crypto/heimdal/doc/doxyout/hdb/man/man3/HDB.3 head/crypto/heimdal/doc/doxyout/hdb/man/man3/hdb_entry_ex.3 head/crypto/heimdal/doc/doxyout/hx509/html/graph_legend.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__ca.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cert.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cms.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__crypto.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__env.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__error.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__keyset.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__lock.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__misc.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__name.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__peer.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__print.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__query.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__revoke.html head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__verify.html head/crypto/heimdal/doc/doxyout/hx509/html/index.html head/crypto/heimdal/doc/doxyout/hx509/html/modules.html head/crypto/heimdal/doc/doxyout/hx509/html/page_ca.html head/crypto/heimdal/doc/doxyout/hx509/html/page_cert.html head/crypto/heimdal/doc/doxyout/hx509/html/page_cms.html head/crypto/heimdal/doc/doxyout/hx509/html/page_env.html head/crypto/heimdal/doc/doxyout/hx509/html/page_error.html head/crypto/heimdal/doc/doxyout/hx509/html/page_keyset.html head/crypto/heimdal/doc/doxyout/hx509/html/page_lock.html head/crypto/heimdal/doc/doxyout/hx509/html/page_name.html head/crypto/heimdal/doc/doxyout/hx509/html/page_peer.html head/crypto/heimdal/doc/doxyout/hx509/html/page_print.html head/crypto/heimdal/doc/doxyout/hx509/html/page_revoke.html head/crypto/heimdal/doc/doxyout/hx509/html/pages.html head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_ca.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cert.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cms.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_crypto.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_env.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_error.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_keyset.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_lock.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_misc.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_name.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_peer.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_print.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_query.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_revoke.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_verify.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_ca.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_cert.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_cms.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_env.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_error.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_keyset.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_lock.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_name.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_peer.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_print.3 head/crypto/heimdal/doc/doxyout/hx509/man/man3/page_revoke.3 head/crypto/heimdal/doc/doxyout/krb5/html/annotated.html head/crypto/heimdal/doc/doxyout/krb5/html/graph_legend.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__address.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__auth.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__ccache.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__credential.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__crypto.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__deprecated.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__digest.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__error.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__keytab.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__pac.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__principal.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__storage.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__support.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__ticket.html head/crypto/heimdal/doc/doxyout/krb5/html/group__krb5__v4compat.html head/crypto/heimdal/doc/doxyout/krb5/html/index.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_ccache_intro.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_fileformats.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_init_creds_intro.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_introduction.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_keytab_intro.html head/crypto/heimdal/doc/doxyout/krb5/html/krb5_principal_intro.html head/crypto/heimdal/doc/doxyout/krb5/html/modules.html head/crypto/heimdal/doc/doxyout/krb5/html/pages.html head/crypto/heimdal/doc/doxyout/krb5/html/structkrb5__crypto__iov.html head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_address.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_auth.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_ccache.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_ccache_intro.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_credential.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_crypto.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_crypto_iov.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_deprecated.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_digest.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_error.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_fileformats.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_init_creds_intro.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_introduction.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_keytab.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_keytab_intro.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_pac.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_principal.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_principal_intro.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_storage.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_support.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_ticket.3 head/crypto/heimdal/doc/doxyout/krb5/man/man3/krb5_v4compat.3 head/crypto/heimdal/doc/doxyout/ntlm/html/annotated.html head/crypto/heimdal/doc/doxyout/ntlm/html/examples.html head/crypto/heimdal/doc/doxyout/ntlm/html/functions.html head/crypto/heimdal/doc/doxyout/ntlm/html/functions_vars.html head/crypto/heimdal/doc/doxyout/ntlm/html/graph_legend.html head/crypto/heimdal/doc/doxyout/ntlm/html/group__ntlm__core.html head/crypto/heimdal/doc/doxyout/ntlm/html/index.html head/crypto/heimdal/doc/doxyout/ntlm/html/modules.html head/crypto/heimdal/doc/doxyout/ntlm/html/structntlm__buf.html head/crypto/heimdal/doc/doxyout/ntlm/html/structntlm__type1.html head/crypto/heimdal/doc/doxyout/ntlm/html/structntlm__type2.html head/crypto/heimdal/doc/doxyout/ntlm/html/structntlm__type3.html head/crypto/heimdal/doc/doxyout/ntlm/html/test__ntlm_8c-example.html head/crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_buf.3 head/crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_core.3 head/crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_type1.3 head/crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_type2.3 head/crypto/heimdal/doc/doxyout/ntlm/man/man3/ntlm_type3.3 head/crypto/heimdal/doc/doxyout/wind/html/graph_legend.html head/crypto/heimdal/doc/doxyout/wind/html/group__wind.html head/crypto/heimdal/doc/doxyout/wind/html/index.html head/crypto/heimdal/doc/doxyout/wind/html/modules.html head/crypto/heimdal/doc/doxyout/wind/man/man3/wind.3 head/crypto/heimdal/doc/heimdal.texi head/crypto/heimdal/doc/intro.texi head/crypto/heimdal/doc/kerberos4.texi head/crypto/heimdal/doc/setup.texi head/crypto/heimdal/doc/vars.texi head/crypto/heimdal/kdc/default_config.c head/crypto/heimdal/kdc/kdc.8 head/crypto/heimdal/kdc/kdc.h head/crypto/heimdal/kdc/kerberos5.c head/crypto/heimdal/kdc/krb5tgs.c head/crypto/heimdal/kpasswd/kpasswdd.c head/crypto/heimdal/lib/gssapi/krb5/verify_mic.c head/crypto/heimdal/lib/hx509/sel-lex.l head/crypto/heimdal/lib/kadm5/password_quality.c head/crypto/heimdal/lib/krb5/crypto-arcfour.c head/crypto/heimdal/lib/krb5/crypto.c head/crypto/heimdal/lib/krb5/eai_to_heim_errno.c head/crypto/heimdal/lib/krb5/krb5.conf.5 head/crypto/heimdal/lib/krb5/pac.c head/crypto/heimdal/lib/krb5/verify_krb5_conf.c head/crypto/heimdal/lib/wind/bidi_table.c head/crypto/heimdal/lib/wind/bidi_table.h head/crypto/heimdal/lib/wind/combining_table.c head/crypto/heimdal/lib/wind/combining_table.h head/crypto/heimdal/lib/wind/errorlist_table.c head/crypto/heimdal/lib/wind/errorlist_table.h head/crypto/heimdal/lib/wind/map_table.c head/crypto/heimdal/lib/wind/map_table.h head/crypto/heimdal/lib/wind/normalize_table.c head/crypto/heimdal/lib/wind/normalize_table.h head/crypto/heimdal/lib/wind/punycode_examples.c head/crypto/heimdal/lib/wind/punycode_examples.h head/crypto/heimdal/lib/wind/utf8.c head/crypto/heimdal/lib/wind/version-script.map head/crypto/heimdal/tools/krb5-config.in head/kerberos5/include/config.h head/kerberos5/include/version.h Directory Properties: head/crypto/heimdal/ (props changed) Modified: head/crypto/heimdal/NEWS ============================================================================== --- head/crypto/heimdal/NEWS Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/NEWS Sun Apr 8 08:19:17 2012 (r234027) @@ -1,3 +1,16 @@ +Release Notes - Heimdal - Version Heimdal 1.5.2 + + Security fixes + - CVE-2011-4862 Buffer overflow in libtelnet/encrypt.c in telnetd - escalation of privilege + - Check that key types strictly match - denial of service + +Release Notes - Heimdal - Version Heimdal 1.5.1 + + Bug fixes + - Fix building on Solaris, requires c99 + - Fix building on Windows + - Build system updates + Release Notes - Heimdal - Version Heimdal 1.5 New features Modified: head/crypto/heimdal/appl/telnet/libtelnet/encrypt.c ============================================================================== --- head/crypto/heimdal/appl/telnet/libtelnet/encrypt.c Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/appl/telnet/libtelnet/encrypt.c Sun Apr 8 08:19:17 2012 (r234027) @@ -737,7 +737,7 @@ encrypt_keyid(struct key_info *kp, unsig int ret = 0; if (len > MAXKEYLEN) - len = MAXKEYLEN; + len = MAXKEYLEN; if (!(ep = (*kp->getcrypt)(*kp->modep))) { if (len == 0) Modified: head/crypto/heimdal/configure ============================================================================== --- head/crypto/heimdal/configure Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/configure Sun Apr 8 08:19:17 2012 (r234027) @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Revision. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for Heimdal 1.5.1. +# Generated by GNU Autoconf 2.65 for Heimdal 1.5.2. # # Report bugs to . # @@ -563,8 +563,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Heimdal' PACKAGE_TARNAME='heimdal' -PACKAGE_VERSION='1.5.1' -PACKAGE_STRING='Heimdal 1.5.1' +PACKAGE_VERSION='1.5.2' +PACKAGE_STRING='Heimdal 1.5.2' PACKAGE_BUGREPORT='heimdal-bugs@h5l.org' PACKAGE_URL='' @@ -1535,7 +1535,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Heimdal 1.5.1 to adapt to many kinds of systems. +\`configure' configures Heimdal 1.5.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1609,7 +1609,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Heimdal 1.5.1:";; + short | recursive ) echo "Configuration of Heimdal 1.5.2:";; esac cat <<\_ACEOF @@ -1798,7 +1798,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Heimdal configure 1.5.1 +Heimdal configure 1.5.2 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2252,7 +2252,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Heimdal $as_me 1.5.1, which was +It was created by Heimdal $as_me 1.5.2, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -3068,7 +3068,7 @@ fi # Define the identity of the package. PACKAGE='heimdal' - VERSION='1.5.1' + VERSION='1.5.2' cat >>confdefs.h <<_ACEOF @@ -29246,7 +29246,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Heimdal $as_me 1.5.1, which was +This file was extended by Heimdal $as_me 1.5.2, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -29312,7 +29312,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Heimdal config.status 1.5.1 +Heimdal config.status 1.5.2 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" @@ -31284,7 +31284,7 @@ cat > include/newversion.h.in <
-Generated on Fri Sep 30 15:26:17 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
+Generated on Wed Jan 11 14:07:44 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/group__gssapi.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/group__gssapi.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/group__gssapi.html Sun Apr 8 08:19:17 2012 (r234027) @@ -887,6 +887,6 @@ SSPI equivalent if this function is Quer


-Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
+Generated on Wed Jan 11 14:07:44 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_mechs_intro.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_mechs_intro.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_mechs_intro.html Sun Apr 8 08:19:17 2012 (r234027) @@ -25,6 +25,6 @@ GSS-API mechanisms
  • Kerberos 5 - GSS_KRB5_MECHANISM
  • SPNEGO - GSS_SPNEGO_MECHANISM
  • NTLM - GSS_NTLM_MECHANISM

  • -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:43 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_services_intro.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_services_intro.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/gssapi_services_intro.html Sun Apr 8 08:19:17 2012 (r234027) @@ -38,6 +38,6 @@ Per-message services
  • conf
  • int
  • message integrity
  • replay detection
  • out of sequence

  • -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:43 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/index.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/index.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/index.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,7 +21,7 @@

    Heimdal GSS-API Library

    -

    1.5.1

    Heimdal implements the following mechanisms:

    +

    1.5.2

    Heimdal implements the following mechanisms:

    • Kerberos 5
    • SPNEGO
    • NTLM

    @@ -31,6 +31,6 @@ The project web page: Introduction to GSS-API services

  • GSS-API mechanisms
  • Name forms

  • -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:43 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/internalvsmechname.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/internalvsmechname.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/internalvsmechname.html Sun Apr 8 08:19:17 2012 (r234027) @@ -31,6 +31,6 @@ There are two forms of name in GSS-API, There is also special form of the Internal Name (IN), and that is the Mechanism Name (MN). In the mechanism name all the generic information is stripped of and only contain the information for one mechanism. In GSS-API some function return MN and some require MN as input. Each of these function is marked up as such.

    Describe relationship between import_name, canonicalize_name, export_name and friends.


    -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:43 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/modules.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/modules.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/modules.html Sun Apr 8 08:19:17 2012 (r234027) @@ -24,6 +24,6 @@
    -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:44 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/html/pages.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/html/pages.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/html/pages.html Sun Apr 8 08:19:17 2012 (r234027) @@ -29,6 +29,6 @@
    -Generated on Fri Sep 30 15:26:16 2011 for HeimdalGSS-APIlibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:43 2012 for HeimdalGSS-APIlibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "Heimdal GSS-API functions" 3 "30 Sep 2011" "Version 1.5.1" "HeimdalGSS-APIlibrary" \" -*- nroff -*- +.TH "Heimdal GSS-API functions" 3 "11 Jan 2012" "Version 1.5.2" "HeimdalGSS-APIlibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_mechs_intro.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_mechs_intro.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_mechs_intro.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "gssapi_mechs_intro" 3 "30 Sep 2011" "Version 1.5.1" "HeimdalGSS-APIlibrary" \" -*- nroff -*- +.TH "gssapi_mechs_intro" 3 "11 Jan 2012" "Version 1.5.2" "HeimdalGSS-APIlibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_services_intro.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_services_intro.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/man/man3/gssapi_services_intro.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "gssapi_services_intro" 3 "30 Sep 2011" "Version 1.5.1" "HeimdalGSS-APIlibrary" \" -*- nroff -*- +.TH "gssapi_services_intro" 3 "11 Jan 2012" "Version 1.5.2" "HeimdalGSS-APIlibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/gssapi/man/man3/internalvsmechname.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/gssapi/man/man3/internalvsmechname.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/gssapi/man/man3/internalvsmechname.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "internalvsmechname" 3 "30 Sep 2011" "Version 1.5.1" "HeimdalGSS-APIlibrary" \" -*- nroff -*- +.TH "internalvsmechname" 3 "11 Jan 2012" "Version 1.5.2" "HeimdalGSS-APIlibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/example__evp__cipher_8c-example.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/example__evp__cipher_8c-example.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/example__evp__cipher_8c-example.html Sun Apr 8 08:19:17 2012 (r234027) @@ -168,6 +168,6 @@ main(int
    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/examples.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/examples.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/examples.html Sun Apr 8 08:19:17 2012 (r234027) @@ -24,6 +24,6 @@
    -Generated on Fri Sep 30 15:26:06 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/graph_legend.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/graph_legend.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/graph_legend.html Sun Apr 8 08:19:17 2012 (r234027) @@ -83,6 +83,6 @@ A yellow dashed arrow denotes a relation
    -Generated on Fri Sep 30 15:26:06 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__core.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__core.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__core.html Sun Apr 8 08:19:17 2012 (r234027) @@ -185,6 +185,6 @@ Add all algorithms to the crypto core, b


    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__des.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__des.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__des.html Sun Apr 8 08:19:17 2012 (r234027) @@ -905,6 +905,6 @@ Convert a string to a DES key. Use somet


    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__dh.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__dh.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__dh.html Sun Apr 8 08:19:17 2012 (r234027) @@ -576,6 +576,6 @@ Add a reference to the DH object. The ob


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__evp.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__evp.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__evp.html Sun Apr 8 08:19:17 2012 (r234027) @@ -2361,6 +2361,6 @@ The tripple DES cipher type (Micrsoft cr


    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__misc.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__misc.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__misc.html Sun Apr 8 08:19:17 2012 (r234027) @@ -101,6 +101,6 @@ As descriped in PKCS5, convert a passwor


    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rand.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rand.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rand.html Sun Apr 8 08:19:17 2012 (r234027) @@ -420,6 +420,6 @@ Write of random numbers to a file to sto


    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rsa.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rsa.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/group__hcrypto__rsa.html Sun Apr 8 08:19:17 2012 (r234027) @@ -273,6 +273,6 @@ Add an extra reference to the RSA object


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/index.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/index.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/index.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,7 +21,7 @@

    Heimdal crypto library

    -

    1.5.1

    +

    1.5.2

    Introduction

    Heimdal libhcrypto library is a implementation many crypto algorithms, among others: AES, SHA, DES, RSA, Camellia and many help function.

    hcrypto provies a OpenSSL compatible interface libcrypto interface and is licensed under a 3 clause BSD license (GPL compatible).

    @@ -42,6 +42,6 @@ History

    Eric Young implemented DES in the library libdes, that grew into libcrypto in the ssleay package. ssleay went into recession and then got picked up by the OpenSSL (htp://www.openssl.org/) project.

    libhcrypto is an independent implementation with no code decended from ssleay/openssl. Both includes some common imported code, for example the AES implementation.


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/modules.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/modules.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/modules.html Sun Apr 8 08:19:17 2012 (r234027) @@ -30,6 +30,6 @@
    -Generated on Fri Sep 30 15:26:05 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/page_des.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/page_des.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/page_des.html Sun Apr 8 08:19:17 2012 (r234027) @@ -40,6 +40,6 @@ There was no complete BSD licensed, fast The document that got me started for real was "Efficient Implementation of the Data Encryption Standard" by Dag Arne Osvik. I never got to the PC1 transformation was working, instead I used table-lookup was used for all key schedule setup. The document was very useful since it de-mystified other implementations for me.

    The core DES function (SBOX + P transformation) is from Richard Outerbridge public domain DES implementation. My sanity is saved thanks to his work. Thank you Richard.


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/page_dh.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/page_dh.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/page_dh.html Sun Apr 8 08:19:17 2012 (r234027) @@ -25,6 +25,6 @@ Include and example how to use DH_new() and friends here.

    See the library functions here: Diffie-Hellman functions


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/page_evp.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/page_evp.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/page_evp.html Sun Apr 8 08:19:17 2012 (r234027) @@ -25,6 +25,6 @@ EVP Cipher The use of EVP_CipherInit_ex() and EVP_Cipher() is pretty easy to understand forward, then EVP_CipherUpdate() and EVP_CipherFinal_ex() really needs an example to explain example_evp_cipher::c .
    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rand.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rand.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rand.html Sun Apr 8 08:19:17 2012 (r234027) @@ -23,6 +23,6 @@

    RAND - random number

    See the library functions here: RAND crypto functions

    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rsa.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rsa.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/html/page_rsa.html Sun Apr 8 08:19:17 2012 (r234027) @@ -26,6 +26,6 @@ Speed for RSA in seconds no key blinding name 1024 2048 4098 ================================= gmp: 0.73 6.60 44.80 tfm: 2.45 -- -- ltm: 3.79 20.74 105.41 (default in hcrypto) openssl: 4.04 11.90 82.59 cdsa: 15.89 102.89 721.40 imath: 40.62 -- --

    See the library functions here: RSA functions


    -Generated on Fri Sep 30 15:26:03 2011 for Heimdal crypto library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdal crypto library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_core.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_core.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_core.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hcrypto function controlling behavior" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "hcrypto function controlling behavior" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_des.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_des.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_des.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "DES crypto functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "DES crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_dh.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_dh.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_dh.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "Diffie-Hellman functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "Diffie-Hellman functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_evp.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_evp.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_evp.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "EVP generic crypto functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "EVP generic crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_misc.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_misc.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_misc.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hcrypto miscellaneous functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "hcrypto miscellaneous functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rand.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "RAND crypto functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "RAND crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rsa.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rsa.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/hcrypto_rsa.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "RSA functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "RSA functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_des.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_des.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_des.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "page_des" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "page_des" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_dh.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_dh.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_dh.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "page_dh" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "page_dh" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_evp.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_evp.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_evp.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "page_evp" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "page_evp" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rand.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rand.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rand.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "page_rand" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "page_rand" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rsa.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rsa.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hcrypto/man/man3/page_rsa.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "page_rsa" 3 "30 Sep 2011" "Version 1.5.1" "Heimdal crypto library" \" -*- nroff -*- +.TH "page_rsa" 3 "11 Jan 2012" "Version 1.5.2" "Heimdal crypto library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hdb/html/annotated.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/annotated.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/annotated.html Sun Apr 8 08:19:17 2012 (r234027) @@ -30,6 +30,6 @@
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/functions.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/functions.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/functions.html Sun Apr 8 08:19:17 2012 (r234027) @@ -80,6 +80,6 @@ Here is a list of all documented struct
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/functions_vars.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/functions_vars.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/functions_vars.html Sun Apr 8 08:19:17 2012 (r234027) @@ -80,6 +80,6 @@
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/graph_legend.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/graph_legend.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/graph_legend.html Sun Apr 8 08:19:17 2012 (r234027) @@ -82,6 +82,6 @@ A yellow dashed arrow denotes a relation
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/index.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/index.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/index.html Sun Apr 8 08:19:17 2012 (r234027) @@ -20,7 +20,7 @@

    Heimdal database backend library

    -

    1.5.1

    +

    1.5.2

    Introduction

    Heimdal libhdb library provides the backend support for Heimdal kdc and kadmind. Its here where plugins for diffrent database engines can be pluged in and extend support for here Heimdal get the principal and policy data from.

    Example of Heimdal backend are:


    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/struct_h_d_b.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/struct_h_d_b.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/struct_h_d_b.html Sun Apr 8 08:19:17 2012 (r234027) @@ -422,9 +422,9 @@ Check if s4u2self is allowed from this c


    The documentation for this struct was generated from the following file:
      -
    • /Users/lha/src/heimdal/heimdal-release/heimdal-1.5.1/lib/hdb/hdb.h
    +
  • /Users/lha/src/heimdal/heimdal-release/heimdal-1.5.2/lib/hdb/hdb.h
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/html/structhdb__entry__ex.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/html/structhdb__entry__ex.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/html/structhdb__entry__ex.html Sun Apr 8 08:19:17 2012 (r234027) @@ -31,9 +31,9 @@

    Detailed Description

    hdb_entry_ex is a wrapper structure around the hdb_entry structure that allows backends to keep a pointer to the backing store, ie in ->hdb_fetch_kvno(), so that we the kadmin/kpasswd backend gets around to ->hdb_store(), the backend doesn't need to lookup the entry again.
    The documentation for this struct was generated from the following file:
      -
    • /Users/lha/src/heimdal/heimdal-release/heimdal-1.5.1/lib/hdb/hdb.h
    +
  • /Users/lha/src/heimdal/heimdal-release/heimdal-1.5.2/lib/hdb/hdb.h
    -Generated on Fri Sep 30 15:26:07 2011 for Heimdalhdblibrary by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:38 2012 for Heimdalhdblibrary by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hdb/man/man3/HDB.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/man/man3/HDB.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/man/man3/HDB.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "HDB" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalhdblibrary" \" -*- nroff -*- +.TH "HDB" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalhdblibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hdb/man/man3/hdb_entry_ex.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hdb/man/man3/hdb_entry_ex.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hdb/man/man3/hdb_entry_ex.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hdb_entry_ex" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalhdblibrary" \" -*- nroff -*- +.TH "hdb_entry_ex" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalhdblibrary" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/html/graph_legend.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/graph_legend.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/graph_legend.html Sun Apr 8 08:19:17 2012 (r234027) @@ -83,6 +83,6 @@ A yellow dashed arrow denotes a relation
    -Generated on Fri Sep 30 15:26:14 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509.html Sun Apr 8 08:19:17 2012 (r234027) @@ -84,6 +84,6 @@ Creates a hx509 context that most functi


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__ca.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__ca.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__ca.html Sun Apr 8 08:19:17 2012 (r234027) @@ -1174,6 +1174,6 @@ Make of template units, use to build fla


    -Generated on Fri Sep 30 15:26:13 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cert.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cert.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cert.html Sun Apr 8 08:19:17 2012 (r234027) @@ -1420,6 +1420,6 @@ Verify that the certificate is allowed t


    -Generated on Fri Sep 30 15:26:11 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cms.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cms.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__cms.html Sun Apr 8 08:19:17 2012 (r234027) @@ -499,6 +499,6 @@ Wrap data and oid in a ContentInfo and e


    -Generated on Fri Sep 30 15:26:11 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__crypto.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__crypto.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__crypto.html Sun Apr 8 08:19:17 2012 (r234027) @@ -87,6 +87,6 @@ Verify a signature made using the privat


    -Generated on Fri Sep 30 15:26:11 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__env.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__env.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__env.html Sun Apr 8 08:19:17 2012 (r234027) @@ -306,6 +306,6 @@ Search the hx509_env for a length based


    -Generated on Fri Sep 30 15:26:14 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__error.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__error.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__error.html Sun Apr 8 08:19:17 2012 (r234027) @@ -303,6 +303,6 @@ Add an error message to the hx509 contex


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__keyset.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__keyset.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__keyset.html Sun Apr 8 08:19:17 2012 (r234027) @@ -776,6 +776,6 @@ Get one random certificate from the cert


    -Generated on Fri Sep 30 15:26:11 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__lock.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__lock.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__lock.html Sun Apr 8 08:19:17 2012 (r234027) @@ -24,6 +24,6 @@ See the Locking and unlocking certificates and encrypted data. for description and examples.
    -Generated on Fri Sep 30 15:26:13 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__misc.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__misc.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__misc.html Sun Apr 8 08:19:17 2012 (r234027) @@ -83,6 +83,6 @@ Free a data element allocated in the lib


    -Generated on Fri Sep 30 15:26:11 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__name.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__name.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__name.html Sun Apr 8 08:19:17 2012 (r234027) @@ -465,6 +465,6 @@ Convert a DER encoded name info a string


    -Generated on Fri Sep 30 15:26:12 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__peer.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__peer.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__peer.html Sun Apr 8 08:19:17 2012 (r234027) @@ -232,6 +232,6 @@ Set the algorithms that the peer support


    -Generated on Fri Sep 30 15:26:13 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__print.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__print.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__print.html Sun Apr 8 08:19:17 2012 (r234027) @@ -447,6 +447,6 @@ Set the printing functions for the valid


    -Generated on Fri Sep 30 15:26:14 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__query.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__query.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__query.html Sun Apr 8 08:19:17 2012 (r234027) @@ -24,6 +24,6 @@
    -Generated on Fri Sep 30 15:26:13 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__revoke.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__revoke.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__revoke.html Sun Apr 8 08:19:17 2012 (r234027) @@ -373,6 +373,6 @@ Check that a certificate is not expired


    -Generated on Fri Sep 30 15:26:12 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__verify.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__verify.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/group__hx509__verify.html Sun Apr 8 08:19:17 2012 (r234027) @@ -709,6 +709,6 @@ Set the clock time the the verification


    -Generated on Fri Sep 30 15:26:13 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/index.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/index.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/index.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,7 +21,7 @@

    Heimdal PKIX/X.509 library

    -

    1.5.1

    +

    1.5.2

    Introduction

    Heimdal libhx509 library is a implementation of the PKIX/X.509 and related protocols.

    PKIX/X.509 is ...

    @@ -30,6 +30,6 @@ Sections in this manual are:


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/modules.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/modules.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/modules.html Sun Apr 8 08:19:17 2012 (r234027) @@ -39,6 +39,6 @@
    -Generated on Fri Sep 30 15:26:14 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:41 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_ca.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_ca.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_ca.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,6 +21,6 @@

    Hx509 CA functions

    See the library functions here: hx509 CA functions

    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_cert.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_cert.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_cert.html Sun Apr 8 08:19:17 2012 (r234027) @@ -23,6 +23,6 @@ A hx509_cert object is usully found via the keyset interfaces (Certificate store operations), but its also possible to create a certificate directly from a parsed object with hx509_cert_init() and hx509_cert_init_data().

    See the library functions here: hx509 certificate functions


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_cms.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_cms.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_cms.html Sun Apr 8 08:19:17 2012 (r234027) @@ -25,6 +25,6 @@

    See the library functions here: hx509 CMS/pkcs7 functions


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_env.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_env.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_env.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,6 +21,6 @@
    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_error.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_error.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_error.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,6 +21,6 @@
    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_keyset.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_keyset.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_keyset.html Sun Apr 8 08:19:17 2012 (r234027) @@ -24,6 +24,6 @@

    See the library functions here: hx509 certificate store functions


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_lock.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_lock.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_lock.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,6 +21,6 @@
    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_name.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_name.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_name.html Sun Apr 8 08:19:17 2012 (r234027) @@ -27,6 +27,6 @@ Parse and string name into a hx509_name Name string are defined rfc2253, rfc1779 and X.501.

    See the library functions here: hx509 name functions


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_peer.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_peer.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_peer.html Sun Apr 8 08:19:17 2012 (r234027) @@ -22,6 +22,6 @@

    Hx509 crypto selecting functions

    Peer info structures are used togeter with hx509_crypto_select() to select the best avaible crypto algorithm to use.

    See the library functions here: hx509 certificate selecting functions


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_print.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_print.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_print.html Sun Apr 8 08:19:17 2012 (r234027) @@ -21,6 +21,6 @@

    Hx509 printing functions

    See the library functions here: hx509 printing functions

    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/page_revoke.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/page_revoke.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/page_revoke.html Sun Apr 8 08:19:17 2012 (r234027) @@ -23,6 +23,6 @@ CRL is a list of certifiates that have expired.

    OCSP is an online checking method where the requestor sends a list of certificates to the OCSP server to return a signed reply if they are valid or not. Some services sends a OCSP reply as part of the hand-shake to make the revoktion decision simpler/faster for the client.


    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/html/pages.html ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/html/pages.html Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/html/pages.html Sun Apr 8 08:19:17 2012 (r234027) @@ -45,6 +45,6 @@
    -Generated on Fri Sep 30 15:26:09 2011 for Heimdalx509library by doxygen 1.5.6
    +Generated on Wed Jan 11 14:07:40 2012 for Heimdalx509library by doxygen 1.5.6 Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 library" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 library" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_ca.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_ca.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_ca.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 CA functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 CA functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cert.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cert.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cert.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 certificate functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 certificate functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cms.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cms.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_cms.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 CMS/pkcs7 functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 CMS/pkcs7 functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_crypto.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_crypto.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_crypto.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 crypto functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 crypto functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_env.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_env.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_env.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 enviroment functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 enviroment functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_error.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_error.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_error.3 Sun Apr 8 08:19:17 2012 (r234027) @@ -1,4 +1,4 @@ -.TH "hx509 error functions" 3 "30 Sep 2011" "Version 1.5.1" "Heimdalx509library" \" -*- nroff -*- +.TH "hx509 error functions" 3 "11 Jan 2012" "Version 1.5.2" "Heimdalx509library" \" -*- nroff -*- .ad l .nh .SH NAME Modified: head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_keyset.3 ============================================================================== --- head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_keyset.3 Sun Apr 8 06:20:21 2012 (r234026) +++ head/crypto/heimdal/doc/doxyout/hx509/man/man3/hx509_keyset.3 Sun Apr 8 08:19:17 2012 (r234027) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 11:01:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07B9106564A; Sun, 8 Apr 2012 11:01:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF588FC08; Sun, 8 Apr 2012 11:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38B1n9i008907; Sun, 8 Apr 2012 11:01:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38B1nhN008905; Sun, 8 Apr 2012 11:01:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201204081101.q38B1nhN008905@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Apr 2012 11:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234032 - head/sys/security/mac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 11:01:49 -0000 Author: rwatson Date: Sun Apr 8 11:01:49 2012 New Revision: 234032 URL: http://svn.freebsd.org/changeset/base/234032 Log: When allocation of labels on files is implicitly disabled due to MAC policy configuration, avoid leaking resources following failed calls to get and set MAC labels by file descriptor. Reported by: Mateusz Guzik + clang scan-build MFC after: 3 days Modified: head/sys/security/mac/mac_syscalls.c Modified: head/sys/security/mac/mac_syscalls.c ============================================================================== --- head/sys/security/mac/mac_syscalls.c Sun Apr 8 10:15:56 2012 (r234031) +++ head/sys/security/mac/mac_syscalls.c Sun Apr 8 11:01:49 2012 (r234032) @@ -256,8 +256,10 @@ sys___mac_get_fd(struct thread *td, stru switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } vp = fp->f_vnode; intlabel = mac_vnode_label_alloc(); vfslocked = VFS_LOCK_GIANT(vp->v_mount); @@ -271,8 +273,10 @@ sys___mac_get_fd(struct thread *td, stru break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } pipe = fp->f_data; intlabel = mac_pipe_label_alloc(); PIPE_LOCK(pipe); @@ -284,8 +288,10 @@ sys___mac_get_fd(struct thread *td, stru break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } so = fp->f_data; intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); @@ -299,10 +305,10 @@ sys___mac_get_fd(struct thread *td, stru default: error = EINVAL; } - fdrop(fp, td); if (error == 0) error = copyout(buffer, mac.m_string, strlen(buffer)+1); - +out_fdrop: + fdrop(fp, td); out: free(buffer, M_MACTEMP); free(elements, M_MACTEMP); @@ -450,8 +456,10 @@ sys___mac_set_fd(struct thread *td, stru switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_vnode_label_alloc(); error = mac_vnode_internalize_label(intlabel, buffer); if (error) { @@ -475,8 +483,10 @@ sys___mac_set_fd(struct thread *td, stru break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_pipe_label_alloc(); error = mac_pipe_internalize_label(intlabel, buffer); if (error == 0) { @@ -490,8 +500,10 @@ sys___mac_set_fd(struct thread *td, stru break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_socket_label_alloc(M_WAITOK); error = mac_socket_internalize_label(intlabel, buffer); if (error == 0) { @@ -505,6 +517,7 @@ sys___mac_set_fd(struct thread *td, stru default: error = EINVAL; } +out_fdrop: fdrop(fp, td); out: free(buffer, M_MACTEMP); From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 11:05:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA753106566B; Sun, 8 Apr 2012 11:05:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5A238FC15; Sun, 8 Apr 2012 11:05:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38B5MLx009112; Sun, 8 Apr 2012 11:05:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38B5MGf009110; Sun, 8 Apr 2012 11:05:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201204081105.q38B5MGf009110@svn.freebsd.org> From: Robert Watson Date: Sun, 8 Apr 2012 11:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234034 - head/contrib/openbsm/libauditd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 11:05:23 -0000 Author: rwatson Date: Sun Apr 8 11:05:22 2012 New Revision: 234034 URL: http://svn.freebsd.org/changeset/base/234034 Log: Merge a local fix to OpenBSM's libauditd to avoid a directory descriptor leak when iterating over possible audit trail directories. This fix will be merged upstream in an identical form, but hasn't yet appeared in an OpenBSM release. Submitted by: guido Obtained from: TrustedBSD Project MFC after: 3 days Modified: head/contrib/openbsm/libauditd/auditd_lib.c Modified: head/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- head/contrib/openbsm/libauditd/auditd_lib.c Sun Apr 8 11:04:08 2012 (r234033) +++ head/contrib/openbsm/libauditd/auditd_lib.c Sun Apr 8 11:05:22 2012 (r234034) @@ -520,6 +520,7 @@ auditd_expire_trails(int (*warn_expired) } } + closedir(dirp); } oldest_time = current_time - expire_age; From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 13:44:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8EC121065680; Sun, 8 Apr 2012 13:44:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 799FE8FC0A; Sun, 8 Apr 2012 13:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38DiuHQ014198; Sun, 8 Apr 2012 13:44:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38DiuHx014196; Sun, 8 Apr 2012 13:44:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201204081344.q38DiuHx014196@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 8 Apr 2012 13:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234036 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 13:44:56 -0000 Author: trasz Date: Sun Apr 8 13:44:55 2012 New Revision: 234036 URL: http://svn.freebsd.org/changeset/base/234036 Log: Fix panic in ffs_reload(), which may happen when read-only filesystem gets resized and then reloaded. Reviewed by: kib, mckusick (earlier version) Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Apr 8 11:09:08 2012 (r234035) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Apr 8 13:44:55 2012 (r234036) @@ -675,8 +675,14 @@ ffs_reload(struct mount *mp, struct thre /* * Step 3: re-read summary information from disk. */ - blks = howmany(fs->fs_cssize, fs->fs_fsize); - space = fs->fs_csp; + size = fs->fs_cssize; + blks = howmany(size, fs->fs_fsize); + if (fs->fs_contigsumsize > 0) + size += fs->fs_ncg * sizeof(int32_t); + size += fs->fs_ncg * sizeof(u_int8_t); + free(fs->fs_csp, M_UFSMNT); + space = malloc((u_long)size, M_UFSMNT, M_WAITOK); + fs->fs_csp = space; for (i = 0; i < blks; i += fs->fs_frag) { size = fs->fs_bsize; if (i + fs->fs_frag > blks) From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 17:00:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB4FA106566C; Sun, 8 Apr 2012 17:00:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6F718FC14; Sun, 8 Apr 2012 17:00:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38H0kVg020587; Sun, 8 Apr 2012 17:00:46 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38H0kjj020585; Sun, 8 Apr 2012 17:00:46 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201204081700.q38H0kjj020585@svn.freebsd.org> From: Alan Cox Date: Sun, 8 Apr 2012 17:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234038 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 17:00:46 -0000 Author: alc Date: Sun Apr 8 17:00:46 2012 New Revision: 234038 URL: http://svn.freebsd.org/changeset/base/234038 Log: If a page belonging a reservation is cached, then mark the reservation so that it will be freed to the cache pool rather than the default pool. Otherwise, the cached pages within the reservation may be recycled sooner than necessary. Reported by: Andrey Zonov Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sun Apr 8 16:26:26 2012 (r234037) +++ head/sys/vm/vm_reserv.c Sun Apr 8 17:00:46 2012 (r234038) @@ -652,11 +652,13 @@ vm_reserv_free_page(vm_page_t m) mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); rv = vm_reserv_from_page(m); - if (rv->object != NULL) { - vm_reserv_depopulate(rv); - return (TRUE); - } - return (FALSE); + if (rv->object == NULL) + return (FALSE); + if ((m->flags & PG_CACHED) != 0 && m->pool != VM_FREEPOOL_CACHE) + vm_phys_set_pool(VM_FREEPOOL_CACHE, rv->pages, + VM_LEVEL_0_ORDER); + vm_reserv_depopulate(rv); + return (TRUE); } /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 17:41:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CEA106564A; Sun, 8 Apr 2012 17:41:13 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id E4D168FC0A; Sun, 8 Apr 2012 17:41:12 +0000 (UTC) Received: by wgbds12 with SMTP id ds12so3595769wgb.31 for ; Sun, 08 Apr 2012 10:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=wLcEMJw0VxY9Xcd2HScITA2cZXBxFeDoLb7lvNLYyko=; b=hd2bz91NX4VwpGqpvK5nO3Q0diEDpnHZ5Nlrl/EjJxCVMbSlrBeNacXKKJPBXFU376 lcjNYIbNCcgXcVgfJP6nEx1uvpwqhiESwozFI8mDKHBrkl99Pz49qMMNM7Y1Lgge8JB7 oKMaDnIvM/BbCJ+w7aKQnZX3a51/DF0iyFHrxAIXdEl/zZQJi0xqtrgj+7Zvyv0h61oZ ygFwmGKzl1lFfZEoDCZmelFE6MswaGudw/LeVweU9ehiuJGnUoZvBgA9GF5FeVpEPH3e NHnUtXxVRBDPXBQteFHqUZ3jYSzVy/fvlQLa8FGOuPL8+MJl3Mb4tj2Np7GnpaaFWYZD FqnQ== MIME-Version: 1.0 Received: by 10.180.96.228 with SMTP id dv4mr10409278wib.14.1333906871897; Sun, 08 Apr 2012 10:41:11 -0700 (PDT) Sender: tomelite82@gmail.com Received: by 10.223.70.129 with HTTP; Sun, 8 Apr 2012 10:41:11 -0700 (PDT) In-Reply-To: <201204021044.q32AiPng094511@svn.freebsd.org> References: <201204021044.q32AiPng094511@svn.freebsd.org> Date: Sun, 8 Apr 2012 10:41:11 -0700 X-Google-Sender-Auth: O7ircPowpX5Q7ajkXVeOZO4cLhQ Message-ID: From: Qing Li To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233773 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 17:41:14 -0000 This is not the right way to support RFC3021. The code you removed is used for checking against attempt at adding duplicate entry. Both the message and the code apply in that context. I tried to state clearly and concisely what r201282 was intended in solving and was verified by actual users who ran into the described problems. If we actually need to support RFC 3021, then better do it properly. --Qing On Mon, Apr 2, 2012 at 3:44 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Apr =A02 10:44:25 2012 > New Revision: 233773 > URL: http://svn.freebsd.org/changeset/base/233773 > > Log: > =A0Historically arp(8) did a route lookup for the entry it is > =A0about to add, and failed if it exist and had invalid data > =A0link type. > > =A0Later on, in r201282, this check morphed to other code, but > =A0message "proxy entry exists for non 802 device" still left, > =A0and now it is printed in a case if route prefix found is > =A0equal to current address being added. In other words, when > =A0we are trying to add ARP entry for a network address. The > =A0message is absolutely unrelated and disappointing in this > =A0case. > > =A0I don't see anything bad with setting ARP entries for > =A0network addresses. While useless in usual network, > =A0in a /31 RFC3021 it may be necessary. This, remove this code. > > Modified: > =A0head/usr.sbin/arp/arp.c > > Modified: head/usr.sbin/arp/arp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/arp/arp.c =A0 =A0 Mon Apr =A02 10:24:50 2012 =A0 =A0 = =A0 =A0(r233772) > +++ head/usr.sbin/arp/arp.c =A0 =A0 Mon Apr =A02 10:44:25 2012 =A0 =A0 = =A0 =A0(r233773) > @@ -387,10 +387,6 @@ set(int argc, char **argv) > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0addr =3D (struct sockaddr_inarp *)(rtm + 1); > =A0 =A0 =A0 =A0sdl =3D (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)add= r); > - =A0 =A0 =A0 if (addr->sin_addr.s_addr =3D=3D dst->sin_addr.s_addr) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 printf("set: proxy entry exists for non 802= device\n"); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (1); > - =A0 =A0 =A0 } > > =A0 =A0 =A0 =A0if ((sdl->sdl_family !=3D AF_LINK) || > =A0 =A0 =A0 =A0 =A0 =A0(rtm->rtm_flags & RTF_GATEWAY) || From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 18:25:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99231065677; Sun, 8 Apr 2012 18:25:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDEE8FC17; Sun, 8 Apr 2012 18:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38IPDJe023163; Sun, 8 Apr 2012 18:25:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38IPDqT023159; Sun, 8 Apr 2012 18:25:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201204081825.q38IPDqT023159@svn.freebsd.org> From: Alan Cox Date: Sun, 8 Apr 2012 18:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234039 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 18:25:13 -0000 Author: alc Date: Sun Apr 8 18:25:12 2012 New Revision: 234039 URL: http://svn.freebsd.org/changeset/base/234039 Log: Fix mincore(2) so that it reports PG_CACHED pages as resident. MFC after: 2 weeks Modified: head/sys/vm/vm_mmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Apr 8 17:00:46 2012 (r234038) +++ head/sys/vm/vm_mmap.c Sun Apr 8 18:25:12 2012 (r234039) @@ -888,6 +888,9 @@ RestartScan: pindex = OFF_TO_IDX(current->offset + (addr - current->start)); m = vm_page_lookup(object, pindex); + if (m == NULL && + vm_page_is_cached(object, pindex)) + mincoreinfo = MINCORE_INCORE; if (m != NULL && m->valid == 0) m = NULL; if (m != NULL) Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Apr 8 17:00:46 2012 (r234038) +++ head/sys/vm/vm_page.c Sun Apr 8 18:25:12 2012 (r234039) @@ -1285,6 +1285,33 @@ vm_page_cache_transfer(vm_object_t orig_ } /* + * Returns TRUE if a cached page is associated with the given object and + * offset, and FALSE otherwise. + * + * The object must be locked. + */ +boolean_t +vm_page_is_cached(vm_object_t object, vm_pindex_t pindex) +{ + vm_page_t m; + + /* + * Insertion into an object's collection of cached pages requires the + * object to be locked. Therefore, if the object is locked and the + * object's collection is empty, there is no need to acquire the free + * page queues lock in order to prove that the specified page doesn't + * exist. + */ + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + if (object->cache == NULL) + return (FALSE); + mtx_lock(&vm_page_queue_free_mtx); + m = vm_page_cache_lookup(object, pindex); + mtx_unlock(&vm_page_queue_free_mtx); + return (m != NULL); +} + +/* * vm_page_alloc: * * Allocate and return a page that is associated with the specified Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Apr 8 17:00:46 2012 (r234038) +++ head/sys/vm/vm_page.h Sun Apr 8 18:25:12 2012 (r234039) @@ -392,6 +392,7 @@ void vm_page_deactivate (vm_page_t); vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t); vm_page_t vm_page_getfake(vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); +boolean_t vm_page_is_cached(vm_object_t object, vm_pindex_t pindex); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 19:58:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42FC5106564A; Sun, 8 Apr 2012 19:58:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CC938FC0C; Sun, 8 Apr 2012 19:58:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38Jwd7Y026019; Sun, 8 Apr 2012 19:58:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38JwcZc026017; Sun, 8 Apr 2012 19:58:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201204081958.q38JwcZc026017@svn.freebsd.org> From: Andriy Gapon Date: Sun, 8 Apr 2012 19:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234040 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 19:58:39 -0000 Author: avg Date: Sun Apr 8 19:58:38 2012 New Revision: 234040 URL: http://svn.freebsd.org/changeset/base/234040 Log: intpm: reflect the fact that SB800 and later AMD chipsets are not supported They do not have compatible configuration registers in PCI configuration space. Instead their configuration resides in AMD "PM I/O" space (accessed via a pair of I/O space registers). MFC after: 5 days Modified: head/sys/pci/intpm.c Modified: head/sys/pci/intpm.c ============================================================================== --- head/sys/pci/intpm.c Sun Apr 8 18:25:12 2012 (r234039) +++ head/sys/pci/intpm.c Sun Apr 8 19:58:38 2012 (r234040) @@ -99,6 +99,9 @@ intsmb_probe(device_t dev) device_set_desc(dev, "Intel PIIX4 SMBUS Interface"); break; case 0x43851002: + /* SB800 and newer can not be configured in a compatible way. */ + if (pci_get_revid(dev) >= 0x40) + return (ENXIO); device_set_desc(dev, "AMD SB600/700/710/750 SMBus Controller"); /* XXX Maybe force polling right here? */ break; From owner-svn-src-head@FreeBSD.ORG Sun Apr 8 20:48:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA922106566B; Sun, 8 Apr 2012 20:48:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5F378FC0C; Sun, 8 Apr 2012 20:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q38KmdnA027713; Sun, 8 Apr 2012 20:48:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q38Kmdnr027711; Sun, 8 Apr 2012 20:48:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201204082048.q38Kmdnr027711@svn.freebsd.org> From: Andriy Gapon Date: Sun, 8 Apr 2012 20:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234043 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2012 20:48:39 -0000 Author: avg Date: Sun Apr 8 20:48:39 2012 New Revision: 234043 URL: http://svn.freebsd.org/changeset/base/234043 Log: intpm: return only SMB bus error codes from SMB methods PR: kern/25733 MFC after: 5 days Modified: head/sys/pci/intpm.c Modified: head/sys/pci/intpm.c ============================================================================== --- head/sys/pci/intpm.c Sun Apr 8 20:44:57 2012 (r234042) +++ head/sys/pci/intpm.c Sun Apr 8 20:48:39 2012 (r234043) @@ -272,7 +272,7 @@ intsmb_callback(device_t dev, int index, case SMB_RELEASE_BUS: break; default: - error = EINVAL; + error = SMB_EINVAL; } return (error); @@ -519,7 +519,7 @@ intsmb_quick(device_t dev, u_char slave, data |= LSB; break; default: - return (EINVAL); + return (SMB_EINVAL); } INTSMB_LOCK(sc); @@ -774,7 +774,7 @@ intsmb_bread(device_t dev, u_char slave, } *count = nread; } else - error = EIO; + error = SMB_EBUSERR; } INTSMB_UNLOCK(sc); return (error); From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 00:26:19 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 668B8106564A; Mon, 9 Apr 2012 00:26:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id DD8E38FC0C; Mon, 9 Apr 2012 00:26:18 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q390QApi006737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Apr 2012 10:26:11 +1000 Date: Mon, 9 Apr 2012 10:26:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <20120407165729.GA2737@zim.MIT.EDU> Message-ID: <20120409084336.A1308@besplex.bde.org> References: <201202282217.q1SMHrIk094780@svn.freebsd.org> <201203012347.32984.tijl@freebsd.org> <20120302132403.P929@besplex.bde.org> <201203022231.43186.tijl@freebsd.org> <20120407165729.GA2737@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.ORG, Tijl Coosemans , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r232275 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 00:26:19 -0000 On Sat, 7 Apr 2012, David Schultz wrote: > On Fri, Mar 02, 2012, Tijl Coosemans wrote: Hmm, old news. I think I already applied, but now notice some more details. >> Thanks, that was quite informative. C11 does say something about the >> FP env and signals now though: >> >> ``When the processing of the abstract machine is interrupted by receipt >> of a signal, the values of objects that are neither lock-free atomic >> objects nor of type volatile sig_atomic_t are unspecified, as is the >> state of the floating-point environment. The value of any object >> modified by the handler that is neither a lock-free atomic object nor >> of type volatile sig_atomic_t becomes indeterminate when the handler >> exits, as does the state of the floating-point environment if it is >> modified by the handler and not restored to its original state.'' This apparently allows signal handlers to be called with the FP env is in an undefined state (as in FreeBSD-4). But this is a large change relative to C99, since C99 says nothing about the floating point state for signal handlers, and its abstract machine requires FP expressions like "auto double four = 2.0 + 2.0;" to work. Does "unspecified" include "undefined", or does the requirement for the abstract machine to not give undefined behaviour have precedence over the allowance for the FP env to be anything? >> This means a signal handler must not rely on the state of the FP env. >> It may install its own FP env if needed (e.g. FE_DFL_ENV), but then it >> must restore the original before returning. This allows for the >> rounding mode to be silently modified for integer conversions for >> instance. >> >> If longjmp is not supposed to change the FP env then, when called from >> a signal handler, either the signal handler must install a proper FP >> env before calling longjmp or a proper FP env must be installed after >> the target setjmp call. Otherwise the FP env is unspecified. > > There are two reasonable ways to handle the floating point control > word. FreeBSD treats it as a register, resetting it on signal > handler entry and restoring it on longjmp or signal handler > return. Virtually every other OS (e.g., Linux, NetBSD, Solaris) > treats it as global state, leaving it up to the signal handler to > preserve it as needed. I checked what Linux-2.6.10 actually does. It does nothing as drastic as passing the interrupted FP environment to signal handlers. It just provides a clean FP env for signal handlers, like FreeBSD-5+ signal handlers do, except more cleanly for FP SIGFPE on x86: FreeBSD-[1-4] SIGFPE handling: save exception flags in memory clear exception flags in i387 call handler with this unclean state FreeBSD-[5-10] SIGFPE handling: convert exception flags to a signal code. Lose details in translation. Forget to merge the SSE flags when doing this. So the signal code cannot be trusted (AFAIR, it also doesn't distinguish between an i387 and an SSE exception. Better yet, npxtrap() doesn't distinguish, so it blindly translates for i387 when the exception was for SSE). clear exception flags in i387. Do this even if the exception was for SSE. Forget to do anything with the SSE flags. call handler with a different, completely clean state Linux-2.6.10 SIGFPE handling: (not sure if it has a signal code) don't clear exception flags in i387 call handler with a different, completely clean state The result is that if signal handler just returns, then: - under FreeBSD, iff the SIGFPE was for the i387, then the fault doesn't repeat - under Linux and under FreeBSD iff the SIGFPE was for SSE, then the fault does repeat - under FreeBSD, for both cases the i387 exception flags are broken (lost), but the SSE exception flags work (are preserved). Of course, returning from a SIGFPE handler gives undefined behaviour. This (not just different behaviour) the causes the following problems: - if the signal handler just returns, nothing good happens for the SIGFPE case (except for integer SIGFPE) - if the signal handler wants to fix up the FP env before returning, then it has very large portability problems even for fixing the exception flags in the above 3 classes of behaviour. But a fixup is usually essential if the handler is for FP SIGFPE. - if the signal handler longjmp()s, then it gets the following behaviour: - under FreeBSD, it gets the control word restored to that at the time of the setjmp() (modulo some bugs in some versions for SSE); similarly for the exception flags except the bugs are now features (it's best not to touch the exception flags) - under Linux-2.6.10, it gets a clean control and status word from the signal handler's FP env (unless the signal handler has uncleaned them). > Both approaches have their merits. FreeBSD's approach provides > better semantics. Library functions, round-to-integer on most > CPUs, and other things may temporarily change the rounding mode. > Most programmers don't think about that, but on Linux, if an async > signal were delivered at the wrong time and did a longjmp, the > rounding mode would be in an unexpected state. Most programmers It's state will be clean, i.e., FE_TONEAREST. This is OK for fixing up temporary changes to it, but bad if it was set to another mode using fesetround(). The setting may have been either before or after the setjmp(). I think C99 wants it to be the setting of the most recent fesetround(), but FreeBSD restores the setting to the most recent one before the setjmp(). > don't think about that; even a program that never changes the > rounding mode explicitly could wind up in round-to-zero mode after > jumping out of a signal handler. That would only happen in Linux after an explicit fesetround() to FE_TOWARDZERO in the signal handler. > The main advantage of the alternative approach is that it avoids > the overhead of saving and restoring the floating point control > word. Many programs don't even use floating point, and the > efficiency is important for programs that use longjmp frequently, > e.g., to implement exceptions. > > Either way, note the importance of being consistent: If the FP env > gets clobbered automatically on entry to a signal handler, then > longjmp must restore what the application had before. Personally, > I'm not opposed to changing both signal handlers and longjmp to > match what the rest of the world does, but this isn't just about > the mxcsr, as suggested previously. The rest of the world is already perfectly inconsistent, since it clobbers the env for signal handlers, and I don't see it changing now that C11 encourages the reverse. I think the overhead is unimportant. fnstcw in setjmp() takes 4 cycles (latency) on AthlonXP. fldcw in longjmp() takes 11. Hopefully this is in parallel so it takes less than 1 cycle each (throughput). (But I never got anyway trying to hide the latency of fxsave/fxrstor.) Some other arches have hundreds if not thousands of general registers to save where i386 has only 11, so a few more cycles for FP would be even more in the noise. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 01:20:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9B3191065673; Mon, 9 Apr 2012 01:20:51 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85BDD8FC08; Mon, 9 Apr 2012 01:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q391Kpbx036395; Mon, 9 Apr 2012 01:20:51 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q391KpF7036393; Mon, 9 Apr 2012 01:20:51 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201204090120.q391KpF7036393@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 9 Apr 2012 01:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234047 - head/sbin/mdconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 01:20:51 -0000 Author: bjk (doc committer) Date: Mon Apr 9 01:20:50 2012 New Revision: 234047 URL: http://svn.freebsd.org/changeset/base/234047 Log: Fix a couple of style issues. Tweak grammar and markup while here. Approved by: hrs (mentor) Modified: head/sbin/mdconfig/mdconfig.8 Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Sun Apr 8 21:29:48 2012 (r234046) +++ head/sbin/mdconfig/mdconfig.8 Mon Apr 9 01:20:50 2012 (r234047) @@ -41,7 +41,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2008 +.Dd March 21, 2012 .Dt MDCONFIG 8 .Os .Sh NAME @@ -87,7 +87,7 @@ parameters specified and attach it to th Detach a memory disk from the system and release all resources. .It Fl t Ar type Select the type of the memory disk. -.Bl -tag -width "preload" +.Bl -tag -width "malloc" .It Cm malloc Storage for this type of memory disk is allocated with .Xr malloc 9 . @@ -104,31 +104,35 @@ becomes the backing store for this memor .It Cm swap Storage for this type of memory disk is allocated from buffer memory. -Pages get pushed out to the swap when the system is under memory +Pages get pushed out to swap when the system is under memory pressure, otherwise they stay in the operating memory. Using .Cm swap -backing is generally preferable over +backing is generally preferred instead of using .Cm malloc backing. .El .It Fl f Ar file -Filename to use for the vnode type memory disk. Options +Filename to use for the vnode type memory disk. +The .Fl a and .Fl t Ar vnode -are implied if not specified. +options are implied if not specified. .It Fl l List configured devices. If given with .Fl u , display details about that particular device. -If +If the .Fl v -option specified, show all details. +option is specified, show all details. .It Fl n -When printing md device names, print only the unit number without the -md prefix. +When printing +.Xr md 4 +device names, print only the unit number without the +.Xr md 4 +prefix. .It Fl s Ar size Size of the memory disk. .Ar Size @@ -137,11 +141,12 @@ is the number of 512 byte sectors unless or .Cm t which -denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. Options +denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. +The .Fl a and .Fl t Ar swap -are implied if not specified. +options are implied if not specified. .It Fl S Ar sectorsize Sectorsize to use for malloc backed device. .It Fl x Ar sectors/track @@ -175,12 +180,12 @@ Allocate and reserve all needed storage .It Oo Cm no Oc Ns Cm cluster Enable clustering on this disk. .It Oo Cm no Oc Ns Cm compress -Enable/Disable compression features to reduce memory usage. +Enable/disable compression features to reduce memory usage. .It Oo Cm no Oc Ns Cm force -Disable/Enable extra sanity checks to prevent the user from doing something +Disable/enable extra sanity checks to prevent the user from doing something that might adversely affect the system. .It Oo Cm no Oc Ns Cm readonly -Enable/Disable readonly mode. +Enable/disable readonly mode. .El .It Fl u Ar unit Request a specific unit number for the @@ -197,15 +202,15 @@ is provided for convenience as an abbrev .Fl t Ar vnode .Fl f Ar file . .Sh EXAMPLES -To create a 4 megabyte +Create a 4 megabyte .Xr malloc 9 backed memory disk. -The name of the allocated unit will be output on stdout like +The name of the allocated unit will be printed on stdout, such as .Dq Li md3 : .Pp .Dl mdconfig -a -t malloc -s 4m .Pp -To create a disk named +Create a disk named .Pa /dev/md4 with .Pa /tmp/boot.flp @@ -213,12 +218,12 @@ as backing storage: .Pp .Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 .Pp -To detach and free all resources used by +Detach and free all resources used by .Pa /dev/md4 : .Pp .Dl mdconfig -d -u 4 .Pp -To create a 128MByte swap backed disk, initialize an +Create a 128MByte swap backed disk, initialize an .Xr ffs 7 file system on it, and mount it on .Pa /tmp : @@ -229,7 +234,7 @@ mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -To create a 5MB file-backed disk +Create a 5MB file-backed disk .Ns ( Fl a and .Fl t Ar vnode @@ -242,7 +247,7 @@ newfs md0c mount /dev/md0c /mnt .Ed .Pp -To create an +Create an .Xr md 4 device out of an ISO 9660 CD image file .Ns ( Fl a From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 01:37:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1D960106566C for ; Mon, 9 Apr 2012 01:37:07 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7F48FC08 for ; Mon, 9 Apr 2012 01:37:06 +0000 (UTC) Received: by wgbds12 with SMTP id ds12so3802750wgb.31 for ; Sun, 08 Apr 2012 18:37:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=Hnp3kBBlhfBfUNWX6QjauueMiGYAxaMOAzIs2YVCTL8=; b=AAEDVUH96nc9HWxW2FCxYGdxfgU3EbhT1aiLJRTQ7KgtrHIid8igIbalUkxPehMfsD 9H8amg1QPJW9lMlnq6EImSbJs6vnWAla1t1wkolV6YM6JuzlruVTDfxb9m8CZhT4PO5p d4RE6eOyOAMAKOATSUBdY2/r4ABYXT/anPNfYH/F2+tDMGr5J5uqhVNhPNaLhe0nwhrV z7F2KD3EuMgJ2LZf6ofm+Pz8M1LnEfAGQy034dw9XuzdbWPEu2mSNoXfoQZL9GKzJWLZ DixZ8vza8u4vwfBOlFuVyQo8O3BiQsm1HoTuD9EYi7BZ/RAz9xcxt8G9gHaqFTHnbOLT HrnA== Received: by 10.180.97.4 with SMTP id dw4mr12259560wib.18.1333935425813; Sun, 08 Apr 2012 18:37:05 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.180.86.37 with HTTP; Sun, 8 Apr 2012 18:36:45 -0700 (PDT) In-Reply-To: <20120408164521.55aecdd1@fubar.geek.nz> References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> From: Juli Mallett Date: Sun, 8 Apr 2012 18:36:45 -0700 X-Google-Sender-Auth: 0dIQqujAo5z_lSAIwXfikYL5m3g Message-ID: To: Andrew Turner Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQm34gNPqWCUVHBUcEkASmlVyzih0x0A7+85wAwuuK8lRfF0p1cUzuEPVaQWMMtMwoYHFPmj Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 01:37:07 -0000 On Sat, Apr 7, 2012 at 21:45, Andrew Turner wrote: > On Sun, 8 Apr 2012 04:36:27 +0000 (UTC) > Andrew Turner wrote: > >> Author: andrew >> Date: Sun Apr =C2=A08 04:36:27 2012 >> New Revision: 234014 >> URL: http://svn.freebsd.org/changeset/base/234014 >> >> Log: >> =C2=A0 Unlike other functions __aeabi_read_tp function must preserve >> r1-r3. The currently generated code clobbers r3. Fix this by loading >> ARM_TP_ADDRESS using inline assembly. >> >> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0imp (mentor) > > This fixes thread local storage on ARM in cases when the compiler loads > the offset of the variable in r3 before calling __aeabi_read_tp as has > been observed when the variable is in a shared library. I don't believe this is safe unless you specify __attribute__ ((__naked__)) in the declaration =E2=80=94 currently the compiler is free t= o clobber registers that the calling convention/ABI allows it to clobber. I don't see the benefit of implementing this in C over using an assembly file, that said, although GCC does have this attribute precisely to allow one to write assembly in a C source file without having to worry about unexpected behavior. How do you know GCC won't allocate r2 to be used as a temporary in between the assembly and the return? I tried to raise this concern on IRC previously, but hopefully it's clearer= now. Thanks, Juli. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 04:16:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 016B71065673; Mon, 9 Apr 2012 04:16:17 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mailfilter44.ihug.co.nz (mailfilter44.ihug.co.nz [203.109.136.44]) by mx1.freebsd.org (Postfix) with ESMTP id B70E88FC08; Mon, 9 Apr 2012 04:16:15 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=DE6nE7g822sA:10 a=f/SxzVRvWQdBqo0nlH1VRA==:17 a=6I5d2MoRAAAA:8 a=Gjt9h_guEhBIAy_4Co8A:9 a=QEXdDO2ut3YA:10 a=SV7veod9ZcQA:10 a=VAGSD8EX3UrfVcmK:21 a=uMMGHQrZwPfZDydR:21 a=Z1xzJwc4NuAIBxNH110A:9 a=-xCp-FiVW73MmOn47wkA:7 a=KTr_PvXjTkxT82MG:21 a=olYByBxJUJGmHZ1l:21 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAA1hgk/Ldqol/2dsb2JhbABEhWazRIEIggkBAQQBIzMjBQsIAQIOBgQqAgI5HgYTiAkEDKcmkgeLMYQRgRgEjmyGfwGQNoJ8gT8BFg X-IronPort-AV: E=Sophos;i="4.75,392,1330858800"; d="scan'208";a="133786825" Received: from 203-118-170-37.adsl.ihug.co.nz (HELO localhost) ([203.118.170.37]) by cust.filter6.content.vf.net.nz with SMTP; 09 Apr 2012 16:15:06 +1200 Date: Mon, 9 Apr 2012 16:14:53 +1200 From: Andrew Turner To: Juli Mallett Message-ID: <20120409161453.29d1f3de@fubar.geek.nz> In-Reply-To: References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/MUAtSxdUM4O2DLeLY2lu62S" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 04:16:17 -0000 --MP_/MUAtSxdUM4O2DLeLY2lu62S Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sun, 8 Apr 2012 18:36:45 -0700 Juli Mallett wrote: > On Sat, Apr 7, 2012 at 21:45, Andrew Turner > wrote: > > On Sun, 8 Apr 2012 04:36:27 +0000 (UTC) > > Andrew Turner wrote: > > > >> Author: andrew > >> Date: Sun Apr =C2=A08 04:36:27 2012 > >> New Revision: 234014 > >> URL: http://svn.freebsd.org/changeset/base/234014 > >> > >> Log: > >> =C2=A0 Unlike other functions __aeabi_read_tp function must preserve > >> r1-r3. The currently generated code clobbers r3. Fix this by > >> loading ARM_TP_ADDRESS using inline assembly. > >> > >> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0imp (mentor) > > > > This fixes thread local storage on ARM in cases when the compiler > > loads the offset of the variable in r3 before calling > > __aeabi_read_tp as has been observed when the variable is in a > > shared library. >=20 > I don't believe this is safe unless you specify __attribute__ > ((__naked__)) in the declaration =E2=80=94 currently the compiler is free= to > clobber registers that the calling convention/ABI allows it to > clobber. I don't see the benefit of implementing this in C over using > an assembly file, that said, although GCC does have this attribute > precisely to allow one to write assembly in a C source file without > having to worry about unexpected behavior. We can implement it as a naked function but we will need to store all registers other than r0 and pc which seems a waste. The problem implementing it in an assembly file is we are unable to use ARM_TP_ADDRESS is defined as: #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) Where ARM_VECTORS_HIGH is defined as: #define ARM_VECTORS_HIGH 0xffff0000U Binutils fails because of the U in ARM_VECTORS_HIGH eith the following: Error: missing ')' Error: junk at end of line, first unrecognized character is `U' I could remove the U from ARM_VECTORS_HIGH however I'm not sure on the implications of that change. > How do you know GCC won't allocate r2 to be used as a temporary in > between the assembly and the return? The compiler is free to use r2 with the current code. I have attached a patch that fools the compiler into thinking we are using r1-r3 by placing them in the clobber list. Andrew --MP_/MUAtSxdUM4O2DLeLY2lu62S Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=arm_tls.patch Index: lib/libc/arm/gen/__aeabi_read_tp.c =================================================================== --- lib/libc/arm/gen/__aeabi_read_tp.c (revision 234031) +++ lib/libc/arm/gen/__aeabi_read_tp.c (working copy) @@ -39,7 +39,8 @@ { void *_tp; - asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS)); + asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS) + : "r1", "r2", "r3"); return _tp; } --MP_/MUAtSxdUM4O2DLeLY2lu62S-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 06:50:56 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 69A18106566B; Mon, 9 Apr 2012 06:50:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E1C6A8FC0C; Mon, 9 Apr 2012 06:50:55 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q396ommv025180; Mon, 9 Apr 2012 10:50:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q396omrC025179; Mon, 9 Apr 2012 10:50:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 9 Apr 2012 10:50:48 +0400 From: Gleb Smirnoff To: Qing Li Message-ID: <20120409065048.GA9391@FreeBSD.org> References: <201204021044.q32AiPng094511@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233773 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 06:50:56 -0000 Qing, On Sun, Apr 08, 2012 at 10:41:11AM -0700, Qing Li wrote: Q> This is not the right way to support RFC3021. Q> Q> The code you removed is used for checking against attempt at adding Q> duplicate entry. Q> Both the message and the code apply in that context. I tried to state Q> clearly and concisely Q> what r201282 was intended in solving and was verified by actual users Q> who ran into the Q> described problems. How does the message apply? On a 10.0/9.0 prior to my commit: #ifconfig em0 em0: flags=8843 metric 0 mtu 1500 options=4219b ether f0:de:f1:6c:5b:fa inet x.x.x.111 netmask 0xffffffe0 broadcast x.x.x.127 nd6 options=29 media: Ethernet autoselect (100baseTX ) status: active # arp -an ? (x.x.x.97) at 00:00:5e:00:01:61 on em0 expires in 1198 seconds [ethernet] ? (x.x.x.101) at 00:e0:81:5a:22:49 on em0 expires in 618 seconds [ethernet] ? (x.x.x.111) at f0:de:f1:6c:5b:fa on em0 permanent [ethernet] ? (x.x.x.116) at 00:26:18:6a:ea:02 on em0 expires in 1128 seconds [ethernet] # # arp -s 81.19.64.96 0:0:0:0:0:0 set: proxy entry exists for non 802 device And how does this apply? Where is the proxy entry mentioned? Where is the non 802 device? Look at the code before r201282 and see that the message was for absolutely unrelated case. And here is behavior of 6.1-RELEASE, that is prior to your new ARP work: # ifconfig fxp0 fxp0: flags=8843 mtu 1500 options=8 inet x.x.x.134 netmask 0xfffffffc broadcast x.x.x.135 ether 00:20:ed:6e:9c:f9 media: Ethernet autoselect (10baseT/UTP) status: active # arp -s x.x.x.132 0:0:0:0:0:0 set: can only proxy for x.x.x.132 As you see, the error message was an other one. Q> If we actually need to support RFC 3021, then better do it properly. What do you mean here under "properly"? RFC3021 says that network address in a /31 network is a common address. Thus it should be possible to have an ARP entry for it. Anyway this change isn't about RFC3021. A /31 network is just a case when we need to set ARP entry for network address. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 08:03:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59DE0106566C for ; Mon, 9 Apr 2012 08:03:55 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id EFDB38FC0A for ; Mon, 9 Apr 2012 08:03:54 +0000 (UTC) Received: by wibhq7 with SMTP id hq7so1896619wib.13 for ; Mon, 09 Apr 2012 01:03:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=H3jVMCpYxye71jynD4ObjbohkaSCmRoMKgDTvVreLlc=; b=RDq5eVWNLiuUPGfQJKgw94tAapypsfZxL3TgUiT6/f7ML2UbCZehypsiWW/3rV2SA0 g28OjIYNvDEQeIU7QBVUS22f23E976U8t8dHkD6xedbTiDakQNAi3ghRqEYAc3R+wNOF tmq3t4hCvs8yr9NDMljhI/+f6kNYGlL7N0gon7T7T6h1KgurtsuUDSt9aWK9JHcKdRsh tjqICSWrZgkB/kIQWETKTLmFSOHV4Rygy5vr2uOl7HHxG6iIrJQ9BbWmZAlIfj9KnRLo ifaO4f/jA6KB54uWM58q01Nz/esThmGVJSmjYbKq4OnDAuUsHUuUKC/RYd4lUz29D2Ov BbBQ== Received: by 10.180.92.71 with SMTP id ck7mr13951064wib.21.1333958629755; Mon, 09 Apr 2012 01:03:49 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.180.86.37 with HTTP; Mon, 9 Apr 2012 01:03:15 -0700 (PDT) In-Reply-To: <20120409161453.29d1f3de@fubar.geek.nz> References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> <20120409161453.29d1f3de@fubar.geek.nz> From: Juli Mallett Date: Mon, 9 Apr 2012 01:03:15 -0700 X-Google-Sender-Auth: esO6JCsP2DvxxA_JFakzZ7lr5wY Message-ID: To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkbeEYu3ESgR+BlE6w55AgLQ3r7BjjDJrVxkVdird2Wx0JogtENzTBGyNYZpo74Ajx232Rf Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 08:03:56 -0000 On Sun, Apr 8, 2012 at 21:14, Andrew Turner wrote: > We can implement it as a naked function but we will need to store all > registers other than r0 and pc which seems a waste. > > The problem implementing it in an assembly file is we are unable to use > ARM_TP_ADDRESS is defined as: > #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) > > Where ARM_VECTORS_HIGH is defined as: > #define ARM_VECTORS_HIGH 0xffff0000U > > I could remove the U from ARM_VECTORS_HIGH however I'm not sure on the > implications of that change. Oh, is that all? :) It's easy to have an ifdef that adds the u suffix in C and not in assembly. That's perfectly appropriate in this case. If you want to be fancy you can use a macro which adds the U to the constant in C and not in assembly, and use it in other places, but that's usually unnecessary. In the kernel we sometimes use assym to get around this sort of thing, but that's fully unnecessary. Look at powerpc/include/vmparam.h for an example of a header where we do this currently (VM_MAXUSER_ADDRESS specifically.) This is the right thing to do by far over using C as a wrapper for assembly in this way. >> How do you know GCC won't allocate r2 to be used as a temporary in >> between the assembly and the return? > > The compiler is free to use r2 with the current code. I have attached a > patch that fools the compiler into thinking we are using r1-r3 by > placing them in the clobber list. If this file is ever compiled with the correct ABI, then, it will do excessive saves and restores of r1-r3, I think. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 08:44:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBFF5106566C; Mon, 9 Apr 2012 08:44:37 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mailfilter7.ihug.co.nz (mailfilter7.ihug.co.nz [203.109.136.7]) by mx1.freebsd.org (Postfix) with ESMTP id BADE38FC12; Mon, 9 Apr 2012 08:44:36 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=DE6nE7g822sA:10 a=f/SxzVRvWQdBqo0nlH1VRA==:17 a=6I5d2MoRAAAA:8 a=JY2zZMM-WH79sdXe9_gA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=uEJTQoQCguP3aNg6:21 a=229SYwgLYOkVjRFa:21 a=UuEQUMmB_T-5lkOdL3kA:9 a=BUk0qA-K5C3i_JQb-t4A:7 a=cekdDQOhqj3mx9Qj:21 a=ZIziTXNSRwrkK617:21 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAPCggk/Ldqol/2dsb2JhbABEuTCBCIIJAQEEAVYjBQsIAw4KLjkeBhOICQS5YIsnhTMEjmyGfwGQNoJ8gT8 X-IronPort-AV: E=Sophos;i="4.75,393,1330858800"; d="scan'208";a="183969788" Received: from 203-118-170-37.adsl.ihug.co.nz (HELO localhost) ([203.118.170.37]) by cust.filter7.content.vf.net.nz with SMTP; 09 Apr 2012 20:44:28 +1200 Date: Mon, 9 Apr 2012 20:44:16 +1200 From: Andrew Turner To: Juli Mallett Message-ID: <20120409204416.77f61674@fubar.geek.nz> In-Reply-To: References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> <20120409161453.29d1f3de@fubar.geek.nz> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/72Cj3Dkup914XX3fIuDB5o=" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 08:44:37 -0000 --MP_/72Cj3Dkup914XX3fIuDB5o= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 9 Apr 2012 01:03:15 -0700 Juli Mallett wrote: > On Sun, Apr 8, 2012 at 21:14, Andrew Turner > wrote: > > We can implement it as a naked function but we will need to store > > all registers other than r0 and pc which seems a waste. > > > > The problem implementing it in an assembly file is we are unable to > > use ARM_TP_ADDRESS is defined as: > > #define ARM_TP_ADDRESS (ARM_VECTORS_HIGH + 0x1000) > > > > Where ARM_VECTORS_HIGH is defined as: > > #define ARM_VECTORS_HIGH 0xffff0000U > > > > I could remove the U from ARM_VECTORS_HIGH however I'm not sure on > > the implications of that change. > > Oh, is that all? :) It's easy to have an ifdef that adds the u > suffix in C and not in assembly. That's perfectly appropriate in this > case. If you want to be fancy you can use a macro which adds the U to > the constant in C and not in assembly, and use it in other places, but > that's usually unnecessary. In the kernel we sometimes use assym to > get around this sort of thing, but that's fully unnecessary. > > Look at powerpc/include/vmparam.h for an example of a header where we > do this currently (VM_MAXUSER_ADDRESS specifically.) This is the > right thing to do by far over using C as a wrapper for assembly in > this way. How does the attached (untested) patch look. It explicitly loads ARM_TP_ADDRESS into a r0 to ensure r1-3 are not touched. Andrew --MP_/72Cj3Dkup914XX3fIuDB5o= Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=arm_tls.patch Index: lib/libc/arm/gen/Makefile.inc =================================================================== --- lib/libc/arm/gen/Makefile.inc (revision 234031) +++ lib/libc/arm/gen/Makefile.inc (working copy) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Index: lib/libc/arm/gen/__aeabi_read_tp.S =================================================================== --- lib/libc/arm/gen/__aeabi_read_tp.S (revision 0) +++ lib/libc/arm/gen/__aeabi_read_tp.S (working copy) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Andrew Turner + * 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 +__FBSDID("$FreeBSD$"); + +#define LOCORE +#include + +ENTRY(__aeabi_read_tp) + ldr r0, .Larm_tp_address + ldr r0, [r0] + RET + +.Larm_tp_address: + .word ARM_TP_ADDRESS + Index: lib/libc/arm/gen/__aeabi_read_tp.c =================================================================== --- lib/libc/arm/gen/__aeabi_read_tp.c (revision 234031) +++ lib/libc/arm/gen/__aeabi_read_tp.c (working copy) @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2012 Oleksandr Tymoshenko - * Copyright (c) 2012 Andrew Turner - * 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. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include "machine/sysarch.h" - -void * -__aeabi_read_tp() -{ - void *_tp; - - asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS)); - - return _tp; -} Index: sys/arm/include/armreg.h =================================================================== --- sys/arm/include/armreg.h (revision 234031) +++ sys/arm/include/armreg.h (working copy) @@ -316,8 +316,13 @@ /* * Address of the vector page, low and high versions. */ +#ifndef LOCORE #define ARM_VECTORS_LOW 0x00000000U #define ARM_VECTORS_HIGH 0xffff0000U +#else +#define ARM_VECTORS_LOW 0 +#define ARM_VECTORS_HIGH 0xffff0000 +#endif /* * ARM Instructions --MP_/72Cj3Dkup914XX3fIuDB5o=-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 13:42:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E251065780; Mon, 9 Apr 2012 13:42:15 +0000 (UTC) (envelope-from vidwer@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id CA5F28FC08; Mon, 9 Apr 2012 13:42:14 +0000 (UTC) Received: by dadz14 with SMTP id z14so18148219dad.17 for ; Mon, 09 Apr 2012 06:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tctaDCg8WpL/q9AAKNwIBeyUaTYxX3xBbhjJW2dt/1Y=; b=qRPEi9t4urk2Tb2KscHKQmtaKZZ5Ztiueh8vIz5EReLb9QjMQTipty891odqOBnIma Itg9JFEECIdoZWxCqv/Kf/+eBC+CV31JAXOXIg57ehTJlQns/5j+iAHesS3BM3gxgR7J w83ES7UR/t5NbrY38o04L6s4cs1YABW/ivq8CrnfADYZhco0YycI0baO6yteFEU/0VX2 TqtxWjSJOQQCCRqqi4vhalQnou/rCQK7/dan/nPNxIoHAROYBhvqBh/+k+F/MzaS+q1s Q0SHkavhIjz9qQX2BwsDKsCY/m4+csZcIscTrHn8rOFrcW8+0sxVS9/Ongx6Sx65tyOu olDQ== MIME-Version: 1.0 Received: by 10.68.135.73 with SMTP id pq9mr4558363pbb.41.1333978933728; Mon, 09 Apr 2012 06:42:13 -0700 (PDT) Received: by 10.68.4.198 with HTTP; Mon, 9 Apr 2012 06:42:13 -0700 (PDT) Date: Mon, 9 Apr 2012 15:42:13 +0200 Message-ID: From: Idwer Vollering To: svn-src-head@freebsd.org, gibbs@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 13:42:15 -0000 This commit broke HT/SMP bootup. http://lists.freebsd.org/pipermail/freebsd-current/2012-April/033038.html From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 14:17:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 170DD1065676; Mon, 9 Apr 2012 14:17:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0170E8FC14; Mon, 9 Apr 2012 14:17:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39EHMYX063808; Mon, 9 Apr 2012 14:17:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39EHM3D063806; Mon, 9 Apr 2012 14:17:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201204091417.q39EHM3D063806@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 9 Apr 2012 14:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234057 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 14:17:23 -0000 Author: jilles Date: Mon Apr 9 14:17:22 2012 New Revision: 234057 URL: http://svn.freebsd.org/changeset/base/234057 Log: sem_open: Make sure to fail an O_CREAT|O_EXCL open, even if that semaphore is already open in this process. If the named semaphore is already open, sem_open() only increments a reference count and did not take the flags into account (which otherwise happens by passing them to open()). Add an extra check for O_CREAT|O_EXCL. PR: kern/166706 Reviewed by: davidxu MFC after: 10 days Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Mon Apr 9 14:16:24 2012 (r234056) +++ head/lib/libc/gen/sem_new.c Mon Apr 9 14:17:22 2012 (r234057) @@ -162,10 +162,16 @@ _sem_open(const char *name, int flags, . _pthread_mutex_lock(&sem_llock); LIST_FOREACH(ni, &sem_list, next) { if (strcmp(name, ni->name) == 0) { - ni->open_count++; - sem = ni->sem; - _pthread_mutex_unlock(&sem_llock); - return (sem); + if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) { + _pthread_mutex_unlock(&sem_llock); + errno = EEXIST; + return (SEM_FAILED); + } else { + ni->open_count++; + sem = ni->sem; + _pthread_mutex_unlock(&sem_llock); + return (sem); + } } } From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 14:47:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D49FD106566B; Mon, 9 Apr 2012 14:47:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03138FC0C; Mon, 9 Apr 2012 14:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39ElIRI064937; Mon, 9 Apr 2012 14:47:18 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39ElIq9064934; Mon, 9 Apr 2012 14:47:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201204091447.q39ElIq9064934@svn.freebsd.org> From: Dimitry Andric Date: Mon, 9 Apr 2012 14:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234058 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 14:47:18 -0000 Author: dim Date: Mon Apr 9 14:47:18 2012 New Revision: 234058 URL: http://svn.freebsd.org/changeset/base/234058 Log: In kdump's mkioctls script, use '${CPP}' instead of hardcodedly using 'gcc -E'. This fixes building when WITH_CLANG_IS_CC is in effect. Report by: Niclas Zeising MFC after: 1 week Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/mkioctls Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Mon Apr 9 14:17:22 2012 (r234057) +++ head/usr.bin/kdump/Makefile Mon Apr 9 14:47:18 2012 (r234058) @@ -21,7 +21,7 @@ NO_WERROR?= YES CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h linux_syscalls.c ioctl.c: mkioctls - env MACHINE=${MACHINE} \ + env MACHINE=${MACHINE} CPP="${CPP}" \ sh ${.CURDIR}/mkioctls print ${DESTDIR}/usr/include > ${.TARGET} kdump_subr.h: mksubr Modified: head/usr.bin/kdump/mkioctls ============================================================================== --- head/usr.bin/kdump/mkioctls Mon Apr 9 14:17:22 2012 (r234057) +++ head/usr.bin/kdump/mkioctls Mon Apr 9 14:47:18 2012 (r234058) @@ -38,7 +38,7 @@ case "${MACHINE}" in esac awk -v x="$ioctl_includes" 'BEGIN {print x}' | - gcc -E -I$1 -dM -DCOMPAT_43TTY - | + $CPP -I$1 -dM -DCOMPAT_43TTY - | awk -v ioctl_includes="$ioctl_includes" -v style="$style" ' BEGIN { print "/* XXX obnoxious prerequisites. */" From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 15:01:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14C4A106566B; Mon, 9 Apr 2012 15:01:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id DE71C8FC1A; Mon, 9 Apr 2012 15:01:16 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4F800B911; Mon, 9 Apr 2012 11:01:16 -0400 (EDT) From: John Baldwin To: "Justin T. Gibbs" Date: Mon, 9 Apr 2012 10:30:10 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204062119.q36LJTKR026564@svn.freebsd.org> In-Reply-To: <201204062119.q36LJTKR026564@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201204091030.10717.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Apr 2012 11:01:16 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 15:01:17 -0000 On Friday, April 06, 2012 5:19:29 pm Justin T. Gibbs wrote: > Author: gibbs > Date: Fri Apr 6 21:19:28 2012 > New Revision: 233961 > URL: http://svn.freebsd.org/changeset/base/233961 > > Log: > Fix interrupt load balancing regression, introduced in revision > 222813, that left all un-pinned interrupts assigned to CPU 0. > > sys/x86/x86/intr_machdep.c: > In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized > the "intr_cpus" cpuset to only contain CPU0. > > This initialization is too late and nullifies the results of calls > the intr_add_cpu() that occur much earlier in the boot process. > Since "intr_cpus" is statically initialized to the empty set, and > all processors, including the BSP, already add themselves to > "intr_cpus" no special initialization for the BSP is necessary. > > MFC after: 3 days Ah, nice catch! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 15:20:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72B901065670; Mon, 9 Apr 2012 15:20:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DBBC8FC0A; Mon, 9 Apr 2012 15:20:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39FKHgQ066148; Mon, 9 Apr 2012 15:20:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39FKH57066144; Mon, 9 Apr 2012 15:20:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204091520.q39FKH57066144@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Apr 2012 15:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234059 - in head/sys: amd64/amd64 i386/i386 x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 15:20:17 -0000 Author: jhb Date: Mon Apr 9 15:20:16 2012 New Revision: 234059 URL: http://svn.freebsd.org/changeset/base/234059 Log: Recognize the RDRAND instruction feature. Submitted by: Michael Fuckner michael fuckner net MFC after: 3 days Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Mon Apr 9 14:47:18 2012 (r234058) +++ head/sys/amd64/amd64/identcpu.c Mon Apr 9 15:20:16 2012 (r234059) @@ -303,7 +303,7 @@ printcpuinfo(void) "\034OSXSAVE" /* OS-Enabled State Management*/ "\035AVX" /* Advanced Vector Extensions */ "\036F16C" /* Half-precision conversions */ - "\037" + "\037RDRAND" /* RDRAND Instruction */ "\040HV" /* Hypervisor */ ); } Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Mon Apr 9 14:47:18 2012 (r234058) +++ head/sys/i386/i386/identcpu.c Mon Apr 9 15:20:16 2012 (r234059) @@ -779,7 +779,7 @@ printcpuinfo(void) "\034OSXSAVE" /* OS-Enabled State Management*/ "\035AVX" /* Advanced Vector Extensions */ "\036F16C" /* Half-precision conversions */ - "\037" + "\037RDRAND" /* RDRAND Instruction */ "\040HV" /* Hypervisor */ ); } Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Mon Apr 9 14:47:18 2012 (r234058) +++ head/sys/x86/include/specialreg.h Mon Apr 9 15:20:16 2012 (r234059) @@ -153,6 +153,7 @@ #define CPUID2_OSXSAVE 0x08000000 #define CPUID2_AVX 0x10000000 #define CPUID2_F16C 0x20000000 +#define CPUID2_RDRAND 0x40000000 #define CPUID2_HV 0x80000000 /* From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 15:34:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D27F8106566C; Mon, 9 Apr 2012 15:34:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BADA88FC0A; Mon, 9 Apr 2012 15:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39FYMU9066685; Mon, 9 Apr 2012 15:34:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39FYMpX066683; Mon, 9 Apr 2012 15:34:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201204091534.q39FYMpX066683@svn.freebsd.org> From: Dimitry Andric Date: Mon, 9 Apr 2012 15:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234060 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 15:34:22 -0000 Author: dim Date: Mon Apr 9 15:34:22 2012 New Revision: 234060 URL: http://svn.freebsd.org/changeset/base/234060 Log: Since truss also uses kdump's mkioctls script, pass the value of ${CPP} there too, similar to r234058. MFC after: 1 week Modified: head/usr.bin/truss/Makefile Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Mon Apr 9 15:20:16 2012 (r234059) +++ head/usr.bin/truss/Makefile Mon Apr 9 15:34:22 2012 (r234060) @@ -23,7 +23,7 @@ syscalls.h: syscalls.master ${.CURDIR}/i386.conf ioctl.c: ${.CURDIR}/../kdump/mkioctls - env MACHINE=${MACHINE} \ + env MACHINE=${MACHINE} CPP="${CPP}" \ /bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}/usr/include > ${.TARGET} .if ${MACHINE_CPUARCH} == "i386" From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 15:45:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A59C106564A; Mon, 9 Apr 2012 15:45:23 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id E23C98FC08; Mon, 9 Apr 2012 15:45:22 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id E915C1395BE; Mon, 9 Apr 2012 18:45:11 +0300 (EEST) Date: Mon, 9 Apr 2012 18:45:11 +0300 From: Jaakko Heinonen To: "Justin T. Gibbs" Message-ID: <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> References: <201204062119.q36LJTKR026564@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201204062119.q36LJTKR026564@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 15:45:23 -0000 Hi, On 2012-04-06, Justin T. Gibbs wrote: > Fix interrupt load balancing regression, introduced in revision > 222813, that left all un-pinned interrupts assigned to CPU 0. > > sys/x86/x86/intr_machdep.c: > In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized > the "intr_cpus" cpuset to only contain CPU0. > > This initialization is too late and nullifies the results of calls > the intr_add_cpu() that occur much earlier in the boot process. > Since "intr_cpus" is statically initialized to the empty set, and > all processors, including the BSP, already add themselves to > "intr_cpus" no special initialization for the BSP is necessary. My Pentium 4 system hangs on boot after this commit. These are the last lines from a verbose boot: SMP: AP CPU #1 Launched! cpu1 AP: ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 The system boots with r233960. Some information: CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0xf29 Family = f Model = 2 Stepping = 9 Features=0xbfebfbff Features2=0x4400 real memory = 2147483648 (2048 MB) avail memory = 2085228544 (1988 MB) Event timer "LAPIC" quality 400 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 -- Jaakko From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 15:51:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C399106566C; Mon, 9 Apr 2012 15:51:37 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 49F908FC0A; Mon, 9 Apr 2012 15:51:37 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M270060CYPUE100@smtpauth1.wiscmail.wisc.edu>; Mon, 09 Apr 2012 10:51:30 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M27000IYYPSZ910@smtpauth1.wiscmail.wisc.edu>; Mon, 09 Apr 2012 10:51:28 -0500 (CDT) Date: Mon, 09 Apr 2012 10:51:27 -0500 From: Nathan Whitehorn In-reply-to: <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> To: Jaakko Heinonen Message-id: <4F83057F.80808@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.4.9.153915, SenderIP=128.104.160.176 References: <201204062119.q36LJTKR026564@svn.freebsd.org> <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.25) Gecko/20120130 Thunderbird/3.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 15:51:37 -0000 On 04/09/12 10:45, Jaakko Heinonen wrote: > Hi, > > On 2012-04-06, Justin T. Gibbs wrote: >> Fix interrupt load balancing regression, introduced in revision >> 222813, that left all un-pinned interrupts assigned to CPU 0. >> >> sys/x86/x86/intr_machdep.c: >> In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized >> the "intr_cpus" cpuset to only contain CPU0. >> >> This initialization is too late and nullifies the results of calls >> the intr_add_cpu() that occur much earlier in the boot process. >> Since "intr_cpus" is statically initialized to the empty set, and >> all processors, including the BSP, already add themselves to >> "intr_cpus" no special initialization for the BSP is necessary. > My Pentium 4 system hangs on boot after this commit. These are the last > lines from a verbose boot: > > SMP: AP CPU #1 Launched! > cpu1 AP: > ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff > lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff > timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 For whatever it's worth, I had a similar problem on PPC with interrupt distribution where interrupts were going very early in boot to non-BSP CPUs before they were launched, and so getting lost. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 16:34:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8737B10656E6; Mon, 9 Apr 2012 16:34:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5977E8FC0C; Mon, 9 Apr 2012 16:34:53 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1071B9C2; Mon, 9 Apr 2012 12:34:52 -0400 (EDT) From: John Baldwin To: Jaakko Heinonen Date: Mon, 9 Apr 2012 12:34:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204062119.q36LJTKR026564@svn.freebsd.org> <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> In-Reply-To: <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204091234.43106.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Apr 2012 12:34:52 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 16:34:53 -0000 On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: > > Hi, > > On 2012-04-06, Justin T. Gibbs wrote: > > Fix interrupt load balancing regression, introduced in revision > > 222813, that left all un-pinned interrupts assigned to CPU 0. > > > > sys/x86/x86/intr_machdep.c: > > In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized > > the "intr_cpus" cpuset to only contain CPU0. > > > > This initialization is too late and nullifies the results of calls > > the intr_add_cpu() that occur much earlier in the boot process. > > Since "intr_cpus" is statically initialized to the empty set, and > > all processors, including the BSP, already add themselves to > > "intr_cpus" no special initialization for the BSP is necessary. > > My Pentium 4 system hangs on boot after this commit. These are the last > lines from a verbose boot: > > SMP: AP CPU #1 Launched! > cpu1 AP: > ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff > lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff > timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 > > The system boots with r233960. > > Some information: > > CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) > Origin = "GenuineIntel" Id = 0xf29 Family = f Model = 2 Stepping = > 9 > Features=0xbfebfbff > Features2=0x4400 > real memory = 2147483648 (2048 MB) > avail memory = 2085228544 (1988 MB) > Event timer "LAPIC" quality 400 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads > cpu0 (BSP): APIC ID: 0 > cpu1 (AP/HT): APIC ID: 1 I suspect in your case intr_add_cpu() is never called. I think Attilio is not correct in that it is not called for the BSP. Yes, it is not called for the BSP in set_interrupt_apic_ids(). This used to work because bit 0 was assigned statically. Also, in a UP machine set_interrupt_apic_ids() is not called at all. Try this (untested): Index: sys/x86/x86/intr_machdep.c =================================================================== --- intr_machdep.c (revision 234057) +++ intr_machdep.c (working copy) @@ -491,6 +491,15 @@ intr_bind(u_int vector, u_char cpu) return (intr_event_bind(isrc->is_event, cpu)); } +static void +intr_add_bsp(void *arg __unused) +{ + + /* The BSP is always a valid target. */ + CPU_SETOF(0, &intr_cpus); +} +SYSINIT(intr_add_bsp, SI_SUB_CPU, SI_ORDER_FIRST, intr_add_bsp, NULL); + /* * Add a CPU to our mask of valid CPUs that can be destinations of * interrupts. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 16:46:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CB241065670 for ; Mon, 9 Apr 2012 16:46:05 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id BD4B58FC12 for ; Mon, 9 Apr 2012 16:46:04 +0000 (UTC) Received: by wern13 with SMTP id n13so3575053wer.13 for ; Mon, 09 Apr 2012 09:46:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=lzJIYSavzImDudbhNSyh+Ny9wf8qM6AIHSfodFGTLMA=; b=IlhtB30aXcv3irqsEoldJbqA6zlH2UPtUNJ35HjrZeB9ByQEPgscdR66yWweyL0XF0 5jMYqI/sJovZnGg1EP83vKBreRTEGfXrpZqCLf09wf1OF0kNdgi4CQ3Gx7Dgn6Y8GK7x 5UoenrEEO7a31DaBPsDqzDlCO4i/lhGjC/xNlYeiJ+BhDf7rtiKXwliiQm1wty6v1Zp5 Bh/0I7CA7TJjxb3R5kUie3QamhsHRaHuTmJd9qPMpCiMgpvzZA7HLjnCugxC2e1BK52Z 2maZRR0b++JoykxEKsY6ussY7jWAMgPr1BtO3jbU+zO+Up4173GyL9RHn+Pm8zWET5TY Qu9w== Received: by 10.180.96.168 with SMTP id dt8mr16946513wib.18.1333989583649; Mon, 09 Apr 2012 09:39:43 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.180.86.37 with HTTP; Mon, 9 Apr 2012 09:39:23 -0700 (PDT) In-Reply-To: <20120409204416.77f61674@fubar.geek.nz> References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> <20120409161453.29d1f3de@fubar.geek.nz> <20120409204416.77f61674@fubar.geek.nz> From: Juli Mallett Date: Mon, 9 Apr 2012 09:39:23 -0700 X-Google-Sender-Auth: mTTPnSjyhHeUIwOOf4pHSn67ntg Message-ID: To: Andrew Turner Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQm6cvNZiRRIoftSwAjFsaqBPfl2ot3WHcKCoCILXhG56ikZRPYry6Jq6vb+7EZ43APIJGay Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 16:46:05 -0000 On Mon, Apr 9, 2012 at 01:44, Andrew Turner wrote: > How does the attached (untested) patch look. It explicitly loads > ARM_TP_ADDRESS into a r0 to ensure r1-3 are not touched. The example file I pointed at was for the kernel, where the LOCORE-related ifdefs (almost) make sense, but for userland you probably want to conditionalize on __ASSEMBLER__. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 16:53:42 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA01106566B; Mon, 9 Apr 2012 16:53:42 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 61CC78FC20; Mon, 9 Apr 2012 16:53:42 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q39GrZI9013233; Mon, 9 Apr 2012 12:53:35 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q39GrZEo013232; Mon, 9 Apr 2012 12:53:35 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 9 Apr 2012 12:53:35 -0400 From: David Schultz To: Tijl Coosemans Message-ID: <20120409165335.GA13177@zim.MIT.EDU> Mail-Followup-To: Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201203041400.q24E0WcS037398@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203041400.q24E0WcS037398@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r232491 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 16:53:42 -0000 On Sun, Mar 04, 2012, Tijl Coosemans wrote: > Log: > Copy amd64 float.h to x86 and merge with i386 float.h. Replace > amd64/i386/pc98 float.h with stubs. [...] > --- head/sys/amd64/include/float.h Sun Mar 4 12:52:48 2012 (r232490, copy source) > +++ head/sys/x86/include/float.h Sun Mar 4 14:00:32 2012 (r232491) > @@ -42,7 +42,11 @@ __END_DECLS > #define FLT_RADIX 2 /* b */ > #define FLT_ROUNDS __flt_rounds() > #if __ISO_C_VISIBLE >= 1999 > +#ifdef _LP64 > #define FLT_EVAL_METHOD 0 /* no promotions */ > +#else > +#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ > +#endif > #define DECIMAL_DIG 21 /* max precision in decimal digits */ > #endif The implication of this code is that FLT_EVAL_METHOD depends on the size of a long, which it does not. Instead, it depends on whether SSE2 support is guaranteed to be present. If anything, the test should be something like #ifndef __i386__. By the way, the #defines for single- and double-precision are effectively MI and should be in, e.g., ieee754_float.h. I can send some old patches to that effect if someone wants to clean them up and commit them. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 16:58:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39C8106564A; Mon, 9 Apr 2012 16:58:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1B98B8FC16; Mon, 9 Apr 2012 16:58:08 +0000 (UTC) Received: by lagv3 with SMTP id v3so5015599lag.13 for ; Mon, 09 Apr 2012 09:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=se4t0bo0YAfoBu09BD4v5i4G0VcZ7zI1QvQOYzL4HDk=; b=XGABcc2PvA8HmGTzMOi7GPep78eCDmirQtGbQf40L8K1OZxzdsF1qWEf+ZcO6TgckS VDmE/NsNQJ8pQQxuZvEUPw3Rx4Qid8n1rLCngJ1QNh1RIHE+Gd5lJGq/TQXcUdQKQuQQ qHcAf/GOJo20E8hK+7gu1XJWVeST27bSI+I6pHiR7aGQXGkP82PF+qd8PO6falhPx8n0 0lQIzkpxJ6WG/uJ8FtrPSol1oKVkja5eE2qgjNEOUjM6QeZrDas1ERqlmgYN2zE2a7OR Nz679wvB4nYRNM6uLfhlms7J7cHC7Fn8Fw6iPGEubA03wu36ZDr7lOceeVNCTCbU3pOg 125w== MIME-Version: 1.0 Received: by 10.152.132.166 with SMTP id ov6mr12769446lab.35.1333990688033; Mon, 09 Apr 2012 09:58:08 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Mon, 9 Apr 2012 09:58:07 -0700 (PDT) In-Reply-To: <201204091234.43106.jhb@freebsd.org> References: <201204062119.q36LJTKR026564@svn.freebsd.org> <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> <201204091234.43106.jhb@freebsd.org> Date: Mon, 9 Apr 2012 17:58:07 +0100 X-Google-Sender-Auth: bxpHncSu7eL2mF13d2_QRMcFbuU Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 16:58:10 -0000 Il 09 aprile 2012 17:34, John Baldwin ha scritto: > On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: >> >> Hi, >> >> On 2012-04-06, Justin T. Gibbs wrote: >> > =C2=A0 Fix interrupt load balancing regression, introduced in revision >> > =C2=A0 222813, that left all un-pinned interrupts assigned to CPU 0. >> > >> > =C2=A0 sys/x86/x86/intr_machdep.c: >> > =C2=A0 =C2=A0 In intr_shuffle_irqs(), remove CPU_SETOF() call that ini= tialized >> > =C2=A0 =C2=A0 the "intr_cpus" cpuset to only contain CPU0. >> > >> > =C2=A0 =C2=A0 This initialization is too late and nullifies the result= s of calls >> > =C2=A0 =C2=A0 the intr_add_cpu() that occur much earlier in the boot p= rocess. >> > =C2=A0 =C2=A0 Since "intr_cpus" is statically initialized to the empty= set, and >> > =C2=A0 =C2=A0 all processors, including the BSP, already add themselve= s to >> > =C2=A0 =C2=A0 "intr_cpus" no special initialization for the BSP is nec= essary. >> >> My Pentium 4 system hangs on boot after this commit. These are the last >> lines from a verbose boot: >> >> SMP: AP CPU #1 Launched! >> cpu1 AP: >> =C2=A0 =C2=A0 =C2=A0ID: 0x01000000 =C2=A0 VER: 0x00050014 LDR: 0x0000000= 0 DFR: 0xffffffff >> =C2=A0 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001= ff >> =C2=A0 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x000104= 00 >> >> The system boots with r233960. >> >> Some information: >> >> CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) >> =C2=A0 Origin =3D "GenuineIntel" =C2=A0Id =3D 0xf29 =C2=A0Family =3D f = =C2=A0Model =3D 2 =C2=A0Stepping =3D >> 9 >> > Features=3D0xbfebfbff >> =C2=A0 Features2=3D0x4400 >> real memory =C2=A0=3D 2147483648 (2048 MB) >> avail memory =3D 2085228544 (1988 MB) >> Event timer "LAPIC" quality 400 >> ACPI APIC Table: >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads >> =C2=A0cpu0 (BSP): APIC ID: =C2=A00 >> =C2=A0cpu1 (AP/HT): APIC ID: =C2=A01 > > I suspect in your case intr_add_cpu() is never called. =C2=A0I think Atti= lio is not > correct in that it is not called for the BSP. > > Yes, it is not called for the BSP in set_interrupt_apic_ids(). =C2=A0This= used to > work because bit 0 was assigned statically. =C2=A0Also, in a UP machine > set_interrupt_apic_ids() is not called at all. But why there is a front-end check for the BSP in set_interrupt_apic_ids()? Anyway, I think a better fix would be like the attached patch. Thanks, Attilio Index: sys/i386/i386/mp_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/i386/mp_machdep.c (revisione 234046) +++ sys/i386/i386/mp_machdep.c (copia locale) @@ -831,6 +831,8 @@ set_interrupt_apic_ids(void) apic_id =3D cpu_apic_ids[i]; if (apic_id =3D=3D -1) continue; + + /* BSP should be already added by cpu_startup(). */ if (cpu_info[apic_id].cpu_bsp) continue; if (cpu_info[apic_id].cpu_disabled) Index: sys/i386/i386/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/i386/machdep.c (revisione 234046) +++ sys/i386/i386/machdep.c (copia locale) @@ -336,6 +336,11 @@ cpu_startup(dummy) #ifndef XEN cpu_setregs(); #endif + + /* + * Add BSP interrupt bitmask. + */ + intr_add_cpu(0); } /* Index: sys/amd64/amd64/mp_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/amd64/mp_machdep.c (revisione 234046) +++ sys/amd64/amd64/mp_machdep.c (copia locale) @@ -797,6 +797,8 @@ set_interrupt_apic_ids(void) apic_id =3D cpu_apic_ids[i]; if (apic_id =3D=3D -1) continue; + + /* BSP should be already added by cpu_startup(). */ if (cpu_info[apic_id].cpu_bsp) continue; if (cpu_info[apic_id].cpu_disabled) Index: sys/amd64/amd64/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/amd64/machdep.c (revisione 234046) +++ sys/amd64/amd64/machdep.c (copia locale) @@ -295,6 +295,11 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); + + /* + * Add BSP interrupt bitmask. + */ + intr_add_cpu(0); } /* From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 17:05:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 755ED106566B; Mon, 9 Apr 2012 17:05:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 464208FC08; Mon, 9 Apr 2012 17:05:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39H5JmH070017; Mon, 9 Apr 2012 17:05:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39H5JCG070013; Mon, 9 Apr 2012 17:05:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201204091705.q39H5JCG070013@svn.freebsd.org> From: Attilio Rao Date: Mon, 9 Apr 2012 17:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234064 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/tmpfs vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 17:05:19 -0000 Author: attilio Date: Mon Apr 9 17:05:18 2012 New Revision: 234064 URL: http://svn.freebsd.org/changeset/base/234064 Log: - Introduce a cache-miss optimization for consistency with other accesses of the cache member of vm_object objects. - Use novel vm_page_is_cached() for checks outside of the vm subsystem. Reviewed by: alc MFC after: 2 weeks X-MFC: r234039 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/vm/vm_page.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 9 16:18:55 2012 (r234063) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 9 17:05:18 2012 (r234064) @@ -345,10 +345,9 @@ page_lookup(vnode_t *vp, int64_t start, vm_page_busy(pp); vm_page_undirty(pp); } else { - if (__predict_false(obj->cache != NULL)) { + if (vm_page_is_cached(obj, OFF_TO_IDX(start))) vm_page_cache_free(obj, OFF_TO_IDX(start), OFF_TO_IDX(start) + 1); - } pp = NULL; } break; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon Apr 9 16:18:55 2012 (r234063) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Apr 9 17:05:18 2012 (r234064) @@ -662,7 +662,7 @@ lookupvpg: VM_OBJECT_UNLOCK(vobj); error = uiomove_fromphys(&vpg, offset, tlen, uio); } else { - if (__predict_false(vobj->cache != NULL)) + if (vm_page_is_cached(vobj, idx)) vm_page_cache_free(vobj, idx, idx + 1); VM_OBJECT_UNLOCK(vobj); vpg = NULL; Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Apr 9 16:18:55 2012 (r234063) +++ head/sys/vm/vm_page.c Mon Apr 9 17:05:18 2012 (r234064) @@ -1303,7 +1303,7 @@ vm_page_is_cached(vm_object_t object, vm * exist. */ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->cache == NULL) + if (__predict_true(object->cache == NULL)) return (FALSE); mtx_lock(&vm_page_queue_free_mtx); m = vm_page_cache_lookup(object, pindex); From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 17:33:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05758106564A; Mon, 9 Apr 2012 17:33:21 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id AC36A8FC0A; Mon, 9 Apr 2012 17:33:20 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 51BE3216671; Mon, 9 Apr 2012 20:33:07 +0300 (EEST) Date: Mon, 9 Apr 2012 20:33:07 +0300 From: Jaakko Heinonen To: John Baldwin Message-ID: <20120409173307.GB2253@a91-153-116-96.elisa-laajakaista.fi> References: <201204062119.q36LJTKR026564@svn.freebsd.org> <20120409154510.GA2253@a91-153-116-96.elisa-laajakaista.fi> <201204091234.43106.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201204091234.43106.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 17:33:21 -0000 On 2012-04-09, John Baldwin wrote: > I suspect in your case intr_add_cpu() is never called. I think Attilio is not > correct in that it is not called for the BSP. > > Yes, it is not called for the BSP in set_interrupt_apic_ids(). This used to > work because bit 0 was assigned statically. Also, in a UP machine > set_interrupt_apic_ids() is not called at all. > > Try this (untested): I can boot with the patch applied. Thanks! -- Jaakko From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 17:48:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A05361065674; Mon, 9 Apr 2012 17:48:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 71F018FC0C; Mon, 9 Apr 2012 17:48:24 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CD472B915; Mon, 9 Apr 2012 13:48:23 -0400 (EDT) From: John Baldwin To: Attilio Rao Date: Mon, 9 Apr 2012 13:14:20 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204062119.q36LJTKR026564@svn.freebsd.org> <201204091234.43106.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201204091314.20775.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Apr 2012 13:48:23 -0400 (EDT) Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 17:48:24 -0000 On Monday, April 09, 2012 12:58:07 pm Attilio Rao wrote: > Il 09 aprile 2012 17:34, John Baldwin ha scritto: > > On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: > >> > >> Hi, > >> > >> On 2012-04-06, Justin T. Gibbs wrote: > >> > Fix interrupt load balancing regression, introduced in revision > >> > 222813, that left all un-pinned interrupts assigned to CPU 0. > >> > > >> > sys/x86/x86/intr_machdep.c: > >> > In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized > >> > the "intr_cpus" cpuset to only contain CPU0. > >> > > >> > This initialization is too late and nullifies the results of calls > >> > the intr_add_cpu() that occur much earlier in the boot process. > >> > Since "intr_cpus" is statically initialized to the empty set, and > >> > all processors, including the BSP, already add themselves to > >> > "intr_cpus" no special initialization for the BSP is necessary. > >> > >> My Pentium 4 system hangs on boot after this commit. These are the last > >> lines from a verbose boot: > >> > >> SMP: AP CPU #1 Launched! > >> cpu1 AP: > >> ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff > >> lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff > >> timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 > >> > >> The system boots with r233960. > >> > >> Some information: > >> > >> CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) > >> Origin = "GenuineIntel" Id = 0xf29 Family = f Model = 2 Stepping = > >> 9 > >> > > Features=0xbfebfbff > >> Features2=0x4400 > >> real memory = 2147483648 (2048 MB) > >> avail memory = 2085228544 (1988 MB) > >> Event timer "LAPIC" quality 400 > >> ACPI APIC Table: > >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > >> FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads > >> cpu0 (BSP): APIC ID: 0 > >> cpu1 (AP/HT): APIC ID: 1 > > > > I suspect in your case intr_add_cpu() is never called. I think Attilio is not > > correct in that it is not called for the BSP. > > > > Yes, it is not called for the BSP in set_interrupt_apic_ids(). This used to > > work because bit 0 was assigned statically. Also, in a UP machine > > set_interrupt_apic_ids() is not called at all. > > But why there is a front-end check for the BSP in set_interrupt_apic_ids()? > > Anyway, I think a better fix would be like the attached patch. This would be fine. What I would really prefer is to not need the sysinit at all and be able to do something like the original pre-cpuset code: static cpuset_t intr_cpus = CPU_INITIAILIZER(0); Also, with the cpuset variant, I think we could remove the special case check for the BSP from set_apic_interrupt_ids() as it doesn't hurt to set it multiple times. IIRC, the pre-cpuset code kept a separate count which is why that would have been harmful. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 17:59:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE3151065672; Mon, 9 Apr 2012 17:59:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 651F58FC08; Mon, 9 Apr 2012 17:59:15 +0000 (UTC) Received: by lagv3 with SMTP id v3so5068454lag.13 for ; Mon, 09 Apr 2012 10:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Zwpz0DI3BX5TsxzNVEYjj7X16I7UgVnvYCXcjsSBIL8=; b=INoPeIwP2t25k6hPGq3W20VjeXD5Dg7uXpzN6xpwK+17KZpbh8i6BkHmGkI+lddnPU KsB2mCl6xD4FrROtJyK8ECIyAk/l1B+RJt7HNfxUXvSR100BiJkhjW6WaDbfLvXY5wfA 5tj/9u6zqdagrUXNI98O/vo60k3Bh/pntLguDrvlhVTS25G1BHAzT+9KLoqiT0BEkplN KrK/s5SDgmr/fu8E+eMe9JQ/SaBqq4w66lkS7Q96sxrd70/ICU56jsvjARIFGsSv3CHi T3YWyyFxpN5839DsgZY58+6L3nPva623K+DrtkDQqmQMWNlEmNPg0xCIm3maFGV7giHk sbkA== MIME-Version: 1.0 Received: by 10.112.37.132 with SMTP id y4mr93593lbj.8.1333994354009; Mon, 09 Apr 2012 10:59:14 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Mon, 9 Apr 2012 10:59:13 -0700 (PDT) In-Reply-To: <201204091314.20775.jhb@freebsd.org> References: <201204062119.q36LJTKR026564@svn.freebsd.org> <201204091234.43106.jhb@freebsd.org> <201204091314.20775.jhb@freebsd.org> Date: Mon, 9 Apr 2012 18:59:13 +0100 X-Google-Sender-Auth: ZAgkR9QrWAo3URVTpKFZMW9Xmzk Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 17:59:17 -0000 Il 09 aprile 2012 18:14, John Baldwin ha scritto: > On Monday, April 09, 2012 12:58:07 pm Attilio Rao wrote: >> Il 09 aprile 2012 17:34, John Baldwin ha scritto: >> > On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: >> >> >> >> Hi, >> >> >> >> On 2012-04-06, Justin T. Gibbs wrote: >> >> > =C2=A0 Fix interrupt load balancing regression, introduced in revis= ion >> >> > =C2=A0 222813, that left all un-pinned interrupts assigned to CPU 0= . >> >> > >> >> > =C2=A0 sys/x86/x86/intr_machdep.c: >> >> > =C2=A0 =C2=A0 In intr_shuffle_irqs(), remove CPU_SETOF() call that = initialized >> >> > =C2=A0 =C2=A0 the "intr_cpus" cpuset to only contain CPU0. >> >> > >> >> > =C2=A0 =C2=A0 This initialization is too late and nullifies the res= ults of calls >> >> > =C2=A0 =C2=A0 the intr_add_cpu() that occur much earlier in the boo= t process. >> >> > =C2=A0 =C2=A0 Since "intr_cpus" is statically initialized to the em= pty set, and >> >> > =C2=A0 =C2=A0 all processors, including the BSP, already add themse= lves to >> >> > =C2=A0 =C2=A0 "intr_cpus" no special initialization for the BSP is = necessary. >> >> >> >> My Pentium 4 system hangs on boot after this commit. These are the la= st >> >> lines from a verbose boot: >> >> >> >> SMP: AP CPU #1 Launched! >> >> cpu1 AP: >> >> =C2=A0 =C2=A0 =C2=A0ID: 0x01000000 =C2=A0 VER: 0x00050014 LDR: 0x0000= 0000 DFR: 0xffffffff >> >> =C2=A0 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000= 001ff >> >> =C2=A0 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x000= 10400 >> >> >> >> The system boots with r233960. >> >> >> >> Some information: >> >> >> >> CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) >> >> =C2=A0 Origin =3D "GenuineIntel" =C2=A0Id =3D 0xf29 =C2=A0Family =3D = f =C2=A0Model =3D 2 =C2=A0Stepping =3D >> >> 9 >> >> >> > Features=3D0xbfebfbff >> >> =C2=A0 Features2=3D0x4400 >> >> real memory =C2=A0=3D 2147483648 (2048 MB) >> >> avail memory =3D 2085228544 (1988 MB) >> >> Event timer "LAPIC" quality 400 >> >> ACPI APIC Table: >> >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> >> FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads >> >> =C2=A0cpu0 (BSP): APIC ID: =C2=A00 >> >> =C2=A0cpu1 (AP/HT): APIC ID: =C2=A01 >> > >> > I suspect in your case intr_add_cpu() is never called. =C2=A0I think A= ttilio is not >> > correct in that it is not called for the BSP. >> > >> > Yes, it is not called for the BSP in set_interrupt_apic_ids(). =C2=A0T= his used to >> > work because bit 0 was assigned statically. =C2=A0Also, in a UP machin= e >> > set_interrupt_apic_ids() is not called at all. >> >> But why there is a front-end check for the BSP in set_interrupt_apic_ids= ()? >> >> Anyway, I think a better fix would be like the attached patch. > > This would be fine. =C2=A0What I would really prefer is to not need the s= ysinit at > all and be able to do something like the original pre-cpuset code: > > static cpuset_t intr_cpus =3D CPU_INITIAILIZER(0); This is more difficult to do because it would require static array initializations and it would pollute too much the code with compile time, MAXCPU-dependant details. > Also, with the cpuset variant, I think we could remove the special case c= heck > for the BSP from set_apic_interrupt_ids() as it doesn't hurt to set it > multiple times. =C2=A0 IIRC, the pre-cpuset code kept a separate count wh= ich is > why that would have been harmful. I'm not sure I follow, a separate count for what? So do you consider the following patch as a real commit candidate? Thanks, Attilio Index: sys/i386/i386/mp_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/i386/mp_machdep.c (revisione 234064) +++ sys/i386/i386/mp_machdep.c (copia locale) @@ -819,8 +819,6 @@ init_secondary(void) * We tell the I/O APIC code about all the CPUs we want to receive * interrupts. If we don't want certain CPUs to receive IRQs we * can simply not tell the I/O APIC code about them in this function. - * We also do not tell it about the BSP since it tells itself about - * the BSP internally to work with UP kernels and on UP machines. */ static void set_interrupt_apic_ids(void) @@ -831,8 +829,6 @@ set_interrupt_apic_ids(void) apic_id =3D cpu_apic_ids[i]; if (apic_id =3D=3D -1) continue; - if (cpu_info[apic_id].cpu_bsp) - continue; if (cpu_info[apic_id].cpu_disabled) continue; Index: sys/i386/i386/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/i386/machdep.c (revisione 234064) +++ sys/i386/i386/machdep.c (copia locale) @@ -336,6 +336,11 @@ cpu_startup(dummy) #ifndef XEN cpu_setregs(); #endif + + /* + * Add BSP interrupt bitmask. + */ + intr_add_cpu(0); } /* Index: sys/amd64/amd64/mp_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/amd64/mp_machdep.c (revisione 234064) +++ sys/amd64/amd64/mp_machdep.c (copia locale) @@ -785,8 +785,6 @@ init_secondary(void) * We tell the I/O APIC code about all the CPUs we want to receive * interrupts. If we don't want certain CPUs to receive IRQs we * can simply not tell the I/O APIC code about them in this function. - * We also do not tell it about the BSP since it tells itself about - * the BSP internally to work with UP kernels and on UP machines. */ static void set_interrupt_apic_ids(void) @@ -797,8 +795,6 @@ set_interrupt_apic_ids(void) apic_id =3D cpu_apic_ids[i]; if (apic_id =3D=3D -1) continue; - if (cpu_info[apic_id].cpu_bsp) - continue; if (cpu_info[apic_id].cpu_disabled) continue; Index: sys/amd64/amd64/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/amd64/machdep.c (revisione 234064) +++ sys/amd64/amd64/machdep.c (copia locale) @@ -295,6 +295,11 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); + + /* + * Add BSP interrupt bitmask. + */ + intr_add_cpu(0); } /* From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 18:24:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 218E1106564A; Mon, 9 Apr 2012 18:24:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DC7D8FC0A; Mon, 9 Apr 2012 18:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39IOw8J072804; Mon, 9 Apr 2012 18:24:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39IOw64072802; Mon, 9 Apr 2012 18:24:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201204091824.q39IOw64072802@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 Apr 2012 18:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234066 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 18:24:59 -0000 Author: mav Date: Mon Apr 9 18:24:58 2012 New Revision: 234066 URL: http://svn.freebsd.org/changeset/base/234066 Log: Microoptimize cpu_search(). According to profiling, it makes one take 6% of CPU time on hackbench with its million of context switches per second, instead of 8% before. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Apr 9 17:33:35 2012 (r234065) +++ head/sys/kern/sched_ule.c Mon Apr 9 18:24:58 2012 (r234066) @@ -594,32 +594,34 @@ cpu_search(const struct cpu_group *cg, s cpuset_t cpumask; struct cpu_group *child; struct tdq *tdq; - int cpu, i, hload, lload, load, total, rnd; + int cpu, i, hload, lload, load, total, rnd, *rndptr; total = 0; cpumask = cg->cg_mask; if (match & CPU_SEARCH_LOWEST) { lload = INT_MAX; - low->cs_load = INT_MAX; lgroup = *low; } if (match & CPU_SEARCH_HIGHEST) { - hload = -1; - high->cs_load = -1; + hload = INT_MIN; hgroup = *high; } /* Iterate through the child CPU groups and then remaining CPUs. */ - for (i = 0, cpu = 0; i <= cg->cg_children; ) { - if (i >= cg->cg_children) { - while (cpu <= mp_maxid && !CPU_ISSET(cpu, &cpumask)) - cpu++; - if (cpu > mp_maxid) + for (i = cg->cg_children, cpu = mp_maxid; i >= 0; ) { + if (i == 0) { + while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask)) + cpu--; + if (cpu < 0) break; child = NULL; } else - child = &cg->cg_child[i]; + child = &cg->cg_child[i - 1]; + if (match & CPU_SEARCH_LOWEST) + lgroup.cs_cpu = -1; + if (match & CPU_SEARCH_HIGHEST) + hgroup.cs_cpu = -1; if (child) { /* Handle child CPU group. */ CPU_NAND(&cpumask, &child->cg_mask); switch (match) { @@ -636,23 +638,23 @@ cpu_search(const struct cpu_group *cg, s } else { /* Handle child CPU. */ tdq = TDQ_CPU(cpu); load = tdq->tdq_load * 256; - rnd = DPCPU_SET(randomval, - DPCPU_GET(randomval) * 69069 + 5) >> 26; + rndptr = DPCPU_PTR(randomval); + rnd = (*rndptr = *rndptr * 69069 + 5) >> 26; if (match & CPU_SEARCH_LOWEST) { if (cpu == low->cs_prefer) load -= 64; /* If that CPU is allowed and get data. */ - if (CPU_ISSET(cpu, &lgroup.cs_mask) && - tdq->tdq_lowpri > lgroup.cs_pri && - tdq->tdq_load <= lgroup.cs_limit) { + if (tdq->tdq_lowpri > lgroup.cs_pri && + tdq->tdq_load <= lgroup.cs_limit && + CPU_ISSET(cpu, &lgroup.cs_mask)) { lgroup.cs_cpu = cpu; lgroup.cs_load = load - rnd; } } if (match & CPU_SEARCH_HIGHEST) - if (CPU_ISSET(cpu, &hgroup.cs_mask) && - tdq->tdq_load >= hgroup.cs_limit && - tdq->tdq_transferable) { + if (tdq->tdq_load >= hgroup.cs_limit && + tdq->tdq_transferable && + CPU_ISSET(cpu, &hgroup.cs_mask)) { hgroup.cs_cpu = cpu; hgroup.cs_load = load - rnd; } @@ -661,7 +663,7 @@ cpu_search(const struct cpu_group *cg, s /* We have info about child item. Compare it. */ if (match & CPU_SEARCH_LOWEST) { - if (lgroup.cs_load != INT_MAX && + if (lgroup.cs_cpu >= 0 && (load < lload || (load == lload && lgroup.cs_load < low->cs_load))) { lload = load; @@ -670,17 +672,19 @@ cpu_search(const struct cpu_group *cg, s } } if (match & CPU_SEARCH_HIGHEST) - if (hgroup.cs_load >= 0 && + if (hgroup.cs_cpu >= 0 && (load > hload || (load == hload && hgroup.cs_load > high->cs_load))) { hload = load; high->cs_cpu = hgroup.cs_cpu; high->cs_load = hgroup.cs_load; } - if (child) - i++; - else - cpu++; + if (child) { + i--; + if (i == 0 && CPU_EMPTY(&cpumask)) + break; + } else + cpu--; } return (total); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 18:38:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B24FB1065674; Mon, 9 Apr 2012 18:38:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 59E818FC17; Mon, 9 Apr 2012 18:38:10 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C65C0B915; Mon, 9 Apr 2012 14:38:09 -0400 (EDT) From: John Baldwin To: Attilio Rao Date: Mon, 9 Apr 2012 14:35:31 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204062119.q36LJTKR026564@svn.freebsd.org> <201204091314.20775.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201204091435.31893.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Apr 2012 14:38:09 -0400 (EDT) Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 18:38:10 -0000 On Monday, April 09, 2012 1:59:13 pm Attilio Rao wrote: > Il 09 aprile 2012 18:14, John Baldwin ha scritto: > > On Monday, April 09, 2012 12:58:07 pm Attilio Rao wrote: > >> Il 09 aprile 2012 17:34, John Baldwin ha scritto: > >> > On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: > >> >> > >> >> Hi, > >> >> > >> >> On 2012-04-06, Justin T. Gibbs wrote: > >> >> > Fix interrupt load balancing regression, introduced in revision > >> >> > 222813, that left all un-pinned interrupts assigned to CPU 0. > >> >> > > >> >> > sys/x86/x86/intr_machdep.c: > >> >> > In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized > >> >> > the "intr_cpus" cpuset to only contain CPU0. > >> >> > > >> >> > This initialization is too late and nullifies the results of calls > >> >> > the intr_add_cpu() that occur much earlier in the boot process. > >> >> > Since "intr_cpus" is statically initialized to the empty set, and > >> >> > all processors, including the BSP, already add themselves to > >> >> > "intr_cpus" no special initialization for the BSP is necessary. > >> >> > >> >> My Pentium 4 system hangs on boot after this commit. These are the last > >> >> lines from a verbose boot: > >> >> > >> >> SMP: AP CPU #1 Launched! > >> >> cpu1 AP: > >> >> ID: 0x01000000 VER: 0x00050014 LDR: 0x00000000 DFR: 0xffffffff > >> >> lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff > >> >> timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 > >> >> > >> >> The system boots with r233960. > >> >> > >> >> Some information: > >> >> > >> >> CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) > >> >> Origin = "GenuineIntel" Id = 0xf29 Family = f Model = 2 Stepping = > >> >> 9 > >> >> > >> > Features=0xbfebfbff > >> >> Features2=0x4400 > >> >> real memory = 2147483648 (2048 MB) > >> >> avail memory = 2085228544 (1988 MB) > >> >> Event timer "LAPIC" quality 400 > >> >> ACPI APIC Table: > >> >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > >> >> FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads > >> >> cpu0 (BSP): APIC ID: 0 > >> >> cpu1 (AP/HT): APIC ID: 1 > >> > > >> > I suspect in your case intr_add_cpu() is never called. I think Attilio is not > >> > correct in that it is not called for the BSP. > >> > > >> > Yes, it is not called for the BSP in set_interrupt_apic_ids(). This used to > >> > work because bit 0 was assigned statically. Also, in a UP machine > >> > set_interrupt_apic_ids() is not called at all. > >> > >> But why there is a front-end check for the BSP in set_interrupt_apic_ids()? > >> > >> Anyway, I think a better fix would be like the attached patch. > > > > This would be fine. What I would really prefer is to not need the sysinit at > > all and be able to do something like the original pre-cpuset code: > > > > static cpuset_t intr_cpus = CPU_INITIAILIZER(0); > > This is more difficult to do because it would require static array > initializations and it would pollute too much the code with compile > time, MAXCPU-dependant details. > > > Also, with the cpuset variant, I think we could remove the special case check > > for the BSP from set_apic_interrupt_ids() as it doesn't hurt to set it > > multiple times. IIRC, the pre-cpuset code kept a separate count which is > > why that would have been harmful. > > I'm not sure I follow, a separate count for what? The pre-cpuset code used a separate count IIRC. That is why duplicate calls to intr_add_cpu() used to be bad. However, they are no longer bad. > So do you consider the following patch as a real commit candidate? Yes, modulo a nit: > Index: sys/i386/i386/machdep.c > =================================================================== > --- sys/i386/i386/machdep.c (revisione 234064) > +++ sys/i386/i386/machdep.c (copia locale) > @@ -336,6 +336,11 @@ cpu_startup(dummy) > #ifndef XEN > cpu_setregs(); > #endif > + > + /* > + * Add BSP interrupt bitmask. > + */ > + intr_add_cpu(0); > } I would make this a single line comment and say: "Add BSP as an interrupt target." (More closely matches the original comment from intr_machdep.c). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 20:55:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5E3691065673; Mon, 9 Apr 2012 20:55:24 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30A6A8FC0C; Mon, 9 Apr 2012 20:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39KtOfG077904; Mon, 9 Apr 2012 20:55:24 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39KtN7R077902; Mon, 9 Apr 2012 20:55:23 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201204092055.q39KtN7R077902@svn.freebsd.org> From: Robert Millan Date: Mon, 9 Apr 2012 20:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234069 - head/sbin/savecore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 20:55:24 -0000 Author: rmh Date: Mon Apr 9 20:55:23 2012 New Revision: 234069 URL: http://svn.freebsd.org/changeset/base/234069 Log: Include (for SIGINFO). Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Mon Apr 9 19:40:52 2012 (r234068) +++ head/sbin/savecore/savecore.c Mon Apr 9 20:55:23 2012 (r234069) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 20:59:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A62F0106566B; Mon, 9 Apr 2012 20:59:14 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 914478FC0C; Mon, 9 Apr 2012 20:59:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39KxEVO078055; Mon, 9 Apr 2012 20:59:14 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39KxE0q078053; Mon, 9 Apr 2012 20:59:14 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201204092059.q39KxE0q078053@svn.freebsd.org> From: Robert Millan Date: Mon, 9 Apr 2012 20:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234070 - head/usr.sbin/powerd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 20:59:14 -0000 Author: rmh Date: Mon Apr 9 20:59:14 2012 New Revision: 234070 URL: http://svn.freebsd.org/changeset/base/234070 Log: Improve error reporting when no cpufreq(4) support is available. Reviewed by: njl, acpi Modified: head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Mon Apr 9 20:55:23 2012 (r234069) +++ head/usr.sbin/powerd/powerd.c Mon Apr 9 20:59:14 2012 (r234070) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef __i386__ @@ -536,7 +537,7 @@ main(int argc, char * argv[]) err(1, "lookup kern.cp_times"); len = 4; if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len)) - err(1, "lookup freq"); + err(EX_UNAVAILABLE, "no cpufreq(4) support -- aborting"); len = 4; if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len)) err(1, "lookup freq_levels"); From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 21:26:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 24534106564A; Mon, 9 Apr 2012 21:26:08 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 31B908FC08; Mon, 9 Apr 2012 21:26:07 +0000 (UTC) Received: by wibhj6 with SMTP id hj6so2403236wib.13 for ; Mon, 09 Apr 2012 14:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7uzRNWoBlaPp4C+oGfHfFTA12MfiefU7iUJBfh8uKdk=; b=QplD6ea4i3+80iTaBNE5SjWJrn4brL1b8i/VkYQcogsuQNHwkfOKOJgFUN/6tP4tUH XuDbiDTgcJ/pNL7F+nZIZhULq33qGNWOa9EvPCZErjOHULOHdbQO8WapegCwLUGMg98k yQvKnGYxPj0wAlKQhoaAlGBfRYNvj9x8IffyAX7bunMWDIKeMICDyV0uLPgTushOAp1d krUhF9H5R7Fv4NWFLp+gztbp8TQp9WcFfnSDD+7RfqNPdus4qlsgci1IMpX/Gi0q7BpR m+uN/H9bbR9u4MQ1/Xh14A4vsJw7gMJ3GooAFZJ5mc/CpyVsSte4kp46Y/XnW1qUOf/O 985Q== MIME-Version: 1.0 Received: by 10.180.91.10 with SMTP id ca10mr1114846wib.17.1334006766217; Mon, 09 Apr 2012 14:26:06 -0700 (PDT) Sender: tomelite82@gmail.com Received: by 10.223.70.129 with HTTP; Mon, 9 Apr 2012 14:26:06 -0700 (PDT) In-Reply-To: <20120409065048.GA9391@FreeBSD.org> References: <201204021044.q32AiPng094511@svn.freebsd.org> <20120409065048.GA9391@FreeBSD.org> Date: Mon, 9 Apr 2012 14:26:06 -0700 X-Google-Sender-Auth: mt6ufRXj6W22Q_95wxP0XObfkz4 Message-ID: From: Qing Li To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233773 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 21:26:08 -0000 You missed my points. That "if" check as part of r201282 was meant to resolve a couple of issues related to PPP links, as noted in my commit message. In this PPP/proxy resolution context the error message applies, which is why I actually used the word "context" = in my previous reply. Your removing of that code will break the fixes committed in r201282. You don't need to try so hard to be pedantic ... When I say let's put in the code to support RFC 3012 "properly", I mean exactly that, i.e., put code in which makes RFC3012 work without breaking the previous fi= xes. And if there are other cases we need to cover, well, let's make sure we do. Do you have another definition of a "proper" fix ? I can't quite decipher the example you described in this email. Could you please give me a bit more information in a private email so I can= have a better look at the issue, and possibly make a suggestion for an alternati= ve patch ? --Qing 2012/4/8 Gleb Smirnoff : > =A0Qing, > > On Sun, Apr 08, 2012 at 10:41:11AM -0700, Qing Li wrote: > Q> This is not the right way to support RFC3021. > Q> > Q> The code you removed is used for checking against attempt at adding > Q> duplicate entry. > Q> Both the message and the code apply in that context. I tried to state > Q> clearly and concisely > Q> what r201282 was intended in solving and was verified by actual users > Q> who ran into the > Q> described problems. > > How does the message apply? > > On a 10.0/9.0 prior to my commit: > > #ifconfig em0 > em0: flags=3D8843 metric 0 mtu 15= 00 > =A0 =A0 =A0 =A0options=3D4219b > =A0 =A0 =A0 =A0ether f0:de:f1:6c:5b:fa > =A0 =A0 =A0 =A0inet x.x.x.111 netmask 0xffffffe0 broadcast x.x.x.127 > =A0 =A0 =A0 =A0nd6 options=3D29 > =A0 =A0 =A0 =A0media: Ethernet autoselect (100baseTX ) > =A0 =A0 =A0 =A0status: active > # arp -an > ? (x.x.x.97) at 00:00:5e:00:01:61 on em0 expires in 1198 seconds [etherne= t] > ? (x.x.x.101) at 00:e0:81:5a:22:49 on em0 expires in 618 seconds [etherne= t] > ? (x.x.x.111) at f0:de:f1:6c:5b:fa on em0 permanent [ethernet] > ? (x.x.x.116) at 00:26:18:6a:ea:02 on em0 expires in 1128 seconds [ethern= et] > # # arp -s 81.19.64.96 0:0:0:0:0:0 > set: proxy entry exists for non 802 device > > And how does this apply? Where is the proxy entry mentioned? Where is the > non 802 device? > > Look at the code before r201282 and see that the message was for absolute= ly > unrelated case. > > And here is behavior of 6.1-RELEASE, that is prior to your new ARP work: > > # ifconfig fxp0 > fxp0: flags=3D8843 mtu 1500 > =A0 =A0 =A0 =A0options=3D8 > =A0 =A0 =A0 =A0inet x.x.x.134 netmask 0xfffffffc broadcast x.x.x.135 > =A0 =A0 =A0 =A0ether 00:20:ed:6e:9c:f9 > =A0 =A0 =A0 =A0media: Ethernet autoselect (10baseT/UTP) > =A0 =A0 =A0 =A0status: active > # arp -s x.x.x.132 0:0:0:0:0:0 > set: can only proxy for x.x.x.132 > > As you see, the error message was an other one. > > Q> If we actually need to support RFC 3021, then better do it properly. > > What do you mean here under "properly"? RFC3021 says that network address > in a /31 network is a common address. Thus it should be possible to have > an ARP entry for it. > > Anyway this change isn't about RFC3021. A /31 network is just a case when= we > need to set ARP entry for network address. > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 21:58:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DEFC9106564A; Mon, 9 Apr 2012 21:58:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C02268FC12; Mon, 9 Apr 2012 21:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39LwwlW080208; Mon, 9 Apr 2012 21:58:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39LwwoH080206; Mon, 9 Apr 2012 21:58:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201204092158.q39LwwoH080206@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 9 Apr 2012 21:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234072 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 21:58:59 -0000 Author: jilles Date: Mon Apr 9 21:58:58 2012 New Revision: 234072 URL: http://svn.freebsd.org/changeset/base/234072 Log: Remove unused and wrong SA_PROC internal signal property. The SA_PROC signal property indicated whether each signal number is directed at a specific thread or at the process in general. However, that depends on how the signal was generated and not on the signal number. SA_PROC was not used. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Apr 9 21:29:58 2012 (r234071) +++ head/sys/kern/kern_sig.c Mon Apr 9 21:58:58 2012 (r234072) @@ -194,40 +194,39 @@ SYSCTL_INT(_kern, OID_AUTO, nodump_cored #define SA_IGNORE 0x10 /* ignore by default */ #define SA_CONT 0x20 /* continue if suspended */ #define SA_CANTMASK 0x40 /* non-maskable, catchable */ -#define SA_PROC 0x80 /* deliverable to any thread */ static int sigproptbl[NSIG] = { - SA_KILL|SA_PROC, /* SIGHUP */ - SA_KILL|SA_PROC, /* SIGINT */ - SA_KILL|SA_CORE|SA_PROC, /* SIGQUIT */ + SA_KILL, /* SIGHUP */ + SA_KILL, /* SIGINT */ + SA_KILL|SA_CORE, /* SIGQUIT */ SA_KILL|SA_CORE, /* SIGILL */ SA_KILL|SA_CORE, /* SIGTRAP */ SA_KILL|SA_CORE, /* SIGABRT */ - SA_KILL|SA_CORE|SA_PROC, /* SIGEMT */ + SA_KILL|SA_CORE, /* SIGEMT */ SA_KILL|SA_CORE, /* SIGFPE */ - SA_KILL|SA_PROC, /* SIGKILL */ + SA_KILL, /* SIGKILL */ SA_KILL|SA_CORE, /* SIGBUS */ SA_KILL|SA_CORE, /* SIGSEGV */ SA_KILL|SA_CORE, /* SIGSYS */ - SA_KILL|SA_PROC, /* SIGPIPE */ - SA_KILL|SA_PROC, /* SIGALRM */ - SA_KILL|SA_PROC, /* SIGTERM */ - SA_IGNORE|SA_PROC, /* SIGURG */ - SA_STOP|SA_PROC, /* SIGSTOP */ - SA_STOP|SA_TTYSTOP|SA_PROC, /* SIGTSTP */ - SA_IGNORE|SA_CONT|SA_PROC, /* SIGCONT */ - SA_IGNORE|SA_PROC, /* SIGCHLD */ - SA_STOP|SA_TTYSTOP|SA_PROC, /* SIGTTIN */ - SA_STOP|SA_TTYSTOP|SA_PROC, /* SIGTTOU */ - SA_IGNORE|SA_PROC, /* SIGIO */ + SA_KILL, /* SIGPIPE */ + SA_KILL, /* SIGALRM */ + SA_KILL, /* SIGTERM */ + SA_IGNORE, /* SIGURG */ + SA_STOP, /* SIGSTOP */ + SA_STOP|SA_TTYSTOP, /* SIGTSTP */ + SA_IGNORE|SA_CONT, /* SIGCONT */ + SA_IGNORE, /* SIGCHLD */ + SA_STOP|SA_TTYSTOP, /* SIGTTIN */ + SA_STOP|SA_TTYSTOP, /* SIGTTOU */ + SA_IGNORE, /* SIGIO */ SA_KILL, /* SIGXCPU */ SA_KILL, /* SIGXFSZ */ - SA_KILL|SA_PROC, /* SIGVTALRM */ - SA_KILL|SA_PROC, /* SIGPROF */ - SA_IGNORE|SA_PROC, /* SIGWINCH */ - SA_IGNORE|SA_PROC, /* SIGINFO */ - SA_KILL|SA_PROC, /* SIGUSR1 */ - SA_KILL|SA_PROC, /* SIGUSR2 */ + SA_KILL, /* SIGVTALRM */ + SA_KILL, /* SIGPROF */ + SA_IGNORE, /* SIGWINCH */ + SA_IGNORE, /* SIGINFO */ + SA_KILL, /* SIGUSR1 */ + SA_KILL, /* SIGUSR2 */ }; static void reschedule_signals(struct proc *p, sigset_t block, int flags); From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 22:32:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD157106566B; Mon, 9 Apr 2012 22:32:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 40C138FC12; Mon, 9 Apr 2012 22:32:56 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so192446lbb.13 for ; Mon, 09 Apr 2012 15:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uHEukkGe16XM2DcKtT/CsN2qfSqOuIqcg93jR5eXfV0=; b=aVR4TXU+nADctZYWq8gSYIvgYFAi/7LjqgADaKOCR9Qn8bDpbcn58JeNgwAQjsxYvQ ymYaD2iXAQIPPu/XIE6gZV+X8DND4N87vYUPOIMiS8vRJNYF9x0txEKEmrXnQ2FAqPZJ ZrlMIXAQgOaTL60dQXXn1Ubx+0lMKg+yXaiur+dwZ+6kMWWPGAWErS9My8BB5gzTTzhY oNATMqxZua8jZJJkys5Plfxv8YakQBrBsawp0zY3gJLv2GWh7a098FxydwQhKyO80h0S NxYDMHvg0Fu4SSVkMdT8n1iYZyItKjPyHETPHRartcKNHD1xlIFl8bhX3BVKf1dCT5hg T6Lw== MIME-Version: 1.0 Received: by 10.152.147.202 with SMTP id tm10mr13471172lab.49.1334010775083; Mon, 09 Apr 2012 15:32:55 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Mon, 9 Apr 2012 15:32:55 -0700 (PDT) In-Reply-To: <201204091435.31893.jhb@freebsd.org> References: <201204062119.q36LJTKR026564@svn.freebsd.org> <201204091314.20775.jhb@freebsd.org> <201204091435.31893.jhb@freebsd.org> Date: Mon, 9 Apr 2012 23:32:55 +0100 X-Google-Sender-Auth: YEsRMbsX__pAerU9VyNPCYt7Q0I Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, "Justin T. Gibbs" , src-committers@freebsd.org Subject: Re: svn commit: r233961 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 22:32:57 -0000 Il 09 aprile 2012 19:35, John Baldwin ha scritto: > On Monday, April 09, 2012 1:59:13 pm Attilio Rao wrote: >> Il 09 aprile 2012 18:14, John Baldwin ha scritto: >> > On Monday, April 09, 2012 12:58:07 pm Attilio Rao wrote: >> >> Il 09 aprile 2012 17:34, John Baldwin ha scritto: >> >> > On Monday, April 09, 2012 11:45:11 am Jaakko Heinonen wrote: >> >> >> >> >> >> Hi, >> >> >> >> >> >> On 2012-04-06, Justin T. Gibbs wrote: >> >> >> > =C2=A0 Fix interrupt load balancing regression, introduced in re= vision >> >> >> > =C2=A0 222813, that left all un-pinned interrupts assigned to CP= U 0. >> >> >> > >> >> >> > =C2=A0 sys/x86/x86/intr_machdep.c: >> >> >> > =C2=A0 =C2=A0 In intr_shuffle_irqs(), remove CPU_SETOF() call th= at initialized >> >> >> > =C2=A0 =C2=A0 the "intr_cpus" cpuset to only contain CPU0. >> >> >> > >> >> >> > =C2=A0 =C2=A0 This initialization is too late and nullifies the = results of calls >> >> >> > =C2=A0 =C2=A0 the intr_add_cpu() that occur much earlier in the = boot process. >> >> >> > =C2=A0 =C2=A0 Since "intr_cpus" is statically initialized to the= empty set, and >> >> >> > =C2=A0 =C2=A0 all processors, including the BSP, already add the= mselves to >> >> >> > =C2=A0 =C2=A0 "intr_cpus" no special initialization for the BSP = is necessary. >> >> >> >> >> >> My Pentium 4 system hangs on boot after this commit. These are the= last >> >> >> lines from a verbose boot: >> >> >> >> >> >> SMP: AP CPU #1 Launched! >> >> >> cpu1 AP: >> >> >> =C2=A0 =C2=A0 =C2=A0ID: 0x01000000 =C2=A0 VER: 0x00050014 LDR: 0x0= 0000000 DFR: 0xffffffff >> >> >> =C2=A0 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x= 000001ff >> >> >> =C2=A0 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x= 00010400 >> >> >> >> >> >> The system boots with r233960. >> >> >> >> >> >> Some information: >> >> >> >> >> >> CPU: Intel(R) Pentium(R) 4 CPU 2.60GHz (2605.96-MHz 686-class CPU) >> >> >> =C2=A0 Origin =3D "GenuineIntel" =C2=A0Id =3D 0xf29 =C2=A0Family = =3D f =C2=A0Model =3D 2 =C2=A0Stepping =3D >> >> >> 9 >> >> >> >> >> > > Features=3D0xbfebfbff >> >> >> =C2=A0 Features2=3D0x4400 >> >> >> real memory =C2=A0=3D 2147483648 (2048 MB) >> >> >> avail memory =3D 2085228544 (1988 MB) >> >> >> Event timer "LAPIC" quality 400 >> >> >> ACPI APIC Table: >> >> >> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs >> >> >> FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads >> >> >> =C2=A0cpu0 (BSP): APIC ID: =C2=A00 >> >> >> =C2=A0cpu1 (AP/HT): APIC ID: =C2=A01 >> >> > >> >> > I suspect in your case intr_add_cpu() is never called. =C2=A0I thin= k Attilio is not >> >> > correct in that it is not called for the BSP. >> >> > >> >> > Yes, it is not called for the BSP in set_interrupt_apic_ids(). =C2= =A0This used to >> >> > work because bit 0 was assigned statically. =C2=A0Also, in a UP mac= hine >> >> > set_interrupt_apic_ids() is not called at all. >> >> >> >> But why there is a front-end check for the BSP in set_interrupt_apic_= ids()? >> >> >> >> Anyway, I think a better fix would be like the attached patch. >> > >> > This would be fine. =C2=A0What I would really prefer is to not need th= e sysinit at >> > all and be able to do something like the original pre-cpuset code: >> > >> > static cpuset_t intr_cpus =3D CPU_INITIAILIZER(0); >> >> This is more difficult to do because it would require static array >> initializations and it would pollute too much the code with compile >> time, MAXCPU-dependant details. >> >> > Also, with the cpuset variant, I think we could remove the special cas= e check >> > for the BSP from set_apic_interrupt_ids() as it doesn't hurt to set it >> > multiple times. =C2=A0 IIRC, the pre-cpuset code kept a separate count= which is >> > why that would have been harmful. >> >> I'm not sure I follow, a separate count for what? > > The pre-cpuset code used a separate count IIRC. =C2=A0That is why duplica= te calls > to intr_add_cpu() used to be bad. =C2=A0However, they are no longer bad. > >> So do you consider the following patch as a real commit candidate? > > Yes, modulo a nit: > >> Index: sys/i386/i386/machdep.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/i386/i386/machdep.c =C2=A0 =C2=A0 (revisione 234064) >> +++ sys/i386/i386/machdep.c =C2=A0 =C2=A0 (copia locale) >> @@ -336,6 +336,11 @@ cpu_startup(dummy) >> =C2=A0#ifndef XEN >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 cpu_setregs(); >> =C2=A0#endif >> + >> + =C2=A0 =C2=A0 =C2=A0 /* >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0* Add BSP interrupt bitmask. >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0*/ >> + =C2=A0 =C2=A0 =C2=A0 intr_add_cpu(0); >> =C2=A0} > > I would make this a single line comment and say: > "Add BSP as an interrupt target." Please note that all the other comments in cpu_startup() is 3 lines even when single so I'd stick with that. I will change the wording as you wish though. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 22:41:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C678106564A; Mon, 9 Apr 2012 22:41:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8298FC12; Mon, 9 Apr 2012 22:41:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q39MfKZC081615; Mon, 9 Apr 2012 22:41:20 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q39MfJZn081610; Mon, 9 Apr 2012 22:41:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201204092241.q39MfJZn081610@svn.freebsd.org> From: Attilio Rao Date: Mon, 9 Apr 2012 22:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 22:41:20 -0000 Author: attilio Date: Mon Apr 9 22:41:19 2012 New Revision: 234074 URL: http://svn.freebsd.org/changeset/base/234074 Log: BSP is not added to the mask of valid target CPUs for interrupts in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not called in the !SMP case too. Fix this by: - Adding the BSP as an interrupt target directly in cpu_startup(). - Remove an obsolete optimization where the BSP are skipped in set_apic_interrupt_ids(). Reported by: jh Reviewed by: jhb MFC after: 3 days X-MFC: r233961 Pointy hat to: me Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Apr 9 22:01:43 2012 (r234073) +++ head/sys/amd64/amd64/machdep.c Mon Apr 9 22:41:19 2012 (r234074) @@ -295,6 +295,11 @@ cpu_startup(dummy) vm_pager_bufferinit(); cpu_setregs(); + + /* + * Add BSP as an interrupt target. + */ + intr_add_cpu(0); } /* Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Mon Apr 9 22:01:43 2012 (r234073) +++ head/sys/amd64/amd64/mp_machdep.c Mon Apr 9 22:41:19 2012 (r234074) @@ -785,8 +785,6 @@ init_secondary(void) * We tell the I/O APIC code about all the CPUs we want to receive * interrupts. If we don't want certain CPUs to receive IRQs we * can simply not tell the I/O APIC code about them in this function. - * We also do not tell it about the BSP since it tells itself about - * the BSP internally to work with UP kernels and on UP machines. */ static void set_interrupt_apic_ids(void) @@ -797,8 +795,6 @@ set_interrupt_apic_ids(void) apic_id = cpu_apic_ids[i]; if (apic_id == -1) continue; - if (cpu_info[apic_id].cpu_bsp) - continue; if (cpu_info[apic_id].cpu_disabled) continue; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Apr 9 22:01:43 2012 (r234073) +++ head/sys/i386/i386/machdep.c Mon Apr 9 22:41:19 2012 (r234074) @@ -336,6 +336,11 @@ cpu_startup(dummy) #ifndef XEN cpu_setregs(); #endif + + /* + * Add BSP as an interrupt target. + */ + intr_add_cpu(0); } /* Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Apr 9 22:01:43 2012 (r234073) +++ head/sys/i386/i386/mp_machdep.c Mon Apr 9 22:41:19 2012 (r234074) @@ -819,8 +819,6 @@ init_secondary(void) * We tell the I/O APIC code about all the CPUs we want to receive * interrupts. If we don't want certain CPUs to receive IRQs we * can simply not tell the I/O APIC code about them in this function. - * We also do not tell it about the BSP since it tells itself about - * the BSP internally to work with UP kernels and on UP machines. */ static void set_interrupt_apic_ids(void) @@ -831,8 +829,6 @@ set_interrupt_apic_ids(void) apic_id = cpu_apic_ids[i]; if (apic_id == -1) continue; - if (cpu_info[apic_id].cpu_bsp) - continue; if (cpu_info[apic_id].cpu_disabled) continue; From owner-svn-src-head@FreeBSD.ORG Mon Apr 9 23:09:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F11481065670; Mon, 9 Apr 2012 23:09:57 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 866BB8FC17; Mon, 9 Apr 2012 23:09:57 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q39N9oVT029068; Tue, 10 Apr 2012 01:09:50 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q39N9odk029067; Tue, 10 Apr 2012 01:09:50 +0200 (CEST) (envelope-from marius) Date: Tue, 10 Apr 2012 01:09:49 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20120409230949.GB68111@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201204092241.q39MfJZn081610@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 23:09:58 -0000 On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: > Author: attilio > Date: Mon Apr 9 22:41:19 2012 > New Revision: 234074 > URL: http://svn.freebsd.org/changeset/base/234074 > > Log: > BSP is not added to the mask of valid target CPUs for interrupts > in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not > called in the !SMP case too. > Fix this by: > - Adding the BSP as an interrupt target directly in cpu_startup(). > - Remove an obsolete optimization where the BSP are skipped in > set_apic_interrupt_ids(). > > Reported by: jh > Reviewed by: jhb > MFC after: 3 days > X-MFC: r233961 > Pointy hat to: me > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/mp_machdep.c > head/sys/i386/i386/machdep.c > head/sys/i386/i386/mp_machdep.c > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Mon Apr 9 22:01:43 2012 (r234073) > +++ head/sys/amd64/amd64/machdep.c Mon Apr 9 22:41:19 2012 (r234074) > @@ -295,6 +295,11 @@ cpu_startup(dummy) > vm_pager_bufferinit(); > > cpu_setregs(); > + > + /* > + * Add BSP as an interrupt target. > + */ > + intr_add_cpu(0); > } If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be here as well. Marius From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 00:04:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 191781065672; Tue, 10 Apr 2012 00:04:05 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id DEBAB8FC12; Tue, 10 Apr 2012 00:04:03 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so237922lbb.13 for ; Mon, 09 Apr 2012 17:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=P4moq2eu7AhRFwrUjAuy4IC2cq2Pct9Dibr9kGM95MY=; b=IqJaOWS2uCGhrETfIbdNfyhO6KHykB7PnRgOg3cyr6QqLu3fp84Qr7kiTduzt7M+Oq FahbiXXHLaTsCukk/BpnTYqKAwgklSAiPKCIByidsfRcLh0znTkAJgaGc0mzzyBlnf1v vMjhEom+//a1WXdCuyraorb11XV0WkQBky4drmfVDJa5PKVTHEpZeS59OkG9h6Rz34CA 4+wgnPwq8arCLe/ggGdBFSgibgZeNYNWMfQuHfxxwXql5WSe8hrZYt2SIy2VsIudbdBs aE0lvi6BIk9QfQVVAwseyuY9+DgRTvyH0qO5ZkK2e72BtrDc8SlBS3VKn3BEqTYgaZo7 2INw== MIME-Version: 1.0 Received: by 10.112.24.103 with SMTP id t7mr456544lbf.22.1334016236656; Mon, 09 Apr 2012 17:03:56 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Mon, 9 Apr 2012 17:03:56 -0700 (PDT) In-Reply-To: <20120409230949.GB68111@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> Date: Tue, 10 Apr 2012 01:03:56 +0100 X-Google-Sender-Auth: 8YfJ1fH7Q9XRbERoe0V_IE-cSpY Message-ID: From: Attilio Rao To: Marius Strobl , John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 00:04:05 -0000 Il 10 aprile 2012 00:09, Marius Strobl ha scrit= to: > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Mon Apr =C2=A09 22:41:19 2012 >> New Revision: 234074 >> URL: http://svn.freebsd.org/changeset/base/234074 >> >> Log: >> =C2=A0 BSP is not added to the mask of valid target CPUs for interrupts >> =C2=A0 in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() i= s not >> =C2=A0 called in the !SMP case too. >> =C2=A0 Fix this by: >> =C2=A0 - Adding the BSP as an interrupt target directly in cpu_startup()= . >> =C2=A0 - Remove an obsolete optimization where the BSP are skipped in >> =C2=A0 =C2=A0 set_apic_interrupt_ids(). >> >> =C2=A0 Reported by: =C2=A0 =C2=A0 =C2=A0 =C2=A0jh >> =C2=A0 Reviewed by: =C2=A0 =C2=A0 =C2=A0 =C2=A0jhb >> =C2=A0 MFC after: =C2=A03 days >> =C2=A0 X-MFC: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r233961 >> =C2=A0 Pointy hat to: =C2=A0 =C2=A0 =C2=A0me >> >> Modified: >> =C2=A0 head/sys/amd64/amd64/machdep.c >> =C2=A0 head/sys/amd64/amd64/mp_machdep.c >> =C2=A0 head/sys/i386/i386/machdep.c >> =C2=A0 head/sys/i386/i386/mp_machdep.c >> >> Modified: head/sys/amd64/amd64/machdep.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/amd64/amd64/machdep.c =C2=A0 =C2=A0Mon Apr =C2=A09 22:01:43= 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r234073) >> +++ head/sys/amd64/amd64/machdep.c =C2=A0 =C2=A0Mon Apr =C2=A09 22:41:19= 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r234074) >> @@ -295,6 +295,11 @@ cpu_startup(dummy) >> =C2=A0 =C2=A0 =C2=A0 vm_pager_bufferinit(); >> >> =C2=A0 =C2=A0 =C2=A0 cpu_setregs(); >> + >> + =C2=A0 =C2=A0 /* >> + =C2=A0 =C2=A0 =C2=A0* Add BSP as an interrupt target. >> + =C2=A0 =C2=A0 =C2=A0*/ >> + =C2=A0 =C2=A0 intr_add_cpu(0); >> =C2=A0} > > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be > here as well. You are right, sorry, I did forgot to test without SMP. I think we still need intr_add_cpu() on cpu_startup() because of the case smp_disabled =3D 1. I think the attached patch should make its dirty job, opinion? Thanks, Attilio Index: sys/i386/include/intr_machdep.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/i386/include/intr_machdep.h (revisione 234073) +++ sys/i386/include/intr_machdep.h (copia locale) @@ -131,9 +131,7 @@ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); void elcr_resume(void); void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP void intr_add_cpu(u_int cpu); -#endif int intr_add_handler(const char *name, int vector, driver_filter_t filt= er, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep= ); #ifdef SMP Index: sys/amd64/include/intr_machdep.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/amd64/include/intr_machdep.h (revisione 234073) +++ sys/amd64/include/intr_machdep.h (copia locale) @@ -140,9 +140,7 @@ int elcr_probe(void); enum intr_trigger elcr_read_trigger(u_int irq); void elcr_resume(void); void elcr_write_trigger(u_int irq, enum intr_trigger trigger); -#ifdef SMP void intr_add_cpu(u_int cpu); -#endif int intr_add_handler(const char *name, int vector, driver_filter_t filt= er, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); Index: sys/x86/x86/intr_machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/x86/x86/intr_machdep.c (revisione 234073) +++ sys/x86/x86/intr_machdep.c (copia locale) @@ -446,16 +446,34 @@ DB_SHOW_COMMAND(irqs, db_show_irqs) } #endif -#ifdef SMP /* * Support for balancing interrupt sources across CPUs. For now we just * allocate CPUs round-robin. */ static cpuset_t intr_cpus; +#ifdef SMP static int current_cpu; +#endif /* + * Add a CPU to our mask of valid CPUs that can be destinations of + * interrupts. + */ +void +intr_add_cpu(u_int cpu) +{ + + if (cpu >=3D MAXCPU) + panic("%s: Invalid CPU ID", __func__); + if (bootverbose) + printf("INTR: Adding CPU %u as a target\n", cpu); + + CPU_SET(cpu, &intr_cpus); +} + +#ifdef SMP +/* * Return the CPU that the next interrupt source should use. For now * this just returns the next local APIC according to round-robin. */ @@ -492,23 +510,6 @@ intr_bind(u_int vector, u_char cpu) } /* - * Add a CPU to our mask of valid CPUs that can be destinations of - * interrupts. - */ -void -intr_add_cpu(u_int cpu) -{ - - if (cpu >=3D MAXCPU) - panic("%s: Invalid CPU ID", __func__); - if (bootverbose) - printf("INTR: Adding local APIC %d as a target\n", - cpu_apic_ids[cpu]); - - CPU_SET(cpu, &intr_cpus); -} - -/* * Distribute all the interrupt sources among the available CPUs once the * AP's have been launched. */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 01:45:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD92106566C; Tue, 10 Apr 2012 01:45:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id F191F8FC18; Tue, 10 Apr 2012 01:45:27 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q3A1jIAP024420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Apr 2012 11:45:19 +1000 Date: Tue, 10 Apr 2012 11:45:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <20120409165335.GA13177@zim.MIT.EDU> Message-ID: <20120410111448.I1081@besplex.bde.org> References: <201203041400.q24E0WcS037398@svn.freebsd.org> <20120409165335.GA13177@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Tijl Coosemans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r232491 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 01:45:28 -0000 On Mon, 9 Apr 2012, David Schultz wrote: > On Sun, Mar 04, 2012, Tijl Coosemans wrote: >> Log: >> Copy amd64 float.h to x86 and merge with i386 float.h. Replace >> amd64/i386/pc98 float.h with stubs. > [...] >> --- head/sys/amd64/include/float.h Sun Mar 4 12:52:48 2012 (r232490, copy source) >> +++ head/sys/x86/include/float.h Sun Mar 4 14:00:32 2012 (r232491) >> @@ -42,7 +42,11 @@ __END_DECLS >> #define FLT_RADIX 2 /* b */ >> #define FLT_ROUNDS __flt_rounds() >> #if __ISO_C_VISIBLE >= 1999 >> +#ifdef _LP64 >> #define FLT_EVAL_METHOD 0 /* no promotions */ >> +#else >> +#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */ >> +#endif >> #define DECIMAL_DIG 21 /* max precision in decimal digits */ >> #endif > > The implication of this code is that FLT_EVAL_METHOD depends on > the size of a long, which it does not. Instead, it depends on > whether SSE2 support is guaranteed to be present. If anything, > the test should be something like #ifndef __i386__. Actually, it depends on whether both SSE1 and SSE2 support are guaranteed to be used. The i386 ifdef is wrong too (as is the old fixed value for i386), since clang with SSE support breaks the abstract i386 machine by actually using SSE; with gcc, this breakage is under control of the option -mfpmath=unit which defaults to unit=i387. Also, float_t and double_t must match FLT_EVAL_METHOD. I use the following hack to work around the clang breakage in libm: % Index: math.h % =================================================================== % RCS file: /home/ncvs/src/lib/msun/src/math.h,v % retrieving revision 1.82 % diff -u -2 -r1.82 math.h % --- math.h 12 Nov 2011 19:55:48 -0000 1.82 % +++ math.h 4 Jan 2012 05:09:51 -0000 % @@ -125,4 +130,10 @@ % : __signbitl(x)) % % +#ifdef __SSE_MATH__ % +#define __float_t float % +#endif % +#ifdef __SSE2_MATH__ % +#define __double_t double % +#endif % typedef __double_t double_t; % typedef __float_t float_t; I forgot to hack on FLT_EVAL_METHOD similarly. The fixed value of (-1) for i386 is sort of fail-safe, since it says that the evaluation method is indeterminate, so the code must assume the worst. The normal i386 types for float_t and double_t are also sort of fail-safe, since they are larger than necessary. They just cause pessimal code. So would FLT_EVAL_METHOD = -1, and I only hacked on the types since my tests only cover the pessimizations for the types. Note that the compiler builtin __FLT_EVAL_METHOD is unusable, since its value is almost always wrong. With gcc, it is wrong by default (2) but is changed correctly to 0 by -mfpmath=sse. With clang, it is wrong by default (0), but becomes correct with SSE1 and SSE2. With only SSE1, there are even more possibilities for the float evaluation method, but doubles must be evaluated using the i387 so FLT_EVAL_METHOD must remain as -1. Examples: - clang -march=athlon-xp. Athlon-XP only has SSE1, and clang evaluates float expressions using SSE1 but double expressions using i387. This matches float_t = float and double_t = long double given by the above. FLT_EVAL_METHOD = -1 remains correct. - similarly for gcc -march=athlon-xp -mfpmath=sse. - clang -march=athlon64. Athlon64 has both SSE1 and SSE2, and clang evaluates both float and double expressions using SSE*. This matches float_t = float and double_t = double given by the above. FLT_EVAL_METHOD = -1 is now wrong. - similarly for gcc -march=athlon64 -mfpmath=sse. SSE* use can also be controlled by -msse[12] (instead of march), but -mfpmath doesn't distinguish between SSE1 and SSE2, so there seems to be no way to use SSE2 generally and SSE1 for FP without also using SSE2 for FP. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 01:49:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0101F1065670; Tue, 10 Apr 2012 01:49:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81BB8FC16; Tue, 10 Apr 2012 01:49:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A1nV0N094376; Tue, 10 Apr 2012 01:49:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A1nVBc094374; Tue, 10 Apr 2012 01:49:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204100149.q3A1nVBc094374@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Apr 2012 01:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234077 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 01:49:32 -0000 Author: eadler Date: Tue Apr 10 01:49:31 2012 New Revision: 234077 URL: http://svn.freebsd.org/changeset/base/234077 Log: Update examples with corrections from the author PR: ports/160689 Submitted by: mickael.maillot@gmail.com Approved by: cperciva (implicit) MFC after: 1 days (with r233429) Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Tue Apr 10 01:26:58 2012 (r234076) +++ head/share/examples/csh/dot.cshrc Tue Apr 10 01:49:31 2012 (r234077) @@ -29,11 +29,11 @@ complete service 'c/-/(e l r v)/' 'p/1 complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' -complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@" +complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@' complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1A +alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ clean-packages delete-build-only delete-packages force-config help \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 05:42:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6D941065740; Tue, 10 Apr 2012 05:42:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91C268FC1E; Tue, 10 Apr 2012 05:42:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A5gnKd005955; Tue, 10 Apr 2012 05:42:49 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A5gn56005953; Tue, 10 Apr 2012 05:42:49 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201204100542.q3A5gn56005953@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 10 Apr 2012 05:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234084 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 05:42:49 -0000 Author: glebius Date: Tue Apr 10 05:42:48 2012 New Revision: 234084 URL: http://svn.freebsd.org/changeset/base/234084 Log: CARP should be capable to run on if_bridge(4). Unfortunately, this commit is not enough to enable CARP operation on if_bridge(4), because the latter doesn't handle or even initialize its ifp->if_link_state. Reported by: Alexander Lunev Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Tue Apr 10 02:29:11 2012 (r234083) +++ head/sys/netinet/ip_carp.c Tue Apr 10 05:42:48 2012 (r234084) @@ -1384,6 +1384,7 @@ carp_output(struct ifnet *ifp, struct mb /* Set the source MAC address to the Virtual Router MAC Address. */ switch (ifp->if_type) { case IFT_ETHER: + case IFT_BRIDGE: case IFT_L2VLAN: { struct ether_header *eh; @@ -1604,6 +1605,7 @@ carp_ioctl(struct ifreq *ifr, u_long cmd switch (ifp->if_type) { case IFT_ETHER: case IFT_L2VLAN: + case IFT_BRIDGE: case IFT_FDDI: case IFT_ISO88025: break; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 06:09:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEC1D106566C; Tue, 10 Apr 2012 06:09:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 705E48FC0C; Tue, 10 Apr 2012 06:09:03 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q3A6920v034657; Tue, 10 Apr 2012 10:09:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q3A692MB034656; Tue, 10 Apr 2012 10:09:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Apr 2012 10:09:02 +0400 From: Gleb Smirnoff To: Qing Li Message-ID: <20120410060902.GI9391@glebius.int.ru> References: <201204021044.q32AiPng094511@svn.freebsd.org> <20120409065048.GA9391@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r233773 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 06:09:04 -0000 Qing, On Mon, Apr 09, 2012 at 02:26:06PM -0700, Qing Li wrote: Q> You missed my points. Q> Q> That "if" check as part of r201282 was meant to resolve a couple of Q> issues related Q> to PPP links, as noted in my commit message. In this PPP/proxy Q> resolution context Q> the error message applies, which is why I actually used the word "context" in my Q> previous reply. Q> Q> Your removing of that code will break the fixes committed in r201282. Can you please provide example of PPP link configuration, that was broken by r233773. Q> I can't quite decipher the example you described in this email. Okay, here it is more verbose: My list of interfaces: # ifconfig -l em0 wlan0 iwn0 lo0 My only configured interface: # ifconfig em0 em0: flags=8843 metric 0 mtu 1500 š š š šoptions=4219b š š š šether f0:de:f1:6c:5b:fa š š š šinet x.x.x.111 netmask 0xffffffe0 broadcast x.x.x.127 š š š šnd6 options=29 š š š šmedia: Ethernet autoselect (100baseTX ) š š š šstatus: active My arp table: # arp -an ? (x.x.x.97) at 00:00:5e:00:01:61 on em0 expires in 1198 seconds [ethernet] ? (x.x.x.101) at 00:e0:81:5a:22:49 on em0 expires in 618 seconds [ethernet] ? (x.x.x.111) at f0:de:f1:6c:5b:fa on em0 permanent [ethernet] ? (x.x.x.116) at 00:26:18:6a:ea:02 on em0 expires in 1128 seconds [ethernet] Now I'm trying to set ARP entry for network address. And I get error: # arp -s 81.19.64.96 0:0:0:0:0:0 set: proxy entry exists for non 802 device Questions: where is the "proxy entry" mentioned in the above ARP table? I don't see one. Where is the "non 802 device" in the above list of my interfaces? Q> Could you please give me a bit more information in a private email so I can have Q> a better look at the issue, and possibly make a suggestion for an alternative Q> patch ? I have mailed you 8 March 2012 with msg-id <20120308173642.GW13644@glebius.int.ru>, and didn't got any reply since. That's why I proceeded with commit. P.S. And please, can you avoid top quoting when discussing on technical FreeBSD lists? This isn't my personal wish but explicitly documented etiquette: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/mailing-list-faq/etiquette.html#ETIQUETTE-REPLYING -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 06:25:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67ABA106564A; Tue, 10 Apr 2012 06:25:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5290F8FC17; Tue, 10 Apr 2012 06:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A6PC4T007310; Tue, 10 Apr 2012 06:25:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A6PChq007308; Tue, 10 Apr 2012 06:25:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204100625.q3A6PChq007308@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 06:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234085 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 06:25:12 -0000 Author: adrian Date: Tue Apr 10 06:25:11 2012 New Revision: 234085 URL: http://svn.freebsd.org/changeset/base/234085 Log: * Since the API changed along the -CURRENT path (december 2011), add a FreeBSD_version check. It should work fine for compiling on -HEAD, 9.x and 8.x. * Conditionally compile the 11n options only when 11n is enabled. The above changes allow the ath(4) driver to compile and run on 8.1-RELEASE (Hi old PC-BSD!) but with the 11n stuff disabled. I've done a test against the net80211 and tools in 8.1-RELEASE. The NIC used in testing is the AR2427 in an EEEPC. Just to be clear - this change is to allow the -HEAD ath/hal/rate code to run on 9.x _and_ 8.x with no source changes. However, when running on earlier kernels, it should only be used for legacy mode. (Don't define ATH_ENABLE_11N.) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 10 05:42:48 2012 (r234084) +++ head/sys/dev/ath/if_ath.c Tue Apr 10 06:25:11 2012 (r234085) @@ -131,10 +131,17 @@ __FBSDID("$FreeBSD$"); */ CTASSERT(ATH_BCBUF <= 8); +#if __FreeBSD_version > 1000003 static struct ieee80211vap *ath_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); +#else +static struct ieee80211vap *ath_vap_create(struct ieee80211com *, + const char [IFNAMSIZ], int, int, int, + const uint8_t [IEEE80211_ADDR_LEN], + const uint8_t [IEEE80211_ADDR_LEN]); +#endif static void ath_vap_delete(struct ieee80211vap *); static void ath_init(void *); static void ath_stop_locked(struct ifnet *); @@ -200,7 +207,9 @@ static void ath_chan_change(struct ath_s static void ath_scan_start(struct ieee80211com *); static void ath_scan_end(struct ieee80211com *); static void ath_set_channel(struct ieee80211com *); +#ifdef ATH_ENABLE_11N static void ath_update_chw(struct ieee80211com *); +#endif /* ATH_ENABLE_11N */ static void ath_calibrate(void *); static int ath_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void ath_setup_stationkey(struct ieee80211_node *); @@ -804,8 +813,7 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_scan_start = ath_scan_start; ic->ic_scan_end = ath_scan_end; ic->ic_set_channel = ath_set_channel; - ic->ic_update_chw = ath_update_chw; - +#ifdef ATH_ENABLE_11N /* 802.11n specific - but just override anyway */ sc->sc_addba_request = ic->ic_addba_request; sc->sc_addba_response = ic->ic_addba_response; @@ -819,6 +827,9 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_addba_stop = ath_addba_stop; ic->ic_bar_response = ath_bar_response; + ic->ic_update_chw = ath_update_chw; +#endif /* ATH_ENABLE_11N */ + ieee80211_radiotap_attach(ic, &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), ATH_TX_RADIOTAP_PRESENT, @@ -955,11 +966,18 @@ assign_bslot(struct ath_softc *sc) return free; } +#if __FreeBSD_version > 1000003 static struct ieee80211vap * ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) +#else +static struct ieee80211vap * +ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, + int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac0[IEEE80211_ADDR_LEN]) +#endif { struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_vap *avp; @@ -5766,6 +5784,7 @@ ath_scan_end(struct ieee80211com *ic) sc->sc_curaid); } +#ifdef ATH_ENABLE_11N /* * For now, just do a channel change. * @@ -5790,6 +5809,7 @@ ath_update_chw(struct ieee80211com *ic) DPRINTF(sc, ATH_DEBUG_STATE, "%s: called\n", __func__); ath_set_channel(ic); } +#endif /* ATH_ENABLE_11N */ static void ath_set_channel(struct ieee80211com *ic) From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 06:52:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC9C106566B; Tue, 10 Apr 2012 06:52:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 977448FC08; Tue, 10 Apr 2012 06:52:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A6qLeY008182; Tue, 10 Apr 2012 06:52:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A6qLkx008180; Tue, 10 Apr 2012 06:52:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201204100652.q3A6qLkx008180@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 10 Apr 2012 06:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234086 - head/sys/dev/sfxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 06:52:21 -0000 Author: glebius Date: Tue Apr 10 06:52:21 2012 New Revision: 234086 URL: http://svn.freebsd.org/changeset/base/234086 Log: M_DONTWAIT is a flag from historical mbuf(9) allocator, not malloc(9) or uma(9) flag. Modified: head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Tue Apr 10 06:25:11 2012 (r234085) +++ head/sys/dev/sfxge/sfxge_rx.c Tue Apr 10 06:52:21 2012 (r234086) @@ -176,10 +176,10 @@ static inline struct mbuf *sfxge_rx_allo /* Allocate mbuf structure */ args.flags = M_PKTHDR; args.type = MT_DATA; - m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_DONTWAIT); + m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, &args, M_NOWAIT); /* Allocate (and attach) packet buffer */ - if (m && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_DONTWAIT)) { + if (m && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { uma_zfree(zone_mbuf, m); m = NULL; } @@ -586,7 +586,7 @@ static void sfxge_lro_new_conn(struct sf c = TAILQ_FIRST(&st->free_conns); TAILQ_REMOVE(&st->free_conns, c, link); } else { - c = malloc(sizeof(*c), M_SFXGE, M_DONTWAIT); + c = malloc(sizeof(*c), M_SFXGE, M_NOWAIT); if (c == NULL) return; c->mbuf = NULL; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 06:52:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519341065680; Tue, 10 Apr 2012 06:52:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C12B8FC12; Tue, 10 Apr 2012 06:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A6qeXn008226; Tue, 10 Apr 2012 06:52:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A6qeCU008224; Tue, 10 Apr 2012 06:52:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201204100652.q3A6qeCU008224@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 10 Apr 2012 06:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234087 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 06:52:40 -0000 Author: glebius Date: Tue Apr 10 06:52:39 2012 New Revision: 234087 URL: http://svn.freebsd.org/changeset/base/234087 Log: M_DONTWAIT is a flag from historical mbuf(9) allocator, not malloc(9) or uma(9) flag. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Apr 10 06:52:21 2012 (r234086) +++ head/sys/netinet/in.c Tue Apr 10 06:52:39 2012 (r234087) @@ -1279,7 +1279,7 @@ in_lltable_new(const struct sockaddr *l3 { struct in_llentry *lle; - lle = malloc(sizeof(struct in_llentry), M_LLTABLE, M_DONTWAIT | M_ZERO); + lle = malloc(sizeof(struct in_llentry), M_LLTABLE, M_NOWAIT | M_ZERO); if (lle == NULL) /* NB: caller generates msg */ return NULL; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 07:11:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A231065670; Tue, 10 Apr 2012 07:11:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030538FC15; Tue, 10 Apr 2012 07:11:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A7BXkt008891; Tue, 10 Apr 2012 07:11:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A7BXJt008888; Tue, 10 Apr 2012 07:11:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204100711.q3A7BXJt008888@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 07:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234088 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 07:11:34 -0000 Author: adrian Date: Tue Apr 10 07:11:33 2012 New Revision: 234088 URL: http://svn.freebsd.org/changeset/base/234088 Log: Squirrel away the SYNC interrupt in case we're doing interrupt debugging. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Apr 10 06:52:39 2012 (r234087) +++ head/sys/dev/ath/ath_hal/ah.h Tue Apr 10 07:11:33 2012 (r234088) @@ -815,6 +815,7 @@ struct ath_hal { uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ uint32_t ah_intrstate[8]; /* last int state */ + uint32_t ah_syncstate; /* last sync intr state */ HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Apr 10 06:52:39 2012 (r234087) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Tue Apr 10 07:11:33 2012 (r234088) @@ -75,6 +75,7 @@ ar5416GetPendingInterrupts(struct ath_ha * Blank the interrupt debugging area regardless. */ bzero(&ah->ah_intrstate, sizeof(ah->ah_intrstate)); + ah->ah_syncstate = 0; #endif /* @@ -89,6 +90,9 @@ ar5416GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR); else isr = 0; +#ifdef AH_INTERRUPT_DEBUGGING + ah->ah_syncstate = +#endif o_sync_cause = sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE); sync_cause &= AR_INTR_SYNC_DEFAULT; *masked = 0; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 07:16:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B550106564A; Tue, 10 Apr 2012 07:16:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 761B78FC08; Tue, 10 Apr 2012 07:16:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A7GTAh009116; Tue, 10 Apr 2012 07:16:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A7GTB4009114; Tue, 10 Apr 2012 07:16:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204100716.q3A7GTB4009114@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 07:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234089 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 07:16:29 -0000 Author: adrian Date: Tue Apr 10 07:16:28 2012 New Revision: 234089 URL: http://svn.freebsd.org/changeset/base/234089 Log: Revert this for now - it may work for -8 and -9 and -HEAD, but not "-HEAD driver + net80211 on -9 kernel." I'll figure this out at some later stage. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 10 07:11:33 2012 (r234088) +++ head/sys/dev/ath/if_ath.c Tue Apr 10 07:16:28 2012 (r234089) @@ -131,17 +131,10 @@ __FBSDID("$FreeBSD$"); */ CTASSERT(ATH_BCBUF <= 8); -#if __FreeBSD_version > 1000003 static struct ieee80211vap *ath_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); -#else -static struct ieee80211vap *ath_vap_create(struct ieee80211com *, - const char [IFNAMSIZ], int, int, int, - const uint8_t [IEEE80211_ADDR_LEN], - const uint8_t [IEEE80211_ADDR_LEN]); -#endif static void ath_vap_delete(struct ieee80211vap *); static void ath_init(void *); static void ath_stop_locked(struct ifnet *); @@ -966,18 +959,11 @@ assign_bslot(struct ath_softc *sc) return free; } -#if __FreeBSD_version > 1000003 static struct ieee80211vap * ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac0[IEEE80211_ADDR_LEN]) -#else -static struct ieee80211vap * -ath_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, - int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], - const uint8_t mac0[IEEE80211_ADDR_LEN]) -#endif { struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_vap *avp; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 07:23:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D886106566C; Tue, 10 Apr 2012 07:23:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3C18FC08; Tue, 10 Apr 2012 07:23:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A7Nb4e009407; Tue, 10 Apr 2012 07:23:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A7NbA4009402; Tue, 10 Apr 2012 07:23:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204100723.q3A7NbA4009402@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 07:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234090 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 07:23:38 -0000 Author: adrian Date: Tue Apr 10 07:23:37 2012 New Revision: 234090 URL: http://svn.freebsd.org/changeset/base/234090 Log: Squirrel away SYNC interrupt debugging if it's enabled in the HAL. Bus errors will show up as various SYNC interrupts which will be passed back up to ath_intr(). Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 10 07:16:28 2012 (r234089) +++ head/sys/dev/ath/if_ath.c Tue Apr 10 07:23:37 2012 (r234090) @@ -1495,6 +1495,15 @@ ath_intr(void *arg) ah->ah_intrstate[3], ah->ah_intrstate[6]); #endif + + /* Squirrel away SYNC interrupt debugging */ + if (ah->ah_syncstate != 0) { + int i; + for (i = 0; i < 32; i++) + if (ah->ah_syncstate & (i << i)) + sc->sc_intr_stats.sync_intr[i]++; + } + status &= sc->sc_imask; /* discard unasked for bits */ /* Short-circuit un-handled interrupts */ @@ -6476,8 +6485,11 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, ifr->ifr_data, sizeof (sc->sc_stats)); case SIOCZATHSTATS: error = priv_check(curthread, PRIV_DRIVER); - if (error == 0) + if (error == 0) { memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + memset(&sc->sc_intr_stats, 0, + sizeof(sc->sc_intr_stats)); + } break; #ifdef ATH_DIAGAPI case SIOCGATHDIAG: Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Apr 10 07:16:28 2012 (r234089) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Apr 10 07:23:37 2012 (r234090) @@ -655,6 +655,7 @@ ath_sysctl_clearstats(SYSCTL_HANDLER_ARG return 0; /* Not clearing the stats is still valid */ memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); memset(&sc->sc_aggr_stats, 0, sizeof(sc->sc_aggr_stats)); + memset(&sc->sc_intr_stats, 0, sizeof(sc->sc_intr_stats)); val = 0; return 0; @@ -677,6 +678,26 @@ ath_sysctl_stats_attach_rxphyerr(struct } } +static void +ath_sysctl_stats_attach_intr(struct ath_softc *sc, + struct sysctl_oid_list *parent) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + int i; + char sn[8]; + + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "sync_intr", + CTLFLAG_RD, NULL, "Sync interrupt statistics"); + child = SYSCTL_CHILDREN(tree); + for (i = 0; i < 32; i++) { + snprintf(sn, sizeof(sn), "%d", i); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, + &sc->sc_intr_stats.sync_intr[i], 0, ""); + } +} + void ath_sysctl_stats_attach(struct ath_softc *sc) { @@ -904,6 +925,9 @@ ath_sysctl_stats_attach(struct ath_softc /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); + + /* Attach the interrupt statistics array */ + ath_sysctl_stats_attach_intr(sc, child); } /* Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue Apr 10 07:16:28 2012 (r234089) +++ head/sys/dev/ath/if_athioctl.h Tue Apr 10 07:23:37 2012 (r234090) @@ -46,6 +46,10 @@ struct ath_tx_aggr_stats { u_int32_t aggr_rts_aggr_limited; }; +struct ath_intr_stats { + u_int32_t sync_intr[32]; +}; + struct ath_stats { u_int32_t ast_watchdog; /* device reset by watchdog */ u_int32_t ast_hardware; /* fatal hardware error interrupts */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Apr 10 07:16:28 2012 (r234089) +++ head/sys/dev/ath/if_athvar.h Tue Apr 10 07:23:37 2012 (r234090) @@ -349,6 +349,7 @@ struct ath_softc { struct ifnet *sc_ifp; /* interface common */ struct ath_stats sc_stats; /* interface statistics */ struct ath_tx_aggr_stats sc_aggr_stats; + struct ath_intr_stats sc_intr_stats; int sc_debug; int sc_nvaps; /* # vaps */ int sc_nstavaps; /* # station vaps */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 07:27:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 870B61065799; Tue, 10 Apr 2012 07:27:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 720B68FC0C; Tue, 10 Apr 2012 07:27:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A7RhbD009590; Tue, 10 Apr 2012 07:27:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A7Rhhe009588; Tue, 10 Apr 2012 07:27:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204100727.q3A7Rhhe009588@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 07:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234091 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 07:27:43 -0000 Author: adrian Date: Tue Apr 10 07:27:42 2012 New Revision: 234091 URL: http://svn.freebsd.org/changeset/base/234091 Log: Blank the aggregate stats whenever the zero ioctl is called. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 10 07:23:37 2012 (r234090) +++ head/sys/dev/ath/if_ath.c Tue Apr 10 07:27:42 2012 (r234091) @@ -6487,6 +6487,8 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, error = priv_check(curthread, PRIV_DRIVER); if (error == 0) { memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + memset(&sc->sc_aggr_stats, 0, + sizeof(sc->sc_aggr_stats)); memset(&sc->sc_intr_stats, 0, sizeof(sc->sc_intr_stats)); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 09:27:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B867106564A; Tue, 10 Apr 2012 09:27:42 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF4228FC12; Tue, 10 Apr 2012 09:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3A9Rfcn013404; Tue, 10 Apr 2012 09:27:41 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3A9Rf3r013400; Tue, 10 Apr 2012 09:27:41 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201204100927.q3A9Rf3r013400@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 10 Apr 2012 09:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234093 - in head/etc: defaults rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 09:27:42 -0000 Author: stas Date: Tue Apr 10 09:27:41 2012 New Revision: 234093 URL: http://svn.freebsd.org/changeset/base/234093 Log: - Add rc.d script for kfd, kerberos forwarded tickets daemon. Added: head/etc/rc.d/kfd (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Apr 10 07:38:58 2012 (r234092) +++ head/etc/defaults/rc.conf Tue Apr 10 09:27:41 2012 (r234093) @@ -297,6 +297,8 @@ kadmind5_server_enable="NO" # Run kadmin kadmind5_server="/usr/libexec/kadmind" # path to kerberos 5 admin daemon kpasswdd_server_enable="NO" # Run kpasswdd (or NO) kpasswdd_server="/usr/libexec/kpasswdd" # path to kerberos 5 passwd daemon +kfd_server_enable="NO" # Run kfd (or NO) +kfd_server="/usr/libexec/kfd" # path to kerberos 5 kfd daemon gssd_enable="NO" # Run the gssd daemon (or NO). gssd_flags="" # Flags for gssd. Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Apr 10 07:38:58 2012 (r234092) +++ head/etc/rc.d/Makefile Tue Apr 10 09:27:41 2012 (r234093) @@ -66,6 +66,7 @@ FILES= DAEMON \ kadmind \ kerberos \ keyserv \ + kfd \ kld \ kldxref \ kpasswdd \ Added: head/etc/rc.d/kfd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/kfd Tue Apr 10 09:27:41 2012 (r234093) @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: kfd +# BEFORE: DAEMON + +. /etc/rc.subr + +name="kfd" +load_rc_config $name +rcvar="kfd_server_enable" +unset start_cmd +command="${kfd_server}" +kfd_flags="-i" +command_args="&" + +run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 11:25:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03280106564A; Tue, 10 Apr 2012 11:25:19 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from mailfilter13.ihug.co.nz (mailfilter13.ihug.co.nz [203.109.136.13]) by mx1.freebsd.org (Postfix) with ESMTP id CDA2C8FC08; Tue, 10 Apr 2012 11:25:17 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=1 a=DE6nE7g822sA:10 a=cp3ifX0mlxSVeic/PLyttg==:17 a=6I5d2MoRAAAA:8 a=Yl2uaO52LxaW8h47w5sA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=v13WaKXysxbrfLncQysA:9 a=1Jlk8L_6LmbFvwvJMxUA:7 a=qB_eRIhOqYR7xcWE:21 a=UHUKzUWpteEMcZZc:21 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAFoYhE/LdqpC/2dsb2JhbABDuSiBCIIJAQEEAVYjBQsIAw4KLjkeBhOICQS7EYsdhUQEjmyGfwGQNoJ8gT8 X-IronPort-AV: E=Sophos;i="4.75,398,1330858800"; d="scan'208";a="215459796" Received: from 203-118-170-66.adsl.ihug.co.nz (HELO localhost) ([203.118.170.66]) by cust.filter3.content.vf.net.nz with SMTP; 10 Apr 2012 23:24:51 +1200 Date: Tue, 10 Apr 2012 23:24:39 +1200 From: Andrew Turner To: Juli Mallett Message-ID: <20120410232439.5e4cd59f@fubar.geek.nz> In-Reply-To: References: <201204080436.q384aRXS093116@svn.freebsd.org> <20120408164521.55aecdd1@fubar.geek.nz> <20120409161453.29d1f3de@fubar.geek.nz> <20120409204416.77f61674@fubar.geek.nz> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Yx0CjEwxBALbXmKAVJOZT9X" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234014 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 11:25:19 -0000 --MP_/Yx0CjEwxBALbXmKAVJOZT9X Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 9 Apr 2012 09:39:23 -0700 Juli Mallett wrote: > On Mon, Apr 9, 2012 at 01:44, Andrew Turner > wrote: > > How does the attached (untested) patch look. It explicitly loads > > ARM_TP_ADDRESS into a r0 to ensure r1-3 are not touched. > > The example file I pointed at was for the kernel, where the > LOCORE-related ifdefs (almost) make sense, but for userland you > probably want to conditionalize on __ASSEMBLER__. How does the attached patch look? I've updated it to use __ASSEMBLER__ where required. Andrew --MP_/Yx0CjEwxBALbXmKAVJOZT9X Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=arm_tls.patch Index: lib/libc/arm/gen/Makefile.inc =================================================================== --- lib/libc/arm/gen/Makefile.inc (revision 234093) +++ lib/libc/arm/gen/Makefile.inc (working copy) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Index: lib/libc/arm/gen/__aeabi_read_tp.S =================================================================== --- lib/libc/arm/gen/__aeabi_read_tp.S (revision 0) +++ lib/libc/arm/gen/__aeabi_read_tp.S (working copy) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Andrew Turner + * 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 +__FBSDID("$FreeBSD$"); + +#include + +ENTRY(__aeabi_read_tp) + ldr r0, .Larm_tp_address + ldr r0, [r0] + RET + +.Larm_tp_address: + .word ARM_TP_ADDRESS + Index: lib/libc/arm/gen/__aeabi_read_tp.c =================================================================== --- lib/libc/arm/gen/__aeabi_read_tp.c (revision 234093) +++ lib/libc/arm/gen/__aeabi_read_tp.c (working copy) @@ -1,45 +0,0 @@ -/*- - * Copyright (c) 2012 Oleksandr Tymoshenko - * Copyright (c) 2012 Andrew Turner - * 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. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include - -#include "machine/sysarch.h" - -void * -__aeabi_read_tp() -{ - void *_tp; - - asm("ldr %0, [%1]\n" : "=r"(_tp) : "r"(ARM_TP_ADDRESS)); - - return _tp; -} Index: sys/arm/include/sysarch.h =================================================================== --- sys/arm/include/sysarch.h (revision 234093) +++ sys/arm/include/sysarch.h (working copy) @@ -55,6 +55,7 @@ #define ARM_RAS_END (ARM_TP_ADDRESS + 8) #ifndef LOCORE +#ifndef __ASSEMBLER__ #include @@ -85,6 +86,7 @@ __END_DECLS #endif +#endif /* __ASSEMBLER__ */ #endif /* LOCORE */ #endif /* !_ARM_SYSARCH_H_ */ Index: sys/arm/include/armreg.h =================================================================== --- sys/arm/include/armreg.h (revision 234093) +++ sys/arm/include/armreg.h (working copy) @@ -316,8 +316,13 @@ /* * Address of the vector page, low and high versions. */ +#ifndef __ASSEMBLER__ #define ARM_VECTORS_LOW 0x00000000U #define ARM_VECTORS_HIGH 0xffff0000U +#else +#define ARM_VECTORS_LOW 0 +#define ARM_VECTORS_HIGH 0xffff0000 +#endif /* * ARM Instructions --MP_/Yx0CjEwxBALbXmKAVJOZT9X-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 11:41:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86065106566C; Tue, 10 Apr 2012 11:41:23 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 11E1C8FC14; Tue, 10 Apr 2012 11:41:22 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q3ABfI8k032362; Tue, 10 Apr 2012 13:41:19 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q3ABfIJ7032361; Tue, 10 Apr 2012 13:41:18 +0200 (CEST) (envelope-from marius) Date: Tue, 10 Apr 2012 13:41:18 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20120410114118.GB93449@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 11:41:23 -0000 On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: > Il 10 aprile 2012 00:09, Marius Strobl ha scritto: > > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: > >> Author: attilio > >> Date: Mon Apr ??9 22:41:19 2012 > >> New Revision: 234074 > >> URL: http://svn.freebsd.org/changeset/base/234074 > >> > >> Log: > >> ?? BSP is not added to the mask of valid target CPUs for interrupts > >> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not > >> ?? called in the !SMP case too. > >> ?? Fix this by: > >> ?? - Adding the BSP as an interrupt target directly in cpu_startup(). > >> ?? - Remove an obsolete optimization where the BSP are skipped in > >> ?? ?? set_apic_interrupt_ids(). > >> > >> ?? Reported by: ?? ?? ?? ??jh > >> ?? Reviewed by: ?? ?? ?? ??jhb > >> ?? MFC after: ??3 days > >> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 > >> ?? Pointy hat to: ?? ?? ??me > >> > >> Modified: > >> ?? head/sys/amd64/amd64/machdep.c > >> ?? head/sys/amd64/amd64/mp_machdep.c > >> ?? head/sys/i386/i386/machdep.c > >> ?? head/sys/i386/i386/mp_machdep.c > >> > >> Modified: head/sys/amd64/amd64/machdep.c > >> ============================================================================== > >> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? ??(r234073) > >> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? ??(r234074) > >> @@ -295,6 +295,11 @@ cpu_startup(dummy) > >> ?? ?? ?? vm_pager_bufferinit(); > >> > >> ?? ?? ?? cpu_setregs(); > >> + > >> + ?? ?? /* > >> + ?? ?? ??* Add BSP as an interrupt target. > >> + ?? ?? ??*/ > >> + ?? ?? intr_add_cpu(0); > >> ??} > > > > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be > > here as well. > > You are right, sorry, I did forgot to test without SMP. > I think we still need intr_add_cpu() on cpu_startup() because of the > case smp_disabled = 1. > I think the attached patch should make its dirty job, opinion? I currently fail to see why the latter approach would be necessary, i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should be sufficient. In case the kernel is compiled without SMP support, interrupt balancing support isn't available in the first place and the BSP is always the only available target (see the UP version of intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's no need to add the BSP as a valid target. If an SMP kernel is run on a UP machine or with SMP disabled, interrupt balancing support is available but the intr_add_cpu() calls in cpu_startup() will add the BSP as (the only) target, so everything should be fine. Maybe you can elaborate on why you think an SMP kernel with SMP disabled needs special handling. Marius From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 12:55:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF716106564A; Tue, 10 Apr 2012 12:55:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id A2D748FC0C; Tue, 10 Apr 2012 12:55:32 +0000 (UTC) Received: by lagv3 with SMTP id v3so5806759lag.13 for ; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DEqyn8nRn+2D9Ur/Z3yj0xeDrzpSGbpBQTrq3vSgwzE=; b=PcUk7dQC3iNiupKf5UavuxZSNAN79nihDbBB9KnakZlOpAcrMURCwRD91e7o9hZTeF zYb/39APjNXzee0tjf5ZyLYJn6+qHVreRCU7wsDFUx62fO4RM1tTND0mk0U3arQFJ0us hVYCfUz3yVl4w4dlBr6vYQ2ZNEUfGPaFswhhGfFZXl/XTpwH5jlkXz2GUyvagKexB53b qeMaclI+HoLMsLEbMefOqXNpfTB+QWq8V1PsyZ9PZrjmn8rz2Z3DkEaoVCluSv5UnMxo iQTIRCypkPy2V1/XAfx/RnpBgIpRlrOqEO4PSHnlieVPFMmTTaQgxNqDXltcsrqR4xKU K1Jg== MIME-Version: 1.0 Received: by 10.112.24.103 with SMTP id t7mr1190143lbf.22.1334062531399; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Tue, 10 Apr 2012 05:55:31 -0700 (PDT) In-Reply-To: <20120410114118.GB93449@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> <20120410114118.GB93449@alchemy.franken.de> Date: Tue, 10 Apr 2012 13:55:31 +0100 X-Google-Sender-Auth: a-tWbvcxa0dFdcwVNeOCGrJzbFE Message-ID: From: Attilio Rao To: Marius Strobl Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 12:55:33 -0000 Il 10 aprile 2012 12:41, Marius Strobl ha scritto: > On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: >> Il 10 aprile 2012 00:09, Marius Strobl ha scritto: >> > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: >> >> Author: attilio >> >> Date: Mon Apr ??9 22:41:19 2012 >> >> New Revision: 234074 >> >> URL: http://svn.freebsd.org/changeset/base/234074 >> >> >> >> Log: >> >> ?? BSP is not added to the mask of valid target CPUs for interrupts >> >> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not >> >> ?? called in the !SMP case too. >> >> ?? Fix this by: >> >> ?? - Adding the BSP as an interrupt target directly in cpu_startup(). >> >> ?? - Remove an obsolete optimization where the BSP are skipped in >> >> ?? ?? set_apic_interrupt_ids(). >> >> >> >> ?? Reported by: ?? ?? ?? ??jh >> >> ?? Reviewed by: ?? ?? ?? ??jhb >> >> ?? MFC after: ??3 days >> >> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 >> >> ?? Pointy hat to: ?? ?? ??me >> >> >> >> Modified: >> >> ?? head/sys/amd64/amd64/machdep.c >> >> ?? head/sys/amd64/amd64/mp_machdep.c >> >> ?? head/sys/i386/i386/machdep.c >> >> ?? head/sys/i386/i386/mp_machdep.c >> >> >> >> Modified: head/sys/amd64/amd64/machdep.c >> >> ============================================================================== >> >> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? ??(r234073) >> >> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? ??(r234074) >> >> @@ -295,6 +295,11 @@ cpu_startup(dummy) >> >> ?? ?? ?? vm_pager_bufferinit(); >> >> >> >> ?? ?? ?? cpu_setregs(); >> >> + >> >> + ?? ?? /* >> >> + ?? ?? ??* Add BSP as an interrupt target. >> >> + ?? ?? ??*/ >> >> + ?? ?? intr_add_cpu(0); >> >> ??} >> > >> > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be >> > here as well. >> >> You are right, sorry, I did forgot to test without SMP. >> I think we still need intr_add_cpu() on cpu_startup() because of the >> case smp_disabled = 1. >> I think the attached patch should make its dirty job, opinion? > > I currently fail to see why the latter approach would be necessary, > i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should > be sufficient. In case the kernel is compiled without SMP support, > interrupt balancing support isn't available in the first place and > the BSP is always the only available target (see the UP version of > intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's > no need to add the BSP as a valid target. If an SMP kernel is run > on a UP machine or with SMP disabled, interrupt balancing support > is available but the intr_add_cpu() calls in cpu_startup() will add > the BSP as (the only) target, so everything should be fine. Maybe > you can elaborate on why you think an SMP kernel with SMP disabled > needs special handling. I do not understand what you mean. Right now there is a compile time issue where for !SMP kernel it won't compile and this is what I'm trying to fix now, so I don't understand what do you mean here. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 13:25:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B829E106564A; Tue, 10 Apr 2012 13:25:48 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5F05B8FC12; Tue, 10 Apr 2012 13:25:48 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q3ADPkl7032854; Tue, 10 Apr 2012 15:25:47 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q3ADPkv6032853; Tue, 10 Apr 2012 15:25:46 +0200 (CEST) (envelope-from marius) Date: Tue, 10 Apr 2012 15:25:46 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20120410132546.GF93449@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> <20120410114118.GB93449@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 13:25:48 -0000 On Tue, Apr 10, 2012 at 01:55:31PM +0100, Attilio Rao wrote: > Il 10 aprile 2012 12:41, Marius Strobl ha scritto: > > On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: > >> Il 10 aprile 2012 00:09, Marius Strobl ha scritto: > >> > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: > >> >> Author: attilio > >> >> Date: Mon Apr ??9 22:41:19 2012 > >> >> New Revision: 234074 > >> >> URL: http://svn.freebsd.org/changeset/base/234074 > >> >> > >> >> Log: > >> >> ?? BSP is not added to the mask of valid target CPUs for interrupts > >> >> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not > >> >> ?? called in the !SMP case too. > >> >> ?? Fix this by: > >> >> ?? - Adding the BSP as an interrupt target directly in cpu_startup(). > >> >> ?? - Remove an obsolete optimization where the BSP are skipped in > >> >> ?? ?? set_apic_interrupt_ids(). > >> >> > >> >> ?? Reported by: ?? ?? ?? ??jh > >> >> ?? Reviewed by: ?? ?? ?? ??jhb > >> >> ?? MFC after: ??3 days > >> >> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 > >> >> ?? Pointy hat to: ?? ?? ??me > >> >> > >> >> Modified: > >> >> ?? head/sys/amd64/amd64/machdep.c > >> >> ?? head/sys/amd64/amd64/mp_machdep.c > >> >> ?? head/sys/i386/i386/machdep.c > >> >> ?? head/sys/i386/i386/mp_machdep.c > >> >> > >> >> Modified: head/sys/amd64/amd64/machdep.c > >> >> ============================================================================== > >> >> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? ??(r234073) > >> >> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? ??(r234074) > >> >> @@ -295,6 +295,11 @@ cpu_startup(dummy) > >> >> ?? ?? ?? vm_pager_bufferinit(); > >> >> > >> >> ?? ?? ?? cpu_setregs(); > >> >> + > >> >> + ?? ?? /* > >> >> + ?? ?? ??* Add BSP as an interrupt target. > >> >> + ?? ?? ??*/ > >> >> + ?? ?? intr_add_cpu(0); > >> >> ??} > >> > > >> > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be > >> > here as well. > >> > >> You are right, sorry, I did forgot to test without SMP. > >> I think we still need intr_add_cpu() on cpu_startup() because of the > >> case smp_disabled = 1. > >> I think the attached patch should make its dirty job, opinion? > > > > I currently fail to see why the latter approach would be necessary, > > i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should > > be sufficient. In case the kernel is compiled without SMP support, > > interrupt balancing support isn't available in the first place and > > the BSP is always the only available target (see the UP version of > > intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's > > no need to add the BSP as a valid target. If an SMP kernel is run > > on a UP machine or with SMP disabled, interrupt balancing support > > is available but the intr_add_cpu() calls in cpu_startup() will add > > the BSP as (the only) target, so everything should be fine. Maybe > > you can elaborate on why you think an SMP kernel with SMP disabled > > needs special handling. > > I do not understand what you mean. Well, so we are at least in the same boat :) > Right now there is a compile time issue where for !SMP kernel it won't > compile and this is what I'm trying to fix now, so I don't understand > what do you mean here. > AFAICT the below patch should take care of UP in both the compile-time and run-time cases. Marius Index: amd64/amd64/machdep.c =================================================================== --- amd64/amd64/machdep.c (revision 234095) +++ amd64/amd64/machdep.c (working copy) @@ -296,10 +296,12 @@ cpu_startup(dummy) cpu_setregs(); +#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); +#endif } /* Index: i386/i386/machdep.c =================================================================== --- i386/i386/machdep.c (revision 234095) +++ i386/i386/machdep.c (working copy) @@ -337,10 +337,12 @@ cpu_startup(dummy) cpu_setregs(); #endif +#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 13:28:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4035C106566C; Tue, 10 Apr 2012 13:28:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA9C8FC08; Tue, 10 Apr 2012 13:28:44 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so752603lbb.13 for ; Tue, 10 Apr 2012 06:28:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=lXcEahCCrJ8d/Mn49t0jMPR/A5qtEHT1F/EVmSbGlz0=; b=EFHPWywOg2EzB4+A4OVF1Ar88G4+JsbylITP+T82iulecn5X66eTUp7/3F7bhMgZuF pmmHUrJek7kRf2jTXh5uTVqb+lpRFESFcUnzJ74Y/Jg+cyZqTSWtt2MaQ1uLFLcUK7Fh R2SPFcDTdyxOssSlOITM36W4mUgI81m3nSTYBki/6HPbjU4tjfunSF1Zij4HHQUmgvOO QHtX66HQ8s/5nw+j/HsGhZjRerD4ptOTiBSPPnpv8akzilFwPBpWWsCb6c0Ttw1sLFdv vhs4tWoA7socr4zzr1h72z7lYLwQ9geyO95zPF1VmD1ZVKaT3+dmSjcquFcnMd/3m5cw mfQg== MIME-Version: 1.0 Received: by 10.112.84.42 with SMTP id v10mr1272733lby.50.1334064518361; Tue, 10 Apr 2012 06:28:38 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.93.138 with HTTP; Tue, 10 Apr 2012 06:28:38 -0700 (PDT) In-Reply-To: <20120410132546.GF93449@alchemy.franken.de> References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> <20120410114118.GB93449@alchemy.franken.de> <20120410132546.GF93449@alchemy.franken.de> Date: Tue, 10 Apr 2012 14:28:38 +0100 X-Google-Sender-Auth: joA5UCz302MFD8HDFgks66EnpLg Message-ID: From: Attilio Rao To: Marius Strobl Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 13:28:46 -0000 Il 10 aprile 2012 14:25, Marius Strobl ha scritto: > On Tue, Apr 10, 2012 at 01:55:31PM +0100, Attilio Rao wrote: >> Il 10 aprile 2012 12:41, Marius Strobl ha scritto: >> > On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: >> >> Il 10 aprile 2012 00:09, Marius Strobl ha scritto: >> >> > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: >> >> >> Author: attilio >> >> >> Date: Mon Apr ??9 22:41:19 2012 >> >> >> New Revision: 234074 >> >> >> URL: http://svn.freebsd.org/changeset/base/234074 >> >> >> >> >> >> Log: >> >> >> ?? BSP is not added to the mask of valid target CPUs for interrupts >> >> >> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not >> >> >> ?? called in the !SMP case too. >> >> >> ?? Fix this by: >> >> >> ?? - Adding the BSP as an interrupt target directly in cpu_startup(). >> >> >> ?? - Remove an obsolete optimization where the BSP are skipped in >> >> >> ?? ?? set_apic_interrupt_ids(). >> >> >> >> >> >> ?? Reported by: ?? ?? ?? ??jh >> >> >> ?? Reviewed by: ?? ?? ?? ??jhb >> >> >> ?? MFC after: ??3 days >> >> >> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 >> >> >> ?? Pointy hat to: ?? ?? ??me >> >> >> >> >> >> Modified: >> >> >> ?? head/sys/amd64/amd64/machdep.c >> >> >> ?? head/sys/amd64/amd64/mp_machdep.c >> >> >> ?? head/sys/i386/i386/machdep.c >> >> >> ?? head/sys/i386/i386/mp_machdep.c >> >> >> >> >> >> Modified: head/sys/amd64/amd64/machdep.c >> >> >> ============================================================================== >> >> >> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 ?? ?? ?? ??(r234073) >> >> >> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 ?? ?? ?? ??(r234074) >> >> >> @@ -295,6 +295,11 @@ cpu_startup(dummy) >> >> >> ?? ?? ?? vm_pager_bufferinit(); >> >> >> >> >> >> ?? ?? ?? cpu_setregs(); >> >> >> + >> >> >> + ?? ?? /* >> >> >> + ?? ?? ??* Add BSP as an interrupt target. >> >> >> + ?? ?? ??*/ >> >> >> + ?? ?? intr_add_cpu(0); >> >> >> ??} >> >> > >> >> > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be >> >> > here as well. >> >> >> >> You are right, sorry, I did forgot to test without SMP. >> >> I think we still need intr_add_cpu() on cpu_startup() because of the >> >> case smp_disabled = 1. >> >> I think the attached patch should make its dirty job, opinion? >> > >> > I currently fail to see why the latter approach would be necessary, >> > i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should >> > be sufficient. In case the kernel is compiled without SMP support, >> > interrupt balancing support isn't available in the first place and >> > the BSP is always the only available target (see the UP version of >> > intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's >> > no need to add the BSP as a valid target. If an SMP kernel is run >> > on a UP machine or with SMP disabled, interrupt balancing support >> > is available but the intr_add_cpu() calls in cpu_startup() will add >> > the BSP as (the only) target, so everything should be fine. Maybe >> > you can elaborate on why you think an SMP kernel with SMP disabled >> > needs special handling. >> >> I do not understand what you mean. > > Well, so we are at least in the same boat :) > >> Right now there is a compile time issue where for !SMP kernel it won't >> compile and this is what I'm trying to fix now, so I don't understand >> what do you mean here. >> > > AFAICT the below patch should take care of UP in both the compile-time > and run-time cases. Not sure why, I was convinced that this patch was going to break the SMP + smp_disabled=1 case but of course it is not. Please go ahead and commit it, thanks. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 13:58:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 631CB106564A; Tue, 10 Apr 2012 13:58:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 35A6D8FC0A; Tue, 10 Apr 2012 13:58:26 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 98EDFB911; Tue, 10 Apr 2012 09:58:25 -0400 (EDT) From: John Baldwin To: Marius Strobl Date: Tue, 10 Apr 2012 09:33:32 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> In-Reply-To: <20120409230949.GB68111@alchemy.franken.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201204100933.32374.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Apr 2012 09:58:25 -0400 (EDT) Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 13:58:26 -0000 On Monday, April 09, 2012 7:09:49 pm Marius Strobl wrote: > On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: > > Author: attilio > > Date: Mon Apr 9 22:41:19 2012 > > New Revision: 234074 > > URL: http://svn.freebsd.org/changeset/base/234074 > > > > Log: > > BSP is not added to the mask of valid target CPUs for interrupts > > in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() is not > > called in the !SMP case too. > > Fix this by: > > - Adding the BSP as an interrupt target directly in cpu_startup(). > > - Remove an obsolete optimization where the BSP are skipped in > > set_apic_interrupt_ids(). > > > > Reported by: jh > > Reviewed by: jhb > > MFC after: 3 days > > X-MFC: r233961 > > Pointy hat to: me > > > > Modified: > > head/sys/amd64/amd64/machdep.c > > head/sys/amd64/amd64/mp_machdep.c > > head/sys/i386/i386/machdep.c > > head/sys/i386/i386/mp_machdep.c > > > > Modified: head/sys/amd64/amd64/machdep.c > > ============================================================================== > > --- head/sys/amd64/amd64/machdep.c Mon Apr 9 22:01:43 2012 (r234073) > > +++ head/sys/amd64/amd64/machdep.c Mon Apr 9 22:41:19 2012 (r234074) > > @@ -295,6 +295,11 @@ cpu_startup(dummy) > > vm_pager_bufferinit(); > > > > cpu_setregs(); > > + > > + /* > > + * Add BSP as an interrupt target. > > + */ > > + intr_add_cpu(0); > > } > > If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it should be > here as well. Correct. This is why I had put it in intr_machdep.c in the big #ifdef SMP block where all the interrupt target stuff lives. Adding #ifdef's here is fine as well though. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 13:59:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C513B106566C; Tue, 10 Apr 2012 13:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1A218FC15; Tue, 10 Apr 2012 13:59:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3ADxZns026579; Tue, 10 Apr 2012 13:59:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3ADxZba026577; Tue, 10 Apr 2012 13:59:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204101359.q3ADxZba026577@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Apr 2012 13:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234098 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 13:59:35 -0000 Author: jhb Date: Tue Apr 10 13:59:35 2012 New Revision: 234098 URL: http://svn.freebsd.org/changeset/base/234098 Log: Add media types for 40G media that might be used with FreeBSD. Reviewed by: bz MFC after: 2 weeks Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Tue Apr 10 13:37:43 2012 (r234097) +++ head/sys/net/if_media.h Tue Apr 10 13:59:35 2012 (r234098) @@ -150,6 +150,9 @@ uint64_t ifmedia_baudrate(int); #define IFM_10G_LRM 24 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_UNKNOWN 25 /* media types not defined yet */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ +#define IFM_40G_CR4 27 /* 40GBase-CR4 */ +#define IFM_40G_SR4 28 /* 40GBase-SR4 */ +#define IFM_40G_LR4 29 /* 40GBase-LR4 */ /* note 31 is the max! */ @@ -360,6 +363,9 @@ struct ifmedia_description { { IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" }, \ { IFM_UNKNOWN, "Unknown" }, \ { IFM_10G_T, "10Gbase-T" }, \ + { IFM_40G_CR4, "40Gbase-CR4" }, \ + { IFM_40G_SR4, "40Gbase-SR4" }, \ + { IFM_40G_LR4, "40Gbase-LR4" }, \ { 0, NULL }, \ } @@ -658,6 +664,9 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10ULL) }, \ + { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 14:01:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9DDB1065674; Tue, 10 Apr 2012 14:01:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94EAA8FC1F; Tue, 10 Apr 2012 14:01:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AE19gK026689; Tue, 10 Apr 2012 14:01:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AE19Tc026685; Tue, 10 Apr 2012 14:01:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204101401.q3AE19Tc026685@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Apr 2012 14:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234099 - head/sys/ofed/drivers/net/mlx4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 14:01:09 -0000 Author: jhb Date: Tue Apr 10 14:01:09 2012 New Revision: 234099 URL: http://svn.freebsd.org/changeset/base/234099 Log: Properly parse 40G media types from newer Mellanox adapters that are 40G capable. For now, map all 40G links to 40GBase-CR4. MFC after: 2 weeks Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/en_port.c head/sys/ofed/drivers/net/mlx4/en_port.h Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Apr 10 13:59:35 2012 (r234098) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Apr 10 14:01:09 2012 (r234099) @@ -991,12 +991,20 @@ static int mlx4_en_calc_media(struct mlx active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ - if (priv->port_state.link_speed == 1000) + switch (priv->port_state.link_speed) { + case 1000: active |= IFM_1000_T; - else if (trans_type > 0 && trans_type <= 0xC) - active |= IFM_10G_SR; - else if (trans_type == 0x80 || trans_type == 0) - active |= IFM_10G_CX4; + break; + case 10000: + if (trans_type > 0 && trans_type <= 0xC) + active |= IFM_10G_SR; + else if (trans_type == 0x80 || trans_type == 0) + active |= IFM_10G_CX4; + break; + case 40000: + active |= IFM_40G_CR4; + break; + } if (priv->prof->tx_pause) active |= IFM_ETH_TXPAUSE; if (priv->prof->rx_pause) Modified: head/sys/ofed/drivers/net/mlx4/en_port.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_port.c Tue Apr 10 13:59:35 2012 (r234098) +++ head/sys/ofed/drivers/net/mlx4/en_port.c Tue Apr 10 14:01:09 2012 (r234099) @@ -152,11 +152,21 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_de /* This command is always accessed from Ethtool context * already synchronized, no need in locking */ state->link_state = !!(qport_context->link_up & MLX4_EN_LINK_UP_MASK); - if ((qport_context->link_speed & MLX4_EN_SPEED_MASK) == - MLX4_EN_1G_SPEED) + switch (qport_context->link_speed & MLX4_EN_SPEED_MASK) { + case MLX4_EN_1G_SPEED: state->link_speed = 1000; - else + break; + case MLX4_EN_10G_SPEED_XAUI: + case MLX4_EN_10G_SPEED_XFI: state->link_speed = 10000; + break; + case MLX4_EN_40G_SPEED: + state->link_speed = 40000; + break; + default: + state->link_speed = -1; + break; + } state->transciver = qport_context->transceiver; if (be32_to_cpu(qport_context->transceiver_code_hi) & 0x400) state->transciver = 0x80; Modified: head/sys/ofed/drivers/net/mlx4/en_port.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_port.h Tue Apr 10 13:59:35 2012 (r234098) +++ head/sys/ofed/drivers/net/mlx4/en_port.h Tue Apr 10 14:01:09 2012 (r234099) @@ -85,6 +85,14 @@ enum { MLX4_MCAST_ENABLE = 2, }; +enum { + MLX4_EN_1G_SPEED = 0x02, + MLX4_EN_10G_SPEED_XFI = 0x01, + MLX4_EN_10G_SPEED_XAUI = 0x00, + MLX4_EN_40G_SPEED = 0x40, + MLX4_EN_OTHER_SPEED = 0x0f, +}; + struct mlx4_en_query_port_context { u8 link_up; #define MLX4_EN_LINK_UP_MASK 0x80 @@ -92,8 +100,7 @@ struct mlx4_en_query_port_context { __be16 mtu; u8 reserved2; u8 link_speed; -#define MLX4_EN_SPEED_MASK 0x3 -#define MLX4_EN_1G_SPEED 0x2 +#define MLX4_EN_SPEED_MASK 0x43 u16 reserved3[5]; __be64 mac; u8 transceiver; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 15:29:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C44C106564A; Tue, 10 Apr 2012 15:29:29 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56C208FC14; Tue, 10 Apr 2012 15:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AFTTA9029570; Tue, 10 Apr 2012 15:29:29 GMT (envelope-from schweikh@svn.freebsd.org) Received: (from schweikh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AFTTj6029568; Tue, 10 Apr 2012 15:29:29 GMT (envelope-from schweikh@svn.freebsd.org) Message-Id: <201204101529.q3AFTTj6029568@svn.freebsd.org> From: Jens Schweikhardt Date: Tue, 10 Apr 2012 15:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234101 - head/usr.bin/lex X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 15:29:29 -0000 Author: schweikh Date: Tue Apr 10 15:29:28 2012 New Revision: 234101 URL: http://svn.freebsd.org/changeset/base/234101 Log: Parenthesize args in yyless() and unput() replacement text so they are safer when used with expressions. MFC after: 1 week Modified: head/usr.bin/lex/flex.skl Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Tue Apr 10 14:29:56 2012 (r234100) +++ head/usr.bin/lex/flex.skl Tue Apr 10 15:29:28 2012 (r234101) @@ -122,7 +122,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This + * into a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) @@ -143,12 +143,12 @@ extern FILE *yyin, *yyout; /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + yy_c_buf_p = yy_cp = yy_bp + (n) - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) +#define unput(c) yyunput( (c), yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 15:59:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44084106564A; Tue, 10 Apr 2012 15:59:38 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156CB8FC18; Tue, 10 Apr 2012 15:59:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AFxbLh030566; Tue, 10 Apr 2012 15:59:37 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AFxbX2030563; Tue, 10 Apr 2012 15:59:37 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201204101559.q3AFxbX2030563@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 10 Apr 2012 15:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234103 - in head: lib/libc/sys sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 15:59:38 -0000 Author: jh Date: Tue Apr 10 15:59:37 2012 New Revision: 234103 URL: http://svn.freebsd.org/changeset/base/234103 Log: - Return EPERM from ufs_setattr() when an user without PRIV_VFS_SYSFLAGS privilege attempts to toggle SF_SETTABLE flags. - Use the '^' operator in the SF_SNAPSHOT anti-toggling check. Flags are now stored to ip->i_flags in one place after all checks. Submitted by: bde Modified: head/lib/libc/sys/chflags.2 head/sys/ufs/ufs/ufs_vnops.c Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Tue Apr 10 15:58:22 2012 (r234102) +++ head/lib/libc/sys/chflags.2 Tue Apr 10 15:59:37 2012 (r234103) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd Oct 29, 2010 +.Dd Apr 10, 2012 .Dt CHFLAGS 2 .Os .Sh NAME @@ -114,8 +114,7 @@ The and .Dv SF_ARCHIVED flags may only be set or unset by the super-user. -Attempts to set these flags by non-super-users are rejected, attempts by -non-superusers to clear flags that are already unset are silently ignored. +Attempts to toggle these flags by non-super-users are rejected. These flags may be set at any time, but normally may only be unset when the system is in single-user mode. (See Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Apr 10 15:58:22 2012 (r234102) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Apr 10 15:59:37 2012 (r234103) @@ -555,23 +555,17 @@ ufs_setattr(ap) if (error) return (error); } - /* Snapshot flag cannot be set or cleared */ - if (((vap->va_flags & SF_SNAPSHOT) != 0 && - (ip->i_flags & SF_SNAPSHOT) == 0) || - ((vap->va_flags & SF_SNAPSHOT) == 0 && - (ip->i_flags & SF_SNAPSHOT) != 0)) + /* The snapshot flag cannot be toggled. */ + if ((vap->va_flags ^ ip->i_flags) & SF_SNAPSHOT) return (EPERM); - ip->i_flags = vap->va_flags; - DIP_SET(ip, i_flags, vap->va_flags); } else { if (ip->i_flags & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) || - (vap->va_flags & UF_SETTABLE) != vap->va_flags) + ((vap->va_flags ^ ip->i_flags) & SF_SETTABLE)) return (EPERM); - ip->i_flags &= SF_SETTABLE; - ip->i_flags |= (vap->va_flags & UF_SETTABLE); - DIP_SET(ip, i_flags, ip->i_flags); } + ip->i_flags = vap->va_flags; + DIP_SET(ip, i_flags, vap->va_flags); ip->i_flag |= IN_CHANGE; error = UFS_UPDATE(vp, 0); if (ip->i_flags & (IMMUTABLE | APPEND)) From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 16:05:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBB6106564A; Tue, 10 Apr 2012 16:05:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D76948FC0C; Tue, 10 Apr 2012 16:05:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AG5qbC030818; Tue, 10 Apr 2012 16:05:52 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AG5qaH030816; Tue, 10 Apr 2012 16:05:52 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201204101605.q3AG5qaH030816@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 10 Apr 2012 16:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234104 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 16:05:53 -0000 Author: jh Date: Tue Apr 10 16:05:52 2012 New Revision: 234104 URL: http://svn.freebsd.org/changeset/base/234104 Log: Apply changes from r233787 to ext2fs: - Use more natural ip->i_flags instead of vap->va_flags in the final flags check. - Style improvements. No functional change intended. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 10 15:59:37 2012 (r234103) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Apr 10 16:05:52 2012 (r234104) @@ -407,7 +407,6 @@ ext2_setattr(ap) /* Disallow flags not supported by ext2fs. */ if(vap->va_flags & ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP)) return (EOPNOTSUPP); - if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); /* @@ -424,23 +423,23 @@ ext2_setattr(ap) * if securelevel > 0 and any existing system flags are set. */ if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) { - if (ip->i_flags - & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) { + if (ip->i_flags & + (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) { error = securelevel_gt(cred, 0); if (error) return (error); } ip->i_flags = vap->va_flags; } else { - if (ip->i_flags - & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) || + if (ip->i_flags & + (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) || (vap->va_flags & UF_SETTABLE) != vap->va_flags) return (EPERM); ip->i_flags &= SF_SETTABLE; ip->i_flags |= (vap->va_flags & UF_SETTABLE); } ip->i_flag |= IN_CHANGE; - if (vap->va_flags & (IMMUTABLE | APPEND)) + if (ip->i_flags & (IMMUTABLE | APPEND)) return (0); } if (ip->i_flags & (IMMUTABLE | APPEND)) From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 16:08:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60A4E106566C; Tue, 10 Apr 2012 16:08:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6588FC12; Tue, 10 Apr 2012 16:08:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AG8l3m030934; Tue, 10 Apr 2012 16:08:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AG8l4l030931; Tue, 10 Apr 2012 16:08:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204101608.q3AG8l4l030931@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 Apr 2012 16:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234105 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 16:08:47 -0000 Author: marius Date: Tue Apr 10 16:08:46 2012 New Revision: 234105 URL: http://svn.freebsd.org/changeset/base/234105 Log: Fix !SMP build after r234074. Reviewed by: attilio, jhb Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Apr 10 16:05:52 2012 (r234104) +++ head/sys/amd64/amd64/machdep.c Tue Apr 10 16:08:46 2012 (r234105) @@ -296,10 +296,12 @@ cpu_startup(dummy) cpu_setregs(); +#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); +#endif } /* Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Apr 10 16:05:52 2012 (r234104) +++ head/sys/i386/i386/machdep.c Tue Apr 10 16:08:46 2012 (r234105) @@ -337,10 +337,12 @@ cpu_startup(dummy) cpu_setregs(); #endif +#ifdef SMP /* * Add BSP as an interrupt target. */ intr_add_cpu(0); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 16:33:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E08BF1065670; Tue, 10 Apr 2012 16:33:19 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5FA8FC0C; Tue, 10 Apr 2012 16:33:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AGXJPW031719; Tue, 10 Apr 2012 16:33:19 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AGXJjG031714; Tue, 10 Apr 2012 16:33:19 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201204101633.q3AGXJjG031714@svn.freebsd.org> From: Jim Harris Date: Tue, 10 Apr 2012 16:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234106 - head/sys/dev/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 16:33:20 -0000 Author: jimharris Date: Tue Apr 10 16:33:19 2012 New Revision: 234106 URL: http://svn.freebsd.org/changeset/base/234106 Log: Queue CCBs internally instead of using CAM_REQUEUE_REQ status. This fixes problem where userspace apps such as smartctl fail due to CAM_REQUEUE_REQ status getting returned when tagged commands are outstanding when smartctl sends its I/O using the pass(4) interface. Sponsored by: Intel Found and tested by: Ravi Pokala Reviewed by: scottl Approved by: scottl MFC after: 1 week Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_remote_device.c Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Tue Apr 10 16:08:46 2012 (r234105) +++ head/sys/dev/isci/isci.h Tue Apr 10 16:33:19 2012 (r234106) @@ -86,6 +86,7 @@ struct ISCI_REMOTE_DEVICE { BOOL is_resetting; uint32_t frozen_lun_mask; SCI_FAST_LIST_ELEMENT_T pending_device_reset_element; + TAILQ_HEAD(,ccb_hdr) queued_ccbs; }; struct ISCI_DOMAIN { Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Tue Apr 10 16:08:46 2012 (r234105) +++ head/sys/dev/isci/isci_controller.c Tue Apr 10 16:33:19 2012 (r234106) @@ -430,6 +430,7 @@ int isci_controller_allocate_memory(stru remote_device->frozen_lun_mask = 0; sci_fast_list_element_init(remote_device, &remote_device->pending_device_reset_element); + TAILQ_INIT(&remote_device->queued_ccbs); /* * For the first SCI_MAX_DOMAINS device objects, do not put Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Tue Apr 10 16:08:46 2012 (r234105) +++ head/sys/dev/isci/isci_io_request.c Tue Apr 10 16:33:19 2012 (r234106) @@ -85,7 +85,9 @@ isci_io_request_complete(SCI_CONTROLLER_ struct ISCI_CONTROLLER *isci_controller; struct ISCI_REMOTE_DEVICE *isci_remote_device; union ccb *ccb; + BOOL complete_ccb; + complete_ccb = TRUE; isci_controller = (struct ISCI_CONTROLLER *) sci_object_get_association(scif_controller); isci_remote_device = (struct ISCI_REMOTE_DEVICE *) sci_object_get_association(remote_device); @@ -163,9 +165,7 @@ isci_io_request_complete(SCI_CONTROLLER_ case SCI_IO_FAILURE_INVALID_STATE: case SCI_IO_FAILURE_INSUFFICIENT_RESOURCES: - ccb->ccb_h.status |= CAM_REQUEUE_REQ; - isci_remote_device_freeze_lun_queue(isci_remote_device, - ccb->ccb_h.target_lun); + complete_ccb = FALSE; break; case SCI_IO_FAILURE_INVALID_REMOTE_DEVICE: @@ -189,7 +189,7 @@ isci_io_request_complete(SCI_CONTROLLER_ scif_remote_device_get_max_queue_depth(remote_device); xpt_action((union ccb *)&ccb_relsim); xpt_free_path(path); - ccb->ccb_h.status |= CAM_REQUEUE_REQ; + complete_ccb = FALSE; } break; @@ -209,17 +209,6 @@ isci_io_request_complete(SCI_CONTROLLER_ break; } - if (ccb->ccb_h.status != CAM_REQ_CMP) { - /* ccb will be completed with some type of non-success - * status. So temporarily freeze the queue until the - * upper layers can act on the status. The CAM_DEV_QFRZN - * flag will then release the queue after the status is - * acted upon. - */ - ccb->ccb_h.status |= CAM_DEV_QFRZN; - xpt_freeze_devq(ccb->ccb_h.path, 1); - } - callout_stop(&isci_request->parent.timer); bus_dmamap_sync(isci_request->parent.dma_tag, isci_request->parent.dma_map, @@ -228,20 +217,43 @@ isci_io_request_complete(SCI_CONTROLLER_ bus_dmamap_unload(isci_request->parent.dma_tag, isci_request->parent.dma_map); - if (isci_remote_device->frozen_lun_mask != 0 && - !(ccb->ccb_h.status & CAM_REQUEUE_REQ)) - isci_remote_device_release_device_queue(isci_remote_device); - - xpt_done(ccb); isci_request->ccb = NULL; - if (isci_controller->is_frozen == TRUE) { - isci_controller->is_frozen = FALSE; - xpt_release_simq(isci_controller->sim, TRUE); - } - sci_pool_put(isci_controller->request_pool, (struct ISCI_REQUEST *)isci_request); + + if (complete_ccb) { + if (ccb->ccb_h.status != CAM_REQ_CMP) { + /* ccb will be completed with some type of non-success + * status. So temporarily freeze the queue until the + * upper layers can act on the status. The + * CAM_DEV_QFRZN flag will then release the queue + * after the status is acted upon. + */ + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); + } + + if (isci_remote_device->frozen_lun_mask != 0) { + isci_remote_device_release_device_queue(isci_remote_device); + } + + xpt_done(ccb); + + if (isci_controller->is_frozen == TRUE) { + isci_controller->is_frozen = FALSE; + xpt_release_simq(isci_controller->sim, TRUE); + } + } else { + isci_remote_device_freeze_lun_queue(isci_remote_device, + ccb->ccb_h.target_lun); + + isci_log_message(1, "ISCI", "queue %p %x\n", ccb, + ccb->csio.cdb_io.cdb_bytes[0]); + ccb->ccb_h.status |= CAM_SIM_QUEUED; + TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, + &ccb->ccb_h, sim_links.tqe); + } } /** Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Tue Apr 10 16:08:46 2012 (r234105) +++ head/sys/dev/isci/isci_remote_device.c Tue Apr 10 16:33:19 2012 (r234106) @@ -289,9 +289,22 @@ isci_remote_device_release_lun_queue(str void isci_remote_device_release_device_queue( - struct ISCI_REMOTE_DEVICE *remote_device) + struct ISCI_REMOTE_DEVICE *device) { - lun_id_t lun; - for (lun = 0; lun < ISCI_MAX_LUN; lun++) - isci_remote_device_release_lun_queue(remote_device, lun); + if (TAILQ_EMPTY(&device->queued_ccbs)) { + lun_id_t lun; + + for (lun = 0; lun < ISCI_MAX_LUN; lun++) + isci_remote_device_release_lun_queue(device, lun); + } else { + struct ccb_hdr *ccb_h; + + ccb_h = TAILQ_FIRST(&device->queued_ccbs); + TAILQ_REMOVE(&device->queued_ccbs, ccb_h, sim_links.tqe); + ccb_h->status &= ~CAM_SIM_QUEUED; + isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, + ((union ccb*)ccb_h)->csio.cdb_io.cdb_bytes[0]); + isci_io_request_execute_scsi_io((union ccb *)ccb_h, + device->domain->controller); + } } From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 17:37:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D527D1065672; Tue, 10 Apr 2012 17:37:24 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFDCD8FC1A; Tue, 10 Apr 2012 17:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AHbOxB033711; Tue, 10 Apr 2012 17:37:24 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AHbObC033708; Tue, 10 Apr 2012 17:37:24 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201204101737.q3AHbObC033708@svn.freebsd.org> From: Juli Mallett Date: Tue, 10 Apr 2012 17:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234107 - head/lib/libgeom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 17:37:24 -0000 Author: jmallett Date: Tue Apr 10 17:37:24 2012 New Revision: 234107 URL: http://svn.freebsd.org/changeset/base/234107 Log: Back out r233646. Although it fixed most libgeom consumers under 32-bit compatibility, it broke programs using devstat, under 32-bit compatibility and not. It's very difficult to fix the identifiers used by devstat, so this change is simply being backed out. Since changes to 3rd-party code seem likely, and may be necessary to properly fix 32-bit binaries on 64-bit kernel, it would seem better to make more invasive changes to fix GEOM's problems with 32-bit compatibility in general. The right thing to do is to replace all of the use of pointers as opaque identifiers with a fixed-size (64-bit or even 32-bit should be enough for tracking unique GEOM elments) field. That probably maintains source compatibility with most GEOM consumers, and allows xml2tree to make better assumptions about how to decode the identifiers. Submitted by: Anton Yuzhaninov Modified: head/lib/libgeom/geom_xml2tree.c head/lib/libgeom/libgeom.h Modified: head/lib/libgeom/geom_xml2tree.c ============================================================================== --- head/lib/libgeom/geom_xml2tree.c Tue Apr 10 16:33:19 2012 (r234106) +++ head/lib/libgeom/geom_xml2tree.c Tue Apr 10 17:37:24 2012 (r234107) @@ -55,56 +55,9 @@ struct mystate { int level; struct sbuf *sbuf[20]; struct gconf *config; - unsigned nident; + int nident; }; -static void * -internalize_ident(struct mystate *mt, const char *element, const char *str) -{ - struct gident *gip; - unsigned i; - - if (mt->nident != 0 && mt->mesh->lg_ident == NULL) { - warn("Cannot continue due to previous memory exhaustion."); - return (NULL); - } - - for (i = 0; i < mt->nident; i++) { - if (strcmp(mt->mesh->lg_ident[i].lg_id, str) != 0) - continue; - return ((void *)(uintptr_t)(i + 1)); - } - - i = mt->nident; - mt->nident++; - mt->mesh->lg_ident = reallocf(mt->mesh->lg_ident, (mt->nident + 1) * sizeof mt->mesh->lg_ident[0]); - if (mt->mesh->lg_ident == NULL) { - warn("Cannot allocate memory during processing of '%s' " - "element for identifier '%s'", element, str); - return (NULL); - } - - gip = &mt->mesh->lg_ident[i]; - gip->lg_id = strdup(str); - if (gip->lg_id == NULL) { - free(mt->mesh->lg_ident); - mt->mesh->lg_ident = NULL; - warn("Cannot allocate memory during processing of '%s' " - "element for identifier '%s'", element, str); - return (NULL); - } - gip->lg_ptr = NULL; - gip->lg_what = ISUNRESOLVED; - - /* Terminator entry. */ - gip = &mt->mesh->lg_ident[i + 1]; - gip->lg_id = NULL; - gip->lg_ptr = NULL; - gip->lg_what = ISUNRESOLVED; - - return ((void *)(uintptr_t)(i + 1)); -} - static void StartElement(void *userData, const char *name, const char **attr) { @@ -120,9 +73,10 @@ StartElement(void *userData, const char ref = NULL; for (i = 0; attr[i] != NULL; i += 2) { if (!strcmp(attr[i], "id")) { - id = internalize_ident(mt, name, attr[i + 1]); + id = (void *)strtoul(attr[i + 1], NULL, 0); + mt->nident++; } else if (!strcmp(attr[i], "ref")) { - ref = internalize_ident(mt, name, attr[i + 1]); + ref = (void *)strtoul(attr[i + 1], NULL, 0); } else printf("%*.*s[%s = %s]\n", mt->level + 1, mt->level + 1, "", @@ -363,16 +317,11 @@ CharData(void *userData , const XML_Char struct gident * geom_lookupid(struct gmesh *gmp, const void *id) { - unsigned i; - - if (gmp->lg_ident == NULL) - return (NULL); + struct gident *gip; - for (i = 0; gmp->lg_ident[i].lg_id != NULL; i++) { - if (i + 1 != (unsigned)(uintptr_t)id) - continue; - return (&gmp->lg_ident[i]); - } + for (gip = gmp->lg_ident; gip->lg_id != NULL; gip++) + if (gip->lg_id == id) + return (gip); return (NULL); } @@ -385,7 +334,6 @@ geom_xml2tree(struct gmesh *gmp, char *p struct ggeom *ge; struct gprovider *pr; struct gconsumer *co; - struct gident *gip; int i; memset(gmp, 0, sizeof *gmp); @@ -408,30 +356,33 @@ geom_xml2tree(struct gmesh *gmp, char *p free(mt); return (-1); } - if (gmp->lg_ident == NULL && mt->nident != 0) { - free(mt); - return (ENOMEM); - } + gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1); free(mt); + if (gmp->lg_ident == NULL) + return (ENOMEM); + i = 0; /* Collect all identifiers */ LIST_FOREACH(cl, &gmp->lg_class, lg_class) { - gip = geom_lookupid(gmp, cl->lg_id); - gip->lg_ptr = cl; - gip->lg_what = ISCLASS; - + gmp->lg_ident[i].lg_id = cl->lg_id; + gmp->lg_ident[i].lg_ptr = cl; + gmp->lg_ident[i].lg_what = ISCLASS; + i++; LIST_FOREACH(ge, &cl->lg_geom, lg_geom) { - gip = geom_lookupid(gmp, ge->lg_id); - gip->lg_ptr = ge; - gip->lg_what = ISGEOM; + gmp->lg_ident[i].lg_id = ge->lg_id; + gmp->lg_ident[i].lg_ptr = ge; + gmp->lg_ident[i].lg_what = ISGEOM; + i++; LIST_FOREACH(pr, &ge->lg_provider, lg_provider) { - gip = geom_lookupid(gmp, pr->lg_id); - gip->lg_ptr = pr; - gip->lg_what = ISPROVIDER; + gmp->lg_ident[i].lg_id = pr->lg_id; + gmp->lg_ident[i].lg_ptr = pr; + gmp->lg_ident[i].lg_what = ISPROVIDER; + i++; } LIST_FOREACH(co, &ge->lg_consumer, lg_consumer) { - gip = geom_lookupid(gmp, co->lg_id); - gip->lg_ptr = co; - gip->lg_what = ISCONSUMER; + gmp->lg_ident[i].lg_id = co->lg_id; + gmp->lg_ident[i].lg_ptr = co; + gmp->lg_ident[i].lg_what = ISCONSUMER; + i++; } } } @@ -498,10 +449,7 @@ geom_deletetree(struct gmesh *gmp) struct ggeom *ge; struct gprovider *pr; struct gconsumer *co; - unsigned i; - for (i = 0; gmp->lg_ident[i].lg_id != NULL; i++) - free(gmp->lg_ident[i].lg_id); free(gmp->lg_ident); gmp->lg_ident = NULL; for (;;) { Modified: head/lib/libgeom/libgeom.h ============================================================================== --- head/lib/libgeom/libgeom.h Tue Apr 10 16:33:19 2012 (r234106) +++ head/lib/libgeom/libgeom.h Tue Apr 10 17:37:24 2012 (r234107) @@ -71,8 +71,7 @@ struct gident { enum { ISCLASS, ISGEOM, ISPROVIDER, - ISCONSUMER, - ISUNRESOLVED } lg_what; + ISCONSUMER } lg_what; }; struct gmesh { From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 19:25:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F24161065672; Tue, 10 Apr 2012 19:25:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD6628FC0A; Tue, 10 Apr 2012 19:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AJPhhE037319; Tue, 10 Apr 2012 19:25:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AJPh7T037317; Tue, 10 Apr 2012 19:25:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204101925.q3AJPh7T037317@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 19:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234109 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 19:25:44 -0000 Author: adrian Date: Tue Apr 10 19:25:43 2012 New Revision: 234109 URL: http://svn.freebsd.org/changeset/base/234109 Log: Convert the flags over to a set of bit flags. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Apr 10 19:11:09 2012 (r234108) +++ head/sys/dev/ath/if_athvar.h Tue Apr 10 19:25:43 2012 (r234109) @@ -206,18 +206,19 @@ struct ath_buf { uint16_t bfs_nframes; /* number of frames in aggregate */ uint16_t bfs_ndelim; /* number of delims for padding */ - int bfs_aggr:1; /* part of aggregate? */ - int bfs_aggrburst:1; /* part of aggregate burst? */ - int bfs_isretried:1; /* retried frame? */ - int bfs_dobaw:1; /* actually check against BAW? */ - int bfs_addedbaw:1; /* has been added to the BAW */ - int bfs_shpream:1; /* use short preamble */ - int bfs_istxfrag:1; /* is fragmented */ - int bfs_ismrr:1; /* do multi-rate TX retry */ - int bfs_doprot:1; /* do RTS/CTS based protection */ - int bfs_doratelookup:1; /* do rate lookup before each TX */ - int bfs_need_seqno:1; /* need to assign a seqno for aggregation */ - int bfs_seqno_assigned:1; /* seqno has been assigned */ + u_int32_t bfs_aggr:1, /* part of aggregate? */ + bfs_aggrburst:1, /* part of aggregate burst? */ + bfs_isretried:1, /* retried frame? */ + bfs_dobaw:1, /* actually check against BAW? */ + bfs_addedbaw:1, /* has been added to the BAW */ + bfs_shpream:1, /* use short preamble */ + bfs_istxfrag:1, /* is fragmented */ + bfs_ismrr:1, /* do multi-rate TX retry */ + bfs_doprot:1, /* do RTS/CTS based protection */ + bfs_doratelookup:1, /* do rate lookup before each TX */ + bfs_need_seqno:1, /* need to assign a seqno for aggr */ + bfs_seqno_assigned:1; /* seqno has been assigned */ + int bfs_nfl; /* next fragment length */ /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 19:47:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9F661065672 for ; Tue, 10 Apr 2012 19:47:27 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id E45638FC12 for ; Tue, 10 Apr 2012 19:47:26 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so182508lbb.13 for ; Tue, 10 Apr 2012 12:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=G5ebDz/lXDJS6/VtntBCT4PjVpxegM4+fXRs0QL5w+I=; b=JytZykrX/N9CHuz7KV27zwm8w7O1kEO2Ge1G/cnGVrCXOjqasq2/npnqiMqDZaH4hS IsiZKk+uUyTOECGOIyLDm2NSlWMDZSFVc+MOpqShUtiy9j2AbfQhqKzDe5DhWY/NMiTv FFUuqTorgpRbGLq4vr8VrukynhmTnEFk01uo6suvIlhyzySWNFQiCwnzhaV5zcEAfirX YaonEn9AzIA8bNHhXm1xBcr0zfTd2pko2tkgzEZZBD8mC/sHlsYoZujCSgQf+xMo9aHT O05QmUZARVhMQBDsBqPRpQoz5AYRlJCZbN6+0vY0mSRUcObKMfnqGI6rMmWC9Bm+0kmU GADQ== Received: by 10.152.131.66 with SMTP id ok2mr16000296lab.10.1334087245634; Tue, 10 Apr 2012 12:47:25 -0700 (PDT) Received: from [10.254.254.77] ([109.252.212.252]) by mx.google.com with ESMTPS id mr15sm286685lab.8.2012.04.10.12.47.24 (version=SSLv3 cipher=OTHER); Tue, 10 Apr 2012 12:47:25 -0700 (PDT) Message-ID: <4F848E4B.8020302@zonov.org> Date: Tue, 10 Apr 2012 23:47:23 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: John Baldwin References: <201204051713.q35HDE3d067735@svn.freebsd.org> In-Reply-To: <201204051713.q35HDE3d067735@svn.freebsd.org> Content-Type: multipart/mixed; boundary="------------080007010705000102020006" X-Gm-Message-State: ALoCoQkufsNshmU8Sd3r04PX70dbFBMbP34K6SsDWxilvxio0gOu49VnBe93p70WLPf/k2Skkr4m Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233925 - in head: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 19:47:27 -0000 This is a multi-part message in MIME format. --------------080007010705000102020006 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05.04.2012 21:13, John Baldwin wrote: > Author: jhb > Date: Thu Apr 5 17:13:14 2012 > New Revision: 233925 > URL: http://svn.freebsd.org/changeset/base/233925 > > Log: > Add new ktrace records for the start and end of VM faults. This gives > a pair of records similar to syscall entry and return that a user can > use to determine how long page faults take. The new ktrace records are > enabled via the 'p' trace type, and are enabled in the default set of > trace points. > > Reviewed by: kib > MFC after: 2 weeks > Hi John, Thanks a lot, this change is very useful! And while you are here I would like to show you a patch which adds a "wmesg" to the context switch tracing. It is not finished, it's just a concept. Please review it and if you are interesting in that I'll finish it and will test more widely. -- Andrey Zonov --------------080007010705000102020006 Content-Type: text/plain; charset=windows-1251; name="ktrace_csw.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ktrace_csw.patch" SW5kZXg6IHVzci5iaW4va2R1bXAva2R1bXAuYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3IuYmlu L2tkdW1wL2tkdW1wLmMJKHJldmlzaW9uIDIzMzkyNSkKKysrIHVzci5iaW4va2R1bXAva2R1 bXAuYwkod29ya2luZyBjb3B5KQpAQCAtMTI0Nyw4ICsxMjQ3LDggQEAga3RycHNpZyhzdHJ1 Y3Qga3RyX3BzaWcgKnBzaWcpCiB2b2lkCiBrdHJjc3coc3RydWN0IGt0cl9jc3cgKmNzKQog ewotCXByaW50ZigiJXMgJXNcbiIsIGNzLT5vdXQgPyAic3RvcCIgOiAicmVzdW1lIiwKLQkJ Y3MtPnVzZXIgPyAidXNlciIgOiAia2VybmVsIik7CisJcHJpbnRmKCIlcyAlcyBcIiVzXCJc biIsIGNzLT5vdXQgPyAic3RvcCIgOiAicmVzdW1lIiwKKwkJY3MtPnVzZXIgPyAidXNlciIg OiAia2VybmVsIiwgY3MtPndtZXNnID8gY3MtPndtZXNnIDogIiIpOwogfQogCiAjZGVmaW5l CVVUUkFDRV9ETE9QRU5fU1RBUlQJCTEKSW5kZXg6IHN5cy9zeXMva3RyYWNlLmgKPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQotLS0gc3lzL3N5cy9rdHJhY2UuaAkocmV2aXNpb24gMjMzOTI1KQorKysgc3lz L3N5cy9rdHJhY2UuaAkod29ya2luZyBjb3B5KQpAQCAtMTM4LDYgKzEzOCw3IEBAIHN0cnVj dCBrdHJfcHNpZyB7CiBzdHJ1Y3Qga3RyX2NzdyB7CiAJaW50CW91dDsJLyogMSBpZiBzd2l0 Y2ggb3V0LCAwIGlmIHN3aXRjaCBpbiAqLwogCWludAl1c2VyOwkvKiAxIGlmIHVzZXJtb2Rl IChpdmNzdyksIDAgaWYga2VybmVsICh2Y3N3KSAqLworCWNoYXIJd21lc2dbOF07CiB9Owog CiAvKgpAQCAtMjQ0LDcgKzI0NSw3IEBAIHN0cnVjdCBrdHJfZmF1bHRlbmQgewogCiAjaWZk ZWYJX0tFUk5FTAogdm9pZAlrdHJuYW1laShjaGFyICopOwotdm9pZAlrdHJjc3coaW50LCBp bnQpOwordm9pZAlrdHJjc3coaW50LCBpbnQsIGNvbnN0IGNoYXIgKik7CiB2b2lkCWt0cnBz aWcoaW50LCBzaWdfdCwgc2lnc2V0X3QgKiwgaW50KTsKIHZvaWQJa3RyZmF1bHQodm1fb2Zm c2V0X3QsIGludCk7CiB2b2lkCWt0cmZhdWx0ZW5kKGludCk7CkluZGV4OiBzeXMva2Vybi9r ZXJuX2t0cmFjZS5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL2tlcm5fa3RyYWNlLmMJ KHJldmlzaW9uIDIzMzkyNSkKKysrIHN5cy9rZXJuL2tlcm5fa3RyYWNlLmMJKHdvcmtpbmcg Y29weSkKQEAgLTczMyw4ICs3MzMsOSBAQCBrdHJwc2lnKHNpZywgYWN0aW9uLCBtYXNrLCBj b2RlKQogfQogCiB2b2lkCi1rdHJjc3cob3V0LCB1c2VyKQora3RyY3N3KG91dCwgdXNlciwg d21lc2cpCiAJaW50IG91dCwgdXNlcjsKKwljb25zdCBjaGFyICp3bWVzZzsKIHsKIAlzdHJ1 Y3QgdGhyZWFkICp0ZCA9IGN1cnRocmVhZDsKIAlzdHJ1Y3Qga3RyX3JlcXVlc3QgKnJlcTsK QEAgLTc0Niw2ICs3NDcsOCBAQCB2b2lkCiAJa2MgPSAmcmVxLT5rdHJfZGF0YS5rdHJfY3N3 OwogCWtjLT5vdXQgPSBvdXQ7CiAJa2MtPnVzZXIgPSB1c2VyOworCWlmICh3bWVzZyAhPSBO VUxMKQorCQlzdHJuY3B5KGtjLT53bWVzZywgd21lc2csIHNpemVvZihrYy0+d21lc2cpKTsK IAlrdHJfZW5xdWV1ZXJlcXVlc3QodGQsIHJlcSk7CiAJa3RyYWNlX2V4aXQodGQpOwogfQpJ bmRleDogc3lzL2tlcm4vc3Vicl90cmFwLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2tlcm4v c3Vicl90cmFwLmMJKHJldmlzaW9uIDIzMzkyNSkKKysrIHN5cy9rZXJuL3N1YnJfdHJhcC5j CSh3b3JraW5nIGNvcHkpCkBAIC0yMTksNyArMjE5LDcgQEAgYXN0KHN0cnVjdCB0cmFwZnJh bWUgKmZyYW1lcCkKIAlpZiAoZmxhZ3MgJiBUREZfTkVFRFJFU0NIRUQpIHsKICNpZmRlZiBL VFJBQ0UKIAkJaWYgKEtUUlBPSU5UKHRkLCBLVFJfQ1NXKSkKLQkJCWt0cmNzdygxLCAxKTsK KwkJCWt0cmNzdygxLCAxLCBOVUxMKTsKICNlbmRpZgogCQl0aHJlYWRfbG9jayh0ZCk7CiAJ CXNjaGVkX3ByaW8odGQsIHRkLT50ZF91c2VyX3ByaSk7CkBAIC0yMjcsNyArMjI3LDcgQEAg YXN0KHN0cnVjdCB0cmFwZnJhbWUgKmZyYW1lcCkKIAkJdGhyZWFkX3VubG9jayh0ZCk7CiAj aWZkZWYgS1RSQUNFCiAJCWlmIChLVFJQT0lOVCh0ZCwgS1RSX0NTVykpCi0JCQlrdHJjc3co MCwgMSk7CisJCQlrdHJjc3coMCwgMSwgTlVMTCk7CiAjZW5kaWYKIAl9CiAKSW5kZXg6IHN5 cy9rZXJuL2tlcm5fY29uZHZhci5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL2tlcm5f Y29uZHZhci5jCShyZXZpc2lvbiAyMzM5MjUpCisrKyBzeXMva2Vybi9rZXJuX2NvbmR2YXIu Ywkod29ya2luZyBjb3B5KQpAQCAtMTAzLDcgKzEwMyw3IEBAIF9jdl93YWl0KHN0cnVjdCBj diAqY3ZwLCBzdHJ1Y3QgbG9ja19vYmplY3QgKmxvY2spCiAJbG9ja19zdGF0ZSA9IDA7CiAj aWZkZWYgS1RSQUNFCiAJaWYgKEtUUlBPSU5UKHRkLCBLVFJfQ1NXKSkKLQkJa3RyY3N3KDEs IDApOworCQlrdHJjc3coMSwgMCwgTlVMTCk7CiAjZW5kaWYKIAlDVl9BU1NFUlQoY3ZwLCBs b2NrLCB0ZCk7CiAJV0lUTkVTU19XQVJOKFdBUk5fR0lBTlRPSyB8IFdBUk5fU0xFRVBPSywg bG9jaywKQEAgLTE0MCw3ICsxNDAsNyBAQCBfY3Zfd2FpdChzdHJ1Y3QgY3YgKmN2cCwgc3Ry dWN0IGxvY2tfb2JqZWN0ICpsb2NrKQogCiAjaWZkZWYgS1RSQUNFCiAJaWYgKEtUUlBPSU5U KHRkLCBLVFJfQ1NXKSkKLQkJa3RyY3N3KDAsIDApOworCQlrdHJjc3coMCwgMCwgTlVMTCk7 CiAjZW5kaWYKIAlQSUNLVVBfR0lBTlQoKTsKIAlpZiAobG9jayAhPSAmR2lhbnQubG9ja19v YmplY3QpIHsKQEAgLTE2Miw3ICsxNjIsNyBAQCBfY3Zfd2FpdF91bmxvY2soc3RydWN0IGN2 ICpjdnAsIHN0cnVjdCBsb2NrX29iamVjdAogCXRkID0gY3VydGhyZWFkOwogI2lmZGVmIEtU UkFDRQogCWlmIChLVFJQT0lOVCh0ZCwgS1RSX0NTVykpCi0JCWt0cmNzdygxLCAwKTsKKwkJ a3RyY3N3KDEsIDAsIE5VTEwpOwogI2VuZGlmCiAJQ1ZfQVNTRVJUKGN2cCwgbG9jaywgdGQp OwogCVdJVE5FU1NfV0FSTihXQVJOX0dJQU5UT0sgfCBXQVJOX1NMRUVQT0ssIGxvY2ssCkBA IC0xOTcsNyArMTk3LDcgQEAgX2N2X3dhaXRfdW5sb2NrKHN0cnVjdCBjdiAqY3ZwLCBzdHJ1 Y3QgbG9ja19vYmplY3QKIAogI2lmZGVmIEtUUkFDRQogCWlmIChLVFJQT0lOVCh0ZCwgS1RS X0NTVykpCi0JCWt0cmNzdygwLCAwKTsKKwkJa3RyY3N3KDAsIDAsIE5VTEwpOwogI2VuZGlm CiAJUElDS1VQX0dJQU5UKCk7CiB9CkBAIC0yMjAsNyArMjIwLDcgQEAgX2N2X3dhaXRfc2ln KHN0cnVjdCBjdiAqY3ZwLCBzdHJ1Y3QgbG9ja19vYmplY3QgKmwKIAlsb2NrX3N0YXRlID0g MDsKICNpZmRlZiBLVFJBQ0UKIAlpZiAoS1RSUE9JTlQodGQsIEtUUl9DU1cpKQotCQlrdHJj c3coMSwgMCk7CisJCWt0cmNzdygxLCAwLCBOVUxMKTsKICNlbmRpZgogCUNWX0FTU0VSVChj dnAsIGxvY2ssIHRkKTsKIAlXSVRORVNTX1dBUk4oV0FSTl9HSUFOVE9LIHwgV0FSTl9TTEVF UE9LLCBsb2NrLApAQCAtMjU4LDcgKzI1OCw3IEBAIF9jdl93YWl0X3NpZyhzdHJ1Y3QgY3Yg KmN2cCwgc3RydWN0IGxvY2tfb2JqZWN0ICpsCiAKICNpZmRlZiBLVFJBQ0UKIAlpZiAoS1RS UE9JTlQodGQsIEtUUl9DU1cpKQotCQlrdHJjc3coMCwgMCk7CisJCWt0cmNzdygwLCAwLCBO VUxMKTsKICNlbmRpZgogCVBJQ0tVUF9HSUFOVCgpOwogCWlmIChsb2NrICE9ICZHaWFudC5s b2NrX29iamVjdCkgewpAQCAtMjg2LDcgKzI4Niw3IEBAIF9jdl90aW1lZHdhaXQoc3RydWN0 IGN2ICpjdnAsIHN0cnVjdCBsb2NrX29iamVjdCAqCiAJbG9ja19zdGF0ZSA9IDA7CiAjaWZk ZWYgS1RSQUNFCiAJaWYgKEtUUlBPSU5UKHRkLCBLVFJfQ1NXKSkKLQkJa3RyY3N3KDEsIDAp OworCQlrdHJjc3coMSwgMCwgTlVMTCk7CiAjZW5kaWYKIAlDVl9BU1NFUlQoY3ZwLCBsb2Nr LCB0ZCk7CiAJV0lUTkVTU19XQVJOKFdBUk5fR0lBTlRPSyB8IFdBUk5fU0xFRVBPSywgbG9j aywKQEAgLTMyNCw3ICszMjQsNyBAQCBfY3ZfdGltZWR3YWl0KHN0cnVjdCBjdiAqY3ZwLCBz dHJ1Y3QgbG9ja19vYmplY3QgKgogCiAjaWZkZWYgS1RSQUNFCiAJaWYgKEtUUlBPSU5UKHRk LCBLVFJfQ1NXKSkKLQkJa3RyY3N3KDAsIDApOworCQlrdHJjc3coMCwgMCwgTlVMTCk7CiAj ZW5kaWYKIAlQSUNLVVBfR0lBTlQoKTsKIAlpZiAobG9jayAhPSAmR2lhbnQubG9ja19vYmpl Y3QpIHsKQEAgLTM1Myw3ICszNTMsNyBAQCBfY3ZfdGltZWR3YWl0X3NpZyhzdHJ1Y3QgY3Yg KmN2cCwgc3RydWN0IGxvY2tfb2JqZQogCWxvY2tfc3RhdGUgPSAwOwogI2lmZGVmIEtUUkFD RQogCWlmIChLVFJQT0lOVCh0ZCwgS1RSX0NTVykpCi0JCWt0cmNzdygxLCAwKTsKKwkJa3Ry Y3N3KDEsIDAsIE5VTEwpOwogI2VuZGlmCiAJQ1ZfQVNTRVJUKGN2cCwgbG9jaywgdGQpOwog CVdJVE5FU1NfV0FSTihXQVJOX0dJQU5UT0sgfCBXQVJOX1NMRUVQT0ssIGxvY2ssCkBAIC0z OTIsNyArMzkyLDcgQEAgX2N2X3RpbWVkd2FpdF9zaWcoc3RydWN0IGN2ICpjdnAsIHN0cnVj dCBsb2NrX29iamUKIAogI2lmZGVmIEtUUkFDRQogCWlmIChLVFJQT0lOVCh0ZCwgS1RSX0NT VykpCi0JCWt0cmNzdygwLCAwKTsKKwkJa3RyY3N3KDAsIDAsIE5VTEwpOwogI2VuZGlmCiAJ UElDS1VQX0dJQU5UKCk7CiAJaWYgKGxvY2sgIT0gJkdpYW50LmxvY2tfb2JqZWN0KSB7Cklu ZGV4OiBzeXMva2Vybi9rZXJuX3N5bmNoLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2tlcm4v a2Vybl9zeW5jaC5jCShyZXZpc2lvbiAyMzM5MjUpCisrKyBzeXMva2Vybi9rZXJuX3N5bmNo LmMJKHdvcmtpbmcgY29weSkKQEAgLTE0Miw3ICsxNDIsNyBAQCBfc2xlZXAodm9pZCAqaWRl bnQsIHN0cnVjdCBsb2NrX29iamVjdCAqbG9jaywgaW50CiAJcCA9IHRkLT50ZF9wcm9jOwog I2lmZGVmIEtUUkFDRQogCWlmIChLVFJQT0lOVCh0ZCwgS1RSX0NTVykpCi0JCWt0cmNzdygx LCAwKTsKKwkJa3RyY3N3KDEsIDAsIHdtZXNnKTsKICNlbmRpZgogCVdJVE5FU1NfV0FSTihX QVJOX0dJQU5UT0sgfCBXQVJOX1NMRUVQT0ssIGxvY2ssCiAJICAgICJTbGVlcGluZyBvbiBc IiVzXCIiLCB3bWVzZyk7CkBAIC0yMzYsNyArMjM2LDcgQEAgX3NsZWVwKHZvaWQgKmlkZW50 LCBzdHJ1Y3QgbG9ja19vYmplY3QgKmxvY2ssIGludAogCX0KICNpZmRlZiBLVFJBQ0UKIAlp ZiAoS1RSUE9JTlQodGQsIEtUUl9DU1cpKQotCQlrdHJjc3coMCwgMCk7CisJCWt0cmNzdygw LCAwLCB3bWVzZyk7CiAjZW5kaWYKIAlQSUNLVVBfR0lBTlQoKTsKIAlpZiAobG9jayAhPSBO VUxMICYmIGxvY2sgIT0gJkdpYW50LmxvY2tfb2JqZWN0ICYmICEocHJpb3JpdHkgJiBQRFJP UCkpIHsKQEAgLTI5OCw3ICsyOTgsNyBAQCBtc2xlZXBfc3Bpbih2b2lkICppZGVudCwgc3Ry dWN0IG10eCAqbXR4LCBjb25zdCBjaAogI2lmZGVmIEtUUkFDRQogCWlmIChLVFJQT0lOVCh0 ZCwgS1RSX0NTVykpIHsKIAkJc2xlZXBxX3JlbGVhc2UoaWRlbnQpOwotCQlrdHJjc3coMSwg MCk7CisJCWt0cmNzdygxLCAwLCB3bWVzZyk7CiAJCXNsZWVwcV9sb2NrKGlkZW50KTsKIAl9 CiAjZW5kaWYKQEAgLTMxNiw3ICszMTYsNyBAQCBtc2xlZXBfc3Bpbih2b2lkICppZGVudCwg c3RydWN0IG10eCAqbXR4LCBjb25zdCBjaAogCX0KICNpZmRlZiBLVFJBQ0UKIAlpZiAoS1RS UE9JTlQodGQsIEtUUl9DU1cpKQotCQlrdHJjc3coMCwgMCk7CisJCWt0cmNzdygwLCAwLCB3 bWVzZyk7CiAjZW5kaWYKIAlQSUNLVVBfR0lBTlQoKTsKIAltdHhfbG9ja19zcGluKG10eCk7 Cg== --------------080007010705000102020006-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 19:47:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D5B910656B5; Tue, 10 Apr 2012 19:47:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789248FC1B; Tue, 10 Apr 2012 19:47:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3AJljXD038023; Tue, 10 Apr 2012 19:47:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3AJljRD038021; Tue, 10 Apr 2012 19:47:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204101947.q3AJljRD038021@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Apr 2012 19:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234110 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 19:47:45 -0000 Author: adrian Date: Tue Apr 10 19:47:44 2012 New Revision: 234110 URL: http://svn.freebsd.org/changeset/base/234110 Log: Fix compilation with IEEE80211_ENABLE_SUPERG defined. PR: kern/164951 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 10 19:25:43 2012 (r234109) +++ head/sys/dev/ath/if_ath.c Tue Apr 10 19:47:44 2012 (r234110) @@ -4906,6 +4906,7 @@ ath_tx_processq(struct ath_softc *sc, st struct ath_tx_status *ts; struct ieee80211_node *ni; struct ath_node *an; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; int nacked; HAL_STATUS status; From owner-svn-src-head@FreeBSD.ORG Tue Apr 10 20:17:01 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBBEB106566B; Tue, 10 Apr 2012 20:17:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 547028FC12; Tue, 10 Apr 2012 20:17:00 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA16626; Tue, 10 Apr 2012 23:16:58 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1SHhUo-000IZ1-4s; Tue, 10 Apr 2012 23:16:58 +0300 Message-ID: <4F849538.9000604@FreeBSD.org> Date: Tue, 10 Apr 2012 23:16:56 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120317 Thunderbird/10.0.3 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201204101633.q3AGXJjG031714@svn.freebsd.org> In-Reply-To: <201204101633.q3AGXJjG031714@svn.freebsd.org> X-Enigmail-Version: 1.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Jim Harris , Scott Long , Alexander Motin Subject: Re: svn commit: r234106 - head/sys/dev/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2012 20:17:02 -0000 on 10/04/2012 19:33 Jim Harris said the following: > Author: jimharris > Date: Tue Apr 10 16:33:19 2012 > New Revision: 234106 > URL: http://svn.freebsd.org/changeset/base/234106 > > Log: > Queue CCBs internally instead of using CAM_REQUEUE_REQ status. This fixes > problem where userspace apps such as smartctl fail due to CAM_REQUEUE_REQ > status getting returned when tagged commands are outstanding when smartctl > sends its I/O using the pass(4) interface. > > Sponsored by: Intel > Found and tested by: Ravi Pokala > Reviewed by: scottl > Approved by: scottl > MFC after: 1 week Once upon a time I had an idea that CAM_REQUEUE_REQ should never be leaked to userland and always re-queued. But our SCSI experts were against that. (I don't recall the exact argument, but I think that it was something about target emulation). So there is at least one other driver that likely needs the same kind of change. Maybe we should have some common infrastructure to support "really re-queue this CCB" case, so that each driver doesn't have to re-implement it? Or maybe CAM_REQUEUE_REQ should become that kind of command, after all. [Just thinking out loud] -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 00:00:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B673F106564A; Wed, 11 Apr 2012 00:00:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C15D8FC08; Wed, 11 Apr 2012 00:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B00fir046056; Wed, 11 Apr 2012 00:00:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B00fQT046048; Wed, 11 Apr 2012 00:00:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204110000.q3B00fQT046048@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 11 Apr 2012 00:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234115 - in head: lib/libc/powerpc/gen lib/libc/powerpc64/gen sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 00:00:41 -0000 Author: nwhitehorn Date: Wed Apr 11 00:00:40 2012 New Revision: 234115 URL: http://svn.freebsd.org/changeset/base/234115 Log: Do not restore the register holding the TLS pointer when doing various usermode context switches (long jumps and ucontext operations). If these are used across threads, multiple threads can end up with the same TLS base. Madness will then result. This makes behavior on PPC match that on x86 systems and on Linux. MFC after: 10 days Modified: head/lib/libc/powerpc/gen/_setjmp.S head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc/gen/sigsetjmp.S head/lib/libc/powerpc64/gen/_setjmp.S head/lib/libc/powerpc64/gen/setjmp.S head/lib/libc/powerpc64/gen/sigsetjmp.S head/sys/powerpc/powerpc/exec_machdep.c Modified: head/lib/libc/powerpc/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/_setjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc/gen/_setjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -63,7 +63,6 @@ ENTRY(_longjmp) lmw %r9,20(%r3) mtlr %r11 mtcr %r12 - mr %r2,%r9 mr %r1,%r10 or. %r3,%r4,%r4 bnelr Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc/gen/setjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -75,7 +75,6 @@ ENTRY(__longjmp) mr %r6,%r4 /* save val param */ mtlr %r11 /* r11 -> link reg */ mtcr %r12 /* r12 -> condition reg */ - mr %r2,%r9 /* r9 -> global ptr */ mr %r1,%r10 /* r10 -> stackptr */ mr %r4,%r3 li %r3,3 /* SIG_SETMASK */ Modified: head/lib/libc/powerpc/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/sigsetjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc/gen/sigsetjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -80,7 +80,6 @@ ENTRY(siglongjmp) mr %r6,%r4 mtlr %r11 mtcr %r12 - mr %r2,%r9 mr %r1,%r10 or. %r7,%r7,%r7 beq 1f Modified: head/lib/libc/powerpc64/gen/_setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/_setjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc64/gen/_setjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -86,7 +86,6 @@ ENTRY(_longjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc64/gen/setjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -99,7 +99,6 @@ ENTRY(__longjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: head/lib/libc/powerpc64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/sigsetjmp.S Tue Apr 10 22:46:40 2012 (r234114) +++ head/lib/libc/powerpc64/gen/sigsetjmp.S Wed Apr 11 00:00:40 2012 (r234115) @@ -103,7 +103,6 @@ ENTRY(siglongjmp) ld %r10,40 + 1*8(%r3) ld %r11,40 + 2*8(%r3) ld %r12,40 + 3*8(%r3) - ld %r13,40 + 4*8(%r3) ld %r14,40 + 5*8(%r3) ld %r15,40 + 6*8(%r3) ld %r16,40 + 7*8(%r3) Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Tue Apr 10 22:46:40 2012 (r234114) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Apr 11 00:00:40 2012 (r234115) @@ -441,6 +441,7 @@ set_mcontext(struct thread *td, const mc { struct pcb *pcb; struct trapframe *tf; + register_t tls; pcb = td->td_pcb; tf = td->td_frame; @@ -448,16 +449,25 @@ set_mcontext(struct thread *td, const mc if (mcp->mc_vers != _MC_VERSION || mcp->mc_len != sizeof(*mcp)) return (EINVAL); - #ifdef AIM +#ifdef AIM /* * Don't let the user set privileged MSR bits */ if ((mcp->mc_srr1 & PSL_USERSTATIC) != (tf->srr1 & PSL_USERSTATIC)) { return (EINVAL); } - #endif +#endif + /* Copy trapframe, preserving TLS pointer across context change */ + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + tls = tf->fixreg[13]; + else + tls = tf->fixreg[2]; memcpy(tf, mcp->mc_frame, sizeof(mcp->mc_frame)); + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + tf->fixreg[13] = tls; + else + tf->fixreg[2] = tls; #ifdef AIM if (mcp->mc_flags & _MC_FP_VALID) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 00:03:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86B3B106566B; Wed, 11 Apr 2012 00:03:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 203B98FC08; Wed, 11 Apr 2012 00:03:39 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q3B03U5D013128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Apr 2012 10:03:32 +1000 Date: Wed, 11 Apr 2012 10:03:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jaakko Heinonen In-Reply-To: <201204101559.q3AFxbX2030563@svn.freebsd.org> Message-ID: <20120411085433.S1057@besplex.bde.org> References: <201204101559.q3AFxbX2030563@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234103 - in head: lib/libc/sys sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 00:03:40 -0000 On Tue, 10 Apr 2012, Jaakko Heinonen wrote: > Log: > - Return EPERM from ufs_setattr() when an user without PRIV_VFS_SYSFLAGS > privilege attempts to toggle SF_SETTABLE flags. > - Use the '^' operator in the SF_SNAPSHOT anti-toggling check. > > Flags are now stored to ip->i_flags in one place after all checks. > > Submitted by: bde Thanks. The first point fixes longstanding brokenness of chflags(2). > ... > Modified: head/lib/libc/sys/chflags.2 > ============================================================================== > --- head/lib/libc/sys/chflags.2 Tue Apr 10 15:58:22 2012 (r234102) > +++ head/lib/libc/sys/chflags.2 Tue Apr 10 15:59:37 2012 (r234103) > @@ -28,7 +28,7 @@ > .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 > .\" $FreeBSD$ > .\" > -.Dd Oct 29, 2010 > +.Dd Apr 10, 2012 > .Dt CHFLAGS 2 > .Os > .Sh NAME > @@ -114,8 +114,7 @@ The > and > .Dv SF_ARCHIVED > flags may only be set or unset by the super-user. > -Attempts to set these flags by non-super-users are rejected, attempts by > -non-superusers to clear flags that are already unset are silently ignored. > +Attempts to toggle these flags by non-super-users are rejected. > These flags may be set at any time, but normally may only be unset when > the system is in single-user mode. > (See The fixed semantics are documented here. Previously, normal read-modify- write didn't work for non-super-users when trying to change user flags while preserving system flags that don't prevent user changes (SF_ARCHIVED and SF_SNAPSHOT). Naive programs like chflags(1) didn't understand the complications and just did a normal read-modify-write. A few more changes in the man page are needed. Quoting "man ./chflags.2 | col -bx": % ERRORS % The chflags() system call will fail if: % ... % [EPERM] A non-super-user tries to set one of SF_ARCHIVED, % SF_IMMUTABLE, SF_APPEND, or SF_NOUNLINK. s/set/toggle/ s/tries to/attempted to/ This fixes this part of the man page not being as formal as the rest. This is the only man page in all of libc/sys that uses the expression "tries to". 3 lines use the correct tense "tried to". 14 lines use "attempted to". I got the changed wording mostly from getpriority.2. The other (mostly worse) variations with "attempt" and "super" are: % clock_gettime.2:A user other than the super-user attempted to set the time. % ffclock.2:A user other than the super-user attempted to set the feed-forward clock % getpriority.2:A non super-user attempted to lower a process priority. % gettimeofday.2:A user other than the super-user attempted to set the time. % jail.2:A user other than the super-user attempted to attach to or remove a jail. % kenv.2:a user other than the superuser attempted to set or unset a kernel Most of these presume that there is only 1 super-user. "non-super-user" avoids this and is shorter. Apparently, "non-super-user" should be hyhenated after "non", since 5 lines do it and only the above line in getpriority.2 doesn't do it. kenv.2 is also missing capitalization of the sentence and hyphenation of super-user. 99 lines hyphenate super-user, and only 16 don't. % % [EPERM] User tries to set or remove the SF_SNAPSHOT flag. s/User tries to set or remove/An attempt was made to toggle/ This sentence had many more bugs: - missing article before "User" - but "User" was just misleading -- the error applies to all callers - "tries to" was informal - "set or remove" was less clear than "toggle". % ... % The fchflags() system call will fail if: % ... % [EPERM] A non-super-user tries to set one of SF_ARCHIVED, % SF_IMMUTABLE, SF_APPEND, or SF_NOUNLINK. % % [EPERM] User tries to set or remove the SF_SNAPSHOT flag. As above. Reviewing all other FreeBSD changes to chflags.2 showed a few more problems: - the description of SF_SNAPSHOT says "cannot be changed". "cannot be toggled" would be clearer. It also says "by any user", and as above, "user" is just misleading. It is this syscall that cannot change SF_SNAPSHOT. - the main description and the 2 EPERM error descriptions of SF_IMMUTABLE, etc., presume only 1 super-user - the EOPNOTSUPP error description still says "the underlying file system does not support file flags", but this error can now happen even for ffs when the underlying file system doesn't support at least one of the flags that the syscall attempted to set - lchflags() is missing in HISTORY. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 02:34:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B382106566C; Wed, 11 Apr 2012 02:34:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E6C8FC0A; Wed, 11 Apr 2012 02:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B2YW7U050815; Wed, 11 Apr 2012 02:34:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B2YWRE050813; Wed, 11 Apr 2012 02:34:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204110234.q3B2YWRE050813@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Apr 2012 02:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234117 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 02:34:33 -0000 Author: adrian Date: Wed Apr 11 02:34:32 2012 New Revision: 234117 URL: http://svn.freebsd.org/changeset/base/234117 Log: Fix the default, non-superg compile. Pointy-hat-to: adrian Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Apr 11 00:28:44 2012 (r234116) +++ head/sys/dev/ath/if_ath.c Wed Apr 11 02:34:32 2012 (r234117) @@ -4906,7 +4906,9 @@ ath_tx_processq(struct ath_softc *sc, st struct ath_tx_status *ts; struct ieee80211_node *ni; struct ath_node *an; +#ifdef IEEE80211_SUPPORT_SUPERG struct ieee80211com *ic = sc->sc_ifp->if_l2com; +#endif /* IEEE80211_SUPPORT_SUPERG */ int nacked; HAL_STATUS status; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 02:42:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E208106566C; Wed, 11 Apr 2012 02:42:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E35718FC14; Wed, 11 Apr 2012 02:42:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B2g1He051067; Wed, 11 Apr 2012 02:42:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B2g1GF051063; Wed, 11 Apr 2012 02:42:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201204110242.q3B2g1GF051063@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 11 Apr 2012 02:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234118 - in head/sys: conf dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 02:42:02 -0000 Author: marcel Date: Wed Apr 11 02:42:01 2012 New Revision: 234118 URL: http://svn.freebsd.org/changeset/base/234118 Log: uart_cpu_amd64.c and uart_cpu_i386.c (under sys/dev/uart) are identical now that the bus spaces are unified under sys/x86. Replace them with a single uart_cpu_x86.c. o delete uart_cpu_i386.c o move uart_cpu_amd64.c to uart_cpu_x86.c o update files.amd64 and files.i386 accordingly. Added: head/sys/dev/uart/uart_cpu_x86.c - copied unchanged from r234116, head/sys/dev/uart/uart_cpu_amd64.c Deleted: head/sys/dev/uart/uart_cpu_amd64.c head/sys/dev/uart/uart_cpu_i386.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Apr 11 02:34:32 2012 (r234117) +++ head/sys/conf/files.amd64 Wed Apr 11 02:42:01 2012 (r234118) @@ -267,7 +267,7 @@ dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa -dev/uart/uart_cpu_amd64.c optional uart +dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd dev/wbwd/wbwd.c optional wbwd dev/wpi/if_wpi.c optional wpi Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Apr 11 02:34:32 2012 (r234117) +++ head/sys/conf/files.i386 Wed Apr 11 02:42:01 2012 (r234118) @@ -244,7 +244,7 @@ dev/syscons/scvtb.c optional sc dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa -dev/uart/uart_cpu_i386.c optional uart +dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard Copied: head/sys/dev/uart/uart_cpu_x86.c (from r234116, head/sys/dev/uart/uart_cpu_amd64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_cpu_x86.c Wed Apr 11 02:42:01 2012 (r234118, copy of r234116, head/sys/dev/uart/uart_cpu_amd64.c) @@ -0,0 +1,107 @@ +/*- + * Copyright (c) 2003, 2004 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO; +bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM; + +int +uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) +{ + + return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); +} + +int +uart_cpu_getdev(int devtype, struct uart_devinfo *di) +{ + struct uart_class *class; + unsigned int i, ivar; + + class = &uart_ns8250_class; + if (class == NULL) + return (ENXIO); + + /* Check the environment. */ + if (uart_getenv(devtype, di, class) == 0) + return (0); + + /* + * Scan the hints. We only try units 0 to 3 (inclusive). This + * covers the ISA legacy where 4 UARTs had their resources + * predefined. + */ + for (i = 0; i < 4; i++) { + if (resource_int_value("uart", i, "flags", &ivar)) + continue; + if (devtype == UART_DEV_CONSOLE && !UART_FLAGS_CONSOLE(ivar)) + continue; + if (devtype == UART_DEV_DBGPORT && !UART_FLAGS_DBGPORT(ivar)) + continue; + /* + * We have a possible device. Make sure it's enabled and + * that we have an I/O port. + */ + if (resource_int_value("uart", i, "disabled", &ivar) == 0 && + ivar != 0) + continue; + if (resource_int_value("uart", i, "port", &ivar) != 0 || + ivar == 0) + continue; + /* + * Got it. Fill in the instance and return it. We only have + * ns8250 and successors on i386. + */ + di->ops = uart_getops(class); + di->bas.chan = 0; + di->bas.bst = uart_bus_space_io; + if (bus_space_map(di->bas.bst, ivar, uart_getrange(class), 0, + &di->bas.bsh) != 0) + continue; + di->bas.regshft = 0; + di->bas.rclk = 0; + if (resource_int_value("uart", i, "baud", &ivar) != 0) + ivar = 0; + di->baudrate = ivar; + di->databits = 8; + di->stopbits = 1; + di->parity = UART_PARITY_NONE; + return (0); + } + + return (ENXIO); +} From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 06:34:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 612BA1065672; Wed, 11 Apr 2012 06:34:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41CAD8FC1D; Wed, 11 Apr 2012 06:34:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B6YQaq058532; Wed, 11 Apr 2012 06:34:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B6YPM0058529; Wed, 11 Apr 2012 06:34:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201204110634.q3B6YPM0058529@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 11 Apr 2012 06:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234121 - head/sys/dev/bce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 06:34:26 -0000 Author: yongari Date: Wed Apr 11 06:34:25 2012 New Revision: 234121 URL: http://svn.freebsd.org/changeset/base/234121 Log: Back out r228476. r228476 fixed superfluous link UP/DOWN messages but broke IPMI access during boot. It's not clear why r228476 breaks IPMI and should be revisited. Reported by: Paul Guyot ieee dot org > MFC after: 1 week Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed Apr 11 05:11:33 2012 (r234120) +++ head/sys/dev/bce/if_bce.c Wed Apr 11 06:34:25 2012 (r234121) @@ -1982,7 +1982,6 @@ static void bce_miibus_statchg(device_t dev) { struct bce_softc *sc; - struct ifnet *ifp; struct mii_data *mii; int val; @@ -1990,57 +1989,42 @@ bce_miibus_statchg(device_t dev) DBENTER(BCE_VERBOSE_PHY); - ifp = sc->bce_ifp; mii = device_get_softc(sc->bce_miibus); - if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - return; - sc->bce_link_up = FALSE; val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == - (IFM_ACTIVE | IFM_AVALID)) { - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_10_T: - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { - DBPRINT(sc, BCE_INFO_PHY, - "Enabling 10Mb interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII_10; - sc->bce_link_up = TRUE; - break; - } - /* FALLTHROUGH */ - case IFM_100_TX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII; - sc->bce_link_up = TRUE; - break; - case IFM_2500_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); - val |= BCE_EMAC_MODE_25G; - /* FALLTHROUGH */ - case IFM_1000_T: - case IFM_1000_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; - sc->bce_link_up = TRUE; - if (bce_verbose || bootverbose) - BCE_PRINTF("Gigabit link up!\n"); - break; - default: - DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed.\n"); + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII_10; break; } + /* fall-through */ + case IFM_100_TX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII; + break; + case IFM_2500_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); + val |= BCE_EMAC_MODE_25G; + /* fall-through */ + case IFM_1000_T: + case IFM_1000_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); + val |= BCE_EMAC_MODE_PORT_GMII; + break; + default: + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " + "default GMII interface.\n"); + val |= BCE_EMAC_MODE_PORT_GMII; } - if (sc->bce_link_up == FALSE) - return; - /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { DBPRINT(sc, BCE_INFO_PHY, @@ -2052,7 +2036,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2062,7 +2046,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -6222,11 +6206,15 @@ bce_phy_intr(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } + /* - * Link state changed, allow tick routine to update - * the state baased on actual media state. + * Assume link is down and allow + * tick routine to update the state + * based on the actual media state. */ - sc->bce_link_tick = TRUE; + sc->bce_link_up = FALSE; + callout_stop(&sc->bce_tick_callout); + bce_tick(sc); } /* Acknowledge the link change interrupt. */ @@ -6910,13 +6898,12 @@ bce_init_locked(struct bce_softc *sc) /* Enable host interrupts. */ bce_enable_intr(sc, 1); + bce_ifmedia_upd_locked(ifp); + /* Let the OS know the driver is up and running. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sc->bce_link_tick = TRUE; - bce_ifmedia_upd_locked(ifp); - callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc); bce_init_locked_exit: @@ -8212,19 +8199,31 @@ bce_tick(void *xsc) bce_watchdog(sc); /* If link is up already up then we're done. */ - if (sc->bce_link_tick == FALSE && sc->bce_link_up == TRUE) + if (sc->bce_link_up == TRUE) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ mii = device_get_softc(sc->bce_miibus); mii_tick(mii); - sc->bce_link_tick = FALSE; - /* Now that link is up, handle any outstanding TX traffic. */ - if (sc->bce_link_up == TRUE && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + /* Check if the link has come up. */ + if ((mii->mii_media_status & IFM_ACTIVE) && + (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Found pending TX traffic.\n", __FUNCTION__); - bce_start_locked(ifp); + "%s(): Link up!\n", __FUNCTION__); + sc->bce_link_up = TRUE; + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || + IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && + (bce_verbose || bootverbose)) + BCE_PRINTF("Gigabit link up!\n"); + + /* Now that link is up, handle any outstanding TX traffic. */ + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " + "pending TX traffic.\n", __FUNCTION__); + bce_start_locked(ifp); + } } bce_tick_exit: Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Wed Apr 11 05:11:33 2012 (r234120) +++ head/sys/dev/bce/if_bcereg.h Wed Apr 11 06:34:25 2012 (r234121) @@ -6560,7 +6560,6 @@ struct bce_softc u16 pg_prod; u16 pg_cons; - int bce_link_tick; int bce_link_up; struct callout bce_tick_callout; struct callout bce_pulse_callout; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 06:35:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F0C51065672; Wed, 11 Apr 2012 06:35:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0718FC1A; Wed, 11 Apr 2012 06:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B6ZDWM058592; Wed, 11 Apr 2012 06:35:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B6ZDg5058590; Wed, 11 Apr 2012 06:35:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204110635.q3B6ZDg5058590@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Apr 2012 06:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234122 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 06:35:14 -0000 Author: ae Date: Wed Apr 11 06:35:13 2012 New Revision: 234122 URL: http://svn.freebsd.org/changeset/base/234122 Log: It seems that libdisk(3) incorrectly sets d_secperunit value. Automatically fix it like GEOM_PART_BSD does. MFC after: 1 week Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Wed Apr 11 06:34:25 2012 (r234121) +++ head/sbin/bsdlabel/bsdlabel.c Wed Apr 11 06:35:13 2012 (r234122) @@ -1194,7 +1194,8 @@ checklabel(struct disklabel *lp) lp->d_interleave = vl->d_interleave; if (lp->d_secpercyl == 0) lp->d_secpercyl = vl->d_secpercyl; - if (lp->d_secperunit == 0) + if (lp->d_secperunit == 0 || + lp->d_secperunit > vl->d_secperunit) lp->d_secperunit = vl->d_secperunit; if (lp->d_bbsize == 0) lp->d_bbsize = vl->d_bbsize; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 12:26:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E592F1065673; Wed, 11 Apr 2012 12:26:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1FFC8FC15; Wed, 11 Apr 2012 12:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BCQUnJ077682; Wed, 11 Apr 2012 12:26:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BCQUUQ077680; Wed, 11 Apr 2012 12:26:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201204111226.q3BCQUUQ077680@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Apr 2012 12:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234130 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 12:26:31 -0000 Author: glebius Date: Wed Apr 11 12:26:30 2012 New Revision: 234130 URL: http://svn.freebsd.org/changeset/base/234130 Log: It is a logical error that in carp_multicast_cleanup() we look at count of addresses on a particular vhid, we should account number of addresses on cif. To achieve this we need to run carp_attach() and carp_detach() under appropriate cif lock. Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Apr 11 09:25:20 2012 (r234129) +++ head/sys/netinet/ip_carp.c Wed Apr 11 12:26:30 2012 (r234130) @@ -223,6 +223,13 @@ SYSCTL_STRUCT(_net_inet_carp, OID_AUTO, #define CIF_LOCK_ASSERT(cif) mtx_assert(&(cif)->cif_mtx, MA_OWNED) #define CIF_LOCK(cif) mtx_lock(&(cif)->cif_mtx) #define CIF_UNLOCK(cif) mtx_unlock(&(cif)->cif_mtx) +#define CIF_FREE(cif) do { \ + CIF_LOCK_ASSERT(cif); \ + if (TAILQ_EMPTY(&(cif)->cif_vrs)) \ + carp_free_if(cif); \ + else \ + CIF_UNLOCK(cif); \ +} while (0) #define CARP_LOG(...) do { \ if (carp_log > 0) \ @@ -257,6 +264,7 @@ SYSCTL_STRUCT(_net_inet_carp, OID_AUTO, static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static struct carp_softc *carp_alloc(struct ifnet *); +static void carp_detach_locked(struct ifaddr *); static void carp_destroy(struct carp_softc *); static struct carp_if *carp_alloc_if(struct ifnet *); @@ -1214,12 +1222,13 @@ carp_setrun(struct carp_softc *sc, sa_fa * Setup multicast structures. */ static int -carp_multicast_setup(struct carp_softc *sc, sa_family_t sa) +carp_multicast_setup(struct carp_if *cif, sa_family_t sa) { - struct ifnet *ifp = sc->sc_carpdev; - struct carp_if *cif = ifp->if_carp; + struct ifnet *ifp = cif->cif_ifp; int error = 0; + CIF_LOCK_ASSERT(cif); + switch (sa) { #ifdef INET case AF_INET: @@ -1232,7 +1241,9 @@ carp_multicast_setup(struct carp_softc * imo->imo_membership = (struct in_multi **)malloc( (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP, - M_WAITOK); + M_NOWAIT); + if (imo->imo_membership == NULL) + return (ENOMEM); imo->imo_mfilters = NULL; imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; imo->imo_multicast_vif = -1; @@ -1262,7 +1273,9 @@ carp_multicast_setup(struct carp_softc * im6o->im6o_membership = (struct in6_multi **)malloc( (sizeof(struct in6_multi *) * IPV6_MIN_MEMBERSHIPS), M_CARP, - M_ZERO|M_WAITOK); + M_ZERO | M_NOWAIT); + if (im6o->im6o_membership == NULL) + return (ENOMEM); im6o->im6o_mfilters = NULL; im6o->im6o_max_memberships = IPV6_MIN_MEMBERSHIPS; im6o->im6o_multicast_hlim = CARP_DFLTTL; @@ -1316,15 +1329,14 @@ carp_multicast_setup(struct carp_softc * * Free multicast structures. */ static void -carp_multicast_cleanup(struct carp_softc *sc, sa_family_t sa) +carp_multicast_cleanup(struct carp_if *cif, sa_family_t sa) { - struct ifnet *ifp = sc->sc_carpdev; - struct carp_if *cif = ifp->if_carp; + CIF_LOCK_ASSERT(cif); switch (sa) { #ifdef INET case AF_INET: - if (sc->sc_naddrs == 0) { + if (cif->cif_naddrs == 0) { struct ip_moptions *imo = &cif->cif_imo; in_leavegroup(imo->imo_membership[0], NULL); @@ -1338,7 +1350,7 @@ carp_multicast_cleanup(struct carp_softc #endif #ifdef INET6 case AF_INET6: - if (sc->sc_naddrs6 == 0) { + if (cif->cif_naddrs6 == 0) { struct ip6_moptions *im6o = &cif->cif_im6o; in6_mc_leave(im6o->im6o_membership[0], NULL); @@ -1496,12 +1508,9 @@ carp_destroy(struct carp_softc *sc) struct ifnet *ifp = sc->sc_carpdev; struct carp_if *cif = ifp->if_carp; - CIF_LOCK(cif); + CIF_LOCK_ASSERT(cif); + TAILQ_REMOVE(&cif->cif_vrs, sc, sc_list); - if (TAILQ_EMPTY(&cif->cif_vrs)) - carp_free_if(cif); - else - CIF_UNLOCK(cif); mtx_lock(&carp_mtx); LIST_REMOVE(sc, sc_next); @@ -1777,6 +1786,7 @@ int carp_attach(struct ifaddr *ifa, int vhid) { struct ifnet *ifp = ifa->ifa_ifp; + struct carp_if *cif = ifp->if_carp; struct carp_softc *sc; int index, error; @@ -1795,43 +1805,51 @@ carp_attach(struct ifaddr *ifa, int vhid return (EPROTOTYPE); } - CIF_LOCK(ifp->if_carp); + CIF_LOCK(cif); IFNET_FOREACH_CARP(ifp, sc) if (sc->sc_vhid == vhid) break; - CIF_UNLOCK(ifp->if_carp); - if (sc == NULL) + if (sc == NULL) { + CIF_UNLOCK(cif); return (ENOENT); + } if (ifa->ifa_carp) { if (ifa->ifa_carp->sc_vhid != vhid) - carp_detach(ifa); - else + carp_detach_locked(ifa); + else { + CIF_UNLOCK(cif); return (0); + } } - error = carp_multicast_setup(sc, ifa->ifa_addr->sa_family); - if (error) + error = carp_multicast_setup(cif, ifa->ifa_addr->sa_family); + if (error) { + CIF_FREE(cif); return (error); + } CARP_LOCK(sc); index = sc->sc_naddrs + sc->sc_naddrs6 + 1; if (index > sc->sc_ifasiz / sizeof(struct ifaddr *)) if ((error = carp_grow_ifas(sc)) != 0) { - carp_multicast_cleanup(sc, + carp_multicast_cleanup(cif, ifa->ifa_addr->sa_family); CARP_UNLOCK(sc); + CIF_FREE(cif); return (error); } switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: + cif->cif_naddrs++; sc->sc_naddrs++; break; #endif #ifdef INET6 case AF_INET6: + cif->cif_naddrs6++; sc->sc_naddrs6++; break; #endif @@ -1845,6 +1863,7 @@ carp_attach(struct ifaddr *ifa, int vhid carp_sc_state(sc); CARP_UNLOCK(sc); + CIF_UNLOCK(cif); return (0); } @@ -1852,11 +1871,25 @@ carp_attach(struct ifaddr *ifa, int vhid void carp_detach(struct ifaddr *ifa) { + struct ifnet *ifp = ifa->ifa_ifp; + struct carp_if *cif = ifp->if_carp; + + CIF_LOCK(cif); + carp_detach_locked(ifa); + CIF_FREE(cif); +} + +static void +carp_detach_locked(struct ifaddr *ifa) +{ + struct ifnet *ifp = ifa->ifa_ifp; + struct carp_if *cif = ifp->if_carp; struct carp_softc *sc = ifa->ifa_carp; int i, index; KASSERT(sc != NULL, ("%s: %p not attached", __func__, ifa)); + CIF_LOCK_ASSERT(cif); CARP_LOCK(sc); /* Shift array. */ @@ -1872,18 +1905,20 @@ carp_detach(struct ifaddr *ifa) switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: + cif->cif_naddrs--; sc->sc_naddrs--; break; #endif #ifdef INET6 case AF_INET6: + cif->cif_naddrs6--; sc->sc_naddrs6--; break; #endif } carp_ifa_delroute(ifa); - carp_multicast_cleanup(sc, ifa->ifa_addr->sa_family); + carp_multicast_cleanup(cif, ifa->ifa_addr->sa_family); ifa->ifa_carp = NULL; ifa_free(ifa); From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 14:08:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91AA8106564A; Wed, 11 Apr 2012 14:08:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 627638FC15; Wed, 11 Apr 2012 14:08:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BE8Ae8080945; Wed, 11 Apr 2012 14:08:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BE8A3x080941; Wed, 11 Apr 2012 14:08:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204111408.q3BE8A3x080941@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Apr 2012 14:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234131 - in head: lib/libc/sys sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 14:08:10 -0000 Author: eadler Date: Wed Apr 11 14:08:09 2012 New Revision: 234131 URL: http://svn.freebsd.org/changeset/base/234131 Log: Return EBADF instead of EMFILE from dup2 when the second argument is outside the range of valid file descriptors PR: kern/164970 Submitted by: Peter Jeremy Reviewed by: jilles Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/sys/dup.2 head/lib/libc/sys/fcntl.2 head/sys/kern/kern_descrip.c Modified: head/lib/libc/sys/dup.2 ============================================================================== --- head/lib/libc/sys/dup.2 Wed Apr 11 12:26:30 2012 (r234130) +++ head/lib/libc/sys/dup.2 Wed Apr 11 14:08:09 2012 (r234131) @@ -128,20 +128,27 @@ indicates the cause of the error. .Sh ERRORS The .Fn dup -and -.Fn dup2 -system calls fail if: +system call fails if: .Bl -tag -width Er .It Bq Er EBADF The .Fa oldd -or -.Fa newd argument is not a valid active descriptor .It Bq Er EMFILE Too many descriptors are active. .El +The +.Fn dup2 +system call fails if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa oldd +argument is not a valid active descriptor or the +.Fa newd +argument is negative or exceeds the maximum allowable descriptor number +.El .Sh SEE ALSO .Xr accept 2 , .Xr cap_new 2 , Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Wed Apr 11 12:26:30 2012 (r234130) +++ head/lib/libc/sys/fcntl.2 Wed Apr 11 14:08:09 2012 (r234131) @@ -539,8 +539,6 @@ The argument .Fa cmd is .Dv F_DUPFD -or -.Dv F_DUP2FD and the maximum number of file descriptors permitted for the process are already in use, or no file descriptors greater than or equal to Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Apr 11 12:26:30 2012 (r234130) +++ head/sys/kern/kern_descrip.c Wed Apr 11 14:08:09 2012 (r234131) @@ -817,7 +817,7 @@ do_dup(struct thread *td, int flags, int maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); PROC_UNLOCK(p); if (new >= maxfd) - return (flags & DUP_FCNTL ? EINVAL : EMFILE); + return (flags & DUP_FCNTL ? EINVAL : EBADF); FILEDESC_XLOCK(fdp); if (old >= fdp->fd_nfiles || fdp->fd_ofiles[old] == NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 14:12:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B4051065781; Wed, 11 Apr 2012 14:12:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 667F98FC0A; Wed, 11 Apr 2012 14:12:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BECT4M081111; Wed, 11 Apr 2012 14:12:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BECTCp081109; Wed, 11 Apr 2012 14:12:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204111412.q3BECTCp081109@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Apr 2012 14:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234132 - head/lib/libcrypt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 14:12:29 -0000 Author: eadler Date: Wed Apr 11 14:12:28 2012 New Revision: 234132 URL: http://svn.freebsd.org/changeset/base/234132 Log: Make the item numbers match the crypt magic number PR: docs/166497 Submitted by: Mike Kelly Approved by: cperciva MFC after: 1 week Modified: head/lib/libcrypt/crypt.3 Modified: head/lib/libcrypt/crypt.3 ============================================================================== --- head/lib/libcrypt/crypt.3 Wed Apr 11 14:08:09 2012 (r234131) +++ head/lib/libcrypt/crypt.3 Wed Apr 11 14:12:28 2012 (r234132) @@ -187,6 +187,8 @@ Blowfish .It NT-Hash .It +(unused) +.It SHA-256 .It SHA-512 From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 14:13:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C541065678; Wed, 11 Apr 2012 14:13:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31968FC20; Wed, 11 Apr 2012 14:13:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BEDMr8081170; Wed, 11 Apr 2012 14:13:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BEDMU4081168; Wed, 11 Apr 2012 14:13:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204111413.q3BEDMU4081168@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Apr 2012 14:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234133 - head/etc/root X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 14:13:23 -0000 Author: eadler Date: Wed Apr 11 14:13:22 2012 New Revision: 234133 URL: http://svn.freebsd.org/changeset/base/234133 Log: - remove the length shortening on the path - make the default prompt a bit more like scp - make the user show as root even when using 'su' instead of 'su -' - the key bindings didn't hurt anything but likely hide a bug - merge history instead of overwriting it Submitted by: gavin, joel Approved by: cperciva Modified: head/etc/root/dot.cshrc Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Wed Apr 11 14:12:28 2012 (r234132) +++ head/etc/root/dot.cshrc Wed Apr 11 14:13:22 2012 (r234133) @@ -23,12 +23,15 @@ setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up - set prompt = "%n@%m:%c04%# " + if ($uid == 0) then + set user = root + endif + set prompt = "%n@%m:%/ %# " set promptchars = "%#" set filec set history = 1000 - set savehist = 1000 + set savehist = (1000 merge) set autolist = ambiguous # Use history to aid expansion set autoexpand @@ -38,10 +41,6 @@ if ($?prompt) then bindkey "^W" backward-delete-word bindkey -k up history-search-backward bindkey -k down history-search-forward - - bindkey "\e[1~" beginning-of-line #make Home key work; - bindkey "\e[3~" delete-char #make Delete key work; - bindkey "\e[4~" end-of-line #make End key work; endif endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 14:18:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CBDF9106564A; Wed, 11 Apr 2012 14:18:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B74658FC18; Wed, 11 Apr 2012 14:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BEIIpW081364; Wed, 11 Apr 2012 14:18:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BEIIg1081362; Wed, 11 Apr 2012 14:18:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204111418.q3BEIIg1081362@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Apr 2012 14:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234134 - head/sbin/sysctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 14:18:18 -0000 Author: eadler Date: Wed Apr 11 14:18:18 2012 New Revision: 234134 URL: http://svn.freebsd.org/changeset/base/234134 Log: s/Free Memory Pages/Free Memory/ to avoid confusion, since we're reporting a number of bytes rather than a number of pages PR: misc/165208 Submitted by: Arnaud Lacombe Approved by: cperciva MFC after: 3 days Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Wed Apr 11 14:13:22 2012 (r234133) +++ head/sbin/sysctl/sysctl.c Wed Apr 11 14:18:18 2012 (r234134) @@ -419,7 +419,7 @@ S_vmtotal(int l2, void *p) v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n", v->t_rmshr * pageKilo, v->t_armshr * pageKilo); - printf("Free Memory Pages:\t%dK\n", v->t_free * pageKilo); + printf("Free Memory:\t%dK\n", v->t_free * pageKilo); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 14:36:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D906106566C; Wed, 11 Apr 2012 14:36:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088398FC19; Wed, 11 Apr 2012 14:36:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BEa5nP081978; Wed, 11 Apr 2012 14:36:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BEa5Sd081976; Wed, 11 Apr 2012 14:36:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204111436.q3BEa5Sd081976@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Apr 2012 14:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234135 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 14:36:06 -0000 Author: eadler Date: Wed Apr 11 14:36:05 2012 New Revision: 234135 URL: http://svn.freebsd.org/changeset/base/234135 Log: Fix typo (add a missing '%/' in sed) Submitted by: jmallett Approved by: cperciva (implicit) MFC after: 3 days Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Wed Apr 11 14:18:18 2012 (r234134) +++ head/share/examples/csh/dot.cshrc Wed Apr 11 14:36:05 2012 (r234135) @@ -29,7 +29,7 @@ complete service 'c/-/(e l r v)/' 'p/1 complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' -complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed svar/db/pkg/%%`@' +complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 15:02:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED905106564A; Wed, 11 Apr 2012 15:02:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CFC8FC0C; Wed, 11 Apr 2012 15:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BF2EKc082895; Wed, 11 Apr 2012 15:02:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BF2Eb3082893; Wed, 11 Apr 2012 15:02:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204111502.q3BF2Eb3082893@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 11 Apr 2012 15:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234137 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 15:02:15 -0000 Author: luigi Date: Wed Apr 11 15:02:14 2012 New Revision: 234137 URL: http://svn.freebsd.org/changeset/base/234137 Log: Enable prefetching of descriptors on the TX ring, using the same values as in the Intel driver 3.8.21 for linux. The fact that it is standard in the above driver suggests that it has no bad side effects. But of course there must be a reason for enabling features, not just "it does not harm", so here it is a good one: Prefetching enables full line rate even using a single queue (14.88 Mpps, compared to ~12 Mpps without prefetch). This in turn is terribly useful when one wants to schedule traffic. For obvious reasons the difference is only visible with netmap or other high speed solutions, but presumably the advantage should be in the order of a fraction of a microsecond when starting transmission on an empty queue. Discussed with Jack Vogel. MFC after: 1 week Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Apr 11 14:54:06 2012 (r234136) +++ head/sys/dev/ixgbe/ixgbe.c Wed Apr 11 15:02:14 2012 (r234137) @@ -1143,6 +1143,14 @@ ixgbe_init_locked(struct adapter *adapte txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); + /* + * When the internal queue falls below PTHRESH (32), + * start prefetching as long as there are at least + * HTHRESH (1) buffers ready. The values are taken + * from the Intel linux driver 3.8.21. + * Prefetching enables tx line rate even with 1 queue. + */ + txdctl |= (16 << 0) | (1 << 8); IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 15:42:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD7A2106566B; Wed, 11 Apr 2012 15:42:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1828FC1D; Wed, 11 Apr 2012 15:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BFg3Md084117; Wed, 11 Apr 2012 15:42:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BFg3pS084115; Wed, 11 Apr 2012 15:42:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201204111542.q3BFg3pS084115@svn.freebsd.org> From: Ed Maste Date: Wed, 11 Apr 2012 15:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234138 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 15:42:03 -0000 Author: emaste Date: Wed Apr 11 15:42:02 2012 New Revision: 234138 URL: http://svn.freebsd.org/changeset/base/234138 Log: Support percent-encoded user and password RFC 1738 specifies that any ":", "@", or "/" within a user name or password in a URL is percent-encoded, to avoid ambiguity with the use of those characters as URL component separators. Reviewed by: rstone@ MFC after: 1 month Modified: head/lib/libfetch/fetch.c Modified: head/lib/libfetch/fetch.c ============================================================================== --- head/lib/libfetch/fetch.c Wed Apr 11 15:02:14 2012 (r234137) +++ head/lib/libfetch/fetch.c Wed Apr 11 15:42:02 2012 (r234138) @@ -289,6 +289,49 @@ fetchMakeURL(const char *scheme, const c } /* + * Return value of the given hex digit. + */ +static int +fetch_hexval(char ch) +{ + + if (ch >= '0' && ch <= '9') + return (ch - '0'); + else if (ch >= 'a' && ch <= 'f') + return (ch - 'a' + 10); + else if (ch >= 'A' && ch <= 'F') + return (ch - 'A' + 10); + return (-1); +} + +/* + * Decode percent-encoded URL component from src into dst, stopping at end + * of string, or at @ or : separators. Returns a pointer to the unhandled + * part of the input string (null terminator, @, or :). No terminator is + * written to dst (it is the caller's responsibility). + */ +static const char * +fetch_pctdecode(char *dst, const char *src, size_t dlen) +{ + int d1, d2; + char c; + const char *s; + + for (s = src; *s != '\0' && *s != '@' && *s != ':'; s++) { + if (s[0] == '%' && (d1 = fetch_hexval(s[1])) >= 0 && + (d2 = fetch_hexval(s[2])) >= 0 && (d1 > 0 || d2 > 0)) { + c = d1 << 4 | d2; + s += 2; + } else { + c = *s; + } + if (dlen-- > 0) + *dst++ = c; + } + return (s); +} + +/* * Split an URL into components. URL syntax is: * [method:/][/[user[:pwd]@]host[:port]/][document] * This almost, but not quite, RFC1738 URL syntax. @@ -329,15 +372,11 @@ fetchParseURL(const char *URL) p = strpbrk(URL, "/@"); if (p && *p == '@') { /* username */ - for (q = URL, i = 0; (*q != ':') && (*q != '@'); q++) - if (i < URL_USERLEN) - u->user[i++] = *q; + q = fetch_pctdecode(u->user, URL, URL_USERLEN); /* password */ if (*q == ':') - for (q++, i = 0; (*q != ':') && (*q != '@'); q++) - if (i < URL_PWDLEN) - u->pwd[i++] = *q; + q = fetch_pctdecode(u->pwd, ++q, URL_PWDLEN); p++; } else { From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 15:48:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 030E8106566B; Wed, 11 Apr 2012 15:48:51 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D691F8FC15; Wed, 11 Apr 2012 15:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BFmoUI084377; Wed, 11 Apr 2012 15:48:50 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BFmocP084375; Wed, 11 Apr 2012 15:48:50 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201204111548.q3BFmocP084375@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 11 Apr 2012 15:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234139 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 15:48:51 -0000 Author: jh Date: Wed Apr 11 15:48:50 2012 New Revision: 234139 URL: http://svn.freebsd.org/changeset/base/234139 Log: Restore the blank line incorrectly removed in r234104. Pointed out by: bde Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Apr 11 15:42:02 2012 (r234138) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Apr 11 15:48:50 2012 (r234139) @@ -407,6 +407,7 @@ ext2_setattr(ap) /* Disallow flags not supported by ext2fs. */ if(vap->va_flags & ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP)) return (EOPNOTSUPP); + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); /* From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 16:11:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B043106564A; Wed, 11 Apr 2012 16:11:09 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 060698FC14; Wed, 11 Apr 2012 16:11:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BGB812085145; Wed, 11 Apr 2012 16:11:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BGB8CM085142; Wed, 11 Apr 2012 16:11:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204111611.q3BGB8CM085142@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 11 Apr 2012 16:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234140 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 16:11:09 -0000 Author: luigi Date: Wed Apr 11 16:11:08 2012 New Revision: 234140 URL: http://svn.freebsd.org/changeset/base/234140 Log: A couple of changes related to ixgbe operation in netmap mode: - add a sysctl, dev.netmap.ix_crcstrip, to control whether ixgbe should strip the CRC on received frames. Defaults to 0, which keeps the CRC. and improves performance when receiving min-sized (64-byte) frames. This matters because min-sized frames is one of the standard benchmarks for switches and routers, some chipsets seem to issue read-modify-write cycles for PCIe transactions that are not a full cache line, and a min-sized frame triggers the bug, resulting in reduced throughput -- 9.7 instead of 14.88 Mpps -- and heavy bus load. - for the time being, always look for incoming packets on a select/poll even if there has not been an interrupt in the meantime. This is only a temporary workaround for a probable race condition in keeping track of rx interrupts. Add a couple of diagnostic vars to help studying the problem. Modified: head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Wed Apr 11 15:48:50 2012 (r234139) +++ head/sys/dev/netmap/ixgbe_netmap.h Wed Apr 11 16:11:08 2012 (r234140) @@ -49,6 +49,29 @@ */ #include +/* + * ix_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. + * During regular operations the CRC is stripped, but on some + * hardware reception of frames not multiple of 64 is slower, + * so using crcstrip=0 helps in benchmarks. + * + * ix_rx_miss, ix_rx_miss_bufs: + * count packets that might be missed due to lost interrupts. + * + * ix_use_dd + * use the dd bit for completed tx transmissions. + * This is tricky, much better to use TDH for now. + */ +SYSCTL_DECL(_dev_netmap); +static int ix_rx_miss, ix_rx_miss_bufs, ix_use_dd, ix_crcstrip; +SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, + CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ix_use_dd, + CTLFLAG_RW, &ix_use_dd, 0, "use dd instead of tdh to detect tx frames"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss, + CTLFLAG_RW, &ix_rx_miss, 0, "potentially missed rx intr"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ix_rx_miss_bufs, + CTLFLAG_RW, &ix_rx_miss_bufs, 0, "potentially missed rx intr bufs"); /* * wrapper to export locks to the generic netmap code. @@ -82,6 +105,38 @@ ixgbe_netmap_lock_wrapper(struct ifnet * } +static void +set_crcstrip(struct ixgbe_hw *hw, int onoff) +{ + /* crc stripping is set in two places: + * IXGBE_HLREG0 (left alone by the original driver) + * IXGBE_RDRXCTL (set by the original driver in + * ixgbe_setup_hw_rsc() called in init_locked. + * We disable the setting when netmap is compiled in). + * When netmap is compiled in we disabling IXGBE_RDRXCTL + * modifications of the IXGBE_RDRXCTL_CRCSTRIP bit, and + * instead update the state here. + */ + uint32_t hl, rxc; + + hl = IXGBE_READ_REG(hw, IXGBE_HLREG0); + rxc = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); + /* hw requirements ... */ + rxc &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; + rxc |= IXGBE_RDRXCTL_RSCACKC; + if (onoff && !ix_crcstrip) { + /* keep the crc. Fast rx */ + hl &= ~IXGBE_HLREG0_RXCRCSTRP; + rxc &= ~IXGBE_RDRXCTL_CRCSTRIP; + } else { + /* reset default mode */ + hl |= IXGBE_HLREG0_RXCRCSTRP; + rxc |= IXGBE_RDRXCTL_CRCSTRIP; + } + IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hl); + IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc); +} + /* * Register/unregister. We are already under core lock. * Only called on the first register or the last unregister. @@ -101,6 +156,7 @@ ixgbe_netmap_reg(struct ifnet *ifp, int /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + set_crcstrip(&adapter->hw, onoff); if (onoff) { /* enable netmap mode */ ifp->if_capenable |= IFCAP_NETMAP; @@ -125,6 +181,7 @@ fail: /* initialize the card, this time in standard mode */ ixgbe_init_locked(adapter); /* also enables intr */ } + set_crcstrip(&adapter->hw, onoff); return (error); } @@ -325,12 +382,26 @@ ring_reset: * For the time being we use TDH, as we do it infrequently * enough not to pose performance problems. */ + if (ix_use_dd) { + struct ixgbe_legacy_tx_desc *txd = + (struct ixgbe_legacy_tx_desc *)txr->tx_base; + + l = txr->next_to_clean; + k = netmap_idx_k2n(kring, kring->nr_hwcur); + delta = 0; + while (l != k && + txd[l].upper.fields.status & IXGBE_TXD_STAT_DD) { + delta++; + l = (l == lim) ? 0 : l + 1; + } + } else { l = IXGBE_READ_REG(&adapter->hw, IXGBE_TDH(ring_nr)); if (l >= kring->nkr_num_slots) { /* XXX can happen */ D("TDH wrap %d", l); l -= kring->nkr_num_slots; } delta = l - txr->next_to_clean; + } if (delta) { /* some tx completed, increment avail */ if (delta < 0) @@ -402,23 +473,29 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * * rxr->next_to_check is set to 0 on a ring reinit */ - l = rxr->next_to_check; - j = netmap_idx_n2k(kring, l); - if (netmap_no_pendintr || force_update) { + int crclen = ix_crcstrip ? 0 : 4; + l = rxr->next_to_check; + j = netmap_idx_n2k(kring, l); + for (n = 0; ; n++) { union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; - ring->slot[j].len = le16toh(curr->wb.upper.length); + ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } if (n) { /* update the state variables */ + if (netmap_no_pendintr && !force_update) { + /* diagnostics */ + ix_rx_miss ++; + ix_rx_miss_bufs += n; + } rxr->next_to_check = l; kring->nr_hwavail += n; } Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Apr 11 15:48:50 2012 (r234139) +++ head/sys/dev/netmap/netmap.c Wed Apr 11 16:11:08 2012 (r234140) @@ -111,7 +111,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, buf_si CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); int netmap_mitigate = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); -int netmap_no_pendintr; +int netmap_no_pendintr = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 20:28:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0530D1065674; Wed, 11 Apr 2012 20:28:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E40678FC12; Wed, 11 Apr 2012 20:28:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BKS5G5094376; Wed, 11 Apr 2012 20:28:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BKS5XI094374; Wed, 11 Apr 2012 20:28:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204112028.q3BKS5XI094374@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 11 Apr 2012 20:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234149 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 20:28:06 -0000 Author: nwhitehorn Date: Wed Apr 11 20:28:05 2012 New Revision: 234149 URL: http://svn.freebsd.org/changeset/base/234149 Log: Fix error in r233949. Synchronizing icaches on uncacheable pages turns out not to be a good idea, and of course the PV entry list for a page is never empty after the page has been mapped. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Apr 11 20:26:50 2012 (r234148) +++ head/sys/powerpc/aim/mmu_oea.c Wed Apr 11 20:28:05 2012 (r234149) @@ -1137,9 +1137,11 @@ moea_enter_locked(pmap_t pmap, vm_offset /* * Flush the real page from the instruction cache. This has be done * for all user mappings to prevent information leakage via the - * instruction cache. + * instruction cache. moea_pvo_enter() returns ENOENT for the first + * mapping for a page. */ - if (pmap != kernel_pmap && LIST_EMPTY(vm_page_to_pvoh(m))) + if (pmap != kernel_pmap && error == ENOENT && + (pte_lo & (PTE_I | PTE_G)) == 0) moea_syncicache(VM_PAGE_TO_PHYS(m), PAGE_SIZE); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 20:57:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13623106566B; Wed, 11 Apr 2012 20:57:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8CD58FC14; Wed, 11 Apr 2012 20:57:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BKvfmR095443; Wed, 11 Apr 2012 20:57:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BKvfoA095440; Wed, 11 Apr 2012 20:57:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204112057.q3BKvfoA095440@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Apr 2012 20:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234152 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 20:57:42 -0000 Author: jhb Date: Wed Apr 11 20:57:41 2012 New Revision: 234152 URL: http://svn.freebsd.org/changeset/base/234152 Log: Allow device_busy() and device_unbusy() to be invoked while a device is being attached. This is implemented by adding a new DS_ATTACHING state while a device's DEVICE_ATTACH() method is being invoked. A driver is required to not fail an attach of a busy device. The device's state will be promoted to DS_BUSY rather than DS_ACTIVE() if the device was marked busy during DEVICE_ATTACH(). Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 11 20:55:21 2012 (r234151) +++ head/sys/kern/subr_bus.c Wed Apr 11 20:57:41 2012 (r234152) @@ -2472,12 +2472,13 @@ device_disable(device_t dev) void device_busy(device_t dev) { - if (dev->state < DS_ATTACHED) + if (dev->state < DS_ATTACHING) panic("device_busy: called for unattached device"); if (dev->busy == 0 && dev->parent) device_busy(dev->parent); dev->busy++; - dev->state = DS_BUSY; + if (dev->state == DS_ATTACHED) + dev->state = DS_BUSY; } /** @@ -2486,14 +2487,16 @@ device_busy(device_t dev) void device_unbusy(device_t dev) { - if (dev->state != DS_BUSY) + if (dev->busy != 0 && dev->state != DS_BUSY && + dev->state != DS_ATTACHING) panic("device_unbusy: called for non-busy device %s", device_get_nameunit(dev)); dev->busy--; if (dev->busy == 0) { if (dev->parent) device_unbusy(dev->parent); - dev->state = DS_ATTACHED; + if (dev->state == DS_BUSY) + dev->state = DS_ATTACHED; } } @@ -2729,6 +2732,7 @@ device_attach(device_t dev) device_sysctl_init(dev); if (!device_is_quiet(dev)) device_print_child(dev->parent, dev); + dev->state = DS_ATTACHING; if ((error = DEVICE_ATTACH(dev)) != 0) { printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); @@ -2736,11 +2740,15 @@ device_attach(device_t dev) devclass_delete_device(dev->devclass, dev); (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); + KASSERT(dev->busy == 0, ("attach failed but busy")); dev->state = DS_NOTPRESENT; return (error); } device_sysctl_update(dev); - dev->state = DS_ATTACHED; + if (dev->busy) + dev->state = DS_BUSY; + else + dev->state = DS_ATTACHED; dev->flags &= ~DF_DONENOMATCH; devadded(dev); return (0); Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Apr 11 20:55:21 2012 (r234151) +++ head/sys/sys/bus.h Wed Apr 11 20:57:41 2012 (r234152) @@ -52,6 +52,7 @@ struct u_businfo { typedef enum device_state { DS_NOTPRESENT = 10, /**< @brief not probed or probe failed */ DS_ALIVE = 20, /**< @brief probe succeeded */ + DS_ATTACHING = 25, /**< @brief currently attaching */ DS_ATTACHED = 30, /**< @brief attach method called */ DS_BUSY = 40 /**< @brief device is open */ } device_state_t; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 21:00:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7741065677; Wed, 11 Apr 2012 21:00:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EAD78FC16; Wed, 11 Apr 2012 21:00:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BL0XR7095591; Wed, 11 Apr 2012 21:00:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BL0Xs9095589; Wed, 11 Apr 2012 21:00:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204112100.q3BL0Xs9095589@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Apr 2012 21:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234153 - head/sys/x86/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 21:00:34 -0000 Author: jhb Date: Wed Apr 11 21:00:33 2012 New Revision: 234153 URL: http://svn.freebsd.org/changeset/base/234153 Log: Trim stray blank line. Modified: head/sys/x86/pci/pci_bus.c Modified: head/sys/x86/pci/pci_bus.c ============================================================================== --- head/sys/x86/pci/pci_bus.c Wed Apr 11 20:57:41 2012 (r234152) +++ head/sys/x86/pci/pci_bus.c Wed Apr 11 21:00:33 2012 (r234153) @@ -133,7 +133,6 @@ legacy_pcib_map_msi(device_t pcib, devic slot, func)); pci_ht_map_msi(hostb, *addr); return (0); - } static const char * From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 21:33:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5233A1065680; Wed, 11 Apr 2012 21:33:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324E58FC16; Wed, 11 Apr 2012 21:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BLXkDW096690; Wed, 11 Apr 2012 21:33:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BLXjgZ096687; Wed, 11 Apr 2012 21:33:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204112133.q3BLXjgZ096687@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Apr 2012 21:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234154 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 21:33:46 -0000 Author: jhb Date: Wed Apr 11 21:33:45 2012 New Revision: 234154 URL: http://svn.freebsd.org/changeset/base/234154 Log: Reapply r223198 which was reverted in the previous vendor import. Some portions were already reapplied in r233708: - Use a dedicated task to handle deferred transmits from the if_transmit method instead of reusing the existing per-queue interrupt task. Reusing the per-queue interrupt task could result in both an interrupt thread and the taskqueue thread trying to handle received packets on a single queue resulting in out-of-order packet processing. - Call ether_ifdetach() earlier in igb_detach(). - Drain tasks and free taskqueues during igb_detach(). MFC after: 1 week Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Apr 11 21:00:33 2012 (r234153) +++ head/sys/dev/e1000/if_igb.c Wed Apr 11 21:33:45 2012 (r234154) @@ -176,6 +176,7 @@ static int igb_mq_start(struct ifnet *, static int igb_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static void igb_qflush(struct ifnet *); +static void igb_deferred_mq_start(void *, int); #else static void igb_start(struct ifnet *); static void igb_start_locked(struct tx_ring *, struct ifnet *ifp); @@ -715,6 +716,8 @@ igb_detach(device_t dev) return (EBUSY); } + ether_ifdetach(adapter->ifp); + if (adapter->led_dev != NULL) led_destroy(adapter->led_dev); @@ -746,8 +749,6 @@ igb_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); - callout_drain(&adapter->timer); #ifdef DEV_NETMAP @@ -943,7 +944,7 @@ igb_mq_start(struct ifnet *ifp, struct m IGB_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } return (err); @@ -1003,6 +1004,22 @@ igb_mq_start_locked(struct ifnet *ifp, s } /* + * Called from a taskqueue to drain queued transmit packets. + */ +static void +igb_deferred_mq_start(void *arg, int pending) +{ + struct tx_ring *txr = arg; + struct adapter *adapter = txr->adapter; + struct ifnet *ifp = adapter->ifp; + + IGB_TX_LOCK(txr); + if (!drbr_empty(ifp, txr->br)) + igb_mq_start_locked(ifp, txr, NULL); + IGB_TX_UNLOCK(txr); +} + +/* ** Flush all ring buffers */ static void @@ -2382,6 +2399,7 @@ igb_allocate_legacy(struct adapter *adap { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; int error, rid = 0; /* Turn off all interrupts */ @@ -2400,6 +2418,10 @@ igb_allocate_legacy(struct adapter *adap return (ENXIO); } +#if __FreeBSD_version >= 800000 + TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr); +#endif + /* * Try allocating a fast interrupt and the associated deferred * processing contexts. @@ -2473,9 +2495,13 @@ igb_allocate_msix(struct adapter *adapte */ if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); +#if __FreeBSD_version >= 800000 + TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, + que->txr); +#endif /* Make tasklet for deferred handling */ TASK_INIT(&que->que_task, 0, igb_handle_que, que); - que->tq = taskqueue_create_fast("igb_que", M_NOWAIT, + que->tq = taskqueue_create("igb_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(adapter->dev)); @@ -2682,13 +2708,24 @@ igb_free_pci_resources(struct adapter *a else (adapter->msix != 0) ? (rid = 1):(rid = 0); + que = adapter->queues; if (adapter->tag != NULL) { + taskqueue_drain(que->tq, &adapter->link_task); bus_teardown_intr(dev, adapter->res, adapter->tag); adapter->tag = NULL; } if (adapter->res != NULL) bus_release_resource(dev, SYS_RES_IRQ, rid, adapter->res); + for (int i = 0; i < adapter->num_queues; i++, que++) { + if (que->tq != NULL) { +#if __FreeBSD_version >= 800000 + taskqueue_drain(que->tq, &que->txr->txq_task); +#endif + taskqueue_drain(que->tq, &que->que_task); + taskqueue_free(que->tq); + } + } mem: if (adapter->msix) pci_release_msi(dev); Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Wed Apr 11 21:00:33 2012 (r234153) +++ head/sys/dev/e1000/if_igb.h Wed Apr 11 21:33:45 2012 (r234154) @@ -301,6 +301,7 @@ struct tx_ring { struct buf_ring *br; #endif bus_dma_tag_t txtag; + struct task txq_task; u32 bytes; u32 packets; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 21:35:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFA4F10656A8; Wed, 11 Apr 2012 21:35:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 39C678FC16; Wed, 11 Apr 2012 21:35:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8FEA1B94D; Wed, 11 Apr 2012 17:35:00 -0400 (EDT) From: John Baldwin To: Andrey Zonov Date: Wed, 11 Apr 2012 12:02:05 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201204051713.q35HDE3d067735@svn.freebsd.org> <4F848E4B.8020302@zonov.org> In-Reply-To: <4F848E4B.8020302@zonov.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201204111202.05409.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 11 Apr 2012 17:35:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233925 - in head: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 21:35:14 -0000 On Tuesday, April 10, 2012 3:47:23 pm Andrey Zonov wrote: > On 05.04.2012 21:13, John Baldwin wrote: > > Author: jhb > > Date: Thu Apr 5 17:13:14 2012 > > New Revision: 233925 > > URL: http://svn.freebsd.org/changeset/base/233925 > > > > Log: > > Add new ktrace records for the start and end of VM faults. This gives > > a pair of records similar to syscall entry and return that a user can > > use to determine how long page faults take. The new ktrace records are > > enabled via the 'p' trace type, and are enabled in the default set of > > trace points. > > > > Reviewed by: kib > > MFC after: 2 weeks > > > > Hi John, > > Thanks a lot, this change is very useful! > > And while you are here I would like to show you a patch which adds a > "wmesg" to the context switch tracing. It is not finished, it's just a > concept. Please review it and if you are interesting in that I'll > finish it and will test more widely. Ah, this looks fairly neat. However, I think you will need a few changes: 1) You will want to make kdump handle either the old or new size of struct ktr_csw. (The size of the record is in the header, so as long as you have a 'struct ktr_csw_old' you can handle this fairly easily.) 2) cs->wmesg is never NULL. Instead, it should probably just always print it out. 3) condvar's have a valid wmesg. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 21:56:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A571106566B; Wed, 11 Apr 2012 21:56:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAB38FC14; Wed, 11 Apr 2012 21:56:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BLutq1097433; Wed, 11 Apr 2012 21:56:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BLutS8097431; Wed, 11 Apr 2012 21:56:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204112156.q3BLutS8097431@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 11 Apr 2012 21:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234155 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 21:56:56 -0000 Author: nwhitehorn Date: Wed Apr 11 21:56:55 2012 New Revision: 234155 URL: http://svn.freebsd.org/changeset/base/234155 Log: Only manipulate the PGA_EXECUTABLE flag on managed pages. This is a proxy for whether the page is physical. On dense phys mem systems (32-bit), VM_PHYS_TO_PAGE will not return NULL for device memory pages if device memory is above physical memory even if there is no allocated vm_page. Attempting to use the returned page could then cause either memory corruption or a page fault. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Apr 11 21:33:45 2012 (r234154) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Apr 11 21:56:55 2012 (r234155) @@ -1906,17 +1906,15 @@ moea64_pvo_protect(mmu_t mmu, pmap_t pm /* * If the PVO is in the page table, update that pte as well. */ - if (pt != -1) { + if (pt != -1) MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, pvo->pvo_vpn); - if (pm != kernel_pmap && pg != NULL && - !(pg->aflags & PGA_EXECUTABLE) && - (pvo->pvo_pte.lpte.pte_lo & - (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { + if (pm != kernel_pmap && pg != NULL && !(pg->aflags & PGA_EXECUTABLE) && + (pvo->pvo_pte.lpte.pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { + if ((pg->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(pg, PGA_EXECUTABLE); - moea64_syncicache(mmu, pm, PVO_VADDR(pvo), - pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, PAGE_SIZE); - } + moea64_syncicache(mmu, pm, PVO_VADDR(pvo), + pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, PAGE_SIZE); } /* @@ -2368,9 +2366,8 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ */ pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN); - if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && - (pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { - if (pg != NULL) { + if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && pg != NULL) { + if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG) vm_page_dirty(pg); if (pvo->pvo_pte.lpte.pte_lo & LPTE_REF) @@ -2378,11 +2375,10 @@ moea64_pvo_remove(mmu_t mmu, struct pvo_ if (LIST_EMPTY(vm_page_to_pvoh(pg))) vm_page_aflag_clear(pg, PGA_WRITEABLE); } + if (LIST_EMPTY(vm_page_to_pvoh(pg))) + vm_page_aflag_clear(pg, PGA_EXECUTABLE); } - if (pg != NULL && LIST_EMPTY(vm_page_to_pvoh(pg))) - vm_page_aflag_clear(pg, PGA_EXECUTABLE); - moea64_pvo_entries--; moea64_pvo_remove_calls++; From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 22:23:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61404106564A; Wed, 11 Apr 2012 22:23:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 426288FC0C; Wed, 11 Apr 2012 22:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BMNpZB098396; Wed, 11 Apr 2012 22:23:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BMNp6l098391; Wed, 11 Apr 2012 22:23:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201204112223.q3BMNp6l098391@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 11 Apr 2012 22:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234156 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 22:23:51 -0000 Author: nwhitehorn Date: Wed Apr 11 22:23:50 2012 New Revision: 234156 URL: http://svn.freebsd.org/changeset/base/234156 Log: We don't need kcopy() in any of the remaining places it is used, so remove it. MFC after: 2 weeks Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/cpu.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Wed Apr 11 21:56:55 2012 (r234155) +++ head/sys/powerpc/aim/machdep.c Wed Apr 11 22:23:50 2012 (r234156) @@ -738,36 +738,6 @@ spinlock_exit(void) intr_restore(msr); } -/* - * kcopy(const void *src, void *dst, size_t len); - * - * Copy len bytes from src to dst, aborting if we encounter a fatal - * page fault. - * - * kcopy() _must_ save and restore the old fault handler since it is - * called by uiomove(), which may be in the path of servicing a non-fatal - * page fault. - */ -int -kcopy(const void *src, void *dst, size_t len) -{ - struct thread *td; - faultbuf env, *oldfault; - int rv; - - td = curthread; - oldfault = td->td_pcb->pcb_onfault; - if ((rv = setfault(env)) != 0) { - td->td_pcb->pcb_onfault = oldfault; - return rv; - } - - memcpy(dst, src, len); - - td->td_pcb->pcb_onfault = oldfault; - return (0); -} - int db_trap_glue(struct trapframe *); /* Called from trap_subr.S */ int Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Wed Apr 11 21:56:55 2012 (r234155) +++ head/sys/powerpc/aim/mmu_oea.c Wed Apr 11 22:23:50 2012 (r234156) @@ -1023,7 +1023,7 @@ moea_copy_page(mmu_t mmu, vm_page_t msrc dst = VM_PAGE_TO_PHYS(mdst); src = VM_PAGE_TO_PHYS(msrc); - kcopy((void *)src, (void *)dst, PAGE_SIZE); + bcopy((void *)src, (void *)dst, PAGE_SIZE); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Apr 11 21:56:55 2012 (r234155) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Apr 11 22:23:50 2012 (r234156) @@ -1097,14 +1097,14 @@ moea64_copy_page(mmu_t mmu, vm_page_t ms src = VM_PAGE_TO_PHYS(msrc); if (hw_direct_map) { - kcopy((void *)src, (void *)dst, PAGE_SIZE); + bcopy((void *)src, (void *)dst, PAGE_SIZE); } else { mtx_lock(&moea64_scratchpage_mtx); moea64_set_scratchpage_pa(mmu, 0, src); moea64_set_scratchpage_pa(mmu, 1, dst); - kcopy((void *)moea64_scratchpage_va[0], + bcopy((void *)moea64_scratchpage_va[0], (void *)moea64_scratchpage_va[1], PAGE_SIZE); mtx_unlock(&moea64_scratchpage_mtx); Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Wed Apr 11 21:56:55 2012 (r234155) +++ head/sys/powerpc/include/cpu.h Wed Apr 11 22:23:50 2012 (r234156) @@ -100,6 +100,5 @@ void swi_vm(void *); /* XXX the following should not be here. */ void savectx(struct pcb *); -int kcopy(const void *, void *, size_t); #endif /* _MACHINE_CPU_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 22:43:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B764106566B; Wed, 11 Apr 2012 22:43:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6713F8FC0A; Wed, 11 Apr 2012 22:43:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BMhfUX099010; Wed, 11 Apr 2012 22:43:41 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BMhf1E099008; Wed, 11 Apr 2012 22:43:41 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204112243.q3BMhf1E099008@svn.freebsd.org> From: Kirk McKusick Date: Wed, 11 Apr 2012 22:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234157 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 22:43:41 -0000 Author: mckusick Date: Wed Apr 11 22:43:40 2012 New Revision: 234157 URL: http://svn.freebsd.org/changeset/base/234157 Log: Whitespace cleanup. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Wed Apr 11 22:23:50 2012 (r234156) +++ head/sys/sys/mount.h Wed Apr 11 22:43:40 2012 (r234157) @@ -199,10 +199,10 @@ void __mnt_vnode_markerfree(str __mnt_vnode_markerfree(&(mvp), (mp)) #define MNT_VNODE_FOREACH_ABORT(mp, mvp) \ - do { \ - MNT_ILOCK(mp); \ - MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); \ - MNT_IUNLOCK(mp); \ + do { \ + MNT_ILOCK(mp); \ + MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp); \ + MNT_IUNLOCK(mp); \ } while (0) #define MNT_ILOCK(mp) mtx_lock(&(mp)->mnt_mtx) @@ -211,7 +211,7 @@ void __mnt_vnode_markerfree(str #define MNT_MTX(mp) (&(mp)->mnt_mtx) #define MNT_REF(mp) (mp)->mnt_ref++ #define MNT_REL(mp) do { \ - KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ + KASSERT((mp)->mnt_ref > 0, ("negative mnt_ref")); \ (mp)->mnt_ref--; \ if ((mp)->mnt_ref == 0) \ wakeup((mp)); \ From owner-svn-src-head@FreeBSD.ORG Wed Apr 11 23:01:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60881065673; Wed, 11 Apr 2012 23:01:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 776528FC18; Wed, 11 Apr 2012 23:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3BN1CNm099602; Wed, 11 Apr 2012 23:01:12 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3BN1Ctn099598; Wed, 11 Apr 2012 23:01:12 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201204112301.q3BN1Ctn099598@svn.freebsd.org> From: Kirk McKusick Date: Wed, 11 Apr 2012 23:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234158 - in head/sys: kern sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 23:01:12 -0000 Author: mckusick Date: Wed Apr 11 23:01:11 2012 New Revision: 234158 URL: http://svn.freebsd.org/changeset/base/234158 Log: Export vinactive() from kern/vfs_subr.c (e.g., make it no longer static and declare its prototype in sys/vnode.h) so that it can be called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c) instead of the body of vinactive() being cut and pasted into process_deferred_inactive(). Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Apr 11 22:43:40 2012 (r234157) +++ head/sys/kern/vfs_subr.c Wed Apr 11 23:01:11 2012 (r234158) @@ -103,7 +103,6 @@ static int flushbuflist(struct bufv *buf static void syncer_shutdown(void *arg, int howto); static int vtryrecycle(struct vnode *vp); static void vbusy(struct vnode *vp); -static void vinactive(struct vnode *, struct thread *); static void v_incr_usecount(struct vnode *); static void v_decr_usecount(struct vnode *); static void v_decr_useonly(struct vnode *); @@ -2401,7 +2400,7 @@ vdropl(struct vnode *vp) * OWEINACT tracks whether a vnode missed a call to inactive due to a * failed lock upgrade. */ -static void +void vinactive(struct vnode *vp, struct thread *td) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Apr 11 22:43:40 2012 (r234157) +++ head/sys/sys/vnode.h Wed Apr 11 23:01:11 2012 (r234158) @@ -632,6 +632,7 @@ int vget(struct vnode *vp, int lockflag, void vgone(struct vnode *vp); void vhold(struct vnode *); void vholdl(struct vnode *); +void vinactive(struct vnode *, struct thread *); int vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo); int vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td, off_t length, int blksize); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Wed Apr 11 22:43:40 2012 (r234157) +++ head/sys/ufs/ffs/ffs_snapshot.c Wed Apr 11 23:01:11 2012 (r234158) @@ -2572,20 +2572,9 @@ process_deferred_inactive(struct mount * MNT_ILOCK(mp); continue; } - - VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp, - ("process_deferred_inactive: " - "recursed on VI_DOINGINACT")); - vp->v_iflag |= VI_DOINGINACT; - vp->v_iflag &= ~VI_OWEINACT; - VI_UNLOCK(vp); - (void) VOP_INACTIVE(vp, td); - VI_LOCK(vp); - VNASSERT(vp->v_iflag & VI_DOINGINACT, vp, - ("process_deferred_inactive: lost VI_DOINGINACT")); + vinactive(vp, td); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("process_deferred_inactive: got VI_OWEINACT")); - vp->v_iflag &= ~VI_DOINGINACT; VI_UNLOCK(vp); VOP_UNLOCK(vp, 0); vdrop(vp); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 00:12:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 712D31065670; Thu, 12 Apr 2012 00:12:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51C758FC0C; Thu, 12 Apr 2012 00:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C0CIra001895; Thu, 12 Apr 2012 00:12:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C0CIJ9001893; Thu, 12 Apr 2012 00:12:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204120012.q3C0CIJ9001893@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Apr 2012 00:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234159 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 00:12:18 -0000 Author: eadler Date: Thu Apr 12 00:12:17 2012 New Revision: 234159 URL: http://svn.freebsd.org/changeset/base/234159 Log: Sort completions Add a new one for sysctl Submitted by: rm (the new completion) Approved by: cperciva (implicit) MFC after: 3 days Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Wed Apr 11 23:01:11 2012 (r234158) +++ head/share/examples/csh/dot.cshrc Thu Apr 12 00:12:17 2012 (r234159) @@ -21,20 +21,20 @@ bindkey "^[[3~" delete-char-or-list-or-e # Make the Ins key work bindkey "\e[2~" overwrite-mode +# Aliases used for completions +alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' +alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' + # Some common completions complete chown 'p/1/u/' -complete man 'C/*/c/' -complete service 'n/*/`service -l`/' -complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' +complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' +complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' complete kldunload 'n@*@`kldstat | awk \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name` @' complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@' +complete man 'C/*/c/' complete pkg_delete 'c/-/(i v D n p d f G x X r)/' 'n@*@`ls /var/db/pkg`@' complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@' -complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/' -complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $5}'"'"'`/' -complete dd 'c/[io]f=/f/ n/*/"(if of ibs obs bs skip seek count)"/=' -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-name -r | cut -d . -f 1' -alias _PKGS_PkGs_PoRtS_ 'awk -F\| \{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\} /usr/ports/INDEX-`uname -r | cut -d . -f 1`&& pkg_info -E \*' complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir clean-distfiles \ clean-packages delete-build-only delete-packages force-config help \ index index-first index-only list-origins local-packagedir no-confirm \ @@ -42,6 +42,8 @@ complete portmaster 'c/--/(always-fetc packages-local packages-only show-work update-if-newer version)/' \ 'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \ 'n@*@`_PKGS_PkGs_PoRtS_`@' +complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop reload restart status rcvar onestart onestop)/' +complete sysctl 'n/*/`sysctl -Na`/' # Alternate prompts set prompt = '#' From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 01:07:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C89106566B; Thu, 12 Apr 2012 01:07:17 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B74398FC0A; Thu, 12 Apr 2012 01:07:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C17H26003746; Thu, 12 Apr 2012 01:07:17 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C17H42003743; Thu, 12 Apr 2012 01:07:17 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201204120107.q3C17H42003743@svn.freebsd.org> From: Andrew Thompson Date: Thu, 12 Apr 2012 01:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234163 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 01:07:18 -0000 Author: thompsa Date: Thu Apr 12 01:07:17 2012 New Revision: 234163 URL: http://svn.freebsd.org/changeset/base/234163 Log: Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets are discarded, this is an issue because lacp drops the lock which may allow network threads to access freed memory. Expand the lock coverage so the detach/attach happen atomically. Submitted by: Andrew Boyer (earlier version) Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Apr 12 00:59:30 2012 (r234162) +++ head/sys/net/if_lagg.c Thu Apr 12 01:07:17 2012 (r234163) @@ -950,11 +950,11 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = EPROTONOSUPPORT; break; } + LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { - LAGG_WLOCK(sc); - error = sc->sc_detach(sc); - /* Reset protocol and pointers */ + /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; + error = sc->sc_detach(sc); sc->sc_detach = NULL; sc->sc_start = NULL; sc->sc_input = NULL; @@ -966,10 +966,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd sc->sc_lladdr = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; - LAGG_WUNLOCK(sc); + } else if (sc->sc_input != NULL) { + /* Still detaching */ + error = EBUSY; } - if (error != 0) + if (error != 0) { + LAGG_WUNLOCK(sc); break; + } for (int i = 0; i < (sizeof(lagg_protos) / sizeof(lagg_protos[0])); i++) { if (lagg_protos[i].ti_proto == ra->ra_proto) { @@ -977,7 +981,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd printf("%s: using proto %u\n", sc->sc_ifname, lagg_protos[i].ti_proto); - LAGG_WLOCK(sc); sc->sc_proto = lagg_protos[i].ti_proto; if (sc->sc_proto != LAGG_PROTO_NONE) error = lagg_protos[i].ti_attach(sc); @@ -985,6 +988,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd return (error); } } + LAGG_WUNLOCK(sc); error = EPROTONOSUPPORT; break; case SIOCGLAGGFLAGS: From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 01:51:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id D256F1065675; Thu, 12 Apr 2012 01:51:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0083916456D; Thu, 12 Apr 2012 01:51:00 +0000 (UTC) Date: Wed, 11 Apr 2012 18:51:00 -0700 (PDT) From: Doug Barton To: Stanislav Sedov In-Reply-To: <201204100927.q3A9Rf3r013400@svn.freebsd.org> Message-ID: References: <201204100927.q3A9Rf3r013400@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-318390063-1334195461=:20567" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234093 - in head/etc: defaults rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 01:51:23 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-318390063-1334195461=:20567 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed This script has many problems. First, new scripts in the base should never use BEFORE since this makes debugging rcorder issues harder. Please instead add this to the REQUIRE line in DAEMON. You can use 'service -r' to get an idea of where it will be included at boot time. Second, for new scripts the name of the file, $name, and PROVIDE should all the the same, in this case "kfd". That implies that the rcvar should be kfd_enable unless there is a very good reason for it to be different, which in this case there is not one that I can see. (FYI, the "d" in "kfd" implies "server.") Scripts that start persistent services should always include "KEYWORD: shutdown" so that they get started cleanly. It's not clear to me if this script should also include the nojail keyword. It's also generally a good idea to add a REQUIRE line unless it truly doesn't matter. I guessed at REQUIRE: kerberos ala the kadamind script, if that's wrong please let me know. Next, the arguments in the script, and the script generally, don't follow the default format. It's very helpful when doing mass reviews/updates if the script looks the same as other similar scripts unless there is a good reason for it to be different. The reference at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html should help. It's also unclear why you are unset'ing start_cmd, but not supplying your own start method. The way that you're using kfd_server is also totally wrong, as is hard-coding kfd_flags in the script. If the -i argument is always needed, it should be included in command_args. If it's not always needed, but is generally recommended, you should include it in /etc/defaults/rc.conf so that the user can easily override it. I've assumed the latter, if it should always be included please let me know. Finally, you neglected to update rc.conf.5. The attached patch fixes the problems mentioned above, modulo the rc.conf.5 update which I'll leave to you. In order to avoid inconvenience to those tracking HEAD who want to use this new feature I plan to commit this in the next couple of days if I don't hear from you. In the future it would probably be a good idea to submit patches to freebsd-rc@ for review. hth, Doug On Tue, 10 Apr 2012, Stanislav Sedov wrote: > Author: stas > Date: Tue Apr 10 09:27:41 2012 > New Revision: 234093 > URL: http://svn.freebsd.org/changeset/base/234093 > > Log: > - Add rc.d script for kfd, kerberos forwarded tickets daemon. > > Added: > head/etc/rc.d/kfd (contents, props changed) > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/Makefile > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Tue Apr 10 07:38:58 2012 (r234092) > +++ head/etc/defaults/rc.conf Tue Apr 10 09:27:41 2012 (r234093) > @@ -297,6 +297,8 @@ kadmind5_server_enable="NO" # Run kadmin > kadmind5_server="/usr/libexec/kadmind" # path to kerberos 5 admin daemon > kpasswdd_server_enable="NO" # Run kpasswdd (or NO) > kpasswdd_server="/usr/libexec/kpasswdd" # path to kerberos 5 passwd daemon > +kfd_server_enable="NO" # Run kfd (or NO) > +kfd_server="/usr/libexec/kfd" # path to kerberos 5 kfd daemon > > gssd_enable="NO" # Run the gssd daemon (or NO). > gssd_flags="" # Flags for gssd. > > Modified: head/etc/rc.d/Makefile > ============================================================================== > --- head/etc/rc.d/Makefile Tue Apr 10 07:38:58 2012 (r234092) > +++ head/etc/rc.d/Makefile Tue Apr 10 09:27:41 2012 (r234093) > @@ -66,6 +66,7 @@ FILES= DAEMON \ > kadmind \ > kerberos \ > keyserv \ > + kfd \ > kld \ > kldxref \ > kpasswdd \ > > Added: head/etc/rc.d/kfd > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/rc.d/kfd Tue Apr 10 09:27:41 2012 (r234093) > @@ -0,0 +1,19 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# PROVIDE: kfd > +# BEFORE: DAEMON > + > +. /etc/rc.subr > + > +name="kfd" > +load_rc_config $name > +rcvar="kfd_server_enable" > +unset start_cmd > +command="${kfd_server}" > +kfd_flags="-i" > +command_args="&" > + > +run_rc_command "$1" > > -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --0-318390063-1334195461=:20567 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=kfd-rcd.diff Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=kfd-rcd.diff SW5kZXg6IGRlZmF1bHRzL3JjLmNvbmYNCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0NCi0tLSBkZWZhdWx0cy9yYy5jb25mCShyZXZpc2lvbiAyMzQxNjQpDQor KysgZGVmYXVsdHMvcmMuY29uZgkod29ya2luZyBjb3B5KQ0KQEAgLTI5Nyw4 ICsyOTcsOSBAQA0KIGthZG1pbmQ1X3NlcnZlcj0iL3Vzci9saWJleGVjL2th ZG1pbmQiCSMgcGF0aCB0byBrZXJiZXJvcyA1IGFkbWluIGRhZW1vbg0KIGtw YXNzd2RkX3NlcnZlcl9lbmFibGU9Ik5PIgkjIFJ1biBrcGFzc3dkZCAob3Ig Tk8pDQoga3Bhc3N3ZGRfc2VydmVyPSIvdXNyL2xpYmV4ZWMva3Bhc3N3ZGQi CSMgcGF0aCB0byBrZXJiZXJvcyA1IHBhc3N3ZCBkYWVtb24NCi1rZmRfc2Vy dmVyX2VuYWJsZT0iTk8iCQkjIFJ1biBrZmQgKG9yIE5PKQ0KLWtmZF9zZXJ2 ZXI9Ii91c3IvbGliZXhlYy9rZmQiCSMgcGF0aCB0byBrZXJiZXJvcyA1IGtm ZCBkYWVtb24NCitrZmRfZW5hYmxlPSJOTyIgCQkjIFJ1biBrZmQgKG9yIE5P KQ0KK2tmZF9wcm9ncmFtPSIvdXNyL2xpYmV4ZWMva2ZkIgkjIFBhdGggdG8g a2VyYmVyb3MgNSBrZmQgZGFlbW9uDQora2ZkX2ZsYWdzPSItaSINCiANCiBn c3NkX2VuYWJsZT0iTk8iCQkjIFJ1biB0aGUgZ3NzZCBkYWVtb24gKG9yIE5P KS4NCiBnc3NkX2ZsYWdzPSIiCQkJIyBGbGFncyBmb3IgZ3NzZC4NCkluZGV4 OiByYy5kL2tmZA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIHJjLmQv a2ZkCShyZXZpc2lvbiAyMzQxNjQpDQorKysgcmMuZC9rZmQJKHdvcmtpbmcg Y29weSkNCkBAIC0xLDE5ICsxLDIwIEBADQogIyEvYmluL3NoDQotIw0KKw0K ICMgJEZyZWVCU0QkDQogIw0KLQ0KICMgUFJPVklERToga2ZkDQotIyBCRUZP UkU6IERBRU1PTg0KKyMgUkVRVUlSRToga2VyYmVyb3MNCisjIEtFWVdPUkQ6 IHNodXRkb3duDQogDQogLiAvZXRjL3JjLnN1YnINCiANCi1uYW1lPSJrZmQi DQorbmFtZT1rZmQNCityY3Zhcj1rZmRfZW5hYmxlDQorDQogbG9hZF9yY19j b25maWcgJG5hbWUNCi1yY3Zhcj0ia2ZkX3NlcnZlcl9lbmFibGUiDQotdW5z ZXQgc3RhcnRfY21kDQotY29tbWFuZD0iJHtrZmRfc2VydmVyfSINCi1rZmRf ZmxhZ3M9Ii1pIg0KKw0KKyMgdW5zZXQgc3RhcnRfY21kID8/Pw0KKw0KIGNv bW1hbmRfYXJncz0iJiINCiANCiBydW5fcmNfY29tbWFuZCAiJDEiDQpJbmRl eDogcmMuZC9EQUVNT04NCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBy Yy5kL0RBRU1PTgkocmV2aXNpb24gMjM0MTY0KQ0KKysrIHJjLmQvREFFTU9O CSh3b3JraW5nIGNvcHkpDQpAQCAtNCw3ICs0LDcgQEANCiAjDQogDQogIyBQ Uk9WSURFOiBEQUVNT04NCi0jIFJFUVVJUkU6IE5FVFdPUktJTkcgU0VSVkVS Uw0KKyMgUkVRVUlSRTogTkVUV09SS0lORyBTRVJWRVJTIGtmZA0KIA0KICMJ VGhpcyBpcyBhIGR1bW15IGRlcGVuZGVuY3ksIHRvIGVuc3VyZSB0aGF0IGdl bmVyYWwgcHVycG9zZSBkYWVtb25zDQogIwlhcmUgcnVuIF9hZnRlcl8gdGhl IGFib3ZlIGFyZS4NCg== --0-318390063-1334195461=:20567-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 01:53:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55AB1106566C; Thu, 12 Apr 2012 01:53:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3C08FC0C; Thu, 12 Apr 2012 01:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C1rYv0005329; Thu, 12 Apr 2012 01:53:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C1rYlk005327; Thu, 12 Apr 2012 01:53:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201204120153.q3C1rYlk005327@svn.freebsd.org> From: Doug Barton Date: Thu, 12 Apr 2012 01:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234165 - in head: contrib/bind9 share/doc/bind9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 01:53:34 -0000 Author: dougb Date: Thu Apr 12 01:53:33 2012 New Revision: 234165 URL: http://svn.freebsd.org/changeset/base/234165 Log: The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes. This change was noticed by ISC at: https://lists.isc.org/pipermail/bind-users/2012-April/087345.html and verified by me both by comparing the contents of the old and new distfiles and by verifying the PGP signature on the new distfile. Deleted: head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.html head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.pdf head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.txt head/contrib/bind9/release-notes.css Modified: head/share/doc/bind9/Makefile Directory Properties: head/contrib/bind9/ (props changed) Modified: head/share/doc/bind9/Makefile ============================================================================== --- head/share/doc/bind9/Makefile Thu Apr 12 01:14:03 2012 (r234164) +++ head/share/doc/bind9/Makefile Thu Apr 12 01:53:33 2012 (r234165) @@ -8,9 +8,7 @@ SRCDIR= ${BIND_DIR}/doc NO_OBJ= FILESGROUPS= TOP ARM MISC -TOP= CHANGES COPYRIGHT FAQ HISTORY README \ - RELEASE-NOTES-BIND-9.8.1.pdf RELEASE-NOTES-BIND-9.8.1.txt \ - RELEASE-NOTES-BIND-9.8.1.html release-notes.css +TOP= CHANGES COPYRIGHT FAQ HISTORY README TOPDIR= ${DOCDIR}/bind9 ARM= Bv9ARM.ch01.html Bv9ARM.ch02.html Bv9ARM.ch03.html \ Bv9ARM.ch04.html Bv9ARM.ch05.html Bv9ARM.ch06.html \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 01:57:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 43B981065697; Thu, 12 Apr 2012 01:57:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 3110C1631D2; Thu, 12 Apr 2012 01:57:24 +0000 (UTC) Date: Wed, 11 Apr 2012 18:57:23 -0700 (PDT) From: Doug Barton To: Stanislav Sedov In-Reply-To: Message-ID: References: <201204100927.q3A9Rf3r013400@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234093 - in head/etc: defaults rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 01:57:26 -0000 On Wed, 11 Apr 2012, Doug Barton wrote: > Scripts that start persistent services should always include "KEYWORD: > shutdown" so that they get started cleanly. Sorry, that's "so that they get shut down cleanly." Doug From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 03:25:47 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 785D5106566C; Thu, 12 Apr 2012 03:25:47 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 3ACEB8FC14; Thu, 12 Apr 2012 03:25:47 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q3C3PfOr029778; Wed, 11 Apr 2012 23:25:41 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q3C3PfdN029777; Wed, 11 Apr 2012 23:25:41 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 11 Apr 2012 23:25:41 -0400 From: David Schultz To: David Chisnall Message-ID: <20120412032541.GA29711@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201203131414.q2DEEDBR048510@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203131414.q2DEEDBR048510@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r232926 - in head: include/xlocale lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 03:25:47 -0000 On Tue, Mar 13, 2012, David Chisnall wrote: > Modified: head/lib/libc/locale/Symbol.map > ============================================================================== > --- head/lib/libc/locale/Symbol.map Tue Mar 13 14:10:33 2012 (r232925) > +++ head/lib/libc/locale/Symbol.map Tue Mar 13 14:14:13 2012 (r232926) > @@ -60,9 +60,13 @@ FBSD_1.0 { > nextwctype; > nl_langinfo; > __maskrune; > + __maskrune_l; > __sbmaskrune; > + __sbmaskrune_l; > __istype; > + __istype_l; > __sbistype; > + __sbistype_l; > __isctype; > __toupper; > __sbtoupper; (still a month behind on commit mail) This doesn't look right; new symbols should be in the FBSD_1.3 namespace, not FBSD_1.0. Here is the symbol versioning documentation, if you care: http://people.freebsd.org/~deischen/symver/freebsd_versioning.txt From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 03:35:53 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A349A106564A; Thu, 12 Apr 2012 03:35:53 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6848FC0A; Thu, 12 Apr 2012 03:35:53 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q3C3ZqJo029947; Wed, 11 Apr 2012 23:35:52 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q3C3Zqkw029946; Wed, 11 Apr 2012 23:35:52 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 11 Apr 2012 23:35:52 -0400 From: David Schultz To: David Chisnall Message-ID: <20120412033552.GB29711@zim.MIT.EDU> Mail-Followup-To: David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201203132002.q2DK2g0K060213@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203132002.q2DK2g0K060213@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r232935 - head/lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 03:35:53 -0000 On Tue, Mar 13, 2012, David Chisnall wrote: > Author: theraven > Date: Tue Mar 13 20:02:41 2012 > New Revision: 232935 > URL: http://svn.freebsd.org/changeset/base/232935 > > Log: > First set of xlocale man pages. More to follow... Thanks! By the way, it's customary to bump the date on the manpage if there are significant changes, such as the addition of a new function. From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 06:32:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AFF9D106566C for ; Thu, 12 Apr 2012 06:32:46 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0968FC15 for ; Thu, 12 Apr 2012 06:32:45 +0000 (UTC) Received: by lagv3 with SMTP id v3so1695558lag.13 for ; Wed, 11 Apr 2012 23:32:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=X/leeGBKreRkeDKGLnxVcShyUabI+X2rcNy+ZoxWA+A=; b=lUSmEIiDymjNqznzGeCYEQBPr+LZe7Lcj4hM1DYP+7lHSBzFNfeWUoYtuHAkV73uz9 gf2oWRHvkGy6LaHT5vfj/W2WLsuWsdQ8ojB9j36D+9VxKeXvd1ZlGuDTC7eCl9ynQZd1 qur03uP6Wl4dZ091Y9HzZ5rO/x2fcj/Iv/Ll06J8ovXPyG9fHrn9vVwvxebl4pGtYFD4 mydWr6+T0B53hH8Iwn40KGaPh8qdT0ghWW9R84VuwOisXy4JUQVg7S4gzZHjaghjtn5z 9NqSOBRQku34HRh0iFy9wvKZTsyCW4/OIwJ7f+rBKENxcf4wTsrKbwv+13gavuAPCi6g K9Tg== Received: by 10.152.110.193 with SMTP id ic1mr1098738lab.4.1334212364659; Wed, 11 Apr 2012 23:32:44 -0700 (PDT) Received: from [10.254.254.77] (ppp109-252-212-252.pppoe.spdop.ru. [109.252.212.252]) by mx.google.com with ESMTPS id h8sm6491916lbx.8.2012.04.11.23.32.43 (version=SSLv3 cipher=OTHER); Wed, 11 Apr 2012 23:32:44 -0700 (PDT) Message-ID: <4F86770B.508@zonov.org> Date: Thu, 12 Apr 2012 10:32:43 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: John Baldwin References: <201204051713.q35HDE3d067735@svn.freebsd.org> <4F848E4B.8020302@zonov.org> <201204111202.05409.jhb@freebsd.org> In-Reply-To: <201204111202.05409.jhb@freebsd.org> Content-Type: multipart/mixed; boundary="------------070604040808030408020200" X-Gm-Message-State: ALoCoQmq40EmDjdWEIypSvfazmXcyADa4ZgnO4cKJj/B1hoNpmt+RgmdTsIwbn0D2+aKBwk7N9Fr Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233925 - in head: sys/kern sys/sys sys/vm usr.bin/kdump usr.bin/ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 06:32:46 -0000 This is a multi-part message in MIME format. --------------070604040808030408020200 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit On 11.04.2012 20:02, John Baldwin wrote: > On Tuesday, April 10, 2012 3:47:23 pm Andrey Zonov wrote: >> On 05.04.2012 21:13, John Baldwin wrote: >>> Author: jhb >>> Date: Thu Apr 5 17:13:14 2012 >>> New Revision: 233925 >>> URL: http://svn.freebsd.org/changeset/base/233925 >>> >>> Log: >>> Add new ktrace records for the start and end of VM faults. This gives >>> a pair of records similar to syscall entry and return that a user can >>> use to determine how long page faults take. The new ktrace records are >>> enabled via the 'p' trace type, and are enabled in the default set of >>> trace points. >>> >>> Reviewed by: kib >>> MFC after: 2 weeks >>> >> >> Hi John, >> >> Thanks a lot, this change is very useful! >> >> And while you are here I would like to show you a patch which adds a >> "wmesg" to the context switch tracing. It is not finished, it's just a >> concept. Please review it and if you are interesting in that I'll >> finish it and will test more widely. > > Ah, this looks fairly neat. However, I think you will need a few changes: > > 1) You will want to make kdump handle either the old or new size of struct > ktr_csw. (The size of the record is in the header, so as long as you have > a 'struct ktr_csw_old' you can handle this fairly easily.) > It's a good suggestion. I've implemented that and tested. > 2) cs->wmesg is never NULL. Instead, it should probably just always print it > out. > Agree. > 3) condvar's have a valid wmesg. > Yes, I found it in 5 minutes after sending mail. Please look at updated patch. -- Andrey Zonov --------------070604040808030408020200 Content-Type: text/plain; charset=windows-1251; name="ktrace_csw.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ktrace_csw.patch" Index: usr.bin/kdump/kdump.c =================================================================== --- usr.bin/kdump/kdump.c (revision 233925) +++ usr.bin/kdump/kdump.c (working copy) @@ -94,7 +94,7 @@ void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); -void ktrcsw(struct ktr_csw *); +void ktrcsw(struct ktr_csw *, int); void ktruser_malloc(unsigned char *); void ktruser_rtld(int, unsigned char *); void ktruser(int, unsigned char *); @@ -298,7 +298,7 @@ ktrpsig((struct ktr_psig *)m); break; case KTR_CSW: - ktrcsw((struct ktr_csw *)m); + ktrcsw((struct ktr_csw *)m, ktrlen); break; case KTR_USER: ktruser(ktrlen, m); @@ -1245,10 +1245,16 @@ } void -ktrcsw(struct ktr_csw *cs) +ktrcsw(struct ktr_csw *cs, int len) { - printf("%s %s\n", cs->out ? "stop" : "resume", - cs->user ? "user" : "kernel"); + if (len == sizeof(struct ktr_csw_old)) + printf("%s %s\n", cs->out ? "stop" : "resume", + cs->user ? "user" : "kernel"); + else if (len == sizeof(struct ktr_csw)) + printf("%s %s \"%s\"\n", cs->out ? "stop" : "resume", + cs->user ? "user" : "kernel", cs->wmesg); + else + errx(1, "Unknown size of ktrace record"); } #define UTRACE_DLOPEN_START 1 Index: sys/sys/ktrace.h =================================================================== --- sys/sys/ktrace.h (revision 233925) +++ sys/sys/ktrace.h (working copy) @@ -135,9 +135,15 @@ * KTR_CSW - trace context switches */ #define KTR_CSW 6 +struct ktr_csw_old { + int out; /* 1 if switch out, 0 if switch in */ + int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ +}; + struct ktr_csw { int out; /* 1 if switch out, 0 if switch in */ int user; /* 1 if usermode (ivcsw), 0 if kernel (vcsw) */ + char wmesg[8]; }; /* @@ -244,7 +250,7 @@ #ifdef _KERNEL void ktrnamei(char *); -void ktrcsw(int, int); +void ktrcsw(int, int, const char *); void ktrpsig(int, sig_t, sigset_t *, int); void ktrfault(vm_offset_t, int); void ktrfaultend(int); Index: sys/kern/kern_ktrace.c =================================================================== --- sys/kern/kern_ktrace.c (revision 233925) +++ sys/kern/kern_ktrace.c (working copy) @@ -733,8 +733,9 @@ } void -ktrcsw(out, user) +ktrcsw(out, user, wmesg) int out, user; + const char *wmesg; { struct thread *td = curthread; struct ktr_request *req; @@ -746,6 +747,10 @@ kc = &req->ktr_data.ktr_csw; kc->out = out; kc->user = user; + if (wmesg != NULL) + strlcpy(kc->wmesg, wmesg, sizeof(kc->wmesg)); + else + bzero(kc->wmesg, sizeof(kc->wmesg)); ktr_enqueuerequest(td, req); ktrace_exit(td); } Index: sys/kern/subr_trap.c =================================================================== --- sys/kern/subr_trap.c (revision 233925) +++ sys/kern/subr_trap.c (working copy) @@ -219,7 +219,7 @@ if (flags & TDF_NEEDRESCHED) { #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 1); + ktrcsw(1, 1, __func__); #endif thread_lock(td); sched_prio(td, td->td_user_pri); @@ -227,7 +227,7 @@ thread_unlock(td); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 1); + ktrcsw(0, 1, __func__); #endif } Index: sys/kern/kern_condvar.c =================================================================== --- sys/kern/kern_condvar.c (revision 233925) +++ sys/kern/kern_condvar.c (working copy) @@ -103,7 +103,7 @@ lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -140,7 +140,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -162,7 +162,7 @@ td = curthread; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -197,7 +197,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); } @@ -220,7 +220,7 @@ lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -258,7 +258,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -286,7 +286,7 @@ lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -324,7 +324,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { @@ -353,7 +353,7 @@ lock_state = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, cv_wmesg(cvp)); #endif CV_ASSERT(cvp, lock, td); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, @@ -392,7 +392,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, cv_wmesg(cvp)); #endif PICKUP_GIANT(); if (lock != &Giant.lock_object) { Index: sys/kern/kern_synch.c =================================================================== --- sys/kern/kern_synch.c (revision 233925) +++ sys/kern/kern_synch.c (working copy) @@ -142,7 +142,7 @@ p = td->td_proc; #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Sleeping on \"%s\"", wmesg); @@ -236,7 +236,7 @@ } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); if (lock != NULL && lock != &Giant.lock_object && !(priority & PDROP)) { @@ -298,7 +298,7 @@ #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) { sleepq_release(ident); - ktrcsw(1, 0); + ktrcsw(1, 0, wmesg); sleepq_lock(ident); } #endif @@ -316,7 +316,7 @@ } #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) - ktrcsw(0, 0); + ktrcsw(0, 0, wmesg); #endif PICKUP_GIANT(); mtx_lock_spin(mtx); --------------070604040808030408020200-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 08:38:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2973106566B; Thu, 12 Apr 2012 08:38:56 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9958FC08; Thu, 12 Apr 2012 08:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C8cuBQ017984; Thu, 12 Apr 2012 08:38:56 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C8cu3p017982; Thu, 12 Apr 2012 08:38:56 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204120838.q3C8cu3p017982@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Apr 2012 08:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234168 - head/tools/tools/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 08:38:57 -0000 Author: luigi Date: Thu Apr 12 08:38:56 2012 New Revision: 234168 URL: http://svn.freebsd.org/changeset/base/234168 Log: use getopt to parse options, add one option to set the wait time for link-up events Modified: head/tools/tools/netmap/bridge.c Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Thu Apr 12 06:29:02 2012 (r234167) +++ head/tools/tools/netmap/bridge.c Thu Apr 12 08:38:56 2012 (r234168) @@ -48,7 +48,7 @@ int verbose = 0; } while (0) -char *version = "$Id: bridge.c 10637 2012-02-24 16:36:25Z luigi $"; +char *version = "$Id: bridge.c 10857 2012-04-06 12:18:22Z luigi $"; static int do_abort = 0; @@ -306,6 +306,14 @@ howmany(struct my_ring *me, int tx) return tot; } +static void +usage(void) +{ + fprintf(stderr, + "usage: bridge [-v] [-i ifa] [-i ifb] [-b burst] [-w wait_time] [iface]\n"); + exit(1); +} + /* * bridge [-v] if1 [if2] * @@ -317,36 +325,72 @@ int main(int argc, char **argv) { struct pollfd pollfd[2]; - int i; - u_int burst = 1024; + int i, ch; + u_int burst = 1024, wait_link = 4; struct my_ring me[2]; + char *ifa = NULL, *ifb = NULL; fprintf(stderr, "%s %s built %s %s\n", argv[0], version, __DATE__, __TIME__); bzero(me, sizeof(me)); - while (argc > 1 && !strcmp(argv[1], "-v")) { - verbose++; - argv++; - argc--; - } + while ( (ch = getopt(argc, argv, "b:i:vw:")) != -1) { + switch (ch) { + D("bad option %c %s", ch, optarg); + usage(); + break; + case 'b': /* burst */ + burst = atoi(optarg); + break; + case 'i': /* interface */ + if (ifa == NULL) + ifa = optarg; + else if (ifb == NULL) + ifb = optarg; + else + D("%s ignored, already have 2 interfaces", + optarg); + break; + case 'v': + verbose++; + break; + case 'w': + wait_link = atoi(optarg); + break; + } - if (argc < 2 || argc > 4) { - D("Usage: %s IFNAME1 [IFNAME2 [BURST]]", argv[0]); - return (1); } + if (argc > 1) + ifa = argv[1]; + if (argc > 2) + ifb = argv[2]; + if (argc > 3) + burst = atoi(argv[3]); + if (!ifb) + ifb = ifa; + if (!ifa) { + D("missing interface"); + usage(); + } + if (burst < 1 || burst > 8192) { + D("invalid burst %d, set to 1024", burst); + burst = 1024; + } + if (wait_link > 100) { + D("invalid wait_link %d, set to 4", wait_link); + wait_link = 4; + } /* setup netmap interface #1. */ - me[0].ifname = argv[1]; - if (argc == 2 || !strcmp(argv[1], argv[2])) { + me[0].ifname = ifa; + me[1].ifname = ifb; + if (!strcmp(ifa, ifb)) { D("same interface, endpoint 0 goes to host"); i = NETMAP_SW_RING; - me[1].ifname = argv[1]; } else { /* two different interfaces. Take all rings on if1 */ i = 0; // all hw rings - me[1].ifname = argv[2]; } if (netmap_open(me, i)) return (1); @@ -385,8 +429,6 @@ main(int argc, char **argv) me[1].if_reqcap = me[1].if_curcap; me[1].if_reqcap &= ~(IFCAP_HWCSUM | IFCAP_TSO | IFCAP_TOE); do_ioctl(me+1, SIOCSIFCAP); - if (argc > 3) - burst = atoi(argv[3]); /* packets burst size. */ /* setup poll(2) variables. */ memset(pollfd, 0, sizeof(pollfd)); @@ -395,8 +437,8 @@ main(int argc, char **argv) pollfd[i].events = (POLLIN); } - D("Wait 2 secs for link to come up..."); - sleep(2); + D("Wait %d secs for link to come up...", wait_link); + sleep(wait_link); D("Ready to go, %s 0x%x/%d <-> %s 0x%x/%d.", me[0].ifname, me[0].queueid, me[0].nifp->ni_rx_queues, me[1].ifname, me[1].queueid, me[1].nifp->ni_rx_queues); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 08:54:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A0CE106566B; Thu, 12 Apr 2012 08:54:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 552048FC0C; Thu, 12 Apr 2012 08:54:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3C8s2Ie018579; Thu, 12 Apr 2012 08:54:02 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3C8s2XY018577; Thu, 12 Apr 2012 08:54:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204120854.q3C8s2XY018577@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Apr 2012 08:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234169 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 08:54:02 -0000 Author: luigi Date: Thu Apr 12 08:54:01 2012 New Revision: 234169 URL: http://svn.freebsd.org/changeset/base/234169 Log: use correct selinfo pointer for the generic interrupt handler (it is never used in current FreeBSD drivers). Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Apr 12 08:38:56 2012 (r234168) +++ head/sys/dev/netmap/netmap.c Thu Apr 12 08:54:01 2012 (r234169) @@ -1667,10 +1667,10 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (work_done) { /* RX path */ r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; - main_wq = (na->num_rx_queues > 1) ? &na->tx_si : NULL; + main_wq = (na->num_rx_queues > 1) ? &na->rx_si : NULL; } else { /* tx path */ r = na->tx_rings + q; - main_wq = (na->num_tx_queues > 1) ? &na->rx_si : NULL; + main_wq = (na->num_tx_queues > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ } if (na->separate_locks) { From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 09:30:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72B931065689; Thu, 12 Apr 2012 09:30:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 462268FC16; Thu, 12 Apr 2012 09:30:19 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so1827056lbb.13 for ; Thu, 12 Apr 2012 02:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JRzBPqvCp6nrwGAHkC9dd0MDRl/PNqLeZh/Qm/yek4s=; b=Rjniy8DSv2RnWAu4bvKJFoBVRsazyrUEoJK+jA6BpOeOlPEQBXdorYPu3RiGJ4JXrA Ay6r28HH9wMhIWQhmrheS2PnGZNrcUlnAJuH2jkphGf9i2dJLtoREfICjtx0ow6M8ScO KdZH5YNLAQLhAqF++4J38uooFPcLjlxhrvIB9i24BOjUAqxpz2cLB09zlQuOSi68YDlq xnO60EE2QD/jkTk4A06Eh7qgboodyxWCdhPf1Sdf8aof99sHeKprQm1txUf6IiADnNWP KUZ+dda0r+cjtikwlqt9sEsPCXEFyTwN203smmrhwMzZEvM+9oBl81xRH6/jjFIjnmkD /N8w== MIME-Version: 1.0 Received: by 10.112.11.39 with SMTP id n7mr683277lbb.93.1334223017893; Thu, 12 Apr 2012 02:30:17 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.25.69 with HTTP; Thu, 12 Apr 2012 02:30:17 -0700 (PDT) In-Reply-To: <201204120153.q3C1rYlk005327@svn.freebsd.org> References: <201204120153.q3C1rYlk005327@svn.freebsd.org> Date: Thu, 12 Apr 2012 13:30:17 +0400 X-Google-Sender-Auth: AUIPGN_La1H0twNveY0lN6C67PE Message-ID: From: Sergey Kandaurov To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234165 - in head: contrib/bind9 share/doc/bind9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 09:30:20 -0000 On 12 April 2012 05:53, Doug Barton wrote: > Author: dougb > Date: Thu Apr 12 01:53:33 2012 > New Revision: 234165 > URL: http://svn.freebsd.org/changeset/base/234165 > > Log: > =A0The BIND 9.8.2 tarball was re-rolled to remove 9.8.1 release notes. > =A0This change was noticed by ISC at: > > =A0https://lists.isc.org/pipermail/bind-users/2012-April/087345.html > > =A0and verified by me both by comparing the contents of the old and new > =A0distfiles and by verifying the PGP signature on the new distfile. > > Deleted: > =A0head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.html > =A0head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.pdf > =A0head/contrib/bind9/RELEASE-NOTES-BIND-9.8.1.txt > =A0head/contrib/bind9/release-notes.css Also, these files should be added to ObsoleteFiles.inc [...] --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 10:32:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A82AE106564A; Thu, 12 Apr 2012 10:32:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F227D8FC0A; Thu, 12 Apr 2012 10:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CAWMFP024353; Thu, 12 Apr 2012 10:32:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CAWM0W024351; Thu, 12 Apr 2012 10:32:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201204121032.q3CAWM0W024351@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 12 Apr 2012 10:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234170 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 10:32:23 -0000 Author: kib Date: Thu Apr 12 10:32:22 2012 New Revision: 234170 URL: http://svn.freebsd.org/changeset/base/234170 Log: Propagate the current state of rtld_bind_lock to dlopen_object() calls through the filter loading call chain. This fixes attempts to write-lock the already locked rtld_bind_lock when filter loading is initiated by relocation of dlopening dso. Reported and tested by: Taku YAMAMOTO MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Apr 12 08:54:01 2012 (r234169) +++ head/libexec/rtld-elf/rtld.c Thu Apr 12 10:32:22 2012 (r234170) @@ -85,7 +85,7 @@ static void digest_dynamic(Obj_Entry *, static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, - int lo_flags, int mode); + int lo_flags, int mode, RtldLockState *lockstate); static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); @@ -1672,13 +1672,14 @@ unload_filtees(Obj_Entry *obj) } static void -load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags) +load_filtee1(Obj_Entry *obj, Needed_Entry *needed, int flags, + RtldLockState *lockstate) { for (; needed != NULL; needed = needed->next) { needed->obj = dlopen_object(obj->strtab + needed->name, -1, obj, flags, ((ld_loadfltr || obj->z_loadfltr) ? RTLD_NOW : RTLD_LAZY) | - RTLD_LOCAL); + RTLD_LOCAL, lockstate); } } @@ -1688,8 +1689,8 @@ load_filtees(Obj_Entry *obj, int flags, lock_restart_for_upgrade(lockstate); if (!obj->filtees_loaded) { - load_filtee1(obj, obj->needed_filtees, flags); - load_filtee1(obj, obj->needed_aux_filtees, flags); + load_filtee1(obj, obj->needed_filtees, flags, lockstate); + load_filtee1(obj, obj->needed_aux_filtees, flags, lockstate); obj->filtees_loaded = true; } } @@ -2489,7 +2490,7 @@ rtld_dlopen(const char *name, int fd, in lo_flags |= RTLD_LO_TRACE; return (dlopen_object(name, fd, obj_main, lo_flags, - mode & (RTLD_MODEMASK | RTLD_GLOBAL))); + mode & (RTLD_MODEMASK | RTLD_GLOBAL), NULL)); } static void @@ -2504,17 +2505,20 @@ dlopen_cleanup(Obj_Entry *obj) static Obj_Entry * dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, - int mode) + int mode, RtldLockState *lockstate) { Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - RtldLockState lockstate; + RtldLockState mlockstate; int result; objlist_init(&initlist); - wlock_acquire(rtld_bind_lock, &lockstate); + if (lockstate == NULL && !(lo_flags & RTLD_LO_EARLY)) { + wlock_acquire(rtld_bind_lock, &mlockstate); + lockstate = &mlockstate; + } GDB_STATE(RT_ADD,NULL); old_obj_tail = obj_tail; @@ -2543,7 +2547,7 @@ dlopen_object(const char *name, int fd, if (result == -1 || (relocate_objects(obj, (mode & RTLD_MODEMASK) == RTLD_NOW, &obj_rtld, (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, - &lockstate)) == -1) { + lockstate)) == -1) { dlopen_cleanup(obj); obj = NULL; } else if (lo_flags & RTLD_LO_EARLY) { @@ -2587,28 +2591,31 @@ dlopen_object(const char *name, int fd, GDB_STATE(RT_CONSISTENT,obj ? &obj->linkmap : NULL); if (!(lo_flags & RTLD_LO_EARLY)) { - map_stacks_exec(&lockstate); + map_stacks_exec(lockstate); } if (initlist_objects_ifunc(&initlist, (mode & RTLD_MODEMASK) == RTLD_NOW, (lo_flags & RTLD_LO_EARLY) ? SYMLOOK_EARLY : 0, - &lockstate) == -1) { + lockstate) == -1) { objlist_clear(&initlist); dlopen_cleanup(obj); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); return (NULL); } if (!(lo_flags & RTLD_LO_EARLY)) { /* Call the init functions. */ - objlist_call_init(&initlist, &lockstate); + objlist_call_init(&initlist, lockstate); } objlist_clear(&initlist); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); return obj; trace: trace_loaded_objects(obj); - lock_release(rtld_bind_lock, &lockstate); + if (lockstate == &mlockstate) + lock_release(rtld_bind_lock, lockstate); exit(0); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 10:32:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE2210657AA; Thu, 12 Apr 2012 10:32:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C292C8FC08; Thu, 12 Apr 2012 10:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CAWYaJ024395; Thu, 12 Apr 2012 10:32:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CAWY96024393; Thu, 12 Apr 2012 10:32:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204121032.q3CAWY96024393@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Apr 2012 10:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234171 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 10:32:35 -0000 Author: luigi Date: Thu Apr 12 10:32:34 2012 New Revision: 234171 URL: http://svn.freebsd.org/changeset/base/234171 Log: remove an unnecessary #define Modified: head/sys/net/netmap.h Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Thu Apr 12 10:32:22 2012 (r234170) +++ head/sys/net/netmap.h Thu Apr 12 10:32:34 2012 (r234171) @@ -234,10 +234,6 @@ struct netmap_if { const ssize_t ring_ofs[0]; }; -#ifndef IFCAP_NETMAP -#define IFCAP_NETMAP 0x100000 /* used on linux */ -#endif - #ifndef NIOCREGIF /* * ioctl names and related fields From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 10:48:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBC32106564A; Thu, 12 Apr 2012 10:48:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8089C8FC12; Thu, 12 Apr 2012 10:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CAmifE024927; Thu, 12 Apr 2012 10:48:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CAmi06024923; Thu, 12 Apr 2012 10:48:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201204121048.q3CAmi06024923@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 12 Apr 2012 10:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234172 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 10:48:45 -0000 Author: kib Date: Thu Apr 12 10:48:43 2012 New Revision: 234172 URL: http://svn.freebsd.org/changeset/base/234172 Log: Add thread-private flag to indicate that error value is already placed in td_errno. Flag is supposed to be used by syscalls returning EJUSTRETURN because errno was already placed into the usermode frame by a call to set_syscall_retval(9). Both ktrace and dtrace get errno value from td_errno if the flag is set. Use the flag to fix sigsuspend(2) error return ktrace records. Requested by: bde MFC after: 1 week Modified: head/sys/kern/kern_sig.c head/sys/kern/subr_syscall.c head/sys/sys/proc.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Apr 12 10:32:34 2012 (r234171) +++ head/sys/kern/kern_sig.c Thu Apr 12 10:48:43 2012 (r234172) @@ -1465,6 +1465,8 @@ kern_sigsuspend(struct thread *td, sigse mtx_unlock(&p->p_sigacts->ps_mtx); } PROC_UNLOCK(p); + td->td_errno = EINTR; + td->td_pflags |= TDP_NERRNO; return (EJUSTRETURN); } Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Thu Apr 12 10:32:34 2012 (r234171) +++ head/sys/kern/subr_syscall.c Thu Apr 12 10:48:43 2012 (r234172) @@ -136,7 +136,8 @@ syscallenter(struct thread *td, struct s AUDIT_SYSCALL_EXIT(error, td); /* Save the latest error return value. */ - td->td_errno = error; + if ((td->td_pflags & TDP_NERRNO) == 0) + td->td_errno = error; #ifdef KDTRACE_HOOKS /* @@ -191,9 +192,12 @@ syscallret(struct thread *td, int error, syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); #ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa->code, error, td->td_retval[0]); + if (KTRPOINT(td, KTR_SYSRET)) { + ktrsysret(sa->code, (td->td_pflags & TDP_NERRNO) == 0 ? + error : td->td_errno, td->td_retval[0]); + } #endif + td->td_pflags &= ~TDP_NERRNO; if (p->p_flag & P_TRACED) { traced = 1; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Apr 12 10:32:34 2012 (r234171) +++ head/sys/sys/proc.h Thu Apr 12 10:48:43 2012 (r234172) @@ -418,6 +418,7 @@ do { \ #define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ #define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ +#define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ /* * Reasons that the current thread can not be run yet. From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 11:23:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF571065678; Thu, 12 Apr 2012 11:23:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D668FC15; Thu, 12 Apr 2012 11:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CBNOQs026193; Thu, 12 Apr 2012 11:23:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CBNOB8026191; Thu, 12 Apr 2012 11:23:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201204121123.q3CBNOB8026191@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 Apr 2012 11:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234173 - head/contrib/openpam/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 11:23:25 -0000 Author: des Date: Thu Apr 12 11:23:24 2012 New Revision: 234173 URL: http://svn.freebsd.org/changeset/base/234173 Log: Keep a copy of the original pointer returned by openpam_readline() so we can free it later, instead of trying to free a pointer that points to the end of the buffer. Committed to head because this code no longer exists upstream. Submitted by: jasone@ Modified: head/contrib/openpam/lib/openpam_configure.c Modified: head/contrib/openpam/lib/openpam_configure.c ============================================================================== --- head/contrib/openpam/lib/openpam_configure.c Thu Apr 12 10:48:43 2012 (r234172) +++ head/contrib/openpam/lib/openpam_configure.c Thu Apr 12 11:23:24 2012 (r234173) @@ -360,7 +360,7 @@ openpam_parse_chain(pam_handle_t *pamh, pam_chain_t *this, **next; pam_facility_t fclt; pam_control_t ctlf; - char *line, *str, *name; + char *line0, *line, *str, *name; char *option, **optv; int len, lineno, ret; FILE *f; @@ -377,18 +377,18 @@ openpam_parse_chain(pam_handle_t *pamh, this = NULL; name = NULL; lineno = 0; - while ((line = openpam_readline(f, &lineno, NULL)) != NULL) { + while ((line0 = line = openpam_readline(f, &lineno, NULL)) != NULL) { /* get service name if necessary */ if (style == pam_conf_style) { if ((len = parse_service_name(&line, &str)) == 0) { openpam_log(PAM_LOG_NOTICE, "%s(%d): invalid service name (ignored)", filename, lineno); - FREE(line); + FREE(line0); continue; } if (strlcmp(service, str, len) != 0) { - FREE(line); + FREE(line0); continue; } } @@ -401,7 +401,7 @@ openpam_parse_chain(pam_handle_t *pamh, goto fail; } if (facility != fclt && facility != PAM_FACILITY_ANY) { - FREE(line); + FREE(line0); continue; } @@ -425,7 +425,7 @@ openpam_parse_chain(pam_handle_t *pamh, FREE(name); if (ret != PAM_SUCCESS) goto fail; - FREE(line); + FREE(line0); continue; } @@ -486,7 +486,7 @@ openpam_parse_chain(pam_handle_t *pamh, this = NULL; /* next please... */ - FREE(line); + FREE(line0); } if (!feof(f)) goto syserr; From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 11:27:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C729106566B; Thu, 12 Apr 2012 11:27:10 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B1E8FC14; Thu, 12 Apr 2012 11:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CBR9Bd026349; Thu, 12 Apr 2012 11:27:09 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CBR9VO026345; Thu, 12 Apr 2012 11:27:09 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204121127.q3CBR9VO026345@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Apr 2012 11:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234174 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 11:27:10 -0000 Author: luigi Date: Thu Apr 12 11:27:09 2012 New Revision: 234174 URL: http://svn.freebsd.org/changeset/base/234174 Log: Some code restructuring to bring the memory allocator out of netmap.c and make it easier to replace it with a different implementation. On passing, also fix indentation. NOTE: I know that #include "foo.c" is ugly, but the alternative (add another entry to sys/conf/files, add a separate header with structs and prototypes, and expose functions that are meant to be private) looks even worse to me. We need a more modular way to specify dependencies and build options. Added: head/sys/dev/netmap/netmap_mem1.c (contents, props changed) Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Apr 12 11:23:24 2012 (r234173) +++ head/sys/dev/netmap/netmap.c Thu Apr 12 11:27:09 2012 (r234174) @@ -116,507 +116,13 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); - -/*----- memory allocator -----------------*/ -/* - * Here we have the low level routines for memory allocator - * and its primary users. - */ - -/* - * Default amount of memory pre-allocated by the module. - * We start with a large size and then shrink our demand - * according to what is avalable when the module is loaded. - * At the moment the block is contiguous, but we can easily - * restrict our demand to smaller units (16..64k) - */ -#define NETMAP_MEMORY_SIZE (64 * 1024 * PAGE_SIZE) -static void * netmap_malloc(size_t size, const char *msg); -static void netmap_free(void *addr, const char *msg); - -#define netmap_if_malloc(len) netmap_malloc(len, "nifp") -#define netmap_if_free(v) netmap_free((v), "nifp") - -#define netmap_ring_malloc(len) netmap_malloc(len, "ring") -#define netmap_free_rings(na) \ - netmap_free((na)->tx_rings[0].ring, "shadow rings"); - -/* - * Allocator for a pool of packet buffers. For each buffer we have - * one entry in the bitmap to signal the state. Allocation scans - * the bitmap, but since this is done only on attach, we are not - * too worried about performance - * XXX if we need to allocate small blocks, a translation - * table is used both for kernel virtual address and physical - * addresses. - */ -struct netmap_buf_pool { - u_int total_buffers; /* total buffers. */ - u_int free; - u_int bufsize; - char *base; /* buffer base address */ - uint32_t *bitmap; /* one bit per buffer, 1 means free */ -}; -struct netmap_buf_pool nm_buf_pool; -SYSCTL_INT(_dev_netmap, OID_AUTO, total_buffers, - CTLFLAG_RD, &nm_buf_pool.total_buffers, 0, "total_buffers"); -SYSCTL_INT(_dev_netmap, OID_AUTO, free_buffers, - CTLFLAG_RD, &nm_buf_pool.free, 0, "free_buffers"); - - - - -/* - * Allocate n buffers from the ring, and fill the slot. - * Buffer 0 is the 'junk' buffer. - */ -static void -netmap_new_bufs(struct netmap_if *nifp __unused, - struct netmap_slot *slot, u_int n) -{ - struct netmap_buf_pool *p = &nm_buf_pool; - uint32_t bi = 0; /* index in the bitmap */ - uint32_t mask, j, i = 0; /* slot counter */ - - if (n > p->free) { - D("only %d out of %d buffers available", i, n); - return; - } - /* termination is guaranteed by p->free */ - while (i < n && p->free > 0) { - uint32_t cur = p->bitmap[bi]; - if (cur == 0) { /* bitmask is fully used */ - bi++; - continue; - } - /* locate a slot */ - for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; - p->bitmap[bi] &= ~mask; /* slot in use */ - p->free--; - slot[i].buf_idx = bi*32+j; - slot[i].len = p->bufsize; - slot[i].flags = NS_BUF_CHANGED; - i++; - } - ND("allocated %d buffers, %d available", n, p->free); -} - - -static void -netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) -{ - struct netmap_buf_pool *p = &nm_buf_pool; - - uint32_t pos, mask; - if (i >= p->total_buffers) { - D("invalid free index %d", i); - return; - } - pos = i / 32; - mask = 1 << (i % 32); - if (p->bitmap[pos] & mask) { - D("slot %d already free", i); - return; - } - p->bitmap[pos] |= mask; - p->free++; -} - - -/* Descriptor of the memory objects handled by our memory allocator. */ -struct netmap_mem_obj { - TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the - chain. */ - int nmo_used; /* flag set on used memory objects. */ - size_t nmo_size; /* size of the memory area reserved for the - object. */ - void *nmo_data; /* pointer to the memory area. */ -}; - -/* Wrap our memory objects to make them ``chainable``. */ -TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); - - -/* Descriptor of our custom memory allocator. */ -struct netmap_mem_d { - struct mtx nm_mtx; /* lock used to handle the chain of memory - objects. */ - struct netmap_mem_obj_h nm_molist; /* list of memory objects */ - size_t nm_size; /* total amount of memory used for rings etc. */ - size_t nm_totalsize; /* total amount of allocated memory - (the difference is used for buffers) */ - size_t nm_buf_start; /* offset of packet buffers. - This is page-aligned. */ - size_t nm_buf_len; /* total memory for buffers */ - void *nm_buffer; /* pointer to the whole pre-allocated memory - area. */ -}; - -/* Shorthand to compute a netmap interface offset. */ -#define netmap_if_offset(v) \ - ((char *) (v) - (char *) nm_mem->nm_buffer) -/* .. and get a physical address given a memory offset */ -#define netmap_ofstophys(o) \ - (vtophys(nm_mem->nm_buffer) + (o)) - - -/*------ netmap memory allocator -------*/ -/* - * Request for a chunk of memory. - * - * Memory objects are arranged into a list, hence we need to walk this - * list until we find an object with the needed amount of data free. - * This sounds like a completely inefficient implementation, but given - * the fact that data allocation is done once, we can handle it - * flawlessly. - * - * Return NULL on failure. - */ -static void * -netmap_malloc(size_t size, __unused const char *msg) -{ - struct netmap_mem_obj *mem_obj, *new_mem_obj; - void *ret = NULL; - - NMA_LOCK(); - TAILQ_FOREACH(mem_obj, &nm_mem->nm_molist, nmo_next) { - if (mem_obj->nmo_used != 0 || mem_obj->nmo_size < size) - continue; - - new_mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, - M_WAITOK | M_ZERO); - TAILQ_INSERT_BEFORE(mem_obj, new_mem_obj, nmo_next); - - new_mem_obj->nmo_used = 1; - new_mem_obj->nmo_size = size; - new_mem_obj->nmo_data = mem_obj->nmo_data; - memset(new_mem_obj->nmo_data, 0, new_mem_obj->nmo_size); - - mem_obj->nmo_size -= size; - mem_obj->nmo_data = (char *) mem_obj->nmo_data + size; - if (mem_obj->nmo_size == 0) { - TAILQ_REMOVE(&nm_mem->nm_molist, mem_obj, - nmo_next); - free(mem_obj, M_NETMAP); - } - - ret = new_mem_obj->nmo_data; - - break; - } - NMA_UNLOCK(); - ND("%s: %d bytes at %p", msg, size, ret); - - return (ret); -} - -/* - * Return the memory to the allocator. - * - * While freeing a memory object, we try to merge adjacent chunks in - * order to reduce memory fragmentation. - */ -static void -netmap_free(void *addr, const char *msg) -{ - size_t size; - struct netmap_mem_obj *cur, *prev, *next; - - if (addr == NULL) { - D("NULL addr for %s", msg); - return; - } - - NMA_LOCK(); - TAILQ_FOREACH(cur, &nm_mem->nm_molist, nmo_next) { - if (cur->nmo_data == addr && cur->nmo_used) - break; - } - if (cur == NULL) { - NMA_UNLOCK(); - D("invalid addr %s %p", msg, addr); - return; - } - - size = cur->nmo_size; - cur->nmo_used = 0; - - /* merge current chunk of memory with the previous one, - if present. */ - prev = TAILQ_PREV(cur, netmap_mem_obj_h, nmo_next); - if (prev && prev->nmo_used == 0) { - TAILQ_REMOVE(&nm_mem->nm_molist, cur, nmo_next); - prev->nmo_size += cur->nmo_size; - free(cur, M_NETMAP); - cur = prev; - } - - /* merge with the next one */ - next = TAILQ_NEXT(cur, nmo_next); - if (next && next->nmo_used == 0) { - TAILQ_REMOVE(&nm_mem->nm_molist, next, nmo_next); - cur->nmo_size += next->nmo_size; - free(next, M_NETMAP); - } - NMA_UNLOCK(); - ND("freed %s %d bytes at %p", msg, size, addr); -} - - -/* - * Create and return a new ``netmap_if`` object, and possibly also - * rings and packet buffors. - * - * Return NULL on failure. - */ -static void * -netmap_if_new(const char *ifname, struct netmap_adapter *na) -{ - struct netmap_if *nifp; - struct netmap_ring *ring; - struct netmap_kring *kring; - char *buff; - u_int i, len, ofs, numdesc; - u_int nrx = na->num_rx_queues + 1; /* shorthand, include stack queue */ - u_int ntx = na->num_tx_queues + 1; /* shorthand, include stack queue */ - - /* - * the descriptor is followed inline by an array of offsets - * to the tx and rx rings in the shared memory region. - */ - len = sizeof(struct netmap_if) + (nrx + ntx) * sizeof(ssize_t); - nifp = netmap_if_malloc(len); - if (nifp == NULL) - return (NULL); - - /* initialize base fields */ - *(int *)(uintptr_t)&nifp->ni_rx_queues = na->num_rx_queues; - *(int *)(uintptr_t)&nifp->ni_tx_queues = na->num_tx_queues; - strncpy(nifp->ni_name, ifname, IFNAMSIZ); - - (na->refcount)++; /* XXX atomic ? we are under lock */ - if (na->refcount > 1) - goto final; - - /* - * First instance. Allocate the netmap rings - * (one for each hw queue, one pair for the host). - * The rings are contiguous, but have variable size. - * The entire block is reachable at - * na->tx_rings[0] - */ - len = (ntx + nrx) * sizeof(struct netmap_ring) + - (ntx * na->num_tx_desc + nrx * na->num_rx_desc) * - sizeof(struct netmap_slot); - buff = netmap_ring_malloc(len); - if (buff == NULL) { - D("failed to allocate %d bytes for %s shadow ring", - len, ifname); -error: - (na->refcount)--; - netmap_if_free(nifp); - return (NULL); - } - /* Check whether we have enough buffers */ - len = ntx * na->num_tx_desc + nrx * na->num_rx_desc; - NMA_LOCK(); - if (nm_buf_pool.free < len) { - NMA_UNLOCK(); - netmap_free(buff, "not enough bufs"); - goto error; - } - /* - * in the kring, store the pointers to the shared rings - * and initialize the rings. We are under NMA_LOCK(). - */ - ofs = 0; - for (i = 0; i < ntx; i++) { /* Transmit rings */ - kring = &na->tx_rings[i]; - numdesc = na->num_tx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); - *(uint32_t *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - - /* - * IMPORTANT: - * Always keep one slot empty, so we can detect new - * transmissions comparing cur and nr_hwcur (they are - * the same only if there are no new transmissions). - */ - ring->avail = kring->nr_hwavail = numdesc - 1; - ring->cur = kring->nr_hwcur = 0; - *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; - netmap_new_bufs(nifp, ring->slot, numdesc); - - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - } - - for (i = 0; i < nrx; i++) { /* Receive rings */ - kring = &na->rx_rings[i]; - numdesc = na->num_rx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("rxring[%d] at %p offset %d", i, ring, ring->buf_ofs); - *(uint32_t *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - ring->cur = kring->nr_hwcur = 0; - ring->avail = kring->nr_hwavail = 0; /* empty */ - *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; - netmap_new_bufs(nifp, ring->slot, numdesc); - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - } - NMA_UNLOCK(); - // XXX initialize the selrecord structs. - -final: - /* - * fill the slots for the rx and tx queues. They contain the offset - * between the ring and nifp, so the information is usable in - * userspace to reach the ring from the nifp. - */ - for (i = 0; i < ntx; i++) { - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = - (char *)na->tx_rings[i].ring - (char *)nifp; - } - for (i = 0; i < nrx; i++) { - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+ntx] = - (char *)na->rx_rings[i].ring - (char *)nifp; - } - return (nifp); -} - -/* - * Initialize the memory allocator. - * - * Create the descriptor for the memory , allocate the pool of memory - * and initialize the list of memory objects with a single chunk - * containing the whole pre-allocated memory marked as free. - * - * Start with a large size, then halve as needed if we fail to - * allocate the block. While halving, always add one extra page - * because buffers 0 and 1 are used for special purposes. - * Return 0 on success, errno otherwise. - */ -static int -netmap_memory_init(void) -{ - struct netmap_mem_obj *mem_obj; - void *buf = NULL; - int i, n, sz = NETMAP_MEMORY_SIZE; - int extra_sz = 0; // space for rings and two spare buffers - - for (; sz >= 1<<20; sz >>=1) { - extra_sz = sz/200; - extra_sz = (extra_sz + 2*PAGE_SIZE - 1) & ~(PAGE_SIZE-1); - buf = contigmalloc(sz + extra_sz, - M_NETMAP, - M_WAITOK | M_ZERO, - 0, /* low address */ - -1UL, /* high address */ - PAGE_SIZE, /* alignment */ - 0 /* boundary */ - ); - if (buf) - break; - } - if (buf == NULL) - return (ENOMEM); - sz += extra_sz; - nm_mem = malloc(sizeof(struct netmap_mem_d), M_NETMAP, - M_WAITOK | M_ZERO); - mtx_init(&nm_mem->nm_mtx, "netmap memory allocator lock", NULL, - MTX_DEF); - TAILQ_INIT(&nm_mem->nm_molist); - nm_mem->nm_buffer = buf; - nm_mem->nm_totalsize = sz; - - /* - * A buffer takes 2k, a slot takes 8 bytes + ring overhead, - * so the ratio is 200:1. In other words, we can use 1/200 of - * the memory for the rings, and the rest for the buffers, - * and be sure we never run out. - */ - nm_mem->nm_size = sz/200; - nm_mem->nm_buf_start = - (nm_mem->nm_size + PAGE_SIZE - 1) & ~(PAGE_SIZE-1); - nm_mem->nm_buf_len = sz - nm_mem->nm_buf_start; - - nm_buf_pool.base = nm_mem->nm_buffer; - nm_buf_pool.base += nm_mem->nm_buf_start; - netmap_buffer_base = nm_buf_pool.base; - D("netmap_buffer_base %p (offset %d)", - netmap_buffer_base, (int)nm_mem->nm_buf_start); - /* number of buffers, they all start as free */ - - netmap_total_buffers = nm_buf_pool.total_buffers = - nm_mem->nm_buf_len / NETMAP_BUF_SIZE; - nm_buf_pool.bufsize = NETMAP_BUF_SIZE; - - D("Have %d MB, use %dKB for rings, %d buffers at %p", - (sz >> 20), (int)(nm_mem->nm_size >> 10), - nm_buf_pool.total_buffers, nm_buf_pool.base); - - /* allocate and initialize the bitmap. Entry 0 is considered - * always busy (used as default when there are no buffers left). - */ - n = (nm_buf_pool.total_buffers + 31) / 32; - nm_buf_pool.bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, - M_WAITOK | M_ZERO); - nm_buf_pool.bitmap[0] = ~3; /* slot 0 and 1 always busy */ - for (i = 1; i < n; i++) - nm_buf_pool.bitmap[i] = ~0; - nm_buf_pool.free = nm_buf_pool.total_buffers - 2; - - mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, - M_WAITOK | M_ZERO); - TAILQ_INSERT_HEAD(&nm_mem->nm_molist, mem_obj, nmo_next); - mem_obj->nmo_used = 0; - mem_obj->nmo_size = nm_mem->nm_size; - mem_obj->nmo_data = nm_mem->nm_buffer; - - return (0); -} - - -/* - * Finalize the memory allocator. - * - * Free all the memory objects contained inside the list, and deallocate - * the pool of memory; finally free the memory allocator descriptor. - */ -static void -netmap_memory_fini(void) -{ - struct netmap_mem_obj *mem_obj; - - while (!TAILQ_EMPTY(&nm_mem->nm_molist)) { - mem_obj = TAILQ_FIRST(&nm_mem->nm_molist); - TAILQ_REMOVE(&nm_mem->nm_molist, mem_obj, nmo_next); - if (mem_obj->nmo_used == 1) { - printf("netmap: leaked %d bytes at %p\n", - (int)mem_obj->nmo_size, - mem_obj->nmo_data); - } - free(mem_obj, M_NETMAP); - } - contigfree(nm_mem->nm_buffer, nm_mem->nm_totalsize, M_NETMAP); - // XXX mutex_destroy(nm_mtx); - free(nm_mem, M_NETMAP); -} -/*------------- end of memory allocator -----------------*/ - +/*------------- memory allocator -----------------*/ +#ifdef NETMAP_MEM2 +#include "netmap_mem2.c" +#else /* !NETMAP_MEM2 */ +#include "netmap_mem1.c" +#endif /* !NETMAP_MEM2 */ +/*------------ end of memory allocator ----------*/ /* Structure associated to each thread which registered an interface. */ struct netmap_priv_d { @@ -837,7 +343,7 @@ netmap_sync_from_host(struct netmap_adap if (j != k) { n = k >= j ? k - j : k + lim - j; kring->nr_hwavail -= n; - kring->nr_hwcur = k; + kring->nr_hwcur = k; } k = ring->avail = kring->nr_hwavail - resvd; if (k == 0 && td) @@ -1150,27 +656,28 @@ error: /* find the last ring to scan */ lim = priv->np_qlast; if (lim == NETMAP_HW_RING) - lim = (cmd == NIOCTXSYNC) ? na->num_tx_queues : na->num_rx_queues; + lim = (cmd == NIOCTXSYNC) ? + na->num_tx_queues : na->num_rx_queues; for (i = priv->np_qfirst; i < lim; i++) { - if (cmd == NIOCTXSYNC) { - struct netmap_kring *kring = &na->tx_rings[i]; - if (netmap_verbose & NM_VERB_TXSYNC) - D("sync tx ring %d cur %d hwcur %d", - i, kring->ring->cur, - kring->nr_hwcur); - na->nm_txsync(ifp, i, 1 /* do lock */); - if (netmap_verbose & NM_VERB_TXSYNC) - D("after sync tx ring %d cur %d hwcur %d", - i, kring->ring->cur, - kring->nr_hwcur); - } else { - na->nm_rxsync(ifp, i, 1 /* do lock */); - microtime(&na->rx_rings[i].ring->ts); - } + if (cmd == NIOCTXSYNC) { + struct netmap_kring *kring = &na->tx_rings[i]; + if (netmap_verbose & NM_VERB_TXSYNC) + D("pre txsync ring %d cur %d hwcur %d", + i, kring->ring->cur, + kring->nr_hwcur); + na->nm_txsync(ifp, i, 1 /* do lock */); + if (netmap_verbose & NM_VERB_TXSYNC) + D("post txsync ring %d cur %d hwcur %d", + i, kring->ring->cur, + kring->nr_hwcur); + } else { + na->nm_rxsync(ifp, i, 1 /* do lock */); + microtime(&na->rx_rings[i].ring->ts); + } } - break; + break; case BIOCIMMEDIATE: case BIOCGHDRCMPLT: @@ -1645,13 +1152,13 @@ netmap_reset(struct netmap_adapter *na, * Default functions to handle rx/tx interrupts * we have 4 cases: * 1 ring, single lock: - * lock(core); wake(i=0); unlock(core) + * lock(core); wake(i=0); unlock(core) * N rings, single lock: - * lock(core); wake(i); wake(N+1) unlock(core) + * lock(core); wake(i); wake(N+1) unlock(core) * 1 ring, separate locks: (i=0) - * lock(i); wake(i); unlock(i) + * lock(i); wake(i); unlock(i) * N rings, separate locks: - * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) + * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) * work_done is non-null on the RX path. */ int @@ -1689,7 +1196,7 @@ netmap_rx_irq(struct ifnet *ifp, int q, selwakeuppri(main_wq, PI_NET); mtx_unlock(&na->core_lock); } - *work_done = 1; /* do not fire napi again */ + *work_done = 1; /* do not fire napi again */ return 1; } Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Apr 12 11:23:24 2012 (r234173) +++ head/sys/dev/netmap/netmap_kern.h Thu Apr 12 11:27:09 2012 (r234174) @@ -86,7 +86,7 @@ struct netmap_kring { u_int nr_hwcur; int nr_hwavail; u_int nr_kflags; /* private driver flags */ -#define NKR_PENDINTR 0x1 // Pending interrupt. +#define NKR_PENDINTR 0x1 // Pending interrupt. u_int nkr_num_slots; int nkr_hwofs; /* offset between NIC and netmap ring */ @@ -208,7 +208,7 @@ struct netmap_slot *netmap_reset(struct int netmap_ring_reinit(struct netmap_kring *); extern int netmap_buf_size; -#define NETMAP_BUF_SIZE netmap_buf_size +#define NETMAP_BUF_SIZE netmap_buf_size extern int netmap_mitigate; extern int netmap_no_pendintr; extern u_int netmap_total_buffers; @@ -303,7 +303,7 @@ NMB(struct netmap_slot *slot) { uint32_t i = slot->buf_idx; return (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i *NETMAP_BUF_SIZE); + netmap_buffer_base + (i * NETMAP_BUF_SIZE); } static inline void * @@ -311,7 +311,7 @@ PNMB(struct netmap_slot *slot, uint64_t { uint32_t i = slot->buf_idx; void *ret = (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i *NETMAP_BUF_SIZE); + netmap_buffer_base + (i * NETMAP_BUF_SIZE); *pp = vtophys(ret); return ret; } @@ -319,8 +319,4 @@ PNMB(struct netmap_slot *slot, uint64_t /* default functions to handle rx/tx interrupts */ int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) -#ifdef __linux__ -#define bus_dmamap_sync(_a, _b, _c) // wmb() or rmb() ? -netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); -#endif #endif /* _NET_NETMAP_KERN_H_ */ Added: head/sys/dev/netmap/netmap_mem1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/netmap_mem1.c Thu Apr 12 11:27:09 2012 (r234174) @@ -0,0 +1,521 @@ +/* + * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. 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. + */ + +/* + * $FreeBSD$ + * + * The original netmap memory allocator, using a single large + * chunk of memory allocated with contigmalloc. + */ + +/* + * Default amount of memory pre-allocated by the module. + * We start with a large size and then shrink our demand + * according to what is avalable when the module is loaded. + */ +#define NETMAP_MEMORY_SIZE (64 * 1024 * PAGE_SIZE) +static void * netmap_malloc(size_t size, const char *msg); +static void netmap_free(void *addr, const char *msg); + +#define netmap_if_malloc(len) netmap_malloc(len, "nifp") +#define netmap_if_free(v) netmap_free((v), "nifp") + +#define netmap_ring_malloc(len) netmap_malloc(len, "ring") +#define netmap_free_rings(na) \ + netmap_free((na)->tx_rings[0].ring, "shadow rings"); + +/* + * Allocator for a pool of packet buffers. For each buffer we have + * one entry in the bitmap to signal the state. Allocation scans + * the bitmap, but since this is done only on attach, we are not + * too worried about performance + * XXX if we need to allocate small blocks, a translation + * table is used both for kernel virtual address and physical + * addresses. + */ +struct netmap_buf_pool { + u_int total_buffers; /* total buffers. */ + u_int free; + u_int bufsize; + char *base; /* buffer base address */ + uint32_t *bitmap; /* one bit per buffer, 1 means free */ +}; +struct netmap_buf_pool nm_buf_pool; +SYSCTL_INT(_dev_netmap, OID_AUTO, total_buffers, + CTLFLAG_RD, &nm_buf_pool.total_buffers, 0, "total_buffers"); +SYSCTL_INT(_dev_netmap, OID_AUTO, free_buffers, + CTLFLAG_RD, &nm_buf_pool.free, 0, "free_buffers"); + + +/* + * Allocate n buffers from the ring, and fill the slot. + * Buffer 0 is the 'junk' buffer. + */ +static void +netmap_new_bufs(struct netmap_if *nifp __unused, + struct netmap_slot *slot, u_int n) +{ + struct netmap_buf_pool *p = &nm_buf_pool; + uint32_t bi = 0; /* index in the bitmap */ + uint32_t mask, j, i = 0; /* slot counter */ + + if (n > p->free) { + D("only %d out of %d buffers available", i, n); + return; + } + /* termination is guaranteed by p->free */ + while (i < n && p->free > 0) { + uint32_t cur = p->bitmap[bi]; + if (cur == 0) { /* bitmask is fully used */ + bi++; + continue; + } + /* locate a slot */ + for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; + p->bitmap[bi] &= ~mask; /* slot in use */ + p->free--; + slot[i].buf_idx = bi*32+j; + slot[i].len = p->bufsize; + slot[i].flags = NS_BUF_CHANGED; + i++; + } + ND("allocated %d buffers, %d available", n, p->free); +} + + +static void +netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) +{ + struct netmap_buf_pool *p = &nm_buf_pool; + + uint32_t pos, mask; + if (i >= p->total_buffers) { + D("invalid free index %d", i); + return; + } + pos = i / 32; + mask = 1 << (i % 32); + if (p->bitmap[pos] & mask) { + D("slot %d already free", i); + return; + } + p->bitmap[pos] |= mask; + p->free++; +} + + +/* Descriptor of the memory objects handled by our memory allocator. */ +struct netmap_mem_obj { + TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the + chain. */ + int nmo_used; /* flag set on used memory objects. */ + size_t nmo_size; /* size of the memory area reserved for the + object. */ + void *nmo_data; /* pointer to the memory area. */ +}; + +/* Wrap our memory objects to make them ``chainable``. */ +TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); + + +/* Descriptor of our custom memory allocator. */ +struct netmap_mem_d { + struct mtx nm_mtx; /* lock used to handle the chain of memory + objects. */ + struct netmap_mem_obj_h nm_molist; /* list of memory objects */ + size_t nm_size; /* total amount of memory used for rings etc. */ + size_t nm_totalsize; /* total amount of allocated memory + (the difference is used for buffers) */ + size_t nm_buf_start; /* offset of packet buffers. + This is page-aligned. */ + size_t nm_buf_len; /* total memory for buffers */ + void *nm_buffer; /* pointer to the whole pre-allocated memory + area. */ +}; + +/* Shorthand to compute a netmap interface offset. */ +#define netmap_if_offset(v) \ + ((char *) (v) - (char *) nm_mem->nm_buffer) +/* .. and get a physical address given a memory offset */ +#define netmap_ofstophys(o) \ + (vtophys(nm_mem->nm_buffer) + (o)) + + +/*------ netmap memory allocator -------*/ +/* + * Request for a chunk of memory. + * + * Memory objects are arranged into a list, hence we need to walk this + * list until we find an object with the needed amount of data free. + * This sounds like a completely inefficient implementation, but given + * the fact that data allocation is done once, we can handle it + * flawlessly. + * + * Return NULL on failure. + */ +static void * +netmap_malloc(size_t size, __unused const char *msg) +{ + struct netmap_mem_obj *mem_obj, *new_mem_obj; + void *ret = NULL; + + NMA_LOCK(); + TAILQ_FOREACH(mem_obj, &nm_mem->nm_molist, nmo_next) { + if (mem_obj->nmo_used != 0 || mem_obj->nmo_size < size) + continue; + + new_mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, + M_WAITOK | M_ZERO); + TAILQ_INSERT_BEFORE(mem_obj, new_mem_obj, nmo_next); + + new_mem_obj->nmo_used = 1; + new_mem_obj->nmo_size = size; + new_mem_obj->nmo_data = mem_obj->nmo_data; + memset(new_mem_obj->nmo_data, 0, new_mem_obj->nmo_size); + + mem_obj->nmo_size -= size; + mem_obj->nmo_data = (char *) mem_obj->nmo_data + size; + if (mem_obj->nmo_size == 0) { + TAILQ_REMOVE(&nm_mem->nm_molist, mem_obj, + nmo_next); + free(mem_obj, M_NETMAP); + } + + ret = new_mem_obj->nmo_data; + + break; + } + NMA_UNLOCK(); + ND("%s: %d bytes at %p", msg, size, ret); + + return (ret); +} + +/* + * Return the memory to the allocator. + * + * While freeing a memory object, we try to merge adjacent chunks in + * order to reduce memory fragmentation. + */ +static void +netmap_free(void *addr, const char *msg) +{ + size_t size; + struct netmap_mem_obj *cur, *prev, *next; + + if (addr == NULL) { + D("NULL addr for %s", msg); + return; + } + + NMA_LOCK(); + TAILQ_FOREACH(cur, &nm_mem->nm_molist, nmo_next) { + if (cur->nmo_data == addr && cur->nmo_used) + break; + } + if (cur == NULL) { + NMA_UNLOCK(); + D("invalid addr %s %p", msg, addr); + return; + } + + size = cur->nmo_size; + cur->nmo_used = 0; + + /* merge current chunk of memory with the previous one, + if present. */ + prev = TAILQ_PREV(cur, netmap_mem_obj_h, nmo_next); + if (prev && prev->nmo_used == 0) { + TAILQ_REMOVE(&nm_mem->nm_molist, cur, nmo_next); + prev->nmo_size += cur->nmo_size; + free(cur, M_NETMAP); + cur = prev; + } + + /* merge with the next one */ + next = TAILQ_NEXT(cur, nmo_next); + if (next && next->nmo_used == 0) { + TAILQ_REMOVE(&nm_mem->nm_molist, next, nmo_next); + cur->nmo_size += next->nmo_size; + free(next, M_NETMAP); + } + NMA_UNLOCK(); + ND("freed %s %d bytes at %p", msg, size, addr); +} + + +/* + * Create and return a new ``netmap_if`` object, and possibly also + * rings and packet buffors. + * + * Return NULL on failure. + */ +static void * +netmap_if_new(const char *ifname, struct netmap_adapter *na) +{ + struct netmap_if *nifp; + struct netmap_ring *ring; + struct netmap_kring *kring; + char *buff; + u_int i, len, ofs, numdesc; + u_int nrx = na->num_rx_queues + 1; /* shorthand, include stack queue */ + u_int ntx = na->num_tx_queues + 1; /* shorthand, include stack queue */ + + /* + * the descriptor is followed inline by an array of offsets + * to the tx and rx rings in the shared memory region. + */ + len = sizeof(struct netmap_if) + (nrx + ntx) * sizeof(ssize_t); + nifp = netmap_if_malloc(len); + if (nifp == NULL) + return (NULL); + + /* initialize base fields */ + *(int *)(uintptr_t)&nifp->ni_rx_queues = na->num_rx_queues; + *(int *)(uintptr_t)&nifp->ni_tx_queues = na->num_tx_queues; + strncpy(nifp->ni_name, ifname, IFNAMSIZ); + + (na->refcount)++; /* XXX atomic ? we are under lock */ + if (na->refcount > 1) + goto final; + + /* + * First instance. Allocate the netmap rings + * (one for each hw queue, one pair for the host). + * The rings are contiguous, but have variable size. + * The entire block is reachable at + * na->tx_rings[0] + */ + len = (ntx + nrx) * sizeof(struct netmap_ring) + + (ntx * na->num_tx_desc + nrx * na->num_rx_desc) * + sizeof(struct netmap_slot); + buff = netmap_ring_malloc(len); + if (buff == NULL) { + D("failed to allocate %d bytes for %s shadow ring", + len, ifname); +error: + (na->refcount)--; + netmap_if_free(nifp); + return (NULL); + } + /* Check whether we have enough buffers */ + len = ntx * na->num_tx_desc + nrx * na->num_rx_desc; + NMA_LOCK(); + if (nm_buf_pool.free < len) { + NMA_UNLOCK(); + netmap_free(buff, "not enough bufs"); + goto error; + } + /* + * in the kring, store the pointers to the shared rings + * and initialize the rings. We are under NMA_LOCK(). + */ + ofs = 0; + for (i = 0; i < ntx; i++) { /* Transmit rings */ + kring = &na->tx_rings[i]; + numdesc = na->num_tx_desc; + bzero(kring, sizeof(*kring)); + kring->na = na; + + ring = kring->ring = (struct netmap_ring *)(buff + ofs); + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + nm_buf_pool.base - (char *)ring; + ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); + *(uint32_t *)(uintptr_t)&ring->num_slots = + kring->nkr_num_slots = numdesc; + + /* + * IMPORTANT: + * Always keep one slot empty, so we can detect new *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 12:37:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32DBC106566B; Thu, 12 Apr 2012 12:37:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D71828FC08; Thu, 12 Apr 2012 12:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CCbrMJ028524; Thu, 12 Apr 2012 12:37:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CCbrQu028522; Thu, 12 Apr 2012 12:37:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201204121237.q3CCbrQu028522@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2012 12:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234176 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 12:37:54 -0000 Author: ae Date: Thu Apr 12 12:37:53 2012 New Revision: 234176 URL: http://svn.freebsd.org/changeset/base/234176 Log: Read backup GPT header from the last LBA only when primary GPT header and table aren't valid. If they are ok, use hdr_lba_alt value to read backup header. This will make gptboot happy when GPT used atop of some GEOM provider, e.g. GEOM_MIRROR. Reviewed by: pjd MFC after: 2 weeks Modified: head/sys/boot/common/gpt.c Modified: head/sys/boot/common/gpt.c ============================================================================== --- head/sys/boot/common/gpt.c Thu Apr 12 12:15:15 2012 (r234175) +++ head/sys/boot/common/gpt.c Thu Apr 12 12:37:53 2012 (r234176) @@ -337,16 +337,16 @@ gptread(const uuid_t *uuid, struct dsk * gpttable = table_primary; } - altlba = drvsize(dskp); - if (altlba > 0) - altlba--; - else if (hdr_primary_lba > 0) { + if (hdr_primary_lba > 0) { /* - * If we cannot obtain disk size, but primary header - * is valid, we can get backup header location from - * there. + * If primary header is valid, we can get backup + * header location from there. */ altlba = hdr_primary.hdr_lba_alt; + } else { + altlba = drvsize(dskp); + if (altlba > 0) + altlba--; } if (altlba == 0) printf("%s: unable to locate backup GPT header\n", BOOTPROG); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 12:58:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 48FF7106564A; Thu, 12 Apr 2012 12:58:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32F918FC12; Thu, 12 Apr 2012 12:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CCwFRi029229; Thu, 12 Apr 2012 12:58:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CCwEVe029227; Thu, 12 Apr 2012 12:58:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201204121258.q3CCwEVe029227@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 12 Apr 2012 12:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234177 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 12:58:15 -0000 Author: trasz Date: Thu Apr 12 12:58:14 2012 New Revision: 234177 URL: http://svn.freebsd.org/changeset/base/234177 Log: Refactor da(4) to remove one of two code paths used to query capacity data. Reviewed by: ken, mav (earlier version) Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Apr 12 12:37:53 2012 (r234176) +++ head/sys/cam/scsi/scsi_da.c Thu Apr 12 12:58:14 2012 (r234177) @@ -83,7 +83,8 @@ typedef enum { DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, - DA_FLAG_CAN_RC16 = 0x400 + DA_FLAG_CAN_RC16 = 0x400, + DA_FLAG_PROBED = 0x800 } da_flags; typedef enum { @@ -829,7 +830,7 @@ static void dadone(struct cam_periph *p static int daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); static void daprevent(struct cam_periph *periph, int action); -static int dagetcapacity(struct cam_periph *periph); +static void dareprobe(struct cam_periph *periph); static void dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, struct scsi_read_capacity_data_long *rcaplong, @@ -929,36 +930,29 @@ daopen(struct disk *dp) softc->flags &= ~DA_FLAG_PACK_INVALID; } - error = dagetcapacity(periph); + dareprobe(periph); - if (error == 0) { - - softc->disk->d_sectorsize = softc->params.secsize; - softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; - softc->disk->d_stripesize = softc->params.stripesize; - softc->disk->d_stripeoffset = softc->params.stripeoffset; - /* XXX: these are not actually "firmware" values, so they may be wrong */ - softc->disk->d_fwsectors = softc->params.secs_per_track; - softc->disk->d_fwheads = softc->params.heads; - softc->disk->d_devstat->block_size = softc->params.secsize; - softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; - if (softc->delete_method > DA_DELETE_DISABLE) - softc->disk->d_flags |= DISKFLAG_CANDELETE; - else - softc->disk->d_flags &= ~DISKFLAG_CANDELETE; - - if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && - (softc->quirks & DA_Q_NO_PREVENT) == 0) - daprevent(periph, PR_PREVENT); - } else - softc->flags &= ~DA_FLAG_OPEN; + /* Wait for the disk size update. */ + error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO, + "dareprobe", 0); + if (error != 0) + xpt_print(periph->path, "unable to retrieve capacity data"); + + if (periph->flags & CAM_PERIPH_INVALID) + error = ENXIO; + + if (error == 0 && (softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && + (softc->quirks & DA_Q_NO_PREVENT) == 0) + daprevent(periph, PR_PREVENT); cam_periph_unhold(periph); cam_periph_unlock(periph); if (error != 0) { + softc->flags &= ~DA_FLAG_OPEN; cam_periph_release(periph); } + return (error); } @@ -2364,7 +2358,7 @@ dadone(struct cam_periph *periph, union } } free(csio->data_ptr, M_SCSIDA); - if (announce_buf[0] != '\0') { + if (announce_buf[0] != '\0' && ((softc->flags & DA_FLAG_PROBED) == 0)) { /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -2378,9 +2372,7 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "fatal error, " "could not acquire reference count\n"); } - } - softc->state = DA_STATE_NORMAL; /* * Since our peripheral may be invalidated by an error * above or an external event, we must release our CCB @@ -2390,7 +2382,13 @@ dadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - cam_periph_unhold(periph); + softc->state = DA_STATE_NORMAL; + wakeup(&softc->disk->d_mediasize); + if ((softc->flags & DA_FLAG_PROBED) == 0) { + softc->flags |= DA_FLAG_PROBED; + cam_periph_unhold(periph); + } else + cam_periph_release_locked(periph); return; } case DA_CCB_WAITING: @@ -2408,6 +2406,30 @@ dadone(struct cam_periph *periph, union xpt_release_ccb(done_ccb); } +static void +dareprobe(struct cam_periph *periph) +{ + struct da_softc *softc; + cam_status status; + + softc = (struct da_softc *)periph->softc; + + /* Probe in progress; don't interfere. */ + if ((softc->flags & DA_FLAG_PROBED) == 0) + return; + + status = cam_periph_acquire(periph); + KASSERT(status == CAM_REQ_CMP, + ("dareprobe: cam_periph_acquire failed")); + + if (softc->flags & DA_FLAG_CAN_RC16) + softc->state = DA_STATE_PROBE2; + else + softc->state = DA_STATE_PROBE; + + xpt_schedule(periph, CAM_PRIORITY_DEV); +} + static int daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) { @@ -2437,6 +2459,16 @@ daerror(union ccb *ccb, u_int32_t cam_fl &error_code, &sense_key, &asc, &ascq); if (sense_key == SSD_KEY_ILLEGAL_REQUEST) error = cmd6workaround(ccb); + /* + * If the target replied with CAPACITY DATA HAS CHANGED UA, + * query the capacity and notify upper layers. + */ + else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x2A && ascq == 0x09) { + xpt_print(periph->path, "capacity data has changed\n"); + dareprobe(periph); + sense_flags |= SF_NO_PRINT; + } } if (error == ERESTART) return (ERESTART); @@ -2490,164 +2522,6 @@ daprevent(struct cam_periph *periph, int xpt_release_ccb(ccb); } -static int -dagetcapacity(struct cam_periph *periph) -{ - struct da_softc *softc; - union ccb *ccb; - struct scsi_read_capacity_data *rcap; - struct scsi_read_capacity_data_long *rcaplong; - uint32_t block_len; - uint64_t maxsector; - int error, rc16failed; - u_int32_t sense_flags; - u_int lbppbe; /* Logical blocks per physical block exponent. */ - u_int lalba; /* Lowest aligned LBA. */ - - softc = (struct da_softc *)periph->softc; - block_len = 0; - maxsector = 0; - lbppbe = 0; - lalba = 0; - error = 0; - rc16failed = 0; - rcaplong = NULL; - sense_flags = SF_RETRY_UA; - if (softc->flags & DA_FLAG_PACK_REMOVABLE) - sense_flags |= SF_NO_PRINT; - - /* Do a read capacity */ - rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong), - M_SCSIDA, - M_NOWAIT | M_ZERO); - if (rcap == NULL) - return (ENOMEM); - rcaplong = (struct scsi_read_capacity_data_long *)rcap; - - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); - - /* Try READ CAPACITY(16) first if we think it should work. */ - if (softc->flags & DA_FLAG_CAN_RC16) { - scsi_read_capacity_16(&ccb->csio, - /*retries*/ 4, - /*cbfcnp*/ dadone, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*lba*/ 0, - /*reladr*/ 0, - /*pmi*/ 0, - /*rcap_buf*/ (uint8_t *)rcaplong, - /*rcap_buf_len*/ sizeof(*rcaplong), - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, softc->disk->d_devstat); - if (error == 0) - goto rc16ok; - - /* If we got ILLEGAL REQUEST, do not prefer RC16 any more. */ - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { - softc->flags &= ~DA_FLAG_CAN_RC16; - } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) - && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) - && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) - && ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) - && ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { - int sense_key, error_code, asc, ascq; - - scsi_extract_sense_len(&ccb->csio.sense_data, - ccb->csio.sense_len - - ccb->csio.sense_resid, - &error_code, &sense_key, - &asc, &ascq, /*show_errors*/1); - /* - * If we don't have enough sense to get the sense - * key, or if it's illegal request, turn off - * READ CAPACITY (16). - */ - if ((sense_key == -1) - || (sense_key == SSD_KEY_ILLEGAL_REQUEST)) - softc->flags &= ~DA_FLAG_CAN_RC16; - } - rc16failed = 1; - } - - /* Do READ CAPACITY(10). */ - scsi_read_capacity(&ccb->csio, - /*retries*/4, - /*cbfncp*/dadone, - MSG_SIMPLE_Q_TAG, - rcap, - SSD_FULL_SIZE, - /*timeout*/60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, - softc->disk->d_devstat); - if (error == 0) { - block_len = scsi_4btoul(rcap->length); - maxsector = scsi_4btoul(rcap->addr); - - if (maxsector != 0xffffffff || rc16failed) - goto done; - } else - goto done; - - /* If READ CAPACITY(10) returned overflow, use READ CAPACITY(16) */ - scsi_read_capacity_16(&ccb->csio, - /*retries*/ 4, - /*cbfcnp*/ dadone, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*lba*/ 0, - /*reladr*/ 0, - /*pmi*/ 0, - /*rcap_buf*/ (uint8_t *)rcaplong, - /*rcap_buf_len*/ sizeof(*rcaplong), - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); - ccb->ccb_h.ccb_bp = NULL; - - error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, - softc->disk->d_devstat); - if (error == 0) { -rc16ok: - block_len = scsi_4btoul(rcaplong->length); - maxsector = scsi_8btou64(rcaplong->addr); - lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; - lalba = scsi_2btoul(rcaplong->lalba_lbp); - } - -done: - - if (error == 0) { - if (block_len >= MAXPHYS || block_len == 0) { - xpt_print(periph->path, - "unsupportable block size %ju\n", - (uintmax_t) block_len); - error = EINVAL; - } else { - dasetgeom(periph, block_len, maxsector, - rcaplong, sizeof(*rcaplong)); - if ((lalba & SRC16_LBPME) - && softc->delete_method == DA_DELETE_NONE) - softc->delete_method = DA_DELETE_UNMAP; - } - } - - xpt_release_ccb(ccb); - - free(rcap, M_SCSIDA); - - return (error); -} - static void dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, struct scsi_read_capacity_data_long *rcaplong, size_t rcap_len) @@ -2747,6 +2621,20 @@ dasetgeom(struct cam_periph *periph, uin min(sizeof(softc->rcaplong), rcap_len)); } } + + softc->disk->d_sectorsize = softc->params.secsize; + softc->disk->d_mediasize = softc->params.secsize * (off_t)softc->params.sectors; + softc->disk->d_stripesize = softc->params.stripesize; + softc->disk->d_stripeoffset = softc->params.stripeoffset; + /* XXX: these are not actually "firmware" values, so they may be wrong */ + softc->disk->d_fwsectors = softc->params.secs_per_track; + softc->disk->d_fwheads = softc->params.heads; + softc->disk->d_devstat->block_size = softc->params.secsize; + softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } static void From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 13:43:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEFF3106566C; Thu, 12 Apr 2012 13:43:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A74308FC14; Thu, 12 Apr 2012 13:43:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CDhhl3030674; Thu, 12 Apr 2012 13:43:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CDhh21030672; Thu, 12 Apr 2012 13:43:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201204121343.q3CDhh21030672@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 12 Apr 2012 13:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234178 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 13:43:43 -0000 Author: trasz Date: Thu Apr 12 13:43:43 2012 New Revision: 234178 URL: http://svn.freebsd.org/changeset/base/234178 Log: Remove block reallocation used to make room for the cylinder group summary structure. From now on, when there is no room for it, we simply allocate new one in a newly added cylinder group. This patch removes a conditional in updcsloc(), reindents some code there, and removes unused routines. I decided to do it this way instead of disabling reallocation when the filesystem is live and leaving it as it is otherwise, because this allows for removal of lots of complicated and hard to test code. Also, conditionally disabling it would result in a different layout in filesystems resized online and offline, which would look somewhat weird. Reviewed by: mckusick No objections from: kib Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Thu Apr 12 12:58:14 2012 (r234177) +++ head/sbin/growfs/growfs.c Thu Apr 12 13:43:43 2012 (r234178) @@ -94,45 +94,11 @@ static union { #define acg cgun1.cg /* a cylinder cgroup (new) */ #define aocg cgun2.cg /* an old cylinder group */ -static char ablk[MAXBSIZE]; /* a block */ - static struct csum *fscs; /* cylinder summary */ -union dinode { - struct ufs1_dinode dp1; - struct ufs2_dinode dp2; -}; -#define DIP(dp, field) \ - ((sblock.fs_magic == FS_UFS1_MAGIC) ? \ - (uint32_t)(dp)->dp1.field : (dp)->dp2.field) -#define DIP_SET(dp, field, val) do { \ - if (sblock.fs_magic == FS_UFS1_MAGIC) \ - (dp)->dp1.field = (val); \ - else \ - (dp)->dp2.field = (val); \ - } while (0) -static ufs2_daddr_t inoblk; /* inode block address */ -static char inobuf[MAXBSIZE]; /* inode block */ -static ino_t maxino; /* last valid inode */ - -/* - * An array of elements of type struct gfs_bpp describes all blocks to - * be relocated in order to free the space needed for the cylinder group - * summary for all cylinder groups located in the first cylinder group. - */ -struct gfs_bpp { - ufs2_daddr_t old; /* old block number */ - ufs2_daddr_t new; /* new block number */ -#define GFS_FL_FIRST 1 -#define GFS_FL_LAST 2 - unsigned int flags; /* special handling required */ - int found; /* how many references were updated */ -}; - static void growfs(int, int, unsigned int); static void rdfs(ufs2_daddr_t, size_t, void *, int); static void wtfs(ufs2_daddr_t, size_t, void *, int, unsigned int); -static ufs2_daddr_t alloc(void); static int charsperline(void); static void usage(void); static int isblock(struct fs *, unsigned char *, int); @@ -141,14 +107,8 @@ static void setblock(struct fs *, unsign static void initcg(int, time_t, int, unsigned int); static void updjcg(int, time_t, int, int, unsigned int); static void updcsloc(time_t, int, int, unsigned int); -static union dinode *ginode(ino_t, int, int); static void frag_adjust(ufs2_daddr_t, int); -static int cond_bl_upd(ufs2_daddr_t *, struct gfs_bpp *, int, int, - unsigned int); static void updclst(int); -static void updrefs(int, ino_t, struct gfs_bpp *, int, int, unsigned int); -static void indirchk(ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, ufs_lbn_t, - struct gfs_bpp *, int, int, unsigned int); static void get_dev_size(int, int *); /* @@ -587,64 +547,6 @@ frag_adjust(ufs2_daddr_t frag, int sign) } /* - * Here we conditionally update a pointer to a fragment. We check for all - * relocated blocks if any of its fragments is referenced by the current - * field, and update the pointer to the respective fragment in our new - * block. If we find a reference we write back the block immediately, - * as there is no easy way for our general block reading engine to figure - * out if a write back operation is needed. - */ -static int -cond_bl_upd(ufs2_daddr_t *block, struct gfs_bpp *field, int fsi, int fso, - unsigned int Nflag) -{ - DBG_FUNC("cond_bl_upd") - struct gfs_bpp *f; - ufs2_daddr_t src, dst; - int fragnum; - void *ibuf; - - DBG_ENTER; - - for (f = field; f->old != 0; f++) { - src = *block; - if (fragstoblks(&sblock, src) != f->old) - continue; - /* - * The fragment is part of the block, so update. - */ - dst = blkstofrags(&sblock, f->new); - fragnum = fragnum(&sblock, src); - *block = dst + fragnum; - f->found++; - DBG_PRINT3("scg (%jd->%jd)[%d] reference updated\n", - (intmax_t)f->old, (intmax_t)f->new, fragnum); - - /* - * Copy the block back immediately. - * - * XXX If src is from an indirect block we have - * to implement copy on write here in case of - * active snapshots. - */ - ibuf = malloc(sblock.fs_bsize); - if (!ibuf) - errx(1, "malloc failed"); - src -= fragnum; - rdfs(fsbtodb(&sblock, src), (size_t)sblock.fs_bsize, ibuf, fsi); - wtfs(dst, (size_t)sblock.fs_bsize, ibuf, fso, Nflag); - free(ibuf); - /* - * The same block can't be found again in this loop. - */ - return (1); - } - - DBG_LEAVE; - return (0); -} - -/* * Here we do all needed work for the former last cylinder group. It has to be * changed in any case, even if the file system ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number @@ -890,11 +792,8 @@ updjcg(int cylno, time_t modtime, int fs * longer in the beginning of the first cylinder group you should never * use a version of fsck which is not aware of the possibility to have * this structure in a non standard place. - * Option (1) is considered to be less intrusive to the structure of the file- - * system. So we try to stick to that whenever possible. If there is not enough - * space in the cylinder group containing the cylinder summary we have to use - * method (2). In case of active snapshots in the file system we probably can - * completely avoid implementing copy on write if we stick to method (2) only. + * Option (2) is considered to be less intrusive to the structure of the file- + * system, so that's the one being used. */ static void updcsloc(time_t modtime, int fsi, int fso, unsigned int Nflag) @@ -903,11 +802,7 @@ updcsloc(time_t modtime, int fsi, int fs struct csum *cs; int ocscg, ncscg; int blocks; - ufs2_daddr_t cbase, dupper, odupper, d, f, g; - int ind, inc; - uint cylno; - struct gfs_bpp *bp; - int i, l; + ufs2_daddr_t d; int lcs = 0; int block; @@ -951,117 +846,86 @@ updcsloc(time_t modtime, int fsi, int fs * also up to 8*3 blocks for indirect blocks for all possible * references. */ - if (/*((int)sblock.fs_time&0x3)>0||*/ cs->cs_nbfree < blocks) { - /* - * There is not enough space in the old cylinder group to - * relocate all blocks as needed, so we relocate the whole - * cylinder group summary to a new group. We try to use the - * first complete new cylinder group just created. Within the - * cylinder group we align the area immediately after the - * cylinder group information location in order to be as - * close as possible to the original implementation of ffs. - * - * First we have to make sure we'll find enough space in the - * new cylinder group. If not, then we currently give up. - * We start with freeing everything which was used by the - * fragments of the old cylinder summary in the current group. - * Now we write back the group meta data, read in the needed - * meta data from the new cylinder group, and start allocating - * within that group. Here we can assume, the group to be - * completely empty. Which makes the handling of fragments and - * clusters a lot easier. - */ - DBG_TRC; - if (sblock.fs_ncg - osblock.fs_ncg < 2) - errx(2, "panic: not enough space"); + /* + * There is not enough space in the old cylinder group to + * relocate all blocks as needed, so we relocate the whole + * cylinder group summary to a new group. We try to use the + * first complete new cylinder group just created. Within the + * cylinder group we align the area immediately after the + * cylinder group information location in order to be as + * close as possible to the original implementation of ffs. + * + * First we have to make sure we'll find enough space in the + * new cylinder group. If not, then we currently give up. + * We start with freeing everything which was used by the + * fragments of the old cylinder summary in the current group. + * Now we write back the group meta data, read in the needed + * meta data from the new cylinder group, and start allocating + * within that group. Here we can assume, the group to be + * completely empty. Which makes the handling of fragments and + * clusters a lot easier. + */ + DBG_TRC; + if (sblock.fs_ncg - osblock.fs_ncg < 2) + errx(2, "panic: not enough space"); - /* - * Point "d" to the first fragment not used by the cylinder - * summary. - */ - d = osblock.fs_csaddr + (osblock.fs_cssize / osblock.fs_fsize); + /* + * Point "d" to the first fragment not used by the cylinder + * summary. + */ + d = osblock.fs_csaddr + (osblock.fs_cssize / osblock.fs_fsize); - /* - * Set up last cluster size ("lcs") already here. Calculate - * the size for the trailing cluster just behind where "d" - * points to. - */ - if (sblock.fs_contigsumsize > 0) { - for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), - lcs = 0; lcs < sblock.fs_contigsumsize; - block++, lcs++) { - if (isclr(cg_clustersfree(&acg), block)) - break; - } + /* + * Set up last cluster size ("lcs") already here. Calculate + * the size for the trailing cluster just behind where "d" + * points to. + */ + if (sblock.fs_contigsumsize > 0) { + for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), + lcs = 0; lcs < sblock.fs_contigsumsize; + block++, lcs++) { + if (isclr(cg_clustersfree(&acg), block)) + break; } + } + /* + * Point "d" to the last frag used by the cylinder summary. + */ + d--; + + DBG_PRINT1("d=%jd\n", (intmax_t)d); + if ((d + 1) % sblock.fs_frag) { /* - * Point "d" to the last frag used by the cylinder summary. + * The end of the cylinder summary is not a complete + * block. */ - d--; - - DBG_PRINT1("d=%jd\n", (intmax_t)d); - if ((d + 1) % sblock.fs_frag) { - /* - * The end of the cylinder summary is not a complete - * block. - */ - DBG_TRC; - frag_adjust(d % sblock.fs_fpg, -1); - for (; (d + 1) % sblock.fs_frag; d--) { - DBG_PRINT1("d=%jd\n", (intmax_t)d); - setbit(cg_blksfree(&acg), d % sblock.fs_fpg); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - /* - * Point "d" to the last fragment of the last - * (incomplete) block of the cylinder summary. - */ - d++; - frag_adjust(d%sblock.fs_fpg, 1); - - if (isblock(&sblock, cg_blksfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag)) { - DBG_PRINT1("d=%jd\n", (intmax_t)d); - acg.cg_cs.cs_nffree -= sblock.fs_frag; - acg.cg_cs.cs_nbfree++; - sblock.fs_cstotal.cs_nffree -= sblock.fs_frag; - sblock.fs_cstotal.cs_nbfree++; - if (sblock.fs_contigsumsize > 0) { - setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / - sblock.fs_frag); - if (lcs < sblock.fs_contigsumsize) { - if (lcs) - cg_clustersum(&acg)[lcs]--; - lcs++; - cg_clustersum(&acg)[lcs]++; - } - } - } - /* - * Point "d" to the first fragment of the block before - * the last incomplete block. - */ - d--; + DBG_TRC; + frag_adjust(d % sblock.fs_fpg, -1); + for (; (d + 1) % sblock.fs_frag; d--) { + DBG_PRINT1("d=%jd\n", (intmax_t)d); + setbit(cg_blksfree(&acg), d % sblock.fs_fpg); + acg.cg_cs.cs_nffree++; + sblock.fs_cstotal.cs_nffree++; } + /* + * Point "d" to the last fragment of the last + * (incomplete) block of the cylinder summary. + */ + d++; + frag_adjust(d%sblock.fs_fpg, 1); - DBG_PRINT1("d=%jd\n", (intmax_t)d); - for (d = rounddown(d, sblock.fs_frag); d >= osblock.fs_csaddr; - d -= sblock.fs_frag) { - DBG_TRC; + if (isblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag)) { DBG_PRINT1("d=%jd\n", (intmax_t)d); - setblock(&sblock, cg_blksfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nffree -= sblock.fs_frag; acg.cg_cs.cs_nbfree++; + sblock.fs_cstotal.cs_nffree -= sblock.fs_frag; sblock.fs_cstotal.cs_nbfree++; if (sblock.fs_contigsumsize > 0) { setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - /* - * The last cluster size is already set up. - */ + (d % sblock.fs_fpg) / + sblock.fs_frag); if (lcs < sblock.fs_contigsumsize) { if (lcs) cg_clustersum(&acg)[lcs]--; @@ -1070,392 +934,138 @@ updcsloc(time_t modtime, int fsi, int fs } } } - *cs = acg.cg_cs; - /* - * Now write the former cylinder group containing the cylinder - * summary back to disk. + * Point "d" to the first fragment of the block before + * the last incomplete block. */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), - (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); - DBG_PRINT0("oscg written\n"); - DBG_DUMP_CG(&sblock, "old summary cg", &acg); - - /* - * Find the beginning of the new cylinder group containing the - * cylinder summary. - */ - sblock.fs_csaddr = cgdmin(&sblock, osblock.fs_ncg); - ncscg = dtog(&sblock, sblock.fs_csaddr); - cs = fscs + ncscg; - - /* - * If Nflag is specified, we would now read random data instead - * of an empty cg structure from disk. So we can't simulate that - * part for now. - */ - if (Nflag) { - DBG_PRINT0("nscg update skipped\n"); - DBG_LEAVE; - return; - } - - /* - * Read the future cylinder group containing the cylinder - * summary from disk, and make a copy. - */ - rdfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), - (size_t)sblock.fs_cgsize, (void *)&aocg, fsi); - DBG_PRINT0("nscg read\n"); - DBG_DUMP_CG(&sblock, "new summary cg", &aocg); - - memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); + d--; + } - /* - * Allocate all complete blocks used by the new cylinder - * summary. - */ - for (d = sblock.fs_csaddr; d + sblock.fs_frag <= - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize); - d += sblock.fs_frag) { - clrblock(&sblock, cg_blksfree(&acg), + DBG_PRINT1("d=%jd\n", (intmax_t)d); + for (d = rounddown(d, sblock.fs_frag); d >= osblock.fs_csaddr; + d -= sblock.fs_frag) { + DBG_TRC; + DBG_PRINT1("d=%jd\n", (intmax_t)d); + setblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nbfree++; + sblock.fs_cstotal.cs_nbfree++; + if (sblock.fs_contigsumsize > 0) { + setbit(cg_clustersfree(&acg), (d % sblock.fs_fpg) / sblock.fs_frag); - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - } - } - - /* - * Allocate all fragments used by the cylinder summary in the - * last block. - */ - if (d < - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { - for (; d - sblock.fs_csaddr < - sblock.fs_cssize/sblock.fs_fsize; d++) { - clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; + /* + * The last cluster size is already set up. + */ + if (lcs < sblock.fs_contigsumsize) { + if (lcs) + cg_clustersum(&acg)[lcs]--; + lcs++; + cg_clustersum(&acg)[lcs]++; } - acg.cg_cs.cs_nbfree--; - acg.cg_cs.cs_nffree += sblock.fs_frag; - sblock.fs_cstotal.cs_nbfree--; - sblock.fs_cstotal.cs_nffree += sblock.fs_frag; - if (sblock.fs_contigsumsize > 0) - clrbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / sblock.fs_frag); - - frag_adjust(d % sblock.fs_fpg, 1); } - /* - * XXX Handle the cluster statistics here in the case this - * cylinder group is now almost full, and the remaining - * space is less then the maximum cluster size. This is - * probably not needed, as you would hardly find a file - * system which has only MAXCSBUFS+FS_MAXCONTIG of free - * space right behind the cylinder group information in - * any new cylinder group. - */ - - /* - * Update our statistics in the cylinder summary. - */ - *cs = acg.cg_cs; - - /* - * Write the new cylinder group containing the cylinder summary - * back to disk. - */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), - (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); - DBG_PRINT0("nscg written\n"); - DBG_DUMP_CG(&sblock, "new summary cg", &acg); - - DBG_LEAVE; - return; } - /* - * We have got enough of space in the current cylinder group, so we - * can relocate just a few blocks, and let the summary information - * grow in place where it is right now. - */ - DBG_TRC; - - cbase = cgbase(&osblock, ocscg); /* old and new are equal */ - dupper = sblock.fs_csaddr - cbase + - howmany(sblock.fs_cssize, sblock.fs_fsize); - odupper = osblock.fs_csaddr - cbase + - howmany(osblock.fs_cssize, osblock.fs_fsize); - - sblock.fs_dsize -= dupper - odupper; + *cs = acg.cg_cs; /* - * Allocate the space for the array of blocks to be relocated. + * Now write the former cylinder group containing the cylinder + * summary back to disk. */ - bp = (struct gfs_bpp *)malloc(((dupper - odupper) / - sblock.fs_frag + 2) * sizeof(struct gfs_bpp)); - if (bp == NULL) - errx(1, "malloc failed"); - memset((char *)bp, 0, ((dupper - odupper) / sblock.fs_frag + 2) * - sizeof(struct gfs_bpp)); + wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), + (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); + DBG_PRINT0("oscg written\n"); + DBG_DUMP_CG(&sblock, "old summary cg", &acg); /* - * Lock all new frags needed for the cylinder group summary. This is - * done per fragment in the first and last block of the new required - * area, and per block for all other blocks. - * - * Handle the first new block here (but only if some fragments where - * already used for the cylinder summary). + * Find the beginning of the new cylinder group containing the + * cylinder summary. */ - ind = 0; - frag_adjust(odupper, -1); - for (d = odupper; ((d < dupper) && (d % sblock.fs_frag)); d++) { - DBG_PRINT1("scg first frag check loop d=%jd\n", (intmax_t)d); - if (isclr(cg_blksfree(&acg), d)) { - if (!ind) { - bp[ind].old = d / sblock.fs_frag; - bp[ind].flags |= GFS_FL_FIRST; - if (roundup(d, sblock.fs_frag) >= dupper) - bp[ind].flags |= GFS_FL_LAST; - ind++; - } - } else { - clrbit(cg_blksfree(&acg), d); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } - /* - * No cluster handling is needed here, as there was at least - * one fragment in use by the cylinder summary in the old - * file system. - * No block-free counter handling here as this block was not - * a free block. - */ - } - frag_adjust(odupper, 1); + sblock.fs_csaddr = cgdmin(&sblock, osblock.fs_ncg); + ncscg = dtog(&sblock, sblock.fs_csaddr); + cs = fscs + ncscg; /* - * Handle all needed complete blocks here. + * If Nflag is specified, we would now read random data instead + * of an empty cg structure from disk. So we can't simulate that + * part for now. */ - for (; d + sblock.fs_frag <= dupper; d += sblock.fs_frag) { - DBG_PRINT1("scg block check loop d=%jd\n", (intmax_t)d); - if (!isblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag)) { - for (f = d; f < d + sblock.fs_frag; f++) { - if (isset(cg_blksfree(&aocg), f)) { - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } - } - clrblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag); - bp[ind].old = d / sblock.fs_frag; - ind++; - } else { - clrblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag); - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), d / sblock.fs_frag); - for (lcs = 0, l = (d / sblock.fs_frag) + 1; - lcs < sblock.fs_contigsumsize; l++, lcs++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - if (lcs < sblock.fs_contigsumsize) { - cg_clustersum(&acg)[lcs + 1]--; - if (lcs) - cg_clustersum(&acg)[lcs]++; - } - } - } - /* - * No fragment counter handling is needed here, as this finally - * doesn't change after the relocation. - */ + if (Nflag) { + DBG_PRINT0("nscg update skipped\n"); + DBG_LEAVE; + return; } /* - * Handle all fragments needed in the last new affected block. + * Read the future cylinder group containing the cylinder + * summary from disk, and make a copy. */ - if (d < dupper) { - frag_adjust(dupper - 1, -1); + rdfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), + (size_t)sblock.fs_cgsize, (void *)&aocg, fsi); + DBG_PRINT0("nscg read\n"); + DBG_DUMP_CG(&sblock, "new summary cg", &aocg); - if (isblock(&sblock, cg_blksfree(&acg), d / sblock.fs_frag)) { - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - acg.cg_cs.cs_nffree += sblock.fs_frag; - sblock.fs_cstotal.cs_nffree += sblock.fs_frag; - if (sblock.fs_contigsumsize > 0) { - clrbit(cg_clustersfree(&acg), d / sblock.fs_frag); - for (lcs = 0, l =(d / sblock.fs_frag) + 1; - lcs < sblock.fs_contigsumsize; l++, lcs++ ) { - if (isclr(cg_clustersfree(&acg),l)) - break; - } - if (lcs < sblock.fs_contigsumsize) { - cg_clustersum(&acg)[lcs + 1]--; - if (lcs) - cg_clustersum(&acg)[lcs]++; - } - } - } + memcpy((void *)&cgun1, (void *)&cgun2, sizeof(cgun2)); - for (; d < dupper; d++) { - DBG_PRINT1("scg second frag check loop d=%jd\n", - (intmax_t)d); - if (isclr(cg_blksfree(&acg), d)) { - bp[ind].old = d / sblock.fs_frag; - bp[ind].flags |= GFS_FL_LAST; - } else { - clrbit(cg_blksfree(&acg), d); - acg.cg_cs.cs_nffree--; - sblock.fs_cstotal.cs_nffree--; - } + /* + * Allocate all complete blocks used by the new cylinder + * summary. + */ + for (d = sblock.fs_csaddr; d + sblock.fs_frag <= + sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize); + d += sblock.fs_frag) { + clrblock(&sblock, cg_blksfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); + acg.cg_cs.cs_nbfree--; + sblock.fs_cstotal.cs_nbfree--; + if (sblock.fs_contigsumsize > 0) { + clrbit(cg_clustersfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); } - if (bp[ind].flags & GFS_FL_LAST) /* we have to advance here */ - ind++; - frag_adjust(dupper - 1, 1); } /* - * If we found a block to relocate just do so. + * Allocate all fragments used by the cylinder summary in the + * last block. */ - if (ind) { - for (i = 0; i < ind; i++) { - if (!bp[i].old) { /* no more blocks listed */ - /* - * XXX A relative blocknumber should not be - * zero, which is not explicitly - * guaranteed by our code. - */ - break; - } - /* - * Allocate a complete block in the same (current) - * cylinder group. - */ - bp[i].new = alloc() / sblock.fs_frag; - - /* - * There is no frag_adjust() needed for the new block - * as it will have no fragments yet :-). - */ - for (f = bp[i].old * sblock.fs_frag, - g = bp[i].new * sblock.fs_frag; - f < (bp[i].old + 1) * sblock.fs_frag; - f++, g++) { - if (isset(cg_blksfree(&aocg), f)) { - setbit(cg_blksfree(&acg), g); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - } - - /* - * Special handling is required if this was the first - * block. We have to consider the fragments which were - * used by the cylinder summary in the original block - * which re to be free in the copy of our block. We - * have to be careful if this first block happens to - * be also the last block to be relocated. - */ - if (bp[i].flags & GFS_FL_FIRST) { - for (f = bp[i].old * sblock.fs_frag, - g =bp[i].new * sblock.fs_frag; - f < odupper; f++, g++) { - setbit(cg_blksfree(&acg), g); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - if (!(bp[i].flags & GFS_FL_LAST)) - frag_adjust(bp[i].new * sblock.fs_frag, 1); - } - - /* - * Special handling is required if this is the last - * block to be relocated. - */ - if (bp[i].flags & GFS_FL_LAST) { - frag_adjust(bp[i].new * sblock.fs_frag, 1); - frag_adjust(bp[i].old * sblock.fs_frag, -1); - for (f = dupper; - f < roundup(dupper, sblock.fs_frag); f++) { - if (isclr(cg_blksfree(&acg), f)) { - setbit(cg_blksfree(&acg), f); - acg.cg_cs.cs_nffree++; - sblock.fs_cstotal.cs_nffree++; - } - } - frag_adjust(bp[i].old * sblock.fs_frag, 1); - } - - /* - * !!! Attach the cylindergroup offset here. - */ - bp[i].old += cbase / sblock.fs_frag; - bp[i].new += cbase / sblock.fs_frag; - - /* - * Copy the content of the block. - */ - /* - * XXX Here we will have to implement a copy on write - * in the case we have any active snapshots. - */ - rdfs(fsbtodb(&sblock, bp[i].old * sblock.fs_frag), - (size_t)sblock.fs_bsize, (void *)&ablk, fsi); - wtfs(fsbtodb(&sblock, bp[i].new * sblock.fs_frag), - (size_t)sblock.fs_bsize, (void *)&ablk, fso, Nflag); - DBG_DUMP_HEX(&sblock, "copied full block", - (unsigned char *)&ablk); - DBG_PRINT2("scg (%jd->%jd) block relocated\n", - (intmax_t)bp[i].old, (intmax_t)bp[i].new); - } - - /* - * Now we have to update all references to any fragment which - * belongs to any block relocated. We iterate now over all - * cylinder groups, within those over all non zero length - * inodes. - */ - for (cylno = 0; cylno < osblock.fs_ncg; cylno++) { - DBG_PRINT1("scg doing cg (%d)\n", cylno); - for (inc = osblock.fs_ipg - 1 ; inc > 0 ; inc--) - updrefs(cylno, (ino_t)inc, bp, fsi, fso, Nflag); + if (d < + sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { + for (; d - sblock.fs_csaddr < + sblock.fs_cssize/sblock.fs_fsize; d++) { + clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); + acg.cg_cs.cs_nffree--; + sblock.fs_cstotal.cs_nffree--; } + acg.cg_cs.cs_nbfree--; + acg.cg_cs.cs_nffree += sblock.fs_frag; + sblock.fs_cstotal.cs_nbfree--; + sblock.fs_cstotal.cs_nffree += sblock.fs_frag; + if (sblock.fs_contigsumsize > 0) + clrbit(cg_clustersfree(&acg), + (d % sblock.fs_fpg) / sblock.fs_frag); - /* - * All inodes are checked, now make sure the number of - * references found make sense. - */ - for (i = 0; i < ind; i++) { - if (!bp[i].found || (bp[i].found > sblock.fs_frag)) { - warnx("error: %jd refs found for block %jd.", - (intmax_t)bp[i].found, (intmax_t)bp[i].old); - } - } + frag_adjust(d % sblock.fs_fpg, 1); } /* - * The following statistics are not changed here: - * sblock.fs_cstotal.cs_ndir - * sblock.fs_cstotal.cs_nifree - * The following statistics were already updated on the fly: - * sblock.fs_cstotal.cs_nffree - * sblock.fs_cstotal.cs_nbfree - * As the statistics for this cylinder group are ready, copy it to - * the summary information array. + * XXX Handle the cluster statistics here in the case this + * cylinder group is now almost full, and the remaining + * space is less then the maximum cluster size. This is + * probably not needed, as you would hardly find a file + * system which has only MAXCSBUFS+FS_MAXCONTIG of free + * space right behind the cylinder group information in + * any new cylinder group. */ + /* + * Update our statistics in the cylinder summary. + */ *cs = acg.cg_cs; /* - * Write summary cylinder group back to disk. + * Write the new cylinder group containing the cylinder summary + * back to disk. */ - wtfs(fsbtodb(&sblock, cgtod(&sblock, ocscg)), (size_t)sblock.fs_cgsize, - (void *)&acg, fso, Nflag); - DBG_PRINT0("scg written\n"); + wtfs(fsbtodb(&sblock, cgtod(&sblock, ncscg)), + (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); + DBG_PRINT0("nscg written\n"); DBG_DUMP_CG(&sblock, "new summary cg", &acg); DBG_LEAVE; @@ -1511,126 +1121,6 @@ wtfs(ufs2_daddr_t bno, size_t size, void } /* - * Here we allocate a free block in the current cylinder group. It is assumed, - * that acg contains the current cylinder group. As we may take a block from - * somewhere in the file system we have to handle cluster summary here. - */ -static ufs2_daddr_t -alloc(void) -{ - DBG_FUNC("alloc") - ufs2_daddr_t d, blkno; - int lcs1, lcs2; - int l; - int csmin, csmax; - int dlower, dupper, dmax; - - DBG_ENTER; - - if (acg.cg_magic != CG_MAGIC) { - warnx("acg: bad magic number"); - DBG_LEAVE; - return (0); - } - if (acg.cg_cs.cs_nbfree == 0) { - warnx("error: cylinder group ran out of space"); - DBG_LEAVE; - return (0); - } - /* - * We start seeking for free blocks only from the space available after - * the end of the new grown cylinder summary. Otherwise we allocate a - * block here which we have to relocate a couple of seconds later again - * again, and we are not prepared to to this anyway. - */ - blkno = -1; - dlower = cgsblock(&sblock, acg.cg_cgx) - cgbase(&sblock, acg.cg_cgx); - dupper = cgdmin(&sblock, acg.cg_cgx) - cgbase(&sblock, acg.cg_cgx); - dmax = cgbase(&sblock, acg.cg_cgx) + sblock.fs_fpg; - if (dmax > sblock.fs_size) - dmax = sblock.fs_size; - dmax -= cgbase(&sblock, acg.cg_cgx); /* retransform into cg */ - csmin = sblock.fs_csaddr - cgbase(&sblock, acg.cg_cgx); - csmax = csmin + howmany(sblock.fs_cssize, sblock.fs_fsize); - DBG_PRINT3("seek range: dl=%d, du=%d, dm=%d\n", dlower, dupper, dmax); - DBG_PRINT2("range cont: csmin=%d, csmax=%d\n", csmin, csmax); - - for (d = 0; (d < dlower && blkno == -1); d += sblock.fs_frag) { - if (d >= csmin && d <= csmax) - continue; - if (isblock(&sblock, cg_blksfree(&acg), fragstoblks(&sblock, d))) { - blkno = fragstoblks(&sblock, d);/* Yeah found a block */ - break; - } - } - for (d = dupper; (d < dmax && blkno == -1); d += sblock.fs_frag) { - if (d >= csmin && d <= csmax) { - continue; - } - if (isblock(&sblock, cg_blksfree(&acg), fragstoblks(&sblock, d))) { - blkno = fragstoblks(&sblock, d);/* Yeah found a block */ - break; - } - } - if (blkno == -1) { - warnx("internal error: couldn't find promised block in cg"); - DBG_LEAVE; - return (0); - } - - /* - * This is needed if the block was found already in the first loop. - */ - d = blkstofrags(&sblock, blkno); - - clrblock(&sblock, cg_blksfree(&acg), blkno); - if (sblock.fs_contigsumsize > 0) { - /* - * Handle the cluster allocation bitmap. - */ - clrbit(cg_clustersfree(&acg), blkno); - /* - * We possibly have split a cluster here, so we have to do - * recalculate the sizes of the remaining cluster halves now, - * and use them for updating the cluster summary information. - * - * Lets start with the blocks before our allocated block ... - */ - for (lcs1 = 0, l = blkno - 1; lcs1 < sblock.fs_contigsumsize; - l--, lcs1++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - /* - * ... and continue with the blocks right after our allocated - * block. - */ - for (lcs2 = 0, l = blkno + 1; lcs2 < sblock.fs_contigsumsize; - l++, lcs2++ ) { - if (isclr(cg_clustersfree(&acg), l)) - break; - } - - /* - * Now update all counters. - */ - cg_clustersum(&acg)[MIN(lcs1 + lcs2 + 1, sblock.fs_contigsumsize)]--; - if (lcs1) - cg_clustersum(&acg)[lcs1]++; - if (lcs2) - cg_clustersum(&acg)[lcs2]++; - } - /* - * Update all statistics based on blocks. - */ - acg.cg_cs.cs_nbfree--; - sblock.fs_cstotal.cs_nbfree--; - - DBG_LEAVE; - return (d); -} - -/* * Here we check if all frags of a block are free. For more details again * please see the source of newfs(8), as this function is taken over almost * unchanged. @@ -1735,54 +1225,6 @@ setblock(struct fs *fs, unsigned char *c } /* - * This function provides access to an individual inode. We find out in which - * block the requested inode is located, read it from disk if needed, and - * return the pointer into that block. We maintain a cache of one block to - * not read the same block again and again if we iterate linearly over all - * inodes. - */ -static union dinode * -ginode(ino_t inumber, int fsi, int cg) -{ - DBG_FUNC("ginode") - static ino_t startinum = 0; /* first inode in cached block */ - - DBG_ENTER; - - /* - * The inumber passed in is relative to the cg, so use it here to see - * if the inode has been allocated yet. - */ - if (isclr(cg_inosused(&aocg), inumber)) { - DBG_LEAVE; - return NULL; - } - /* - * Now make the inumber relative to the entire inode space so it can - * be sanity checked. - */ - inumber += (cg * sblock.fs_ipg); - if (inumber < ROOTINO) { - DBG_LEAVE; - return NULL; - } - if (inumber > maxino) - errx(8, "bad inode number %d to ginode", inumber); - if (startinum == 0 || - inumber < startinum || inumber >= startinum + INOPB(&sblock)) { - inoblk = fsbtodb(&sblock, ino_to_fsba(&sblock, inumber)); - rdfs(inoblk, (size_t)sblock.fs_bsize, inobuf, fsi); - startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); - } - DBG_LEAVE; - if (sblock.fs_magic == FS_UFS1_MAGIC) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 13:53:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E519F106566B; Thu, 12 Apr 2012 13:53:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFFA78FC12; Thu, 12 Apr 2012 13:53:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CDrn88031167; Thu, 12 Apr 2012 13:53:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CDrnII031164; Thu, 12 Apr 2012 13:53:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204121353.q3CDrnII031164@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Apr 2012 13:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234182 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 13:53:50 -0000 Author: jhb Date: Thu Apr 12 13:53:49 2012 New Revision: 234182 URL: http://svn.freebsd.org/changeset/base/234182 Log: Don't update if_obytes when transmitting packets. That is already done in IFQ_HANDOFF() when the packet is passed to the start routine, so doing it here resulted in double counting. Reported by: Alex Tutubalin lexa lexa ru MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Apr 12 13:53:10 2012 (r234181) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Apr 12 13:53:49 2012 (r234182) @@ -682,7 +682,6 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ /* FIXME: is this right? Shouldn't we only increment on success? */ ++dev->if_opackets; - dev->if_obytes += tx_req->mb->m_pkthdr.len; m_freem(tx_req->mb); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Apr 12 13:53:10 2012 (r234181) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Thu Apr 12 13:53:49 2012 (r234182) @@ -345,7 +345,6 @@ static void ipoib_ib_handle_tx_wc(struct ipoib_dma_unmap_tx(priv->ca, tx_req); ++dev->if_opackets; - dev->if_obytes += tx_req->mb->m_pkthdr.len; m_freem(tx_req->mb); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 14:01:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A405106566C; Thu, 12 Apr 2012 14:01:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 129B48FC14; Thu, 12 Apr 2012 14:01:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CE17dv031478; Thu, 12 Apr 2012 14:01:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CE16ts031461; Thu, 12 Apr 2012 14:01:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204121401.q3CE16ts031461@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Apr 2012 14:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234183 - in head/sys: amd64/conf conf i386/conf modules/mlx4 modules/mlx4ib modules/mlxen modules/mthca ofed/drivers/infiniband/core ofed/drivers/infiniband/ulp/ipoib ofed/drivers/net/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 14:01:07 -0000 Author: jhb Date: Thu Apr 12 14:01:06 2012 New Revision: 234183 URL: http://svn.freebsd.org/changeset/base/234183 Log: Add OFED and the associated options and drivers to x86 LINT builds: - Mark 'sdp' as requiring 'inet'. - Always include "opt_inet.h" and "opt_inet6.h" and modify the IB driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options to determine what should be enabled during a module build. - Fix the mlxen(4) driver and the core IB code to compile without if INET is disabled (including when both INET and INET6 are disabled). Reviewed by: bz MFC after: 2 weeks Modified: head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlxen/Makefile head/sys/modules/mthca/Makefile head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/net/mlx4/en_frag.c head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/include/linux/in.h head/sys/ofed/include/linux/in6.h head/sys/ofed/include/net/ip.h head/sys/ofed/include/net/ipv6.h Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/amd64/conf/NOTES Thu Apr 12 14:01:06 2012 (r234183) @@ -90,6 +90,19 @@ options DEVICE_POLLING options BPF_JITTER +# OpenFabrics Enterprise Distribution (Infiniband). +options OFED +options OFED_DEBUG_INIT + +# Sockets Direct Protocol +options SDP +options SDP_DEBUG + +# IP over Inifiband +options IPOIB +options IPOIB_DEBUG +options IPOIB_CM + ##################################################################### # CLOCK OPTIONS @@ -290,6 +303,9 @@ options DRM_DEBUG # Include debug print # Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 4965/1000/5000/6000 802.11 network adapters # Requires the iwn firmware module +# mlx4ib: Mellanox ConnectX HCA InfiniBand +# mlxen: Mellanox ConnectX HCA Ethernet +# mthca: Mellanox HCA InfiniBand # mwl: Marvell 88W8363 IEEE 802.11 adapter # Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -305,6 +321,9 @@ options ED_SIC device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device mlx4ib # Mellanox ConnectX HCA InfiniBand +device mlxen # Mellanox ConnectX HCA Ethernet +device mthca # Mellanox HCA InfiniBand device mwl # Marvell 88W8363 802.11n wireless NICs. device nfe # nVidia nForce MCP on-board Ethernet device nve # nVidia nForce MCP on-board Ethernet Networking Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/conf/files Thu Apr 12 14:01:06 2012 (r234183) @@ -3215,19 +3215,19 @@ ofed/drivers/infiniband/ulp/ipoib/ipoib_ # no-depend \ # compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" -ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_main.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_main.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_rx.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_rx.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_cma.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" -ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp \ +ofed/drivers/infiniband/ulp/sdp/sdp_tx.c optional sdp inet \ no-depend \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/" Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/i386/conf/NOTES Thu Apr 12 14:01:06 2012 (r234183) @@ -260,6 +260,19 @@ options DEVICE_POLLING options BPF_JITTER +# OpenFabrics Enterprise Distribution (Infiniband). +options OFED +options OFED_DEBUG_INIT + +# Sockets Direct Protocol +options SDP +options SDP_DEBUG + +# IP over Inifiband +options IPOIB +options IPOIB_DEBUG +options IPOIB_CM + ##################################################################### # CLOCK OPTIONS @@ -561,6 +574,9 @@ hint.mse.0.irq="5" # Requires the iwi firmware module # iwn: Intel Wireless WiFi Link 4965AGN 802.11 network adapters # Requires the iwn firmware module +# mlx4ib: Mellanox ConnectX HCA InfiniBand +# mlxen: Mellanox ConnectX HCA Ethernet +# mthca: Mellanox HCA InfiniBand # mwl: Marvell 88W8363 IEEE 802.11 adapter # Requires the mwl firmware module # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) @@ -605,6 +621,9 @@ hint.le.0.at="isa" hint.le.0.port="0x280" hint.le.0.irq="10" hint.le.0.drq="0" +device mlx4ib # Mellanox ConnectX HCA InfiniBand +device mlxen # Mellanox ConnectX HCA Ethernet +device mthca # Mellanox HCA InfiniBand device mwl # Marvell 88W8363 802.11n wireless NICs. device nfe # nVidia nForce MCP on-board Ethernet device nve # nVidia nForce MCP on-board Ethernet Networking Modified: head/sys/modules/mlx4/Makefile ============================================================================== --- head/sys/modules/mlx4/Makefile Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/modules/mlx4/Makefile Thu Apr 12 14:01:06 2012 (r234183) @@ -1,13 +1,28 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 + +.include + KMOD = mlx4 SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c SRCS+= pd.c port.c profile.c qp.c reset.c sense.c srq.c xrcd.c +SRCS+= opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -DINET6 + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: head/sys/modules/mlx4ib/Makefile ============================================================================== --- head/sys/modules/mlx4ib/Makefile Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/modules/mlx4ib/Makefile Thu Apr 12 14:01:06 2012 (r234183) @@ -1,10 +1,26 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mlx4 + +.include + KMOD = mlx4ib SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= ah.c cq.c doorbell.c mad.c main.c mr.c qp.c srq.c wc.c +SRCS+= opt_inet.h opt_inet6.h + +CFLAGS+= -I${.CURDIR}/../../ofed/include/ + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif -CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6 +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: head/sys/modules/mlxen/Makefile ============================================================================== --- head/sys/modules/mlxen/Makefile Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/modules/mlxen/Makefile Thu Apr 12 14:01:06 2012 (r234183) @@ -1,12 +1,27 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 + +.include + KMOD = mlxen SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS += en_cq.c en_frag.c en_main.c en_netdev.c en_port.c en_resources.c SRCS += en_rx.c en_tx.c +SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ -CFLAGS+= -DINET6 + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif + +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: head/sys/modules/mthca/Makefile ============================================================================== --- head/sys/modules/mthca/Makefile Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/modules/mthca/Makefile Thu Apr 12 14:01:06 2012 (r234183) @@ -1,14 +1,30 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../ofed/drivers/infiniband/hw/mthca + +.include + KMOD = mthca SRCS = device_if.h bus_if.h pci_if.h vnode_if.h SRCS+= mthca_allocator.c mthca_av.c mthca_catas.c mthca_cmd.c mthca_cq.c SRCS+= mthca_eq.c mthca_mad.c mthca_main.c mthca_mcg.c mthca_memfree.c SRCS+= mthca_mr.c mthca_pd.c mthca_profile.c mthca_provider.c mthca_qp.c SRCS+= mthca_reset.c mthca_srq.c mthca_uar.c +SRCS+= opt_inet.h opt_inet6.h + +CFLAGS+= -I${.CURDIR}/../../ofed/include + +.if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + @echo "#define INET 1" > ${.TARGET} +.endif -CFLAGS+= -I${.CURDIR}/../../ofed/include/ -DINET6 +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + @echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Apr 12 14:01:06 2012 (r234183) @@ -136,6 +136,7 @@ int rdma_translate_ip(struct sockaddr *a } switch (addr->sa_family) { +#ifdef INET case AF_INET: dev = ip_dev_find(NULL, ((struct sockaddr_in *) addr)->sin_addr.s_addr); @@ -146,6 +147,7 @@ int rdma_translate_ip(struct sockaddr *a ret = rdma_copy_addr(dev_addr, dev, NULL); dev_put(dev); break; +#endif #if defined(INET6) case AF_INET6: @@ -346,7 +348,9 @@ static int addr_resolve(struct sockaddr struct sockaddr_in6 *sin6; struct ifaddr *ifa; struct ifnet *ifp; +#if defined(INET) || defined(INET6) struct llentry *lle; +#endif struct rtentry *rte; in_port_t port; u_char edst[MAX_ADDR_LEN]; @@ -365,6 +369,7 @@ static int addr_resolve(struct sockaddr ifp = NULL; rte = NULL; switch (dst_in->sa_family) { +#ifdef INET case AF_INET: sin = (struct sockaddr_in *)dst_in; if (sin->sin_addr.s_addr == INADDR_BROADCAST) @@ -383,6 +388,7 @@ static int addr_resolve(struct sockaddr } else src_in = NULL; break; +#endif #ifdef INET6 case AF_INET6: sin6 = (struct sockaddr_in6 *)dst_in; @@ -459,12 +465,21 @@ mcast: /* * Resolve the link local address. */ + switch (dst_in->sa_family) { +#ifdef INET + case AF_INET: + error = arpresolve(ifp, rte, NULL, dst_in, edst, &lle); + break; +#endif #ifdef INET6 - if (dst_in->sa_family == AF_INET6) + case AF_INET6: error = nd6_storelladdr(ifp, NULL, dst_in, (u_char *)edst, &lle); - else + break; #endif - error = arpresolve(ifp, rte, NULL, dst_in, edst, &lle); + default: + /* XXX: Shouldn't happen. */ + error = -EINVAL; + } RTFREE(rte); if (error == 0) return rdma_copy_addr(addr, ifp, edst); Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Apr 12 14:01:06 2012 (r234183) @@ -96,7 +96,9 @@ static DEFINE_IDR(sdp_ps); static DEFINE_IDR(tcp_ps); static DEFINE_IDR(udp_ps); static DEFINE_IDR(ipoib_ps); +#if defined(INET) static int next_port; +#endif struct cma_device { struct list_head list; @@ -2137,6 +2139,7 @@ err1: static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv) { +#if defined(INET) struct rdma_bind_list *bind_list; int port, ret, low, high; @@ -2178,6 +2181,9 @@ err2: err1: kfree(bind_list); return ret; +#else + return -ENOSPC; +#endif } static int cma_use_port(struct idr *ps, struct rdma_id_private *id_priv) @@ -2919,9 +2925,13 @@ static int cma_ib_mc_handler(int status, static void cma_set_mgid(struct rdma_id_private *id_priv, struct sockaddr *addr, union ib_gid *mgid) { +#if defined(INET) || defined(INET6) unsigned char mc_map[MAX_ADDR_LEN]; struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr; +#endif +#ifdef INET struct sockaddr_in *sin = (struct sockaddr_in *) addr; +#endif #ifdef INET6 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) addr; #endif @@ -2940,11 +2950,13 @@ static void cma_set_mgid(struct rdma_id_ mc_map[7] = 0x01; /* Use RDMA CM signature */ *mgid = *(union ib_gid *) (mc_map + 4); #endif +#ifdef INET } else { ip_ib_mc_map(sin->sin_addr.s_addr, dev_addr->broadcast, mc_map); if (id_priv->id.ps == RDMA_PS_UDP) mc_map[7] = 0x01; /* Use RDMA CM signature */ *mgid = *(union ib_gid *) (mc_map + 4); +#endif } } @@ -3347,12 +3359,15 @@ static void cma_remove_one(struct ib_dev static int cma_init(void) { - int ret, low, high, remaining; + int ret; +#if defined(INET) + int low, high, remaining; get_random_bytes(&next_port, sizeof next_port); inet_get_local_port_range(&low, &high); remaining = (high - low) + 1; next_port = ((unsigned int) next_port % remaining) + low; +#endif cma_wq = create_singlethread_workqueue("rdma_cm"); if (!cma_wq) Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Thu Apr 12 14:01:06 2012 (r234183) @@ -1247,7 +1247,9 @@ static void ipoib_cm_mb_reap(struct work cm.mb_task); struct mbuf *mb; unsigned long flags; +#if defined(INET) || defined(INET6) unsigned mtu = priv->mcast_mtu; +#endif uint16_t proto; spin_lock_irqsave(&priv->lock, flags); @@ -1260,14 +1262,20 @@ static void ipoib_cm_mb_reap(struct work proto = htons(*mtod(mb, uint16_t *)); m_adj(mb, IPOIB_ENCAP_LEN); - if (proto == ETHERTYPE_IP) + switch (proto) { +#if defined(INET) + case ETHERTYPE_IP: icmp_error(mb, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, mtu); + break; +#endif #if defined(INET6) - else if (proto == ETHERTYPE_IPV6) + case ETHERTYPE_IPV6: icmp6_error(mb, ICMP6_PACKET_TOO_BIG, 0, mtu); + break; #endif - else + default: m_freem(mb); + } spin_lock_irqsave(&priv->lock, flags); } Modified: head/sys/ofed/drivers/net/mlx4/en_frag.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_frag.c Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/drivers/net/mlx4/en_frag.c Thu Apr 12 14:01:06 2012 (r234183) @@ -31,8 +31,11 @@ * */ +#include "opt_inet.h" #include "mlx4_en.h" +#ifdef INET + #include #include #include @@ -186,3 +189,4 @@ void mlx4_en_flush_frags(struct mlx4_en_ flush_session(priv, session, IP_MF); } } +#endif Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Thu Apr 12 14:01:06 2012 (r234183) @@ -31,6 +31,7 @@ * */ +#include "opt_inet.h" #include "mlx4_en.h" #include @@ -287,6 +288,7 @@ int mlx4_en_activate_rx_rings(struct mlx /* Initailize all descriptors */ for (i = 0; i < ring->size; i++) mlx4_en_init_rx_desc(priv, ring, i); +#ifdef INET /* Configure lro mngr */ if (priv->dev->if_capenable & IFCAP_LRO) { if (tcp_lro_init(&ring->lro)) @@ -294,6 +296,7 @@ int mlx4_en_activate_rx_rings(struct mlx else ring->lro.ifp = priv->dev; } +#endif } err = mlx4_en_fill_rx_buffers(priv); if (err) @@ -330,7 +333,9 @@ void mlx4_en_destroy_rx_ring(struct mlx4 void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring) { +#ifdef INET tcp_lro_free(&ring->lro); +#endif mlx4_en_free_rx_buf(priv, ring); if (ring->stride <= TXBB_SIZE) ring->buf -= TXBB_SIZE; @@ -446,7 +451,9 @@ int mlx4_en_process_rx_cq(struct net_dev struct mbuf **mb_list; struct mlx4_en_rx_desc *rx_desc; struct mbuf *mb; +#ifdef INET struct lro_entry *queued; +#endif int index; unsigned int length; int polled = 0; @@ -515,22 +522,26 @@ int mlx4_en_process_rx_cq(struct net_dev * - without IP options * - not an IP fragment */ +#ifdef INET if (mlx4_en_can_lro(cqe->status) && (dev->if_capenable & IFCAP_LRO)) { if (ring->lro.lro_cnt != 0 && tcp_lro_rx(&ring->lro, mb, 0) == 0) goto next; } +#endif /* LRO not possible, complete processing here */ INC_PERF_COUNTER(priv->pstats.lro_misses); } else { mb->m_pkthdr.csum_flags = 0; priv->port_stats.rx_chksum_none++; +#ifdef INET if (priv->ip_reasm && cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPV4) && !mlx4_en_rx_frags(priv, ring, mb, cqe)) goto next; +#endif } /* Push it up the stack */ @@ -545,11 +556,13 @@ next: } /* Flush all pending IP reassembly sessions */ out: +#ifdef INET mlx4_en_flush_frags(priv, ring); while ((queued = SLIST_FIRST(&ring->lro.lro_active)) != NULL) { SLIST_REMOVE_HEAD(&ring->lro.lro_active, next); tcp_lro_flush(&ring->lro, queued); } +#endif AVG_PERF_COUNTER(priv->pstats.rx_coal_avg, polled); mlx4_cq_set_ci(&cq->mcq); wmb(); /* ensure HW sees CQ consumer before we post new buffers */ Modified: head/sys/ofed/include/linux/in.h ============================================================================== --- head/sys/ofed/include/linux/in.h Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/include/linux/in.h Thu Apr 12 14:01:06 2012 (r234183) @@ -28,6 +28,8 @@ #ifndef _LINUX_IN_H_ #define _LINUX_IN_H_ +#include "opt_inet.h" + #include #include Modified: head/sys/ofed/include/linux/in6.h ============================================================================== --- head/sys/ofed/include/linux/in6.h Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/include/linux/in6.h Thu Apr 12 14:01:06 2012 (r234183) @@ -29,8 +29,6 @@ #ifndef _LINUX_IN6_H_ #define _LINUX_IN6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #endif /* _LINUX_IN6_H_ */ Modified: head/sys/ofed/include/net/ip.h ============================================================================== --- head/sys/ofed/include/net/ip.h Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/include/net/ip.h Thu Apr 12 14:01:06 2012 (r234183) @@ -29,6 +29,8 @@ #ifndef _LINUX_NET_IP_H_ #define _LINUX_NET_IP_H_ +#include "opt_inet.h" + #include #include @@ -39,6 +41,7 @@ #include #include +#ifdef INET static inline void inet_get_local_port_range(int *low, int *high) { *low = V_ipport_firstauto; @@ -73,5 +76,6 @@ ip_ib_mc_map(uint32_t addr, const unsign buf[18] = (addr >> 8) & 0xff; buf[19] = addr & 0xff; } +#endif #endif /* _LINUX_NET_IP_H_ */ Modified: head/sys/ofed/include/net/ipv6.h ============================================================================== --- head/sys/ofed/include/net/ipv6.h Thu Apr 12 13:53:49 2012 (r234182) +++ head/sys/ofed/include/net/ipv6.h Thu Apr 12 14:01:06 2012 (r234183) @@ -29,9 +29,7 @@ #ifndef _LINUX_NET_IPV6_H_ #define _LINUX_NET_IPV6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #define ipv6_addr_loopback IN6_IS_ADDR_LOOPBACK #define ipv6_addr_copy(dst, src) \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 14:03:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F748106566C; Thu, 12 Apr 2012 14:03:00 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 294168FC16; Thu, 12 Apr 2012 14:03:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CE30ZD031569; Thu, 12 Apr 2012 14:03:00 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CE2xZ3031567; Thu, 12 Apr 2012 14:02:59 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201204121402.q3CE2xZ3031567@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Thu, 12 Apr 2012 14:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234184 - head/lib/libpam/modules/pam_exec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 14:03:00 -0000 Author: dumbbell Date: Thu Apr 12 14:02:59 2012 New Revision: 234184 URL: http://svn.freebsd.org/changeset/base/234184 Log: Fix error messages containing the executed command name Before, we took the first argument to pam_exec(8). With the addition of options in front of the command, this could be wrong. Now, options are parsed before calling _pam_exec() and messages contain the proper command name. While here, fix a warning. Sponsored by: Yakaz (http://www.yakaz.com) Modified: head/lib/libpam/modules/pam_exec/pam_exec.c Modified: head/lib/libpam/modules/pam_exec/pam_exec.c ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.c Thu Apr 12 14:01:06 2012 (r234183) +++ head/lib/libpam/modules/pam_exec/pam_exec.c Thu Apr 12 14:02:59 2012 (r234184) @@ -60,22 +60,17 @@ static struct { ENV_ITEM(PAM_RUSER), }; +struct pe_opts { + int return_prog_exit_status; +}; + #define PAM_RV_COUNT 24 static int -_pam_exec(pam_handle_t *pamh __unused, - const char *func, int flags __unused, int argc, const char *argv[]) +parse_options(const char *func, int *argc, const char **argv[], + struct pe_opts *options) { - int envlen, i, nitems, pam_err, status, return_prog_exit_status; - int nitems_rv; - char *env, **envlist, **tmp, *envstr; - volatile int childerr; - pid_t pid; - - /* - * XXX For additional credit, divert child's stdin/stdout/stderr - * to the conversation function. - */ + int i; /* * Parse options: @@ -84,25 +79,45 @@ _pam_exec(pam_handle_t *pamh __unused, * --: * stop options parsing; what follows is the command to execute */ - return_prog_exit_status = 0; - for (i = 0; i < argc; ++i) { - if (strcmp(argv[i], "return_prog_exit_status") == 0) { + options->return_prog_exit_status = 0; + + for (i = 0; i < *argc; ++i) { + if (strcmp((*argv)[i], "return_prog_exit_status") == 0) { openpam_log(PAM_LOG_DEBUG, "%s: Option \"return_prog_exit_status\" enabled", func); - return_prog_exit_status = 1; + options->return_prog_exit_status = 1; } else { - if (strcmp(argv[i], "--") == 0) { - argc--; - argv++; + if (strcmp((*argv)[i], "--") == 0) { + (*argc)--; + (*argv)++; } break; } } - argc -= i; - argv += i; + (*argc) -= i; + (*argv) += i; + + return (0); +} + +static int +_pam_exec(pam_handle_t *pamh __unused, + const char *func, int flags __unused, int argc, const char *argv[], + struct pe_opts *options) +{ + int envlen, i, nitems, pam_err, status; + int nitems_rv; + char **envlist, **tmp, *envstr; + volatile int childerr; + pid_t pid; + + /* + * XXX For additional credit, divert child's stdin/stdout/stderr + * to the conversation function. + */ /* Check there's a program name left after parsing options. */ if (argc < 1) { @@ -122,7 +137,7 @@ _pam_exec(pam_handle_t *pamh __unused, /* nothing */ ; nitems = sizeof(env_items) / sizeof(*env_items); /* Count PAM return values put in the environment. */ - nitems_rv = return_prog_exit_status ? PAM_RV_COUNT : 0; + nitems_rv = options->return_prog_exit_status ? PAM_RV_COUNT : 0; tmp = realloc(envlist, (envlen + nitems + 1 + nitems_rv + 1) * sizeof(*envlist)); if (tmp == NULL) { @@ -136,7 +151,8 @@ _pam_exec(pam_handle_t *pamh __unused, pam_err = pam_get_item(pamh, env_items[i].item, &item); if (pam_err != PAM_SUCCESS || item == NULL) continue; - asprintf(&envstr, "%s=%s", env_items[i].name, item); + asprintf(&envstr, "%s=%s", env_items[i].name, + (const char *)item); if (envstr == NULL) { openpam_free_envlist(envlist); return (PAM_BUF_ERR); @@ -154,7 +170,7 @@ _pam_exec(pam_handle_t *pamh __unused, envlist[envlen++] = envstr; /* Add the PAM return values to the environment. */ - if (return_prog_exit_status) { + if (options->return_prog_exit_status) { #define ADD_PAM_RV_TO_ENV(name) \ asprintf(&envstr, #name "=%d", name); \ if (envstr == NULL) { \ @@ -232,7 +248,7 @@ _pam_exec(pam_handle_t *pamh __unused, return (PAM_SERVICE_ERR); } - if (return_prog_exit_status) { + if (options->return_prog_exit_status) { openpam_log(PAM_LOG_DEBUG, "%s: Use program exit status as return value: %d", func, WEXITSTATUS(status)); @@ -248,8 +264,13 @@ pam_sm_authenticate(pam_handle_t *pamh, int argc, const char *argv[]) { int ret; + struct pe_opts options; - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); + + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this @@ -284,8 +305,13 @@ pam_sm_setcred(pam_handle_t *pamh, int f int argc, const char *argv[]) { int ret; + struct pe_opts options; - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); + + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this @@ -319,8 +345,13 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int int argc, const char *argv[]) { int ret; + struct pe_opts options; + + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this @@ -354,8 +385,13 @@ pam_sm_open_session(pam_handle_t *pamh, int argc, const char *argv[]) { int ret; + struct pe_opts options; + + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this @@ -386,8 +422,13 @@ pam_sm_close_session(pam_handle_t *pamh, int argc, const char *argv[]) { int ret; + struct pe_opts options; - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); + + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this @@ -418,8 +459,13 @@ pam_sm_chauthtok(pam_handle_t *pamh, int int argc, const char *argv[]) { int ret; + struct pe_opts options; + + ret = parse_options(__func__, &argc, &argv, &options); + if (ret != 0) + return (PAM_SERVICE_ERR); - ret = _pam_exec(pamh, __func__, flags, argc, argv); + ret = _pam_exec(pamh, __func__, flags, argc, argv, &options); /* * We must check that the program returned a valid code for this From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 14:06:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B6631065670; Thu, 12 Apr 2012 14:06:06 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA79C8FC0A; Thu, 12 Apr 2012 14:06:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CE65cf031776; Thu, 12 Apr 2012 14:06:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CE65in031774; Thu, 12 Apr 2012 14:06:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204121406.q3CE65in031774@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Apr 2012 14:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234185 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 14:06:06 -0000 Author: luigi Date: Thu Apr 12 14:06:05 2012 New Revision: 234185 URL: http://svn.freebsd.org/changeset/base/234185 Log: Apparently the length field in advanced descriptors does not include the CRC irrespective of the setting of CRCSTRIP. The 82599 data sheets (sec. 7.1.6) say differently. Very strange. Need to check what happens on legacy descriptors, but for the time being this restores functionality. Modified: head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Apr 12 14:02:59 2012 (r234184) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Apr 12 14:06:05 2012 (r234185) @@ -474,7 +474,12 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * rxr->next_to_check is set to 0 on a ring reinit */ if (netmap_no_pendintr || force_update) { - int crclen = ix_crcstrip ? 0 : 4; + /* XXX apparently the length field in advanced descriptors + * does not include the CRC irrespective of the setting + * of CRCSTRIP. The data sheets say differently. + * Very strange. + */ + int crclen = 0; // ix_crcstrip ? 0 : 4; l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 14:49:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BBD1106564A; Thu, 12 Apr 2012 14:49:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06BA28FC14; Thu, 12 Apr 2012 14:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CEnP3j033084; Thu, 12 Apr 2012 14:49:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CEnP8L033082; Thu, 12 Apr 2012 14:49:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204121449.q3CEnP8L033082@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Apr 2012 14:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234186 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 14:49:26 -0000 Author: jhb Date: Thu Apr 12 14:49:25 2012 New Revision: 234186 URL: http://svn.freebsd.org/changeset/base/234186 Log: If a linker file contains at least one module, but all of the modules fail to load (the MOD_LOAD event fails) during a kldload(2), unload the linker file and fail the kldload(2) with ENOEXEC. Reported by: gcooper MFC after: 1 week Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Apr 12 14:06:05 2012 (r234185) +++ head/sys/kern/kern_linker.c Thu Apr 12 14:49:25 2012 (r234186) @@ -380,7 +380,7 @@ linker_load_file(const char *filename, l { linker_class_t lc; linker_file_t lf; - int foundfile, error; + int foundfile, error, modules; /* Refuse to load modules if securelevel raised */ if (prison0.pr_securelevel > 0) @@ -419,11 +419,22 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (error); } + modules = !TAILQ_EMPTY(&lf->modules); KLD_UNLOCK(); linker_file_register_sysctls(lf); linker_file_sysinit(lf); KLD_LOCK(); lf->flags |= LINKER_FILE_LINKED; + + /* + * If all of the modules in this file failed + * to load, unload the file and return an + * error of ENOEXEC. + */ + if (modules && TAILQ_EMPTY(&lf->modules)) { + linker_file_unload(lf, LINKER_UNLOAD_FORCE); + return (ENOEXEC); + } *result = lf; return (0); } @@ -627,7 +638,7 @@ linker_file_unload(linker_file_t file, i /* * Inform any modules associated with this file that they are - * being be unloaded. + * being unloaded. */ MOD_XLOCK; for (mod = TAILQ_FIRST(&file->modules); mod; mod = next) { From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 15:06:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7409D106564A; Thu, 12 Apr 2012 15:06:58 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6108FC08; Thu, 12 Apr 2012 15:06:57 +0000 (UTC) Received: by lagv3 with SMTP id v3so2155365lag.13 for ; Thu, 12 Apr 2012 08:06:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=X42I/aUnKx8Rla2NNKtWYzj0eBzbTd8+cvoyrMofwqQ=; b=DrdTr5m1Gnq9c4ufhDUFGsLykASZ7S7arZL4aJTchFt2SC63RJDWVfivH43K/zX2sB kd5ChG2Ho+0NCuU+bthhSHWY5J4nHdbq/3PApLkZd26g2tE4WJDezavw6G9WXyW4E0en JUPHkRmSQYnRezrpTEj0cdvV9EOK33rT+ga9IGOi1Ub7ELt2Rourvw5h5P8isxdJpEPf +n1FATRy+lEExFfVNqyMWsjpVIoK146038nsjrwmUuHVsSuBc6eRVV5JIBYG0Sr9f5uK Nb5BBqF/v6DYvOKAnLLBgJZ6BERN6r025N2mMrYLHkgH37uC8tRJuxRmo1w8lNETAA+l 7mXg== MIME-Version: 1.0 Received: by 10.112.25.130 with SMTP id c2mr1217169lbg.107.1334243216315; Thu, 12 Apr 2012 08:06:56 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.25.69 with HTTP; Thu, 12 Apr 2012 08:06:56 -0700 (PDT) In-Reply-To: <201204121449.q3CEnP8L033082@svn.freebsd.org> References: <201204121449.q3CEnP8L033082@svn.freebsd.org> Date: Thu, 12 Apr 2012 19:06:56 +0400 X-Google-Sender-Auth: H007v4XVVdqU9r33Lltf7O7IuqY Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234186 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 15:06:58 -0000 On 12 April 2012 18:49, John Baldwin wrote: > Author: jhb > Date: Thu Apr 12 14:49:25 2012 > New Revision: 234186 > URL: http://svn.freebsd.org/changeset/base/234186 > > Log: > =A0If a linker file contains at least one module, but all of the modules > =A0fail to load (the MOD_LOAD event fails) during a kldload(2), unload th= e > =A0linker file and fail the kldload(2) with ENOEXEC. > > =A0Reported by: =A0gcooper > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/sys/kern/kern_linker.c > > Modified: head/sys/kern/kern_linker.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_linker.c Thu Apr 12 14:06:05 2012 =A0 =A0 =A0 =A0(= r234185) > +++ head/sys/kern/kern_linker.c Thu Apr 12 14:49:25 2012 =A0 =A0 =A0 =A0(= r234186) > @@ -380,7 +380,7 @@ linker_load_file(const char *filename, l > =A0{ > =A0 =A0 =A0 =A0linker_class_t lc; > =A0 =A0 =A0 =A0linker_file_t lf; > - =A0 =A0 =A0 int foundfile, error; > + =A0 =A0 =A0 int foundfile, error, modules; > > =A0 =A0 =A0 =A0/* Refuse to load modules if securelevel raised */ > =A0 =A0 =A0 =A0if (prison0.pr_securelevel > 0) > @@ -419,11 +419,22 @@ linker_load_file(const char *filename, l > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_fil= e_unload(lf, LINKER_UNLOAD_FORCE); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (er= ror); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modules =3D !TAILQ_EMPTY(&l= f->modules); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_UNLOCK(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_register_sysct= ls(lf); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_sysinit(lf); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_LOCK(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lf->flags |=3D LINKER_FILE= _LINKED; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If all of the modules = in this file failed > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* to load, unload the fi= le and return an > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* error of ENOEXEC. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (modules && TAILQ_EMPTY(= &lf->modules)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 linker_file= _unload(lf, LINKER_UNLOAD_FORCE); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (ENO= EXEC); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*result =3D lf; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > @@ -627,7 +638,7 @@ linker_file_unload(linker_file_t file, i > > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Inform any modules associated with this file that they = are > - =A0 =A0 =A0 =A0* being be unloaded. > + =A0 =A0 =A0 =A0* being unloaded. > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0MOD_XLOCK; > =A0 =A0 =A0 =A0for (mod =3D TAILQ_FIRST(&file->modules); mod; mod =3D nex= t) { Thanks. I have had exactly this change in my local tree, but I didn't commit it for some reasons I don't recall... --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 15:10:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37774106566B; Thu, 12 Apr 2012 15:10:14 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C39AB8FC16; Thu, 12 Apr 2012 15:10:12 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so2149898lbb.13 for ; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=noNGpKtSKe2oZETelh9Dap35voQJ813oOFkpFkC8MCo=; b=nT4kK/Ye/c+yxJnOJdmDziNlCRnr/9dKbeKUlkrv5NRfVuR569XtmwS5og4u+KMaG1 +jDZ5nm0SrVVoqoNuaUDpASBTdWl/jZJubK9uNbCkJNFjvLmcSPGKifRbWSglgh9n9+u J88MvPxyxDZW+cw/w6OXn+N43GYQpIQ8GV1RhSwly32AH+fHpLPxJXXPY3aKjvfXXI9Q O0aCDfQPkZy1HzkSvSE0vuBq0C2OJS8YQX3OB43fdrTOFbMIfWtevFmo6buMH43OZgmC EOpnjlTBfvDBzBwNt2HOinoFmXciSTlIBJpB5C4jKx9BgurXwC1Kx3OPs86dshxNnO68 uCmQ== MIME-Version: 1.0 Received: by 10.152.104.109 with SMTP id gd13mr2574645lab.9.1334243410321; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.152.25.69 with HTTP; Thu, 12 Apr 2012 08:10:10 -0700 (PDT) In-Reply-To: References: <201204121449.q3CEnP8L033082@svn.freebsd.org> Date: Thu, 12 Apr 2012 19:10:10 +0400 X-Google-Sender-Auth: GJ7_tIl3pIfWNIXhxz-42RZkoII Message-ID: From: Sergey Kandaurov To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234186 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 15:10:14 -0000 On 12 April 2012 19:06, Sergey Kandaurov wrote: > On 12 April 2012 18:49, John Baldwin wrote: >> Author: jhb >> Date: Thu Apr 12 14:49:25 2012 >> New Revision: 234186 >> URL: http://svn.freebsd.org/changeset/base/234186 >> >> Log: >> =A0If a linker file contains at least one module, but all of the modules >> =A0fail to load (the MOD_LOAD event fails) during a kldload(2), unload t= he >> =A0linker file and fail the kldload(2) with ENOEXEC. >> >> =A0Reported by: =A0gcooper >> =A0MFC after: =A0 =A01 week >> >> Modified: >> =A0head/sys/kern/kern_linker.c >> >> Modified: head/sys/kern/kern_linker.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/kern_linker.c Thu Apr 12 14:06:05 2012 =A0 =A0 =A0 =A0= (r234185) >> +++ head/sys/kern/kern_linker.c Thu Apr 12 14:49:25 2012 =A0 =A0 =A0 =A0= (r234186) >> @@ -380,7 +380,7 @@ linker_load_file(const char *filename, l >> =A0{ >> =A0 =A0 =A0 =A0linker_class_t lc; >> =A0 =A0 =A0 =A0linker_file_t lf; >> - =A0 =A0 =A0 int foundfile, error; >> + =A0 =A0 =A0 int foundfile, error, modules; >> >> =A0 =A0 =A0 =A0/* Refuse to load modules if securelevel raised */ >> =A0 =A0 =A0 =A0if (prison0.pr_securelevel > 0) >> @@ -419,11 +419,22 @@ linker_load_file(const char *filename, l >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_fi= le_unload(lf, LINKER_UNLOAD_FORCE); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (e= rror); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 modules =3D !TAILQ_EMPTY(&= lf->modules); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_UNLOCK(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_register_sysc= tls(lf); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0linker_file_sysinit(lf); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0KLD_LOCK(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lf->flags |=3D LINKER_FIL= E_LINKED; >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If all of the modules= in this file failed >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* to load, unload the f= ile and return an >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* error of ENOEXEC. >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (modules && TAILQ_EMPTY= (&lf->modules)) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 linker_fil= e_unload(lf, LINKER_UNLOAD_FORCE); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (EN= OEXEC); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*result =3D lf; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (0); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> @@ -627,7 +638,7 @@ linker_file_unload(linker_file_t file, i >> >> =A0 =A0 =A0 =A0/* >> =A0 =A0 =A0 =A0 * Inform any modules associated with this file that they= are >> - =A0 =A0 =A0 =A0* being be unloaded. >> + =A0 =A0 =A0 =A0* being unloaded. >> =A0 =A0 =A0 =A0 */ >> =A0 =A0 =A0 =A0MOD_XLOCK; >> =A0 =A0 =A0 =A0for (mod =3D TAILQ_FIRST(&file->modules); mod; mod =3D ne= xt) { > > Thanks. I have had exactly this change in my local tree, > but I didn't commit it for some reasons I don't recall... Doh, I have had something different.. Sorry. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 16:02:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF511065672; Thu, 12 Apr 2012 16:02:46 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1C48FC0C; Thu, 12 Apr 2012 16:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CG2kMH035436; Thu, 12 Apr 2012 16:02:46 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CG2kpK035434; Thu, 12 Apr 2012 16:02:46 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201204121602.q3CG2kpK035434@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 12 Apr 2012 16:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234188 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 16:02:46 -0000 Author: pluknet Date: Thu Apr 12 16:02:45 2012 New Revision: 234188 URL: http://svn.freebsd.org/changeset/base/234188 Log: Update the swi_add prototype after struct ithd was split up into struct intr_event and struct intr_thread. PR: docs/166864 Reviewed by: jhb (older version) MFC after: 1 week Modified: head/share/man/man9/swi.9 Modified: head/share/man/man9/swi.9 ============================================================================== --- head/share/man/man9/swi.9 Thu Apr 12 15:56:04 2012 (r234187) +++ head/share/man/man9/swi.9 Thu Apr 12 16:02:45 2012 (r234188) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2000 +.Dd April 12, 2012 .Dt SWI 9 .Os .Sh NAME @@ -42,7 +42,7 @@ .Vt "extern void *vm_ih" ; .Ft int .Fo swi_add -.Fa "struct ithd **ithdp" +.Fa "struct intr_event **eventp" .Fa "const char *name" .Fa "driver_intr_t handler" .Fa "void *arg" @@ -67,20 +67,21 @@ time, and that they can be run via a lig .Pp The .Fn swi_add -function is used to register a new software interrupt handler. +function is used to add a new software interrupt handler to a specified +interrupt event. The -.Fa ithdp +.Fa eventp argument is an optional pointer to a -.Vt struct ithd +.Vt struct intr_event pointer. -If this argument points to an existing software interrupt thread, then this -handler will be attached to that thread. -Otherwise a new thread will be created, and if -.Fa ithdp +If this argument points to an existing event that holds a list of +interrupt handlers, then this handler will be attached to that event. +Otherwise a new event will be created, and if +.Fa eventp is not .Dv NULL , then the pointer at that address to will be modified to point to the -newly created thread. +newly created event. The .Fa name argument is used to associate a name with a specific handler. @@ -99,7 +100,7 @@ The .Fa pri value specifies the priority of this interrupt handler relative to other software interrupt handlers. -If an interrupt thread is created, then this value is used as the vector, +If an interrupt event is created, then this value is used as the vector, and the .Fa flags argument is used to specify the attributes of a handler such as @@ -183,7 +184,7 @@ argument specifies .Dv INTR_ENTROPY . .It Bq Er EINVAL The -.Fa ithdp +.Fa eventp argument points to a hardware interrupt thread. .It Bq Er EINVAL Either of the @@ -195,9 +196,9 @@ arguments are .It Bq Er EINVAL The .Dv INTR_EXCL -flag is specified and the interrupt thread pointed to by -.Fa ithdp -already has at least one handler, or the interrupt thread already has an +flag is specified and the interrupt event pointed to by +.Fa eventp +already has at least one handler, or the interrupt event already has an exclusive handler. .El .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 16:55:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF005106564A; Thu, 12 Apr 2012 16:55:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0CE38FC0A; Thu, 12 Apr 2012 16:55:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CGtm2i037801; Thu, 12 Apr 2012 16:55:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CGtm5l037799; Thu, 12 Apr 2012 16:55:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201204121655.q3CGtm5l037799@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 12 Apr 2012 16:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234189 - head/sbin/growfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 16:55:49 -0000 Author: trasz Date: Thu Apr 12 16:55:48 2012 New Revision: 234189 URL: http://svn.freebsd.org/changeset/base/234189 Log: Style. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Thu Apr 12 16:02:45 2012 (r234188) +++ head/sbin/growfs/growfs.c Thu Apr 12 16:55:48 2012 (r234189) @@ -76,7 +76,7 @@ int _dbg_lvl_ = (DL_INFO); /* DL_TRC */ static union { struct fs fs; - char pad[SBLOCKSIZE]; + char pad[SBLOCKSIZE]; } fsun1, fsun2; #define sblock fsun1.fs /* the new superblock */ #define osblock fsun2.fs /* the old superblock */ @@ -89,7 +89,7 @@ static ufs2_daddr_t sblockloc; static union { struct cg cg; - char pad[MAXBSIZE]; + char pad[MAXBSIZE]; } cgun1, cgun2; #define acg cgun1.cg /* a cylinder cgroup (new) */ #define aocg cgun2.cg /* an old cylinder group */ @@ -526,7 +526,7 @@ frag_adjust(ufs2_daddr_t frag, int sign) /* * We found something in between. */ - acg.cg_frsum[fragsize]+=sign; + acg.cg_frsum[fragsize] += sign; DBG_PRINT2("frag_adjust [%d]+=%d\n", fragsize, sign); } @@ -882,8 +882,7 @@ updcsloc(time_t modtime, int fsi, int fs */ if (sblock.fs_contigsumsize > 0) { for (block = howmany(d % sblock.fs_fpg, sblock.fs_frag), - lcs = 0; lcs < sblock.fs_contigsumsize; - block++, lcs++) { + lcs = 0; lcs < sblock.fs_contigsumsize; block++, lcs++) { if (isclr(cg_clustersfree(&acg), block)) break; } @@ -913,7 +912,7 @@ updcsloc(time_t modtime, int fsi, int fs * (incomplete) block of the cylinder summary. */ d++; - frag_adjust(d%sblock.fs_fpg, 1); + frag_adjust(d % sblock.fs_fpg, 1); if (isblock(&sblock, cg_blksfree(&acg), (d % sblock.fs_fpg) / sblock.fs_frag)) { @@ -924,8 +923,7 @@ updcsloc(time_t modtime, int fsi, int fs sblock.fs_cstotal.cs_nbfree++; if (sblock.fs_contigsumsize > 0) { setbit(cg_clustersfree(&acg), - (d % sblock.fs_fpg) / - sblock.fs_frag); + (d % sblock.fs_fpg) / sblock.fs_frag); if (lcs < sblock.fs_contigsumsize) { if (lcs) cg_clustersum(&acg)[lcs]--; @@ -1026,8 +1024,7 @@ updcsloc(time_t modtime, int fsi, int fs * Allocate all fragments used by the cylinder summary in the * last block. */ - if (d < - sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { + if (d < sblock.fs_csaddr + (sblock.fs_cssize / sblock.fs_fsize)) { for (; d - sblock.fs_csaddr < sblock.fs_cssize/sblock.fs_fsize; d++) { clrbit(cg_blksfree(&acg), d % sblock.fs_fpg); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 17:43:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DAECE106564A; Thu, 12 Apr 2012 17:43:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5AD18FC0A; Thu, 12 Apr 2012 17:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CHhxK9039337; Thu, 12 Apr 2012 17:43:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CHhxQA039333; Thu, 12 Apr 2012 17:43:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204121743.q3CHhxQA039333@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Apr 2012 17:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234190 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 17:44:00 -0000 Author: jhb Date: Thu Apr 12 17:43:59 2012 New Revision: 234190 URL: http://svn.freebsd.org/changeset/base/234190 Log: - Extend the KDB interface to add a per-debugger callback to print a backtrace for an arbitrary thread (rather than the calling thread). A kdb_backtrace_thread() wrapper function uses the configured debugger if possible, otherwise it falls back to using stack(9) if that is available. - Replace a direct call to db_trace_thread() in propagate_priority() with a call to kdb_backtrace_thread() instead. MFC after: 1 week Modified: head/sys/kern/subr_kdb.c head/sys/kern/subr_turnstile.c head/sys/sys/kdb.h Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Thu Apr 12 16:55:48 2012 (r234189) +++ head/sys/kern/subr_kdb.c Thu Apr 12 17:43:59 2012 (r234190) @@ -73,7 +73,7 @@ struct trapframe *kdb_frame = NULL; static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; -KDB_BACKEND(null, NULL, NULL, NULL); +KDB_BACKEND(null, NULL, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS); @@ -376,6 +376,7 @@ kdb_backtrace(void) struct stack st; printf("KDB: stack backtrace:\n"); + stack_zero(&st); stack_save(&st); stack_print_ddb(&st); } @@ -383,6 +384,30 @@ kdb_backtrace(void) } /* + * Similar to kdb_backtrace() except that it prints a backtrace of an + * arbitrary thread rather than the calling thread. + */ +void +kdb_backtrace_thread(struct thread *td) +{ + + if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace_thread != NULL) { + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + kdb_dbbe->dbbe_trace_thread(td); + } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace of thread %d:\n", td->td_tid); + stack_zero(&st); + stack_save_td(&st, td); + stack_print_ddb(&st); + } +#endif +} + +/* * Set/change the current backend. */ Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Thu Apr 12 16:55:48 2012 (r234189) +++ head/sys/kern/subr_turnstile.c Thu Apr 12 17:43:59 2012 (r234190) @@ -217,9 +217,7 @@ propagate_priority(struct thread *td) printf( "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", td->td_tid, td->td_proc->p_pid); -#ifdef DDB - db_trace_thread(td, -1); -#endif + kdb_backtrace_thread(td); panic("sleeping thread"); } Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Thu Apr 12 16:55:48 2012 (r234189) +++ head/sys/sys/kdb.h Thu Apr 12 17:43:59 2012 (r234190) @@ -31,31 +31,34 @@ #include +struct pcb; +struct thread; +struct trapframe; + typedef int dbbe_init_f(void); typedef void dbbe_trace_f(void); +typedef void dbbe_trace_thread_f(struct thread *); typedef int dbbe_trap_f(int, int); struct kdb_dbbe { const char *dbbe_name; dbbe_init_f *dbbe_init; dbbe_trace_f *dbbe_trace; + dbbe_trace_thread_f *dbbe_trace_thread; dbbe_trap_f *dbbe_trap; int dbbe_active; }; -#define KDB_BACKEND(name, init, trace, trap) \ +#define KDB_BACKEND(name, init, trace, trace_thread, trap) \ static struct kdb_dbbe name##_dbbe = { \ .dbbe_name = #name, \ .dbbe_init = init, \ .dbbe_trace = trace, \ + .dbbe_trace_thread = trace_thread, \ .dbbe_trap = trap \ }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) -struct pcb; -struct thread; -struct trapframe; - extern int kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_panic; /* enter the debugger on panic. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ @@ -67,6 +70,7 @@ int kdb_alt_break(int, int *); int kdb_alt_break_gdb(int, int *); int kdb_break(void); void kdb_backtrace(void); +void kdb_backtrace_thread(struct thread *); int kdb_dbbe_select(const char *); void kdb_enter(const char *, const char *); void kdb_init(void); From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 18:06:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8BD7106566C; Thu, 12 Apr 2012 18:06:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B42628FC12; Thu, 12 Apr 2012 18:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CI6UH9040160; Thu, 12 Apr 2012 18:06:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CI6Ugw040155; Thu, 12 Apr 2012 18:06:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201204121806.q3CI6Ugw040155@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 12 Apr 2012 18:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234193 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 18:06:31 -0000 Author: hselasky Date: Thu Apr 12 18:06:30 2012 New Revision: 234193 URL: http://svn.freebsd.org/changeset/base/234193 Log: Add missing LibUSB 1.0 API function. Reported by: lme @ MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Apr 12 17:59:17 2012 (r234192) +++ head/lib/libusb/Makefile Thu Apr 12 18:06:30 2012 (r234193) @@ -48,6 +48,7 @@ MLINKS += libusb.3 libusb_get_bus_number MLINKS += libusb.3 libusb_get_device_address.3 MLINKS += libusb.3 libusb_get_device_speed.3 MLINKS += libusb.3 libusb_get_max_packet_size.3 +MLINKS += libusb.3 libusb_get_max_iso_packet_size.3 MLINKS += libusb.3 libusb_ref_device.3 MLINKS += libusb.3 libusb_unref_device.3 MLINKS += libusb.3 libusb_open.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Apr 12 17:59:17 2012 (r234192) +++ head/lib/libusb/libusb.3 Thu Apr 12 18:06:30 2012 (r234193) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd April 12, 2012 .Dt LIBUSB 3 .Os .Sh NAME @@ -118,6 +118,12 @@ LIBUSB_SPEED_UNKNOWN is returned in case Returns the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist and LIBUSB_ERROR_OTHERS on other failure. .Pp +.Ft int +.Fn libusb_get_max_iso_packet_size "libusb_device *dev" "unsigned char endpoint" +Returns the packet size multiplied by the packet multiplier on success, +LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist and +LIBUSB_ERROR_OTHERS on other failure. +.Pp .Ft libusb_device * .Fn libusb_ref_device "libusb_device *dev" Increment the reference counter of the device Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Apr 12 17:59:17 2012 (r234192) +++ head/lib/libusb/libusb.h Thu Apr 12 18:06:30 2012 (r234193) @@ -371,6 +371,7 @@ uint8_t libusb_get_device_address(libusb enum libusb_speed libusb_get_device_speed(libusb_device * dev); int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint); int libusb_get_max_packet_size(libusb_device * dev, uint8_t endpoint); +int libusb_get_max_iso_packet_size(libusb_device * dev, uint8_t endpoint); libusb_device *libusb_ref_device(libusb_device * dev); void libusb_unref_device(libusb_device * dev); int libusb_open(libusb_device * dev, libusb_device_handle ** devh); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Apr 12 17:59:17 2012 (r234192) +++ head/lib/libusb/libusb10.c Thu Apr 12 18:06:30 2012 (r234193) @@ -331,6 +331,30 @@ out: return (ret); } +int +libusb_get_max_iso_packet_size(libusb_device *dev, uint8_t endpoint) +{ + int multiplier; + int ret; + + ret = libusb_get_max_packet_size(dev, endpoint); + + switch (libusb20_dev_get_speed(dev->os_priv)) { + case LIBUSB20_SPEED_LOW: + case LIBUSB20_SPEED_FULL: + break; + default: + if (ret > -1) { + multiplier = (1 + ((ret >> 11) & 3)); + if (multiplier > 3) + multiplier = 3; + ret = (ret & 0x7FF) * multiplier; + } + break; + } + return (ret); +} + libusb_device * libusb_ref_device(libusb_device *dev) { From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 18:46:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8A261065672; Thu, 12 Apr 2012 18:46:48 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 998138FC1D; Thu, 12 Apr 2012 18:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CIkmle041387; Thu, 12 Apr 2012 18:46:48 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CIkm15041383; Thu, 12 Apr 2012 18:46:48 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201204121846.q3CIkm15041383@svn.freebsd.org> From: Peter Grehan Date: Thu, 12 Apr 2012 18:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234194 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 18:46:48 -0000 Author: grehan Date: Thu Apr 12 18:46:48 2012 New Revision: 234194 URL: http://svn.freebsd.org/changeset/base/234194 Log: Complete polled-mode operation by using a callout if the device will be used in polled-mode. The callout invokes uart_intr, which rearms the timeout. Implemented for bhyve, but generically useful for e.g. embedded bringup when the interrupt controller hasn't been setup, or if it's not deemed worthy to wire an interrupt line from a serial port. Submitted by: neel Reviewed by: marcel Obtained from: NetApp MFC after: 3 weeks Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_core.c head/sys/dev/uart/uart_if.m Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Thu Apr 12 18:06:30 2012 (r234193) +++ head/sys/dev/uart/uart_bus.h Thu Apr 12 18:46:48 2012 (r234194) @@ -87,6 +87,7 @@ struct uart_softc { struct resource *sc_ires; /* Interrupt resource. */ void *sc_icookie; int sc_irid; + struct callout sc_timer; int sc_callout:1; /* This UART is opened for callout. */ int sc_fastintr:1; /* This UART uses fast interrupts. */ Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Thu Apr 12 18:06:30 2012 (r234193) +++ head/sys/dev/uart/uart_core.c Thu Apr 12 18:46:48 2012 (r234194) @@ -58,6 +58,12 @@ SLIST_HEAD(uart_devinfo_list, uart_devin static MALLOC_DEFINE(M_UART, "UART", "UART driver"); +#ifndef UART_POLL_FREQ +#define UART_POLL_FREQ 50 +#endif +static int uart_poll_freq = UART_POLL_FREQ; +TUNABLE_INT("debug.uart_poll_freq", &uart_poll_freq); + void uart_add_sysdev(struct uart_devinfo *di) { @@ -257,6 +263,12 @@ uart_intr(void *arg) if (ipend & SER_INT_TXIDLE) uart_intr_txidle(sc); } + + if (sc->sc_polled) { + callout_reset(&sc->sc_timer, hz / uart_poll_freq, + (timeout_t *)uart_intr, sc); + } + return((flag)?FILTER_HANDLED:FILTER_STRAY); } @@ -440,8 +452,9 @@ uart_bus_attach(device_t dev) } } if (sc->sc_ires == NULL) { - /* XXX no interrupt resource. Force polled mode. */ + /* No interrupt resource. Force polled mode. */ sc->sc_polled = 1; + callout_init(&sc->sc_timer, 1); } sc->sc_rxbufsz = 384; Modified: head/sys/dev/uart/uart_if.m ============================================================================== --- head/sys/dev/uart/uart_if.m Thu Apr 12 18:06:30 2012 (r234193) +++ head/sys/dev/uart/uart_if.m Thu Apr 12 18:46:48 2012 (r234194) @@ -26,6 +26,7 @@ # $FreeBSD$ #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 20:22:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D863A106564A; Thu, 12 Apr 2012 20:22:17 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C385A8FC08; Thu, 12 Apr 2012 20:22:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CKMHa0044493; Thu, 12 Apr 2012 20:22:17 GMT (envelope-from madpilot@svn.freebsd.org) Received: (from madpilot@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CKMHQA044491; Thu, 12 Apr 2012 20:22:17 GMT (envelope-from madpilot@svn.freebsd.org) Message-Id: <201204122022.q3CKMHQA044491@svn.freebsd.org> From: Guido Falsi Date: Thu, 12 Apr 2012 20:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234195 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 20:22:17 -0000 Author: madpilot (ports committer) Date: Thu Apr 12 20:22:17 2012 New Revision: 234195 URL: http://svn.freebsd.org/changeset/base/234195 Log: Add myself and my relation to my mentors. Approved by: crees Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Apr 12 18:46:48 2012 (r234194) +++ head/share/misc/committers-ports.dot Thu Apr 12 20:22:17 2012 (r234195) @@ -128,6 +128,7 @@ lme [label="Lars Engels\nlme@FreeBSD.org lth [label="Lars Thegler\nlth@FreeBSD.org\n2004/05/04"] lwhsu [label="Li-Wen Hsu\nlwhsu@FreeBSD.org\n2007/04/03"] lx [label="David Thiel\nlx@FreeBSD.org\n2006/11/29"] +madpilot [label="Guido Falsi\nmadpilot@FreeBSD.org\n2012/04/12"] maho [label="Maho Nakata\nmaho@FreeBSD.org\n2002/10/17"] makc [label="Max Brazhnikov\nmakc@FreeBSD.org\n2008/08/25"] mandree [label="Matthias Andree\nmandree@FreeBSD.org\n2009/11/18"] @@ -240,6 +241,7 @@ clsung -> lwhsu clsung -> tabthorpe crees -> jgh +crees -> madpilot delphij -> nemoliu delphij -> rafan @@ -440,6 +442,7 @@ tabthorpe -> fluffy tabthorpe -> jacula tabthorpe -> jadawin tabthorpe -> jlaffaye +tabthorpe -> madpilot tabthorpe -> pgj tabthorpe -> rene tabthorpe -> zi From owner-svn-src-head@FreeBSD.ORG Thu Apr 12 21:34:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0009106566C; Thu, 12 Apr 2012 21:34:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAFFA8FC14; Thu, 12 Apr 2012 21:34:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3CLYwYm046739; Thu, 12 Apr 2012 21:34:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3CLYwrN046736; Thu, 12 Apr 2012 21:34:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201204122134.q3CLYwrN046736@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Apr 2012 21:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234196 - in head/sys: ddb gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 21:34:58 -0000 Author: jhb Date: Thu Apr 12 21:34:58 2012 New Revision: 234196 URL: http://svn.freebsd.org/changeset/base/234196 Log: Update the ddb and gdb backends for the new 'trace_thread' hook. It is implemented via db_trace_thread() for DDB and not implemented for GDB. This should have been part of r234190. Pointy hat to: jhb Reported by: jkim MFC after: 1 week Modified: head/sys/ddb/db_main.c head/sys/gdb/gdb_main.c Modified: head/sys/ddb/db_main.c ============================================================================== --- head/sys/ddb/db_main.c Thu Apr 12 20:22:17 2012 (r234195) +++ head/sys/ddb/db_main.c Thu Apr 12 21:34:58 2012 (r234196) @@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFL static dbbe_init_f db_init; static dbbe_trap_f db_trap; static dbbe_trace_f db_trace_self_wrapper; +static dbbe_trace_thread_f db_trace_thread_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, + db_trap); vm_offset_t ksym_start, ksym_end; @@ -246,3 +248,15 @@ db_trace_self_wrapper(void) db_trace_self(); (void)kdb_jmpbuf(prev_jb); } + +static void +db_trace_thread_wrapper(struct thread *td) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_thread(td, -1); + (void)kdb_jmpbuf(prev_jb); +} Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Thu Apr 12 20:22:17 2012 (r234195) +++ head/sys/gdb/gdb_main.c Thu Apr 12 21:34:58 2012 (r234196) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; -KDB_BACKEND(gdb, gdb_init, NULL, gdb_trap); +KDB_BACKEND(gdb, gdb_init, NULL, NULL, gdb_trap); static struct gdb_dbgport null_gdb_dbgport; DATA_SET(gdb_dbgport_set, null_gdb_dbgport); From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 04:22:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8861065672; Fri, 13 Apr 2012 04:22:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAC848FC08; Fri, 13 Apr 2012 04:22:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D4MgmU059822; Fri, 13 Apr 2012 04:22:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D4MglV059820; Fri, 13 Apr 2012 04:22:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130422.q3D4MglV059820@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 04:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234201 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 04:22:42 -0000 Author: adrian Date: Fri Apr 13 04:22:42 2012 New Revision: 234201 URL: http://svn.freebsd.org/changeset/base/234201 Log: Use strdup() on the name (and free it when it's done) so non-static names can be used in firmware_register(). Modified: head/sys/kern/subr_firmware.c Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Fri Apr 13 04:21:54 2012 (r234200) +++ head/sys/kern/subr_firmware.c Fri Apr 13 04:22:42 2012 (r234201) @@ -175,6 +175,9 @@ firmware_register(const char *imagename, unsigned int version, const struct firmware *parent) { struct priv_fw *match, *frp; + char *str; + + str = strdup(imagename, M_TEMP); mtx_lock(&firmware_mtx); /* @@ -185,16 +188,18 @@ firmware_register(const char *imagename, mtx_unlock(&firmware_mtx); printf("%s: image %s already registered!\n", __func__, imagename); + free(str, M_TEMP); return NULL; } if (frp == NULL) { mtx_unlock(&firmware_mtx); printf("%s: cannot register image %s, firmware table full!\n", __func__, imagename); + free(str, M_TEMP); return NULL; } bzero(frp, sizeof(frp)); /* start from a clean record */ - frp->fw.name = imagename; + frp->fw.name = str; frp->fw.data = data; frp->fw.datasize = datasize; frp->fw.version = version; @@ -230,7 +235,7 @@ firmware_unregister(const char *imagenam err = 0; } else if (fp->refcnt != 0) { /* cannot unregister */ err = EBUSY; - } else { + } else { linker_file_t x = fp->file; /* save value */ /* @@ -238,6 +243,7 @@ firmware_unregister(const char *imagenam * do not forget anything. Then restore 'file' which is * non-null for autoloaded images. */ + free((void *) (uintptr_t) fp->fw.name, M_TEMP); bzero(fp, sizeof(struct priv_fw)); fp->file = x; err = 0; From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 05:40:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96269106564A; Fri, 13 Apr 2012 05:40:27 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C6F8FC08; Fri, 13 Apr 2012 05:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D5eRFb062345; Fri, 13 Apr 2012 05:40:27 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D5eRia062343; Fri, 13 Apr 2012 05:40:27 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201204130540.q3D5eRia062343@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Apr 2012 05:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234202 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 05:40:27 -0000 Author: jh Date: Fri Apr 13 05:40:26 2012 New Revision: 234202 URL: http://svn.freebsd.org/changeset/base/234202 Log: Additional manual page updates for r234103. Submitted by: bde Modified: head/lib/libc/sys/chflags.2 Modified: head/lib/libc/sys/chflags.2 ============================================================================== --- head/lib/libc/sys/chflags.2 Fri Apr 13 04:22:42 2012 (r234201) +++ head/lib/libc/sys/chflags.2 Fri Apr 13 05:40:26 2012 (r234202) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd Apr 10, 2012 +.Dd Apr 13, 2012 .Dt CHFLAGS 2 .Os .Sh NAME @@ -123,7 +123,7 @@ for details.) .Pp The .Dv SF_SNAPSHOT -flag is maintained by the system and cannot be changed by any user. +flag is maintained by the system and cannot be toggled. .Sh RETURN VALUES .Rv -std .Sh ERRORS @@ -153,12 +153,12 @@ or is set and the user is either not the super-user or securelevel is greater than 0. .It Bq Er EPERM -A non-super-user tries to set one of +A non-super-user attempted to toggle one of .Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND , or .Dv SF_NOUNLINK . .It Bq Er EPERM -User tries to set or remove the +An attempt was made to toggle the .Dv SF_SNAPSHOT flag. .It Bq Er EROFS @@ -173,7 +173,9 @@ An .Tn I/O error occurred while reading from or writing to the file system. .It Bq Er EOPNOTSUPP -The underlying file system does not support file flags. +The underlying file system does not support file flags, or +does not support all of the flags set in +.Fa flags . .El .Pp The @@ -198,12 +200,12 @@ or is set and the user is either not the super-user or securelevel is greater than 0. .It Bq Er EPERM -A non-super-user tries to set one of +A non-super-user attempted to toggle one of .Dv SF_ARCHIVED , SF_IMMUTABLE , SF_APPEND , or .Dv SF_NOUNLINK . .It Bq Er EPERM -User tries to set or remove the +An attempt was made to toggle the .Dv SF_SNAPSHOT flag. .It Bq Er EROFS @@ -213,7 +215,9 @@ An .Tn I/O error occurred while reading from or writing to the file system. .It Bq Er EOPNOTSUPP -The underlying file system does not support file flags. +The underlying file system does not support file flags, or +does not support all of the flags set in +.Fa flags . .El .Sh SEE ALSO .Xr chflags 1 , From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 05:48:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8F261065778; Fri, 13 Apr 2012 05:48:31 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93D408FC15; Fri, 13 Apr 2012 05:48:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D5mVDB062623; Fri, 13 Apr 2012 05:48:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D5mVkN062621; Fri, 13 Apr 2012 05:48:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201204130548.q3D5mVkN062621@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Apr 2012 05:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234203 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 05:48:31 -0000 Author: jh Date: Fri Apr 13 05:48:31 2012 New Revision: 234203 URL: http://svn.freebsd.org/changeset/base/234203 Log: Apply changes from r234103 to ext2fs: Return EPERM from ext2_setattr() when an user without PRIV_VFS_SYSFLAGS privilege attempts to toggle SF_SETTABLE flags. Flags are now stored to ip->i_flags in one place after all checks. Also, remove SF_NOUNLINK from the checks because ext2fs doesn't support that flag. Reviewed by: bde Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Apr 13 05:40:26 2012 (r234202) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Apr 13 05:48:31 2012 (r234203) @@ -424,21 +424,17 @@ ext2_setattr(ap) * if securelevel > 0 and any existing system flags are set. */ if (!priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0)) { - if (ip->i_flags & - (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) { + if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND)) { error = securelevel_gt(cred, 0); if (error) return (error); } - ip->i_flags = vap->va_flags; } else { - if (ip->i_flags & - (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) || - (vap->va_flags & UF_SETTABLE) != vap->va_flags) + if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND) || + ((vap->va_flags ^ ip->i_flags) & SF_SETTABLE)) return (EPERM); - ip->i_flags &= SF_SETTABLE; - ip->i_flags |= (vap->va_flags & UF_SETTABLE); } + ip->i_flags = vap->va_flags; ip->i_flag |= IN_CHANGE; if (ip->i_flags & (IMMUTABLE | APPEND)) return (0); From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 06:11:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43A8B1065673; Fri, 13 Apr 2012 06:11:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE478FC16; Fri, 13 Apr 2012 06:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D6BPrg063426; Fri, 13 Apr 2012 06:11:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D6BOQZ063423; Fri, 13 Apr 2012 06:11:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130611.q3D6BOQZ063423@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 06:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234204 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 06:11:25 -0000 Author: adrian Date: Fri Apr 13 06:11:24 2012 New Revision: 234204 URL: http://svn.freebsd.org/changeset/base/234204 Log: Sync this code against what's in OpenWRT trunk. * the openwrt code doesn't treat 0/0/0 any differently from other bus/slot/func combinations. * A "local write" function writes to the LCONF area, and so I've added it. * The PCI workaround at attach time uses this LCONF code, which it already did .. * .. but it is a 4 byte write, not a 2 byte write. Even though it's PCIR_COMMAND which is a two byte PCI register. Tested on: AR7161 TODO: The other two AR71xx derivatives TODO: More thoroughly stare at the datasheets I do have and if it indeed is incorrect, push fixes to both FreeBSD and Linux/OpenWRT. Obtained from: Linux OpenWRT Modified: head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 05:48:31 2012 (r234203) +++ head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 06:11:24 2012 (r234204) @@ -207,17 +207,11 @@ ar71xx_pci_read_config(device_t dev, u_i dprintf("%s: tag (%x, %x, %x) reg %d(%d)\n", __func__, bus, slot, func, reg, bytes); - if ((bus == 0) && (slot == 0) && (func == 0)) { - cmd = PCI_LCONF_CMD_READ | (reg & ~3); - ATH_WRITE_REG(AR71XX_PCI_LCONF_CMD, cmd); - data = ATH_READ_REG(AR71XX_PCI_LCONF_READ_DATA); - } else { - if (ar71xx_pci_conf_setup(bus, slot, func, reg, bytes, - PCI_CONF_CMD_READ) == 0) - data = ATH_READ_REG(AR71XX_PCI_CONF_READ_DATA); - else - data = -1; - } + if (ar71xx_pci_conf_setup(bus, slot, func, reg, bytes, + PCI_CONF_CMD_READ) == 0) + data = ATH_READ_REG(AR71XX_PCI_CONF_READ_DATA); + else + data = -1; /* get request bytes from 32-bit word */ data = (data >> shift) & mask; @@ -228,26 +222,33 @@ ar71xx_pci_read_config(device_t dev, u_i } static void -ar71xx_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func, - u_int reg, uint32_t data, int bytes) +ar71xx_pci_local_write(device_t dev, uint32_t reg, uint32_t data, int bytes) { uint32_t cmd; - dprintf("%s: tag (%x, %x, %x) reg %d(%d)\n", __func__, bus, slot, + dprintf("%s: local write reg %d(%d)\n", __func__, reg, bytes); + + data = data << (8*(reg % 4)); + + cmd = PCI_LCONF_CMD_WRITE | (reg & ~3); + cmd |= (ar71xx_get_bytes_to_read(reg, bytes) << 20); + ATH_WRITE_REG(AR71XX_PCI_LCONF_CMD, cmd); + ATH_WRITE_REG(AR71XX_PCI_LCONF_WRITE_DATA, data); +} + +static void +ar71xx_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, uint32_t data, int bytes) +{ + + dprintf("%s: tag (%x, %x, %x) reg %d(%d)\n", __func__, bus, slot, func, reg, bytes); data = data << (8*(reg % 4)); - if ((bus == 0) && (slot == 0) && (func == 0)) { - cmd = PCI_LCONF_CMD_WRITE | (reg & ~3); - cmd |= ar71xx_get_bytes_to_read(reg, bytes) << 20; - ATH_WRITE_REG(AR71XX_PCI_LCONF_CMD, cmd); - ATH_WRITE_REG(AR71XX_PCI_LCONF_WRITE_DATA, data); - } else { - if (ar71xx_pci_conf_setup(bus, slot, func, reg, bytes, - PCI_CONF_CMD_WRITE) == 0) - ATH_WRITE_REG(AR71XX_PCI_CONF_WRITE_DATA, data); - } + if (ar71xx_pci_conf_setup(bus, slot, func, reg, bytes, + PCI_CONF_CMD_WRITE) == 0) + ATH_WRITE_REG(AR71XX_PCI_CONF_WRITE_DATA, data); } #ifdef AR71XX_ATH_EEPROM @@ -389,10 +390,10 @@ ar71xx_pci_attach(device_t dev) ar71xx_pci_check_bus_error(); /* Fixup internal PCI bridge */ - ar71xx_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, - PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN + ar71xx_pci_local_write(dev, PCIR_COMMAND, + PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN | PCIM_CMD_SERRESPEN | PCIM_CMD_BACKTOBACK - | PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 2); + | PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 4); #ifdef AR71XX_ATH_EEPROM /* From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 06:11:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6FA4106564A; Fri, 13 Apr 2012 06:11:53 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 26C0E8FC14; Fri, 13 Apr 2012 06:11:53 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 98FCA1515A1; Fri, 13 Apr 2012 09:11:40 +0300 (EEST) Date: Fri, 13 Apr 2012 09:11:39 +0300 From: Jaakko Heinonen To: Mikolaj Golub , Kevin Lo Message-ID: <20120413061139.GA2370@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> <86vco2yvrt.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86vco2yvrt.fsf@kopusha.home.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 06:11:53 -0000 On 2012-01-23, Mikolaj Golub wrote: > I see two issues with this patch: What do you think about this patch? %%% Index: sys/fs/tmpfs/tmpfs.h =================================================================== --- sys/fs/tmpfs/tmpfs.h (revision 234201) +++ sys/fs/tmpfs/tmpfs.h (working copy) @@ -387,6 +387,9 @@ struct tmpfs_mount { * tmpfs_pool.c. */ uma_zone_t tm_dirent_pool; uma_zone_t tm_node_pool; + + /* Read-only status. */ + int tm_ronly; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) Index: sys/fs/tmpfs/tmpfs_vfsops.c =================================================================== --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 234201) +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { NULL }; +static const char *tmpfs_updateopts[] = { + "from", "export", NULL +}; + /* --------------------------------------------------------------------- */ static int @@ -150,12 +154,13 @@ tmpfs_mount(struct mount *mp) return (EINVAL); if (mp->mnt_flag & MNT_UPDATE) { - /* - * Only support update mounts for NFS export. - */ - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) - return (0); - return (EOPNOTSUPP); + /* Only support update mounts for certain options. */ + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) + return (EOPNOTSUPP); + if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) != + ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly) + return (EOPNOTSUPP); + return (0); } vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); @@ -228,6 +233,7 @@ tmpfs_mount(struct mount *mp) tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); + tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; /* Allocate the root node. */ error = tmpfs_alloc_node(tmp, VDIR, root_uid, %%% -- Jaakko From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 06:13:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAC70106566B; Fri, 13 Apr 2012 06:13:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96A118FC08; Fri, 13 Apr 2012 06:13:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D6Dbbu063530; Fri, 13 Apr 2012 06:13:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D6DbFT063528; Fri, 13 Apr 2012 06:13:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130613.q3D6DbFT063528@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 06:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234205 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 06:13:37 -0000 Author: adrian Date: Fri Apr 13 06:13:37 2012 New Revision: 234205 URL: http://svn.freebsd.org/changeset/base/234205 Log: Remove an unused variable. Grr. Modified: head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 06:11:24 2012 (r234204) +++ head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 06:13:37 2012 (r234205) @@ -195,7 +195,7 @@ ar71xx_pci_read_config(device_t dev, u_i u_int reg, int bytes) { uint32_t data; - uint32_t cmd, shift, mask; + uint32_t shift, mask; /* register access is 32-bit aligned */ shift = (reg & 3) * 8; From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 06:15:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E8331065676; Fri, 13 Apr 2012 06:15:52 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 005408FC0C; Fri, 13 Apr 2012 06:15:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D6FpQl063635; Fri, 13 Apr 2012 06:15:51 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D6FpFa063633; Fri, 13 Apr 2012 06:15:51 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201204130615.q3D6FpFa063633@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Apr 2012 06:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234206 - head/usr.bin/unzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 06:15:52 -0000 Author: kevlo Date: Fri Apr 13 06:15:51 2012 New Revision: 234206 URL: http://svn.freebsd.org/changeset/base/234206 Log: Partially implement zipinfo (-Z) support. This fixes some test failures seen with perl 5.12 and 5.14. PR: bin/166895 Submitted by: swills MFC after: 3 days Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Apr 13 06:13:37 2012 (r234205) +++ head/usr.bin/unzip/unzip.c Fri Apr 13 06:15:51 2012 (r234206) @@ -65,6 +65,7 @@ static int q_opt; /* quiet */ static int t_opt; /* test */ static int u_opt; /* update */ static int v_opt; /* verbose/list */ +static int Z1_opt; /* zipinfo mode list files only */ /* time when unzip started */ static time_t now; @@ -72,6 +73,9 @@ static time_t now; /* debug flag */ static int unzip_debug; +/* zipinfo mode */ +static int zipinfo_mode; + /* running on tty? */ static int tty; @@ -802,17 +806,22 @@ list(struct archive *a, struct archive_e mtime = archive_entry_mtime(e); strftime(buf, sizeof(buf), "%m-%d-%g %R", localtime(&mtime)); - if (v_opt == 1) { - printf(" %8ju %s %s\n", - (uintmax_t)archive_entry_size(e), - buf, archive_entry_pathname(e)); - } else if (v_opt == 2) { - printf("%8ju Stored %7ju 0%% %s %08x %s\n", - (uintmax_t)archive_entry_size(e), - (uintmax_t)archive_entry_size(e), - buf, - 0U, - archive_entry_pathname(e)); + if (!zipinfo_mode) { + if (v_opt == 1) { + printf(" %8ju %s %s\n", + (uintmax_t)archive_entry_size(e), + buf, archive_entry_pathname(e)); + } else if (v_opt == 2) { + printf("%8ju Stored %7ju 0%% %s %08x %s\n", + (uintmax_t)archive_entry_size(e), + (uintmax_t)archive_entry_size(e), + buf, + 0U, + archive_entry_pathname(e)); + } + } else { + if (Z1_opt) + printf("%s\n",archive_entry_pathname(e)); } ac(archive_read_data_skip(a)); } @@ -870,14 +879,16 @@ unzip(const char *fn) ac(archive_read_support_format_zip(a)); ac(archive_read_open_fd(a, fd, 8192)); - if (!p_opt && !q_opt) - printf("Archive: %s\n", fn); - if (v_opt == 1) { - printf(" Length Date Time Name\n"); - printf(" -------- ---- ---- ----\n"); - } else if (v_opt == 2) { - printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); - printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); + if (!zipinfo_mode) { + if (!p_opt && !q_opt) + printf("Archive: %s\n", fn); + if (v_opt == 1) { + printf(" Length Date Time Name\n"); + printf(" -------- ---- ---- ----\n"); + } else if (v_opt == 2) { + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); + } } total_size = 0; @@ -888,28 +899,35 @@ unzip(const char *fn) if (ret == ARCHIVE_EOF) break; ac(ret); - if (t_opt) - error_count += test(a, e); - else if (v_opt) - list(a, e); - else if (p_opt || c_opt) - extract_stdout(a, e); - else - extract(a, e); + if (!zipinfo_mode) { + if (t_opt) + error_count += test(a, e); + else if (v_opt) + list(a, e); + else if (p_opt || c_opt) + extract_stdout(a, e); + else + extract(a, e); + } else { + if (Z1_opt) + list(a, e); + } total_size += archive_entry_size(e); ++file_count; } - if (v_opt == 1) { - printf(" -------- -------\n"); - printf(" %8ju %ju file%s\n", - total_size, file_count, file_count != 1 ? "s" : ""); - } else if (v_opt == 2) { - printf("-------- ------- --- -------\n"); - printf("%8ju %7ju 0%% %ju file%s\n", - total_size, total_size, file_count, - file_count != 1 ? "s" : ""); + if (zipinfo_mode) { + if (v_opt == 1) { + printf(" -------- -------\n"); + printf(" %8ju %ju file%s\n", + total_size, file_count, file_count != 1 ? "s" : ""); + } else if (v_opt == 2) { + printf("-------- ------- --- -------\n"); + printf("%8ju %7ju 0%% %ju file%s\n", + total_size, total_size, file_count, + file_count != 1 ? "s" : ""); + } } ac(archive_read_close(a)); @@ -933,7 +951,7 @@ static void usage(void) { - fprintf(stderr, "usage: unzip [-aCcfjLlnopqtuv] [-d dir] [-x pattern] zipfile\n"); + fprintf(stderr, "usage: unzip [-aCcfjLlnopqtuvZ1] [-d dir] [-x pattern] zipfile\n"); exit(1); } @@ -943,8 +961,11 @@ getopts(int argc, char *argv[]) int opt; optreset = optind = 1; - while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:")) != -1) + while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:Z1")) != -1) switch (opt) { + case '1': + Z1_opt = 1; + break; case 'a': a_opt = 1; break; @@ -995,6 +1016,9 @@ getopts(int argc, char *argv[]) case 'x': add_pattern(&exclude, optarg); break; + case 'Z': + zipinfo_mode = 1; + break; default: usage(); } @@ -1024,6 +1048,15 @@ main(int argc, char *argv[]) */ nopts = getopts(argc, argv); + /* + * When more of the zipinfo mode options are implemented, this + * will need to change. + */ + if (zipinfo_mode && !Z1_opt) { + printf("Zipinfo mode needs additional options\n"); + exit(1); + } + if (argc <= nopts) usage(); zipfile = argv[nopts++]; From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 07:15:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF8951065672; Fri, 13 Apr 2012 07:15:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AEC88FC15; Fri, 13 Apr 2012 07:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D7FeQb065423; Fri, 13 Apr 2012 07:15:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D7Fevo065420; Fri, 13 Apr 2012 07:15:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201204130715.q3D7Fevo065420@svn.freebsd.org> From: Andriy Gapon Date: Fri, 13 Apr 2012 07:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234207 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 07:15:40 -0000 Author: avg Date: Fri Apr 13 07:15:40 2012 New Revision: 234207 URL: http://svn.freebsd.org/changeset/base/234207 Log: bump INTRCNT_COUNT values to reflect actual numbers of IPI counters Maybe the numbers should be conditionalized on COUNT_IPIS Reviewed by: jhb MFC after: 1 week Modified: head/sys/amd64/include/intr_machdep.h head/sys/i386/include/intr_machdep.h Modified: head/sys/amd64/include/intr_machdep.h ============================================================================== --- head/sys/amd64/include/intr_machdep.h Fri Apr 13 06:15:51 2012 (r234206) +++ head/sys/amd64/include/intr_machdep.h Fri Apr 13 07:15:40 2012 (r234207) @@ -60,10 +60,10 @@ * - 1 ??? dummy counter. * - 2 counters for each I/O interrupt. * - 1 counter for each CPU for lapic timer. - * - 7 counters for each CPU for IPI counters for SMP. + * - 8 counters for each CPU for IPI counters for SMP. */ #ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU) +#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 8) * MAXCPU) #else #define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) #endif Modified: head/sys/i386/include/intr_machdep.h ============================================================================== --- head/sys/i386/include/intr_machdep.h Fri Apr 13 06:15:51 2012 (r234206) +++ head/sys/i386/include/intr_machdep.h Fri Apr 13 07:15:40 2012 (r234207) @@ -60,10 +60,10 @@ * - 1 ??? dummy counter. * - 2 counters for each I/O interrupt. * - 1 counter for each CPU for lapic timer. - * - 7 counters for each CPU for IPI counters for SMP. + * - 9 counters for each CPU for IPI counters for SMP. */ #ifdef SMP -#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 7) * MAXCPU) +#define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + (1 + 9) * MAXCPU) #else #define INTRCNT_COUNT (1 + NUM_IO_INTS * 2 + 1) #endif From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 07:18:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE5EF106564A; Fri, 13 Apr 2012 07:18:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B90178FC14; Fri, 13 Apr 2012 07:18:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D7IJIO065542; Fri, 13 Apr 2012 07:18:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D7IJQh065539; Fri, 13 Apr 2012 07:18:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201204130718.q3D7IJQh065539@svn.freebsd.org> From: Andriy Gapon Date: Fri, 13 Apr 2012 07:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234208 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 07:18:19 -0000 Author: avg Date: Fri Apr 13 07:18:19 2012 New Revision: 234208 URL: http://svn.freebsd.org/changeset/base/234208 Log: add actual interrupt counters to back ipi_invlcache_counts Otherwise one could run into a panic with COUNT_IPIS when cache invalidation actually happened. Reviewed by: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Apr 13 07:15:40 2012 (r234207) +++ head/sys/amd64/amd64/mp_machdep.c Fri Apr 13 07:18:19 2012 (r234208) @@ -1471,6 +1471,8 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_invlrng_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:invlpg", i); intrcnt_add(buf, &ipi_invlpg_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:invlcache", i); + intrcnt_add(buf, &ipi_invlcache_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:preempt", i); intrcnt_add(buf, &ipi_preempt_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:ast", i); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri Apr 13 07:15:40 2012 (r234207) +++ head/sys/i386/i386/mp_machdep.c Fri Apr 13 07:18:19 2012 (r234208) @@ -1530,6 +1530,8 @@ mp_ipi_intrcnt(void *dummy) intrcnt_add(buf, &ipi_invlrng_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:invlpg", i); intrcnt_add(buf, &ipi_invlpg_counts[i]); + snprintf(buf, sizeof(buf), "cpu%d:invlcache", i); + intrcnt_add(buf, &ipi_invlcache_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:preempt", i); intrcnt_add(buf, &ipi_preempt_counts[i]); snprintf(buf, sizeof(buf), "cpu%d:ast", i); From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 08:45:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D200106564A; Fri, 13 Apr 2012 08:45:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F21378FC18; Fri, 13 Apr 2012 08:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D8joDN068844; Fri, 13 Apr 2012 08:45:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D8joSO068842; Fri, 13 Apr 2012 08:45:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130845.q3D8joSO068842@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 08:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234217 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 08:45:51 -0000 Author: adrian Date: Fri Apr 13 08:45:50 2012 New Revision: 234217 URL: http://svn.freebsd.org/changeset/base/234217 Log: (ab)Use the firmware API to store away EEPROM calibration data for future use by the ath(4) driver. These embedded devices put the calibration/PCI bootstrap data on the on board SPI flash rather than on an EEPROM connected to the NIC. For some boards, there's two NICs and two sets of EEPROM data in the main SPI flash. The particulars: * Introduce ath_fixup_size, which is the size of the EEPROM area in bytes. * Create a firmware image with a name based on the PCI device identifier (bus/slot/device/function). * Hide some verbose debugging behind 'bootverbose'. ath(4) can then use this to load in the EEPROM data. This requires AR71XX_ATH_EEPROM to be defined. Modified: head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 08:11:14 2012 (r234216) +++ head/sys/mips/atheros/ar71xx_pci.c Fri Apr 13 08:45:50 2012 (r234217) @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$"); #include +#ifdef AR71XX_ATH_EEPROM +#include +#include +#endif /* AR71XX_ATH_EEPROM */ + #undef AR71XX_PCI_DEBUG #ifdef AR71XX_PCI_DEBUG #define dprintf printf @@ -266,8 +271,9 @@ ar71xx_pci_fixup(device_t dev, u_int bus uint16_t *cal_data = (uint16_t *) MIPS_PHYS_TO_KSEG1(flash_addr); uint32_t reg, val, bar0; - printf("%s: flash_addr=%lx, cal_data=%p\n", - __func__, flash_addr, cal_data); + if (bootverbose) + device_printf(dev, "%s: flash_addr=%lx, cal_data=%p\n", + __func__, flash_addr, cal_data); /* XXX check 0xa55a */ /* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */ @@ -284,7 +290,8 @@ ar71xx_pci_fixup(device_t dev, u_int bus reg = *cal_data++; val = *cal_data++; val |= (*cal_data++) << 16; - printf(" reg: %x, val=%x\n", reg, val); + if (bootverbose) + printf(" reg: %x, val=%x\n", reg, val); /* Write eeprom fixup data to device memory */ ATH_WRITE_REG(AR71XX_PCI_MEM_BASE + reg, val); @@ -299,6 +306,62 @@ ar71xx_pci_fixup(device_t dev, u_int bus ar71xx_pci_write_config(dev, bus, slot, func, PCIR_BAR(0), bar0, 4); } +/* + * Take a copy of the EEPROM contents and squirrel it away in a firmware. + * The SPI flash will eventually cease to be memory-mapped, so we need + * to take a copy of this before the SPI driver initialises. + */ +static void +ar71xx_pci_slot_create_eeprom_firmware(device_t dev, u_int bus, u_int slot, + u_int func, long int flash_addr) +{ + char buf[64]; + uint16_t *cal_data = (uint16_t *) MIPS_PHYS_TO_KSEG1(flash_addr); + void *eeprom = NULL; + const struct firmware *fw = NULL; + int len; + + snprintf(buf, sizeof(buf), "bus.%d.%d.%d.ath_fixup_size", + bus, slot, func); + + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + buf, &len) != 0) { + device_printf(dev, "%s: missing hint '%s', aborting EEPROM\n", + __func__, buf); + return; + } + + device_printf(dev, "EEPROM firmware: 0x%lx @ %d bytes\n", + flash_addr, len); + + eeprom = malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); + if (! eeprom) { + device_printf(dev, + "%s: malloc failed for '%s', aborting EEPROM\n", + __func__, buf); + return; + } + + memcpy(eeprom, cal_data, len); + + /* + * Generate a flash EEPROM 'firmware' from the given memory + * region. Since the SPI controller will eventually + * go into port-IO mode instead of memory-mapped IO + * mode, a copy of the EEPROM contents is required. + */ + snprintf(buf, sizeof(buf), "%s.%d.bus.%d.%d.%d.eeprom_firmware", + device_get_name(dev), device_get_unit(dev), bus, slot, func); + fw = firmware_register(buf, eeprom, len, 1, NULL); + if (fw == NULL) { + device_printf(dev, "%s: firmware_register (%s) failed\n", + __func__, buf); + free(eeprom, M_DEVBUF); + return; + } + device_printf(dev, "device EEPROM '%s' registered\n", buf); +} + static void ar71xx_pci_slot_fixup(device_t dev, u_int bus, u_int slot, u_int func) { @@ -308,16 +371,19 @@ ar71xx_pci_slot_fixup(device_t dev, u_in /* * Check whether the given slot has a hint to poke. */ - printf("%s: checking dev %s, %d/%d/%d\n", + if (bootverbose) + device_printf(dev, "%s: checking dev %s, %d/%d/%d\n", __func__, device_get_nameunit(dev), bus, slot, func); snprintf(buf, sizeof(buf), "bus.%d.%d.%d.ath_fixup_addr", bus, slot, func); if (resource_long_value(device_get_name(dev), device_get_unit(dev), buf, &flash_addr) == 0) { - printf("%s: found fixupaddr at %lx: updating\n", - __func__, flash_addr); + device_printf(dev, "found EEPROM at 0x%lx on %d.%d.%d\n", + flash_addr, bus, slot, func); ar71xx_pci_fixup(dev, bus, slot, func, flash_addr); + ar71xx_pci_slot_create_eeprom_firmware(dev, bus, slot, func, + flash_addr); } } #endif /* AR71XX_ATH_EEPROM */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 08:48:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 64E461065674; Fri, 13 Apr 2012 08:48:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364B08FC08; Fri, 13 Apr 2012 08:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D8mdl1068959; Fri, 13 Apr 2012 08:48:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D8mdRD068957; Fri, 13 Apr 2012 08:48:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130848.q3D8mdRD068957@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 08:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234218 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 08:48:39 -0000 Author: adrian Date: Fri Apr 13 08:48:38 2012 New Revision: 234218 URL: http://svn.freebsd.org/changeset/base/234218 Log: Introduce the ability to grab local EEPROM data from the firmware(9) interface. * Introduce a device hint, 'eeprom_firmware', which is the name of firmware to lookup. * If the lookup succeeds, take a copy of it and use it as the eeprom data. This isn't enabled by default - you have to define ATH_EEPROM_FIRMWARE. I'll add it to the configuration variables in a later commit. TODO: * just keep a firmware reference in ath_softc, and remove the need to waste the extra memory in having sc_eepromdata be a malloc()ed block. Modified: head/sys/dev/ath/if_ath_pci.c Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Fri Apr 13 08:45:50 2012 (r234217) +++ head/sys/dev/ath/if_ath_pci.c Fri Apr 13 08:48:38 2012 (r234218) @@ -60,6 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include +/* #define ATH_EEPROM_FIRMWARE */ + +/* For EEPROM firmware */ +#ifdef ATH_EEPROM_FIRMWARE +#include +#include +#endif /* ATH_EEPROM_FIRMWARE */ + /* * PCI glue. */ @@ -123,6 +131,10 @@ ath_pci_attach(device_t dev) struct ath_softc *sc = &psc->sc_sc; int error = ENXIO; int rid; +#ifdef ATH_EEPROM_FIRMWARE + const struct firmware *fw = NULL; + const char *buf; +#endif sc->sc_dev = dev; @@ -191,6 +203,37 @@ ath_pci_attach(device_t dev) goto bad3; } +#ifdef ATH_EEPROM_FIRMWARE + /* + * If there's an EEPROM firmware image, load that in. + */ + if (resource_string_value(device_get_name(dev), device_get_unit(dev), + "eeprom_firmware", &buf) == 0) { + if (bootverbose) + device_printf(dev, "%s: looking up firmware @ '%s'\n", + __func__, buf); + + fw = firmware_get(buf); + if (fw == NULL) { + device_printf(dev, "%s: couldn't find firmware\n", + __func__); + goto bad3; + } + + device_printf(dev, "%s: EEPROM firmware @ %p\n", + __func__, fw->data); + sc->sc_eepromdata = + malloc(fw->datasize, M_TEMP, M_WAITOK | M_ZERO); + if (! sc->sc_eepromdata) { + device_printf(dev, "%s: can't malloc eepromdata\n", + __func__); + goto bad3; + } + memcpy(sc->sc_eepromdata, fw->data, fw->datasize); + firmware_put(fw, 0); + } +#endif /* ATH_EEPROM_FIRMWARE */ + ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); @@ -234,6 +277,9 @@ ath_pci_detach(device_t dev) bus_dma_tag_destroy(sc->sc_dmat); bus_release_resource(dev, SYS_RES_MEMORY, BS_BAR, psc->sc_sr); + if (sc->sc_eepromdata) + free(sc->sc_eepromdata, M_TEMP); + ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 08:52:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C18BE106564A; Fri, 13 Apr 2012 08:52:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5B98FC0C; Fri, 13 Apr 2012 08:52:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D8qPMa069109; Fri, 13 Apr 2012 08:52:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D8qP1k069105; Fri, 13 Apr 2012 08:52:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130852.q3D8qP1k069105@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 08:52:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234219 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 08:52:25 -0000 Author: adrian Date: Fri Apr 13 08:52:25 2012 New Revision: 234219 URL: http://svn.freebsd.org/changeset/base/234219 Log: Introduce configuration files for AP94 and AP96. This uses the new firmware(9) method for squirreling away the EEPROM contents from SPI flash so ath(4) can get to them later. It won't work out of the box just yet - you have to add this to if_ath_pci.c: #define ATH_EEPROM_FIRMWARE .. until I've added it as a configuration option and updated things. Added: head/sys/mips/conf/AP94 (contents, props changed) head/sys/mips/conf/AP94.hints (contents, props changed) head/sys/mips/conf/AP96 (contents, props changed) head/sys/mips/conf/AP96.hints (contents, props changed) Added: head/sys/mips/conf/AP94 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP94 Fri Apr 13 08:52:25 2012 (r234219) @@ -0,0 +1,32 @@ +# +# Specific board setup for the Atheros AP94 reference board. +# +# The AP94 has the following hardware: +# +# + AR7161 CPU SoC +# + AR9223 2.4GHz 11n +# + AR9220 5GHz 11n +# + AR8216 10/100 switch +# + m25p64 based 8MB flash +# + 32mb RAM +# + uboot environment + +# $FreeBSD$ + +include "AR71XX_BASE" +ident "AP94" +hints "AP94.hints" + +# GEOM modules +device geom_redboot # to get access to the SPI flash partitions +device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP + +options ROOTDEVNAME=\"ufs:md0.uzip\" +options AR71XX_REALMEM=32*1024*1024 + +# options MD_ROOT +# options MD_ROOT_SIZE="6144" + +options AR71XX_ATH_EEPROM +device firmware Added: head/sys/mips/conf/AP94.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP94.hints Fri Apr 13 08:52:25 2012 (r234219) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +hint.arge.0.phymask=0x000c +hint.arge.0.media=100 +hint.arge.0.fduplex=1 + +# XXX grab these from uboot? +# hint.arge.0.eeprommac=0x1f01fc00 + +# The ath NICs have calibration data in flash. +# PCI slot 17 +# hint.ath.0.eepromaddr=0x1fff1000 +# PCI slot 18 +# hint.ath.1.eepromaddr=0x1fff5000 + +# ath0 - slot 17 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 + +# ath1 - slot 18 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 +hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 + +# .. and now, telling each ath(4) NIC where to find the firmware +# image. +hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" +hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" + Added: head/sys/mips/conf/AP96 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP96 Fri Apr 13 08:52:25 2012 (r234219) @@ -0,0 +1,32 @@ +# +# Specific board setup for the Atheros AP96 reference board. +# +# The AP96 has the following hardware: +# +# + AR7161 CPU SoC +# + AR9223 2.4GHz 11n +# + AR9220 5GHz 11n +# + AR8316 10/100/1000 switch +# + m25p64 based 8MB flash +# + 64mb RAM +# + uboot environment + +# $FreeBSD$ + +include "AR71XX_BASE" +ident "AP96" +hints "AP96.hints" + +# GEOM modules +device geom_redboot # to get access to the SPI flash partitions +device geom_uzip # compressed in-memory filesystem hackery! +options GEOM_UZIP + +options ROOTDEVNAME=\"ufs:md0.uzip\" +options AR71XX_REALMEM=64*1024*1024 + +# options MD_ROOT +# options MD_ROOT_SIZE="6144" + +options AR71XX_ATH_EEPROM +device firmware Added: head/sys/mips/conf/AP96.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AP96.hints Fri Apr 13 08:52:25 2012 (r234219) @@ -0,0 +1,28 @@ +# $FreeBSD$ + +hint.arge.0.phymask=0x000c +hint.arge.0.media=100 +hint.arge.0.fduplex=1 + +# XXX grab these from uboot? +# hint.arge.0.eeprommac=0x1f01fc00 + +# The ath NICs have calibration data in flash. +# PCI slot 17 +# hint.ath.0.eepromaddr=0x1fff1000 +# PCI slot 18 +# hint.ath.1.eepromaddr=0x1fff5000 + +# ath0 - slot 17 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1fff1000 +hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 + +# ath1 - slot 18 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1fff5000 +hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 + +# .. and now, telling each ath(4) NIC where to find the firmware +# image. +hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" +hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" + From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 08:56:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50081065672; Fri, 13 Apr 2012 08:56:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A101C8FC17; Fri, 13 Apr 2012 08:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D8uNNd069294; Fri, 13 Apr 2012 08:56:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D8uNfA069291; Fri, 13 Apr 2012 08:56:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204130856.q3D8uNfA069291@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 08:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234220 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 08:56:23 -0000 Author: adrian Date: Fri Apr 13 08:56:23 2012 New Revision: 234220 URL: http://svn.freebsd.org/changeset/base/234220 Log: These are uboot, so mark them as such or booting from flash will not work. Modified: head/sys/mips/conf/AP94 head/sys/mips/conf/AP96 Modified: head/sys/mips/conf/AP94 ============================================================================== --- head/sys/mips/conf/AP94 Fri Apr 13 08:52:25 2012 (r234219) +++ head/sys/mips/conf/AP94 Fri Apr 13 08:56:23 2012 (r234220) @@ -25,6 +25,8 @@ options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" options AR71XX_REALMEM=32*1024*1024 +options AR71XX_ENV_UBOOT + # options MD_ROOT # options MD_ROOT_SIZE="6144" Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Fri Apr 13 08:52:25 2012 (r234219) +++ head/sys/mips/conf/AP96 Fri Apr 13 08:56:23 2012 (r234220) @@ -25,6 +25,8 @@ options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" options AR71XX_REALMEM=64*1024*1024 +options AR71XX_ENV_UBOOT + # options MD_ROOT # options MD_ROOT_SIZE="6144" From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 09:54:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 496D71065670; Fri, 13 Apr 2012 09:54:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 341D48FC15; Fri, 13 Apr 2012 09:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3D9sbRj071208; Fri, 13 Apr 2012 09:54:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3D9sbFP071206; Fri, 13 Apr 2012 09:54:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201204130954.q3D9sbFP071206@svn.freebsd.org> From: Glen Barber Date: Fri, 13 Apr 2012 09:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234221 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 09:54:37 -0000 Author: gjb (doc committer) Date: Fri Apr 13 09:54:36 2012 New Revision: 234221 URL: http://svn.freebsd.org/changeset/base/234221 Log: Belatedly add my entry to the calendar file, now that 30 is here and gone. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 13 08:56:23 2012 (r234220) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Apr 13 09:54:36 2012 (r234221) @@ -126,6 +126,7 @@ 04/12 Ed Schouten born in Oss, the Netherlands, 1986 04/13 Oliver Braun born in Nuremberg, Bavaria, Germany, 1972 04/14 Crist J. Clark born in Milwaukee, Wisconsin, United States, 1970 +04/14 Glen J. Barber born in Wilkes-Barre, Pennsylvania, United States, 1981 04/15 David Malone born in Dublin, Ireland, 1973 04/17 Dryice Liu born in Jinan, Shandong, China, 1975 04/22 Joerg Wunsch born in Dresden, Sachsen, Germany, 1962 From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 15:33:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0352106566B; Fri, 13 Apr 2012 15:33:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC2A08FC15; Fri, 13 Apr 2012 15:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DFXCUk086053; Fri, 13 Apr 2012 15:33:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DFXCN9086051; Fri, 13 Apr 2012 15:33:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204131533.q3DFXCN9086051@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Apr 2012 15:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234225 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 15:33:12 -0000 Author: luigi Date: Fri Apr 13 15:33:12 2012 New Revision: 234225 URL: http://svn.freebsd.org/changeset/base/234225 Log: do not use a deprecated field in a structure. Modified: head/sys/dev/netmap/if_re_netmap.h Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Fri Apr 13 14:36:57 2012 (r234224) +++ head/sys/dev/netmap/if_re_netmap.h Fri Apr 13 15:33:12 2012 (r234225) @@ -284,7 +284,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in for (n = 0; j != k; n++) { struct netmap_slot *slot = ring->slot + j; struct rl_desc *desc = &sc->rl_ldata.rl_rx_list[l]; - int cmd = na->buff_size | RL_RDESC_CMD_OWN; + int cmd = NETMAP_BUF_SIZE | RL_RDESC_CMD_OWN; uint64_t paddr; void *addr = PNMB(slot, &paddr); @@ -391,7 +391,7 @@ re_netmap_rx_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_desc[i].rx_dmamap, BUS_DMASYNC_PREREAD); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc[i].rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); - cmdstat = na->buff_size; + cmdstat = NETMAP_BUF_SIZE; if (i == n - 1) /* mark the end of ring */ cmdstat |= RL_RDESC_CMD_EOR; if (i < max_avail) From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 16:03:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C188106564A; Fri, 13 Apr 2012 16:03:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 754C28FC0C; Fri, 13 Apr 2012 16:03:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DG38dk087229; Fri, 13 Apr 2012 16:03:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DG38gK087221; Fri, 13 Apr 2012 16:03:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204131603.q3DG38gK087221@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Apr 2012 16:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234227 - in head: sys/dev/netmap sys/net tools/tools/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 16:03:08 -0000 Author: luigi Date: Fri Apr 13 16:03:07 2012 New Revision: 234227 URL: http://svn.freebsd.org/changeset/base/234227 Log: A bit of cleanup in the names of fields of netmap-related structures. Use the name 'ring' instead of 'queue' in all fields. Bump NETMAP_API. Modified: head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem1.c head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/bridge.c Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/dev/netmap/ixgbe_netmap.h Fri Apr 13 16:03:07 2012 (r234227) @@ -63,6 +63,9 @@ * This is tricky, much better to use TDH for now. */ SYSCTL_DECL(_dev_netmap); +static int ix_write_len; +SYSCTL_INT(_dev_netmap, OID_AUTO, ix_write_len, + CTLFLAG_RW, &ix_write_len, 0, "write rx len"); static int ix_rx_miss, ix_rx_miss_bufs, ix_use_dd, ix_crcstrip; SYSCTL_INT(_dev_netmap, OID_AUTO, ix_crcstrip, CTLFLAG_RW, &ix_crcstrip, 0, "strip CRC on rx frames"); @@ -121,6 +124,9 @@ set_crcstrip(struct ixgbe_hw *hw, int on hl = IXGBE_READ_REG(hw, IXGBE_HLREG0); rxc = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); + if (netmap_verbose) + D("%s read HLREG 0x%x rxc 0x%x", + onoff ? "enter" : "exit", hl, rxc); /* hw requirements ... */ rxc &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; rxc |= IXGBE_RDRXCTL_RSCACKC; @@ -133,6 +139,9 @@ set_crcstrip(struct ixgbe_hw *hw, int on hl |= IXGBE_HLREG0_RXCRCSTRP; rxc |= IXGBE_RDRXCTL_CRCSTRIP; } + if (netmap_verbose) + D("%s write HLREG 0x%x rxc 0x%x", + onoff ? "enter" : "exit", hl, rxc); IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hl); IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc); } @@ -479,7 +488,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * of CRCSTRIP. The data sheets say differently. * Very strange. */ - int crclen = 0; // ix_crcstrip ? 0 : 4; + int crclen = ix_crcstrip ? 0 : 4; l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); @@ -490,6 +499,8 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u if ((staterr & IXGBE_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; + if (ix_write_len) + D("rx[%d] len %d", j, ring->slot[j].len); bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/dev/netmap/netmap.c Fri Apr 13 16:03:07 2012 (r234227) @@ -173,21 +173,21 @@ netmap_dtor_locked(void *data) /* Wake up any sleeping threads. netmap_poll will * then return POLLERR */ - for (i = 0; i < na->num_tx_queues + 1; i++) + for (i = 0; i < na->num_tx_rings + 1; i++) selwakeuppri(&na->tx_rings[i].si, PI_NET); - for (i = 0; i < na->num_rx_queues + 1; i++) + for (i = 0; i < na->num_rx_rings + 1; i++) selwakeuppri(&na->rx_rings[i].si, PI_NET); selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); /* release all buffers */ NMA_LOCK(); - for (i = 0; i < na->num_tx_queues + 1; i++) { + for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; lim = na->tx_rings[i].nkr_num_slots; for (j = 0; j < lim; j++) netmap_free_buf(nifp, ring->slot[j].buf_idx); } - for (i = 0; i < na->num_rx_queues + 1; i++) { + for (i = 0; i < na->num_rx_rings + 1; i++) { struct netmap_ring *ring = na->rx_rings[i].ring; lim = na->rx_rings[i].nkr_num_slots; for (j = 0; j < lim; j++) @@ -260,7 +260,7 @@ netmap_mmap(__unused struct cdev *dev, static void netmap_sync_to_host(struct netmap_adapter *na) { - struct netmap_kring *kring = &na->tx_rings[na->num_tx_queues]; + struct netmap_kring *kring = &na->tx_rings[na->num_tx_rings]; struct netmap_ring *ring = kring->ring; struct mbuf *head = NULL, *tail = NULL, *m; u_int k, n, lim = kring->nkr_num_slots - 1; @@ -320,7 +320,7 @@ netmap_sync_to_host(struct netmap_adapte static void netmap_sync_from_host(struct netmap_adapter *na, struct thread *td) { - struct netmap_kring *kring = &na->rx_rings[na->num_rx_queues]; + struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; struct netmap_ring *ring = kring->ring; u_int j, n, lim = kring->nkr_num_slots; u_int k = ring->cur, resvd = ring->reserved; @@ -415,7 +415,7 @@ netmap_ring_reinit(struct netmap_kring * } if (errors) { int pos = kring - kring->na->tx_rings; - int n = kring->na->num_tx_queues + 1; + int n = kring->na->num_tx_rings + 1; D("total %d errors", errors); errors++; @@ -443,10 +443,10 @@ netmap_set_ringid(struct netmap_priv_d * u_int i = ringid & NETMAP_RING_MASK; /* initially (np_qfirst == np_qlast) we don't want to lock */ int need_lock = (priv->np_qfirst != priv->np_qlast); - int lim = na->num_rx_queues; + int lim = na->num_rx_rings; - if (na->num_tx_queues > lim) - lim = na->num_tx_queues; + if (na->num_tx_rings > lim) + lim = na->num_tx_rings; if ( (ringid & NETMAP_HW_RING) && i >= lim) { D("invalid ring id %d", i); return (EINVAL); @@ -531,8 +531,8 @@ netmap_ioctl(__unused struct cdev *dev, if (error) break; na = NA(ifp); /* retrieve netmap_adapter */ - nmr->nr_rx_rings = na->num_rx_queues; - nmr->nr_tx_rings = na->num_tx_queues; + nmr->nr_rx_rings = na->num_rx_rings; + nmr->nr_tx_rings = na->num_tx_rings; nmr->nr_rx_slots = na->num_rx_desc; nmr->nr_tx_slots = na->num_tx_desc; if_rele(ifp); /* return the refcount */ @@ -619,8 +619,8 @@ error: } /* return the offset of the netmap_if object */ - nmr->nr_rx_rings = na->num_rx_queues; - nmr->nr_tx_rings = na->num_tx_queues; + nmr->nr_rx_rings = na->num_rx_rings; + nmr->nr_tx_rings = na->num_tx_rings; nmr->nr_rx_slots = na->num_rx_desc; nmr->nr_tx_slots = na->num_tx_desc; nmr->nr_memsize = nm_mem->nm_totalsize; @@ -657,7 +657,7 @@ error: lim = priv->np_qlast; if (lim == NETMAP_HW_RING) lim = (cmd == NIOCTXSYNC) ? - na->num_tx_queues : na->num_rx_queues; + na->num_tx_rings : na->num_rx_rings; for (i = priv->np_qfirst; i < lim; i++) { if (cmd == NIOCTXSYNC) { @@ -742,8 +742,8 @@ netmap_poll(__unused struct cdev *dev, i na = NA(ifp); /* retrieve netmap adapter */ - lim_tx = na->num_tx_queues; - lim_rx = na->num_rx_queues; + lim_tx = na->num_tx_rings; + lim_rx = na->num_rx_rings; /* how many queues we are scanning */ if (priv->np_qfirst == NETMAP_SW_RING) { if (priv->np_txpoll || want_tx) { @@ -965,7 +965,7 @@ netmap_lock_wrapper(struct ifnet *dev, i * kring N+1 is only used for the selinfo for all queues. * Return 0 on success, ENOMEM otherwise. * - * na->num_tx_queues can be set for cards with different tx/rx setups + * na->num_tx_rings can be set for cards with different tx/rx setups */ int netmap_attach(struct netmap_adapter *na, int num_queues) @@ -980,22 +980,21 @@ netmap_attach(struct netmap_adapter *na, } /* clear other fields ? */ na->refcount = 0; - if (na->num_tx_queues == 0) - na->num_tx_queues = num_queues; - na->num_rx_queues = num_queues; + if (na->num_tx_rings == 0) + na->num_tx_rings = num_queues; + na->num_rx_rings = num_queues; /* on each direction we have N+1 resources * 0..n-1 are the hardware rings * n is the ring attached to the stack. */ - n = na->num_rx_queues + na->num_tx_queues + 2; + n = na->num_rx_rings + na->num_tx_rings + 2; size = sizeof(*na) + n * sizeof(struct netmap_kring); buf = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); if (buf) { WNA(ifp) = buf; na->tx_rings = (void *)((char *)buf + sizeof(*na)); - na->rx_rings = na->tx_rings + na->num_tx_queues + 1; - na->buff_size = NETMAP_BUF_SIZE; + na->rx_rings = na->tx_rings + na->num_tx_rings + 1; bcopy(na, buf, sizeof(*na)); ifp->if_capabilities |= IFCAP_NETMAP; @@ -1003,9 +1002,9 @@ netmap_attach(struct netmap_adapter *na, if (na->nm_lock == NULL) na->nm_lock = netmap_lock_wrapper; mtx_init(&na->core_lock, "netmap core lock", NULL, MTX_DEF); - for (i = 0 ; i < na->num_tx_queues + 1; i++) + for (i = 0 ; i < na->num_tx_rings + 1; i++) mtx_init(&na->tx_rings[i].q_lock, "netmap txq lock", NULL, MTX_DEF); - for (i = 0 ; i < na->num_rx_queues + 1; i++) + for (i = 0 ; i < na->num_rx_rings + 1; i++) mtx_init(&na->rx_rings[i].q_lock, "netmap rxq lock", NULL, MTX_DEF); } #ifdef linux @@ -1033,11 +1032,11 @@ netmap_detach(struct ifnet *ifp) if (!na) return; - for (i = 0; i < na->num_tx_queues + 1; i++) { + for (i = 0; i < na->num_tx_rings + 1; i++) { knlist_destroy(&na->tx_rings[i].si.si_note); mtx_destroy(&na->tx_rings[i].q_lock); } - for (i = 0; i < na->num_rx_queues + 1; i++) { + for (i = 0; i < na->num_rx_rings + 1; i++) { knlist_destroy(&na->rx_rings[i].si.si_note); mtx_destroy(&na->rx_rings[i].q_lock); } @@ -1058,7 +1057,7 @@ int netmap_start(struct ifnet *ifp, struct mbuf *m) { struct netmap_adapter *na = NA(ifp); - struct netmap_kring *kring = &na->rx_rings[na->num_rx_queues]; + struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; u_int i, len = MBUF_LEN(m); int error = EBUSY, lim = kring->nkr_num_slots - 1; struct netmap_slot *slot; @@ -1085,7 +1084,7 @@ netmap_start(struct ifnet *ifp, struct m slot->len = len; kring->nr_hwavail++; if (netmap_verbose & NM_VERB_HOST) - D("wake up host ring %s %d", na->ifp->if_xname, na->num_rx_queues); + D("wake up host ring %s %d", na->ifp->if_xname, na->num_rx_rings); selwakeuppri(&kring->si, PI_NET); error = 0; done: @@ -1174,10 +1173,10 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (work_done) { /* RX path */ r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; - main_wq = (na->num_rx_queues > 1) ? &na->rx_si : NULL; + main_wq = (na->num_rx_rings > 1) ? &na->rx_si : NULL; } else { /* tx path */ r = na->tx_rings + q; - main_wq = (na->num_tx_queues > 1) ? &na->tx_si : NULL; + main_wq = (na->num_tx_rings > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ } if (na->separate_locks) { Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/dev/netmap/netmap_kern.h Fri Apr 13 16:03:07 2012 (r234227) @@ -34,6 +34,8 @@ #ifndef _NET_NETMAP_KERN_H_ #define _NET_NETMAP_KERN_H_ +#define NETMAP_MEM2 // use the new memory allocator + #if defined(__FreeBSD__) #define NM_LOCK_T struct mtx #define NM_SELINFO_T struct selinfo @@ -104,20 +106,25 @@ struct netmap_adapter { int refcount; /* number of user-space descriptors using this interface, which is equal to the number of struct netmap_if objs in the mapped region. */ + /* + * The selwakeup in the interrupt thread can use per-ring + * and/or global wait queues. We track how many clients + * of each type we have so we can optimize the drivers, + * and especially avoid huge contention on the locks. + */ + int na_single; /* threads attached to a single hw queue */ + int na_multi; /* threads attached to multiple hw queues */ int separate_locks; /* set if the interface suports different locks for rx, tx and core. */ - u_int num_rx_queues; /* number of tx/rx queue pairs: this is - a duplicate field needed to simplify the - signature of ``netmap_detach``. */ - u_int num_tx_queues; // if nonzero, overrides num_queues XXX + u_int num_rx_rings; /* number of tx/rx ring pairs */ + u_int num_tx_rings; // if nonzero, overrides num_rx_rings u_int num_tx_desc; /* number of descriptor in each queue */ u_int num_rx_desc; - u_int buff_size; // XXX deprecate, use NETMAP_BUF_SIZE + //u_int buff_size; // XXX deprecate, use NETMAP_BUF_SIZE - //u_int flags; // XXX unused /* tx_rings and rx_rings are private but allocated * as a contiguous chunk of memory. Each array has * N+1 entries, for the adapter queues and for the host queue. @@ -129,9 +136,7 @@ struct netmap_adapter { /* copy of if_qflush and if_transmit pointers, to intercept * packets from the network stack when netmap is active. - * XXX probably if_qflush is not necessary. */ - //void (*if_qflush)(struct ifnet *); // XXX unused int (*if_transmit)(struct ifnet *, struct mbuf *); /* references to the ifnet and device routines, used by @@ -294,6 +299,21 @@ netmap_idx_k2n(struct netmap_kring *kr, } +#ifdef NETMAP_MEM2 +/* Entries of the look-up table. */ +struct lut_entry { + void *vaddr; /* virtual address. */ + vm_paddr_t paddr; /* phisical address. */ +}; + +struct netmap_obj_pool; +extern struct lut_entry *netmap_buffer_lut; +#define NMB_VA(i) (netmap_buffer_lut[i].vaddr) +#define NMB_PA(i) (netmap_buffer_lut[i].paddr) +#else /* NETMAP_MEM1 */ +#define NMB_VA(i) (netmap_buffer_base + (i * NETMAP_BUF_SIZE) ) +#endif /* NETMAP_MEM2 */ + /* * NMB return the virtual address of a buffer (buffer 0 on bad index) * PNMB also fills the physical address @@ -302,17 +322,19 @@ static inline void * NMB(struct netmap_slot *slot) { uint32_t i = slot->buf_idx; - return (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i * NETMAP_BUF_SIZE); + return (i >= netmap_total_buffers) ? NMB_VA(0) : NMB_VA(i); } static inline void * PNMB(struct netmap_slot *slot, uint64_t *pp) { uint32_t i = slot->buf_idx; - void *ret = (i >= netmap_total_buffers) ? netmap_buffer_base : - netmap_buffer_base + (i * NETMAP_BUF_SIZE); + void *ret = (i >= netmap_total_buffers) ? NMB_VA(0) : NMB_VA(i); +#ifdef NETMAP_MEM2 + *pp = (i >= netmap_total_buffers) ? NMB_PA(0) : NMB_PA(i); +#else *pp = vtophys(ret); +#endif return ret; } Modified: head/sys/dev/netmap/netmap_mem1.c ============================================================================== --- head/sys/dev/netmap/netmap_mem1.c Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/dev/netmap/netmap_mem1.c Fri Apr 13 16:03:07 2012 (r234227) @@ -280,8 +280,8 @@ netmap_if_new(const char *ifname, struct struct netmap_kring *kring; char *buff; u_int i, len, ofs, numdesc; - u_int nrx = na->num_rx_queues + 1; /* shorthand, include stack queue */ - u_int ntx = na->num_tx_queues + 1; /* shorthand, include stack queue */ + u_int nrx = na->num_rx_rings + 1; /* shorthand, include stack queue */ + u_int ntx = na->num_tx_rings + 1; /* shorthand, include stack queue */ /* * the descriptor is followed inline by an array of offsets @@ -293,8 +293,8 @@ netmap_if_new(const char *ifname, struct return (NULL); /* initialize base fields */ - *(int *)(uintptr_t)&nifp->ni_rx_queues = na->num_rx_queues; - *(int *)(uintptr_t)&nifp->ni_tx_queues = na->num_tx_queues; + *(int *)(uintptr_t)&nifp->ni_rx_rings = na->num_rx_rings; + *(int *)(uintptr_t)&nifp->ni_tx_rings = na->num_tx_rings; strncpy(nifp->ni_name, ifname, IFNAMSIZ); (na->refcount)++; /* XXX atomic ? we are under lock */ Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/net/netmap.h Fri Apr 13 16:03:07 2012 (r234227) @@ -83,8 +83,8 @@ / | cur | NETMAP_IF (nifp, one per file desc.) / | avail | +---------------+ / | buf_ofs | - | ni_num_queues | / +=============+ - | | / | buf_idx | slot[0] + | ni_tx_rings | / +=============+ + | ni_rx_rings | / | buf_idx | slot[0] | | / | len, flags | | | / +-------------+ +===============+ / | buf_idx | slot[1] @@ -221,8 +221,8 @@ struct netmap_ring { struct netmap_if { char ni_name[IFNAMSIZ]; /* name of the interface. */ const u_int ni_version; /* API version, currently unused */ - const u_int ni_rx_queues; /* number of rx queue pairs */ - const u_int ni_tx_queues; /* if zero, same as ni_tx_queues */ + const u_int ni_rx_rings; /* number of rx rings */ + const u_int ni_tx_rings; /* if zero, same as ni_rx_rings */ /* * The following array contains the offset of each netmap ring * from this structure. The first ni_tx_queues+1 entries refer @@ -257,7 +257,7 @@ struct netmap_if { struct nmreq { char nr_name[IFNAMSIZ]; uint32_t nr_version; /* API version */ -#define NETMAP_API 2 /* current version */ +#define NETMAP_API 3 /* current version */ uint32_t nr_offset; /* nifp offset in the shared region */ uint32_t nr_memsize; /* size of the shared region */ uint32_t nr_tx_slots; /* slots in tx rings */ Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Fri Apr 13 15:43:42 2012 (r234226) +++ head/sys/net/netmap_user.h Fri Apr 13 16:03:07 2012 (r234227) @@ -70,7 +70,7 @@ #define NETMAP_RXRING(nifp, index) \ ((struct netmap_ring *)((char *)(nifp) + \ - (nifp)->ring_ofs[index + (nifp)->ni_tx_queues+1] ) ) + (nifp)->ring_ofs[index + (nifp)->ni_tx_rings + 1] ) ) #define NETMAP_BUF(ring, index) \ ((char *)(ring) + (ring)->buf_ofs + ((index)*(ring)->nr_buf_size)) Modified: head/tools/tools/netmap/bridge.c ============================================================================== --- head/tools/tools/netmap/bridge.c Fri Apr 13 15:43:42 2012 (r234226) +++ head/tools/tools/netmap/bridge.c Fri Apr 13 16:03:07 2012 (r234227) @@ -300,7 +300,7 @@ howmany(struct my_ring *me, int tx) if (0 && verbose && tot && !tx) D("ring %s %s %s has %d avail at %d", me->ifname, tx ? "tx": "rx", - me->end > me->nifp->ni_rx_queues ? + me->end >= me->nifp->ni_tx_rings ? // XXX who comes first ? "host":"net", tot, NETMAP_TXRING(me->nifp, me->begin)->cur); return tot; @@ -361,6 +361,8 @@ main(int argc, char **argv) } } + argc -= optind; + argv += optind; if (argc > 1) ifa = argv[1]; @@ -440,8 +442,8 @@ main(int argc, char **argv) D("Wait %d secs for link to come up...", wait_link); sleep(wait_link); D("Ready to go, %s 0x%x/%d <-> %s 0x%x/%d.", - me[0].ifname, me[0].queueid, me[0].nifp->ni_rx_queues, - me[1].ifname, me[1].queueid, me[1].nifp->ni_rx_queues); + me[0].ifname, me[0].queueid, me[0].nifp->ni_rx_rings, + me[1].ifname, me[1].queueid, me[1].nifp->ni_rx_rings); /* main loop */ signal(SIGINT, sigint_h); From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 16:32:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87664106564A; Fri, 13 Apr 2012 16:32:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70C958FC14; Fri, 13 Apr 2012 16:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DGWXc2088241; Fri, 13 Apr 2012 16:32:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DGWXqj088240; Fri, 13 Apr 2012 16:32:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204131632.q3DGWXqj088240@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Apr 2012 16:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234228 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 16:32:33 -0000 Author: luigi Date: Fri Apr 13 16:32:33 2012 New Revision: 234228 URL: http://svn.freebsd.org/changeset/base/234228 Log: add the new memory allocator for netmap, which allocates memory in small clusters instead of one big contiguous chunk. This was already enabled in the previous commit. Added: head/sys/dev/netmap/netmap_mem2.c (contents, props changed) Added: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/netmap_mem2.c Fri Apr 13 16:32:33 2012 (r234228) @@ -0,0 +1,720 @@ +/* + * Copyright (C) 2012 Matteo Landi, Luigi Rizzo. 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. + */ + +/* + * $FreeBSD$ + * $Id: netmap_mem2.c 10830 2012-03-22 18:06:01Z luigi $ + * + * New memory allocator for netmap + */ + +/* + * The new version allocates three regions: + * nm_if_pool for the struct netmap_if + * nm_ring_pool for the struct netmap_ring + * nm_buf_pool for the packet buffers. + * + * All regions need to be page-sized as we export them to + * userspace through mmap. Only the latter need to be dma-able, + * but for convenience use the same type of allocator for all. + * + * Once mapped, the three regions are exported to userspace + * as a contiguous block, starting from nm_if_pool. Each + * cluster (and pool) is an integral number of pages. + * [ . . . ][ . . . . . .][ . . . . . . . . . .] + * nm_if nm_ring nm_buf + * + * The userspace areas contain offsets of the objects in userspace. + * When (at init time) we write these offsets, we find out the index + * of the object, and from there locate the offset from the beginning + * of the region. + * + * Allocator for a pool of memory objects of the same size. + * The pool is split into smaller clusters, whose size is a + * multiple of the page size. The cluster size is chosen + * to minimize the waste for a given max cluster size + * (we do it by brute force, as we have relatively few object + * per cluster). + * + * To be polite with the cache, objects are aligned to + * the cache line, or 64 bytes. Sizes are rounded to multiple of 64. + * For each object we have + * one entry in the bitmap to signal the state. Allocation scans + * the bitmap, but since this is done only on attach, we are not + * too worried about performance + */ + +/* + * MEMORY SIZES: + * + * (all the parameters below will become tunables) + * + * struct netmap_if is variable size but small. + * Assuming each NIC has 8+2 rings, (4+1 tx, 4+1 rx) the netmap_if + * uses 120 bytes on a 64-bit machine. + * We allocate NETMAP_IF_MAX_SIZE (1024) which should work even for + * cards with 48 ring pairs. + * The total number of 'struct netmap_if' could be slightly larger + * that the total number of rings on all interfaces on the system. + */ +#define NETMAP_IF_MAX_SIZE 1024 +#define NETMAP_IF_MAX_NUM 512 + +/* + * netmap rings are up to 2..4k descriptors, 8 bytes each, + * plus some glue at the beginning (32 bytes). + * We set the default ring size to 9 pages (36K) and enable + * a few hundreds of them. + */ +#define NETMAP_RING_MAX_SIZE (9*PAGE_SIZE) +#define NETMAP_RING_MAX_NUM 200 /* approx 8MB */ + +/* + * Buffers: the more the better. Buffer size is NETMAP_BUF_SIZE, + * 2k or slightly less, aligned to 64 bytes. + * A large 10G interface can have 2k*18 = 36k buffers per interface, + * or about 72MB of memory. Up to us to use more. + */ +#ifndef CONSERVATIVE +#define NETMAP_BUF_MAX_NUM 100000 /* 200MB */ +#else /* CONSERVATIVE */ +#define NETMAP_BUF_MAX_NUM 20000 /* 40MB */ +#endif + + +struct netmap_obj_pool { + char name[16]; /* name of the allocator */ + u_int objtotal; /* actual total number of objects. */ + u_int objfree; /* number of free objects. */ + u_int clustentries; /* actual objects per cluster */ + + /* the total memory space is _numclusters*_clustsize */ + u_int _numclusters; /* how many clusters */ + u_int _clustsize; /* cluster size */ + u_int _objsize; /* actual object size */ + + u_int _memtotal; /* _numclusters*_clustsize */ + struct lut_entry *lut; /* virt,phys addresses, objtotal entries */ + uint32_t *bitmap; /* one bit per buffer, 1 means free */ +}; + +struct netmap_mem_d { + NM_LOCK_T nm_mtx; /* protect the allocator ? */ + u_int nm_totalsize; /* shorthand */ + + /* pointers to the three allocators */ + struct netmap_obj_pool *nm_if_pool; + struct netmap_obj_pool *nm_ring_pool; + struct netmap_obj_pool *nm_buf_pool; +}; + +struct lut_entry *netmap_buffer_lut; /* exported */ + + +/* + * Convert a userspace offset to a phisical address. + * XXX re-do in a simpler way. + * + * The idea here is to hide userspace applications the fact that pre-allocated + * memory is not contiguous, but fragmented across different clusters and + * smaller memory allocators. Consequently, first of all we need to find which + * allocator is owning provided offset, then we need to find out the physical + * address associated to target page (this is done using the look-up table. + */ +static inline vm_paddr_t +netmap_ofstophys(vm_offset_t offset) +{ + const struct netmap_obj_pool *p[] = { + nm_mem->nm_if_pool, + nm_mem->nm_ring_pool, + nm_mem->nm_buf_pool }; + int i; + vm_offset_t o = offset; + + + for (i = 0; i < 3; offset -= p[i]->_memtotal, i++) { + if (offset >= p[i]->_memtotal) + continue; + // XXX now scan the clusters + return p[i]->lut[offset / p[i]->_objsize].paddr + + offset % p[i]->_objsize; + } + D("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", o, + p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, + p[0]->_memtotal + p[1]->_memtotal + p[2]->_memtotal); + return 0; // XXX bad address +} + +/* + * we store objects by kernel address, need to find the offset + * within the pool to export the value to userspace. + * Algorithm: scan until we find the cluster, then add the + * actual offset in the cluster + */ +ssize_t +netmap_obj_offset(struct netmap_obj_pool *p, const void *vaddr) +{ + int i, k = p->clustentries, n = p->objtotal; + ssize_t ofs = 0; + + for (i = 0; i < n; i += k, ofs += p->_clustsize) { + const char *base = p->lut[i].vaddr; + ssize_t relofs = (const char *) vaddr - base; + + if (relofs < 0 || relofs > p->_clustsize) + continue; + + ofs = ofs + relofs; + ND("%s: return offset %d (cluster %d) for pointer %p", + p->name, ofs, i, vaddr); + return ofs; + } + D("address %p is not contained inside any cluster (%s)", + vaddr, p->name); + return 0; /* An error occurred */ +} + +/* Helper functions which convert virtual addresses to offsets */ +#define netmap_if_offset(v) \ + netmap_obj_offset(nm_mem->nm_if_pool, (v)) + +#define netmap_ring_offset(v) \ + (nm_mem->nm_if_pool->_memtotal + \ + netmap_obj_offset(nm_mem->nm_ring_pool, (v))) + +#define netmap_buf_offset(v) \ + (nm_mem->nm_if_pool->_memtotal + \ + nm_mem->nm_ring_pool->_memtotal + \ + netmap_obj_offset(nm_mem->nm_buf_pool, (v))) + + +static void * +netmap_obj_malloc(struct netmap_obj_pool *p, int len) +{ + uint32_t i = 0; /* index in the bitmap */ + uint32_t mask, j; /* slot counter */ + void *vaddr = NULL; + + if (len > p->_objsize) { + D("%s request size %d too large", p->name, len); + // XXX cannot reduce the size + return NULL; + } + + if (p->objfree == 0) { + D("%s allocator: run out of memory", p->name); + return NULL; + } + + /* termination is guaranteed by p->free */ + while (vaddr == NULL) { + uint32_t cur = p->bitmap[i]; + if (cur == 0) { /* bitmask is fully used */ + i++; + continue; + } + /* locate a slot */ + for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) + ; + + p->bitmap[i] &= ~mask; /* mark object as in use */ + p->objfree--; + + vaddr = p->lut[i * 32 + j].vaddr; + } + ND("%s allocator: allocated object @ [%d][%d]: vaddr %p", i, j, vaddr); + + return vaddr; +} + + +/* + * free by index, not by address + */ +static void +netmap_obj_free(struct netmap_obj_pool *p, uint32_t j) +{ + if (j >= p->objtotal) { + D("invalid index %u, max %u", j, p->objtotal); + return; + } + p->bitmap[j / 32] |= (1 << (j % 32)); + p->objfree++; + return; +} + +static void +netmap_obj_free_va(struct netmap_obj_pool *p, void *vaddr) +{ + int i, j, n = p->_memtotal / p->_clustsize; + + for (i = 0, j = 0; i < n; i++, j += p->clustentries) { + void *base = p->lut[i * p->clustentries].vaddr; + ssize_t relofs = (ssize_t) vaddr - (ssize_t) base; + + /* Given address, is out of the scope of the current cluster.*/ + if (vaddr < base || relofs > p->_clustsize) + continue; + + j = j + relofs / p->_objsize; + KASSERT(j != 0, ("Cannot free object 0")); + netmap_obj_free(p, j); + return; + } + ND("address %p is not contained inside any cluster (%s)", + vaddr, p->name); +} + +#define netmap_if_malloc(len) netmap_obj_malloc(nm_mem->nm_if_pool, len) +#define netmap_if_free(v) netmap_obj_free_va(nm_mem->nm_if_pool, (v)) +#define netmap_ring_malloc(len) netmap_obj_malloc(nm_mem->nm_ring_pool, len) +#define netmap_buf_malloc() \ + netmap_obj_malloc(nm_mem->nm_buf_pool, NETMAP_BUF_SIZE) + + +/* Return the index associated to the given packet buffer */ +#define netmap_buf_index(v) \ + (netmap_obj_offset(nm_mem->nm_buf_pool, (v)) / nm_mem->nm_buf_pool->_objsize) + + +static void +netmap_new_bufs(struct netmap_if *nifp __unused, + struct netmap_slot *slot, u_int n) +{ + struct netmap_obj_pool *p = nm_mem->nm_buf_pool; + uint32_t i = 0; /* slot counter */ + + for (i = 0; i < n; i++) { + void *vaddr = netmap_buf_malloc(); + if (vaddr == NULL) { + D("unable to locate empty packet buffer"); + goto cleanup; + } + + slot[i].buf_idx = netmap_buf_index(vaddr); + KASSERT(slot[i].buf_idx != 0, + ("Assigning buf_idx=0 to just created slot")); + slot[i].len = p->_objsize; + slot[i].flags = NS_BUF_CHANGED; // XXX GAETANO hack + } + + ND("allocated %d buffers, %d available", n, p->objfree); + return; + +cleanup: + for (i--; i >= 0; i--) { + netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); + } +} + + +static void +netmap_free_buf(struct netmap_if *nifp, uint32_t i) +{ + struct netmap_obj_pool *p = nm_mem->nm_buf_pool; + if (i < 2 || i >= p->objtotal) { + D("Cannot free buf#%d: should be in [2, %d[", i, p->objtotal); + return; + } + netmap_obj_free(nm_mem->nm_buf_pool, i); +} + + +/* + * Free all resources related to an allocator. + */ +static void +netmap_destroy_obj_allocator(struct netmap_obj_pool *p) +{ + if (p == NULL) + return; + if (p->bitmap) + free(p->bitmap, M_NETMAP); + if (p->lut) { + int i; + for (i = 0; i < p->objtotal; i += p->clustentries) { + if (p->lut[i].vaddr) + contigfree(p->lut[i].vaddr, p->_clustsize, M_NETMAP); + } + bzero(p->lut, sizeof(struct lut_entry) * p->objtotal); + free(p->lut, M_NETMAP); + } + bzero(p, sizeof(*p)); + free(p, M_NETMAP); +} + +/* + * We receive a request for objtotal objects, of size objsize each. + * Internally we may round up both numbers, as we allocate objects + * in small clusters multiple of the page size. + * In the allocator we don't need to store the objsize, + * but we do need to keep track of objtotal' and clustentries, + * as they are needed when freeing memory. + * + * XXX note -- userspace needs the buffers to be contiguous, + * so we cannot afford gaps at the end of a cluster. + */ +static struct netmap_obj_pool * +netmap_new_obj_allocator(const char *name, u_int objtotal, u_int objsize) +{ + struct netmap_obj_pool *p; + int i, n; + u_int clustsize; /* the cluster size, multiple of page size */ + u_int clustentries; /* how many objects per entry */ + +#define MAX_CLUSTSIZE (1<<17) +#define LINE_ROUND 64 + if (objsize >= MAX_CLUSTSIZE) { + /* we could do it but there is no point */ + D("unsupported allocation for %d bytes", objsize); + return NULL; + } + /* make sure objsize is a multiple of LINE_ROUND */ + i = (objsize & (LINE_ROUND - 1)); + if (i) { + D("XXX aligning object by %d bytes", LINE_ROUND - i); + objsize += LINE_ROUND - i; + } + /* + * Compute number of objects using a brute-force approach: + * given a max cluster size, + * we try to fill it with objects keeping track of the + * wasted space to the next page boundary. + */ + for (clustentries = 0, i = 1;; i++) { + u_int delta, used = i * objsize; + if (used > MAX_CLUSTSIZE) + break; + delta = used % PAGE_SIZE; + if (delta == 0) { // exact solution + clustentries = i; + break; + } + if (delta > ( (clustentries*objsize) % PAGE_SIZE) ) + clustentries = i; + } + // D("XXX --- ouch, delta %d (bad for buffers)", delta); + /* compute clustsize and round to the next page */ + clustsize = clustentries * objsize; + i = (clustsize & (PAGE_SIZE - 1)); + if (i) + clustsize += PAGE_SIZE - i; + D("objsize %d clustsize %d objects %d", + objsize, clustsize, clustentries); + + p = malloc(sizeof(struct netmap_obj_pool), M_NETMAP, + M_WAITOK | M_ZERO); + if (p == NULL) { + D("Unable to create '%s' allocator", name); + return NULL; + } + /* + * Allocate and initialize the lookup table. + * + * The number of clusters is n = ceil(objtotal/clustentries) + * objtotal' = n * clustentries + */ + strncpy(p->name, name, sizeof(p->name)); + p->clustentries = clustentries; + p->_clustsize = clustsize; + n = (objtotal + clustentries - 1) / clustentries; + p->_numclusters = n; + p->objtotal = n * clustentries; + p->objfree = p->objtotal - 2; /* obj 0 and 1 are reserved */ + p->_objsize = objsize; + p->_memtotal = p->_numclusters * p->_clustsize; + + p->lut = malloc(sizeof(struct lut_entry) * p->objtotal, + M_NETMAP, M_WAITOK | M_ZERO); + if (p->lut == NULL) { + D("Unable to create lookup table for '%s' allocator", name); + goto clean; + } + + /* Allocate the bitmap */ + n = (p->objtotal + 31) / 32; + p->bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, M_WAITOK | M_ZERO); + if (p->bitmap == NULL) { + D("Unable to create bitmap (%d entries) for allocator '%s'", n, + name); + goto clean; + } + + /* + * Allocate clusters, init pointers and bitmap + */ + for (i = 0; i < p->objtotal;) { + int lim = i + clustentries; + char *clust; + + clust = contigmalloc(clustsize, M_NETMAP, M_WAITOK | M_ZERO, + 0, -1UL, PAGE_SIZE, 0); + if (clust == NULL) { + /* + * If we get here, there is a severe memory shortage, + * so halve the allocated memory to reclaim some. + */ + D("Unable to create cluster at %d for '%s' allocator", + i, name); + lim = i / 2; + for (; i >= lim; i--) { + p->bitmap[ (i>>5) ] &= ~( 1 << (i & 31) ); + if (i % clustentries == 0 && p->lut[i].vaddr) + contigfree(p->lut[i].vaddr, + p->_clustsize, M_NETMAP); + } + p->objtotal = i; + p->objfree = p->objtotal - 2; + p->_numclusters = i / clustentries; + p->_memtotal = p->_numclusters * p->_clustsize; + break; + } + for (; i < lim; i++, clust += objsize) { + p->bitmap[ (i>>5) ] |= ( 1 << (i & 31) ); + p->lut[i].vaddr = clust; + p->lut[i].paddr = vtophys(clust); + } + } + p->bitmap[0] = ~3; /* objs 0 and 1 is always busy */ + D("Pre-allocated %d clusters (%d/%dKB) for '%s'", + p->_numclusters, p->_clustsize >> 10, + p->_memtotal >> 10, name); + + return p; + +clean: + netmap_destroy_obj_allocator(p); + return NULL; +} + +static int +netmap_memory_init(void) +{ + struct netmap_obj_pool *p; + + nm_mem = malloc(sizeof(struct netmap_mem_d), M_NETMAP, + M_WAITOK | M_ZERO); + if (nm_mem == NULL) + goto clean; + + p = netmap_new_obj_allocator("netmap_if", + NETMAP_IF_MAX_NUM, NETMAP_IF_MAX_SIZE); + if (p == NULL) + goto clean; + nm_mem->nm_if_pool = p; + + p = netmap_new_obj_allocator("netmap_ring", + NETMAP_RING_MAX_NUM, NETMAP_RING_MAX_SIZE); + if (p == NULL) + goto clean; + nm_mem->nm_ring_pool = p; + + p = netmap_new_obj_allocator("netmap_buf", + NETMAP_BUF_MAX_NUM, NETMAP_BUF_SIZE); + if (p == NULL) + goto clean; + netmap_total_buffers = p->objtotal; + netmap_buffer_lut = p->lut; + nm_mem->nm_buf_pool = p; + netmap_buffer_base = p->lut[0].vaddr; + + mtx_init(&nm_mem->nm_mtx, "netmap memory allocator lock", NULL, + MTX_DEF); + nm_mem->nm_totalsize = + nm_mem->nm_if_pool->_memtotal + + nm_mem->nm_ring_pool->_memtotal + + nm_mem->nm_buf_pool->_memtotal; + + D("Have %d KB for interfaces, %d KB for rings and %d MB for buffers", + nm_mem->nm_if_pool->_memtotal >> 10, + nm_mem->nm_ring_pool->_memtotal >> 10, + nm_mem->nm_buf_pool->_memtotal >> 20); + return 0; + +clean: + if (nm_mem) { + netmap_destroy_obj_allocator(nm_mem->nm_ring_pool); + netmap_destroy_obj_allocator(nm_mem->nm_if_pool); + free(nm_mem, M_NETMAP); + } + return ENOMEM; +} + + +static void +netmap_memory_fini(void) +{ + if (!nm_mem) + return; + netmap_destroy_obj_allocator(nm_mem->nm_if_pool); + netmap_destroy_obj_allocator(nm_mem->nm_ring_pool); + netmap_destroy_obj_allocator(nm_mem->nm_buf_pool); + mtx_destroy(&nm_mem->nm_mtx); + free(nm_mem, M_NETMAP); +} + + + +static void * +netmap_if_new(const char *ifname, struct netmap_adapter *na) +{ + struct netmap_if *nifp; + struct netmap_ring *ring; + ssize_t base; /* handy for relative offsets between rings and nifp */ + u_int i, len, ndesc; + u_int ntx = na->num_tx_rings + 1; /* shorthand, include stack ring */ + u_int nrx = na->num_rx_rings + 1; /* shorthand, include stack ring */ + struct netmap_kring *kring; + + NMA_LOCK(); + /* + * the descriptor is followed inline by an array of offsets + * to the tx and rx rings in the shared memory region. + */ + len = sizeof(struct netmap_if) + (nrx + ntx) * sizeof(ssize_t); + nifp = netmap_if_malloc(len); + if (nifp == NULL) { + NMA_UNLOCK(); + return NULL; + } + + /* initialize base fields -- override const */ + *(int *)(uintptr_t)&nifp->ni_tx_rings = na->num_tx_rings; + *(int *)(uintptr_t)&nifp->ni_rx_rings = na->num_rx_rings; + strncpy(nifp->ni_name, ifname, IFNAMSIZ); + + (na->refcount)++; /* XXX atomic ? we are under lock */ + if (na->refcount > 1) { /* already setup, we are done */ + NMA_UNLOCK(); + goto final; + } + + /* + * First instance, allocate netmap rings and buffers for this card + * The rings are contiguous, but have variable size. + */ + for (i = 0; i < ntx; i++) { /* Transmit rings */ + kring = &na->tx_rings[i]; + ndesc = na->num_tx_desc; + bzero(kring, sizeof(*kring)); + len = sizeof(struct netmap_ring) + + ndesc * sizeof(struct netmap_slot); + ring = netmap_ring_malloc(len); + if (ring == NULL) { + D("Cannot allocate tx_ring[%d] for %s", i, ifname); + goto cleanup; + } + ND("txring[%d] at %p ofs %d", i, ring); + kring->na = na; + kring->ring = ring; + *(int *)(uintptr_t)&ring->num_slots = kring->nkr_num_slots = ndesc; + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + (nm_mem->nm_if_pool->_memtotal + + nm_mem->nm_ring_pool->_memtotal) - + netmap_ring_offset(ring); + + /* + * IMPORTANT: + * Always keep one slot empty, so we can detect new + * transmissions comparing cur and nr_hwcur (they are + * the same only if there are no new transmissions). + */ + ring->avail = kring->nr_hwavail = ndesc - 1; + ring->cur = kring->nr_hwcur = 0; + *(int *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + ND("initializing slots for txring[%d]", i); + netmap_new_bufs(nifp, ring->slot, ndesc); + } + + for (i = 0; i < nrx; i++) { /* Receive rings */ + kring = &na->rx_rings[i]; + ndesc = na->num_rx_desc; + bzero(kring, sizeof(*kring)); + len = sizeof(struct netmap_ring) + + ndesc * sizeof(struct netmap_slot); + ring = netmap_ring_malloc(len); + if (ring == NULL) { + D("Cannot allocate rx_ring[%d] for %s", i, ifname); + goto cleanup; + } + ND("rxring[%d] at %p ofs %d", i, ring); + + kring->na = na; + kring->ring = ring; + *(int *)(uintptr_t)&ring->num_slots = kring->nkr_num_slots = ndesc; + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + (nm_mem->nm_if_pool->_memtotal + + nm_mem->nm_ring_pool->_memtotal) - + netmap_ring_offset(ring); + + ring->cur = kring->nr_hwcur = 0; + ring->avail = kring->nr_hwavail = 0; /* empty */ + *(int *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + ND("initializing slots for rxring[%d]", i); + netmap_new_bufs(nifp, ring->slot, ndesc); + } + NMA_UNLOCK(); +#ifdef linux + // XXX initialize the selrecord structs. + for (i = 0; i < ntx; i++) + init_waitqueue_head(&na->rx_rings[i].si); + for (i = 0; i < nrx; i++) + init_waitqueue_head(&na->tx_rings[i].si); + init_waitqueue_head(&na->rx_si); + init_waitqueue_head(&na->tx_si); +#endif +final: + /* + * fill the slots for the rx and tx rings. They contain the offset + * between the ring and nifp, so the information is usable in + * userspace to reach the ring from the nifp. + */ + base = netmap_if_offset(nifp); + for (i = 0; i < ntx; i++) { + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = + netmap_ring_offset(na->tx_rings[i].ring) - base; + } + for (i = 0; i < nrx; i++) { + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+ntx] = + netmap_ring_offset(na->rx_rings[i].ring) - base; + } + return (nifp); +cleanup: + // XXX missing + NMA_UNLOCK(); + return NULL; +} + +static void +netmap_free_rings(struct netmap_adapter *na) +{ + int i; + for (i = 0; i < na->num_tx_rings + 1; i++) + netmap_obj_free_va(nm_mem->nm_ring_pool, + na->tx_rings[i].ring); + for (i = 0; i < na->num_rx_rings + 1; i++) + netmap_obj_free_va(nm_mem->nm_ring_pool, + na->rx_rings[i].ring); +} From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 16:42:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2CC21065670; Fri, 13 Apr 2012 16:42:55 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81F478FC16; Fri, 13 Apr 2012 16:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DGgtPk088692; Fri, 13 Apr 2012 16:42:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DGgtnC088689; Fri, 13 Apr 2012 16:42:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204131642.q3DGgtnC088689@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Apr 2012 16:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234229 - in head/sys/dev: ixgbe netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 16:42:55 -0000 Author: luigi Date: Fri Apr 13 16:42:54 2012 New Revision: 234229 URL: http://svn.freebsd.org/changeset/base/234229 Log: Properly disable crc stripping when operating in netmap mode. Contrarily to what i wrote in my previous commit, the 82599 does include the CRC in the length. The operating mode is reset in ixgbe_init_locked() and so we need to hook into the places where the two registers (HLREG0 and RDRXCTL) are modified. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Apr 13 16:32:33 2012 (r234228) +++ head/sys/dev/ixgbe/ixgbe.c Fri Apr 13 16:42:54 2012 (r234229) @@ -3812,6 +3812,9 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); rdrxctl &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; +#ifdef DEV_NETMAP /* crcstrip is optional in netmap */ + if (adapter->ifp->if_capenable & IFCAP_NETMAP && !ix_crcstrip) +#endif /* DEV_NETMAP */ rdrxctl |= IXGBE_RDRXCTL_CRCSTRIP; rdrxctl |= IXGBE_RDRXCTL_RSCACKC; IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); @@ -4104,6 +4107,13 @@ ixgbe_initialize_receive_units(struct ad hlreg |= IXGBE_HLREG0_JUMBOEN; else hlreg &= ~IXGBE_HLREG0_JUMBOEN; +#ifdef DEV_NETMAP + /* crcstrip is conditional in netmap (in RDRXCTL too ?) */ + if (ifp->if_capenable & IFCAP_NETMAP && !ix_crcstrip) + hlreg &= ~IXGBE_HLREG0_RXCRCSTRP; + else + hlreg |= IXGBE_HLREG0_RXCRCSTRP; +#endif /* DEV_NETMAP */ IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); bufsz = (adapter->rx_mbuf_sz + Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Fri Apr 13 16:32:33 2012 (r234228) +++ head/sys/dev/netmap/ixgbe_netmap.h Fri Apr 13 16:42:54 2012 (r234229) @@ -112,13 +112,12 @@ static void set_crcstrip(struct ixgbe_hw *hw, int onoff) { /* crc stripping is set in two places: - * IXGBE_HLREG0 (left alone by the original driver) + * IXGBE_HLREG0 (modified on init_locked and hw reset) * IXGBE_RDRXCTL (set by the original driver in * ixgbe_setup_hw_rsc() called in init_locked. * We disable the setting when netmap is compiled in). - * When netmap is compiled in we disabling IXGBE_RDRXCTL - * modifications of the IXGBE_RDRXCTL_CRCSTRIP bit, and - * instead update the state here. + * We update the values here, but also in ixgbe.c because + * init_locked sometimes is called outside our control. */ uint32_t hl, rxc; From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 16:53:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45495106566B; Fri, 13 Apr 2012 16:53:01 +0000 (UTC) (envelope-from monthadar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 307138FC0C; Fri, 13 Apr 2012 16:53:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DGr1fI089078; Fri, 13 Apr 2012 16:53:01 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DGr0jm089076; Fri, 13 Apr 2012 16:53:01 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201204131653.q3DGr0jm089076@svn.freebsd.org> From: Monthadar Al Jaberi Date: Fri, 13 Apr 2012 16:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234230 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 16:53:01 -0000 Author: monthadar Date: Fri Apr 13 16:53:00 2012 New Revision: 234230 URL: http://svn.freebsd.org/changeset/base/234230 Log: Add myself as a new committer and add adrian as my mentor. Approved by: adrian (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Apr 13 16:42:54 2012 (r234229) +++ head/share/misc/committers-src.dot Fri Apr 13 16:53:00 2012 (r234230) @@ -195,6 +195,7 @@ mdodd [label="Matthew N. Dodd\nmdodd@Fre melifaro [label="Alexander V. Chernikov\nmelifaro@FreeBSD.org\n2011/10/04"] mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] +monthadar [label="Monthadar Al Jaberi\nmonthadar@FreeBSD.org\n2012/04/02"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] mux [label="Maxime Henrion\nmux@FreeBSD.org\n2002/03/03"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] @@ -280,6 +281,7 @@ day1 -> rgrimes day1 -> alm day1 -> dg +adrian -> monthadar adrian -> ray adrian -> rmh From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:00:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A677C1065672; Fri, 13 Apr 2012 18:00:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id 662958FC08; Fri, 13 Apr 2012 18:00:00 +0000 (UTC) Received: by dadz14 with SMTP id z14so13767026dad.17 for ; Fri, 13 Apr 2012 11:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=s//qjdlhlgeoVQ+/Ye3IwB0ETRDh34F7yhYtzThmI+g=; b=BwTvackWx1tdwhR201ZOtJBp5qq9J6hcaNzZyBfiSFz6rrSN0AwhJMlE2EmIxgNCUA mLXa9RflaYAmmiT6mkvqC5RXRerJUYvzEf1fvVMJLAr5djlKZVS/e3PUD0oDW5BU1rxT 1vqTrerrGJxiLGrbXROw44t3//AmVrVj5NISQvG0vbuN06SOawlg+k27n5xJ4IYnLLgs 5TmIo6m3sc6cDTwwp1au/N85VlzvCZgAU/Zu8Pnb191PJDfjcXiO2ORHLZWKZvL06LKv yeQejZuO71EWRTE7g1NEOoYI/VYXgeyb2uggWpjs4lz0/DKstqw0wmGVbnEyhmnncwXo MCNA== MIME-Version: 1.0 Received: by 10.68.204.228 with SMTP id lb4mr6520965pbc.37.1334339999969; Fri, 13 Apr 2012 10:59:59 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.142.101.9 with HTTP; Fri, 13 Apr 2012 10:59:59 -0700 (PDT) In-Reply-To: <201204131632.q3DGWXqj088240@svn.freebsd.org> References: <201204131632.q3DGWXqj088240@svn.freebsd.org> Date: Fri, 13 Apr 2012 10:59:59 -0700 X-Google-Sender-Auth: r8J-kOnJ2rGKArKqEoQLHxtECpY Message-ID: From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234228 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:00:00 -0000 On 13 April 2012 09:32, Luigi Rizzo wrote: > Author: luigi > Date: Fri Apr 13 16:32:33 2012 > New Revision: 234228 > URL: http://svn.freebsd.org/changeset/base/234228 > > Log: > =A0add the new memory allocator for netmap, which allocates memory > =A0in small clusters instead of one big contiguous chunk. > =A0This was already enabled in the previous commit. Hi, is there any scope to make this more generic? I can imagine other parts of the system wanting to use this kind of ring buffer to userland. adrian From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:00:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DDEA106564A; Fri, 13 Apr 2012 18:00:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 794EA8FC17; Fri, 13 Apr 2012 18:00:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DI0nQW091304; Fri, 13 Apr 2012 18:00:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DI0nOH091301; Fri, 13 Apr 2012 18:00:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204131800.q3DI0nOH091301@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 18:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234231 - in head/sys: conf dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:00:49 -0000 Author: adrian Date: Fri Apr 13 18:00:48 2012 New Revision: 234231 URL: http://svn.freebsd.org/changeset/base/234231 Log: Upgrade ATH_EEPROM_FIRMWARE to a configuration option. Modified: head/sys/conf/options head/sys/dev/ath/if_ath_pci.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Apr 13 16:53:00 2012 (r234230) +++ head/sys/conf/options Fri Apr 13 18:00:48 2012 (r234231) @@ -780,6 +780,7 @@ ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h ATH_ENABLE_11N opt_ath.h ATH_ENABLE_DFS opt_ath.h +ATH_EEPROM_FIRMWARE opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Fri Apr 13 16:53:00 2012 (r234230) +++ head/sys/dev/ath/if_ath_pci.c Fri Apr 13 18:00:48 2012 (r234231) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); /* * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver. */ +#include "opt_ath.h" #include #include @@ -60,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* #define ATH_EEPROM_FIRMWARE */ - /* For EEPROM firmware */ #ifdef ATH_EEPROM_FIRMWARE #include From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:01:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E3D3F1065670; Fri, 13 Apr 2012 18:01:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFA078FC1D; Fri, 13 Apr 2012 18:01:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DI1rfN091375; Fri, 13 Apr 2012 18:01:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DI1rEV091372; Fri, 13 Apr 2012 18:01:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204131801.q3DI1rEV091372@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234232 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:01:54 -0000 Author: adrian Date: Fri Apr 13 18:01:53 2012 New Revision: 234232 URL: http://svn.freebsd.org/changeset/base/234232 Log: * Enable ATH_EEPROM_FIRMWARE, now that it's a compile time option * Tidy up things a bit. Modified: head/sys/mips/conf/AP94 head/sys/mips/conf/AP96 Modified: head/sys/mips/conf/AP94 ============================================================================== --- head/sys/mips/conf/AP94 Fri Apr 13 18:00:48 2012 (r234231) +++ head/sys/mips/conf/AP94 Fri Apr 13 18:01:53 2012 (r234232) @@ -30,5 +30,6 @@ options AR71XX_ENV_UBOOT # options MD_ROOT # options MD_ROOT_SIZE="6144" -options AR71XX_ATH_EEPROM -device firmware +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Fri Apr 13 18:00:48 2012 (r234231) +++ head/sys/mips/conf/AP96 Fri Apr 13 18:01:53 2012 (r234232) @@ -30,5 +30,6 @@ options AR71XX_ENV_UBOOT # options MD_ROOT # options MD_ROOT_SIZE="6144" -options AR71XX_ATH_EEPROM -device firmware +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:12:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 599161065670; Fri, 13 Apr 2012 18:12:22 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 16ABD8FC0A; Fri, 13 Apr 2012 18:12:22 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 156DC7300B; Fri, 13 Apr 2012 20:31:38 +0200 (CEST) Date: Fri, 13 Apr 2012 20:31:38 +0200 From: Luigi Rizzo To: Adrian Chadd Message-ID: <20120413183138.GA88823@onelab2.iet.unipi.it> References: <201204131632.q3DGWXqj088240@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r234228 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:12:22 -0000 On Fri, Apr 13, 2012 at 10:59:59AM -0700, Adrian Chadd wrote: > On 13 April 2012 09:32, Luigi Rizzo wrote: > > Author: luigi > > Date: Fri Apr 13 16:32:33 2012 > > New Revision: 234228 > > URL: http://svn.freebsd.org/changeset/base/234228 > > > > Log: > > ?add the new memory allocator for netmap, which allocates memory > > ?in small clusters instead of one big contiguous chunk. > > ?This was already enabled in the previous commit. > > Hi, > > is there any scope to make this more generic? I can imagine other > parts of the system wanting to use this kind of ring buffer to > userland. well, it is already exported to userland through mmap. Perhaps you want to (a) have the buffers allocated on demand, and yes, this could also be done, either per-interface or globally. For instance the NIOCREGIF ioctl could specify how many buffers you want, and allocate them before you malloc. I still need to make up my mind on what is a good model for sharing buffers among different interfaces. cheers luigi From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:21:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17500106566B; Fri, 13 Apr 2012 18:21:57 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F25AD8FC14; Fri, 13 Apr 2012 18:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DILueL092019; Fri, 13 Apr 2012 18:21:56 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DILu0Q092008; Fri, 13 Apr 2012 18:21:56 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201204131821.q3DILu0Q092008@svn.freebsd.org> From: Josh Paetzel Date: Fri, 13 Apr 2012 18:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234233 - in head: sbin/iscontrol share/man/man4 sys/dev/iscsi/initiator sys/modules/iscsi/initiator X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:21:57 -0000 Author: jpaetzel Date: Fri Apr 13 18:21:56 2012 New Revision: 234233 URL: http://svn.freebsd.org/changeset/base/234233 Log: Update to version 2.3.1.0 Obtained from: Daniel Braniss Modified: head/sbin/iscontrol/Makefile head/sbin/iscontrol/iscontrol.8 head/sbin/iscontrol/iscontrol.c head/sbin/iscontrol/iscsi.conf.5 head/share/man/man4/iscsi_initiator.4 head/sys/dev/iscsi/initiator/isc_subr.c head/sys/dev/iscsi/initiator/iscsi.c head/sys/dev/iscsi/initiator/iscsi_subr.c head/sys/dev/iscsi/initiator/iscsivar.h head/sys/modules/iscsi/initiator/Makefile Modified: head/sbin/iscontrol/Makefile ============================================================================== --- head/sbin/iscontrol/Makefile Fri Apr 13 18:01:53 2012 (r234232) +++ head/sbin/iscontrol/Makefile Fri Apr 13 18:21:56 2012 (r234233) @@ -8,7 +8,7 @@ S= ${.CURDIR}/../../sys WARNS?= 3 CFLAGS += -I$S -#CFLAGS += -g -DDEBUG +CFLAGS += -g -DDEBUG MAN= iscsi.conf.5 iscontrol.8 Modified: head/sbin/iscontrol/iscontrol.8 ============================================================================== --- head/sbin/iscontrol/iscontrol.8 Fri Apr 13 18:01:53 2012 (r234232) +++ head/sbin/iscontrol/iscontrol.8 Fri Apr 13 18:21:56 2012 (r234233) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2007 +.Dd August 9, 2010 .Dt ISCONTROL 8 .Os .Sh NAME Modified: head/sbin/iscontrol/iscontrol.c ============================================================================== --- head/sbin/iscontrol/iscontrol.c Fri Apr 13 18:01:53 2012 (r234232) +++ head/sbin/iscontrol/iscontrol.c Fri Apr 13 18:21:56 2012 (r234233) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include "iscontrol.h" +static char version[] = "2.3.1"; // keep in sync with iscsi_initiator + #define USAGE "[-v] [-d] [-c config] [-n name] [-t target] [-p pidfile]" #define OPTIONS "vdc:t:n:p:" @@ -124,9 +126,10 @@ int main(int cc, char **vv) { int ch, disco; - char *pname, *pidfile, *p, *q, *ta, *kw; + char *pname, *pidfile, *p, *q, *ta, *kw, *v; isc_opt_t *op; FILE *fd; + size_t n; op = &opvals; iscsidev = "/dev/"ISCSIDEV; @@ -138,6 +141,21 @@ main(int cc, char **vv) kw = ta = 0; disco = 0; pidfile = NULL; + /* + | check for driver & controller version match + */ + n = 0; + if(sysctlbyname("net.iscsi_initiator.driver_version", 0, &n, 0, 0) != 0) + perror("sysctlbyname"); + v = malloc(n+1); + if(sysctlbyname("net.iscsi_initiator.driver_version", v, &n, 0, 0) != 0) + perror("sysctlbyname"); + + if(strncmp(version, v, 3)) { + fprintf(stderr, "versions missmatch\n"); + exit(1); + } + while((ch = getopt(cc, vv, OPTIONS)) != -1) { switch(ch) { Modified: head/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- head/sbin/iscontrol/iscsi.conf.5 Fri Apr 13 18:01:53 2012 (r234232) +++ head/sbin/iscontrol/iscsi.conf.5 Fri Apr 13 18:21:56 2012 (r234233) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 5, 2007 .Dt ISCSI.CONF 5 .Os .Sh NAME Modified: head/share/man/man4/iscsi_initiator.4 ============================================================================== --- head/share/man/man4/iscsi_initiator.4 Fri Apr 13 18:01:53 2012 (r234232) +++ head/share/man/man4/iscsi_initiator.4 Fri Apr 13 18:21:56 2012 (r234233) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007 Daniel Braniss +.\" Copyright (c) 2007-2010 Daniel Braniss .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,9 +24,9 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2010 -.Dt ISCSI_INITIATOR 4 +.Dd August 3, 2010 .Os +.Dt ISCSI_INITIATOR 4 .Sh NAME .Nm iscsi_initiator .Nd kernel driver for the iSCSI protocol @@ -48,38 +48,36 @@ iscsi_initiator_load="YES" The .Nm implements the kernel side of the Internet SCSI (iSCSI) network -protocol standard. -The userland companion is +protocol standard, the user land companion is .Xr iscontrol 8 , and permits access to remote .Em virtual SCSI devices via .Xr cam 4 . .Sh SYSCTL VARIABLES -.Bl -tag -width "net.iscsi.n.targedaddress" +.Bl -tag -width ".Va net.iscsi.n.targeaddress" .It Va debug.iscsi_initiator set the debug-level, 0 means no debugging, 9 for maximum. .It Va net.iscsi.isid the initiator part of the Session Identifier. -.El -.Pp -The following are informative only: -.Bl -tag -width "net.iscsi.n.targedaddress" +.It Va "kern.cam.cam_srch_hi=1" +allow search above LUN 7 for SCSI3 and greater devices. +.It "the following are informative only:" .It Va net.iscsi.driver_version the current version of the driver. .It Va net.iscsi.sessions the number of current active sessions. .It Va net.iscsi.n.targetname -the target name of session +is the targe name of session .Em n . -.It Va net.iscsi.n.targedaddress -the IP address of the target of session +.It Va net.iscsi.n.targeaddress +is the IP address of the target of session .Em n . .It Va net.iscsi.n.stats -statistics for session -.Em n +are some statistics for session +.EM n .It Va net.iscsi.n.pid -the +is the .Em "process id" of the userland side of session .Em n , @@ -87,11 +85,11 @@ see .Xr iscontrol 8 . .El .Sh FILES -The +The .Nm driver creates the following: -.Pp .Bl -tag -width ".Pa /dev/iscsi%dxx" -compact +.Pp .It Pa /dev/iscsi used to create new sessions. .It Pa /dev/iscsi%d @@ -105,5 +103,6 @@ for each new session. iSCSI RFC 3720 .\" .Sh HISTORY .\" .Sh AUTHORS +This software was written by Daniel Braniss .Sh BUGS The lun discovery method is old-fashioned. Modified: head/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_subr.c Fri Apr 13 18:01:53 2012 (r234232) +++ head/sys/dev/iscsi/initiator/isc_subr.c Fri Apr 13 18:21:56 2012 (r234233) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,104 @@ i_strdupin(char *s, size_t maxlen) return q; } +#if __FreeBSD_version < 800000 +/*****************************************************************/ +/* */ +/* CRC LOOKUP TABLE */ +/* ================ */ +/* The following CRC lookup table was generated automagically */ +/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ +/* Program V1.0 using the following model parameters: */ +/* */ +/* Width : 4 bytes. */ +/* Poly : 0x1EDC6F41L */ +/* Reverse : TRUE. */ +/* */ +/* For more information on the Rocksoft^tm Model CRC Algorithm, */ +/* see the document titled "A Painless Guide to CRC Error */ +/* Detection Algorithms" by Ross Williams */ +/* (ross@guest.adelaide.edu.au.). This document is likely to be */ +/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ +/* */ +/*****************************************************************/ + +static uint32_t crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, + 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, + 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, + 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, + 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, + 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, + 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, + 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, + 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, + 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, + 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, + 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, + 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, + 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, + 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, + 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, + 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, + 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, + 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, + 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, + 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, + 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, + 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, + 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, + 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, + 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, + 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, + 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, + 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, + 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, + 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, + 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, + 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, + 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, + 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, + 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, + 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, + 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, + 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, + 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, + 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, + 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, + 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, + 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, + 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, + 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, + 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, + 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, + 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, + 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, + 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L +}; + +static __inline int +calculate_crc32c(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p = buf; + + while (size--) + crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return crc; +} +#endif static uint32_t i_crc32c(const void *buf, size_t size, uint32_t crc) Modified: head/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi.c Fri Apr 13 18:01:53 2012 (r234232) +++ head/sys/dev/iscsi/initiator/iscsi.c Fri Apr 13 18:21:56 2012 (r234233) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -static char *iscsi_driver_version = "2.2.4.2"; +static char *iscsi_driver_version = "2.3.1"; static struct isc_softc *isc; @@ -231,8 +231,8 @@ iscsi_ioctl(struct cdev *dev, u_long cmd if(error == 0) { sp->proc = td->td_proc; SYSCTL_ADD_INT(&sp->clist, SYSCTL_CHILDREN(sp->oid), - OID_AUTO, "pid", CTLFLAG_RD, - &sp->proc->p_pid, sizeof(pid_t), "control process id"); + OID_AUTO, "pid", CTLFLAG_RD, + &sp->proc->p_pid, sizeof(pid_t), "control process id"); } break; @@ -290,8 +290,7 @@ iscsi_read(struct cdev *dev, struct uio sprintf(buf, "%03d] '%s' '%s'\n", i++, sp->opt.targetAddress, sp->opt.targetName); uiomove(buf, strlen(buf), uio); } - sprintf(buf, "%d/%d /---- free -----/\n", sc->npdu_alloc, sc->npdu_max); - i = 0; + sprintf(buf, "free npdu_alloc=%d, npdu_max=%d\n", sc->npdu_alloc, sc->npdu_max); uiomove(buf, strlen(buf), uio); } else { @@ -696,7 +695,6 @@ iscsi_shutdown(void *v) static void free_pdus(struct isc_softc *sc) { - debug_called(8); if(sc->pdu_zone != NULL) { @@ -777,6 +775,10 @@ iscsi_start(void) sizeof(isc->nsess), "number of active session"); +#ifdef ISCSI_INITIATOR_DEBUG + mtx_init(&iscsi_dbg_mtx, "iscsi_dbg", NULL, MTX_DEF); +#endif + printf("iscsi: version %s\n", iscsi_driver_version); } @@ -814,6 +816,11 @@ iscsi_stop(void) xdebug("sysctl_ctx_free failed"); iscsi_shutdown(isc); // XXX: check EVENTHANDLER_ ... + +#ifdef ISCSI_INITIATOR_DEBUG + mtx_destroy(&iscsi_dbg_mtx); +#endif + free(isc, M_ISCSI); } Modified: head/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- head/sys/dev/iscsi/initiator/iscsi_subr.c Fri Apr 13 18:01:53 2012 (r234232) +++ head/sys/dev/iscsi/initiator/iscsi_subr.c Fri Apr 13 18:21:56 2012 (r234233) @@ -154,7 +154,7 @@ getSenseData(u_int status, union ccb *cc scsi_rsp_t *cmd = &pp->ipdu.scsi_rsp; caddr_t bp; int sense_len, mustfree = 0; - int error_code, sense_key, asc, ascq; + int error_code, sense_key, asc, ascq; bp = mtod(pq->mp, caddr_t); if((sense_len = scsi_2btoul(bp)) == 0) @@ -176,9 +176,8 @@ getSenseData(u_int status, union ccb *cc scsi->sense_resid = 0; if(cmd->flag & (BIT(1)|BIT(2))) scsi->sense_resid = ntohl(pp->ipdu.scsi_rsp.rcnt); - scsi_extract_sense_len(sense, scsi->sense_len - scsi->sense_resid, - &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); + &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); debug(3, "sense_len=%d rcnt=%d sense_resid=%d dsl=%d error_code=%x flags=%x", sense_len, @@ -479,6 +478,8 @@ scsi_encap(struct cam_sim *sim, union cc cmd = &pq->pdu.ipdu.scsi_req; cmd->opcode = ISCSI_SCSI_CMD; cmd->F = 1; +#if 0 +// this breaks at least Isilon's iscsi target. /* | map tag option, default is UNTAGGED */ @@ -488,6 +489,9 @@ scsi_encap(struct cam_sim *sim, union cc case MSG_ORDERED_Q_TAG: cmd->attr = iSCSI_TASK_ORDER; break; case MSG_ACA_TASK: cmd->attr = iSCSI_TASK_ACA; break; } +#else + cmd->attr = iSCSI_TASK_SIMPLE; +#endif dwl(sp, ccb_h->target_lun, (u_char *)&cmd->lun); Modified: head/sys/dev/iscsi/initiator/iscsivar.h ============================================================================== --- head/sys/dev/iscsi/initiator/iscsivar.h Fri Apr 13 18:01:53 2012 (r234232) +++ head/sys/dev/iscsi/initiator/iscsivar.h Fri Apr 13 18:21:56 2012 (r234233) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -203,6 +203,8 @@ struct isc_softc { struct sx unit_sx; uma_zone_t pdu_zone; // pool of free pdu's + TAILQ_HEAD(,pduq) freepdu; + #ifdef ISCSI_INITIATOR_DEBUG int npdu_alloc, npdu_max; // for instrumentation #endif @@ -305,9 +307,11 @@ pdu_alloc(struct isc_softc *isc, int wai return NULL; } #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc++; if(isc->npdu_alloc > isc->npdu_max) isc->npdu_max = isc->npdu_alloc; + mtx_unlock(&iscsi_dbg_mtx); #endif memset(pq, 0, sizeof(pduq_t)); @@ -323,10 +327,12 @@ pdu_free(struct isc_softc *isc, pduq_t * if(pq->buf != NULL) free(pq->buf, M_ISCSIBUF); #endif + uma_zfree(isc->pdu_zone, pq); #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc--; + mtx_unlock(&iscsi_dbg_mtx); #endif - uma_zfree(isc->pdu_zone, pq); } static __inline void Modified: head/sys/modules/iscsi/initiator/Makefile ============================================================================== --- head/sys/modules/iscsi/initiator/Makefile Fri Apr 13 18:01:53 2012 (r234232) +++ head/sys/modules/iscsi/initiator/Makefile Fri Apr 13 18:21:56 2012 (r234233) @@ -1,14 +1,16 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../dev/iscsi/initiator +S= ${.CURDIR}/../../.. +.PATH: $S/dev/iscsi/initiator + KMOD=iscsi_initiator SRCS= iscsi.h iscsivar.h SRCS+= iscsi.c isc_cam.c isc_soc.c isc_sm.c isc_subr.c iscsi_subr.c SRCS+= opt_cam.h opt_iscsi_initiator.h SRCS+= bus_if.h device_if.h - -# Debugging -# CFLAGS+= -DISCSI_INITIATOR_DEBUG=9 - +#CFLAGS+= -DNO_USE_MBUF +CFLAGS+= -DISCSI_INITIATOR_DEBUG=2 +CFLAGS+= -I$S +CFLAGS+= -DINVARIANTS .include From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 19:07:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E412D106566C; Fri, 13 Apr 2012 19:07:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 43DA98FC0C; Fri, 13 Apr 2012 19:06:59 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q3DJ6oQP057236; Fri, 13 Apr 2012 22:06:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q3DJ6nHx080943; Fri, 13 Apr 2012 22:06:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q3DJ6nnk080942; Fri, 13 Apr 2012 22:06:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Apr 2012 22:06:49 +0300 From: Konstantin Belousov To: Josh Paetzel Message-ID: <20120413190649.GJ2358@deviant.kiev.zoral.com.ua> References: <201204131821.q3DILu0Q092008@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3qWxh0fJO+pQarUf" Content-Disposition: inline In-Reply-To: <201204131821.q3DILu0Q092008@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234233 - in head: sbin/iscontrol share/man/man4 sys/dev/iscsi/initiator sys/modules/iscsi/initiator X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 19:07:01 -0000 --3qWxh0fJO+pQarUf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 13, 2012 at 06:21:56PM +0000, Josh Paetzel wrote: > Author: jpaetzel > Date: Fri Apr 13 18:21:56 2012 > New Revision: 234233 > URL: http://svn.freebsd.org/changeset/base/234233 >=20 > Log: > Update to version 2.3.1.0 > =20 > Obtained from: Daniel Braniss >=20 > Modified: > head/sbin/iscontrol/Makefile > head/sbin/iscontrol/iscontrol.8 > head/sbin/iscontrol/iscontrol.c > head/sbin/iscontrol/iscsi.conf.5 > head/share/man/man4/iscsi_initiator.4 > head/sys/dev/iscsi/initiator/isc_subr.c > head/sys/dev/iscsi/initiator/iscsi.c > head/sys/dev/iscsi/initiator/iscsi_subr.c > head/sys/dev/iscsi/initiator/iscsivar.h > head/sys/modules/iscsi/initiator/Makefile >=20 > Modified: head/sbin/iscontrol/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/iscontrol/Makefile Fri Apr 13 18:01:53 2012 (r234232) > +++ head/sbin/iscontrol/Makefile Fri Apr 13 18:21:56 2012 (r234233) > @@ -8,7 +8,7 @@ S=3D ${.CURDIR}/../../sys > =20 > WARNS?=3D 3 > CFLAGS +=3D -I$S > -#CFLAGS +=3D -g -DDEBUG > +CFLAGS +=3D -g -DDEBUG > =20 Was this part intended ? > - > -# Debugging > -# CFLAGS+=3D -DISCSI_INITIATOR_DEBUG=3D9 > - > +#CFLAGS+=3D -DNO_USE_MBUF > +CFLAGS+=3D -DISCSI_INITIATOR_DEBUG=3D2 And this ? > +CFLAGS+=3D -I$S > +CFLAGS+=3D -DINVARIANTS > .include --3qWxh0fJO+pQarUf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+IeUkACgkQC3+MBN1Mb4gmjgCg2T15BrYdRzyvdx9J7wmd26pG 77gAnAvfL8ehKuveaIILMMh0OPi3pRfn =AmWr -----END PGP SIGNATURE----- --3qWxh0fJO+pQarUf-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 20:22:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF0A2106564A; Fri, 13 Apr 2012 20:22:08 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA8798FC0C; Fri, 13 Apr 2012 20:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DKM866095752; Fri, 13 Apr 2012 20:22:08 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DKM834095750; Fri, 13 Apr 2012 20:22:08 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201204132022.q3DKM834095750@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 13 Apr 2012 20:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234234 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 20:22:09 -0000 Author: gnn Date: Fri Apr 13 20:22:08 2012 New Revision: 234234 URL: http://svn.freebsd.org/changeset/base/234234 Log: Change SIGUSR1 to SIGTHR to properly wake up a process that is being traced. The use of SIGUSR1 caused traced processes (those attached to with dtrace -p) to exit when dtrace exited. MFC in: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Fri Apr 13 18:21:56 2012 (r234233) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Fri Apr 13 20:22:08 2012 (r234234) @@ -811,7 +811,7 @@ dt_proc_destroy(dtrace_hdl_t *dtp, struc #if defined(sun) (void) _lwp_kill(dpr->dpr_tid, SIGCANCEL); #else - pthread_kill(dpr->dpr_tid, SIGUSR1); + pthread_kill(dpr->dpr_tid, SIGTHR); #endif /* From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 20:23:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AA76C106566B; Fri, 13 Apr 2012 20:23:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAF58FC08; Fri, 13 Apr 2012 20:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DKNX5C095826; Fri, 13 Apr 2012 20:23:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DKNXuD095823; Fri, 13 Apr 2012 20:23:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204132023.q3DKNXuD095823@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 Apr 2012 20:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234235 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 20:23:33 -0000 Author: adrian Date: Fri Apr 13 20:23:32 2012 New Revision: 234235 URL: http://svn.freebsd.org/changeset/base/234235 Log: Flesh out the rest of the AP96 board/config. Modified: head/sys/mips/conf/AP96 head/sys/mips/conf/AP96.hints Modified: head/sys/mips/conf/AP96 ============================================================================== --- head/sys/mips/conf/AP96 Fri Apr 13 20:22:08 2012 (r234234) +++ head/sys/mips/conf/AP96 Fri Apr 13 20:23:32 2012 (r234235) @@ -17,19 +17,26 @@ include "AR71XX_BASE" ident "AP96" hints "AP96.hints" -# GEOM modules -device geom_redboot # to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! -options GEOM_UZIP - -options ROOTDEVNAME=\"ufs:md0.uzip\" options AR71XX_REALMEM=64*1024*1024 options AR71XX_ENV_UBOOT -# options MD_ROOT -# options MD_ROOT_SIZE="6144" +# For DOS - enable if required +options GEOM_PART_BSD +options GEOM_PART_MBR +options MSDOSFS + +# uncompress - to boot read-only lzma natively from flash +device geom_uzip +options GEOM_UZIP + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" +# Options needed for the EEPROM based calibration/PCI configuration data. options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash options ATH_EEPROM_FIRMWARE # Use EEPROM from flash device firmware # Used by the above Modified: head/sys/mips/conf/AP96.hints ============================================================================== --- head/sys/mips/conf/AP96.hints Fri Apr 13 20:22:08 2012 (r234234) +++ head/sys/mips/conf/AP96.hints Fri Apr 13 20:23:32 2012 (r234235) @@ -26,3 +26,52 @@ hint.pcib.0.bus.0.18.0.ath_fixup_size=40 hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" +# The default flash layout: +# uboot: 192k +# env: 64k +# rootfs: 6144k +# uimage (kernel): 1728k +# caldata: 64k +# +# bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init +# mtdparts=ar7100-nor0:192k(uboot),64k(env),6144k(rootfs),1728k(uImage),64k(caldata) mem=64M + +# +# We steal 64k from the end of rootfs to store the local config. + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000030000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00030000 +hint.map.1.end=0x00040000 +hint.map.1.name="uboot-env" +hint.map.1.readonly=1 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00040000 +hint.map.2.end=0x00630000 +hint.map.2.name="rootfs" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00630000 +hint.map.3.end=0x00640000 +hint.map.3.name="cfg" +hint.map.3.readonly=0 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x00640000 +hint.map.4.end=0x007f0000 +hint.map.4.name="kernel" +hint.map.4.readonly=1 + +hint.map.5.at="flash/spi0" +hint.map.5.start=0x007f0000 +hint.map.5.end=0x00800000 +hint.map.5.name="art" +hint.map.5.readonly=1 + From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 20:58:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0923510656F0; Fri, 13 Apr 2012 20:58:02 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E94E58FC08; Fri, 13 Apr 2012 20:58:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DKw1r0096969; Fri, 13 Apr 2012 20:58:01 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DKw1Fw096967; Fri, 13 Apr 2012 20:58:01 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201204132058.q3DKw1Fw096967@svn.freebsd.org> From: Jason Evans Date: Fri, 13 Apr 2012 20:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234236 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 20:58:02 -0000 Author: jasone Date: Fri Apr 13 20:58:01 2012 New Revision: 234236 URL: http://svn.freebsd.org/changeset/base/234236 Log: Added myself to committers-src.dot. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Apr 13 20:23:32 2012 (r234235) +++ head/share/misc/committers-src.dot Fri Apr 13 20:58:01 2012 (r234236) @@ -156,6 +156,7 @@ iedowse [label="Ian Dowse\niedowse@FreeB imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] ivoras [label="Ivan Voras\nivoras@FreeBSD.org\n2008/06/10"] jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] +jasone [label="Jason Evans\njasone@FreeBSD.org\n1999/03/03"] jceel [label="Jakub Klama\njceel@FreeBSD.org\n2011/09/25"] jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] jeff [label="Jeff Roberson\njeff@FreeBSD.org\n2002/02/21"] @@ -478,6 +479,7 @@ marcel -> arun marcel -> marius marcel -> nwhitehorn +markm -> jasone markm -> sheldonh mav -> ae @@ -494,6 +496,7 @@ mlaier -> thompsa mlaier -> eri msmith -> cokane +msmith -> jasone msmith -> scottl murray -> delphij From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 22:24:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4CB4106567C; Fri, 13 Apr 2012 22:24:57 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D170D8FC14; Fri, 13 Apr 2012 22:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DMOvmE000173; Fri, 13 Apr 2012 22:24:57 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DMOvo4000171; Fri, 13 Apr 2012 22:24:57 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204132224.q3DMOvo4000171@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Apr 2012 22:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234242 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 22:24:58 -0000 Author: luigi Date: Fri Apr 13 22:24:57 2012 New Revision: 234242 URL: http://svn.freebsd.org/changeset/base/234242 Log: fix build with -Wformat -Wmissing-prototypes Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri Apr 13 22:04:28 2012 (r234241) +++ head/sys/dev/netmap/netmap_mem2.c Fri Apr 13 22:24:57 2012 (r234242) @@ -162,7 +162,7 @@ netmap_ofstophys(vm_offset_t offset) offset % p[i]->_objsize; } D("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", o, - p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, + (u_int)p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, p[0]->_memtotal + p[1]->_memtotal + p[2]->_memtotal); return 0; // XXX bad address } @@ -173,7 +173,7 @@ netmap_ofstophys(vm_offset_t offset) * Algorithm: scan until we find the cluster, then add the * actual offset in the cluster */ -ssize_t +static ssize_t netmap_obj_offset(struct netmap_obj_pool *p, const void *vaddr) { int i, k = p->clustentries, n = p->objtotal; From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 22:34:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4572A106566B; Fri, 13 Apr 2012 22:34:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 315248FC14; Fri, 13 Apr 2012 22:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DMY2Cx000541; Fri, 13 Apr 2012 22:34:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DMY21g000539; Fri, 13 Apr 2012 22:34:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201204132234.q3DMY21g000539@svn.freebsd.org> From: Xin LI Date: Fri, 13 Apr 2012 22:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234244 - head/usr.sbin/lpr/lpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 22:34:02 -0000 Author: delphij Date: Fri Apr 13 22:34:01 2012 New Revision: 234244 URL: http://svn.freebsd.org/changeset/base/234244 Log: The scandir(3) function expects fourth parameter, compar, be in type of: int (*compar)(const struct dirent **, const struct dirent **) The current code defines sortq() to accept two void *, then cast them to const struct dirent **. Because the code does not really need this cast, we can eliminate the casts by changing the function prototype to match scandir(3) expectation. MFC after: 1 month Modified: head/usr.sbin/lpr/lpc/cmds.c Modified: head/usr.sbin/lpr/lpc/cmds.c ============================================================================== --- head/usr.sbin/lpr/lpc/cmds.c Fri Apr 13 22:31:49 2012 (r234243) +++ head/usr.sbin/lpr/lpc/cmds.c Fri Apr 13 22:34:01 2012 (r234244) @@ -79,7 +79,7 @@ static char *args2line(int argc, char ** static int doarg(char *_job); static int doselect(const struct dirent *_d); static int kill_qtask(const char *lf); -static int sortq(const void *_a, const void *_b); +static int sortq(const struct dirent **a, const struct dirent **b); static int touch(struct jobqueue *_jq); static void unlinkf(char *_name); static void upstat(struct printer *_pp, const char *_msg, int _notify); @@ -486,14 +486,14 @@ doselect(const struct dirent *d) * filenames (they will have datafile names which start with `dfB*'). */ static int -sortq(const void *a, const void *b) +sortq(const struct dirent **a, const struct dirent **b) { const int a_lt_b = -1, a_gt_b = 1, cat_other = 10; const char *fname_a, *fname_b, *jnum_a, *jnum_b; int cat_a, cat_b, ch, res, seq_a, seq_b; - fname_a = (*(const struct dirent * const *)a)->d_name; - fname_b = (*(const struct dirent * const *)b)->d_name; + fname_a = (*a)->d_name; + fname_b = (*b)->d_name; /* * First separate filenames into categories. Categories are From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 22:35:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDF2E106564A; Fri, 13 Apr 2012 22:35:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5988FC0A; Fri, 13 Apr 2012 22:35:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DMZrWU000636; Fri, 13 Apr 2012 22:35:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DMZrKp000634; Fri, 13 Apr 2012 22:35:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201204132235.q3DMZrKp000634@svn.freebsd.org> From: Xin LI Date: Fri, 13 Apr 2012 22:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234245 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 22:35:53 -0000 Author: delphij Date: Fri Apr 13 22:35:53 2012 New Revision: 234245 URL: http://svn.freebsd.org/changeset/base/234245 Log: Eliminate an unused parameter of static method igmp_stats_live_old(). MFC after: 1 month Modified: head/usr.bin/netstat/inet.c Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Fri Apr 13 22:34:01 2012 (r234244) +++ head/usr.bin/netstat/inet.c Fri Apr 13 22:35:53 2012 (r234245) @@ -1068,7 +1068,7 @@ icmp_stats(u_long off, const char *name, * Dump IGMP statistics structure (pre 8.x kernel). */ static void -igmp_stats_live_old(u_long off, const char *name) +igmp_stats_live_old(const char *name) { struct oigmpstat oigmpstat, zerostat; size_t len = sizeof(oigmpstat); @@ -1128,7 +1128,7 @@ igmp_stats(u_long off, const char *name, return; } if (len < sizeof(igmpstat)) { - igmp_stats_live_old(off, name); + igmp_stats_live_old(name); return; } } From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 22:58:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF66A106566C; Fri, 13 Apr 2012 22:58:23 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4598FC0A; Fri, 13 Apr 2012 22:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DMwNQM001467; Fri, 13 Apr 2012 22:58:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DMwNTM001464; Fri, 13 Apr 2012 22:58:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204132258.q3DMwNTM001464@svn.freebsd.org> From: Marius Strobl Date: Fri, 13 Apr 2012 22:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234247 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 22:58:24 -0000 Author: marius Date: Fri Apr 13 22:58:23 2012 New Revision: 234247 URL: http://svn.freebsd.org/changeset/base/234247 Log: Merge from x86: r233961: Fix interrupt load balancing regression, introduced in revision 222813, that left all un-pinned interrupts assigned to CPU 0. In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized the "intr_cpus" cpuset to only contain CPU0. This initialization is too late and nullifies the results of calls to the intr_add_cpu() that occur much earlier in the boot process. r234074 (partial): The BSP is not added to the mask of valid target CPUs for interrupts. Fix this by adding the BSP as an interrupt target directly in r234105: Fix !SMP build after r234074. MFC after: 3 days Modified: head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Fri Apr 13 22:47:23 2012 (r234246) +++ head/sys/sparc64/sparc64/intr_machdep.c Fri Apr 13 22:58:23 2012 (r234247) @@ -528,9 +528,6 @@ intr_shuffle_irqs(void *arg __unused) struct intr_vector *iv; int i; - /* The BSP is always a valid target. */ - CPU_SETOF(0, &intr_cpus); - /* Don't bother on UP. */ if (mp_ncpus == 1) return; Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Apr 13 22:47:23 2012 (r234246) +++ head/sys/sparc64/sparc64/machdep.c Fri Apr 13 22:58:23 2012 (r234247) @@ -196,6 +196,13 @@ cpu_startup(void *arg) printf("machine: %s\n", sparc64_model); cpu_identify(rdpr(ver), PCPU_GET(clock), curcpu); + +#ifdef SMP + /* + * Add BSP as an interrupt target. + */ + intr_add_cpu(0); +#endif } void From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 23:07:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AAD4106566C; Fri, 13 Apr 2012 23:07:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA12E8FC14; Fri, 13 Apr 2012 23:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DN7W5N001815; Fri, 13 Apr 2012 23:07:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DN7WNM001811; Fri, 13 Apr 2012 23:07:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204132307.q3DN7WNM001811@svn.freebsd.org> From: Marius Strobl Date: Fri, 13 Apr 2012 23:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234248 - in head/sys: conf dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 23:07:33 -0000 Author: marius Date: Fri Apr 13 23:07:32 2012 New Revision: 234248 URL: http://svn.freebsd.org/changeset/base/234248 Log: Add a driver for the NXP (Philips) PCF8563 RTC. Obtained from: NetBSD (pcf8563reg.h) Added: head/sys/dev/iicbus/pcf8563.c (contents, props changed) head/sys/dev/iicbus/pcf8563reg.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 13 22:58:23 2012 (r234247) +++ head/sys/conf/files Fri Apr 13 23:07:32 2012 (r234248) @@ -1288,6 +1288,7 @@ dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc +dev/iicbus/pcf8563.c optional pcf8563 dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci Added: head/sys/dev/iicbus/pcf8563.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/pcf8563.c Fri Apr 13 23:07:32 2012 (r234248) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2012 Marius Strobl + * 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 +__FBSDID("$FreeBSD$"); + +/* + * Driver for NXP PCF8563 real-time clock/calendar + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +#define PCF8563_NCLOCKREGS (PCF8563_R_YEAR - PCF8563_R_CS1 + 1) + +struct pcf8563_softc { + uint32_t sc_flags; +#define PCF8563_CPOL (1 << 0) /* PCF8563_R_MONTH_C means 19xx */ + uint16_t sc_addr; /* PCF8563 slave address */ + uint16_t sc_year0; /* TOD clock year 0 */ +}; + +static device_attach_t pcf8563_attach; +static device_probe_t pcf8563_probe; +static clock_gettime_t pcf8563_gettime; +static clock_settime_t pcf8563_settime; + +static int +pcf8563_probe(device_t dev) +{ + + device_set_desc(dev, "NXP PCF8563 RTC"); + return (BUS_PROBE_NOWILDCARD); +} + +static int +pcf8563_attach(device_t dev) +{ + uint8_t reg = PCF8563_R_SECOND, val; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, sizeof(val), &val } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->sc_addr = iicbus_get_addr(dev); + if (sc->sc_addr == 0) + sc->sc_addr = PCF8563_ADDR; + + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + if ((val & PCF8563_R_SECOND_VL) != 0) { + device_printf(dev, "%s: battery low\n", __func__); + return (ENXIO); + } + + sc->sc_year0 = 1900; + clock_register(dev, 1000000); /* 1 second resolution */ + return (0); +} + +static int +pcf8563_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t reg = PCF8563_R_SECOND, val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, sizeof(reg), ® }, + { 0, IIC_M_RD, PCF8563_NCLOCKREGS, &val[PCF8563_R_SECOND] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + msgs[0].slave = msgs[1].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) { + device_printf(dev, "%s: cannot read RTC\n", __func__); + return (error); + } + + ct.nsec = 0; + ct.sec = FROMBCD(val[PCF8563_R_SECOND] & PCF8563_M_SECOND); + ct.min = FROMBCD(val[PCF8563_R_MINUTE] & PCF8563_M_MINUTE); + ct.hour = FROMBCD(val[PCF8563_R_HOUR] & PCF8563_M_HOUR); + ct.day = FROMBCD(val[PCF8563_R_DAY] & PCF8563_M_DAY); + ct.dow = val[PCF8563_R_WEEKDAY] & PCF8563_M_WEEKDAY; + ct.mon = FROMBCD(val[PCF8563_R_MONTH] & PCF8563_M_MONTH); + ct.year = FROMBCD(val[PCF8563_R_YEAR] & PCF8563_M_YEAR); + ct.year += sc->sc_year0; + if (ct.year < POSIX_BASE_YEAR) + ct.year += 100; /* assume [1970, 2069] */ + if ((val[PCF8563_R_MONTH] & PCF8563_R_MONTH_C) != 0) { + if (ct.year >= 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + } else if (ct.year < 100 + sc->sc_year0) + sc->sc_flags |= PCF8563_CPOL; + return (clock_ct_to_ts(&ct, ts)); +} + +static int +pcf8563_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + uint8_t val[PCF8563_NCLOCKREGS]; + struct iic_msg msgs[] = { + { 0, IIC_M_WR, PCF8563_NCLOCKREGS - 1, &val[PCF8563_R_CS2] } + }; + struct pcf8563_softc *sc; + int error; + + sc = device_get_softc(dev); + val[PCF8563_R_CS2] = PCF8563_R_SECOND; /* abuse */ + /* Accuracy is only one second. */ + if (ts->tv_nsec >= 500000000) + ts->tv_sec++; + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + val[PCF8563_R_SECOND] = TOBCD(ct.sec); + val[PCF8563_R_MINUTE] = TOBCD(ct.min); + val[PCF8563_R_HOUR] = TOBCD(ct.hour); + val[PCF8563_R_DAY] = TOBCD(ct.day); + val[PCF8563_R_WEEKDAY] = ct.dow; + val[PCF8563_R_MONTH] = TOBCD(ct.mon); + val[PCF8563_R_YEAR] = TOBCD(ct.year % 100); + if ((sc->sc_flags & PCF8563_CPOL) != 0) { + if (ct.year >= 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + } else if (ct.year < 100 + sc->sc_year0) + val[PCF8563_R_MONTH] |= PCF8563_R_MONTH_C; + + msgs[0].slave = sc->sc_addr; + error = iicbus_transfer(device_get_parent(dev), msgs, sizeof(msgs) / + sizeof(*msgs)); + if (error != 0) + device_printf(dev, "%s: cannot write RTC\n", __func__); + return (error); +} + +static device_method_t pcf8563_methods[] = { + DEVMETHOD(device_probe, pcf8563_probe), + DEVMETHOD(device_attach, pcf8563_attach), + + DEVMETHOD(clock_gettime, pcf8563_gettime), + DEVMETHOD(clock_settime, pcf8563_settime), + + DEVMETHOD_END +}; + +static driver_t pcf8563_driver = { + "pcf8563_rtc", + pcf8563_methods, + sizeof(struct pcf8563_softc), +}; + +static devclass_t pcf8563_devclass; + +DRIVER_MODULE(pcf8563, iicbus, pcf8563_driver, pcf8563_devclass, NULL, NULL); +MODULE_VERSION(pcf8563, 1); +MODULE_DEPEND(pcf8563, iicbus, 1, 1, 1); Added: head/sys/dev/iicbus/pcf8563reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/pcf8563reg.h Fri Apr 13 23:07:32 2012 (r234248) @@ -0,0 +1,58 @@ +/* $NetBSD: pcf8563reg.h,v 1.1 2011/01/21 19:11:47 jakllsch Exp $ */ + +/*- + * Jonathan Kollasch, 2011 + * + * This file is in the public domain. + * + * $FreeBSD$ + */ + +/* + * NXP (Philips) PCF8563 RTC registers + */ + +/* We only have clock mode registers here. */ + +#ifndef _PCF8563REG_H_ +#define _PCF8563REG_H_ + +/* + * PCF8563 RTC I2C address: + * + * 101 0001 + */ +#define PCF8563_ADDR 0xa2 + +#define PCF8563_R_CS1 0x00 +#define PCF8563_R_CS2 0x01 +#define PCF8563_R_SECOND 0x02 +#define PCF8563_R_MINUTE 0x03 +#define PCF8563_R_HOUR 0x04 +#define PCF8563_R_DAY 0x05 +#define PCF8563_R_WEEKDAY 0x06 +#define PCF8563_R_MONTH 0x07 +#define PCF8563_R_YEAR 0x08 +#define PCF8563_R_MINUTE_ALARM 0x09 +#define PCF8563_R_HOUR_ALARM 0x0a +#define PCF8563_R_DAY_ALARM 0x0b +#define PCF8563_R_WEEKDAY_ALARM 0x0c +#define PCF8563_R_CLKOUT_CNTRL 0x0d +#define PCF8563_R_TIMER_CNTRL 0x0e +#define PCF8563_R_TIMER 0x0f + +#define PCF8563_R_SECOND_VL 0x80 +#define PCF8563_R_MONTH_C 0x80 + +#define PCF8563_NREGS 0x10 + +#define PCF8563_M_SECOND 0x7f +#define PCF8563_M_MINUTE 0x7f +#define PCF8563_M_HOUR 0x3f +#define PCF8563_M_DAY 0x3f +#define PCF8563_M_WEEKDAY 0x07 +#define PCF8563_M_MONTH 0x1f +#define PCF8563_M_CENTURY 0x80 +#define PCF8563_M_YEAR 0xff + +#endif /* _PCF8563REG_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 04:13:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12DD5106566C; Sat, 14 Apr 2012 04:13:52 +0000 (UTC) (envelope-from gonzo@hq.bluezbox.com) Received: from hq.bluezbox.com (hq.bluezbox.com [70.38.37.145]) by mx1.freebsd.org (Postfix) with ESMTP id BA6AD8FC0A; Sat, 14 Apr 2012 04:13:51 +0000 (UTC) Received: from [24.87.53.93] (helo=[192.168.1.116]) by hq.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1SIuMh-000HO9-6q; Fri, 13 Apr 2012 21:13:36 -0700 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Oleksandr Tymoshenko In-Reply-To: <201204121743.q3CHhxQA039333@svn.freebsd.org> Date: Fri, 13 Apr 2012 21:13:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201204121743.q3CHhxQA039333@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) Sender: gonzo@hq.bluezbox.com X-Spam-Level: ---- X-Spam-Report: Spam detection software, running on the system "hq.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 2012-04-12, at 10:43 AM, John Baldwin wrote: > Author: jhb > Date: Thu Apr 12 17:43:59 2012 > New Revision: 234190 > URL: http://svn.freebsd.org/changeset/base/234190 > > Log: > - Extend the KDB interface to add a per-debugger callback to print a > backtrace for an arbitrary thread (rather than the calling thread). > A kdb_backtrace_thread() wrapper function uses the configured debugger > if possible, otherwise it falls back to using stack(9) if that is > available. > - Replace a direct call to db_trace_thread() in propagate_priority() > with a call to kdb_backtrace_thread() instead. > > > Modified: head/sys/kern/subr_turnstile.c > ============================================================================== > --- head/sys/kern/subr_turnstile.c Thu Apr 12 16:55:48 2012 (r234189) > +++ head/sys/kern/subr_turnstile.c Thu Apr 12 17:43:59 2012 (r234190) > @@ -217, 9 +217, 7 @@ propagate_priority(struct thread *td) > printf( > "Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n", > td->td_tid, td->td_proc->p_pid); > -#ifdef DDB > - db_trace_thread(td, -1); > -#endif > + kdb_backtrace_thread(td); > panic("sleeping thread"); > } [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r234190 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 04:13:52 -0000 On 2012-04-12, at 10:43 AM, John Baldwin wrote: > Author: jhb > Date: Thu Apr 12 17:43:59 2012 > New Revision: 234190 > URL: http://svn.freebsd.org/changeset/base/234190 >=20 > Log: > - Extend the KDB interface to add a per-debugger callback to print a > backtrace for an arbitrary thread (rather than the calling thread). > A kdb_backtrace_thread() wrapper function uses the configured = debugger > if possible, otherwise it falls back to using stack(9) if that is > available. > - Replace a direct call to db_trace_thread() in propagate_priority() > with a call to kdb_backtrace_thread() instead. >=20 >=20 > Modified: head/sys/kern/subr_turnstile.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/subr_turnstile.c Thu Apr 12 16:55:48 2012 = (r234189) > +++ head/sys/kern/subr_turnstile.c Thu Apr 12 17:43:59 2012 = (r234190) > @@ -217,9 +217,7 @@ propagate_priority(struct thread *td) > printf( > "Sleeping thread (tid %d, pid %d) owns a non-sleepable = lock\n", > td->td_tid, td->td_proc->p_pid); > -#ifdef DDB > - db_trace_thread(td, -1); > -#endif > + kdb_backtrace_thread(td); > panic("sleeping thread"); > } It seems that missing "#ifdef DDB" break build for kernels without DDB = enabled: cc1: warnings being treated as errors /src/FreeBSD/head/sys/kern/subr_turnstile.c: In function = 'propagate_priority': /src/FreeBSD/head/sys/kern/subr_turnstile.c:220: warning: implicit = declaration of function 'kdb_backtrace_thread' /src/FreeBSD/head/sys/kern/subr_turnstile.c:220: warning: nested extern = declaration of 'kdb_backtrace_thread' [-Wnested-externs] From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 04:40:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84BD4106564A; Sat, 14 Apr 2012 04:40:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA6D8FC1E; Sat, 14 Apr 2012 04:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3E4eCTN013487; Sat, 14 Apr 2012 04:40:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3E4eC7R013484; Sat, 14 Apr 2012 04:40:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204140440.q3E4eC7R013484@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Apr 2012 04:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234269 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 04:40:12 -0000 Author: adrian Date: Sat Apr 14 04:40:11 2012 New Revision: 234269 URL: http://svn.freebsd.org/changeset/base/234269 Log: Both linux ath9k and the reference driver initialises the PLL here during chip wakeup. Obtained from: Linux ath9k, Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Sat Apr 14 02:49:01 2012 (r234268) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Sat Apr 14 04:40:11 2012 (r234269) @@ -50,6 +50,7 @@ ar5416SetPowerModeAwake(struct ath_hal * & AR_RTC_PM_STATUS_M) == AR_RTC_STATUS_SHUTDOWN) { if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) goto bad; + AH5416(ah)->ah_initPLL(ah, AH_NULL); } if (AR_SREV_HOWL(ah)) From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 05:48:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58504106566B; Sat, 14 Apr 2012 05:48:05 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4194F8FC0A; Sat, 14 Apr 2012 05:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3E5m53l015534; Sat, 14 Apr 2012 05:48:05 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3E5m5Qn015526; Sat, 14 Apr 2012 05:48:05 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201204140548.q3E5m5Qn015526@svn.freebsd.org> From: Peter Grehan Date: Sat, 14 Apr 2012 05:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234270 - in head/sys/dev/virtio: . balloon block network pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 05:48:05 -0000 Author: grehan Date: Sat Apr 14 05:48:04 2012 New Revision: 234270 URL: http://svn.freebsd.org/changeset/base/234270 Log: Catch up with Bryan Venteicher's virtio git repo: a8af6270bd96be6ccd86f70b60fa6512b710e4f0 virtio_blk: Include function name in panic string cbdb03a694b76c5253d7ae3a59b9995b9afbb67a virtio_balloon: Do the notify outside of the lock By the time we return from virtqueue_notify(), the descriptor will be in the used ring so we shouldn't have to sleep. 10ba392e60692529a5cbc1e9987e4064e0128447 virtio: Use DEVMETHOD_END 80cbcc4d6552cac758be67f0c99c36f23ce62110 virtqueue: Add support for VIRTIO_F_RING_EVENT_IDX This can be used to reduce the number of guest/host and host/guest interrupts by delaying the interrupt until a certain index value is reached. Actual use by the network driver will come along later. 8fc465969acc0c58477153e4c3530390db436c02 virtqueue: Simplify virtqueue_nused() Since the values just wrap naturally at UINT16_MAX, we can just subtract the two values directly, rather than doing 2's complement math. a8aa22f25959e2767d006cd621b69050e7ffb0ae virtio_blk: Remove debugging crud from 75dd732a There seems to be an issue with Qemu (or FreeBSD VirtIO) that sets the PCI register space for the device config to bogus values. This only seems to happen after unloading and reloading the module. d404800661cb2a9769c033f8a50b2133934501aa virtio_blk: Use better variable name 75dd732a97743d96e7c63f7ced3c2169696dadd3 virtio_blk: Partially revert 92ba40e65 Just use the virtqueue to determine if any requests are still inflight. 06661ed66b7a9efaea240f99f414c368f1bbcdc7 virtio_blk: error if allowed too few segments Should never happen unless the host provides use with a bogus seg_max value. 4b33e5085bc87a818433d7e664a0a2c8f56a1a89 virtio_blk: Sort function declarations 426b9f5cac892c9c64cc7631966461514f7e08c6 virtio_blk: Cleanup whitespace 617c23e12c61e3c2233d942db713c6b8ff0bd112 virtio_blk: Call disk_err() on error'd completed requests 081a5712d4b2e0abf273be4d26affcf3870263a9 virtio_blk: ASSERT the ready and inflight request queues are empty a9be2631a4f770a84145c18ee03a3f103bed4ca8 virtio_blk: Simplify check for too many segments At the cost of a small style violation. e00ec09da014f2e60cc75542d0ab78898672d521 virtio_blk: Add beginnings of suspend/resume Still not sure if we need to virtio_stop()/virtio_reinit() the device before/after a suspend. Don't start additional IO when marked as suspending. 47c71dc6ce8c238aa59ce8afd4bda5aa294bc884 virtio_blk: Panic when dealt an unhandled BIO cmd 1055544f90fb8c0cc6a2395f5b6104039606aafe virtio_blk: Add VQ enqueue/dequeue wrappers Wrapper functions managed the added/removing to the in-flight list of requests. Normally biodone() any completed IO when draining the virtqueue. 92ba40e65b3bb5e4acb9300ece711f1ea8f3f7f4 virtio_blk: Add in-flight list of requests 74f6d260e075443544522c0833dc2712dd93f49b virtio_blk: Rename VTBLK_FLAG_DETACHING to VTBLK_FLAG_DETACH 7aa549050f6fc6551c09c6362ed6b2a0728956ef virtio_blk: Finish all BIOs through vtblk_finish_bio() Also properly set bio_resid in the case of errors. Most geom_disk providers seem to do the same. 9eef6d0e6f7e5dd362f71ba097f2e2e4c3744882 Added function to translate VirtIO status to error code ef06adc337f31e1129d6d5f26de6d8d1be27bcd2 Reset dumping flag when given unexpected parameters 393b3e390c644193a2e392220dcc6a6c50b212d9 Added missing VTBLK_LOCK() in dump handler Obtained from: Bryan Venteicher bryanv at daemoninthecloset dot org Modified: head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/virtio_ring.h head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Sat Apr 14 05:48:04 2012 (r234270) @@ -122,6 +122,9 @@ static void vtballoon_add_sysctl(struct */ #define VTBALLOON_PAGES_PER_REQUEST 256 +/* Must be able to fix all pages frames in one page (segment). */ +CTASSERT(VTBALLOON_PAGES_PER_REQUEST * sizeof(uint32_t) <= PAGE_SIZE); + #define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx #define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ "VirtIO Balloon Lock", MTX_SPIN) @@ -138,7 +141,7 @@ static device_method_t vtballoon_methods /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtballoon_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtballoon_driver = { @@ -402,13 +405,13 @@ vtballoon_send_page_frames(struct vtball error = virtqueue_enqueue(vq, vq, &sg, 1, 0); KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); + virtqueue_notify(vq); /* * Inflate and deflate operations are done synchronously. The * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - virtqueue_notify(vq); while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/block/virtio_blk.c Sat Apr 14 05:48:04 2012 (r234270) @@ -70,8 +70,8 @@ struct vtblk_softc { uint32_t vtblk_flags; #define VTBLK_FLAG_INDIRECT 0x0001 #define VTBLK_FLAG_READONLY 0x0002 -#define VTBLK_FLAG_DETACHING 0x0004 -#define VTBLK_FLAG_SUSPENDED 0x0008 +#define VTBLK_FLAG_DETACH 0x0004 +#define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_DUMPING 0x0010 struct virtqueue *vtblk_vq; @@ -82,7 +82,7 @@ struct vtblk_softc { TAILQ_HEAD(, vtblk_request) vtblk_req_free; TAILQ_HEAD(, vtblk_request) - vtblk_req_ready; + vtblk_req_ready; struct taskqueue *vtblk_tq; struct task vtblk_intr_task; @@ -116,6 +116,13 @@ static int vtblk_suspend(device_t); static int vtblk_resume(device_t); static int vtblk_shutdown(device_t); +static int vtblk_open(struct disk *); +static int vtblk_close(struct disk *); +static int vtblk_ioctl(struct disk *, u_long, void *, int, + struct thread *); +static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); +static void vtblk_strategy(struct bio *); + static void vtblk_negotiate_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); @@ -124,13 +131,7 @@ static void vtblk_alloc_disk(struct vtbl struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -static int vtblk_open(struct disk *); -static int vtblk_close(struct disk *); -static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); -static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); -static void vtblk_strategy(struct bio *); - +static int vtblk_quiesce(struct vtblk_softc *); static void vtblk_startio(struct vtblk_softc *); static struct vtblk_request * vtblk_bio_request(struct vtblk_softc *); static int vtblk_execute_request(struct vtblk_softc *, @@ -148,6 +149,7 @@ static int vtblk_flush_dump(struct vtblk static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static void vtblk_finish_completed(struct vtblk_softc *); static void vtblk_drain_vq(struct vtblk_softc *, int); static void vtblk_drain(struct vtblk_softc *); @@ -161,7 +163,8 @@ static struct vtblk_request * vtblk_dequ static void vtblk_enqueue_ready(struct vtblk_softc *, struct vtblk_request *); -static void vtblk_bio_error(struct bio *, int); +static int vtblk_request_error(struct vtblk_request *); +static void vtblk_finish_bio(struct bio *, int); /* Tunables. */ static int vtblk_no_ident = 0; @@ -189,9 +192,8 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ #define VTBLK_LOCK_ASSERT_NOTOWNED(_sc) \ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) -#define VTBLK_BIO_SEGMENTS(_bp) sglist_count((_bp)->bio_data, (_bp)->bio_bcount) - #define VTBLK_DISK_NAME "vtbd" +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -210,7 +212,7 @@ static device_method_t vtblk_methods[] = DEVMETHOD(device_resume, vtblk_resume), DEVMETHOD(device_shutdown, vtblk_shutdown), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtblk_driver = { @@ -314,11 +316,13 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + error = EINVAL; + device_printf(dev, "fewer than minimum number of segments " + "allowed: %d\n", sc->vtblk_max_nsegs); + goto fail; + } - /* - * Allocate working sglist. The number of segments may be too - * large to safely store on the stack. - */ sc->vtblk_sglist = sglist_alloc(sc->vtblk_max_nsegs, M_NOWAIT); if (sc->vtblk_sglist == NULL) { error = ENOMEM; @@ -376,7 +380,7 @@ vtblk_detach(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_DETACHING; + sc->vtblk_flags |= VTBLK_FLAG_DETACH; if (device_is_attached(dev)) vtblk_stop(sc); VTBLK_UNLOCK(sc); @@ -408,15 +412,19 @@ static int vtblk_suspend(device_t dev) { struct vtblk_softc *sc; + int error; sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags |= VTBLK_FLAG_SUSPENDED; - /* TODO Wait for any inflight IO to complete? */ + sc->vtblk_flags |= VTBLK_FLAG_SUSPEND; + /* XXX BMV: virtio_stop(), etc needed here? */ + error = vtblk_quiesce(sc); + if (error) + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; VTBLK_UNLOCK(sc); - return (0); + return (error); } static int @@ -427,8 +435,9 @@ vtblk_resume(device_t dev) sc = device_get_softc(dev); VTBLK_LOCK(sc); - sc->vtblk_flags &= ~VTBLK_FLAG_SUSPENDED; - /* TODO Resume IO? */ + /* XXX BMV: virtio_reinit(), etc needed here? */ + sc->vtblk_flags &= ~VTBLK_FLAG_SUSPEND; + vtblk_startio(sc); VTBLK_UNLOCK(sc); return (0); @@ -449,7 +458,7 @@ vtblk_open(struct disk *dp) if ((sc = dp->d_drv1) == NULL) return (ENXIO); - return (sc->vtblk_flags & VTBLK_FLAG_DETACHING ? ENXIO : 0); + return (sc->vtblk_flags & VTBLK_FLAG_DETACH ? ENXIO : 0); } static int @@ -489,6 +498,8 @@ vtblk_dump(void *arg, void *virtual, vm_ if ((sc = dp->d_drv1) == NULL) return (ENXIO); + VTBLK_LOCK(sc); + if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { vtblk_prepare_dump(sc); sc->vtblk_flags |= VTBLK_FLAG_DUMPING; @@ -498,6 +509,10 @@ vtblk_dump(void *arg, void *virtual, vm_ error = vtblk_write_dump(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) error = vtblk_flush_dump(sc); + else { + error = EINVAL; + sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; + } VTBLK_UNLOCK(sc); @@ -510,7 +525,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_bio_error(bp, EINVAL); + vtblk_finish_bio(bp, EINVAL); return; } @@ -520,29 +535,37 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_bio_error(bp, EROFS); + vtblk_finish_bio(bp, EROFS); return; } +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize * was incorrectly set. */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - KASSERT(VTBLK_BIO_SEGMENTS(bp) <= sc->vtblk_max_nsegs - - VTBLK_MIN_SEGMENTS, + int nsegs, max_nsegs; + + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); + max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + + KASSERT(nsegs <= max_nsegs, ("bio spanned too many segments: %d, max: %d", - VTBLK_BIO_SEGMENTS(bp), - sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS)); + nsegs, max_nsegs)); } +#endif VTBLK_LOCK(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_DETACHING) == 0) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + vtblk_finish_bio(bp, ENXIO); + else { bioq_disksort(&sc->vtblk_bioq, bp); - vtblk_startio(sc); - } else - vtblk_bio_error(bp, ENXIO); + + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + } VTBLK_UNLOCK(sc); } @@ -669,6 +692,26 @@ vtblk_create_disk(struct vtblk_softc *sc disk_create(dp, DISK_VERSION); } +static int +vtblk_quiesce(struct vtblk_softc *sc) +{ + int error; + + error = 0; + + VTBLK_LOCK_ASSERT(sc); + + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; + } + } + + return (error); +} + static void vtblk_startio(struct vtblk_softc *sc) { @@ -681,9 +724,6 @@ vtblk_startio(struct vtblk_softc *sc) VTBLK_LOCK_ASSERT(sc); - if (sc->vtblk_flags & VTBLK_FLAG_SUSPENDED) - return; - while (!virtqueue_full(vq)) { if ((req = vtblk_dequeue_ready(sc)) == NULL) req = vtblk_bio_request(sc); @@ -736,9 +776,8 @@ vtblk_bio_request(struct vtblk_softc *sc req->vbr_hdr.sector = bp->bio_offset / 512; break; default: - KASSERT(0, ("bio with unhandled cmd: %d", bp->bio_cmd)); - req->vbr_hdr.type = -1; - break; + panic("%s: bio with unhandled cmd: %d", __FUNCTION__, + bp->bio_cmd); } if (bp->bio_flags & BIO_ORDERED) @@ -752,7 +791,7 @@ vtblk_execute_request(struct vtblk_softc { struct sglist *sg; struct bio *bp; - int writable, error; + int readable, writable, error; sg = sc->vtblk_sglist; bp = req->vbr_bp; @@ -783,10 +822,9 @@ vtblk_execute_request(struct vtblk_softc KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, ("fewer than min segments: %d", sg->sg_nseg)); - error = virtqueue_enqueue(sc->vtblk_vq, req, sg, - sg->sg_nseg - writable, writable); + readable = sg->sg_nseg - writable; - return (error); + return (virtqueue_enqueue(sc->vtblk_vq, req, sg, readable, writable)); } static int @@ -806,37 +844,23 @@ static void vtblk_intr_task(void *arg, int pending) { struct vtblk_softc *sc; - struct vtblk_request *req; struct virtqueue *vq; - struct bio *bp; sc = arg; vq = sc->vtblk_vq; VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACHING) { + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { VTBLK_UNLOCK(sc); return; } - while ((req = virtqueue_dequeue(vq, NULL)) != NULL) { - bp = req->vbr_bp; - - if (req->vbr_ack == VIRTIO_BLK_S_OK) - bp->bio_resid = 0; - else { - bp->bio_flags |= BIO_ERROR; - if (req->vbr_ack == VIRTIO_BLK_S_UNSUPP) - bp->bio_error = ENOTSUP; - else - bp->bio_error = EIO; - } - - biodone(bp); - vtblk_enqueue_request(sc, req); - } + vtblk_finish_completed(sc); - vtblk_startio(sc); + if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) + vtblk_startio(sc); + else + wakeup(&sc->vtblk_vq); if (virtqueue_enable_intr(vq) != 0) { virtqueue_disable_intr(vq); @@ -973,7 +997,6 @@ vtblk_poll_request(struct vtblk_softc *s { device_t dev; struct virtqueue *vq; - struct vtblk_request *r; int error; dev = sc->vtblk_dev; @@ -988,20 +1011,37 @@ vtblk_poll_request(struct vtblk_softc *s virtqueue_notify(vq); - r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response")); + req = virtqueue_poll(vq, NULL); - if (req->vbr_ack != VIRTIO_BLK_S_OK) { - error = req->vbr_ack == VIRTIO_BLK_S_UNSUPP ? ENOTSUP : EIO; - if (bootverbose) - device_printf(dev, - "vtblk_poll_request: IO error: %d\n", error); + error = vtblk_request_error(req); + if (error && bootverbose) { + device_printf(dev, "vtblk_poll_request: IO error: %d\n", + error); } return (error); } static void +vtblk_finish_completed(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + struct bio *bp; + int error; + + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + bp = req->vbr_bp; + + error = vtblk_request_error(req); + if (error) + disk_err(bp, "hard error", -1, 1); + + vtblk_finish_bio(bp, error); + vtblk_enqueue_request(sc, req); + } +} + +static void vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { struct virtqueue *vq; @@ -1013,7 +1053,7 @@ vtblk_drain_vq(struct vtblk_softc *sc, i while ((req = virtqueue_drain(vq, &last)) != NULL) { if (!skip_done) - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } @@ -1030,17 +1070,19 @@ vtblk_drain(struct vtblk_softc *sc) bioq = &sc->vtblk_bioq; - if (sc->vtblk_vq != NULL) + if (sc->vtblk_vq != NULL) { + vtblk_finish_completed(sc); vtblk_drain_vq(sc, 0); + } while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_bio_error(req->vbr_bp, ENXIO); + vtblk_finish_bio(req->vbr_bp, ENXIO); vtblk_enqueue_request(sc, req); } while (bioq_first(bioq) != NULL) { bp = bioq_takefirst(bioq); - vtblk_bio_error(bp, ENXIO); + vtblk_finish_bio(bp, ENXIO); } vtblk_free_requests(sc); @@ -1050,9 +1092,9 @@ static int vtblk_alloc_requests(struct vtblk_softc *sc) { struct vtblk_request *req; - int i, size; + int i, nreqs; - size = virtqueue_size(sc->vtblk_vq); + nreqs = virtqueue_size(sc->vtblk_vq); /* * Preallocate sufficient requests to keep the virtqueue full. Each @@ -1060,9 +1102,9 @@ vtblk_alloc_requests(struct vtblk_softc * the number allocated when indirect descriptors are not available. */ if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - size /= VTBLK_MIN_SEGMENTS; + nreqs /= VTBLK_MIN_SEGMENTS; - for (i = 0; i < size; i++) { + for (i = 0; i < nreqs; i++) { req = uma_zalloc(vtblk_req_zone, M_NOWAIT); if (req == NULL) return (ENOMEM); @@ -1079,6 +1121,9 @@ vtblk_free_requests(struct vtblk_softc * { struct vtblk_request *req; + KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready), + ("ready requests left on queue")); + while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; uma_zfree(vtblk_req_zone, req); @@ -1126,9 +1171,35 @@ vtblk_enqueue_ready(struct vtblk_softc * TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); } +static int +vtblk_request_error(struct vtblk_request *req) +{ + int error; + + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; + } + + return (error); +} + static void -vtblk_bio_error(struct bio *bp, int error) +vtblk_finish_bio(struct bio *bp, int error) { - biofinish(bp, NULL, error); + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Apr 14 05:48:04 2012 (r234270) @@ -223,7 +223,7 @@ static device_method_t vtnet_methods[] = /* VirtIO methods. */ DEVMETHOD(virtio_config_change, vtnet_config_change), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtnet_driver = { Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/pci/virtio_pci.c Sat Apr 14 05:48:04 2012 (r234270) @@ -189,7 +189,7 @@ static device_method_t vtpci_methods[] = DEVMETHOD(virtio_bus_read_device_config, vtpci_read_dev_config), DEVMETHOD(virtio_bus_write_device_config, vtpci_write_dev_config), - { 0, 0 } + DEVMETHOD_END }; static driver_t vtpci_driver = { Modified: head/sys/dev/virtio/virtio_ring.h ============================================================================== --- head/sys/dev/virtio/virtio_ring.h Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/virtio_ring.h Sat Apr 14 05:48:04 2012 (r234270) @@ -103,6 +103,7 @@ struct vring { * __u16 avail_flags; * __u16 avail_idx; * __u16 available[num]; + * __u16 used_event_idx; * * // Padding to the next align boundary. * char pad[]; @@ -111,11 +112,19 @@ struct vring { * __u16 used_flags; * __u16 used_idx; * struct vring_used_elem used[num]; + * __u16 avail_event_idx; * }; * * NOTE: for VirtIO PCI, align is 4096. */ +/* + * We publish the used event index at the end of the available ring, and vice + * versa. They are at the end for backwards compatibility. + */ +#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num]) +#define vring_avail_event(vr) (*(uint16_t *)&(vr)->used->ring[(vr)->num]) + static inline int vring_size(unsigned int num, unsigned long align) { @@ -140,4 +149,18 @@ vring_init(struct vring *vr, unsigned in vr->used = (void *) (((unsigned long) &vr->avail->ring[num] + align-1) & ~(align-1)); } + +/* + * The following is used with VIRTIO_RING_F_EVENT_IDX. + * + * Assuming a given event_idx value from the other size, if we have + * just incremented index from old to new_idx, should we trigger an + * event? + */ +static inline int +vring_need_event(uint16_t event_idx, uint16_t new_idx, uint16_t old) +{ + + return (uint16_t)(new_idx - event_idx - 1) < (uint16_t)(new_idx - old); +} #endif /* VIRTIO_RING_H */ Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/virtqueue.c Sat Apr 14 05:48:04 2012 (r234270) @@ -60,6 +60,7 @@ struct virtqueue { uint16_t vq_nentries; uint32_t vq_flags; #define VIRTQUEUE_FLAG_INDIRECT 0x0001 +#define VIRTQUEUE_FLAG_EVENT_IDX 0x0002 int vq_alignment; int vq_ring_size; @@ -126,7 +127,8 @@ static uint16_t vq_ring_enqueue_segments static int vq_ring_use_indirect(struct virtqueue *, int); static void vq_ring_enqueue_indirect(struct virtqueue *, void *, struct sglist *, int, int); -static void vq_ring_notify_host(struct virtqueue *, int); +static int vq_ring_must_notify_host(struct virtqueue *); +static void vq_ring_notify_host(struct virtqueue *); static void vq_ring_free_chain(struct virtqueue *, uint16_t); uint64_t @@ -136,6 +138,7 @@ virtqueue_filter_features(uint64_t featu mask = (1 << VIRTIO_TRANSPORT_F_START) - 1; mask |= VIRTIO_RING_F_INDIRECT_DESC; + mask |= VIRTIO_RING_F_EVENT_IDX; return (features & mask); } @@ -184,6 +187,9 @@ virtqueue_alloc(device_t dev, uint16_t q vq->vq_intrhand = info->vqai_intr; vq->vq_intrhand_arg = info->vqai_intr_arg; + if (VIRTIO_BUS_WITH_FEATURE(dev, VIRTIO_RING_F_EVENT_IDX) != 0) + vq->vq_flags |= VIRTQUEUE_FLAG_EVENT_IDX; + if (info->vqai_maxindirsz > 1) { error = virtqueue_init_indirect(vq, info->vqai_maxindirsz); if (error) @@ -384,9 +390,12 @@ virtqueue_full(struct virtqueue *vq) void virtqueue_notify(struct virtqueue *vq) { + /* Ensure updated avail->idx is visible to host. */ + mb(); + if (vq_ring_must_notify_host(vq)) + vq_ring_notify_host(vq); vq->vq_queued_cnt = 0; - vq_ring_notify_host(vq, 0); } int @@ -395,11 +404,8 @@ virtqueue_nused(struct virtqueue *vq) uint16_t used_idx, nused; used_idx = vq->vq_ring.used->idx; - if (used_idx >= vq->vq_used_cons_idx) - nused = used_idx - vq->vq_used_cons_idx; - else - nused = UINT16_MAX - vq->vq_used_cons_idx + - used_idx + 1; + + nused = (uint16_t)(used_idx - vq->vq_used_cons_idx); VQASSERT(vq, nused <= vq->vq_nentries, "used more than available"); return (nused); @@ -427,6 +433,10 @@ virtqueue_enable_intr(struct virtqueue * * index of what's already been consumed. */ vq->vq_ring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; + if (vq->vq_flags & VIRTQUEUE_FLAG_EVENT_IDX) + vring_used_event(&vq->vq_ring) = vq->vq_used_cons_idx; + else + vq->vq_ring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); @@ -441,6 +451,37 @@ virtqueue_enable_intr(struct virtqueue * return (0); } +int +virtqueue_postpone_intr(struct virtqueue *vq) +{ + uint16_t ndesc; + + /* + * Postpone until at least half of the available descriptors + * have been consumed. + * + * XXX Adaptive factor? (Linux uses 3/4) + */ + ndesc = (uint16_t)(vq->vq_ring.avail->idx - vq->vq_used_cons_idx) / 2; + + if (vq->vq_flags & VIRTQUEUE_FLAG_EVENT_IDX) + vring_used_event(&vq->vq_ring) = vq->vq_used_cons_idx + ndesc; + else + vq->vq_ring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; + + mb(); + + /* + * Enough items may have already been consumed to meet our + * threshold since we last checked. Let our caller know so + * it processes the new entries. + */ + if (virtqueue_nused(vq) > ndesc) + return (1); + + return (0); +} + void virtqueue_disable_intr(struct virtqueue *vq) { @@ -448,7 +489,8 @@ virtqueue_disable_intr(struct virtqueue /* * Note this is only considered a hint to the host. */ - vq->vq_ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; + if ((vq->vq_flags & VIRTQUEUE_FLAG_EVENT_IDX) == 0) + vq->vq_ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; } int @@ -618,7 +660,7 @@ vq_ring_update_avail(struct virtqueue *v mb(); vq->vq_ring.avail->idx++; - /* Keep pending count until virtqueue_notify() for debugging. */ + /* Keep pending count until virtqueue_notify(). */ vq->vq_queued_cnt++; } @@ -709,15 +751,27 @@ vq_ring_enqueue_indirect(struct virtqueu vq_ring_update_avail(vq, head_idx); } -static void -vq_ring_notify_host(struct virtqueue *vq, int force) +static int +vq_ring_must_notify_host(struct virtqueue *vq) { + uint16_t new_idx, prev_idx, event_idx; - mb(); + if (vq->vq_flags & VIRTQUEUE_FLAG_EVENT_IDX) { + new_idx = vq->vq_ring.avail->idx; + prev_idx = new_idx - vq->vq_queued_cnt; + event_idx = vring_avail_event(&vq->vq_ring); + + return (vring_need_event(event_idx, new_idx, prev_idx) != 0); + } + + return ((vq->vq_ring.used->flags & VRING_USED_F_NO_NOTIFY) == 0); +} + +static void +vq_ring_notify_host(struct virtqueue *vq) +{ - if (force || - (vq->vq_ring.used->flags & VRING_USED_F_NO_NOTIFY) == 0) - VIRTIO_BUS_NOTIFY_VQ(vq->vq_dev, vq->vq_queue_index); + VIRTIO_BUS_NOTIFY_VQ(vq->vq_dev, vq->vq_queue_index); } static void Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Sat Apr 14 04:40:11 2012 (r234269) +++ head/sys/dev/virtio/virtqueue.h Sat Apr 14 05:48:04 2012 (r234270) @@ -78,6 +78,7 @@ int virtqueue_reinit(struct virtqueue * int virtqueue_intr(struct virtqueue *vq); int virtqueue_enable_intr(struct virtqueue *vq); +int virtqueue_postpone_intr(struct virtqueue *vq); void virtqueue_disable_intr(struct virtqueue *vq); /* Get physical address of the virtqueue ring. */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 11:21:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0E4B106566B; Sat, 14 Apr 2012 11:21:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4F28FC08; Sat, 14 Apr 2012 11:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EBLOnS027666; Sat, 14 Apr 2012 11:21:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EBLOmG027664; Sat, 14 Apr 2012 11:21:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141121.q3EBLOmG027664@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 11:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234280 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 11:21:24 -0000 Author: marius Date: Sat Apr 14 11:21:24 2012 New Revision: 234280 URL: http://svn.freebsd.org/changeset/base/234280 Log: Fix !DDB build after r234190. Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sat Apr 14 10:36:43 2012 (r234279) +++ head/sys/kern/subr_turnstile.c Sat Apr 14 11:21:24 2012 (r234280) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -78,7 +79,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 11:29:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB87D106566B; Sat, 14 Apr 2012 11:29:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5C558FC17; Sat, 14 Apr 2012 11:29:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EBTWf3028136; Sat, 14 Apr 2012 11:29:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EBTWSa028123; Sat, 14 Apr 2012 11:29:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141129.q3EBTWSa028123@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 11:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234281 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 11:29:32 -0000 Author: marius Date: Sat Apr 14 11:29:32 2012 New Revision: 234281 URL: http://svn.freebsd.org/changeset/base/234281 Log: - Try to bring these files closer to style(9). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: head/sys/arm/at91/at91_pio.c head/sys/arm/at91/at91_piovar.h head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91_rst.c head/sys/arm/at91/at91_twi.c head/sys/arm/at91/at91_twireg.h head/sys/arm/at91/at91_wdt.c head/sys/arm/at91/at91reg.h head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91var.h head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/at91_pio.c ============================================================================== --- head/sys/arm/at91/at91_pio.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_pio.c Sat Apr 14 11:29:32 2012 (r234281) @@ -52,30 +52,32 @@ struct at91_pio_softc struct mtx sc_mtx; /* basically a perimeter lock */ struct cdev *cdev; int flags; -#define OPENED 1 +#define OPENED 1 }; static inline uint32_t RD4(struct at91_pio_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_pio_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } -#define AT91_PIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define AT91_PIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define AT91_PIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) -#define AT91_PIO_LOCK_INIT(_sc) \ +#define AT91_PIO_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "pio", MTX_SPIN) -#define AT91_PIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT91_PIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT91_PIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); -#define CDEV2SOFTC(dev) ((dev)->si_drv1) +#define AT91_PIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT91_PIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT91_PIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define CDEV2SOFTC(dev) ((dev)->si_drv1) static devclass_t at91_pio_devclass; @@ -132,9 +134,10 @@ at91_pio_probe(device_t dev) static int at91_pio_attach(device_t dev) { - struct at91_pio_softc *sc = device_get_softc(dev); + struct at91_pio_softc *sc; int err; + sc = device_get_softc(dev); sc->dev = dev; err = at91_pio_activate(dev); if (err) @@ -146,7 +149,7 @@ at91_pio_attach(device_t dev) AT91_PIO_LOCK_INIT(sc); /* - * Activate the interrupt, but disable all interrupts in the hardware + * Activate the interrupt, but disable all interrupts in the hardware. */ WR4(sc, PIO_IDR, 0xffffffff); err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, @@ -171,6 +174,7 @@ out: static int at91_pio_detach(device_t dev) { + return (EBUSY); /* XXX */ } @@ -215,7 +219,6 @@ at91_pio_deactivate(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->irq_res), sc->irq_res); sc->irq_res = 0; - return; } static int @@ -225,7 +228,7 @@ at91_pio_intr(void *xsc) #if 0 uint32_t status; - /* Reading the status also clears the interrupt */ + /* Reading the status also clears the interrupt. */ status = RD4(sc, PIO_SR); if (status == 0) return; @@ -236,7 +239,7 @@ at91_pio_intr(void *xsc) return (FILTER_HANDLED); } -static int +static int at91_pio_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct at91_pio_softc *sc; @@ -246,11 +249,11 @@ at91_pio_open(struct cdev *dev, int ofla if (!(sc->flags & OPENED)) { sc->flags |= OPENED; #if 0 - // Enable interrupts + /* Enable interrupts. */ #endif } AT91_PIO_UNLOCK(sc); - return (0); + return (0); } static int @@ -262,7 +265,7 @@ at91_pio_close(struct cdev *dev, int ffl AT91_PIO_LOCK(sc); sc->flags &= ~OPENED; #if 0 - // Disable interrupts + /* Disable interrupts. */ #endif AT91_PIO_UNLOCK(sc); return (0); @@ -272,6 +275,7 @@ static int at91_pio_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { + return (ENXIO); } @@ -280,6 +284,7 @@ at91_pio_ioctl(struct cdev *dev, u_long * don't use bus_space, as that isn't yet available when we need to use * them. */ + void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup) { @@ -369,11 +374,10 @@ at91_pio_gpio_set_deglitch(uint32_t pio, PIO[PIO_IFER / 4] = data_mask; else PIO[PIO_IFDR / 4] = data_mask; - return; } void -at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, +at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt) { uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); @@ -382,14 +386,14 @@ at91_pio_gpio_set_interrupt(uint32_t pio PIO[PIO_IER / 4] = data_mask; else PIO[PIO_IDR / 4] = data_mask; - return; } uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio) { uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); - /* reading this register will clear the interrupts */ + + /* Reading this register will clear the interrupts. */ return (PIO[PIO_ISR / 4]); } @@ -399,7 +403,7 @@ static device_method_t at91_pio_methods[ DEVMETHOD(device_attach, at91_pio_attach), DEVMETHOD(device_detach, at91_pio_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t at91_pio_driver = { @@ -408,4 +412,5 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; -DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, 0, 0); +DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, + NULL); Modified: head/sys/arm/at91/at91_piovar.h ============================================================================== --- head/sys/arm/at91/at91_piovar.h Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_piovar.h Sat Apr 14 11:29:32 2012 (r234281) @@ -26,19 +26,23 @@ /* $FreeBSD$ */ #ifndef ARM_AT91_AT91_PIOVAR_H -#define ARM_AT91_AT91_PIOVAR_H +#define ARM_AT91_AT91_PIOVAR_H -void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup); -void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup); +void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, + int use_pullup); +void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, + int use_pullup); void at91_pio_use_gpio(uint32_t pio, uint32_t gpio_mask); void at91_pio_gpio_input(uint32_t pio, uint32_t input_enable_mask); void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask, - int use_pullup); + int use_pullup); void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask); void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask); uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask); -void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch); -void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, int enable_interrupt); +void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, + int use_deglitch); +void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask, + int enable_interrupt); uint32_t at91_pio_gpio_clear_interrupt(uint32_t pio); #endif /* ARM_AT91_AT91_PIOVAR_H */ Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_pit.c Sat Apr 14 11:29:32 2012 (r234281) @@ -59,12 +59,14 @@ static uint32_t timecount = 0; static inline uint32_t RD4(struct pit_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct pit_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -112,11 +114,11 @@ at91pit_attach(device_t dev) RF_ACTIVE); if (sc->mem_res == NULL) - panic("couldn't allocate register resources"); + panic("couldn't allocate register resources"); rid = 0; irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 1, 1, 1, - RF_ACTIVE | RF_SHAREABLE); + RF_ACTIVE | RF_SHAREABLE); if (!irq) { device_printf(dev, "could not allocate interrupt resources.\n"); err = ENOMEM; @@ -124,16 +126,15 @@ at91pit_attach(device_t dev) } /* Activate the interrupt. */ - err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, pit_intr, - NULL, NULL, &ih); - + err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, pit_intr, NULL, NULL, + &ih); + at91pit_timecounter.tc_frequency = at91_master_clock / PIT_PRESCALE; tc_init(&at91pit_timecounter); - //Enable the PIT here. - WR4(sc, PIT_MR, - PIT_PIV(at91_master_clock / PIT_PRESCALE / hz) | - PIT_EN | PIT_IEN); + /* Enable the PIT here. */ + WR4(sc, PIT_MR, PIT_PIV(at91_master_clock / PIT_PRESCALE / hz) | + PIT_EN | PIT_IEN); out: return (err); } @@ -141,7 +142,7 @@ out: static device_method_t at91pit_methods[] = { DEVMETHOD(device_probe, at91pit_probe), DEVMETHOD(device_attach, at91pit_attach), - {0,0}, + DEVMETHOD_END }; static driver_t at91pit_driver = { @@ -152,7 +153,8 @@ static driver_t at91pit_driver = { static devclass_t at91pit_devclass; -DRIVER_MODULE(at91_pit, atmelarm, at91pit_driver, at91pit_devclass, 0, 0); +DRIVER_MODULE(at91_pit, atmelarm, at91pit_driver, at91pit_devclass, NULL, + NULL); static int pit_intr(void *arg) @@ -175,7 +177,7 @@ pit_intr(void *arg) static unsigned at91pit_get_timecount(struct timecounter *tc) { - uint32_t piir, icnt; + uint32_t piir, icnt; piir = RD4(sc, PIT_PIIR); /* Current count | over flows */ icnt = piir >> 20; /* Overflows */ @@ -192,7 +194,7 @@ DELAY(int us) last = PIT_PIV(RD4(sc, PIT_PIIR)); /* Max delay ~= 260s. @ 133Mhz */ - pit_freq = at91_master_clock / PIT_PRESCALE; + pit_freq = at91_master_clock / PIT_PRESCALE; cnt = ((pit_freq * us) + (mhz -1)) / mhz; cnt = (cnt <= 0) ? 1 : cnt; @@ -211,14 +213,17 @@ DELAY(int us) void cpu_startprofclock(void) { + } void cpu_stopprofclock(void) { + } void cpu_initclocks(void) { + } Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_pmc.c Sat Apr 14 11:29:32 2012 (r234281) @@ -180,9 +180,8 @@ at91_pmc_set_pllb_mode(struct at91_pmc_c if (on) { on = PMC_IER_LOCKB; value = sc->pllb_init; - } else { + } else value = 0; - } /* Workaround RM9200 Errata #26 */ if (at91_is_rm92() && @@ -232,12 +231,12 @@ at91_pmc_clock_add(const char *name, uin int i, buflen; clk = malloc(sizeof(*clk), M_PMC, M_NOWAIT | M_ZERO); - if (clk == NULL) + if (clk == NULL) goto err; buflen = strlen(name) + 1; clk->name = malloc(buflen, M_PMC, M_NOWAIT); - if (clk->name == NULL) + if (clk->name == NULL) goto err; strlcpy(clk->name, name, buflen); @@ -256,7 +255,7 @@ at91_pmc_clock_add(const char *name, uin } err: if (clk != NULL) { - if (clk->name != NULL) + if (clk->name != NULL) free(clk->name, M_PMC); free(clk, M_PMC); } @@ -331,15 +330,16 @@ at91_pmc_pll_rate(struct at91_pmc_clock div = (reg >> clk->pll_div_shift) & clk->pll_div_mask; mul = (reg >> clk->pll_mul_shift) & clk->pll_mul_mask; -// printf("pll = (%d / %d) * %d = %d\n", -// freq, div ,mul + 1, (freq/div) * (mul+1)); +#if 0 + printf("pll = (%d / %d) * %d = %d\n", + freq, div, mul + 1, (freq/div) * (mul+1)); +#endif if (div != 0 && mul != 0) { freq /= div; freq *= mul + 1; - } else { + } else freq = 0; - } clk->hz = freq; @@ -431,9 +431,8 @@ at91_pmc_init_clock(struct at91_pmc_soft if (at91_is_rm92()) { WR4(sc, PMC_SCDR, PMC_SCER_UHP | PMC_SCER_UDP); WR4(sc, PMC_SCER, PMC_SCER_MCKUDP); - } else { + } else WR4(sc, PMC_SCDR, PMC_SCER_UHP_SAM9 | PMC_SCER_UDP_SAM9); - } WR4(sc, CKGR_PLLBR, 0); /* @@ -443,15 +442,14 @@ at91_pmc_init_clock(struct at91_pmc_soft mck.parent = clock_list[mckr & 0x3]; mck.parent->refcnt++; - cpu.hz = - mck.hz = mck.parent->hz / - (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); + cpu.hz = mck.hz = mck.parent->hz / + (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; if (at91_is_sam9()) { if (mdiv > 0) mck.hz /= mdiv * 2; - } else + } else mck.hz /= (1 + mdiv); /* Only found on SAM9G20 */ @@ -574,7 +572,7 @@ at91_pmc_attach(device_t dev) static device_method_t at91_pmc_methods[] = { DEVMETHOD(device_probe, at91_pmc_probe), DEVMETHOD(device_attach, at91_pmc_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t at91_pmc_driver = { @@ -584,4 +582,5 @@ static driver_t at91_pmc_driver = { }; static devclass_t at91_pmc_devclass; -DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, 0, 0); +DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, NULL, + NULL); Modified: head/sys/arm/at91/at91_rst.c ============================================================================== --- head/sys/arm/at91/at91_rst.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_rst.c Sat Apr 14 11:29:32 2012 (r234281) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #define RST_TIMEOUT (5) /* Seconds to hold NRST for hard reset */ -#define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ +#define RST_TICK (20) /* sample NRST at hz/RST_TICK intervals */ static int rst_intr(void *arg); @@ -122,7 +122,7 @@ at91_rst_attach(device_t dev) case RST_SR_RST_WAKE: cause = "Wake Up"; break; - case RST_SR_RST_WDT: + case RST_SR_RST_WDT: cause = "Watchdog"; break; case RST_SR_RST_SOFT: @@ -153,7 +153,7 @@ rst_tick(void *argp) cpu_reset(); } else if ((RD4(sc, RST_SR) & RST_SR_NRSTL)) { /* User released the button in less than RST_TIMEOUT */ - sc->shutdown = 0; + sc->shutdown = 0; device_printf(sc->sc_dev, "shutting down...\n"); shutdown_nice(0); } else { @@ -167,7 +167,7 @@ rst_intr(void *argp) struct rst_softc *sc = argp; if (RD4(sc, RST_SR) & RST_SR_URSTS) { - if (sc->shutdown == 0) + if (sc->shutdown == 0) callout_reset(&sc->tick_ch, hz/RST_TICK, rst_tick, sc); return (FILTER_HANDLED); } @@ -177,7 +177,7 @@ rst_intr(void *argp) static device_method_t at91_rst_methods[] = { DEVMETHOD(device_probe, at91_rst_probe), DEVMETHOD(device_attach, at91_rst_attach), - {0,0}, + DEVMETHOD_END }; static driver_t at91_rst_driver = { @@ -188,7 +188,8 @@ static driver_t at91_rst_driver = { static devclass_t at91_rst_devclass; -DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, 0, 0); +DRIVER_MODULE(at91_rst, atmelarm, at91_rst_driver, at91_rst_devclass, NULL, + NULL); void cpu_reset_sam9g20(void) __attribute__((weak)); void cpu_reset_sam9g20(void) {} @@ -198,7 +199,6 @@ cpu_reset(void) { if (rst_sc) { - cpu_reset_sam9g20(); /* May be null */ WR4(rst_sc, RST_MR, @@ -211,5 +211,6 @@ cpu_reset(void) RST_CR_KEY); } - for(;;) ; + for(;;) + ; } Modified: head/sys/arm/at91/at91_twi.c ============================================================================== --- head/sys/arm/at91/at91_twi.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_twi.c Sat Apr 14 11:29:32 2012 (r234281) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include "iicbus_if.h" -#define TWI_SLOW_CLOCK 1500 -#define TWI_FAST_CLOCK 45000 -#define TWI_FASTEST_CLOCK 90000 +#define TWI_SLOW_CLOCK 1500 +#define TWI_FAST_CLOCK 45000 +#define TWI_FASTEST_CLOCK 90000 struct at91_twi_softc { @@ -67,24 +67,26 @@ struct at91_twi_softc static inline uint32_t RD4(struct at91_twi_softc *sc, bus_size_t off) { + return bus_read_4(sc->mem_res, off); } static inline void WR4(struct at91_twi_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } -#define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AT91_TWI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT91_TWI_LOCK_INIT(_sc) \ +#define AT91_TWI_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "twi", MTX_DEF) -#define AT91_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); -#define TWI_DEF_CLK 100000 +#define AT91_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define TWI_DEF_CLK 100000 static devclass_t at91_twi_devclass; @@ -102,6 +104,7 @@ static void at91_twi_deactivate(device_t static int at91_twi_probe(device_t dev) { + device_set_desc(dev, "TWI"); return (0); } @@ -385,7 +388,7 @@ static device_method_t at91_twi_methods[ DEVMETHOD(iicbus_callback, at91_twi_callback), DEVMETHOD(iicbus_reset, at91_twi_rst_card), DEVMETHOD(iicbus_transfer, at91_twi_transfer), - { 0, 0 } + DEVMETHOD_END }; static driver_t at91_twi_driver = { @@ -394,6 +397,7 @@ static driver_t at91_twi_driver = { sizeof(struct at91_twi_softc), }; -DRIVER_MODULE(at91_twi, atmelarm, at91_twi_driver, at91_twi_devclass, 0, 0); -DRIVER_MODULE(iicbus, at91_twi, iicbus_driver, iicbus_devclass, 0, 0); +DRIVER_MODULE(at91_twi, atmelarm, at91_twi_driver, at91_twi_devclass, NULL, + NULL); +DRIVER_MODULE(iicbus, at91_twi, iicbus_driver, iicbus_devclass, NULL, NULL); MODULE_DEPEND(at91_twi, iicbus, 1, 1, 1); Modified: head/sys/arm/at91/at91_twireg.h ============================================================================== --- head/sys/arm/at91/at91_twireg.h Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_twireg.h Sat Apr 14 11:29:32 2012 (r234281) @@ -26,61 +26,61 @@ /* $FreeBSD$ */ #ifndef ARM_AT91_AT91_TWIREG_H -#define ARM_AT91_AT91_TWIREG_H +#define ARM_AT91_AT91_TWIREG_H -#define TWI_CR 0x00 /* TWI Control Register */ -#define TWI_MMR 0x04 /* TWI Master Mode Register */ -#define TWI_SMR 0x08 /* TWI Master Mode Register */ -#define TWI_IADR 0x0c /* TWI Internal Address Register */ -#define TWI_CWGR 0x10 /* TWI Clock Waveform Generator Reg */ +#define TWI_CR 0x00 /* TWI Control Register */ +#define TWI_MMR 0x04 /* TWI Master Mode Register */ +#define TWI_SMR 0x08 /* TWI Master Mode Register */ +#define TWI_IADR 0x0c /* TWI Internal Address Register */ +#define TWI_CWGR 0x10 /* TWI Clock Waveform Generator Reg */ /* 0x14 reserved */ /* 0x18 reserved */ /* 0x1c reserved */ -#define TWI_SR 0x20 /* TWI Status Register */ -#define TWI_IER 0x24 /* TWI Interrupt Enable Register */ -#define TWI_IDR 0x28 /* TWI Interrupt Disable Register */ -#define TWI_IMR 0x2c /* TWI Interrupt Mask Register */ -#define TWI_RHR 0x30 /* TWI Receiver Holding Register */ -#define TWI_THR 0x34 /* TWI Transmit Holding Register */ +#define TWI_SR 0x20 /* TWI Status Register */ +#define TWI_IER 0x24 /* TWI Interrupt Enable Register */ +#define TWI_IDR 0x28 /* TWI Interrupt Disable Register */ +#define TWI_IMR 0x2c /* TWI Interrupt Mask Register */ +#define TWI_RHR 0x30 /* TWI Receiver Holding Register */ +#define TWI_THR 0x34 /* TWI Transmit Holding Register */ /* TWI_CR */ -#define TWI_CR_START (1U << 0) /* Send a start */ -#define TWI_CR_STOP (1U << 1) /* Send a stop */ -#define TWI_CR_MSEN (1U << 2) /* Master Transfer Enable */ -#define TWI_CR_MSDIS (1U << 3) /* Master Transfer Disable */ -#define TWI_CR_SVEN (1U << 4) /* Slave Transfer Enable */ -#define TWI_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ -#define TWI_CR_SWRST (1U << 7) /* Software Reset */ +#define TWI_CR_START (1U << 0) /* Send a start */ +#define TWI_CR_STOP (1U << 1) /* Send a stop */ +#define TWI_CR_MSEN (1U << 2) /* Master Transfer Enable */ +#define TWI_CR_MSDIS (1U << 3) /* Master Transfer Disable */ +#define TWI_CR_SVEN (1U << 4) /* Slave Transfer Enable */ +#define TWI_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ +#define TWI_CR_SWRST (1U << 7) /* Software Reset */ /* TWI_MMR */ /* TWI_SMR */ -#define TWI_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ -#define TWI_MMR_MWRITE 0U /* Master Read Direction */ -#define TWI_MMR_MREAD (1U << 12) /* Master Read Direction */ -#define TWI_MMR_DADR(n) ((n) << 15) /* Device Address */ +#define TWI_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ +#define TWI_MMR_MWRITE 0U /* Master Read Direction */ +#define TWI_MMR_MREAD (1U << 12) /* Master Read Direction */ +#define TWI_MMR_DADR(n) ((n) << 15) /* Device Address */ /* TWI_CWGR */ -#define TWI_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ -#define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ -#define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ -#define TWI_CWGR_DIV(rate) \ - (at91_is_sam9() ? \ - ((at91_master_clock /(4*(rate))) - 3) : \ - ((at91_master_clock /(4*(rate))) - 2)) +#define TWI_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ +#define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ +#define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ +#define TWI_CWGR_DIV(rate) \ + (at91_is_sam9() ? \ + ((at91_master_clock / (4 * (rate))) - 3) : \ + ((at91_master_clock / (4 * (rate))) - 2)) /* TWI_SR */ /* TWI_IER */ /* TWI_IDR */ /* TWI_IMR */ -#define TWI_SR_TXCOMP (1U << 0) /* Transmission Completed */ -#define TWI_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ -#define TWI_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ -#define TWI_SR_SVREAD (1U << 3) /* Slave Read */ -#define TWI_SR_SVACC (1U << 4) /* Slave Access */ -#define TWI_SR_GCACC (1U << 5) /* General Call Access */ -#define TWI_SR_OVRE (1U << 6) /* Overrun error */ -#define TWI_SR_UNRE (1U << 7) /* Underrun Error */ -#define TWI_SR_NACK (1U << 8) /* Not Acknowledged */ -#define TWI_SR_ARBLST (1U << 9) /* Arbitration Lost */ +#define TWI_SR_TXCOMP (1U << 0) /* Transmission Completed */ +#define TWI_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ +#define TWI_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ +#define TWI_SR_SVREAD (1U << 3) /* Slave Read */ +#define TWI_SR_SVACC (1U << 4) /* Slave Access */ +#define TWI_SR_GCACC (1U << 5) /* General Call Access */ +#define TWI_SR_OVRE (1U << 6) /* Overrun error */ +#define TWI_SR_UNRE (1U << 7) /* Underrun Error */ +#define TWI_SR_NACK (1U << 8) /* Not Acknowledged */ +#define TWI_SR_ARBLST (1U << 9) /* Arbitration Lost */ #endif /* ARM_AT91_AT91_TWIREG_H */ Modified: head/sys/arm/at91/at91_wdt.c ============================================================================== --- head/sys/arm/at91/at91_wdt.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91_wdt.c Sat Apr 14 11:29:32 2012 (r234281) @@ -24,9 +24,9 @@ */ /* - * The sam9 watchdog hardware can be programed only once. So we set the hardware - * watchdog to 16s in wdt_attach and only reset it in the wdt_tick - * handler. The watchdog is halted in processor debug mode. + * The SAM9 watchdog hardware can be programed only once. So we set the + * hardware watchdog to 16 s in wdt_attach and only reset it in the wdt_tick + * handler. The watchdog is halted in processor debug mode. */ #include @@ -52,19 +52,21 @@ struct wdt_softc { struct callout tick_ch; eventhandler_tag sc_wet; void *intrhand; - u_int cmd; - u_int interval; + u_int cmd; + u_int interval; }; static inline uint32_t RD4(struct wdt_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct wdt_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -157,7 +159,7 @@ wdt_attach(device_t dev) RF_ACTIVE); if (sc->mem_res == NULL) - panic("couldn't allocate wdt register resources"); + panic("couldn't allocate wdt register resources"); wdt_mr = RD4(sc, WDT_MR); if ((wdt_mr & WDT_WDRSTEN) == 0) @@ -172,9 +174,11 @@ wdt_attach(device_t dev) WR4(sc, WDT_MR, WDT_WDDBGHLT | WDT_WDD(0xC00)| WDT_WDFIEN| WDT_WDV(0xFFF)); #endif - /* This may have been set by Boot ROM so register value - * may not be what we just requested since this is a - * write once register. */ + /* + * This may have been set by Boot ROM so register value may + * not be what we just requested since this is a write once + * register. + */ wdt_mr = RD4(sc, WDT_MR); if (wdt_mr & WDT_WDFIEN) { rid = 0; @@ -184,15 +188,15 @@ wdt_attach(device_t dev) panic("could not allocate interrupt.\n"); err = bus_setup_intr(dev, irq, INTR_TYPE_CLK, wdt_intr, - NULL, sc, &sc->intrhand); + NULL, sc, &sc->intrhand); } /* interval * hz */ sc->interval = (((wdt_mr & WDT_WDV(~0)) + 1) * WDT_DIV) / - (WDT_CLOCK/hz); + (WDT_CLOCK/hz); device_printf(dev, "watchdog timeout: %d seconds\n", - sc->interval/hz); + sc->interval / hz); /* Slightly less than 1/2 of watchdog hardware timeout */ sc->interval = (sc->interval/2) - (sc->interval/20); @@ -208,7 +212,7 @@ wdt_attach(device_t dev) static device_method_t wdt_methods[] = { DEVMETHOD(device_probe, wdt_probe), DEVMETHOD(device_attach, wdt_attach), - {0,0}, + DEVMETHOD_END }; static driver_t wdt_driver = { @@ -219,4 +223,4 @@ static driver_t wdt_driver = { static devclass_t wdt_devclass; -DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, 0, 0); +DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, NULL, NULL); Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91reg.h Sat Apr 14 11:29:32 2012 (r234281) @@ -28,43 +28,44 @@ */ #ifndef _AT91REG_H_ -#define _AT91REG_H_ +#define _AT91REG_H_ #include "opt_at91.h" /* Where builtin peripherals start in KVM */ -#define AT91_BASE 0xd0000000 +#define AT91_BASE 0xd0000000 /* A few things that we count on being the same * throught the whole family of SOCs */ /* SYSC System Controler */ /* System Registers */ -#define AT91_SYS_BASE 0xffff000 -#define AT91_SYS_SIZE 0x1000 +#define AT91_SYS_BASE 0xffff000 +#define AT91_SYS_SIZE 0x1000 #if defined(AT91SAM9G45) || defined(AT91SAM9263) -#define AT91_DBGU_BASE 0xfffee00 +#define AT91_DBGU_BASE 0xfffee00 #else -#define AT91_DBGU_BASE 0xffff200 +#define AT91_DBGU_BASE 0xffff200 #endif -#define AT91_DBGU_SIZE 0x200 -#define DBGU_C1R (64) /* Chip ID1 Register */ -#define DBGU_C2R (68) /* Chip ID2 Register */ -#define DBGU_FNTR (72) /* Force NTRST Register */ - -#define AT91_CPU_VERSION_MASK 0x0000001f -#define AT91_CPU_RM9200 0x09290780 -#define AT91_CPU_SAM9260 0x019803a0 -#define AT91_CPU_SAM9261 0x019703a0 -#define AT91_CPU_SAM9263 0x019607a0 -#define AT91_CPU_SAM9G10 0x819903a0 -#define AT91_CPU_SAM9G20 0x019905a0 -#define AT91_CPU_SAM9G45 0x819b05a0 - -#define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) -#define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) -#define AT91_ARCH_SAM9 (0x19) -#define AT91_ARCH_RM92 (0x92) +#define AT91_DBGU_SIZE 0x200 +#define DBGU_C1R (64) /* Chip ID1 Register */ +#define DBGU_C2R (68) /* Chip ID2 Register */ +#define DBGU_FNTR (72) /* Force NTRST Register */ + +#define AT91_CPU_VERSION_MASK 0x0000001f +#define AT91_CPU_RM9200 0x09290780 +#define AT91_CPU_SAM9260 0x019803a0 +#define AT91_CPU_SAM9261 0x019703a0 +#define AT91_CPU_SAM9263 0x019607a0 +#define AT91_CPU_SAM9G10 0x819903a0 +#define AT91_CPU_SAM9G20 0x019905a0 +#define AT91_CPU_SAM9G45 0x819b05a0 + +#define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) +#define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) +#define AT91_ARCH_SAM9 (0x19) +#define AT91_ARCH_SAM9XE (0x29) +#define AT91_ARCH_RM92 (0x92) #endif /* _AT91REG_H_ */ Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91sam9260.c Sat Apr 14 11:29:32 2012 (r234281) @@ -93,7 +93,7 @@ static const int at91_irq_prio[32] = 0, /* Advanced Interrupt Controller IRQ2 */ }; -#define DEVICE(_name, _id, _unit) \ +#define DEVICE(_name, _id, _unit) \ { \ _name, _unit, \ AT91SAM9260_ ## _id ##_BASE, \ @@ -157,7 +157,7 @@ at91_add_child(device_t dev, int prio, c bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9260_BASE) + if (addr != 0 && addr < AT91SAM9260_BASE) addr += AT91SAM9260_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); @@ -182,13 +182,14 @@ at91_pll_outa(int freq) if (freq > 195000000) return (0x20000000); - else + else return (0x20008000); } static uint32_t at91_pll_outb(int freq) { + return (0x4000); } @@ -226,7 +227,7 @@ at91_attach(device_t dev) sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* + /* * XXX These values work for the RM9200, SAM926[01], and SAM9260 * will have to fix this when we want to support anything else. XXX */ @@ -247,7 +248,7 @@ at91_attach(device_t dev) at91sc->sc_irq_system = AT91SAM9260_IRQ_SYSTEM; for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + + bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + i * 4, i); /* Priority. */ bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, @@ -276,10 +277,9 @@ at91_attach(device_t dev) i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, AT91SAM9260_EBICSA); bus_space_write_4(sc->sc_st, sc->sc_matrix_sh, - AT91SAM9260_EBICSA, + AT91SAM9260_EBICSA, i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); - /* Update USB device port clock info */ clk = at91_pmc_clock_ref("udpck"); clk->pmc_mask = PMC_SCER_UDP_SAM9; @@ -304,11 +304,12 @@ at91_attach(device_t dev) at91_pmc_clock_deref(clk); /* - * Fudge MAX pll in frequence down below 3.0 Mhz to ensure - * PMC alogrithm choose the divisor that causes the input clock - * to be near the optimal 2 Mhz per datasheet. We know - * we are going to be using this for the USB clock at 96 Mhz. - * Causes no extra frequency deviation for all recomended crystal values. + * Fudge MAX pll in frequence down below 3.0 MHz to ensure + * PMC alogrithm choose the divisor that causes the input clock + * to be near the optimal 2 MHz per datasheet. We know + * we are going to be using this for the USB clock at 96 MHz. + * Causes no extra frequency deviation for all recomended crystal + * values. */ clk = at91_pmc_clock_ref("pllb"); clk->pll_min_in = SAM9260_PLL_B_MIN_IN_FREQ; /* 1 MHz */ @@ -329,7 +330,7 @@ static device_method_t at91sam9260_metho DEVMETHOD(device_probe, at91_probe), DEVMETHOD(device_attach, at91_attach), DEVMETHOD(device_identify, at91_identify), - {0, 0}, + DEVMETHOD_END }; static driver_t at91sam9260_driver = { @@ -340,4 +341,5 @@ static driver_t at91sam9260_driver = { static devclass_t at91sam9260_devclass; -DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 0, 0); +DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, + NULL, NULL); Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/at91var.h Sat Apr 14 11:29:32 2012 (r234281) @@ -62,24 +62,27 @@ struct cpu_devs extern uint32_t at91_chip_id; static inline int at91_is_rm92(void); -static inline int at91_is_sam9(void) ; +static inline int at91_is_sam9(void); static inline int at91_cpu_is(u_int cpu); -static inline int -at91_is_rm92(void) +static inline int +at91_is_rm92(void) { + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_RM92); } -static inline int -at91_is_sam9(void) +static inline int +at91_is_sam9(void) { + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9); } -static inline int +static inline int at91_cpu_is(u_int cpu) { + return (AT91_CPU(at91_chip_id) == cpu); } Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Sat Apr 14 11:21:24 2012 (r234280) +++ head/sys/arm/at91/if_ate.c Sat Apr 14 11:29:32 2012 (r234281) @@ -120,38 +120,38 @@ __FBSDID("$FreeBSD$"); struct ate_softc { - struct ifnet *ifp; /* ifnet pointer */ - struct mtx sc_mtx; /* Basically a perimeter lock */ - device_t dev; /* Myself */ - device_t miibus; /* My child miibus */ - struct resource *irq_res; /* IRQ resource */ - struct resource *mem_res; /* Memory resource */ - struct callout tick_ch; /* Tick callout */ + struct ifnet *ifp; /* ifnet pointer */ + struct mtx sc_mtx; /* Basically a perimeter lock */ + device_t dev; /* Myself */ + device_t miibus; /* My child miibus */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 11:31:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D2311065670; Sat, 14 Apr 2012 11:31:44 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [IPv6:2a01:e0c:1:1599::14]) by mx1.freebsd.org (Postfix) with ESMTP id 94B6B8FC19; Sat, 14 Apr 2012 11:31:39 +0000 (UTC) Received: from endor.tataz.chchile.org (unknown [82.233.239.98]) by smtp5-g21.free.fr (Postfix) with ESMTP id B21D8D48101; Sat, 14 Apr 2012 13:31:33 +0200 (CEST) Received: from felucia.tataz.chchile.org (felucia.tataz.chchile.org [192.168.1.9]) by endor.tataz.chchile.org (Postfix) with ESMTP id 92945952; Sat, 14 Apr 2012 13:31:32 +0200 (CEST) Received: by felucia.tataz.chchile.org (Postfix, from userid 1000) id 8598D647E; Sat, 14 Apr 2012 11:31:32 +0000 (UTC) Date: Sat, 14 Apr 2012 13:31:32 +0200 From: Jeremie Le Hen To: Sergey Kandaurov Message-ID: <20120414113132.GA71196@felucia.tataz.chchile.org> Mail-Followup-To: Sergey Kandaurov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201203220942.q2M9gSvv017339@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203220942.q2M9gSvv017339@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r233296 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 11:31:44 -0000 Hi Sergey, On Thu, Mar 22, 2012 at 09:42:28AM +0000, Sergey Kandaurov wrote: > Author: pluknet > Date: Thu Mar 22 09:42:27 2012 > New Revision: 233296 > URL: http://svn.freebsd.org/changeset/base/233296 > > Log: > Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5 > when passing damaged user-supplied fstab file data. > > MFC after: 1 week > > Modified: > head/lib/libc/gen/fstab.c > > Modified: head/lib/libc/gen/fstab.c > ============================================================================== > --- head/lib/libc/gen/fstab.c Thu Mar 22 09:29:07 2012 (r233295) > +++ head/lib/libc/gen/fstab.c Thu Mar 22 09:42:27 2012 (r233296) > @@ -91,7 +91,7 @@ fixfsfile() > struct stat sb; > struct statfs sf; > > - if (strcmp(_fs_fstab.fs_file, "/") != 0) > + if (_fs_fstab.fs_file != NULL &&strcmp(_fs_fstab.fs_file, "/") != 0) > return; > if (statfs("/", &sf) != 0) > return; Would you mind MFC'ing this please? It bit me today :). Thanks. -- Jeremie Le Hen Men are born free and equal. Later on, they're on their own. Jean Yanne From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 13:39:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B035106564A; Sat, 14 Apr 2012 13:39:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9C878FC08; Sat, 14 Apr 2012 13:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EDddrK032269; Sat, 14 Apr 2012 13:39:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EDddaP032267; Sat, 14 Apr 2012 13:39:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201204141339.q3EDddaP032267@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 14 Apr 2012 13:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234283 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 13:39:40 -0000 Author: bz Date: Sat Apr 14 13:39:39 2012 New Revision: 234283 URL: http://svn.freebsd.org/changeset/base/234283 Log: Make compile on 64bit somehow for now after a first try at r234242 on maybe 32bit? Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 11:44:10 2012 (r234282) +++ head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 13:39:39 2012 (r234283) @@ -161,9 +161,11 @@ netmap_ofstophys(vm_offset_t offset) return p[i]->lut[offset / p[i]->_objsize].paddr + offset % p[i]->_objsize; } - D("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", o, - (u_int)p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, - p[0]->_memtotal + p[1]->_memtotal + p[2]->_memtotal); + D("invalid ofs 0x%jx out of 0x%jx 0x%jx 0x%jx", (uintmax_t)o, + (uintmax_t)p[0]->_memtotal, + (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal), + (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal + + p[2]->_memtotal)); return 0; // XXX bad address } From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 13:40:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C31861065695; Sat, 14 Apr 2012 13:40:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF2908FC0C; Sat, 14 Apr 2012 13:40:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EDedQi032341; Sat, 14 Apr 2012 13:40:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EDedvJ032339; Sat, 14 Apr 2012 13:40:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201204141340.q3EDedvJ032339@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 14 Apr 2012 13:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234284 - head/sys/modules/iscsi/initiator X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 13:40:39 -0000 Author: bz Date: Sat Apr 14 13:40:39 2012 New Revision: 234284 URL: http://svn.freebsd.org/changeset/base/234284 Log: Fix LINT builds after r234233; not sure why modules need DEBUG by default. Modified: head/sys/modules/iscsi/initiator/Makefile Modified: head/sys/modules/iscsi/initiator/Makefile ============================================================================== --- head/sys/modules/iscsi/initiator/Makefile Sat Apr 14 13:39:39 2012 (r234283) +++ head/sys/modules/iscsi/initiator/Makefile Sat Apr 14 13:40:39 2012 (r234284) @@ -10,7 +10,7 @@ SRCS+= iscsi.c isc_cam.c isc_soc.c isc_s SRCS+= opt_cam.h opt_iscsi_initiator.h SRCS+= bus_if.h device_if.h #CFLAGS+= -DNO_USE_MBUF -CFLAGS+= -DISCSI_INITIATOR_DEBUG=2 +#CFLAGS+= -DISCSI_INITIATOR_DEBUG=2 CFLAGS+= -I$S CFLAGS+= -DINVARIANTS .include From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 16:07:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82E5106566C; Sat, 14 Apr 2012 16:07:02 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A17048FC08; Sat, 14 Apr 2012 16:07:01 +0000 (UTC) Received: by wern13 with SMTP id n13so3369703wer.13 for ; Sat, 14 Apr 2012 09:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=BJSWmXE6iAashe3X2mIHQSsyX5zcgLPQrdu120YDY8o=; b=ZoV7WZGa7hyInXT8q1pJId/NVUB5PAPTnw9Vc/qerlSesBop2Yrbk1P2s+Vg+VA/R5 zHF0uiUHSD09dJfUkIotatCzG9XTdvS1gbgTbWuGv753wG+GSTzlNDXUlKJrMiaP841+ t18SHie7vI5wX11OpXdl66u4RXaIEoYwmJ2nCGdDUeu8vkTC0JURUyECMB+zclwxji8n NWffMfOH/1V+sTDrm6UNl6bdSR3N9QSDuGYBz75vidtQyCJjCvSaGa4wB7ND/YktqZh3 yszmNsVwmlIjgGCvz4TQ8Hex25GrTj08m5Gez9xrg1/T9wVbx3YZeZHiS6Stj2dbHIsz lc1g== Received: by 10.180.91.165 with SMTP id cf5mr5078119wib.2.1334419620679; Sat, 14 Apr 2012 09:07:00 -0700 (PDT) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id b3sm5400014wib.4.2012.04.14.09.06.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Apr 2012 09:06:58 -0700 (PDT) From: Mikolaj Golub To: Jaakko Heinonen References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> <86vco2yvrt.fsf@kopusha.home.net> <20120413061139.GA2370@a91-153-116-96.elisa-laajakaista.fi> X-Comment-To: Jaakko Heinonen Sender: Mikolaj Golub Date: Sat, 14 Apr 2012 19:06:56 +0300 In-Reply-To: <20120413061139.GA2370@a91-153-116-96.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Fri, 13 Apr 2012 09:11:39 +0300") Message-ID: <86pqbawb4v.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 16:07:03 -0000 On Fri, 13 Apr 2012 09:11:39 +0300 Jaakko Heinonen wrote: JH> On 2012-01-23, Mikolaj Golub wrote: >> I see two issues with this patch: JH> What do you think about this patch? I think it is much better than we have currently :-). JH> %%% JH> Index: sys/fs/tmpfs/tmpfs.h JH> =================================================================== JH> --- sys/fs/tmpfs/tmpfs.h (revision 234201) JH> +++ sys/fs/tmpfs/tmpfs.h (working copy) JH> @@ -387,6 +387,9 @@ struct tmpfs_mount { JH> * tmpfs_pool.c. */ JH> uma_zone_t tm_dirent_pool; JH> uma_zone_t tm_node_pool; JH> + JH> + /* Read-only status. */ JH> + int tm_ronly; JH> }; JH> #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) JH> #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c JH> =================================================================== JH> --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 234201) JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { JH> NULL JH> }; JH> JH> +static const char *tmpfs_updateopts[] = { JH> + "from", "export", NULL JH> +}; JH> + JH> /* --------------------------------------------------------------------- */ JH> JH> static int JH> @@ -150,12 +154,13 @@ tmpfs_mount(struct mount *mp) JH> return (EINVAL); JH> JH> if (mp->mnt_flag & MNT_UPDATE) { JH> - /* JH> - * Only support update mounts for NFS export. JH> - */ JH> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) JH> - return (0); JH> - return (EOPNOTSUPP); JH> + /* Only support update mounts for certain options. */ JH> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) JH> + return (EOPNOTSUPP); JH> + if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) != JH> + ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly) JH> + return (EOPNOTSUPP); JH> + return (0); JH> } JH> JH> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); JH> @@ -228,6 +233,7 @@ tmpfs_mount(struct mount *mp) JH> tmpfs_node_ctor, tmpfs_node_dtor, JH> tmpfs_node_init, tmpfs_node_fini, JH> UMA_ALIGN_PTR, 0); JH> + tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; JH> JH> /* Allocate the root node. */ JH> error = tmpfs_alloc_node(tmp, VDIR, root_uid, JH> %%% JH> -- JH> Jaakko -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 16:42:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53EB106564A; Sat, 14 Apr 2012 16:42:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6FAE8FC18; Sat, 14 Apr 2012 16:42:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EGgHl8038512; Sat, 14 Apr 2012 16:42:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EGgH1f038510; Sat, 14 Apr 2012 16:42:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201204141642.q3EGgH1f038510@svn.freebsd.org> From: Dimitry Andric Date: Sat, 14 Apr 2012 16:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234289 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 16:42:18 -0000 Author: dim Date: Sat Apr 14 16:42:17 2012 New Revision: 234289 URL: http://svn.freebsd.org/changeset/base/234289 Log: Add files and directories to be cleaned up if WITHOUT_GCC is in effect to OptionalObsoleteFiles.inc. MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Apr 14 14:02:34 2012 (r234288) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Apr 14 16:42:17 2012 (r234289) @@ -1409,6 +1409,42 @@ OLD_FILES+=usr/share/man/man8/strfile.8. OLD_FILES+=usr/share/man/man8/unstr.8.gz .endif +.if ${MK_GCC} == no +OLD_FILES+=usr/bin/c++filt +OLD_FILES+=usr/bin/g++ +OLD_FILES+=usr/bin/gcc +OLD_FILES+=usr/bin/gcov +OLD_FILES+=usr/bin/gcpp +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/gcc/4.2/emmintrin.h +OLD_FILES+=usr/include/gcc/4.2/mm_malloc.h +OLD_FILES+=usr/include/gcc/4.2/mmintrin.h +OLD_FILES+=usr/include/gcc/4.2/pmmintrin.h +OLD_FILES+=usr/include/gcc/4.2/tmmintrin.h +OLD_FILES+=usr/include/gcc/4.2/xmmintrin.h +.elif ${TARGET_ARCH} == "ia64" +OLD_FILES+=usr/include/gcc/4.2/ia64intrin.h +.elif ${TARGET_ARCH} == "arm" +OLD_FILES+=usr/include/gcc/4.2/mmintrin.h +.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" +OLD_FILES+=usr/include/gcc/4.2/altivec.h +OLD_FILES+=usr/include/gcc/4.2/ppc-asm.h +OLD_FILES+=usr/include/gcc/4.2/spe.h +.endif +OLD_DIRS+=usr/include/gcc/4.2 +OLD_DIRS+=usr/include/gcc +OLD_FILES+=usr/libexec/cc1 +OLD_FILES+=usr/libexec/cc1plus +OLD_FILES+=usr/share/info/cpp.info.gz +OLD_FILES+=usr/share/info/cppinternals.info.gz +OLD_FILES+=usr/share/info/gcc.info.gz +OLD_FILES+=usr/share/info/gccint.info.gz +OLD_FILES+=usr/share/man/man1/g++.1.gz +OLD_FILES+=usr/share/man/man1/gcc.1.gz +OLD_FILES+=usr/share/man/man1/gcov.1.gz +OLD_FILES+=usr/share/man/man1/gcpp.1.gz +.endif + .if ${MK_GCOV} == no OLD_FILES+=usr/bin/gcov OLD_FILES+=usr/share/man/man1/gcov.1.gz From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 16:44:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CE91106566B; Sat, 14 Apr 2012 16:44:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 489D18FC17; Sat, 14 Apr 2012 16:44:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EGiJ2i038634; Sat, 14 Apr 2012 16:44:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EGiJ3h038632; Sat, 14 Apr 2012 16:44:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201204141644.q3EGiJ3h038632@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 14 Apr 2012 16:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234290 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 16:44:19 -0000 Author: luigi Date: Sat Apr 14 16:44:18 2012 New Revision: 234290 URL: http://svn.freebsd.org/changeset/base/234290 Log: i prefer this fix for the -Wformat warning (just one cast, all the other variables are already correct for %x). My previous attempt put the cast in the wrong place. Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 16:42:17 2012 (r234289) +++ head/sys/dev/netmap/netmap_mem2.c Sat Apr 14 16:44:18 2012 (r234290) @@ -161,11 +161,9 @@ netmap_ofstophys(vm_offset_t offset) return p[i]->lut[offset / p[i]->_objsize].paddr + offset % p[i]->_objsize; } - D("invalid ofs 0x%jx out of 0x%jx 0x%jx 0x%jx", (uintmax_t)o, - (uintmax_t)p[0]->_memtotal, - (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal), - (uintmax_t)(p[0]->_memtotal + p[1]->_memtotal + - p[2]->_memtotal)); + D("invalid ofs 0x%x out of 0x%x 0x%x 0x%x", (u_int)o, + p[0]->_memtotal, p[0]->_memtotal + p[1]->_memtotal, + p[0]->_memtotal + p[1]->_memtotal + p[2]->_memtotal); return 0; // XXX bad address } From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 17:09:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7828F106564A; Sat, 14 Apr 2012 17:09:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 581E78FC08; Sat, 14 Apr 2012 17:09:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EH9dCo039466; Sat, 14 Apr 2012 17:09:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EH9dQf039457; Sat, 14 Apr 2012 17:09:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141709.q3EH9dQf039457@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 17:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234291 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 17:09:39 -0000 Author: marius Date: Sat Apr 14 17:09:38 2012 New Revision: 234291 URL: http://svn.freebsd.org/changeset/base/234291 Log: Add support for the Atmel SAM9XE familiy of microcontrollers, which consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip flash. Tested with SAM9XE512. Modified: head/sys/arm/at91/at91_pit.c head/sys/arm/at91/at91_rst.c head/sys/arm/at91/at91_twireg.h head/sys/arm/at91/at91_wdt.c head/sys/arm/at91/at91reg.h head/sys/arm/at91/at91sam9260.c head/sys/arm/at91/at91var.h head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91_pit.c Sat Apr 14 17:09:38 2012 (r234291) @@ -90,7 +90,7 @@ static int at91pit_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "AT91SAM9 PIT"); return (0); } Modified: head/sys/arm/at91/at91_rst.c ============================================================================== --- head/sys/arm/at91/at91_rst.c Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91_rst.c Sat Apr 14 17:09:38 2012 (r234291) @@ -71,7 +71,7 @@ static int at91_rst_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "AT91SAM9 Reset Controller"); return (0); } Modified: head/sys/arm/at91/at91_twireg.h ============================================================================== --- head/sys/arm/at91/at91_twireg.h Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91_twireg.h Sat Apr 14 17:09:38 2012 (r234291) @@ -64,7 +64,7 @@ #define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ #define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ #define TWI_CWGR_DIV(rate) \ - (at91_is_sam9() ? \ + (at91_is_sam9() || at91_is_sam9xe() ? \ ((at91_master_clock / (4 * (rate))) - 3) : \ ((at91_master_clock / (4 * (rate))) - 2)) Modified: head/sys/arm/at91/at91_wdt.c ============================================================================== --- head/sys/arm/at91/at91_wdt.c Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91_wdt.c Sat Apr 14 17:09:38 2012 (r234291) @@ -132,7 +132,7 @@ static int wdt_probe(device_t dev) { - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { device_set_desc(dev, "WDT"); return (0); } Modified: head/sys/arm/at91/at91reg.h ============================================================================== --- head/sys/arm/at91/at91reg.h Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91reg.h Sat Apr 14 17:09:38 2012 (r234291) @@ -61,6 +61,9 @@ #define AT91_CPU_SAM9G10 0x819903a0 #define AT91_CPU_SAM9G20 0x019905a0 #define AT91_CPU_SAM9G45 0x819b05a0 +#define AT91_CPU_SAM9XE128 0x329973a0 +#define AT91_CPU_SAM9XE256 0x329a93a0 +#define AT91_CPU_SAM9XE512 0x329aa3a0 #define AT91_ARCH(chipid) ((chipid >> 20) & 0xff) #define AT91_CPU(chipid) (chipid & ~AT91_CPU_VERSION_MASK) Modified: head/sys/arm/at91/at91sam9260.c ============================================================================== --- head/sys/arm/at91/at91sam9260.c Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91sam9260.c Sat Apr 14 17:09:38 2012 (r234291) @@ -197,21 +197,40 @@ static void at91_identify(driver_t *drv, device_t parent) { - if (at91_cpu_is(AT91_CPU_SAM9260)) { + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + case AT91_CPU_SAM9XE128: + case AT91_CPU_SAM9XE256: + case AT91_CPU_SAM9XE512: at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); at91_cpu_add_builtin_children(parent); + break; } } static int at91_probe(device_t dev) { + const char *desc; - if (at91_cpu_is(AT91_CPU_SAM9260)) { - device_set_desc(dev, "AT91SAM9260"); - return (0); + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + desc = "AT91SAM9260"; + break; + case AT91_CPU_SAM9XE128: + desc = "AT91SAM9XE128"; + break; + case AT91_CPU_SAM9XE256: + desc = "AT91SAM9XE256"; + break; + case AT91_CPU_SAM9XE512: + desc = "AT91SAM9XE512"; + break; + default: + return (ENXIO); } - return (ENXIO); + device_set_desc(dev, desc); + return (0); } static int @@ -227,10 +246,6 @@ at91_attach(device_t dev) sc->sc_sh = at91sc->sc_sh; sc->dev = dev; - /* - * XXX These values work for the RM9200, SAM926[01], and SAM9260 - * will have to fix this when we want to support anything else. XXX - */ if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91SAM9260_SYS_BASE, AT91SAM9260_SYS_SIZE, &sc->sc_sys_sh) != 0) panic("Enable to map system registers"); Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/at91var.h Sat Apr 14 17:09:38 2012 (r234291) @@ -63,6 +63,7 @@ extern uint32_t at91_chip_id; static inline int at91_is_rm92(void); static inline int at91_is_sam9(void); +static inline int at91_is_sam9xe(void); static inline int at91_cpu_is(u_int cpu); static inline int @@ -80,6 +81,13 @@ at91_is_sam9(void) } static inline int +at91_is_sam9xe(void) +{ + + return (AT91_ARCH(at91_chip_id) == AT91_ARCH_SAM9XE); +} + +static inline int at91_cpu_is(u_int cpu) { Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Sat Apr 14 16:44:18 2012 (r234290) +++ head/sys/arm/at91/if_ate.c Sat Apr 14 17:09:38 2012 (r234291) @@ -266,7 +266,7 @@ ate_attach(device_t dev) } /* New or old version, chooses buffer size. */ - sc->is_emacb = at91_is_sam9(); + sc->is_emacb = at91_is_sam9() || at91_is_sam9xe(); sc->rx_buf_size = RX_BUF_SIZE(sc); err = ate_activate(dev); From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 17:17:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF9151065672; Sat, 14 Apr 2012 17:17:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16C38FC0C; Sat, 14 Apr 2012 17:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EHHtXP039773; Sat, 14 Apr 2012 17:17:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EHHtmx039771; Sat, 14 Apr 2012 17:17:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141717.q3EHHtmx039771@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 17:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234292 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 17:17:56 -0000 Author: marius Date: Sat Apr 14 17:17:55 2012 New Revision: 234292 URL: http://svn.freebsd.org/changeset/base/234292 Log: Add support for the Atmel SAM9XE familiy of microcontrollers, which consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip flash. Tested with SAM9XE512. This file was missed in r234291. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sat Apr 14 17:09:38 2012 (r234291) +++ head/sys/arm/at91/at91_pmc.c Sat Apr 14 17:17:55 2012 (r234292) @@ -162,12 +162,14 @@ static const unsigned int at91_mainf_tbl static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { + return (bus_read_4(sc->mem_res, off)); } static inline void WR4(struct at91_pmc_softc *sc, bus_size_t off, uint32_t val) { + bus_write_4(sc->mem_res, off, val); } @@ -225,7 +227,8 @@ at91_pmc_set_periph_mode(struct at91_pmc } struct at91_pmc_clock * -at91_pmc_clock_add(const char *name, uint32_t irq, struct at91_pmc_clock *parent) +at91_pmc_clock_add(const char *name, uint32_t irq, + struct at91_pmc_clock *parent) { struct at91_pmc_clock *clk; int i, buflen; @@ -299,11 +302,13 @@ at91_pmc_clock_ref(const char *name) void at91_pmc_clock_deref(struct at91_pmc_clock *clk) { + } void at91_pmc_clock_enable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (clk->parent) at91_pmc_clock_enable(clk->parent); @@ -314,6 +319,7 @@ at91_pmc_clock_enable(struct at91_pmc_cl void at91_pmc_clock_disable(struct at91_pmc_clock *clk) { + /* XXX LOCKING? XXX */ if (--clk->refcnt == 0 && clk->set_mode) clk->set_mode(clk, 0); @@ -342,7 +348,6 @@ at91_pmc_pll_rate(struct at91_pmc_clock freq = 0; clk->hz = freq; - return (freq); } @@ -402,7 +407,7 @@ at91_pmc_init_clock(struct at91_pmc_soft uint32_t mckr; uint32_t mdiv; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; } @@ -446,7 +451,7 @@ at91_pmc_init_clock(struct at91_pmc_soft (1 << ((mckr & PMC_MCKR_PRES_MASK) >> 2)); mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; - if (at91_is_sam9()) { + if (at91_is_sam9() || at91_is_sam9xe()) { if (mdiv > 0) mck.hz /= mdiv * 2; } else @@ -486,7 +491,6 @@ at91_pmc_deactivate(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, rman_get_rid(sc->mem_res), sc->mem_res); sc->mem_res = 0; - return; } static int From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 17:27:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B8541065673; Sat, 14 Apr 2012 17:27:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36BE58FC08; Sat, 14 Apr 2012 17:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EHRZkc040098; Sat, 14 Apr 2012 17:27:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EHRZok040096; Sat, 14 Apr 2012 17:27:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201204141727.q3EHRZok040096@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 Apr 2012 17:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234293 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 17:27:35 -0000 Author: marius Date: Sat Apr 14 17:27:34 2012 New Revision: 234293 URL: http://svn.freebsd.org/changeset/base/234293 Log: Generate an obviously missing STOP when having finished transmitting data. This fixes communication with PCF8563. Modified: head/sys/arm/at91/at91_twi.c Modified: head/sys/arm/at91/at91_twi.c ============================================================================== --- head/sys/arm/at91/at91_twi.c Sat Apr 14 17:17:55 2012 (r234292) +++ head/sys/arm/at91/at91_twi.c Sat Apr 14 17:27:34 2012 (r234293) @@ -364,6 +364,7 @@ at91_twi_transfer(device_t dev, struct i goto out; WR4(sc, TWI_THR, *buf++); } + WR4(sc, TWI_CR, TWI_CR_STOP); } if ((err = at91_twi_wait(sc, TWI_SR_TXCOMP))) break; From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 20:22:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 373CB1065670; Sat, 14 Apr 2012 20:22:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2221B8FC0A; Sat, 14 Apr 2012 20:22:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EKM1Pr045640; Sat, 14 Apr 2012 20:22:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EKM1Us045638; Sat, 14 Apr 2012 20:22:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201204142022.q3EKM1Us045638@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Apr 2012 20:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234296 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 20:22:02 -0000 Author: tuexen Date: Sat Apr 14 20:22:01 2012 New Revision: 234296 URL: http://svn.freebsd.org/changeset/base/234296 Log: Bugfix: Don't send HBs on path which are not idle. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Apr 14 17:35:59 2012 (r234295) +++ head/sys/netinet/sctp_timer.c Sat Apr 14 20:22:01 2012 (r234296) @@ -1438,7 +1438,22 @@ sctp_heartbeat_timer(struct sctp_inpcb * * when move to PF during threshold mangement, a HB has been * queued in that routine */ - sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + uint32_t ms_gone_by; + + if ((net->last_sent_time.tv_sec > 0) || + (net->last_sent_time.tv_usec > 0)) { + struct timeval diff; + + SCTP_GETTIME_TIMEVAL(&diff); + timevalsub(&diff, &net->last_sent_time); + ms_gone_by = (uint32_t) (diff.tv_sec * 1000) + + (uint32_t) (diff.tv_usec / 1000); + } else { + ms_gone_by = 0xffffffff; + } + if (ms_gone_by >= net->heart_beat_delay) { + sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); + } } return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 21:01:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08941106564A; Sat, 14 Apr 2012 21:01:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E83358FC14; Sat, 14 Apr 2012 21:01:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EL1ioM047822; Sat, 14 Apr 2012 21:01:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EL1iPj047820; Sat, 14 Apr 2012 21:01:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201204142101.q3EL1iPj047820@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Apr 2012 21:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234297 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 21:01:45 -0000 Author: tuexen Date: Sat Apr 14 21:01:44 2012 New Revision: 234297 URL: http://svn.freebsd.org/changeset/base/234297 Log: Send always HBs when in PF state. MFC after: 1 week X-MFC with: r234296 Modified: head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sat Apr 14 20:22:01 2012 (r234296) +++ head/sys/netinet/sctp_timer.c Sat Apr 14 21:01:44 2012 (r234297) @@ -1451,7 +1451,8 @@ sctp_heartbeat_timer(struct sctp_inpcb * } else { ms_gone_by = 0xffffffff; } - if (ms_gone_by >= net->heart_beat_delay) { + if ((ms_gone_by >= net->heart_beat_delay) || + (net->dest_state & SCTP_ADDR_PF)) { sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); } } From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 23:05:45 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 688C71065670; Sat, 14 Apr 2012 23:05:45 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (ns1.scsiguy.com [70.89.174.89]) by mx1.freebsd.org (Postfix) with ESMTP id 3513E8FC1A; Sat, 14 Apr 2012 23:05:45 +0000 (UTC) Received: from [192.168.0.99] (macbook.scsiguy.com [192.168.0.99]) (authenticated bits=0) by aslan.scsiguy.com (8.14.5/8.14.5) with ESMTP id q3EN5a9Y071518 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 14 Apr 2012 17:05:36 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: "Justin T. Gibbs" In-Reply-To: <20120410114118.GB93449@alchemy.franken.de> Date: Sat, 14 Apr 2012 17:05:35 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201204092241.q39MfJZn081610@svn.freebsd.org> <20120409230949.GB68111@alchemy.franken.de> <20120410114118.GB93449@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (aslan.scsiguy.com [192.168.0.4]); Sat, 14 Apr 2012 17:05:36 -0600 (MDT) Cc: Attilio Rao , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r234074 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 23:05:45 -0000 On Apr 10, 2012, at 5:41 AM, Marius Strobl wrote: > On Tue, Apr 10, 2012 at 01:03:56AM +0100, Attilio Rao wrote: >> Il 10 aprile 2012 00:09, Marius Strobl ha = scritto: >>> On Mon, Apr 09, 2012 at 10:41:19PM +0000, Attilio Rao wrote: >>>> Author: attilio >>>> Date: Mon Apr ??9 22:41:19 2012 >>>> New Revision: 234074 >>>> URL: http://svn.freebsd.org/changeset/base/234074 >>>>=20 >>>> Log: >>>> ?? BSP is not added to the mask of valid target CPUs for interrupts >>>> ?? in set_apic_interrupt_ids(). Besides, set_apic_interrupts_ids() = is not >>>> ?? called in the !SMP case too. >>>> ?? Fix this by: >>>> ?? - Adding the BSP as an interrupt target directly in = cpu_startup(). >>>> ?? - Remove an obsolete optimization where the BSP are skipped in >>>> ?? ?? set_apic_interrupt_ids(). >>>>=20 >>>> ?? Reported by: ?? ?? ?? ??jh >>>> ?? Reviewed by: ?? ?? ?? ??jhb >>>> ?? MFC after: ??3 days >>>> ?? X-MFC: ?? ?? ?? ?? ?? ?? ??r233961 >>>> ?? Pointy hat to: ?? ?? ??me >>>>=20 >>>> Modified: >>>> ?? head/sys/amd64/amd64/machdep.c >>>> ?? head/sys/amd64/amd64/mp_machdep.c >>>> ?? head/sys/i386/i386/machdep.c >>>> ?? head/sys/i386/i386/mp_machdep.c >>>>=20 >>>> Modified: head/sys/amd64/amd64/machdep.c >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:01:43 2012 = ?? ?? ?? ??(r234073) >>>> +++ head/sys/amd64/amd64/machdep.c ?? ??Mon Apr ??9 22:41:19 2012 = ?? ?? ?? ??(r234074) >>>> @@ -295,6 +295,11 @@ cpu_startup(dummy) >>>> ?? ?? ?? vm_pager_bufferinit(); >>>>=20 >>>> ?? ?? ?? cpu_setregs(); >>>> + >>>> + ?? ?? /* >>>> + ?? ?? ??* Add BSP as an interrupt target. >>>> + ?? ?? ??*/ >>>> + ?? ?? intr_add_cpu(0); >>>> ??} >>>=20 >>> If I'm not mistaken, intr_add_cpu() is under #ifdef SMP, so it = should be >>> here as well. >>=20 >> You are right, sorry, I did forgot to test without SMP. >> I think we still need intr_add_cpu() on cpu_startup() because of the >> case smp_disabled =3D 1. >> I think the attached patch should make its dirty job, opinion? >=20 > I currently fail to see why the latter approach would be necessary, > i.e. IMO wrapping the intr_add_cpu() calls in cpu_startup() should > be sufficient. In case the kernel is compiled without SMP support, > interrupt balancing support isn't available in the first place and > the BSP is always the only available target (see the UP version of > intr_next_cpu() at the end of x86/x86/intr_machdep.c), so there's > no need to add the BSP as a valid target. If an SMP kernel is run > on a UP machine or with SMP disabled, interrupt balancing support > is available but the intr_add_cpu() calls in cpu_startup() will add > the BSP as (the only) target, so everything should be fine. Maybe > you can elaborate on why you think an SMP kernel with SMP disabled > needs special handling. >=20 > Marius While functionally correct, I believe that wrapping intr_add_cpu() in machdep.c in "SMP ifdefs" is inferior to calling it in all cases. It invites questions like, "In the UP case, don't we have to ensure that CPU0 is a valid interrupt target?" This is because casual visitors to this file don't know that intr_add_cpu() only impacts interrupt distribution. Of course, this is just an artifact of the current implementation. #ifdefs should be as close to the implemenation as possible. This simplifies the task of making future enhancments. This is why I'd prefer to see these within the body of intr_add_cpu() than where they are now. I also think the comment could be improved to be something like: /* * The BSP/CPU0 is always an interrupt target even if * our probe of MP hardware fails or MP mode is disabled. */ intr_add_cpu(0); -- Justin From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 23:53:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BBE6E1065672; Sat, 14 Apr 2012 23:53:32 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4A58FC12; Sat, 14 Apr 2012 23:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3ENrW9N055361; Sat, 14 Apr 2012 23:53:32 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3ENrWgD055358; Sat, 14 Apr 2012 23:53:32 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201204142353.q3ENrWgD055358@svn.freebsd.org> From: Davide Italiano Date: Sat, 14 Apr 2012 23:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234302 - in head/sys: conf kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 23:53:32 -0000 Author: davide Date: Sat Apr 14 23:53:31 2012 New Revision: 234302 URL: http://svn.freebsd.org/changeset/base/234302 Log: Fix some style bugs introduced in a previous commit (r233045) Reported by: glebius, jmallet Reviewed by: jmallet Approved by: gnn (mentor) MFC after: 2 days Modified: head/sys/conf/NOTES head/sys/kern/kern_umtx.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Apr 14 21:51:08 2012 (r234301) +++ head/sys/conf/NOTES Sat Apr 14 23:53:31 2012 (r234302) @@ -300,7 +300,8 @@ options MPROF_HASH_SIZE="1543" # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING -options UMTX_PROFILING +options UMTX_PROFILING + ##################################################################### # COMPATIBILITY OPTIONS Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Apr 14 21:51:08 2012 (r234301) +++ head/sys/kern/kern_umtx.c Sat Apr 14 23:53:31 2012 (r234302) @@ -271,15 +271,15 @@ umtxq_sysinit(void *arg __unused) TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list); umtxq_chains[i][j].uc_busy = 0; umtxq_chains[i][j].uc_waiters = 0; - #ifdef UMTX_PROFILING +#ifdef UMTX_PROFILING umtxq_chains[i][j].length = 0; umtxq_chains[i][j].max_length = 0; - #endif +#endif } } - #ifdef UMTX_PROFILING +#ifdef UMTX_PROFILING umtx_init_profiling(); - #endif +#endif mtx_init(&umtx_lock, "umtx lock", NULL, MTX_SPIN); EVENTHANDLER_REGISTER(process_exec, umtx_exec_hook, NULL, EVENTHANDLER_PRI_ANY); @@ -430,14 +430,14 @@ umtxq_insert_queue(struct umtx_q *uq, in TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); uh->length++; - #ifdef UMTX_PROFILING +#ifdef UMTX_PROFILING uc->length++; if (uc->length > uc->max_length) { uc->max_length = uc->length; if (uc->max_length > max_length) max_length = uc->max_length; } - #endif +#endif uq->uq_flags |= UQF_UMTXQ; uq->uq_cur_queue = uh; return; @@ -455,9 +455,9 @@ umtxq_remove_queue(struct umtx_q *uq, in uh = uq->uq_cur_queue; TAILQ_REMOVE(&uh->head, uq, uq_link); uh->length--; - #ifdef UMTX_PROFILING +#ifdef UMTX_PROFILING uc->length--; - #endif +#endif uq->uq_flags &= ~UQF_UMTXQ; if (TAILQ_EMPTY(&uh->head)) { KASSERT(uh->length == 0, From owner-svn-src-head@FreeBSD.ORG Sat Apr 14 23:59:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4E7D106566B; Sat, 14 Apr 2012 23:59:58 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0DA08FC08; Sat, 14 Apr 2012 23:59:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3ENxw2C055602; Sat, 14 Apr 2012 23:59:58 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3ENxwRI055600; Sat, 14 Apr 2012 23:59:58 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201204142359.q3ENxwRI055600@svn.freebsd.org> From: Davide Italiano Date: Sat, 14 Apr 2012 23:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234303 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 23:59:58 -0000 Author: davide Date: Sat Apr 14 23:59:58 2012 New Revision: 234303 URL: http://svn.freebsd.org/changeset/base/234303 Log: Fix a typo. Approved by: gnn (mentor) MFC after: 2 days Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sat Apr 14 23:53:31 2012 (r234302) +++ head/sys/kern/subr_turnstile.c Sat Apr 14 23:59:58 2012 (r234303) @@ -143,7 +143,7 @@ static SYSCTL_NODE(_debug, OID_AUTO, tur static SYSCTL_NODE(_debug_turnstile, OID_AUTO, chains, CTLFLAG_RD, 0, "turnstile chain stats"); SYSCTL_UINT(_debug_turnstile, OID_AUTO, max_depth, CTLFLAG_RD, - &turnstile_max_depth, 0, "maxmimum depth achieved of a single chain"); + &turnstile_max_depth, 0, "maximum depth achieved of a single chain"); #endif static struct mtx td_contested_lock; static struct turnstile_chain turnstile_chains[TC_TABLESIZE];