From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 01:46:00 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2F94C92 for ; Sun, 22 Sep 2013 01:46:00 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85F10237E for ; Sun, 22 Sep 2013 01:46:00 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8M1k02g075124 for ; Sun, 22 Sep 2013 01:46:00 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8M1k0ph075121 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 01:46:00 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 01:46:00 GMT Message-Id: <201309220146.r8M1k0ph075121@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257595 - in soc2013/def/crashdump-head/sys: kern sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 01:46:00 -0000 Author: def Date: Sun Sep 22 01:45:56 2013 New Revision: 257595 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257595 Log: Define a sysctl variable for a kernel crash dump key. Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 00:54:22 2013 (r257594) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 01:45:56 2013 (r257595) @@ -137,6 +137,13 @@ SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW, &show_busybufs, 0, ""); +static struct kerneldumpkey dumperkey; +static struct kerneldumpbuffer dumperbuffer; +#ifdef ENCRYPT_CRASH +SYSCTL_STRUCT(_kern, OID_AUTO, dumpkey, CTLFLAG_RW, &dumperkey, + kerneldumpkey, "Kernel crash dump key"); +#endif + /* * Variable panicstr contains argument to first call to panic; used as flag * to indicate that the kernel has already called panic. @@ -146,8 +153,6 @@ int dumping; /* system is dumping */ int rebooting; /* system is rebooting */ static struct dumperinfo dumper; /* our selected dumper */ -static struct kerneldumpkey dumperkey; -static struct kerneldumpbuffer dumperbuffer; /* Context information for dump-debuggers. */ static struct pcb dumppcb; /* Registers. */ Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 00:54:22 2013 (r257594) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 01:45:56 2013 (r257595) @@ -77,6 +77,7 @@ #define KERNELDUMP_SPARC64_VERSION 1 #define KERNELDUMP_TEXT_VERSION 1 #define KERNELDUMP_KEY_SIZE 32 +#define KERNELDUMP_ENCRYPTED_KEY_SIZE 256 #define KERNELDUMP_TWEAK_SIZE 8 uint64_t dumplength; /* excl headers */ uint64_t dumptime; @@ -108,6 +109,15 @@ return (parity); } +struct kerneldumpkey { + int keysize; + char key[KERNELDUMP_KEY_SIZE]; + char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; + char tweak[KERNELDUMP_TWEAK_SIZE]; + struct xts_ctx data_ctx; + struct xts_ctx tweak_ctx; +}; + #ifdef _KERNEL /* * Constant key for kernel crash dumps. @@ -122,14 +132,6 @@ 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }; -struct kerneldumpkey { - int keysize; - char key[KERNELDUMP_KEY_SIZE]; - char tweak[KERNELDUMP_TWEAK_SIZE]; - struct xts_ctx data_ctx; - struct xts_ctx tweak_ctx; -}; - struct kerneldumpbuffer { #define KERNELDUMP_DEVBLK_SIZE 512 #define KERNELDUMP_SECTOR_SIZE 4096 From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 01:47:49 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 42CC5D87 for ; Sun, 22 Sep 2013 01:47:49 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21BBA2387 for ; Sun, 22 Sep 2013 01:47:49 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8M1lnrc075513 for ; Sun, 22 Sep 2013 01:47:49 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8M1lmRI075511 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 01:47:48 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 01:47:48 GMT Message-Id: <201309220147.r8M1lmRI075511@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257596 - soc2013/def/crashdump-head/sbin/dumpkey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 01:47:49 -0000 Author: def Date: Sun Sep 22 01:47:48 2013 New Revision: 257596 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257596 Log: Use kern.dumpkey in order to transfer key's data to kernel. Refactor dumpkey. Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 01:45:56 2013 (r257595) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 01:47:48 2013 (r257596) @@ -35,11 +35,11 @@ } static int -read_data(char *buf, size_t size, const char *file) +random_data(char *buf, size_t size) { FILE *fp; - fp = fopen(file, "r"); + fp = fopen(PATH_DEVRANDOM, "r"); if (fp == NULL) return (-1); @@ -56,16 +56,7 @@ } static int -random_data(char *buf, size_t size) -{ - if(read_data(buf, size, PATH_DEVRANDOM)) - return (-1); - - return (0); -} - -static int -encrypt_key(char *key, size_t keysize, char *encrypted_key, RSA *public_key, char *public_key_file) +encrypt_key(char *key, char *encrypted_key, RSA *public_key, char *public_key_file) { FILE *fp; @@ -80,61 +71,46 @@ if (public_key == NULL) return (-1); - if (RSA_public_encrypt(keysize, key, encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) + if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE, key, encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) return (-1); return (0); } static int -expand_key(char *key, size_t keysize, char *data_key, char *tweak_key) +expand_key(char *masterkey, struct xts_ctx *data_ctx, struct xts_ctx *tweak_ctx) { struct xts_ctx ctx; + char key[KERNELDUMP_KEY_SIZE]; - bzero(&ctx, sizeof(ctx)); - bzero(data_key, keysize); - bzero(tweak_key, keysize); - - hkdf_expand(&ctx, key, data_key, 1, kerneldump_magic, sizeof(kerneldump_magic)); - memcpy(tweak_key, data_key, keysize); - hkdf_expand(&ctx, key, tweak_key, 2, kerneldump_magic, sizeof(kerneldump_magic)); - - bzero(&ctx, sizeof(ctx)); + bzero(key, KERNELDUMP_KEY_SIZE); + bzero(&ctx, sizeof(struct xts_ctx)); + bzero(data_ctx, sizeof(struct xts_ctx)); + bzero(tweak_ctx, sizeof(struct xts_ctx)); - return (0); -} + hkdf_expand(&ctx, masterkey, key, 1, kerneldump_magic, sizeof(kerneldump_magic)); + xts_alg_aes.pa_keysetup(data_ctx, key, KERNELDUMP_KEY_SIZE << 3); -static int -set_data_key(char *key, size_t keysize) -{ - return (sysctlbyname("kern.dump.key.data", NULL, 0, key, keysize)); -} + hkdf_expand(&ctx, masterkey, key, 2, kerneldump_magic, sizeof(kerneldump_magic)); + xts_alg_aes.pa_keysetup(tweak_ctx, key, KERNELDUMP_KEY_SIZE << 3); -static int -set_tweak_key(char *key, size_t keysize) -{ - return (sysctlbyname("kern.dump.key.tweak", NULL, 0, key, keysize)); -} + bzero(&ctx, sizeof(struct xts_ctx)); + bzero(key, KERNELDUMP_KEY_SIZE); -static int -set_encrypted_key(char *key, size_t keysize) -{ - return (sysctlbyname("kern.dump.key.encrypted", NULL, 0, key, keysize)); + return (0); } static int -set_tweak(char *tweak, size_t tweaksize) +sysctl_dumpkey(struct kerneldumpkey *key) { - return (sysctlbyname("kern.dump.tweak", NULL, 0, tweak, tweaksize)); + return (sysctlbyname("kern.dumpkey", NULL, NULL, key, sizeof(struct kerneldumpkey))); } int main(int argc, char **argv) { - char *public_key_file; - char key[KERNELDUMP_KEY_SIZE], encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; - char data_key[KERNELDUMP_KEY_SIZE], tweak_key[KERNELDUMP_KEY_SIZE]; - char tweak[KERNELDUMP_TWEAK_SIZE]; + struct kerneldumpkey key; + char *public_key_file, buf[KERNELDUMP_KEY_SIZE]; int ch, error; RSA *public_key; @@ -163,60 +139,41 @@ goto out; } - if (random_data(key, KERNELDUMP_KEY_SIZE)) { - printf("Error: cannot generate a symmetric key.\n"); - error = 1; - goto out; - } + key.keysize = KERNELDUMP_KEY_SIZE; - if (encrypt_key(key, KERNELDUMP_KEY_SIZE, encrypted_key, public_key, public_key_file)) { - printf("Error: cannot encrypt a symmetric key.\n"); - error = 1; - goto out; - } - - if (set_encrypted_key(encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE)) { - printf("Error: cannot set an encrypted symmetric key.\n"); + if (random_data(buf, KERNELDUMP_KEY_SIZE)) { + printf("Error: cannot generate a symmetric key.\n"); error = 1; goto out; } - if (expand_key(key, KERNELDUMP_KEY_SIZE, data_key, tweak_key)) { + if (expand_key(buf, &key.data_ctx, &key.tweak_ctx)) { printf("Error: cannot expand a symmetric key."); error = 1; goto out; } - if (set_data_key(data_key, KERNELDUMP_KEY_SIZE)) { - printf("Error: cannot set a symmetric data key.\n"); - error = 1; - goto out; - } - - if (set_tweak_key(tweak_key, KERNELDUMP_KEY_SIZE)) { - printf("Error: cannot set a symmetric tweak key."); + if (encrypt_key(buf, key.encrypted_key, public_key, public_key_file)) { + printf("Error: cannot encrypt a symmetric key.\n"); error = 1; goto out; } - if (random_data(tweak, KERNELDUMP_TWEAK_SIZE)) { + if (random_data(key.tweak, KERNELDUMP_TWEAK_SIZE)) { printf("Error: cannot generate a tweak.\n"); error = 1; goto out; } - if (set_tweak(tweak, KERNELDUMP_TWEAK_SIZE)) { - printf("Error: cannot set a tweak.\n"); + if (sysctl_dumpkey(&key)) { + printf("Error: cannot set a kernel crash dump key.\n"); error = 1; goto out; } out: - bzero(key, KERNELDUMP_KEY_SIZE); - bzero(encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); - bzero(data_key, KERNELDUMP_KEY_SIZE); - bzero(tweak_key, KERNELDUMP_KEY_SIZE); - bzero(tweak, KERNELDUMP_TWEAK_SIZE); + bzero(&key, sizeof(struct kerneldumpkey)); + bzero(buf, KERNELDUMP_KEY_SIZE); RSA_free(public_key); ERR_free_strings(); From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 01:50:13 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9D1F0DA0 for ; Sun, 22 Sep 2013 01:50:13 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B2D9238F for ; Sun, 22 Sep 2013 01:50:13 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8M1oD3f079749 for ; Sun, 22 Sep 2013 01:50:13 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8M1oDhF079735 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 01:50:13 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 01:50:13 GMT Message-Id: <201309220150.r8M1oDhF079735@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257597 - soc2013/def/crashdump-head/sys/crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 01:50:13 -0000 Author: def Date: Sun Sep 22 01:50:13 2013 New Revision: 257597 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257597 Log: Don't align struct xts_ctx because sysctlbyname(3) requires equal structure sizes. Modified: soc2013/def/crashdump-head/sys/crypto/xts.h Modified: soc2013/def/crashdump-head/sys/crypto/xts.h ============================================================================== --- soc2013/def/crashdump-head/sys/crypto/xts.h Sun Sep 22 01:47:48 2013 (r257596) +++ soc2013/def/crashdump-head/sys/crypto/xts.h Sun Sep 22 01:50:13 2013 (r257597) @@ -45,7 +45,7 @@ rijndael_ctx pctx_aes; struct hmac_ctx pctx_hmac; } o; -} __aligned(CACHE_LINE_SIZE); +}; typedef void algop_crypt_t(const struct xts_ctx *ctx, const uint8_t *in, uint8_t *out); From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 09:17:41 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 20F07839 for ; Sun, 22 Sep 2013 09:17:41 +0000 (UTC) (envelope-from mattbw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3DF240E for ; Sun, 22 Sep 2013 09:17:41 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8M9Hek5069507 for ; Sun, 22 Sep 2013 09:17:40 GMT (envelope-from mattbw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8M9HeGT069496 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 09:17:40 GMT (envelope-from mattbw@FreeBSD.org) Date: Sun, 22 Sep 2013 09:17:40 GMT Message-Id: <201309220917.r8M9HeGT069496@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mattbw@FreeBSD.org using -f From: mattbw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257601 - soc2013/mattbw/port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 09:17:41 -0000 Author: mattbw Date: Sun Sep 22 09:17:40 2013 New Revision: 257601 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257601 Log: Update port with new master site and inlined plist. Deleted: soc2013/mattbw/port/pkg-plist Modified: soc2013/mattbw/port/Makefile soc2013/mattbw/port/pkg-message Modified: soc2013/mattbw/port/Makefile ============================================================================== --- soc2013/mattbw/port/Makefile Sun Sep 22 07:30:17 2013 (r257600) +++ soc2013/mattbw/port/Makefile Sun Sep 22 09:17:40 2013 (r257601) @@ -3,17 +3,23 @@ PORTNAME= pkgpackagekit PORTVERSION= 0.1.1 CATEGORIES= ports-mgmt -MASTER_SITES= http://www-student.cs.york.ac.uk/~mbw500/ +MASTER_SITES= http://ftp1.fr.freebsd.org/mirrors/ftp.freebsd.org/ports/local-distfiles/jlaffaye/ \ + http://ftp2.fr.freebsd.org/mirrors/ftp.freebsd.org/ports/local-distfiles/jlaffaye/ MAINTAINER= mattbw@FreeBSD.org COMMENT= PackageKit backend for pkgng +LICENSE= GPLv2 + LIB_DEPENDS= libpackagekit-glib2.so:${PORTSDIR}/ports-mgmt/packagekit \ libpkg.so:${PORTSDIR}/ports-mgmt/pkg +USE_LDCONFIG= yes + WRKSRC= ${WRKDIR}/backend +PLIST_FILES= lib/packagekit-backend/libpk_backend_pkgng.so post-install: - ${CAT} pkg-message | ${SED} 's,%%PREFIX%%,${PREFIX},g' + @${CAT} pkg-message | ${SED} 's,%%PREFIX%%,${PREFIX},g' .include Modified: soc2013/mattbw/port/pkg-message ============================================================================== --- soc2013/mattbw/port/pkg-message Sun Sep 22 07:30:17 2013 (r257600) +++ soc2013/mattbw/port/pkg-message Sun Sep 22 09:17:40 2013 (r257601) @@ -9,3 +9,6 @@ Otherwise, PackageKit will default to using the ports backend unless you explicitly launch packagekitd with a different backend. + +To use PackageKit, don't forget to enable dbus (for example, by adding +dbus_enable="yes" to /etc/rc.conf, or `service dbus start`). From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 10:41:09 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E0A70B52 for ; Sun, 22 Sep 2013 10:41:09 +0000 (UTC) (envelope-from oleksandr@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF06B27A4 for ; Sun, 22 Sep 2013 10:41:09 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MAf9ei070331 for ; Sun, 22 Sep 2013 10:41:09 GMT (envelope-from oleksandr@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8MAf91M070320 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 10:41:09 GMT (envelope-from oleksandr@FreeBSD.org) Date: Sun, 22 Sep 2013 10:41:09 GMT Message-Id: <201309221041.r8MAf91M070320@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to oleksandr@FreeBSD.org using -f From: oleksandr@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257602 - soc2013/oleksandr/ports/emulators/virtualbox-ose-additions/files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 10:41:09 -0000 Author: oleksandr Date: Sun Sep 22 10:41:09 2013 New Revision: 257602 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257602 Log: update mount root vfs section Modified: soc2013/oleksandr/ports/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-freebsd.kmk Modified: soc2013/oleksandr/ports/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-freebsd.kmk ============================================================================== --- soc2013/oleksandr/ports/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-freebsd.kmk Sun Sep 22 09:17:40 2013 (r257601) +++ soc2013/oleksandr/ports/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-freebsd.kmk Sun Sep 22 10:41:09 2013 (r257602) @@ -2,15 +2,13 @@ =================================================================== --- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk (revision 4) +++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk (working copy) -@@ -32,13 +32,14 @@ - . \ +@@ -33,12 +33,13 @@ $(vboxvfs_0_OUTDIR) vboxvfs_SOURCES = \ -- vboxvfs_vfsops.c \ + vboxvfs_vfsops.c \ - vboxvfs_vnops.c -+ vboxfs_vfsops.c \ -+ vboxfs_vnops.c \ -+ vboxfs_prov.c ++ vboxvfs_vnops.c \ ++ vboxvfs_prov.c vboxvfs_LIBS = \ $(VBOX_LIB_VBGL_R0) \ $(VBOX_LIB_IPRT_GUEST_R0) @@ -20,397 +18,65 @@ $$(vboxvfs_0_OUTDIR)/vnode_if_newproto.h \ $$(vboxvfs_0_OUTDIR)/vnode_if_typedef.h vboxvfs_CLEAN += $(vboxvfs_DEPS) -Index: src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c -=================================================================== ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c (revision 4) -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c (working copy) -@@ -1,241 +0,0 @@ --/* $Id: vboxvfs_vnops.c $ */ --/** @file -- * Description. -- */ -- --/* -- * Copyright (C) 2008-2010 Oracle Corporation -- * -- * This file is part of VirtualBox Open Source Edition (OSE), as -- * available from http://www.virtualbox.org. This file is free software; -- * you can redistribute it and/or modify it under the terms of the GNU -- * General Public License (GPL) as published by the Free Software -- * Foundation, in version 2 as it comes in the "COPYING" file of the -- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the -- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. -- */ -- --#include "vboxvfs.h" --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include -- --/* -- * Prototypes for VBOXVFS vnode operations -- */ --static vop_create_t vboxvfs_create; --static vop_mknod_t vboxvfs_mknod; --static vop_open_t vboxvfs_open; --static vop_close_t vboxvfs_close; --static vop_access_t vboxvfs_access; --static vop_getattr_t vboxvfs_getattr; --static vop_setattr_t vboxvfs_setattr; --static vop_read_t vboxvfs_read; --static vop_write_t vboxvfs_write; --static vop_fsync_t vboxvfs_fsync; --static vop_remove_t vboxvfs_remove; --static vop_link_t vboxvfs_link; --static vop_lookup_t vboxvfs_lookup; --static vop_rename_t vboxvfs_rename; --static vop_mkdir_t vboxvfs_mkdir; --static vop_rmdir_t vboxvfs_rmdir; --static vop_symlink_t vboxvfs_symlink; --static vop_readdir_t vboxvfs_readdir; --static vop_strategy_t vboxvfs_strategy; --static vop_print_t vboxvfs_print; --static vop_pathconf_t vboxvfs_pathconf; --static vop_advlock_t vboxvfs_advlock; --static vop_getextattr_t vboxvfs_getextattr; --static vop_ioctl_t vboxvfs_ioctl; --static vop_getpages_t vboxvfs_getpages; --static vop_inactive_t vboxvfs_inactive; --static vop_putpages_t vboxvfs_putpages; --static vop_reclaim_t vboxvfs_reclaim; -- --struct vop_vector vboxvfs_vnodeops = { -- .vop_default = &default_vnodeops, -- -- .vop_access = vboxvfs_access, -- .vop_advlock = vboxvfs_advlock, -- .vop_close = vboxvfs_close, -- .vop_create = vboxvfs_create, -- .vop_fsync = vboxvfs_fsync, -- .vop_getattr = vboxvfs_getattr, -- .vop_getextattr = vboxvfs_getextattr, -- .vop_getpages = vboxvfs_getpages, -- .vop_inactive = vboxvfs_inactive, -- .vop_ioctl = vboxvfs_ioctl, -- .vop_link = vboxvfs_link, -- .vop_lookup = vboxvfs_lookup, -- .vop_mkdir = vboxvfs_mkdir, -- .vop_mknod = vboxvfs_mknod, -- .vop_open = vboxvfs_open, -- .vop_pathconf = vboxvfs_pathconf, -- .vop_print = vboxvfs_print, -- .vop_putpages = vboxvfs_putpages, -- .vop_read = vboxvfs_read, -- .vop_readdir = vboxvfs_readdir, -- .vop_reclaim = vboxvfs_reclaim, -- .vop_remove = vboxvfs_remove, -- .vop_rename = vboxvfs_rename, -- .vop_rmdir = vboxvfs_rmdir, -- .vop_setattr = vboxvfs_setattr, -- .vop_strategy = vboxvfs_strategy, -- .vop_symlink = vboxvfs_symlink, -- .vop_write = vboxvfs_write, --}; -- --static int vboxvfs_access(struct vop_access_args *ap) --{ -- return 0; --} -- --static int vboxvfs_open(struct vop_open_args *ap) --{ -- return 0; --} -- --static int vboxvfs_close(struct vop_close_args *ap) --{ -- return 0; --} -- --static int vboxvfs_getattr(struct vop_getattr_args *ap) --{ -- return 0; --} -- --static int vboxvfs_setattr(struct vop_setattr_args *ap) --{ -- return 0; --} -- --static int vboxvfs_read(struct vop_read_args *ap) --{ -- return 0; --} -- --static int vboxvfs_write(struct vop_write_args *ap) --{ -- return 0; --} -- --static int vboxvfs_create(struct vop_create_args *ap) --{ -- return 0; --} -- --static int vboxvfs_remove(struct vop_remove_args *ap) --{ -- return 0; --} -- --static int vboxvfs_rename(struct vop_rename_args *ap) --{ -- return 0; --} -- --static int vboxvfs_link(struct vop_link_args *ap) --{ -- return EOPNOTSUPP; --} -- --static int vboxvfs_symlink(struct vop_symlink_args *ap) --{ -- return EOPNOTSUPP; --} -- --static int vboxvfs_mknod(struct vop_mknod_args *ap) --{ -- return EOPNOTSUPP; --} -- --static int vboxvfs_mkdir(struct vop_mkdir_args *ap) --{ -- return 0; --} -- --static int vboxvfs_rmdir(struct vop_rmdir_args *ap) --{ -- return 0; --} -- --static int vboxvfs_readdir(struct vop_readdir_args *ap) --{ -- return 0; --} -- --static int vboxvfs_fsync(struct vop_fsync_args *ap) --{ -- return 0; --} -- --static int vboxvfs_print (struct vop_print_args *ap) --{ -- return 0; --} -- --static int vboxvfs_pathconf (struct vop_pathconf_args *ap) --{ -- return 0; --} -- --static int vboxvfs_strategy (struct vop_strategy_args *ap) --{ -- return 0; --} -- --static int vboxvfs_ioctl(struct vop_ioctl_args *ap) --{ -- return ENOTTY; --} -- --static int vboxvfs_getextattr(struct vop_getextattr_args *ap) --{ -- return 0; --} -- --static int vboxvfs_advlock(struct vop_advlock_args *ap) --{ -- return 0; --} -- --static int vboxvfs_lookup(struct vop_lookup_args *ap) --{ -- return 0; --} -- --static int vboxvfs_inactive(struct vop_inactive_args *ap) --{ -- return 0; --} -- --static int vboxvfs_reclaim(struct vop_reclaim_args *ap) --{ -- return 0; --} -- --static int vboxvfs_getpages(struct vop_getpages_args *ap) --{ -- return 0; --} -- --static int vboxvfs_putpages(struct vop_putpages_args *ap) --{ -- return 0; --} -- -Index: src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h -=================================================================== ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h (revision 4) -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h (working copy) -@@ -1,92 +0,0 @@ --/* $Id: vboxvfs.h $ */ --/** @file -- * Description. -- */ -- --/* -- * Copyright (C) 2010 Oracle Corporation -- * -- * This file is part of VirtualBox Open Source Edition (OSE), as -- * available from http://www.virtualbox.org. This file is free software; -- * you can redistribute it and/or modify it under the terms of the GNU -- * General Public License (GPL) as published by the Free Software -- * Foundation, in version 2 as it comes in the "COPYING" file of the -- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the -- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. -- */ -- --#ifndef ___VBOXVFS_H___ --#define ___VBOXVFS_H___ -- --#define VBOXVFS_VFSNAME "vboxvfs" --#define VBOXVFS_VERSION 1 -- --#define MAX_HOST_NAME 256 --#define MAX_NLS_NAME 32 -- --struct vboxvfs_mount_info { -- char name[MAX_HOST_NAME]; -- char nls_name[MAX_NLS_NAME]; -- int uid; -- int gid; -- int ttl; --}; -- --#ifdef _KERNEL -- --#include "../../common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h" --#include --#include -- --struct vboxvfsmount { -- uid_t uid; -- gid_t gid; -- mode_t file_mode; -- mode_t dir_mode; -- struct mount *mp; -- struct ucred *owner; -- u_int flags; -- long nextino; -- int caseopt; -- int didrele; --}; -- --/* structs - stolen from the linux shared module code */ --struct sf_glob_info { -- VBSFMAP map; --/* struct nls_table *nls;*/ -- int ttl; -- int uid; -- int gid; -- struct vnode *vnode_root; --}; -- --struct sf_inode_info { -- SHFLSTRING *path; -- int force_restat; --}; -- --#if 0 --struct sf_dir_info { -- struct list_head info_list; --}; --#endif -- --struct sf_dir_buf { -- size_t nb_entries; -- size_t free_bytes; -- size_t used_bytes; -- void *buf; --#if 0 -- struct list_head head; --#endif --}; -- --struct sf_reg_info { -- SHFLHANDLE handle; --}; -- --#endif /* KERNEL */ -- --#endif /* !___VBOXVFS_H___ */ -- Index: src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c =================================================================== --- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c (revision 4) +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c (working copy) -@@ -1,258 +0,0 @@ +@@ -1,4 +1,4 @@ -/* $Id: vboxvfs_vfsops.c $ */ --/** @file -- * Description. -- */ -- --/* -- * Copyright (C) 2008-2010 Oracle Corporation -- * -- * This file is part of VirtualBox Open Source Edition (OSE), as -- * available from http://www.virtualbox.org. This file is free software; -- * you can redistribute it and/or modify it under the terms of the GNU -- * General Public License (GPL) as published by the Free Software -- * Foundation, in version 2 as it comes in the "COPYING" file of the -- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the -- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. -- */ ++/* $Id: vboxfs_vfsops.c $ */ + /** @file + * Description. + */ +@@ -14,245 +14,525 @@ + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ - -#include "vboxvfs.h" --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include -- --#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) -- ++#include + #include + #include + #include + #include + #include ++#include ++#include + #include + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include + +-#include ++#include ++#include + ++#include "vboxvfs.h" ++ + #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data) + -static int vboxvfs_version = VBOXVFS_VERSION; -- ++#ifdef MALLOC_DECLARE ++MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS"); ++#endif + -SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); -SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, ""); -- --/* global connection to the host service. */ --static VBSFCLIENT g_vboxSFClient; -- ++static int vboxfs_version = VBOXVFS_VERSION; + ++SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem"); ++SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, ""); ++ + /* global connection to the host service. */ + static VBSFCLIENT g_vboxSFClient; ++static sfp_connection_t *sfprov = NULL; + -static vfs_init_t vboxvfs_init; -static vfs_uninit_t vboxvfs_uninit; -static vfs_cmount_t vboxvfs_cmount; @@ -419,7 +85,15 @@ -static vfs_quotactl_t vboxvfs_quotactl; -static vfs_statfs_t vboxvfs_statfs; -static vfs_unmount_t vboxvfs_unmount; -- ++static vfs_init_t vboxfs_init; ++static vfs_uninit_t vboxfs_uninit; ++static vfs_cmount_t vboxfs_cmount; ++static vfs_mount_t vboxfs_mount; ++static vfs_root_t vboxfs_root; ++static vfs_quotactl_t vboxfs_quotactl; ++static vfs_statfs_t vboxfs_statfs; ++static vfs_unmount_t vboxfs_unmount; + -static struct vfsops vboxvfs_vfsops = { - .vfs_init = vboxvfs_init, - .vfs_cmount = vboxvfs_cmount, @@ -430,40 +104,74 @@ - .vfs_sync = vfs_stdsync, - .vfs_uninit = vboxvfs_uninit, - .vfs_unmount = vboxvfs_unmount, --}; -- -- ++static struct vfsops vboxfs_vfsops = { ++ .vfs_init = vboxfs_init, ++ .vfs_cmount = vboxfs_cmount, ++ .vfs_mount = vboxfs_mount, ++ .vfs_quotactl = vboxfs_quotactl, ++ .vfs_root = vboxfs_root, ++ .vfs_statfs = vboxfs_statfs, ++ .vfs_sync = vfs_stdsync, ++ .vfs_uninit = vboxfs_uninit, ++ .vfs_unmount = vboxfs_unmount, ++ .vfs_vget = vboxfs_vget, + }; + + -VFS_SET(vboxvfs_vfsops, vboxvfs, VFCF_NETWORK); --MODULE_DEPEND(vboxvfs, vboxguest, 1, 1, 1); -- ++VFS_SET(vboxfs_vfsops, vboxvfs, VFCF_NETWORK); + MODULE_DEPEND(vboxvfs, vboxguest, 1, 1, 1); + -static int vboxvfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td) --{ ++static int vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags) + { - struct vboxvfs_mount_info args; - int rc = 0; -- ++ struct vboxfs_mount_info args; ++ int error = 0; + - printf("%s: Enter\n", __FUNCTION__); -- ++ printf("%s: Enter\n", __FUNCTION__); ++ ++ if (data == NULL) ++ return (EINVAL); ++ error = copyin(data, &args, sizeof(struct vboxfs_mount_info)); ++ if (error) ++ return (error); + - rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info)); - if (rc) - return rc; -- ++ ma = mount_argf(ma, "uid", "%d", args.uid); ++ ma = mount_argf(ma, "gid", "%d", args.gid); ++ ma = mount_argf(ma, "file_mode", "%d", args.fmode); ++ ma = mount_argf(ma, "dir_mode", "%d", args.dmode); ++ ma = mount_arg(ma, "from", args.name, -1); + - ma = mount_argf(ma, "uid", "%d", args.uid); - ma = mount_argf(ma, "gid", "%d", args.gid); - ma = mount_arg(ma, "from", args.name, -1); -- ++ error = kernel_mount(ma, flags); + - rc = kernel_mount(ma, flags); -- ++ printf("%s: Leave error=%d\n", __FUNCTION__, error); + - printf("%s: Leave rc=%d\n", __FUNCTION__, rc); -- ++ return (error); ++}; + - return rc; -} - -static const char *vboxvfs_opts[] = { - "uid", "gid", "from", "fstype", "fspath", "errmsg", NULL --}; -- ++static const char *vboxfs_opts[] = { ++ "fstype", "fspath", "from", "uid", "gid", "file_mode", "dir_mode", "errmsg", NULL + }; + -static int vboxvfs_mount(struct mount *mp, struct thread *td) --{ ++static int vboxfs_mount(struct mount *mp) + { - int rc; - char *pszShare; - int cbShare, cbOption; @@ -471,2976 +179,3172 @@ - struct sf_glob_info *pShFlGlobalInfo; - SHFLSTRING *pShFlShareName = NULL; - int cbShFlShareName; -- ++ struct vboxfs_mnt *vboxfsmp = NULL; ++ struct vboxfs_node *unode; ++ struct buf *bp = NULL; ++ struct cdev *dev; ++ struct g_consumer *cp; ++ struct bufobj *bo; ++ struct vnode *devvp; /* vnode of the mount device */ ++ struct thread *td = curthread; ++ struct vfsoptlist *opts = mp->mnt_optnew; ++ struct nameidata nd, *ndp = &nd; ++ sfp_mount_t *handle; ++ int error, share_len; ++ char *share_name; ++ mode_t file_mode, dir_mode; ++ char *tmp, *ep; ++ uid_t uid = 0; ++ gid_t gid = 0; + - printf("%s: Enter\n", __FUNCTION__); -- ++ printf("%s: Enter \n", __FUNCTION__); + - if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) - return EOPNOTSUPP; -- ++ if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) ++ return (EOPNOTSUPP); + - if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts)) - { - vfs_mount_error(mp, "%s", "Invalid option"); - return EINVAL; - } -- ++ if (vfs_filteropt(opts, vboxfs_opts)) ++ { ++ vfs_mount_error(mp, "%s", "Invalid option"); ++ return (EINVAL); ++ } + - rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare); - if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe) - return EINVAL; -- ++ if (vfs_getopt(opts, "uid", (void **)&tmp, NULL) == 0) { ++ if (tmp != NULL) ++ uid = (uid_t)strtol(tmp, &ep, 10); ++ if (tmp == NULL || *ep) { ++ vfs_mount_error(mp, "Invalid uid"); ++ return (EINVAL); ++ } ++ } ++ ++ if (vfs_getopt(opts, "gid", (void **)&tmp, NULL) == 0) { ++ if (tmp != NULL) ++ gid = (gid_t)strtol(tmp, &ep, 10); ++ if (tmp == NULL || *ep) { ++ vfs_mount_error(mp, "Invalid gid"); ++ return (EINVAL); ++ } ++ } + - rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption); - if ((rc != ENOENT) && (rc || cbOption != sizeof(gid))) - return EINVAL; -- ++ if (vfs_getopt(opts, "file_mode", (void **)&tmp, NULL) == 0) { ++ if (tmp != NULL) ++ file_mode = (mode_t)strtol(tmp, &ep, 8); ++#if 0 ++ if (tmp == NULL || *ep) { ++ vfs_mount_error(mp, "Invalid file_mode"); ++ return (EINVAL); ++ } ++#endif ++ file_mode &= S_IRWXU | S_IRWXG | S_IRWXO; ++ } + - rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption); - if ((rc != ENOENT) && (rc || cbOption != sizeof(uid))) - return EINVAL; -- ++ if (vfs_getopt(opts, "dir_mode", (void **)&tmp, NULL) == 0) { ++ if (tmp != NULL) ++ dir_mode = (mode_t)strtol(tmp, &ep, 8); ++#if 0 ++ if (tmp == NULL || *ep) { ++ vfs_mount_error(mp, "Invalid dir_mode"); ++ return (EINVAL); ++ } ++#endif ++ dir_mode &= S_IRWXU | S_IRWXG | S_IRWXO; ++ } + - pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info)); - if (!pShFlGlobalInfo) - return ENOMEM; -- ++ vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO); ++ vboxfsmp->sf_uid = uid; ++ vboxfsmp->sf_gid = gid; ++ vboxfsmp->sf_fmode = file_mode; ++ vboxfsmp->sf_dmode = dir_mode; + - cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1; - pShFlShareName = RTMemAllocZ(cbShFlShareName); - if (!pShFlShareName) - return VERR_NO_MEMORY; -- ++ /* ++ * Invoke Hypervisor mount interface before proceeding ++ */ ++ //error = sfprov_mount(share_name, &handle); ++ // if (error) { ++ // return (error); ++ //} + - pShFlShareName->u16Length = cbShFlShareName; - pShFlShareName->u16Size = cbShFlShareName + 1; - memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1); -- ++ mp->mnt_data = handle; + - rc = vboxCallMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map); - RTMemFree(pShFlShareName); -- ++ error = vfs_getopt(opts, "from", (void **)&share_name, &share_len); + - if (RT_FAILURE (rc)) - { - RTMemFree(pShFlGlobalInfo); - printf("vboxCallMapFolder failed rc=%d\n", rc); - return EPROTO; - } -- ++ if (error || share_name[share_len - 1] != '\0' || share_len > 0xfffe) ++ { ++ vfs_mount_error(mp, "Invalid from"); ++ return (EINVAL); ++ } + - pShFlGlobalInfo->uid = uid; - pShFlGlobalInfo->gid = gid; -- ++ /* Check that the mount device exists */ ++ if (share_name == NULL) ++ return (EINVAL); + - mp->mnt_data = pShFlGlobalInfo; -- ++ NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, share_name, td); ++ printf("Device exist_0 %d", namei(ndp)); ++ if ((error = namei(ndp))) ++ return (error); ++ printf("Device exist"); ++ NDFREE(ndp, NDF_ONLY_PNBUF); ++ devvp = ndp->ni_vp; + - /* @todo root vnode. */ -- ++ printf("Device exist_2"); ++ if (vn_isdisk(devvp, &error) == 0) { ++ vput(devvp); ++ return (error); ++ } + - vfs_getnewfsid(mp); - vfs_mountedfrom(mp, pszShare); -- ++ printf("Device exist_3"); ++ /* Check the access rights on the mount device */ ++ error = VOP_ACCESS(devvp, VREAD, td->td_ucred, td); ++ if (error) ++ error = priv_check(td, PRIV_VFS_MOUNT_PERM); ++ if (error) { ++ vput(devvp); ++ return (error); ++ } + - printf("%s: Leave rc=0\n", __FUNCTION__); -- -- return 0; --} -- --static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td) --{ -- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); -- int rc; -- int flags = 0; -- -- rc = vboxCallUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map); -- if (RT_FAILURE(rc)) -- printf("Failed to unmap shared folder\n"); -- -- if (mntflags & MNT_FORCE) -- flags |= FORCECLOSE; -- -- /* There is 1 extra root vnode reference (vnode_root). */ -- rc = vflush(mp, 1, flags, td); -- if (rc) -- return rc; -- -- -- RTMemFree(pShFlGlobalInfo); -- mp->mnt_data = NULL; -- -- return 0; --} -- --static int vboxvfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td) --{ -- int rc = 0; -- struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp); -- struct vnode *vp; -- -- printf("%s: Enter\n", __FUNCTION__); -- -- vp = pShFlGlobalInfo->vnode_root; -- VREF(vp); -- -- vn_lock(vp, flags | LK_RETRY, td); -- *vpp = vp; -- -- printf("%s: Leave\n", __FUNCTION__); -- -- return rc; --} -- --static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td) --{ -- return EOPNOTSUPP; --} -- --int vboxvfs_init(struct vfsconf *vfsp) --{ -- int rc; -- -- /* Initialize the R0 guest library. */ -- rc = vboxInit(); -- if (RT_FAILURE(rc)) -- return ENXIO; -- -- /* Connect to the host service. */ -- rc = vboxConnect(&g_vboxSFClient); -- if (RT_FAILURE(rc)) -- { -- printf("Failed to get connection to host! rc=%d\n", rc); -- vboxUninit(); -- return ENXIO; -- } -- -- rc = vboxCallSetUtf8 (&g_vboxSFClient); -- if (RT_FAILURE (rc)) -- { -- printf("vboxCallSetUtf8 failed, rc=%d\n", rc); -- vboxDisconnect(&g_vboxSFClient); -- vboxUninit(); -- return EPROTO; -- } -- -- printf("Successfully loaded shared folder module\n"); -- -- return 0; --} -- --int vboxvfs_uninit(struct vfsconf *vfsp) --{ -- vboxDisconnect(&g_vboxSFClient); -- vboxUninit(); -- -- return 0; --} -- --int vboxvfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) --{ ++ printf("Device exist_4"); ++ dev = devvp->v_rdev; ++ dev_ref(dev); ++ DROP_GIANT(); ++ g_topology_lock(); ++ error = g_vfs_open(devvp, &cp, "vboxvfs", 0); ++ g_topology_unlock(); ++ PICKUP_GIANT(); ++ VOP_UNLOCK(devvp, 0); ++ if (error) ++ goto bail; + - return 0; --} -Index: src/VBox/Additions/freebsd/vboxvfs/vboxfs.h -=================================================================== ---- src/VBox/Additions/freebsd/vboxvfs/vboxfs.h (revision 0) -+++ src/VBox/Additions/freebsd/vboxvfs/vboxfs.h (working copy) -@@ -0,0 +1,326 @@ -+/* $Id: vboxfs.h $ */ -+/** @file -+ * Description. -+ */ -+ -+/* -+ * Copyright (C) 2010 Oracle Corporation -+ * -+ * This file is part of VirtualBox Open Source Edition (OSE), as -+ * available from http://www.virtualbox.org. This file is free software; -+ * you can redistribute it and/or modify it under the terms of the GNU -+ * General Public License (GPL) as published by the Free Software -+ * Foundation, in version 2 as it comes in the "COPYING" file of the -+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the -+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. -+ */ -+ -+#ifndef ___VBOXVFS_H___ -+#define ___VBOXVFS_H___ -+ -+#define VBOXVFS_VFSNAME "vboxfs" -+#define VBOXVFS_VERSION 1 -+ -+#define MAX_HOST_NAME 256 -+#define MAX_NLS_NAME 32 -+//#define MODEMASK 07777 /* mode bits plus permission bits */ -+/** Helper macros */ -+#define VFSTOVBOXFS(mp) ((struct vboxfs_mnt *)((mp)->mnt_data)) -+#define VTOVBOXFS(vp) ((struct vboxfs_node *)(vp)->v_data) -+ -+MALLOC_DECLARE(M_VBOXVFS); -+ -+#ifdef _KERNEL -+#include "../../../../../include/iprt/nocrt/limits.h" -+#include "../../../../../include/iprt/alloc.h" -+#include "../../../../../include/iprt/asm.h" -+#include "../../../../../include/iprt/asm-amd64-x86.h" -+#include "../../../../../include/iprt/asm-math.h" -+#include "../../../../../include/iprt/assert.h" -+#include "../../../../../include/iprt/cdefs.h" -+#include "../../../../../include/iprt/err.h" -+#include "../../../../../include/iprt/fs.h" -+#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" -+#include "../../../../../include/iprt/mem.h" -+#include "../../../../../include/iprt/param.h" -+#include "../../../../../include/iprt/path.h" -+#include "../../../../../include/iprt/semaphore.h" -+#include "../../../../../include/iprt/stdarg.h" -+#include "../../../../../include/iprt/stdint.h" -+#include "../../../../../include/iprt/string.h" -+#include "../../../../../include/iprt/time.h" -+#include "../../../../../include/iprt/types.h" -+#include "../../../../../include/iprt/uni.h" -+#include "../../../../../include/iprt/nocrt/limits.h" -+#include "../../../../../include/iprt/alloc.h" -+#include "../../../../../include/iprt/asm.h" -+#include "../../../../../include/iprt/asm-amd64-x86.h" -+#include "../../../../../include/iprt/asm-math.h" -+#include "../../../../../include/iprt/assert.h" -+#include "../../../../../include/iprt/cdefs.h" -+#include "../../../../../include/iprt/err.h" -+#include "../../../../../include/iprt/fs.h" -+#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" -+#include "../../../../../include/iprt/mem.h" -+#include "../../../../../include/iprt/param.h" -+#include "../../../../../include/iprt/path.h" -+#include "../../../../../include/iprt/semaphore.h" -+#include "../../../../../include/iprt/stdarg.h" -+#include "../../../../../include/iprt/stdint.h" -+#include "../../../../../include/iprt/string.h" -+#include "../../../../../include/iprt/time.h" -+#include "../../../../../include/iprt/types.h" -+#include "../../../../../include/iprt/uni.h" -+ -+#include "../../common/VBoxGuestLib/SysHlp.h" -+#include "../../common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h" -+#include -+#include -+#include -+ -+/* -+ * representation of an active mount point -+ */ -+struct sfp_mount { -+ VBSFMAP map; -+}; -+ -+/* -+ * Mount / Unmount a shared folder. -+ * -+ * sfprov_mount() takes as input the connection pointer and the name of -+ * the shared folder. On success, it returns zero and supplies an -+ * sfp_mount_t handle. On failure it returns any relevant errno value. -+ * -+ * sfprov_unmount() unmounts the mounted file system. It returns 0 on -+ * success and any relevant errno on failure. -+ */ -+typedef struct sfp_mount sfp_mount_t; -+ -+struct sfp_file { -+ SHFLHANDLE handle; -+ VBSFMAP map; /* need this again for the close operation */ -+}; -+ -+typedef struct sfp_file sfp_file_t; -+ -+/* -+ * File operations: open/close/read/write/etc. -+ * -+ * open/create can return any relevant errno, however ENOENT -+ * generally means that the host file didn't exist. -+ */ -+typedef struct sffs_stat { -+ mode_t sf_mode; -+ off_t sf_size; -+ off_t sf_alloc; -+ struct timespec sf_atime; -+ struct timespec sf_mtime; -+ struct timespec sf_ctime; -+} sffs_stat_t; -+ -+/* -+ * Read directory entries. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 14:36:28 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 100A6A8A for ; Sun, 22 Sep 2013 14:36:28 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E17F8252E for ; Sun, 22 Sep 2013 14:36:27 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MEaRxO061666 for ; Sun, 22 Sep 2013 14:36:27 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8MEaRoI061658 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 14:36:27 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 14:36:27 GMT Message-Id: <201309221436.r8MEaRoI061658@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257606 - in soc2013/def/crashdump-head/sys: kern sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 14:36:28 -0000 Author: def Date: Sun Sep 22 14:36:27 2013 New Revision: 257606 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257606 Log: Remove key and tweak constants. Remove HKDF. Include an encrypted key in a kernel dump hader. Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 13:54:08 2013 (r257605) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 14:36:27 2013 (r257606) @@ -857,11 +857,9 @@ if (dumper.dumper != NULL) return (EBUSY); dumper = *di; - dumper.kdk = &dumperkey; - dumper.kdb = &dumperbuffer; #ifdef ENCRYPT_CRASH - kerneldump_crypto_init(&dumper); + kerneldump_crypto_init(&dumper, &dumperkey, &dumperbuffer); #endif wantcopy = strlcpy(dumpdevname, devname, sizeof(dumpdevname)); @@ -942,73 +940,17 @@ #endif } -static void -kerneldump_hkdf_expand(struct xts_ctx *ctx, const uint8_t *masterkey, uint8_t *key, - int idx, const uint8_t *magic, size_t magicsize) -{ - uint8_t byte_idx = idx; - - hmac_init(&ctx->o.pctx_hmac, CRYPTO_SHA2_512_HMAC, - masterkey, KERNELDUMP_KEY_SIZE); - hmac_update(&ctx->o.pctx_hmac, key, KERNELDUMP_KEY_SIZE); - hmac_update(&ctx->o.pctx_hmac, magic, magicsize); - hmac_update(&ctx->o.pctx_hmac, &byte_idx, sizeof(byte_idx)); - hmac_final(&ctx->o.pctx_hmac, key, KERNELDUMP_KEY_SIZE); -} - void -kerneldump_crypto_init(struct dumperinfo *di) +kerneldump_crypto_init(struct dumperinfo *di, struct kerneldumpkey *kdk, + struct kerneldumpbuffer *kdb) { - if (di->kdk == NULL || di->kdb == NULL) { + if (kdk == NULL || kdb == NULL) { printf("Attempt to initialize a non-existing kernel dump key and buffer."); return; } - di->kdk = kerneldump_set_key(di->kdk, KERNELDUMP_KEY_SIZE, kerneldump_key, kerneldump_tweak); - di->kdb = kerneldump_set_buffer(di->kdb); -} - -struct kerneldumpkey * -kerneldump_set_key(struct kerneldumpkey *kdk, int keysize, char *masterkey, char *tweak) -{ - uint8_t key[KERNELDUMP_KEY_SIZE]; - struct xts_ctx ctx; - - if (kdk == NULL) { - printf("Cannot initialize kernel dump key."); - return (NULL); - } - - kdk->keysize = keysize; - memcpy(kdk->key, masterkey, kdk->keysize); - memcpy(kdk->tweak, tweak, KERNELDUMP_TWEAK_SIZE); - bzero(&kdk->tweak_ctx, sizeof(kdk->tweak_ctx)); - bzero(&kdk->data_ctx, sizeof(kdk->data_ctx)); - bzero(key, KERNELDUMP_KEY_SIZE); - - kerneldump_hkdf_expand(&ctx, kdk->key, key, 1, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&kdk->data_ctx, key, kdk->keysize << 3); - - kerneldump_hkdf_expand(&ctx, kdk->key, key, 2, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&kdk->tweak_ctx, key, kdk->keysize << 3); - - bzero(&ctx, sizeof(ctx)); - bzero(key, KERNELDUMP_KEY_SIZE); - - return (kdk); -} - -struct kerneldumpbuffer * -kerneldump_set_buffer(struct kerneldumpbuffer *kdb) -{ - if (kdb == NULL) { - printf("Cannot initialize kernel dump buffer."); - return (NULL); - } - - kdb->kdhoffset = 0; - - return (kdb); + di->kdk = kdk; + di->kdb = kdb; } void @@ -1029,7 +971,7 @@ if (panicstr != NULL) strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->keysize = dumper.kdk->keysize; - strncpy(kdh->key, dumper.kdk->key, kdh->keysize); + strncpy(kdh->encrypted_key, dumper.kdk->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); strncpy(kdh->tweak, dumper.kdk->tweak, KERNELDUMP_TWEAK_SIZE); kdh->parity = kerneldump_parity(kdh); } Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 13:54:08 2013 (r257605) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 14:36:27 2013 (r257606) @@ -83,10 +83,10 @@ uint64_t dumptime; uint32_t blocksize; char hostname[64]; - char versionstring[170]; - char panicstring[170]; + char versionstring[58]; + char panicstring[58]; int keysize; - char key[KERNELDUMP_KEY_SIZE]; + char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; char tweak[KERNELDUMP_TWEAK_SIZE]; uint32_t parity; }; @@ -111,7 +111,6 @@ struct kerneldumpkey { int keysize; - char key[KERNELDUMP_KEY_SIZE]; char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; char tweak[KERNELDUMP_TWEAK_SIZE]; struct xts_ctx data_ctx; @@ -119,19 +118,6 @@ }; #ifdef _KERNEL -/* - * Constant key for kernel crash dumps. - */ -static char kerneldump_key[KERNELDUMP_KEY_SIZE] = { - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 -}; - -static char kerneldump_tweak[KERNELDUMP_TWEAK_SIZE] = { - 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 -}; - struct kerneldumpbuffer { #define KERNELDUMP_DEVBLK_SIZE 512 #define KERNELDUMP_SECTOR_SIZE 4096 @@ -141,9 +127,8 @@ off_t kdhoffset; /* Offset value of the first kdh. */ }; -void kerneldump_crypto_init(struct dumperinfo *di); -struct kerneldumpkey *kerneldump_set_key(struct kerneldumpkey *kdk, int keysize, char *key, char *tweak); -struct kerneldumpbuffer *kerneldump_set_buffer(struct kerneldumpbuffer *kdb); +void kerneldump_crypto_init(struct dumperinfo *di, struct kerneldumpkey *kdk, + struct kerneldumpbuffer *kdb); void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, uint64_t dumplen, uint32_t blksz); #endif From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 14:46:24 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 028F0D2E for ; Sun, 22 Sep 2013 14:46:24 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2F8E259E for ; Sun, 22 Sep 2013 14:46:23 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MEkN2r088228 for ; Sun, 22 Sep 2013 14:46:23 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8MEkNQe088221 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 14:46:23 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 14:46:23 GMT Message-Id: <201309221446.r8MEkNQe088221@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257607 - in soc2013/def/crashdump-head: etc/rc.d sbin/dumpkey sbin/savecore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 14:46:24 -0000 Author: def Date: Sun Sep 22 14:46:23 2013 New Revision: 257607 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257607 Log: Change savecore(8) to: provide a private key, save an encrypted key in a file, decrypt the key to use it later. Use RSA_size(3) to determine the size of the key. Modified: soc2013/def/crashdump-head/etc/rc.d/savecore soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c soc2013/def/crashdump-head/sbin/savecore/Makefile soc2013/def/crashdump-head/sbin/savecore/decryptfile.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.h soc2013/def/crashdump-head/sbin/savecore/savecore.c Modified: soc2013/def/crashdump-head/etc/rc.d/savecore ============================================================================== --- soc2013/def/crashdump-head/etc/rc.d/savecore Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/etc/rc.d/savecore Sun Sep 22 14:46:23 2013 (r257607) @@ -13,6 +13,7 @@ start_cmd="savecore_start" start_precmd="savecore_prestart" stop_cmd=":" +savecore_flags="${savecore_flags} -p ${dumpkey_priv}" savecore_prestart() { Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 14:46:23 2013 (r257607) @@ -56,7 +56,7 @@ } static int -encrypt_key(char *key, char *encrypted_key, RSA *public_key, char *public_key_file) +encrypt_key(char *plainkey, struct kerneldumpkey *key, RSA *public_key, char *public_key_file) { FILE *fp; @@ -71,9 +71,11 @@ if (public_key == NULL) return (-1); - if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE, key, encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) + if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE, plainkey, key->encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) return (-1); + key->keysize = RSA_size(public_key); + return (0); } @@ -139,8 +141,6 @@ goto out; } - key.keysize = KERNELDUMP_KEY_SIZE; - if (random_data(buf, KERNELDUMP_KEY_SIZE)) { printf("Error: cannot generate a symmetric key.\n"); error = 1; @@ -153,7 +153,7 @@ goto out; } - if (encrypt_key(buf, key.encrypted_key, public_key, public_key_file)) { + if (encrypt_key(buf, &key, public_key, public_key_file)) { printf("Error: cannot encrypt a symmetric key.\n"); error = 1; goto out; Modified: soc2013/def/crashdump-head/sbin/savecore/Makefile ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/Makefile Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/sbin/savecore/Makefile Sun Sep 22 14:46:23 2013 (r257607) @@ -10,8 +10,8 @@ SRCS+= camellia.c SRCS+= hmac.c sha2.c SRCS+= xts.c -DPADD= ${LIBZ} -LDADD= -lz +DPADD= ${LIBZ} ${LIBCRYPTO} +LDADD= -lz -lcrypto CFLAGS+=-I${SYS} WARNS?= 2 MAN= savecore.8 Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Sun Sep 22 14:46:23 2013 (r257607) @@ -4,9 +4,78 @@ #include #include #include + +#define OPENSSL_NO_SHA +#include +#include +#include +#include + #include "decryptfile.h" int +save_key_for(decFile *fd, const char *keyname) +{ + FILE *fp; + + fp = fopen(keyname, "w"); + + if (fp == NULL) + return (-1); + + if (fwrite(fd->encrypted_key, 1, fd->keysize, fp) != fd->keysize) { + fclose(fp); + + return (-1); + } + + fclose(fp); + + return (0); +} + +int +decrypt_key_for(decFile *fd, const char *private_key_file) +{ + RSA *private_key; + FILE *fp; + int error; + + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + OPENSSL_config(NULL); + + error = 0; + private_key = RSA_new(); + fp = fopen(private_key_file, "r"); + + if (fp == NULL) { + error = 1; + goto out; + } + + private_key = PEM_read_RSAPrivateKey(fp, &private_key, NULL, NULL); + fclose(fp); + + if (private_key == NULL) { + error = 1; + goto out; + } + + if (RSA_private_decrypt(fd->keysize, fd->encrypted_key, fd->key, private_key, RSA_PKCS1_PADDING) == -1) { + error = 1; + goto out; + } + +out: + RSA_free(private_key); + ERR_free_strings(); + EVP_cleanup(); + + return (error); +} + +int dwrite(void *cookie, const char *data, int size) { decFile *fd = (decFile *)cookie; @@ -57,7 +126,8 @@ } FILE * -dopen(const char *fname, const char *mode, const struct kerneldumpheader *h, off_t offset) +dopen(const char *fname, const char *mode, const char *keyname, + const char *private_key_file, const struct kerneldumpheader *h, off_t offset) { uint8_t key[KERNELDUMP_KEY_SIZE]; struct xts_ctx ctx; @@ -77,17 +147,20 @@ fd->fp = fp; fd->keysize = h->keysize; - memcpy(fd->key, h->key, fd->keysize); + memcpy(fd->encrypted_key, h->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); memcpy(fd->tweak, h->tweak, KERNELDUMP_TWEAK_SIZE); bzero(&fd->tweak_ctx, sizeof(fd->tweak_ctx)); bzero(&fd->data_ctx, sizeof(fd->data_ctx)); bzero(key, KERNELDUMP_KEY_SIZE); + save_key_for(fd, keyname); + decrypt_key_for(fd, private_key_file); + hkdf_expand(&ctx, fd->key, key, 1, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&fd->data_ctx, key, fd->keysize << 3); + xts_alg_aes.pa_keysetup(&fd->data_ctx, key, KERNELDUMP_KEY_SIZE << 3); hkdf_expand(&ctx, fd->key, key, 2, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&fd->tweak_ctx, key, fd->keysize << 3); + xts_alg_aes.pa_keysetup(&fd->tweak_ctx, key, KERNELDUMP_KEY_SIZE << 3); bzero(&ctx, sizeof(ctx)); bzero(key, KERNELDUMP_KEY_SIZE); Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.h ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Sun Sep 22 14:46:23 2013 (r257607) @@ -8,6 +8,7 @@ FILE *fp; int keysize; char key[KERNELDUMP_KEY_SIZE]; + char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; char tweak[KERNELDUMP_TWEAK_SIZE]; struct xts_ctx tweak_ctx; struct xts_ctx data_ctx; @@ -18,7 +19,10 @@ } decFile; int dwrite(void *cookie, const char *data, int size); -FILE *dopen(const char *fname, const char *mode, const struct kerneldumpheader *h, off_t offset); +FILE *dopen(const char *fname, const char *mode, const char *keyname, + const char *private_key_file, const struct kerneldumpheader *h, off_t offset); int dclose(void *cookie); +int save_key_for(decFile *fd, const char *keyname); +int decrypt_key_for(decFile *fd, const char *public_key_file); #endif /* _FILEDECRYPT_H */ Modified: soc2013/def/crashdump-head/sbin/savecore/savecore.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/savecore.c Sun Sep 22 14:36:27 2013 (r257606) +++ soc2013/def/crashdump-head/sbin/savecore/savecore.c Sun Sep 22 14:46:23 2013 (r257607) @@ -92,6 +92,7 @@ static int checkfor, compress, clear, decrypt, force, keep, verbose; /* flags */ static int nfound, nsaved, nerr; /* statistics */ static int maxdumps; +static char *private_key_file; extern FILE *zopen(const char *, const char *); @@ -435,6 +436,7 @@ DoFile(const char *savedir, const char *device) { static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX]; + static char keyname[PATH_MAX]; static char *buf = NULL; struct kerneldumpheader kdhf, kdhl; off_t mediasize, dumpsize, firsthd, lasthd; @@ -634,7 +636,9 @@ } else if (decrypt) { snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); - fp = dopen(corename, "w", &kdhl, firsthd + sizeof(kdhf)); + snprintf(keyname, sizeof(keyname), "key.%d", bounds); + fp = dopen(corename, "w", keyname, private_key_file, + &kdhl, firsthd + sizeof(kdhf)); } else { snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); @@ -735,7 +739,7 @@ fprintf(stderr, "%s\n%s\n%s\n", "usage: savecore -c [-v] [device ...]", " savecore -C [-v] [device ...]", - " savecore [-dfkvz] [-m maxdumps] [directory [device ...]]"); + " savecore [-dfkvz] [-m maxdumps] [-p private_key] [directory [device ...]]"); exit(1); } @@ -748,11 +752,12 @@ checkfor = compress = clear = decrypt = force = keep = verbose = 0; nfound = nsaved = nerr = 0; + private_key_file = NULL; openlog("savecore", LOG_PERROR, LOG_DAEMON); signal(SIGINFO, infohandler); - while ((ch = getopt(argc, argv, "Ccdfkm:vz")) != -1) + while ((ch = getopt(argc, argv, "Ccdfkm:p:vz")) != -1) switch(ch) { case 'C': checkfor = 1; @@ -776,6 +781,9 @@ exit(1); } break; + case 'p': + private_key_file = optarg; + break; case 'v': verbose++; break; @@ -792,6 +800,8 @@ usage(); if (maxdumps > 0 && (checkfor || clear)) usage(); + if (decrypt && private_key_file == NULL) + usage(); argc -= optind; argv += optind; if (argc >= 1 && !checkfor && !clear) { From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 15:51:23 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA6B26E6 for ; Sun, 22 Sep 2013 15:51:23 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C744F2805 for ; Sun, 22 Sep 2013 15:51:23 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MFpNfl072909 for ; Sun, 22 Sep 2013 15:51:23 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8MFpNSt072903 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 15:51:23 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 15:51:23 GMT Message-Id: <201309221551.r8MFpNSt072903@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257613 - soc2013/def/crashdump-head/etc/rc.d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 15:51:23 -0000 Author: def Date: Sun Sep 22 15:51:23 2013 New Revision: 257613 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257613 Log: Change dumpkey to decrypt a symmetric key. Modified: soc2013/def/crashdump-head/etc/rc.d/dumpkey Modified: soc2013/def/crashdump-head/etc/rc.d/dumpkey ============================================================================== --- soc2013/def/crashdump-head/etc/rc.d/dumpkey Sun Sep 22 14:53:07 2013 (r257612) +++ soc2013/def/crashdump-head/etc/rc.d/dumpkey Sun Sep 22 15:51:23 2013 (r257613) @@ -10,6 +10,9 @@ start_cmd="dumpkey_start" start_precmd="dumpkey_prestart" stop_cmd=":" +decrypt_precmd="dumpkey_predecrypt" +decrypt_cmd="dumpkey_decrypt" +extra_commands="decrypt" dumpkey_prestart() { @@ -29,5 +32,22 @@ /sbin/dumpkey -p ${dumpkey_pub} } +dumpkey_predecrypt() +{ + if [ ! -r "${dumpkey_priv}" ]; then + warn "The private RSA key doesn't exist. It's not possible to decrypt the symmetric key." + return 1 + fi +} + +dumpkey_decrypt() +{ + if [ $# -gt 0 ]; then + /usr/bin/openssl rsautl -decrypt -inkey ${dumpkey_priv} -in "$*" -out "$*-decrypted" + else + echo "You have to specify an encrypted symmetric key." + fi +} + load_rc_config $name -run_rc_command "$1" +run_rc_command "$@" From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 16:34:16 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1B325FF1 for ; Sun, 22 Sep 2013 16:34:16 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E164729CD for ; Sun, 22 Sep 2013 16:34:15 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8MGYF62021102 for ; Sun, 22 Sep 2013 16:34:15 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8MGYFnU021092 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 16:34:15 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 16:34:15 GMT Message-Id: <201309221634.r8MGYFnU021092@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257614 - in soc2013/def/crashdump-head: sbin/dumpkey sbin/savecore sys/sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 16:34:16 -0000 Author: def Date: Sun Sep 22 16:34:15 2013 New Revision: 257614 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257614 Log: Use XTS-AES-256 (see IEEE Std 1619-2007). Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 15:51:23 2013 (r257613) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Sun Sep 22 16:34:15 2013 (r257614) @@ -91,10 +91,10 @@ bzero(tweak_ctx, sizeof(struct xts_ctx)); hkdf_expand(&ctx, masterkey, key, 1, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(data_ctx, key, KERNELDUMP_KEY_SIZE << 3); + xts_alg_aes.pa_keysetup(data_ctx, key, KERNELDUMP_KEY_SIZE << 2); hkdf_expand(&ctx, masterkey, key, 2, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(tweak_ctx, key, KERNELDUMP_KEY_SIZE << 3); + xts_alg_aes.pa_keysetup(tweak_ctx, key, KERNELDUMP_KEY_SIZE << 2); bzero(&ctx, sizeof(struct xts_ctx)); bzero(key, KERNELDUMP_KEY_SIZE); Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Sun Sep 22 15:51:23 2013 (r257613) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Sun Sep 22 16:34:15 2013 (r257614) @@ -157,10 +157,10 @@ decrypt_key_for(fd, private_key_file); hkdf_expand(&ctx, fd->key, key, 1, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&fd->data_ctx, key, KERNELDUMP_KEY_SIZE << 3); + xts_alg_aes.pa_keysetup(&fd->data_ctx, key, KERNELDUMP_KEY_SIZE << 2); hkdf_expand(&ctx, fd->key, key, 2, kerneldump_magic, sizeof(kerneldump_magic)); - xts_alg_aes.pa_keysetup(&fd->tweak_ctx, key, KERNELDUMP_KEY_SIZE << 3); + xts_alg_aes.pa_keysetup(&fd->tweak_ctx, key, KERNELDUMP_KEY_SIZE << 2); bzero(&ctx, sizeof(ctx)); bzero(key, KERNELDUMP_KEY_SIZE); Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 15:51:23 2013 (r257613) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Sun Sep 22 16:34:15 2013 (r257614) @@ -76,7 +76,7 @@ #define KERNELDUMP_POWERPC_VERSION 1 #define KERNELDUMP_SPARC64_VERSION 1 #define KERNELDUMP_TEXT_VERSION 1 -#define KERNELDUMP_KEY_SIZE 32 +#define KERNELDUMP_KEY_SIZE 64 #define KERNELDUMP_ENCRYPTED_KEY_SIZE 256 #define KERNELDUMP_TWEAK_SIZE 8 uint64_t dumplength; /* excl headers */ From owner-svn-soc-all@FreeBSD.ORG Sun Sep 22 21:03:58 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DE449E17 for ; Sun, 22 Sep 2013 21:03:58 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAF052689 for ; Sun, 22 Sep 2013 21:03:58 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8ML3wkk033445 for ; Sun, 22 Sep 2013 21:03:58 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8ML3wmh033433 for svn-soc-all@FreeBSD.org; Sun, 22 Sep 2013 21:03:58 GMT (envelope-from def@FreeBSD.org) Date: Sun, 22 Sep 2013 21:03:58 GMT Message-Id: <201309222103.r8ML3wmh033433@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257625 - soc2013/def/crashdump-head/sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Sep 2013 21:03:58 -0000 Author: def Date: Sun Sep 22 21:03:58 2013 New Revision: 257625 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257625 Log: Fix bug: use memcpy instead of strncpy to copy memory. Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 20:32:28 2013 (r257624) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Sun Sep 22 21:03:58 2013 (r257625) @@ -971,7 +971,7 @@ if (panicstr != NULL) strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->keysize = dumper.kdk->keysize; - strncpy(kdh->encrypted_key, dumper.kdk->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); - strncpy(kdh->tweak, dumper.kdk->tweak, KERNELDUMP_TWEAK_SIZE); + memcpy(kdh->encrypted_key, dumper.kdk->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); + memcpy(kdh->tweak, dumper.kdk->tweak, KERNELDUMP_TWEAK_SIZE); kdh->parity = kerneldump_parity(kdh); } From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 01:01:30 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 119A89D4 for ; Mon, 23 Sep 2013 01:01:30 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2BD7233C for ; Mon, 23 Sep 2013 01:01:29 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8N11TM9079406 for ; Mon, 23 Sep 2013 01:01:29 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8N11TsF079389 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 01:01:29 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 01:01:29 GMT Message-Id: <201309230101.r8N11TsF079389@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257632 - in soc2013/def/crashdump-head: sbin/dumpkey sbin/savecore sys/kern sys/sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 01:01:30 -0000 Author: def Date: Mon Sep 23 01:01:29 2013 New Revision: 257632 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257632 Log: Include a tweak in an encrypted key. Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.h soc2013/def/crashdump-head/sys/kern/kern_shutdown.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 00:16:19 2013 (r257631) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 01:01:29 2013 (r257632) @@ -71,7 +71,10 @@ if (public_key == NULL) return (-1); - if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE, plainkey, key->encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) + memcpy(plainkey + KERNELDUMP_KEY_SIZE, key->tweak, KERNELDUMP_TWEAK_SIZE); + + if (RSA_public_encrypt(KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE, plainkey, + key->encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) return (-1); key->keysize = RSA_size(public_key); @@ -112,7 +115,7 @@ main(int argc, char **argv) { struct kerneldumpkey key; - char *public_key_file, buf[KERNELDUMP_KEY_SIZE]; + char *public_key_file, buf[KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE]; int ch, error; RSA *public_key; @@ -147,20 +150,20 @@ goto out; } - if (expand_key(buf, &key.data_ctx, &key.tweak_ctx)) { - printf("Error: cannot expand a symmetric key."); + if (random_data(key.tweak, KERNELDUMP_TWEAK_SIZE)) { + printf("Error: cannot generate a tweak.\n"); error = 1; goto out; } - if (encrypt_key(buf, &key, public_key, public_key_file)) { - printf("Error: cannot encrypt a symmetric key.\n"); + if (expand_key(buf, &key.data_ctx, &key.tweak_ctx)) { + printf("Error: cannot expand a symmetric key."); error = 1; goto out; } - if (random_data(key.tweak, KERNELDUMP_TWEAK_SIZE)) { - printf("Error: cannot generate a tweak.\n"); + if (encrypt_key(buf, &key, public_key, public_key_file)) { + printf("Error: cannot encrypt a symmetric key.\n"); error = 1; goto out; } Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Mon Sep 23 00:16:19 2013 (r257631) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Mon Sep 23 01:01:29 2013 (r257632) @@ -148,7 +148,6 @@ fd->keysize = h->keysize; memcpy(fd->encrypted_key, h->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); - memcpy(fd->tweak, h->tweak, KERNELDUMP_TWEAK_SIZE); bzero(&fd->tweak_ctx, sizeof(fd->tweak_ctx)); bzero(&fd->data_ctx, sizeof(fd->data_ctx)); bzero(key, KERNELDUMP_KEY_SIZE); Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.h ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Mon Sep 23 00:16:19 2013 (r257631) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Mon Sep 23 01:01:29 2013 (r257632) @@ -8,8 +8,8 @@ FILE *fp; int keysize; char key[KERNELDUMP_KEY_SIZE]; - char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; char tweak[KERNELDUMP_TWEAK_SIZE]; + char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; struct xts_ctx tweak_ctx; struct xts_ctx data_ctx; off_t offset; Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 00:16:19 2013 (r257631) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 01:01:29 2013 (r257632) @@ -972,6 +972,5 @@ strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); kdh->keysize = dumper.kdk->keysize; memcpy(kdh->encrypted_key, dumper.kdk->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); - memcpy(kdh->tweak, dumper.kdk->tweak, KERNELDUMP_TWEAK_SIZE); kdh->parity = kerneldump_parity(kdh); } Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 00:16:19 2013 (r257631) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 01:01:29 2013 (r257632) @@ -83,11 +83,10 @@ uint64_t dumptime; uint32_t blocksize; char hostname[64]; - char versionstring[58]; - char panicstring[58]; + char versionstring[62]; + char panicstring[62]; int keysize; char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; - char tweak[KERNELDUMP_TWEAK_SIZE]; uint32_t parity; }; From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 03:13:34 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7DD6C389 for ; Mon, 23 Sep 2013 03:13:34 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6948B2835 for ; Mon, 23 Sep 2013 03:13:34 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8N3DY80029468 for ; Mon, 23 Sep 2013 03:13:34 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8N3DYwB029463 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 03:13:34 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 03:13:34 GMT Message-Id: <201309230313.r8N3DYwB029463@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257633 - in soc2013/def/crashdump-head: sbin/savecore sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 03:13:34 -0000 Author: def Date: Mon Sep 23 03:13:32 2013 New Revision: 257633 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257633 Log: Change offset to be a relative value to the first kernel dump header. Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.h soc2013/def/crashdump-head/sbin/savecore/savecore.c soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Mon Sep 23 01:01:29 2013 (r257632) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.c Mon Sep 23 03:13:32 2013 (r257633) @@ -127,7 +127,7 @@ FILE * dopen(const char *fname, const char *mode, const char *keyname, - const char *private_key_file, const struct kerneldumpheader *h, off_t offset) + const char *private_key_file, const struct kerneldumpheader *h) { uint8_t key[KERNELDUMP_KEY_SIZE]; struct xts_ctx ctx; @@ -164,7 +164,7 @@ bzero(&ctx, sizeof(ctx)); bzero(key, KERNELDUMP_KEY_SIZE); - fd->offset = offset; + fd->offset = 0; fd->buf_used = 0; return (funopen(fd, NULL, dwrite, NULL, dclose)); Modified: soc2013/def/crashdump-head/sbin/savecore/decryptfile.h ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Mon Sep 23 01:01:29 2013 (r257632) +++ soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Mon Sep 23 03:13:32 2013 (r257633) @@ -20,7 +20,7 @@ int dwrite(void *cookie, const char *data, int size); FILE *dopen(const char *fname, const char *mode, const char *keyname, - const char *private_key_file, const struct kerneldumpheader *h, off_t offset); + const char *private_key_file, const struct kerneldumpheader *h); int dclose(void *cookie); int save_key_for(decFile *fd, const char *keyname); int decrypt_key_for(decFile *fd, const char *public_key_file); Modified: soc2013/def/crashdump-head/sbin/savecore/savecore.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/savecore.c Mon Sep 23 01:01:29 2013 (r257632) +++ soc2013/def/crashdump-head/sbin/savecore/savecore.c Mon Sep 23 03:13:32 2013 (r257633) @@ -637,8 +637,7 @@ snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); snprintf(keyname, sizeof(keyname), "key.%d", bounds); - fp = dopen(corename, "w", keyname, private_key_file, - &kdhl, firsthd + sizeof(kdhf)); + fp = dopen(corename, "w", keyname, private_key_file, &kdhl); } else { snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 01:01:29 2013 (r257632) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 03:13:32 2013 (r257633) @@ -893,6 +893,7 @@ sector_index = (offset - kdb->kdhoffset)/KERNELDUMP_SECTOR_SIZE; sector_offset = kdb->kdhoffset + sector_index*KERNELDUMP_SECTOR_SIZE; devblk_index = (offset - sector_offset)/KERNELDUMP_DEVBLK_SIZE; + sector_offset -= kdb->kdhoffset; while (length > 0) { memcpy(kdb->buf, virtual, KERNELDUMP_DEVBLK_SIZE); @@ -912,7 +913,7 @@ devblk_index = (devblk_index+1)%KERNELDUMP_SECTOR_BLKS; if (devblk_index == 0) - sector_offset = offset; + sector_offset = offset - kdb->kdhoffset; } return (0); From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 04:20:38 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7418A7C4 for ; Mon, 23 Sep 2013 04:20:38 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6024F2A91 for ; Mon, 23 Sep 2013 04:20:38 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8N4KcA4081308 for ; Mon, 23 Sep 2013 04:20:38 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8N4KcaQ081302 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 04:20:38 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 04:20:38 GMT Message-Id: <201309230420.r8N4KcaQ081302@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257634 - in soc2013/def/crashdump-head: etc/rc.d sbin/savecore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 04:20:38 -0000 Author: def Date: Mon Sep 23 04:20:37 2013 New Revision: 257634 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257634 Log: Don't decrypt a crash dump in savecore any more. Added: soc2013/def/crashdump-head/sbin/savecore/dumpfile.c soc2013/def/crashdump-head/sbin/savecore/dumpfile.h Deleted: soc2013/def/crashdump-head/sbin/savecore/decryptfile.c soc2013/def/crashdump-head/sbin/savecore/decryptfile.h Modified: soc2013/def/crashdump-head/etc/rc.d/savecore soc2013/def/crashdump-head/sbin/savecore/Makefile soc2013/def/crashdump-head/sbin/savecore/savecore.c Modified: soc2013/def/crashdump-head/etc/rc.d/savecore ============================================================================== --- soc2013/def/crashdump-head/etc/rc.d/savecore Mon Sep 23 03:13:32 2013 (r257633) +++ soc2013/def/crashdump-head/etc/rc.d/savecore Mon Sep 23 04:20:37 2013 (r257634) @@ -13,7 +13,6 @@ start_cmd="savecore_start" start_precmd="savecore_prestart" stop_cmd=":" -savecore_flags="${savecore_flags} -p ${dumpkey_priv}" savecore_prestart() { Modified: soc2013/def/crashdump-head/sbin/savecore/Makefile ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/Makefile Mon Sep 23 03:13:32 2013 (r257633) +++ soc2013/def/crashdump-head/sbin/savecore/Makefile Mon Sep 23 04:20:37 2013 (r257634) @@ -1,17 +1,11 @@ # $FreeBSD$ SYS= ${.CURDIR}/../../sys -.PATH: ${SYS}/crypto/camellia ${SYS}/crypto/rijndael -.PATH: ${SYS}/crypto/hmac ${SYS}/crypto/sha2 ${SYS}/crypto PROG= savecore -SRCS= ${PROG}.c decryptfile.c -SRCS+= rijndael-api.c rijndael-api-fst.c rijndael-alg-fst.c -SRCS+= camellia.c -SRCS+= hmac.c sha2.c -SRCS+= xts.c -DPADD= ${LIBZ} ${LIBCRYPTO} -LDADD= -lz -lcrypto +SRCS= ${PROG}.c dumpfile.c +DPADD= ${LIBZ} +LDADD= -lz CFLAGS+=-I${SYS} WARNS?= 2 MAN= savecore.8 Added: soc2013/def/crashdump-head/sbin/savecore/dumpfile.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Mon Sep 23 04:20:37 2013 (r257634) @@ -0,0 +1,111 @@ +#include +#include +#include +#include +#include "dumpfile.h" + +int +save_key_for(dumpFile *fd, const char *keyname) +{ + FILE *fp; + + fp = fopen(keyname, "w"); + + if (fp == NULL) + return (-1); + + if (fwrite(fd->encrypted_key, 1, KERNELDUMP_ENCRYPTED_KEY_SIZE, fp) + != KERNELDUMP_ENCRYPTED_KEY_SIZE) { + fclose(fp); + + return (-1); + } + + fclose(fp); + + return (0); +} + +FILE * +dopen(const char *fname, const char *mode, const char *keyname, + const struct kerneldumpheader *h) +{ + dumpFile *fd; + FILE *fp; + + /* Currently other modes are not implemented. */ + if (*mode != 'w') + return (NULL); + + fp = fopen(fname, mode); + + if (fp == NULL) + return (NULL); + + fd = (dumpFile *)malloc(sizeof(dumpFile)); + fd->fp = fp; + + fd->keysize = h->keysize; + memcpy(fd->encrypted_key, h->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); + + save_key_for(fd, keyname); + + fd->buf_used = 0; + + return (funopen(fd, NULL, dwrite, NULL, dclose)); +} + +int +dwrite(void *cookie, const char *data, int size) +{ + dumpFile *fd = (dumpFile *)cookie; + int resid, saved; + + saved = 0; + + while (size + fd->buf_used >= PEFS_SECTOR_SIZE) { + resid = PEFS_SECTOR_SIZE - fd->buf_used; + memcpy(fd->buf + fd->buf_used, data, resid); + fd->buf_used += resid; + + if (fwrite(fd->buf, 1, PEFS_SECTOR_SIZE, fd->fp) != PEFS_SECTOR_SIZE) + return (0); + + data += resid; + size -= resid; + fd->buf_used = 0; + saved += resid; + } + + if (size > 0) { + memcpy(fd->buf + fd->buf_used, data, size); + fd->buf_used += size; + saved += size; + } + + return (saved); +} + +int +dclose(void *cookie) +{ + dumpFile *fd = (dumpFile *)cookie; + int error; + + if (fd->buf_used > 0) { + if (fwrite(fd->buf, 1, fd->buf_used, fd->fp) != 1) + return (0); + + fd->buf_used = 0; + } + + error = fclose(fd->fp); + + if (error < 0) + return (error); + + free(fd); + + return (error); +} + Added: soc2013/def/crashdump-head/sbin/savecore/dumpfile.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/def/crashdump-head/sbin/savecore/dumpfile.h Mon Sep 23 04:20:37 2013 (r257634) @@ -0,0 +1,22 @@ +#ifndef _DUMPFILE_H +#define _DUMPFILE_H + +#include + +typedef struct _dumpFile { + FILE *fp; + int keysize; + char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; +#define PEFS_SECTOR_SIZE 4096 + char buf[PEFS_SECTOR_SIZE]; + int buf_used; +} dumpFile; + +FILE *dopen(const char *fname, const char *mode, const char *keyname, + const struct kerneldumpheader *h); +int dwrite(void *cookie, const char *data, int size); +int dclose(void *cookie); +int save_key_for(dumpFile *fd, const char *keyname); + +#endif /* _DUMPFILE_H */ + Modified: soc2013/def/crashdump-head/sbin/savecore/savecore.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/savecore.c Mon Sep 23 03:13:32 2013 (r257633) +++ soc2013/def/crashdump-head/sbin/savecore/savecore.c Mon Sep 23 04:20:37 2013 (r257634) @@ -80,7 +80,7 @@ #include #include #include -#include "decryptfile.h" +#include "dumpfile.h" /* The size of the buffer used for I/O. */ #define BUFFERSIZE (1024*1024) @@ -89,10 +89,9 @@ #define STATUS_GOOD 1 #define STATUS_UNKNOWN 2 -static int checkfor, compress, clear, decrypt, force, keep, verbose; /* flags */ +static int checkfor, compress, clear, force, isencrypted, keep, verbose; /* flags */ static int nfound, nsaved, nerr; /* statistics */ static int maxdumps; -static char *private_key_file; extern FILE *zopen(const char *, const char *); @@ -123,7 +122,6 @@ fprintf(f, " Panic String: %s\n", h->panicstring); fprintf(f, " Dump Parity: %u\n", h->parity); fprintf(f, " Bounds: %d\n", bounds); - fprintf(f, " Key length: %d bits\n", h->keysize << 3); switch(status) { case STATUS_BAD: @@ -316,7 +314,7 @@ } if (compress) { nw = fwrite(buf, 1, wl, fp); - } else if (decrypt) { + } else if (isencrypted) { nw = fwrite(buf, 1, wl, fp); } else { for (nw = 0; nw < nr; nw = he) { @@ -633,11 +631,11 @@ snprintf(corename, sizeof(corename), "%s.%d.gz", istextdump ? "textdump.tar" : "vmcore", bounds); fp = zopen(corename, "w"); - } else if (decrypt) { + } else if (isencrypted) { snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); snprintf(keyname, sizeof(keyname), "key.%d", bounds); - fp = dopen(corename, "w", keyname, private_key_file, &kdhl); + fp = dopen(corename, "w", keyname, &kdhl); } else { snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : "vmcore", bounds); @@ -666,7 +664,7 @@ fclose(info); syslog(LOG_NOTICE, "writing %score to %s/%s", - compress ? "compressed " : (decrypt ? "decrypted " : ""), savedir, corename); + compress ? "compressed " : (isencrypted ? "encrypted " : ""), savedir, corename); if (istextdump) { if (DoTextdumpFile(fd, dumpsize, lasthd, buf, device, @@ -694,9 +692,6 @@ if (compress) { snprintf(linkname, sizeof(linkname), "%s.last.gz", istextdump ? "textdump.tar" : "vmcore"); - } else if (decrypt) { - snprintf(linkname, sizeof(linkname), "%s.last", - istextdump ? "textdump.tar" : "vmcore"); } else { snprintf(linkname, sizeof(linkname), "%s.last", istextdump ? "textdump.tar" : "vmcore"); @@ -738,7 +733,7 @@ fprintf(stderr, "%s\n%s\n%s\n", "usage: savecore -c [-v] [device ...]", " savecore -C [-v] [device ...]", - " savecore [-dfkvz] [-m maxdumps] [-p private_key] [directory [device ...]]"); + " savecore [-efkvz] [-m maxdumps] [directory [device ...]]"); exit(1); } @@ -749,14 +744,13 @@ struct fstab *fsp; int i, ch, error; - checkfor = compress = clear = decrypt = force = keep = verbose = 0; + checkfor = compress = clear = force = isencrypted = keep = verbose = 0; nfound = nsaved = nerr = 0; - private_key_file = NULL; openlog("savecore", LOG_PERROR, LOG_DAEMON); signal(SIGINFO, infohandler); - while ((ch = getopt(argc, argv, "Ccdfkm:p:vz")) != -1) + while ((ch = getopt(argc, argv, "Ccefkm:vz")) != -1) switch(ch) { case 'C': checkfor = 1; @@ -764,8 +758,8 @@ case 'c': clear = 1; break; - case 'd': - decrypt = 1; + case 'e': + isencrypted = 1; break; case 'f': force = 1; @@ -780,9 +774,6 @@ exit(1); } break; - case 'p': - private_key_file = optarg; - break; case 'v': verbose++; break; @@ -799,8 +790,6 @@ usage(); if (maxdumps > 0 && (checkfor || clear)) usage(); - if (decrypt && private_key_file == NULL) - usage(); argc -= optind; argv += optind; if (argc >= 1 && !checkfor && !clear) { From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 04:40:35 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 072E9AB1 for ; Mon, 23 Sep 2013 04:40:35 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6B642B21 for ; Mon, 23 Sep 2013 04:40:34 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8N4eYgq088970 for ; Mon, 23 Sep 2013 04:40:34 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8N4eYj2088943 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 04:40:34 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 04:40:34 GMT Message-Id: <201309230440.r8N4eYj2088943@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257635 - in soc2013/def/crashdump-head: etc/rc.d sbin/dumpkey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 04:40:35 -0000 Author: def Date: Mon Sep 23 04:40:34 2013 New Revision: 257635 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257635 Log: Change dumpkey to decrypt a crash dump with a custom XTS-AES key and a RSA key. Modified: soc2013/def/crashdump-head/etc/rc.d/dumpkey soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Modified: soc2013/def/crashdump-head/etc/rc.d/dumpkey ============================================================================== --- soc2013/def/crashdump-head/etc/rc.d/dumpkey Mon Sep 23 04:20:37 2013 (r257634) +++ soc2013/def/crashdump-head/etc/rc.d/dumpkey Mon Sep 23 04:40:34 2013 (r257635) @@ -29,7 +29,7 @@ dumpkey_start() { - /sbin/dumpkey -p ${dumpkey_pub} + /sbin/dumpkey -e ${dumpkey_pub} } dumpkey_predecrypt() Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 04:20:37 2013 (r257634) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 04:40:34 2013 (r257635) @@ -13,6 +13,7 @@ #include #define PATH_DEVRANDOM "/dev/random" +#define PEFS_SECTOR_SIZE 4096 static void hkdf_expand(struct xts_ctx *ctx, const uint8_t *masterkey, uint8_t *key, @@ -31,15 +32,17 @@ static void usage(void) { - printf("usage: dumpkey -p public_key\n"); + printf("%s\n%s\n", + "usage: dumpkey -e public_key", + " dumpkey -d private_key -k encrypted_key -c encrypted_core"); } static int -random_data(char *buf, size_t size) +read_data(char *buf, size_t size, char *fname) { FILE *fp; - fp = fopen(PATH_DEVRANDOM, "r"); + fp = fopen(fname, "r"); if (fp == NULL) return (-1); @@ -56,6 +59,12 @@ } static int +random_data(char *buf, size_t size) +{ + return (read_data(buf, size, PATH_DEVRANDOM)); +} + +static int encrypt_key(char *plainkey, struct kerneldumpkey *key, RSA *public_key, char *public_key_file) { FILE *fp; @@ -83,6 +92,33 @@ } static int +decrypt_key(char *cipherkey, char *key, char *tweak, RSA *private_key, char *private_key_file) +{ + FILE *fp; + char buf[KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE]; + + fp = fopen(private_key_file, "r"); + + if (fp == NULL) + return (-1); + + private_key = PEM_read_RSAPrivateKey(fp, &private_key, NULL, NULL); + fclose(fp); + + if (private_key == NULL) + return (-1); + + if (RSA_private_decrypt(KERNELDUMP_ENCRYPTED_KEY_SIZE, cipherkey, buf, + private_key, RSA_PKCS1_PADDING) == -1) + return (-1); + + memcpy(key, buf, KERNELDUMP_KEY_SIZE); + memcpy(tweak, buf + KERNELDUMP_KEY_SIZE, KERNELDUMP_TWEAK_SIZE); + + return (0); +} + +static int expand_key(char *masterkey, struct xts_ctx *data_ctx, struct xts_ctx *tweak_ctx) { struct xts_ctx ctx; @@ -111,74 +147,165 @@ return (sysctlbyname("kern.dumpkey", NULL, NULL, key, sizeof(struct kerneldumpkey))); } -int -main(int argc, char **argv) +static void +generate_key(char *public_key_file) { + char buf[KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE]; struct kerneldumpkey key; - char *public_key_file, buf[KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE]; - int ch, error; RSA *public_key; - ERR_load_crypto_strings(); - OpenSSL_add_all_algorithms(); - OPENSSL_config(NULL); - - error = 0; - public_key_file = NULL; public_key = RSA_new(); - while ((ch = getopt(argc, argv, "p:")) != -1) - switch (ch) { - case 'p': - public_key_file = optarg; - break; - default: - usage(); - error = 1; - goto out; - } - - if (public_key_file == NULL) { - usage(); - error = 1; - goto out; - } - if (random_data(buf, KERNELDUMP_KEY_SIZE)) { printf("Error: cannot generate a symmetric key.\n"); - error = 1; goto out; } if (random_data(key.tweak, KERNELDUMP_TWEAK_SIZE)) { printf("Error: cannot generate a tweak.\n"); - error = 1; goto out; } if (expand_key(buf, &key.data_ctx, &key.tweak_ctx)) { - printf("Error: cannot expand a symmetric key."); - error = 1; + printf("Error: cannot expand a symmetric key.\n"); goto out; } if (encrypt_key(buf, &key, public_key, public_key_file)) { - printf("Error: cannot encrypt a symmetric key.\n"); - error = 1; + printf("Error: cannot encrypt a key.\n"); goto out; } if (sysctl_dumpkey(&key)) { printf("Error: cannot set a kernel crash dump key.\n"); - error = 1; goto out; } out: bzero(&key, sizeof(struct kerneldumpkey)); - bzero(buf, KERNELDUMP_KEY_SIZE); + bzero(buf, KERNELDUMP_KEY_SIZE + KERNELDUMP_TWEAK_SIZE); RSA_free(public_key); +} + +static void +decrypt_core(char *encrypted_core, char *private_key_file, char *encrypted_key_file) +{ + char key[KERNELDUMP_KEY_SIZE], tweak[KERNELDUMP_TWEAK_SIZE]; + char buf[PEFS_SECTOR_SIZE]; + struct xts_ctx data_ctx, tweak_ctx; + RSA *private_key; + int buf_used, offset; + size_t bytes; + FILE *fp, *fp_w; + + private_key = RSA_new(); + + memcpy(buf, encrypted_core, strlen(encrypted_core) + 1); + strcat(buf, "-decrypted"); + fp = fopen(encrypted_core, "r"); + fp_w = fopen(buf, "w"); + + if (fp == NULL || fp_w == NULL) + goto out; + + if (read_data(buf, KERNELDUMP_ENCRYPTED_KEY_SIZE, encrypted_key_file)) { + printf("Error: cannot read an encrypted key.\n"); + goto out; + } + + if (decrypt_key(buf, key, tweak, private_key, private_key_file)) { + printf("Error: cannot decrypt a key.\n"); + goto out; + } + + if (expand_key(key, &data_ctx, &tweak_ctx)) { + printf("Error: cannot expand a symmetric key.\n"); + goto out; + } + + offset = buf_used = 0; + do { + bytes = fread(buf + buf_used, 1, PEFS_SECTOR_SIZE - buf_used, fp); + buf_used += bytes; + + if (buf_used == PEFS_SECTOR_SIZE || (buf_used > 0 && bytes == 0)) { + xts_block_decrypt(&xts_alg_aes, &tweak_ctx, &data_ctx, offset, tweak, 0, buf_used, buf, buf); + + if (fwrite(buf, 1, buf_used, fp_w) != buf_used) + goto out; + + offset += buf_used; + buf_used = 0; + } + } while (bytes > 0); + +out: + fclose(fp_w); + fclose(fp); + bzero(&buf, sizeof(buf)); + bzero(&key, sizeof(key)); + bzero(&tweak, sizeof(tweak)); + bzero(&data_ctx, sizeof(struct xts_ctx)); + bzero(&tweak_ctx, sizeof(struct xts_ctx)); + RSA_free(private_key); +} + +int +main(int argc, char **argv) +{ + char *public_key_file, *private_key_file, *encrypted_key_file, *encrypted_core; + int ch, error; + + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + OPENSSL_config(NULL); + + error = 0; + public_key_file = private_key_file = NULL; + encrypted_key_file = encrypted_core = NULL; + + while ((ch = getopt(argc, argv, "c:d:e:k:")) != -1) + switch (ch) { + case 'c': + encrypted_core = optarg; + break; + case 'd': + private_key_file = optarg; + break; + case 'e': + public_key_file = optarg; + break; + case 'k': + encrypted_key_file = optarg; + break; + default: + usage(); + error = 1; + goto out; + } + + if ((public_key_file == NULL && private_key_file == NULL) || + (public_key_file != NULL && private_key_file != NULL)) { + usage(); + error = 1; + goto out; + } + + if (private_key_file != NULL && (encrypted_key_file == NULL || + encrypted_core == NULL)) { + usage(); + error = 1; + goto out; + } + + if (public_key_file != NULL) + generate_key(public_key_file); + + if (private_key_file != NULL) + decrypt_core(encrypted_core, private_key_file, encrypted_key_file); + +out: ERR_free_strings(); EVP_cleanup(); From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 08:02:36 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A8FCD62B for ; Mon, 23 Sep 2013 08:02:36 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85C2B2657 for ; Mon, 23 Sep 2013 08:02:36 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8N82aFo029035 for ; Mon, 23 Sep 2013 08:02:36 GMT (envelope-from syuu@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8N82aq7029023 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 08:02:36 GMT (envelope-from syuu@FreeBSD.org) Date: Mon, 23 Sep 2013 08:02:36 GMT Message-Id: <201309230802.r8N82aq7029023@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to syuu@FreeBSD.org using -f From: syuu@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257639 - in soc2013/syuu/bhyve_usb/usr.sbin/bhyve: . usb usb/gpl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 08:02:36 -0000 Author: syuu Date: Mon Sep 23 08:02:36 2013 New Revision: 257639 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257639 Log: quick hack for enabling UHCI interrupt Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/ioapic.c soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/bus.c soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/ioapic.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/ioapic.c Mon Sep 23 07:53:58 2013 (r257638) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/ioapic.c Mon Sep 23 08:02:36 2013 (r257639) @@ -106,10 +106,14 @@ */ low = ioapic->redtbl[pin]; high = ioapic->redtbl[pin] >> 32; +#if 0 if ((low & IOART_INTMASK) == IOART_INTMCLR && (low & IOART_TRGRMOD) == IOART_TRGREDG && (low & IOART_DESTMOD) == IOART_DESTPHY && (low & IOART_DELMOD) == IOART_DELFIXED) { +#else + { +#endif vector = low & IOART_INTVEC; apicid = high >> APIC_ID_SHIFT; if (apicid != 0xff) { Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/bus.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/bus.c Mon Sep 23 07:53:58 2013 (r257638) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/bus.c Mon Sep 23 08:02:36 2013 (r257639) @@ -123,8 +123,8 @@ static int usb_device_init(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); if (klass->init) { return klass->init(dev); } @@ -134,8 +134,8 @@ USBDevice *usb_device_find_device(USBDevice *dev, uint8_t addr) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p addr=%x klass=%p\n", -// __func__, __LINE__, dev, addr, klass); + fprintf(usblog, "%s:%d dev=%p addr=%x klass=%p\n", + __func__, __LINE__, dev, addr, klass); if (klass->find_device) { return klass->find_device(dev, addr); } @@ -145,8 +145,8 @@ static void usb_device_handle_destroy(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); if (klass->handle_destroy) { klass->handle_destroy(dev); } @@ -155,8 +155,8 @@ void usb_device_cancel_packet(USBDevice *dev, USBPacket *p) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p p=%p klass=%p\n", -// __func__, __LINE__, dev, p, klass); + fprintf(usblog, "%s:%d dev=%p p=%p klass=%p\n", + __func__, __LINE__, dev, p, klass); if (klass->cancel_packet) { klass->cancel_packet(dev, p); } @@ -165,8 +165,8 @@ void usb_device_handle_attach(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); if (klass->handle_attach) { klass->handle_attach(dev); } @@ -175,8 +175,8 @@ void usb_device_handle_reset(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); if (klass->handle_reset) { klass->handle_reset(dev); } @@ -186,8 +186,8 @@ int value, int index, int length, uint8_t *data) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p p=%p request=%d value=%d index=%d length=%d data=%p klass=%p\n", -// __func__, __LINE__, dev, p, request, value, index, length, data, klass); + fprintf(usblog, "%s:%d dev=%p p=%p request=%d value=%d index=%d length=%d data=%p klass=%p klass->handle_control:%p\n", + __func__, __LINE__, dev, p, request, value, index, length, data, klass, klass->handle_control); if (klass->handle_control) { klass->handle_control(dev, p, request, value, index, length, data); } @@ -196,8 +196,8 @@ void usb_device_handle_data(USBDevice *dev, USBPacket *p) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p p=%p klass=%p\n", -// __func__, __LINE__, dev, p, klass); + fprintf(usblog, "%s:%d dev=%p p=%p klass=%p\n", + __func__, __LINE__, dev, p, klass); if (klass->handle_data) { klass->handle_data(dev, p); } @@ -206,16 +206,16 @@ const char *usb_device_get_product_desc(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); return klass->product_desc; } const USBDesc *usb_device_get_usb_desc(USBDevice *dev) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p klass=%p\n", -// __func__, __LINE__, dev, klass); + fprintf(usblog, "%s:%d dev=%p klass=%p\n", + __func__, __LINE__, dev, klass); if (dev->usb_desc) { return dev->usb_desc; } @@ -236,8 +236,8 @@ void usb_device_flush_ep_queue(USBDevice *dev, USBEndpoint *ep) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p ep=%p klass=%p\n", -// __func__, __LINE__, dev, ep, klass); + fprintf(usblog, "%s:%d dev=%p ep=%p klass=%p\n", + __func__, __LINE__, dev, ep, klass); if (klass->flush_ep_queue) { klass->flush_ep_queue(dev, ep); } @@ -246,8 +246,8 @@ void usb_device_ep_stopped(USBDevice *dev, USBEndpoint *ep) { USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev); -// fprintf(usblog, "%s:%d dev=%p ep=%p klass=%p\n", -// __func__, __LINE__, dev, ep, klass); + fprintf(usblog, "%s:%d dev=%p ep=%p klass=%p\n", + __func__, __LINE__, dev, ep, klass); if (klass->ep_stopped) { klass->ep_stopped(dev, ep); } @@ -363,8 +363,8 @@ USBBus *bus; int i; -// fprintf(usblog, "%s:%d masterbus:%s ports:%p portcount:%d firstport:%d opaqueue:%p ops:%p speedmask:%x\n", -// __func__, __LINE__, masterbus, ports, portcount, firstport, opaque, ops, speedmask); + fprintf(usblog, "%s:%d masterbus:%s ports:%p portcount:%d firstport:%d opaqueue:%p ops:%p speedmask:%x\n", + __func__, __LINE__, masterbus, ports, portcount, firstport, opaque, ops, speedmask); QTAILQ_FOREACH(bus, &busses, next) { if (strcmp(bus->name, masterbus) == 0) { break; @@ -391,8 +391,8 @@ void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr) { -// fprintf(usblog, "%s:%d downstream:%p upstream:%p portnr:%d\n", -// __func__, __LINE__, downstream, upstream, portnr); + fprintf(usblog, "%s:%d downstream:%p upstream:%p portnr:%d\n", + __func__, __LINE__, downstream, upstream, portnr); if (upstream) { snprintf(downstream->path, sizeof(downstream->path), "%s.%d", upstream->path, portnr); Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c Mon Sep 23 07:53:58 2013 (r257638) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c Mon Sep 23 08:02:36 2013 (r257639) @@ -299,7 +299,7 @@ static int64_t get_clock_ns(void) { struct timespec ts; - if (clock_gettime(CLOCK_REALTIME, &ts)) { + if (clock_gettime(CLOCK_MONOTONIC, &ts)) { perror("clock_gettime"); exit(1); } @@ -342,7 +342,8 @@ struct itimerspec its; // fprintf(usblog, "%s:%d timer:%p ns:%ld\n", __func__, __LINE__, timer, ns); - its.it_value = its.it_interval = ns_to_timerspec(ns); + memset(&its, 0, sizeof(its)); + its.it_value = ns_to_timerspec(ns); timer_settime(timer->timerid, 0, &its, 0); } @@ -374,8 +375,8 @@ queue = (UHCIQueue *)calloc(sizeof(*queue), 1); queue->uhci = s; queue->qh_addr = qh_addr; - fprintf(usblog, "%s:%d qh_addr:0x%x\n", - __func__, __LINE__, qh_addr); +// fprintf(usblog, "%s:%d qh_addr:0x%x\n", +// __func__, __LINE__, qh_addr); queue->token = uhci_queue_token(td); queue->ep = ep; QTAILQ_INIT(&queue->asyncs); @@ -543,6 +544,7 @@ (s->status & UHCI_STS_HSERR) || (s->status & UHCI_STS_HCPERR)) { level = 1; + fprintf(usblog, "%s:%d irq=1\n", __func__, __LINE__); } else { level = 0; } @@ -565,9 +567,9 @@ pci_set_cfgdata8(sc->sc_pi, 0x6b, 0x00); s->cmd = 0; s->status = 0; -// fprintf(usblog, "%s s->status = 0\n", __func__); s->status2 = 0; s->intr = 0; + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); s->fl_base_addr = 0; s->sof_timing = 64; s->firstport = 0; @@ -655,15 +657,12 @@ s->expire_time = get_clock_ns() + (get_ticks_per_sec() / FRAME_TIMER_FREQ); // fprintf(usblog, "%s s->expire_time:%ld\n", __func__, s->expire_time); -// mod_timer(s->frame_timer, s->expire_time); - mod_timer(s->frame_timer, get_ticks_per_sec() / FRAME_TIMER_FREQ); + mod_timer(s->frame_timer, (get_ticks_per_sec() / FRAME_TIMER_FREQ)); s->status &= ~UHCI_STS_HCHALTED; -// fprintf(usblog, "%s status &= ~UHCI_STS_HCHALTED\n", __func__); -// fprintf(usblog, "%s status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); } else if (!(val & UHCI_CMD_RS)) { s->status |= UHCI_STS_HCHALTED; -// fprintf(usblog, "%s status |= UHCI_STS_HCHALTED\n", __func__); -// fprintf(usblog, "%s status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); } if (val & UHCI_CMD_GRESET) { UHCIPort *port; @@ -688,17 +687,17 @@ case 0x02: // fprintf(usblog, "%s USBSTS val:%lx\n", __func__, val); s->status &= ~val; -// fprintf(usblog, "%s s->status &= ~%lx\n", __func__, val); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); /* XXX: the chip spec is not coherent, so we add a hidden register to distinguish between IOC and SPD */ if (val & UHCI_STS_USBINT) s->status2 = 0; + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); break; case 0x04: // fprintf(usblog, "%s USBINTR val:%lx\n", __func__, val); s->intr = val; + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); break; case 0x06: @@ -820,8 +819,7 @@ if (s->cmd & UHCI_CMD_EGSM) { s->cmd |= UHCI_CMD_FGR; s->status |= UHCI_STS_RD; -// fprintf(usblog, "%s s->status |= UHCI_STS_RD\n", __func__); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); } } @@ -905,13 +903,14 @@ static void uhci_read_td(UHCIState *s, UHCI_TD *td, uint32_t link) { -// fprintf(usblog, "%s:%d s=%p td=%p link=%x\n", -// __func__, __LINE__, s, td, link); + fprintf(usblog, "%s:%d s=%p td=%p link=%x\n", + __func__, __LINE__, s, td, link); pci_dma_read(STATE_TO_SC(s), link & ~0xf, td, sizeof(*td)); le32_to_cpus(&td->link); le32_to_cpus(&td->ctrl); le32_to_cpus(&td->token); le32_to_cpus(&td->buffer); + fprintf(usblog, "%s:%d td->link:%x td->ctrl:%x td->token:%x td->buffer:%x\n", __func__, __LINE__, td->link, td->ctrl, td->token, td->buffer); } static int uhci_handle_td_error(UHCIState *s, UHCI_TD *td, uint32_t td_addr, @@ -922,54 +921,48 @@ switch (status) { case USB_RET_NAK: -// fprintf(usblog, "%s:%d USB_RET_NAK\n", __func__, __LINE__); + fprintf(usblog, "%s:%d USB_RET_NAK\n", __func__, __LINE__); td->ctrl |= TD_CTRL_NAK; -// fprintf(usblog, "%s:%d TD_RESULT_NEXT_QH\n", __func__, __LINE__); return TD_RESULT_NEXT_QH; case USB_RET_STALL: -// fprintf(usblog, "%s:%d USB_RET_STALL\n", __func__, __LINE__); + fprintf(usblog, "%s:%d USB_RET_STALL\n", __func__, __LINE__); td->ctrl |= TD_CTRL_STALL; trace_usb_uhci_packet_complete_stall(queue_token, td_addr); -// fprintf(usblog, "%s:%d TD_RESULT_NEXT_QH\n", __func__, __LINE__); ret = TD_RESULT_NEXT_QH; break; case USB_RET_BABBLE: -// fprintf(usblog, "%s:%d USB_RET_BABBLE\n", __func__, __LINE__); + fprintf(usblog, "%s:%d USB_RET_BABBLE\n", __func__, __LINE__); td->ctrl |= TD_CTRL_BABBLE | TD_CTRL_STALL; /* frame interrupted */ trace_usb_uhci_packet_complete_babble(queue_token, td_addr); -// fprintf(usblog, "%s:%d TD_RESULT_STOP_FRAME\n", __func__, __LINE__); ret = TD_RESULT_STOP_FRAME; break; case USB_RET_IOERROR: case USB_RET_NODEV: default: -#if 0 if (status == USB_RET_IOERROR) fprintf(usblog, "%s:%d USB_RET_IOERROR\n", __func__, __LINE__); else if (status == USB_RET_NODEV) fprintf(usblog, "%s:%d USB_RET_NODEV\n", __func__, __LINE__); else fprintf(usblog, "%s:%d invalid\n", __func__, __LINE__); -#endif td->ctrl |= TD_CTRL_TIMEOUT; td->ctrl &= ~(3 << TD_CTRL_ERROR_SHIFT); trace_usb_uhci_packet_complete_error(queue_token, td_addr); -// fprintf(usblog, "%s:%d TD_RESULT_NEXT_QH\n", __func__, __LINE__); ret = TD_RESULT_NEXT_QH; break; } td->ctrl &= ~TD_CTRL_ACTIVE; s->status |= UHCI_STS_USBERR; -// fprintf(usblog, "%s s->status |= UHCI_STS_USBERR\n", __func__); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); if (td->ctrl & TD_CTRL_IOC) { *int_mask |= 0x01; + fprintf(usblog, "%s:%d int_mask |= 1\n", __func__, __LINE__); } + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); return ret; } @@ -997,17 +990,19 @@ here. The docs are somewhat unclear, but win2k relies on this behavior. */ td->ctrl &= ~(TD_CTRL_ACTIVE | TD_CTRL_NAK); - if (td->ctrl & TD_CTRL_IOC) + if (td->ctrl & TD_CTRL_IOC) { *int_mask |= 0x01; + fprintf(usblog, "%s:%d int_mask |= 1\n", __func__, __LINE__); + } if (pid == USB_TOKEN_IN) { pci_dma_write(STATE_TO_SC(s), td->buffer, async->buf, len); if ((td->ctrl & TD_CTRL_SPD) && len < max_len) { *int_mask |= 0x02; + fprintf(usblog, "%s:%d int_mask |= 2\n", __func__, __LINE__); /* short packet: do not update QH */ trace_usb_uhci_packet_complete_shortxfer(async->queue->token, async->td_addr); -// fprintf(usblog, "%s:%d TD_RESULT_NEXT_QH\n", __func__, __LINE__); return TD_RESULT_NEXT_QH; } } @@ -1015,7 +1010,6 @@ /* success */ trace_usb_uhci_packet_complete_success(async->queue->token, async->td_addr); -// fprintf(usblog, "%s:%d TD_RESULT_COMPLETE\n", __func__, __LINE__); return TD_RESULT_COMPLETE; } @@ -1029,7 +1023,7 @@ UHCIAsync *async = uhci_async_find_td(s, td_addr); if (async) { -// fprintf(usblog, "%s:%d async\n", __func__, __LINE__); + fprintf(usblog, "%s:%d async\n", __func__, __LINE__); if (uhci_queue_verify(async->queue, qh_addr, td, td_addr, queuing)) { assert(q == NULL || q == async->queue); q = async->queue; @@ -1040,7 +1034,7 @@ } if (q == NULL) { -// fprintf(usblog, "%s:%d q == NULL\n", __func__, __LINE__); + fprintf(usblog, "%s:%d q == NULL\n", __func__, __LINE__); q = uhci_queue_find(s, td); if (q && !uhci_queue_verify(q, qh_addr, td, td_addr, queuing)) { uhci_queue_free(q, "guest re-used qh"); @@ -1049,13 +1043,13 @@ } if (q) { -// fprintf(usblog, "%s:%d q\n", __func__, __LINE__); + fprintf(usblog, "%s:%d q\n", __func__, __LINE__); q->valid = QH_VALID; } /* Is active ? */ if (!(td->ctrl & TD_CTRL_ACTIVE)) { -// fprintf(usblog, "%s:%d !TD_CTRL_ACTIVE\n", __func__, __LINE__); + fprintf(usblog, "%s:%d !TD_CTRL_ACTIVE\n", __func__, __LINE__); if (async) { /* Guest marked a pending td non-active, cancel the queue */ uhci_queue_free(async->queue, "pending td non-active"); @@ -1066,25 +1060,24 @@ */ if (td->ctrl & TD_CTRL_IOC) { *int_mask |= 0x01; + fprintf(usblog, "%s:%d int_mask |= 1\n", __func__, __LINE__); } -// fprintf(usblog, "%s:%d TD_RESULT_NEXT_QH\n", __func__, __LINE__); return TD_RESULT_NEXT_QH; } if (async) { -// fprintf(usblog, "%s:%d async\n", __func__, __LINE__); + fprintf(usblog, "%s:%d async\n", __func__, __LINE__); if (queuing) { -// fprintf(usblog, "%s:%d queueing\n", __func__, __LINE__); + fprintf(usblog, "%s:%d queueing\n", __func__, __LINE__); /* we are busy filling the queue, we are not prepared to consume completed packages then, just leave them in async state */ -// fprintf(usblog, "%s:%d TD_RESULT_ASYNC_CONT\n", __func__, __LINE__); return TD_RESULT_ASYNC_CONT; } if (!async->done) { UHCI_TD last_td; UHCIAsync *last = QTAILQ_LAST(&async->queue->asyncs, asyncs_head); -// fprintf(usblog, "%s:%d !async->done\n", __func__, __LINE__); + fprintf(usblog, "%s:%d !async->done\n", __func__, __LINE__); /* * While we are waiting for the current td to complete, the guest * may have added more tds to the queue. Note we re-read the td @@ -1093,7 +1086,6 @@ uhci_read_td(s, &last_td, last->td_addr); uhci_queue_fill(async->queue, &last_td); -// fprintf(usblog, "%s:%d TD_RESULT_ASYNC_CONT\n", __func__, __LINE__); return TD_RESULT_ASYNC_CONT; } uhci_async_unlink(async); @@ -1101,8 +1093,7 @@ } if (s->completions_only) { -// fprintf(usblog, "%s:%d completions_only\n", __func__, __LINE__); -// fprintf(usblog, "%s:%d TD_RESULT_ASYNC_CONT\n", __func__, __LINE__); + fprintf(usblog, "%s:%d completions_only\n", __func__, __LINE__); return TD_RESULT_ASYNC_CONT; } @@ -1110,10 +1101,10 @@ if (q == NULL) { USBDevice *dev = uhci_find_device(s, (td->token >> 8) & 0x7f); USBEndpoint *ep = usb_ep_get(dev, pid, (td->token >> 15) & 0xf); -// fprintf(usblog, "%s:%d q == NULL\n", __func__, __LINE__); + fprintf(usblog, "%s:%d q == NULL\n", __func__, __LINE__); if (ep == NULL) { -// fprintf(usblog, "%s:%d eq == NULL\n", __func__, __LINE__); + fprintf(usblog, "%s:%d eq == NULL\n", __func__, __LINE__); return uhci_handle_td_error(s, td, td_addr, USB_RET_NODEV, int_mask); } @@ -1153,25 +1144,22 @@ /* invalid pid : frame interrupted */ uhci_async_free(async); s->status |= UHCI_STS_HCPERR; -// fprintf(usblog, "%s s->status |= UHCI_STS_USBERR\n", __func__); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); -// fprintf(usblog, "%s:%d TD_RESULT_STOP_FRAME\n", __func__, __LINE__); return TD_RESULT_STOP_FRAME; } if (async->packet.status == USB_RET_ASYNC) { -// fprintf(usblog, "%s:%d USB_RET_ASYNC\n", __func__, __LINE__); + fprintf(usblog, "%s:%d USB_RET_ASYNC\n", __func__, __LINE__); uhci_async_link(async); if (!queuing) { uhci_queue_fill(q, td); } -// fprintf(usblog, "%s:%d TD_RESULT_ASYNC_START\n", __func__, __LINE__); return TD_RESULT_ASYNC_START; } done: -// fprintf(usblog, "%s:%d done\n", __func__, __LINE__); + fprintf(usblog, "%s:%d done\n", __func__, __LINE__); ret = uhci_complete_td(s, td, async, int_mask); uhci_async_free(async); return ret; @@ -1276,10 +1264,10 @@ frame_addr = s->fl_base_addr + ((s->frnum & 0x3ff) << 2); -// fprintf(usblog, "%s:%d s:%p frame_addr:0x%x\n", __func__, __LINE__, s, frame_addr); + fprintf(usblog, "%s:%d s:%p frame_addr:0x%x\n", __func__, __LINE__, s, frame_addr); pci_dma_read(STATE_TO_SC(s), frame_addr, &link, 4); -// fprintf(usblog, "%s:%d link:%x\n", __func__, __LINE__, link); le32_to_cpus(&link); + fprintf(usblog, "%s:%d link:%x\n", __func__, __LINE__, link); int_mask = 0; curr_qh = 0; @@ -1287,7 +1275,7 @@ qhdb_reset(&qhdb); for (cnt = FRAME_MAX_LOOPS; is_valid(link) && cnt; cnt--) { -// fprintf(usblog, "%s:%d cnt:%d is_valid(link):%d is_qh(link):%d\n", __func__, __LINE__, cnt, is_valid(link), is_qh(link)); + fprintf(usblog, "%s:%d cnt:%d is_valid(link):%d is_qh(link):%d\n", __func__, __LINE__, cnt, is_valid(link), is_qh(link)); if (!s->completions_only && s->frame_bytes >= s->frame_bandwidth) { /* We've reached the usb 1.1 bandwidth, which is 1280 bytes/frame, stop processing */ @@ -1354,24 +1342,24 @@ switch (ret) { case TD_RESULT_STOP_FRAME: /* interrupted frame */ -// fprintf(usblog, "%s:%d TD_RESULT_STOP_FRAME\n", __func__, __LINE__); + fprintf(usblog, "%s:%d TD_RESULT_STOP_FRAME\n", __func__, __LINE__); goto out; case TD_RESULT_NEXT_QH: case TD_RESULT_ASYNC_CONT: -// fprintf(usblog, "%s:%d %s\n", __func__, __LINE__, ret == TD_RESULT_NEXT_QH ? "TD_RESULT_NEXT_QH" : "TD_RESULT_ASYNC_CONT"); + fprintf(usblog, "%s:%d %s\n", __func__, __LINE__, ret == TD_RESULT_NEXT_QH ? "TD_RESULT_NEXT_QH" : "TD_RESULT_ASYNC_CONT"); trace_usb_uhci_td_nextqh(curr_qh & ~0xf, link & ~0xf); link = curr_qh ? qh.link : td.link; continue; case TD_RESULT_ASYNC_START: -// fprintf(usblog, "%s:%d TD_RESULT_ASYNC_START\n", __func__, __LINE__); + fprintf(usblog, "%s:%d TD_RESULT_ASYNC_START\n", __func__, __LINE__); trace_usb_uhci_td_async(curr_qh & ~0xf, link & ~0xf); link = curr_qh ? qh.link : td.link; continue; case TD_RESULT_COMPLETE: -// fprintf(usblog, "%s:%d TD_RESULT_COMPLETE\n", __func__, __LINE__); + fprintf(usblog, "%s:%d TD_RESULT_COMPLETE\n", __func__, __LINE__); trace_usb_uhci_td_complete(curr_qh & ~0xf, link & ~0xf); link = td.link; td_count++; @@ -1402,6 +1390,7 @@ out: s->pending_int_mask |= int_mask; + fprintf(usblog, "%s:%d pending_int_mask(%x) |= %x\n", __func__, __LINE__, s->pending_int_mask, int_mask); } static void uhci_bh(void *opaque) @@ -1413,10 +1402,12 @@ static void uhci_frame_timer(void *opaque) { UHCIState *s = opaque; + struct pci_uhci_softc *sc = STATE_TO_SC(s); uint64_t t_now, t_last_run; int i, frames; const uint64_t frame_t = get_ticks_per_sec() / FRAME_TIMER_FREQ; + pthread_mutex_lock(&sc->sc_mtx); s->completions_only = false; // qemu_bh_cancel(s->bh); @@ -1427,8 +1418,8 @@ uhci_async_cancel_all(s); /* set hchalted bit in status - UHCI11D 2.1.2 */ s->status |= UHCI_STS_HCHALTED; -// fprintf(usblog, "%s s->status |= UHCI_STS_HCHALTED\n", __func__); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); + pthread_mutex_unlock(&sc->sc_mtx); return; } @@ -1438,20 +1429,17 @@ /* Process up to MAX_FRAMES_PER_TICK frames */ frames = (t_now - t_last_run) / frame_t; -// fprintf(usblog, "%s:%d frame_t:%ld s->expire_time:%ld t_last_run:%ld t_now:%ld frames:%d\n", __func__, __LINE__, frame_t, s->expire_time, t_last_run, t_now, frames); if (frames > s->maxframes) { int skipped = frames - s->maxframes; s->expire_time += skipped * frame_t; s->frnum = (s->frnum + skipped) & 0x7ff; frames -= skipped; -// fprintf(usblog, "%s frames > s->maxframes skipped:%d s->expire_time:%ld frames:%d\n", __func__, skipped, s->expire_time, frames); } if (frames > MAX_FRAMES_PER_TICK) { frames = MAX_FRAMES_PER_TICK; } for (i = 0; i < frames; i++) { -// fprintf(usblog, "%s:%d %d\n", __func__, __LINE__, i); s->frame_bytes = 0; trace_usb_uhci_frame_start(s->frnum); uhci_async_validate_begin(s); @@ -1461,20 +1449,20 @@ * the guest must look at frnum - 1 on interrupt, so inc frnum now */ s->frnum = (s->frnum + 1) & 0x7ff; s->expire_time += frame_t; -// fprintf(usblog, "%s s->expire_time:%ld\n", __func__, s->expire_time); } /* Complete the previous frame(s) */ if (s->pending_int_mask) { s->status2 |= s->pending_int_mask; s->status |= UHCI_STS_USBINT; -// fprintf(usblog, "%s s->status |= UHCI_STS_USBINT\n", __func__); -// fprintf(usblog, "%s s->status = %x\n", __func__, s->status); + fprintf(usblog, "%s:%d status:%x status2:%x intr:%x\n", __func__, __LINE__, s->status, s->status2, s->intr); uhci_update_irq(s); } s->pending_int_mask = 0; + fprintf(usblog, "%s:%d pending_int_mask = 0\n", __func__, __LINE__); -// mod_timer(s->frame_timer, t_now + frame_t); + mod_timer(s->frame_timer, frame_t); + pthread_mutex_unlock(&sc->sc_mtx); } /* @@ -1744,7 +1732,7 @@ pci_set_cfgdata8(pi, PCI_USBREV, PCI_USB_REV_1_0); if (!pci_is_legacy(pi)) { - fprintf(stderr, "hcd-uhci works only in legacy mode\n"); + fprintf(usblog, "hcd-uhci works only in legacy mode\n"); } else { pci_lintr_request(pi, 9); } From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 15:20:34 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0DE944F3 for ; Mon, 23 Sep 2013 15:20:34 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE89E24C9 for ; Mon, 23 Sep 2013 15:20:33 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NFKXf7053438 for ; Mon, 23 Sep 2013 15:20:33 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NFKXAf053375 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 15:20:33 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 15:20:33 GMT Message-Id: <201309231520.r8NFKXAf053375@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257646 - in soc2013/def/crashdump-head: sbin/dumpkey sbin/savecore sys/kern sys/sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 15:20:34 -0000 Author: def Date: Mon Sep 23 15:20:33 2013 New Revision: 257646 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257646 Log: Remove kerneldumpkey.keysize because dumpkey and savecore use constants anyway. Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c soc2013/def/crashdump-head/sbin/savecore/dumpfile.c soc2013/def/crashdump-head/sbin/savecore/dumpfile.h soc2013/def/crashdump-head/sys/kern/kern_shutdown.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 14:18:34 2013 (r257645) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 15:20:33 2013 (r257646) @@ -86,8 +86,6 @@ key->encrypted_key, public_key, RSA_PKCS1_PADDING) == -1) return (-1); - key->keysize = RSA_size(public_key); - return (0); } Modified: soc2013/def/crashdump-head/sbin/savecore/dumpfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Mon Sep 23 14:18:34 2013 (r257645) +++ soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Mon Sep 23 15:20:33 2013 (r257646) @@ -45,7 +45,6 @@ fd = (dumpFile *)malloc(sizeof(dumpFile)); fd->fp = fp; - fd->keysize = h->keysize; memcpy(fd->encrypted_key, h->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); save_key_for(fd, keyname); Modified: soc2013/def/crashdump-head/sbin/savecore/dumpfile.h ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/dumpfile.h Mon Sep 23 14:18:34 2013 (r257645) +++ soc2013/def/crashdump-head/sbin/savecore/dumpfile.h Mon Sep 23 15:20:33 2013 (r257646) @@ -5,7 +5,6 @@ typedef struct _dumpFile { FILE *fp; - int keysize; char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; #define PEFS_SECTOR_SIZE 4096 char buf[PEFS_SECTOR_SIZE]; Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 14:18:34 2013 (r257645) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 15:20:33 2013 (r257646) @@ -971,7 +971,6 @@ strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); if (panicstr != NULL) strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); - kdh->keysize = dumper.kdk->keysize; memcpy(kdh->encrypted_key, dumper.kdk->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); kdh->parity = kerneldump_parity(kdh); } Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 14:18:34 2013 (r257645) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 15:20:33 2013 (r257646) @@ -83,9 +83,8 @@ uint64_t dumptime; uint32_t blocksize; char hostname[64]; - char versionstring[62]; - char panicstring[62]; - int keysize; + char versionstring[64]; + char panicstring[64]; char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; uint32_t parity; }; @@ -109,7 +108,6 @@ } struct kerneldumpkey { - int keysize; char encrypted_key[KERNELDUMP_ENCRYPTED_KEY_SIZE]; char tweak[KERNELDUMP_TWEAK_SIZE]; struct xts_ctx data_ctx; From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 15:31:52 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6075E94C for ; Mon, 23 Sep 2013 15:31:52 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3E22574 for ; Mon, 23 Sep 2013 15:31:52 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NFVqvm009828 for ; Mon, 23 Sep 2013 15:31:52 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NFVqtt009826 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 15:31:52 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 15:31:52 GMT Message-Id: <201309231531.r8NFVqtt009826@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257647 - soc2013/def/crashdump-head/sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 15:31:52 -0000 Author: def Date: Mon Sep 23 15:31:52 2013 New Revision: 257647 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257647 Log: Flush a kernel dump buffer to reuse it with another dumper. Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Modified: soc2013/def/crashdump-head/sys/kern/kern_shutdown.c ============================================================================== --- soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 15:20:33 2013 (r257646) +++ soc2013/def/crashdump-head/sys/kern/kern_shutdown.c Mon Sep 23 15:31:52 2013 (r257647) @@ -952,6 +952,8 @@ di->kdk = kdk; di->kdb = kdb; + + bzero(di->kdb, sizeof(struct kerneldumpbuffer)); } void From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 15:41:39 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 95416A3E for ; Mon, 23 Sep 2013 15:41:39 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8054D25E7 for ; Mon, 23 Sep 2013 15:41:39 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NFfd7P045757 for ; Mon, 23 Sep 2013 15:41:39 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NFfdwM045748 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 15:41:39 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 15:41:39 GMT Message-Id: <201309231541.r8NFfdwM045748@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257648 - in soc2013/def/crashdump-head: sbin/dumpkey sys/sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 15:41:39 -0000 Author: def Date: Mon Sep 23 15:41:39 2013 New Revision: 257648 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257648 Log: dumpkey is in charge of setting properly a kernel dump key so kerneldump_magic shouldn't be in kernel. Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c soc2013/def/crashdump-head/sys/sys/kerneldump.h Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 15:31:52 2013 (r257647) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 15:41:39 2013 (r257648) @@ -15,6 +15,8 @@ #define PATH_DEVRANDOM "/dev/random" #define PEFS_SECTOR_SIZE 4096 +static const char kerneldump_magic[] = "PEFSKEY-V1"; + static void hkdf_expand(struct xts_ctx *ctx, const uint8_t *masterkey, uint8_t *key, int idx, const uint8_t *magic, size_t magicsize) Modified: soc2013/def/crashdump-head/sys/sys/kerneldump.h ============================================================================== --- soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 15:31:52 2013 (r257647) +++ soc2013/def/crashdump-head/sys/sys/kerneldump.h Mon Sep 23 15:41:39 2013 (r257648) @@ -89,8 +89,6 @@ uint32_t parity; }; -static const char kerneldump_magic[] = "PEFSKEY-V1"; - /* * Parity calculation is endian insensitive. */ From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 16:04:32 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4D2E730C for ; Mon, 23 Sep 2013 16:04:32 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6C72736 for ; Mon, 23 Sep 2013 16:04:32 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NG4WAQ038149 for ; Mon, 23 Sep 2013 16:04:32 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NG4WJB038141 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 16:04:32 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 16:04:32 GMT Message-Id: <201309231604.r8NG4WJB038141@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257649 - soc2013/def/crashdump-head/sbin/savecore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 16:04:32 -0000 Author: def Date: Mon Sep 23 16:04:31 2013 New Revision: 257649 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257649 Log: Review savecore(8). Modified: soc2013/def/crashdump-head/sbin/savecore/Makefile soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Modified: soc2013/def/crashdump-head/sbin/savecore/Makefile ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/Makefile Mon Sep 23 15:41:39 2013 (r257648) +++ soc2013/def/crashdump-head/sbin/savecore/Makefile Mon Sep 23 16:04:31 2013 (r257649) @@ -7,7 +7,6 @@ DPADD= ${LIBZ} LDADD= -lz CFLAGS+=-I${SYS} -WARNS?= 2 MAN= savecore.8 .include Modified: soc2013/def/crashdump-head/sbin/savecore/dumpfile.c ============================================================================== --- soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Mon Sep 23 15:41:39 2013 (r257648) +++ soc2013/def/crashdump-head/sbin/savecore/dumpfile.c Mon Sep 23 16:04:31 2013 (r257649) @@ -44,12 +44,15 @@ fd = (dumpFile *)malloc(sizeof(dumpFile)); fd->fp = fp; + fd->buf_used = 0; memcpy(fd->encrypted_key, h->encrypted_key, KERNELDUMP_ENCRYPTED_KEY_SIZE); - save_key_for(fd, keyname); + if (save_key_for(fd, keyname)) { + free(fd); - fd->buf_used = 0; + return (NULL); + } return (funopen(fd, NULL, dwrite, NULL, dclose)); } @@ -67,8 +70,11 @@ memcpy(fd->buf + fd->buf_used, data, resid); fd->buf_used += resid; - if (fwrite(fd->buf, 1, PEFS_SECTOR_SIZE, fd->fp) != PEFS_SECTOR_SIZE) - return (0); + if (fwrite(fd->buf, 1, PEFS_SECTOR_SIZE, fd->fp) != PEFS_SECTOR_SIZE) { + fd->buf_used -= resid; + + return (saved); + } data += resid; size -= resid; From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 16:12:11 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 887DA724 for ; Mon, 23 Sep 2013 16:12:11 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73E53284D for ; Mon, 23 Sep 2013 16:12:11 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NGCBms065329 for ; Mon, 23 Sep 2013 16:12:11 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NGCB3p065324 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 16:12:11 GMT (envelope-from zcore@FreeBSD.org) Date: Mon, 23 Sep 2013 16:12:11 GMT Message-Id: <201309231612.r8NGCB3p065324@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257650 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 16:12:11 -0000 Author: zcore Date: Mon Sep 23 16:12:11 2013 New Revision: 257650 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257650 Log: abort packet cmd if we don't support Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Mon Sep 23 16:04:31 2013 (r257649) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Mon Sep 23 16:12:11 2013 (r257650) @@ -1097,6 +1097,11 @@ atapi_get_event_status_notification(p, slot, cfis); break; default: + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; + p->asc = 0x20; + ahci_write_fis_d2h(p, slot, cfis, (p->sense_key << 12) | + ATA_S_READY | ATA_S_ERROR); break; } } From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 16:35:08 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CD850AA2 for ; Mon, 23 Sep 2013 16:35:08 +0000 (UTC) (envelope-from def@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8399297D for ; Mon, 23 Sep 2013 16:35:08 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NGZ8Tk015310 for ; Mon, 23 Sep 2013 16:35:08 GMT (envelope-from def@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NGZ8QB015299 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 16:35:08 GMT (envelope-from def@FreeBSD.org) Date: Mon, 23 Sep 2013 16:35:08 GMT Message-Id: <201309231635.r8NGZ8QB015299@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to def@FreeBSD.org using -f From: def@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257651 - in soc2013/def/crashdump-head: etc/defaults etc/rc.d sbin/dumpkey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 16:35:09 -0000 Author: def Date: Mon Sep 23 16:35:08 2013 New Revision: 257651 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257651 Log: Review dumpkey. Modified: soc2013/def/crashdump-head/etc/defaults/rc.conf soc2013/def/crashdump-head/etc/rc.d/dumpkey soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Modified: soc2013/def/crashdump-head/etc/defaults/rc.conf ============================================================================== --- soc2013/def/crashdump-head/etc/defaults/rc.conf Mon Sep 23 16:12:11 2013 (r257650) +++ soc2013/def/crashdump-head/etc/defaults/rc.conf Mon Sep 23 16:35:08 2013 (r257651) @@ -606,10 +606,10 @@ chkprintcap_flags="-d" # Create missing directories by default. dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored -dumpkey_enable="YES" -dumpkey_pub="/var/crash/.public.key" -dumpkey_priv="/var/crash/.private.key" -dumpkey_bits="2048" +dumpkey_enable="YES" # Run dumpkey to generate a symmetric key. +dumpkey_pub="/var/crash/.public.key" # Public key to encrypt a symmetric key. +dumpkey_priv="/var/crash/.private.key" # Private key to decrypt a symmetric key. +dumpkey_bits="2048" # RSA keys' length. savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps # are saved. Modified: soc2013/def/crashdump-head/etc/rc.d/dumpkey ============================================================================== --- soc2013/def/crashdump-head/etc/rc.d/dumpkey Mon Sep 23 16:12:11 2013 (r257650) +++ soc2013/def/crashdump-head/etc/rc.d/dumpkey Mon Sep 23 16:35:08 2013 (r257651) @@ -9,10 +9,7 @@ rcvar="dumpkey_enable" start_cmd="dumpkey_start" start_precmd="dumpkey_prestart" -stop_cmd=":" -decrypt_precmd="dumpkey_predecrypt" -decrypt_cmd="dumpkey_decrypt" -extra_commands="decrypt" +stop_cmd="dumpkey_stop" dumpkey_prestart() { @@ -32,21 +29,9 @@ /sbin/dumpkey -e ${dumpkey_pub} } -dumpkey_predecrypt() +dumpkey_stop() { - if [ ! -r "${dumpkey_priv}" ]; then - warn "The private RSA key doesn't exist. It's not possible to decrypt the symmetric key." - return 1 - fi -} - -dumpkey_decrypt() -{ - if [ $# -gt 0 ]; then - /usr/bin/openssl rsautl -decrypt -inkey ${dumpkey_priv} -in "$*" -out "$*-decrypted" - else - echo "You have to specify an encrypted symmetric key." - fi + rm ${dumpdir}/*-decrypted } load_rc_config $name Modified: soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c ============================================================================== --- soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 16:12:11 2013 (r257650) +++ soc2013/def/crashdump-head/sbin/dumpkey/dumpkey.c Mon Sep 23 16:35:08 2013 (r257651) @@ -40,7 +40,7 @@ } static int -read_data(char *buf, size_t size, char *fname) +read_data(char *buf, size_t size, const char *fname) { FILE *fp; @@ -194,8 +194,8 @@ char buf[PEFS_SECTOR_SIZE]; struct xts_ctx data_ctx, tweak_ctx; RSA *private_key; - int buf_used, offset; - size_t bytes; + int offset; + size_t buf_used, bytes; FILE *fp, *fp_w; private_key = RSA_new(); @@ -232,8 +232,10 @@ if (buf_used == PEFS_SECTOR_SIZE || (buf_used > 0 && bytes == 0)) { xts_block_decrypt(&xts_alg_aes, &tweak_ctx, &data_ctx, offset, tweak, 0, buf_used, buf, buf); - if (fwrite(buf, 1, buf_used, fp_w) != buf_used) + if (fwrite(buf, 1, buf_used, fp_w) != buf_used) { + printf("Error: cannot write a decrypted core.\n"); goto out; + } offset += buf_used; buf_used = 0; From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 16:37:10 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16DDEC9D for ; Mon, 23 Sep 2013 16:37:10 +0000 (UTC) (envelope-from mikema@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB83629A0 for ; Mon, 23 Sep 2013 16:37:09 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NGb9ds039666 for ; Mon, 23 Sep 2013 16:37:09 GMT (envelope-from mikema@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NGb9gI039662 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 16:37:09 GMT (envelope-from mikema@FreeBSD.org) Date: Mon, 23 Sep 2013 16:37:09 GMT Message-Id: <201309231637.r8NGb9gI039662@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mikema@FreeBSD.org using -f From: mikema@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257652 - soc2013/mikema/gluster_port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 16:37:10 -0000 Author: mikema Date: Mon Sep 23 16:37:09 2013 New Revision: 257652 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257652 Log: new folder for gluster port Added: soc2013/mikema/gluster_port/ From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 16:56:53 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A1EEB66D for ; Mon, 23 Sep 2013 16:56:53 +0000 (UTC) (envelope-from mikema@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B17A2ACB for ; Mon, 23 Sep 2013 16:56:53 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NGur9q001812 for ; Mon, 23 Sep 2013 16:56:53 GMT (envelope-from mikema@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NGuraa001780 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 16:56:53 GMT (envelope-from mikema@FreeBSD.org) Date: Mon, 23 Sep 2013 16:56:53 GMT Message-Id: <201309231656.r8NGuraa001780@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mikema@FreeBSD.org using -f From: mikema@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257653 - in soc2013/mikema/gluster_port: . api api/examples api/src argp-standalone argp-standalone/autom4te.cache autom4te.cache cli cli/src contrib contrib/aclocal contrib/fuse-in... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 16:56:53 -0000 Author: mikema Date: Mon Sep 23 16:56:52 2013 New Revision: 257653 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257653 Log: gsoc project submission Added: soc2013/mikema/gluster_port/AUTHORS soc2013/mikema/gluster_port/CONTRIBUTING soc2013/mikema/gluster_port/COPYING-GPLV2 soc2013/mikema/gluster_port/COPYING-LGPLV3 soc2013/mikema/gluster_port/ChangeLog soc2013/mikema/gluster_port/INSTALL soc2013/mikema/gluster_port/Makefile.am soc2013/mikema/gluster_port/Makefile.in soc2013/mikema/gluster_port/NEWS soc2013/mikema/gluster_port/README soc2013/mikema/gluster_port/THANKS soc2013/mikema/gluster_port/aclocal.m4 soc2013/mikema/gluster_port/api/ soc2013/mikema/gluster_port/api/Makefile.am soc2013/mikema/gluster_port/api/Makefile.in soc2013/mikema/gluster_port/api/examples/ soc2013/mikema/gluster_port/api/examples/Makefile.am soc2013/mikema/gluster_port/api/examples/README soc2013/mikema/gluster_port/api/examples/autogen.sh (contents, props changed) soc2013/mikema/gluster_port/api/examples/configure.ac soc2013/mikema/gluster_port/api/examples/gfapi.py (contents, props changed) soc2013/mikema/gluster_port/api/examples/glfsxmp.c soc2013/mikema/gluster_port/api/src/ soc2013/mikema/gluster_port/api/src/Makefile.am soc2013/mikema/gluster_port/api/src/Makefile.in soc2013/mikema/gluster_port/api/src/glfs-fops.c soc2013/mikema/gluster_port/api/src/glfs-internal.h soc2013/mikema/gluster_port/api/src/glfs-master.c soc2013/mikema/gluster_port/api/src/glfs-mem-types.h soc2013/mikema/gluster_port/api/src/glfs-mgmt.c soc2013/mikema/gluster_port/api/src/glfs-resolve.c soc2013/mikema/gluster_port/api/src/glfs.c soc2013/mikema/gluster_port/api/src/glfs.h soc2013/mikema/gluster_port/argp-standalone/ soc2013/mikema/gluster_port/argp-standalone/Makefile.am soc2013/mikema/gluster_port/argp-standalone/Makefile.in soc2013/mikema/gluster_port/argp-standalone/acinclude.m4 soc2013/mikema/gluster_port/argp-standalone/aclocal.m4 soc2013/mikema/gluster_port/argp-standalone/argp-ba.c soc2013/mikema/gluster_port/argp-standalone/argp-eexst.c soc2013/mikema/gluster_port/argp-standalone/argp-fmtstream.c soc2013/mikema/gluster_port/argp-standalone/argp-fmtstream.h soc2013/mikema/gluster_port/argp-standalone/argp-help.c soc2013/mikema/gluster_port/argp-standalone/argp-namefrob.h soc2013/mikema/gluster_port/argp-standalone/argp-parse.c soc2013/mikema/gluster_port/argp-standalone/argp-pv.c soc2013/mikema/gluster_port/argp-standalone/argp-pvh.c soc2013/mikema/gluster_port/argp-standalone/argp.h soc2013/mikema/gluster_port/argp-standalone/autogen.sh (contents, props changed) soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/ soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/output.0 soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/output.1 soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/requests soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/traces.0 soc2013/mikema/gluster_port/argp-standalone/autom4te.cache/traces.1 soc2013/mikema/gluster_port/argp-standalone/config.h.in soc2013/mikema/gluster_port/argp-standalone/configure (contents, props changed) soc2013/mikema/gluster_port/argp-standalone/configure.ac soc2013/mikema/gluster_port/argp-standalone/depcomp (contents, props changed) soc2013/mikema/gluster_port/argp-standalone/install-sh (contents, props changed) soc2013/mikema/gluster_port/argp-standalone/mempcpy.c soc2013/mikema/gluster_port/argp-standalone/missing (contents, props changed) soc2013/mikema/gluster_port/argp-standalone/strcasecmp.c soc2013/mikema/gluster_port/argp-standalone/strchrnul.c soc2013/mikema/gluster_port/argp-standalone/strndup.c soc2013/mikema/gluster_port/argp-standalone/vsnprintf.c soc2013/mikema/gluster_port/autogen.sh (contents, props changed) soc2013/mikema/gluster_port/autom4te.cache/ soc2013/mikema/gluster_port/autom4te.cache/output.0 soc2013/mikema/gluster_port/autom4te.cache/output.1 soc2013/mikema/gluster_port/autom4te.cache/requests soc2013/mikema/gluster_port/autom4te.cache/traces.0 soc2013/mikema/gluster_port/autom4te.cache/traces.1 soc2013/mikema/gluster_port/cli/ soc2013/mikema/gluster_port/cli/Makefile.am soc2013/mikema/gluster_port/cli/Makefile.in soc2013/mikema/gluster_port/cli/src/ soc2013/mikema/gluster_port/cli/src/Makefile.am soc2013/mikema/gluster_port/cli/src/Makefile.in soc2013/mikema/gluster_port/cli/src/cli-cmd-misc.c soc2013/mikema/gluster_port/cli/src/cli-cmd-parser.c soc2013/mikema/gluster_port/cli/src/cli-cmd-peer.c soc2013/mikema/gluster_port/cli/src/cli-cmd-system.c soc2013/mikema/gluster_port/cli/src/cli-cmd-volume-bdevice.c soc2013/mikema/gluster_port/cli/src/cli-cmd-volume.c soc2013/mikema/gluster_port/cli/src/cli-cmd.c soc2013/mikema/gluster_port/cli/src/cli-cmd.h soc2013/mikema/gluster_port/cli/src/cli-mem-types.h soc2013/mikema/gluster_port/cli/src/cli-rl.c soc2013/mikema/gluster_port/cli/src/cli-rpc-ops.c soc2013/mikema/gluster_port/cli/src/cli-xml-output.c soc2013/mikema/gluster_port/cli/src/cli.c soc2013/mikema/gluster_port/cli/src/cli.h soc2013/mikema/gluster_port/cli/src/input.c soc2013/mikema/gluster_port/cli/src/registry.c soc2013/mikema/gluster_port/config.guess (contents, props changed) soc2013/mikema/gluster_port/config.h.in soc2013/mikema/gluster_port/config.sub (contents, props changed) soc2013/mikema/gluster_port/configure (contents, props changed) soc2013/mikema/gluster_port/configure.ac soc2013/mikema/gluster_port/contrib/ soc2013/mikema/gluster_port/contrib/aclocal/ soc2013/mikema/gluster_port/contrib/aclocal/mkdirp.m4 soc2013/mikema/gluster_port/contrib/aclocal/python.m4 soc2013/mikema/gluster_port/contrib/fuse-include/ soc2013/mikema/gluster_port/contrib/fuse-include/fuse-misc.h soc2013/mikema/gluster_port/contrib/fuse-include/fuse-mount.h soc2013/mikema/gluster_port/contrib/fuse-include/fuse_kernel.h soc2013/mikema/gluster_port/contrib/fuse-include/fuse_kernel_macfuse.h soc2013/mikema/gluster_port/contrib/fuse-include/mount_util.h soc2013/mikema/gluster_port/contrib/fuse-lib/ soc2013/mikema/gluster_port/contrib/fuse-lib/COPYING.LIB soc2013/mikema/gluster_port/contrib/fuse-lib/misc.c soc2013/mikema/gluster_port/contrib/fuse-lib/mount-common.c soc2013/mikema/gluster_port/contrib/fuse-lib/mount-gluster-compat.h soc2013/mikema/gluster_port/contrib/fuse-lib/mount.c soc2013/mikema/gluster_port/contrib/fuse-util/ soc2013/mikema/gluster_port/contrib/fuse-util/.deps/ soc2013/mikema/gluster_port/contrib/fuse-util/.deps/fusermount.Po soc2013/mikema/gluster_port/contrib/fuse-util/.deps/mount-common.Po soc2013/mikema/gluster_port/contrib/fuse-util/.deps/mount_util.Po soc2013/mikema/gluster_port/contrib/fuse-util/COPYING soc2013/mikema/gluster_port/contrib/fuse-util/Makefile soc2013/mikema/gluster_port/contrib/fuse-util/Makefile.am soc2013/mikema/gluster_port/contrib/fuse-util/Makefile.in soc2013/mikema/gluster_port/contrib/fuse-util/fusermount.c soc2013/mikema/gluster_port/contrib/fuse-util/mount_util.c soc2013/mikema/gluster_port/contrib/ipaddr-py/ soc2013/mikema/gluster_port/contrib/ipaddr-py/COPYING soc2013/mikema/gluster_port/contrib/ipaddr-py/MANIFEST.in soc2013/mikema/gluster_port/contrib/ipaddr-py/OWNERS soc2013/mikema/gluster_port/contrib/ipaddr-py/README soc2013/mikema/gluster_port/contrib/ipaddr-py/ipaddr.py soc2013/mikema/gluster_port/contrib/ipaddr-py/ipaddr_test.py (contents, props changed) soc2013/mikema/gluster_port/contrib/ipaddr-py/setup.py (contents, props changed) soc2013/mikema/gluster_port/contrib/ipaddr-py/test-2to3.sh (contents, props changed) soc2013/mikema/gluster_port/contrib/libgen/ soc2013/mikema/gluster_port/contrib/libgen/basename_r.c soc2013/mikema/gluster_port/contrib/libgen/dirname_r.c soc2013/mikema/gluster_port/contrib/macfuse/ soc2013/mikema/gluster_port/contrib/macfuse/COPYING.txt soc2013/mikema/gluster_port/contrib/macfuse/fuse_ioctl.h soc2013/mikema/gluster_port/contrib/macfuse/fuse_param.h soc2013/mikema/gluster_port/contrib/macfuse/mount_darwin.c soc2013/mikema/gluster_port/contrib/rbtree/ soc2013/mikema/gluster_port/contrib/rbtree/rb.c soc2013/mikema/gluster_port/contrib/rbtree/rb.h soc2013/mikema/gluster_port/contrib/stdlib/ soc2013/mikema/gluster_port/contrib/stdlib/gf_mkostemp.c soc2013/mikema/gluster_port/contrib/uuid/ soc2013/mikema/gluster_port/contrib/uuid/clear.c soc2013/mikema/gluster_port/contrib/uuid/compare.c soc2013/mikema/gluster_port/contrib/uuid/copy.c soc2013/mikema/gluster_port/contrib/uuid/gen_uuid.c soc2013/mikema/gluster_port/contrib/uuid/gen_uuid_nt.c soc2013/mikema/gluster_port/contrib/uuid/isnull.c soc2013/mikema/gluster_port/contrib/uuid/pack.c soc2013/mikema/gluster_port/contrib/uuid/parse.c soc2013/mikema/gluster_port/contrib/uuid/tst_uuid.c soc2013/mikema/gluster_port/contrib/uuid/unpack.c soc2013/mikema/gluster_port/contrib/uuid/unparse.c soc2013/mikema/gluster_port/contrib/uuid/uuid.h soc2013/mikema/gluster_port/contrib/uuid/uuidP.h soc2013/mikema/gluster_port/contrib/uuid/uuid_time.c soc2013/mikema/gluster_port/contrib/uuid/uuid_types.h.in soc2013/mikema/gluster_port/contrib/uuid/uuidd.h soc2013/mikema/gluster_port/depcomp (contents, props changed) soc2013/mikema/gluster_port/doc/ soc2013/mikema/gluster_port/doc/Makefile.am soc2013/mikema/gluster_port/doc/Makefile.in soc2013/mikema/gluster_port/doc/admin-guide/ soc2013/mikema/gluster_port/doc/admin-guide/en-US/ soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/ soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/640px-GlusterFS_3.2_Architecture.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Distributed_Replicated_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Distributed_Striped_Replicated_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Distributed_Striped_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Distributed_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Geo-Rep03_Internet.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Geo-Rep04_Cascading.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Geo-Rep_LAN.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Geo-Rep_WAN.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/GlusterFS_3.2_Architecture.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Hadoop_Architecture.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Replicated_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Striped_Replicated_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/Striped_Volume.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/UFO_Architecture.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/VSA_Architecture.png (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/arhitecture.png soc2013/mikema/gluster_port/doc/admin-guide/en-US/images/icon.svg (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/ soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Administration_Guide.md (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Author_Group.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Book_Info.md (contents, props changed) soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Chapter.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Preface.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/Revision_History.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_ACLs.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_Hadoop.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_UFO.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_commandref.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_console.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_directory_Quota.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_geo-replication.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_managing_volumes.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_monitoring_workload.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_setting_volumes.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_settingup_clients.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_start_stop_daemon.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_storage_pools.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/admin_troubleshooting.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/gfs_introduction.md soc2013/mikema/gluster_port/doc/admin-guide/en-US/markdown/glossary.md soc2013/mikema/gluster_port/doc/authentication.txt soc2013/mikema/gluster_port/doc/bd.txt soc2013/mikema/gluster_port/doc/coding-standard.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/coding-standard.tex soc2013/mikema/gluster_port/doc/examples/ soc2013/mikema/gluster_port/doc/examples/legacy/ soc2013/mikema/gluster_port/doc/examples/legacy/Makefile.am soc2013/mikema/gluster_port/doc/examples/legacy/README soc2013/mikema/gluster_port/doc/examples/legacy/filter.vol soc2013/mikema/gluster_port/doc/examples/legacy/io-cache.vol soc2013/mikema/gluster_port/doc/examples/legacy/io-threads.vol soc2013/mikema/gluster_port/doc/examples/legacy/posix-locks.vol soc2013/mikema/gluster_port/doc/examples/legacy/protocol-client.vol soc2013/mikema/gluster_port/doc/examples/legacy/protocol-server.vol soc2013/mikema/gluster_port/doc/examples/legacy/read-ahead.vol soc2013/mikema/gluster_port/doc/examples/legacy/replicate.vol soc2013/mikema/gluster_port/doc/examples/legacy/stripe.vol soc2013/mikema/gluster_port/doc/examples/legacy/trace.vol soc2013/mikema/gluster_port/doc/examples/legacy/trash.vol soc2013/mikema/gluster_port/doc/examples/legacy/write-behind.vol soc2013/mikema/gluster_port/doc/gluster.8 soc2013/mikema/gluster_port/doc/glusterd.8 soc2013/mikema/gluster_port/doc/glusterd.vol soc2013/mikema/gluster_port/doc/glusterfs.8 soc2013/mikema/gluster_port/doc/glusterfsd.8 soc2013/mikema/gluster_port/doc/legacy/ soc2013/mikema/gluster_port/doc/legacy/Makefile.am soc2013/mikema/gluster_port/doc/legacy/advanced-stripe.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/advanced-stripe.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/booster.txt soc2013/mikema/gluster_port/doc/legacy/colonO-icon.jpg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/ soc2013/mikema/gluster_port/doc/legacy/docbook/Administration_Guide.ent soc2013/mikema/gluster_port/doc/legacy/docbook/Administration_Guide.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/Author_Group.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/Book_Info.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/Chapter.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/Preface.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/Revision_History.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_ACLs.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_Hadoop.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_UFO.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_commandref.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_console.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_directory_Quota.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_geo-replication.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_managing_volumes.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_monitoring_workload.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_setting_volumes.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_settingup_clients.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_start_stop_daemon.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_storage_pools.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/admin_troubleshooting.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/gfs_introduction.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/glossary.xml (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/docbook/publican.cfg soc2013/mikema/gluster_port/doc/legacy/errno.list.bsd.txt soc2013/mikema/gluster_port/doc/legacy/errno.list.linux.txt soc2013/mikema/gluster_port/doc/legacy/errno.list.macosx.txt soc2013/mikema/gluster_port/doc/legacy/errno.list.solaris.txt soc2013/mikema/gluster_port/doc/legacy/fdl.texi soc2013/mikema/gluster_port/doc/legacy/fuse.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/fuse.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/get_put_api_using_xattr.txt soc2013/mikema/gluster_port/doc/legacy/ha.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/ha.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/hacker-guide/ soc2013/mikema/gluster_port/doc/legacy/hacker-guide/Makefile.am soc2013/mikema/gluster_port/doc/legacy/hacker-guide/adding-fops.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/bdb.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/call-stub.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/hacker-guide.tex soc2013/mikema/gluster_port/doc/legacy/hacker-guide/lock-ahead.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/posix.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/replicate.txt soc2013/mikema/gluster_port/doc/legacy/hacker-guide/write-behind.txt soc2013/mikema/gluster_port/doc/legacy/handling-options.txt soc2013/mikema/gluster_port/doc/legacy/mac-related-xattrs.txt soc2013/mikema/gluster_port/doc/legacy/porting_guide.txt soc2013/mikema/gluster_port/doc/legacy/replicate.lyx soc2013/mikema/gluster_port/doc/legacy/replicate.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/solaris-related-xattrs.txt soc2013/mikema/gluster_port/doc/legacy/stat-prefetch-design.txt soc2013/mikema/gluster_port/doc/legacy/stripe.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/stripe.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/translator-options.txt soc2013/mikema/gluster_port/doc/legacy/unify.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/unify.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/user-guide.info (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/user-guide.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/user-guide.texi soc2013/mikema/gluster_port/doc/legacy/xlator.odg (contents, props changed) soc2013/mikema/gluster_port/doc/legacy/xlator.pdf (contents, props changed) soc2013/mikema/gluster_port/doc/logging.txt soc2013/mikema/gluster_port/doc/mount.glusterfs.8 soc2013/mikema/gluster_port/doc/qa/ soc2013/mikema/gluster_port/doc/qa/legacy/ soc2013/mikema/gluster_port/doc/qa/legacy/qa-client.vol soc2013/mikema/gluster_port/doc/qa/legacy/qa-high-avail-client.vol soc2013/mikema/gluster_port/doc/qa/legacy/qa-high-avail-server.vol soc2013/mikema/gluster_port/doc/qa/legacy/qa-server.vol soc2013/mikema/gluster_port/doc/rdma-cm-in-3.4.0.txt soc2013/mikema/gluster_port/doc/rpc-for-glusterfs.changes-done.txt soc2013/mikema/gluster_port/error-codes.json soc2013/mikema/gluster_port/extras/ soc2013/mikema/gluster_port/extras/FreeBSD/ soc2013/mikema/gluster_port/extras/FreeBSD/Makefile soc2013/mikema/gluster_port/extras/FreeBSD/README.FreeBSD soc2013/mikema/gluster_port/extras/FreeBSD/distinfo soc2013/mikema/gluster_port/extras/FreeBSD/pkg-descr soc2013/mikema/gluster_port/extras/FreeBSD/pkg-plist soc2013/mikema/gluster_port/extras/LinuxRPM/ soc2013/mikema/gluster_port/extras/LinuxRPM/Makefile.am soc2013/mikema/gluster_port/extras/LinuxRPM/Makefile.in soc2013/mikema/gluster_port/extras/MacOSX/ soc2013/mikema/gluster_port/extras/MacOSX/Portfile soc2013/mikema/gluster_port/extras/MacOSX/README.MacOSX soc2013/mikema/gluster_port/extras/Makefile.am soc2013/mikema/gluster_port/extras/Makefile.in soc2013/mikema/gluster_port/extras/Solaris/ soc2013/mikema/gluster_port/extras/Solaris/Prototype soc2013/mikema/gluster_port/extras/Solaris/README.solaris soc2013/mikema/gluster_port/extras/Solaris/checkinstall soc2013/mikema/gluster_port/extras/Solaris/pkginfo soc2013/mikema/gluster_port/extras/Ubuntu/ soc2013/mikema/gluster_port/extras/Ubuntu/README.Ubuntu soc2013/mikema/gluster_port/extras/Ubuntu/glusterd.conf soc2013/mikema/gluster_port/extras/Ubuntu/mounting-glusterfs.conf soc2013/mikema/gluster_port/extras/backend-cleanup.sh soc2013/mikema/gluster_port/extras/backend-xattr-sanitize.sh (contents, props changed) soc2013/mikema/gluster_port/extras/benchmarking/ soc2013/mikema/gluster_port/extras/benchmarking/Makefile.am soc2013/mikema/gluster_port/extras/benchmarking/Makefile.in soc2013/mikema/gluster_port/extras/benchmarking/README soc2013/mikema/gluster_port/extras/benchmarking/glfs-bm.c soc2013/mikema/gluster_port/extras/benchmarking/launch-script.sh (contents, props changed) soc2013/mikema/gluster_port/extras/benchmarking/local-script.sh (contents, props changed) soc2013/mikema/gluster_port/extras/benchmarking/rdd.c soc2013/mikema/gluster_port/extras/clear_xattrs.sh (contents, props changed) soc2013/mikema/gluster_port/extras/contri-add.sh (contents, props changed) soc2013/mikema/gluster_port/extras/disk_usage_sync.sh (contents, props changed) soc2013/mikema/gluster_port/extras/file_size_contri.sh (contents, props changed) soc2013/mikema/gluster_port/extras/generate-xdr-files.sh (contents, props changed) soc2013/mikema/gluster_port/extras/glusterd-sysconfig soc2013/mikema/gluster_port/extras/glusterfs-logrotate soc2013/mikema/gluster_port/extras/glusterfs-mode.el soc2013/mikema/gluster_port/extras/glusterfs.vim soc2013/mikema/gluster_port/extras/gnfs-loganalyse.py soc2013/mikema/gluster_port/extras/group-virt.example soc2013/mikema/gluster_port/extras/hook-scripts/ soc2013/mikema/gluster_port/extras/hook-scripts/Makefile.am soc2013/mikema/gluster_port/extras/hook-scripts/Makefile.in soc2013/mikema/gluster_port/extras/hook-scripts/S29CTDBsetup.sh soc2013/mikema/gluster_port/extras/hook-scripts/S30samba-set.sh (contents, props changed) soc2013/mikema/gluster_port/extras/hook-scripts/S30samba-start.sh (contents, props changed) soc2013/mikema/gluster_port/extras/hook-scripts/S30samba-stop.sh (contents, props changed) soc2013/mikema/gluster_port/extras/hook-scripts/S40ufo-stop.py (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/ soc2013/mikema/gluster_port/extras/init.d/Makefile.am soc2013/mikema/gluster_port/extras/init.d/Makefile.in soc2013/mikema/gluster_port/extras/init.d/glusterd-Debian.in (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/glusterd-FreeBSD.in (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/glusterd-Redhat.in (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/glusterd-SuSE.in (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/glusterd.plist.in (contents, props changed) soc2013/mikema/gluster_port/extras/init.d/rhel5-load-fuse.modules (contents, props changed) soc2013/mikema/gluster_port/extras/migrate-unify-to-distribute.sh (contents, props changed) soc2013/mikema/gluster_port/extras/ocf/ soc2013/mikema/gluster_port/extras/ocf/Makefile.am soc2013/mikema/gluster_port/extras/ocf/Makefile.in soc2013/mikema/gluster_port/extras/ocf/glusterd.in (contents, props changed) soc2013/mikema/gluster_port/extras/ocf/volume.in (contents, props changed) soc2013/mikema/gluster_port/extras/profiler/ soc2013/mikema/gluster_port/extras/profiler/glusterfs-profiler (contents, props changed) soc2013/mikema/gluster_port/extras/prot_filter.py (contents, props changed) soc2013/mikema/gluster_port/extras/quota-metadata-cleanup.sh (contents, props changed) soc2013/mikema/gluster_port/extras/quota-remove-xattr.sh (contents, props changed) soc2013/mikema/gluster_port/extras/rebalance.py (contents, props changed) soc2013/mikema/gluster_port/extras/rpc-coverage.sh (contents, props changed) soc2013/mikema/gluster_port/extras/specgen.scm (contents, props changed) soc2013/mikema/gluster_port/extras/stripe-merge.c soc2013/mikema/gluster_port/extras/systemd/ soc2013/mikema/gluster_port/extras/systemd/Makefile.am soc2013/mikema/gluster_port/extras/systemd/Makefile.in soc2013/mikema/gluster_port/extras/systemd/glusterd.service.in soc2013/mikema/gluster_port/extras/test/ soc2013/mikema/gluster_port/extras/test/bug-920583.t (contents, props changed) soc2013/mikema/gluster_port/extras/test/gluster_commands.sh (contents, props changed) soc2013/mikema/gluster_port/extras/test/ld-preload-test/ soc2013/mikema/gluster_port/extras/test/ld-preload-test/Makefile soc2013/mikema/gluster_port/extras/test/ld-preload-test/README soc2013/mikema/gluster_port/extras/test/ld-preload-test/ld-preload-lib.c soc2013/mikema/gluster_port/extras/test/ld-preload-test/ld-preload-test.c soc2013/mikema/gluster_port/extras/test/ld-preload-test/test-preload.sh (contents, props changed) soc2013/mikema/gluster_port/extras/test/open-fd-tests.c soc2013/mikema/gluster_port/extras/test/run.sh (contents, props changed) soc2013/mikema/gluster_port/extras/test/stop_glusterd.sh (contents, props changed) soc2013/mikema/gluster_port/extras/test/test-ffop.c soc2013/mikema/gluster_port/extras/volfilter.py soc2013/mikema/gluster_port/gen-headers.py (contents, props changed) soc2013/mikema/gluster_port/gf-error-codes.h.template soc2013/mikema/gluster_port/glusterfs-api.pc.in soc2013/mikema/gluster_port/glusterfs-hadoop/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/conf/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/conf/core-site.xml (contents, props changed) soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/pom.xml soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSBrickClass.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSBrickRepl.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFUSEInputStream.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFUSEOutputStream.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFileSystem.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/apache/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/apache/hadoop/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/apache/hadoop/fs/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/apache/hadoop/fs/glusterfs/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/src/test/java/org/apache/hadoop/fs/glusterfs/AppTest.java soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/tools/ soc2013/mikema/gluster_port/glusterfs-hadoop/0.20.2/tools/build-deploy-jar.py (contents, props changed) soc2013/mikema/gluster_port/glusterfs-hadoop/COPYING soc2013/mikema/gluster_port/glusterfs-hadoop/README soc2013/mikema/gluster_port/glusterfs.spec.in soc2013/mikema/gluster_port/glusterfsd/ soc2013/mikema/gluster_port/glusterfsd/Makefile.am soc2013/mikema/gluster_port/glusterfsd/Makefile.in soc2013/mikema/gluster_port/glusterfsd/src/ soc2013/mikema/gluster_port/glusterfsd/src/Makefile.am soc2013/mikema/gluster_port/glusterfsd/src/Makefile.in soc2013/mikema/gluster_port/glusterfsd/src/glusterfsd-mem-types.h soc2013/mikema/gluster_port/glusterfsd/src/glusterfsd-mgmt.c soc2013/mikema/gluster_port/glusterfsd/src/glusterfsd.c soc2013/mikema/gluster_port/glusterfsd/src/glusterfsd.h soc2013/mikema/gluster_port/install-sh (contents, props changed) soc2013/mikema/gluster_port/libglusterfs/ soc2013/mikema/gluster_port/libglusterfs/Makefile.am soc2013/mikema/gluster_port/libglusterfs/Makefile.in soc2013/mikema/gluster_port/libglusterfs/src/ soc2013/mikema/gluster_port/libglusterfs/src/Makefile.am soc2013/mikema/gluster_port/libglusterfs/src/Makefile.in soc2013/mikema/gluster_port/libglusterfs/src/byte-order.h soc2013/mikema/gluster_port/libglusterfs/src/call-stub.c soc2013/mikema/gluster_port/libglusterfs/src/call-stub.h soc2013/mikema/gluster_port/libglusterfs/src/checksum.c soc2013/mikema/gluster_port/libglusterfs/src/checksum.h soc2013/mikema/gluster_port/libglusterfs/src/circ-buff.c soc2013/mikema/gluster_port/libglusterfs/src/circ-buff.h soc2013/mikema/gluster_port/libglusterfs/src/common-utils.c soc2013/mikema/gluster_port/libglusterfs/src/common-utils.h soc2013/mikema/gluster_port/libglusterfs/src/compat-errno.c soc2013/mikema/gluster_port/libglusterfs/src/compat-errno.h soc2013/mikema/gluster_port/libglusterfs/src/compat.c soc2013/mikema/gluster_port/libglusterfs/src/compat.h soc2013/mikema/gluster_port/libglusterfs/src/ctx.c soc2013/mikema/gluster_port/libglusterfs/src/daemon.c soc2013/mikema/gluster_port/libglusterfs/src/daemon.h soc2013/mikema/gluster_port/libglusterfs/src/defaults.c soc2013/mikema/gluster_port/libglusterfs/src/defaults.h soc2013/mikema/gluster_port/libglusterfs/src/dict.c soc2013/mikema/gluster_port/libglusterfs/src/dict.h soc2013/mikema/gluster_port/libglusterfs/src/event-epoll.c soc2013/mikema/gluster_port/libglusterfs/src/event-history.c soc2013/mikema/gluster_port/libglusterfs/src/event-history.h soc2013/mikema/gluster_port/libglusterfs/src/event-poll.c soc2013/mikema/gluster_port/libglusterfs/src/event.c soc2013/mikema/gluster_port/libglusterfs/src/event.h soc2013/mikema/gluster_port/libglusterfs/src/fd-lk.c soc2013/mikema/gluster_port/libglusterfs/src/fd-lk.h soc2013/mikema/gluster_port/libglusterfs/src/fd.c soc2013/mikema/gluster_port/libglusterfs/src/fd.h soc2013/mikema/gluster_port/libglusterfs/src/gf-dirent.c soc2013/mikema/gluster_port/libglusterfs/src/gf-dirent.h soc2013/mikema/gluster_port/libglusterfs/src/gf-error-codes.h soc2013/mikema/gluster_port/libglusterfs/src/gidcache.c soc2013/mikema/gluster_port/libglusterfs/src/gidcache.h soc2013/mikema/gluster_port/libglusterfs/src/globals.c soc2013/mikema/gluster_port/libglusterfs/src/globals.h soc2013/mikema/gluster_port/libglusterfs/src/glusterfs.h soc2013/mikema/gluster_port/libglusterfs/src/graph-print.c soc2013/mikema/gluster_port/libglusterfs/src/graph-utils.h soc2013/mikema/gluster_port/libglusterfs/src/graph.c soc2013/mikema/gluster_port/libglusterfs/src/graph.l soc2013/mikema/gluster_port/libglusterfs/src/graph.y soc2013/mikema/gluster_port/libglusterfs/src/hashfn.c soc2013/mikema/gluster_port/libglusterfs/src/hashfn.h soc2013/mikema/gluster_port/libglusterfs/src/iatt.h soc2013/mikema/gluster_port/libglusterfs/src/inode.c soc2013/mikema/gluster_port/libglusterfs/src/inode.h soc2013/mikema/gluster_port/libglusterfs/src/iobuf.c soc2013/mikema/gluster_port/libglusterfs/src/iobuf.h soc2013/mikema/gluster_port/libglusterfs/src/latency.c soc2013/mikema/gluster_port/libglusterfs/src/latency.h soc2013/mikema/gluster_port/libglusterfs/src/list.h soc2013/mikema/gluster_port/libglusterfs/src/lkowner.h soc2013/mikema/gluster_port/libglusterfs/src/locking.h soc2013/mikema/gluster_port/libglusterfs/src/logging.c soc2013/mikema/gluster_port/libglusterfs/src/logging.h soc2013/mikema/gluster_port/libglusterfs/src/mem-pool.c soc2013/mikema/gluster_port/libglusterfs/src/mem-pool.h soc2013/mikema/gluster_port/libglusterfs/src/mem-types.h soc2013/mikema/gluster_port/libglusterfs/src/options.c soc2013/mikema/gluster_port/libglusterfs/src/options.h soc2013/mikema/gluster_port/libglusterfs/src/rbthash.c soc2013/mikema/gluster_port/libglusterfs/src/rbthash.h soc2013/mikema/gluster_port/libglusterfs/src/revision.h soc2013/mikema/gluster_port/libglusterfs/src/run.c soc2013/mikema/gluster_port/libglusterfs/src/run.h soc2013/mikema/gluster_port/libglusterfs/src/stack.c soc2013/mikema/gluster_port/libglusterfs/src/stack.h soc2013/mikema/gluster_port/libglusterfs/src/statedump.c soc2013/mikema/gluster_port/libglusterfs/src/statedump.h soc2013/mikema/gluster_port/libglusterfs/src/store.c soc2013/mikema/gluster_port/libglusterfs/src/store.h soc2013/mikema/gluster_port/libglusterfs/src/syncop.c soc2013/mikema/gluster_port/libglusterfs/src/syncop.h soc2013/mikema/gluster_port/libglusterfs/src/syscall.c soc2013/mikema/gluster_port/libglusterfs/src/syscall.h soc2013/mikema/gluster_port/libglusterfs/src/timer.c soc2013/mikema/gluster_port/libglusterfs/src/timer.h soc2013/mikema/gluster_port/libglusterfs/src/trie.c soc2013/mikema/gluster_port/libglusterfs/src/trie.h soc2013/mikema/gluster_port/libglusterfs/src/xlator.c soc2013/mikema/gluster_port/libglusterfs/src/xlator.h soc2013/mikema/gluster_port/ltmain.sh soc2013/mikema/gluster_port/missing (contents, props changed) soc2013/mikema/gluster_port/py-compile (contents, props changed) soc2013/mikema/gluster_port/rfc.sh (contents, props changed) soc2013/mikema/gluster_port/rpc/ soc2013/mikema/gluster_port/rpc/Makefile.am soc2013/mikema/gluster_port/rpc/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-lib/ soc2013/mikema/gluster_port/rpc/rpc-lib/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-lib/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-lib/src/ soc2013/mikema/gluster_port/rpc/rpc-lib/src/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-lib/src/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-lib/src/auth-glusterfs.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/auth-null.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/auth-unix.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/protocol-common.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-clnt.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-clnt.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-drc.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-drc.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-transport.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpc-transport.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpcsvc-auth.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpcsvc-common.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpcsvc.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/rpcsvc.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/xdr-common.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/xdr-rpc.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/xdr-rpc.h soc2013/mikema/gluster_port/rpc/rpc-lib/src/xdr-rpcclnt.c soc2013/mikema/gluster_port/rpc/rpc-lib/src/xdr-rpcclnt.h soc2013/mikema/gluster_port/rpc/rpc-transport/ soc2013/mikema/gluster_port/rpc/rpc-transport/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-transport/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/ soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/Makefile soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/ soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/.deps/ soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/.deps/name.Plo soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/.deps/rdma.Plo soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/Makefile soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/name.c soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/name.h soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/rdma.c soc2013/mikema/gluster_port/rpc/rpc-transport/rdma/src/rdma.h soc2013/mikema/gluster_port/rpc/rpc-transport/socket/ soc2013/mikema/gluster_port/rpc/rpc-transport/socket/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-transport/socket/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/ soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/Makefile.am soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/Makefile.in soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/name.c soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/name.h soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/socket.c soc2013/mikema/gluster_port/rpc/rpc-transport/socket/src/socket.h soc2013/mikema/gluster_port/rpc/xdr/ soc2013/mikema/gluster_port/rpc/xdr/Makefile.am soc2013/mikema/gluster_port/rpc/xdr/Makefile.in soc2013/mikema/gluster_port/rpc/xdr/src/ soc2013/mikema/gluster_port/rpc/xdr/src/Makefile.am soc2013/mikema/gluster_port/rpc/xdr/src/Makefile.in soc2013/mikema/gluster_port/rpc/xdr/src/acl.x soc2013/mikema/gluster_port/rpc/xdr/src/acl3-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/acl3-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/cli1-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/cli1-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/cli1-xdr.x soc2013/mikema/gluster_port/rpc/xdr/src/glusterd1-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/glusterd1-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/glusterd1-xdr.x soc2013/mikema/gluster_port/rpc/xdr/src/glusterfs3-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/glusterfs3-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/glusterfs3-xdr.x soc2013/mikema/gluster_port/rpc/xdr/src/glusterfs3.h soc2013/mikema/gluster_port/rpc/xdr/src/mount3udp.x soc2013/mikema/gluster_port/rpc/xdr/src/msg-nfs3.c soc2013/mikema/gluster_port/rpc/xdr/src/msg-nfs3.h soc2013/mikema/gluster_port/rpc/xdr/src/nlm4-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/nlm4-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/nlm4.x soc2013/mikema/gluster_port/rpc/xdr/src/nlmcbk-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/nlmcbk-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/nlmcbk.x soc2013/mikema/gluster_port/rpc/xdr/src/nsm-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/nsm-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/nsm.x soc2013/mikema/gluster_port/rpc/xdr/src/portmap-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/portmap-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/portmap-xdr.x soc2013/mikema/gluster_port/rpc/xdr/src/rpc-common-xdr.c soc2013/mikema/gluster_port/rpc/xdr/src/rpc-common-xdr.h soc2013/mikema/gluster_port/rpc/xdr/src/rpc-common-xdr.x soc2013/mikema/gluster_port/rpc/xdr/src/xdr-generic.c soc2013/mikema/gluster_port/rpc/xdr/src/xdr-generic.h soc2013/mikema/gluster_port/rpc/xdr/src/xdr-nfs3.c soc2013/mikema/gluster_port/rpc/xdr/src/xdr-nfs3.h soc2013/mikema/gluster_port/run-tests.sh (contents, props changed) soc2013/mikema/gluster_port/run-tests_FreeBSD.sh (contents, props changed) soc2013/mikema/gluster_port/tests/ soc2013/mikema/gluster_port/tests/README soc2013/mikema/gluster_port/tests/afr.rc soc2013/mikema/gluster_port/tests/basic/ soc2013/mikema/gluster_port/tests/basic/bd.t (contents, props changed) soc2013/mikema/gluster_port/tests/basic/mount.t (contents, props changed) soc2013/mikema/gluster_port/tests/basic/nufa.t soc2013/mikema/gluster_port/tests/basic/posixonly.t (contents, props changed) soc2013/mikema/gluster_port/tests/basic/pump.t soc2013/mikema/gluster_port/tests/basic/quota.t (contents, props changed) soc2013/mikema/gluster_port/tests/basic/rpm.t (contents, props changed) soc2013/mikema/gluster_port/tests/basic/self-heald.t soc2013/mikema/gluster_port/tests/basic/volume-status.t soc2013/mikema/gluster_port/tests/basic/volume.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/ soc2013/mikema/gluster_port/tests/bugs/859927/ soc2013/mikema/gluster_port/tests/bugs/859927/repl.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/886998/ soc2013/mikema/gluster_port/tests/bugs/886998/strict-readdir.t soc2013/mikema/gluster_port/tests/bugs/949327.t soc2013/mikema/gluster_port/tests/bugs/bug-000000.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-762989.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-764638.t soc2013/mikema/gluster_port/tests/bugs/bug-765230.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-765380.t soc2013/mikema/gluster_port/tests/bugs/bug-765473.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-765564.t soc2013/mikema/gluster_port/tests/bugs/bug-767095.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-767585-gfid.t soc2013/mikema/gluster_port/tests/bugs/bug-770655.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-782095.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-797171.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-802417.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-808400-dist.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-808400-fcntl.c soc2013/mikema/gluster_port/tests/bugs/bug-808400-flock.c soc2013/mikema/gluster_port/tests/bugs/bug-808400-repl.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-808400-stripe.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-808400.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-811493.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-821056.t soc2013/mikema/gluster_port/tests/bugs/bug-822830.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-823081.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-824753-file-locker.c soc2013/mikema/gluster_port/tests/bugs/bug-824753.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-830665.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-834465.c soc2013/mikema/gluster_port/tests/bugs/bug-834465.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-839595.t soc2013/mikema/gluster_port/tests/bugs/bug-844688.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-845213.t soc2013/mikema/gluster_port/tests/bugs/bug-846240.t soc2013/mikema/gluster_port/tests/bugs/bug-847622.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-847624.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-848251.t soc2013/mikema/gluster_port/tests/bugs/bug-852147.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-853258.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-853680.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-853690.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-856455.t soc2013/mikema/gluster_port/tests/bugs/bug-857330/ soc2013/mikema/gluster_port/tests/bugs/bug-857330/common.rc soc2013/mikema/gluster_port/tests/bugs/bug-857330/normal.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-857330/xml.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-858215.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-858242.c soc2013/mikema/gluster_port/tests/bugs/bug-858242.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-858488-min-free-disk.t soc2013/mikema/gluster_port/tests/bugs/bug-859927.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-860297.t soc2013/mikema/gluster_port/tests/bugs/bug-860663.t soc2013/mikema/gluster_port/tests/bugs/bug-861015-index.t soc2013/mikema/gluster_port/tests/bugs/bug-861015-log.t soc2013/mikema/gluster_port/tests/bugs/bug-861542.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-861945.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-862834.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-862967.t soc2013/mikema/gluster_port/tests/bugs/bug-863068.t soc2013/mikema/gluster_port/tests/bugs/bug-864222.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-864499.t soc2013/mikema/gluster_port/tests/bugs/bug-864506.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-865825.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-866459.t soc2013/mikema/gluster_port/tests/bugs/bug-867252.t soc2013/mikema/gluster_port/tests/bugs/bug-867253.t soc2013/mikema/gluster_port/tests/bugs/bug-869724.t soc2013/mikema/gluster_port/tests/bugs/bug-872923.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-873367.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-873549.t soc2013/mikema/gluster_port/tests/bugs/bug-873962-spb.t soc2013/mikema/gluster_port/tests/bugs/bug-873962.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-874272.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-874498.t soc2013/mikema/gluster_port/tests/bugs/bug-877293.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-877885.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-877992.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-878004.t soc2013/mikema/gluster_port/tests/bugs/bug-879490.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-879494.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-880898.t soc2013/mikema/gluster_port/tests/bugs/bug-882278.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-884328.t soc2013/mikema/gluster_port/tests/bugs/bug-884452.t soc2013/mikema/gluster_port/tests/bugs/bug-884455.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-884597.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-887098-gmount-crash.t soc2013/mikema/gluster_port/tests/bugs/bug-887145.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-888174.t soc2013/mikema/gluster_port/tests/bugs/bug-889630.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-889996.t soc2013/mikema/gluster_port/tests/bugs/bug-892730.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-893338.t soc2013/mikema/gluster_port/tests/bugs/bug-893378.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-895235.t soc2013/mikema/gluster_port/tests/bugs/bug-896431.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-902610.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-903336.t soc2013/mikema/gluster_port/tests/bugs/bug-904300.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-905307.t soc2013/mikema/gluster_port/tests/bugs/bug-905864.c soc2013/mikema/gluster_port/tests/bugs/bug-905864.t soc2013/mikema/gluster_port/tests/bugs/bug-906646.t soc2013/mikema/gluster_port/tests/bugs/bug-908146.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-912297.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-912564.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-913051.t soc2013/mikema/gluster_port/tests/bugs/bug-913487.t soc2013/mikema/gluster_port/tests/bugs/bug-913544.t soc2013/mikema/gluster_port/tests/bugs/bug-913555.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-915280.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-915554.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-916226.t soc2013/mikema/gluster_port/tests/bugs/bug-916549.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-918437-sh-mtime.t soc2013/mikema/gluster_port/tests/bugs/bug-921072.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-921408.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-924075.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-924265.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-927616.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-948686.t soc2013/mikema/gluster_port/tests/bugs/bug-948729/ soc2013/mikema/gluster_port/tests/bugs/bug-948729/bug-948729-force.t soc2013/mikema/gluster_port/tests/bugs/bug-948729/bug-948729-mode-script.t soc2013/mikema/gluster_port/tests/bugs/bug-948729/bug-948729.t soc2013/mikema/gluster_port/tests/bugs/bug-949242.t soc2013/mikema/gluster_port/tests/bugs/bug-949298.t soc2013/mikema/gluster_port/tests/bugs/bug-949930.t soc2013/mikema/gluster_port/tests/bugs/bug-957877.t soc2013/mikema/gluster_port/tests/bugs/bug-958691.t soc2013/mikema/gluster_port/tests/bugs/bug-958790.t soc2013/mikema/gluster_port/tests/bugs/bug-961307.t soc2013/mikema/gluster_port/tests/bugs/bug-961615.t soc2013/mikema/gluster_port/tests/bugs/bug-961669.t soc2013/mikema/gluster_port/tests/bugs/bug-963541.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-963678.t soc2013/mikema/gluster_port/tests/bugs/bug-964059.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-966018.t soc2013/mikema/gluster_port/tests/bugs/bug-969193.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-970070.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-973073.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-974972.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-976800.t soc2013/mikema/gluster_port/tests/bugs/bug-977246.t soc2013/mikema/gluster_port/tests/bugs/bug-977797.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-978794.t soc2013/mikema/gluster_port/tests/bugs/bug-979365.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-982174.t soc2013/mikema/gluster_port/tests/bugs/bug-983477.t (contents, props changed) soc2013/mikema/gluster_port/tests/bugs/bug-985074.t soc2013/mikema/gluster_port/tests/bugs/getlk_owner.c soc2013/mikema/gluster_port/tests/bugs/overlap.py (contents, props changed) soc2013/mikema/gluster_port/tests/cluster.rc (contents, props changed) soc2013/mikema/gluster_port/tests/dht.rc soc2013/mikema/gluster_port/tests/fallocate.rc soc2013/mikema/gluster_port/tests/features/ soc2013/mikema/gluster_port/tests/features/glupy.t (contents, props changed) soc2013/mikema/gluster_port/tests/fileio.rc soc2013/mikema/gluster_port/tests/include.rc soc2013/mikema/gluster_port/tests/nfs.rc soc2013/mikema/gluster_port/tests/performance/ soc2013/mikema/gluster_port/tests/performance/open-behind.t (contents, props changed) soc2013/mikema/gluster_port/tests/performance/quick-read.t soc2013/mikema/gluster_port/tests/utils/ soc2013/mikema/gluster_port/tests/utils/create-files.py (contents, props changed) soc2013/mikema/gluster_port/tests/volume.rc soc2013/mikema/gluster_port/tests_FreeBSD/ soc2013/mikema/gluster_port/tests_FreeBSD/README soc2013/mikema/gluster_port/tests_FreeBSD/afr.rc soc2013/mikema/gluster_port/tests_FreeBSD/basic/ soc2013/mikema/gluster_port/tests_FreeBSD/basic/mount.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/basic/nufa.t soc2013/mikema/gluster_port/tests_FreeBSD/basic/posixonly.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/basic/pump.t soc2013/mikema/gluster_port/tests_FreeBSD/basic/quota.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/basic/rpm.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/basic/self-heald.t soc2013/mikema/gluster_port/tests_FreeBSD/basic/volume-status.t soc2013/mikema/gluster_port/tests_FreeBSD/basic/volume.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/ soc2013/mikema/gluster_port/tests_FreeBSD/bugs/859927/ soc2013/mikema/gluster_port/tests_FreeBSD/bugs/859927/repl.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/886998/ soc2013/mikema/gluster_port/tests_FreeBSD/bugs/886998/strict-readdir.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/949327.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-000000.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-762989.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-764638.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-765230.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-765380.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-765473.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-765564.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-767095.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-767585-gfid.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-770655.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-782095.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-797171.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-802417.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400-dist.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400-fcntl.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400-flock.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400-repl.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400-stripe.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-808400.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-811493.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-821056.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-822830.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-823081.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-824753-file-locker.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-824753.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-830665.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-834465.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-834465.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-839595.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-844688.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-845213.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-846240.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-847622.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-847624.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-848251.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-852147.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-853258.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-853680.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-853690.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-856455.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-857330/ soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-857330/common.rc soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-857330/normal.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-857330/xml.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-858215.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-858242.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-858242.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-858488-min-free-disk.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-859927.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-860297.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-860663.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-861015-index.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-861015-log.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-861542.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-861945.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-862834.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-862967.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-863068.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-864222.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-864499.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-864506.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-865825.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-866459.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-867252.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-867253.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-869724.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-872923.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-873367.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-873549.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-873962-spb.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-873962.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-874272.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-874498.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-877293.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-877885.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-877992.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-878004.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-879490.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-879494.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-880898.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-882278.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-884328.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-884452.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-884455.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-884597.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-887098-gmount-crash.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-887145.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-888174.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-889630.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-889996.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-892730.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-893338.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-893378.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-895235.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-896431.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-902610.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-903336.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-904300.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-905307.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-905864.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-905864.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-906646.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-908146.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-912297.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-912564.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-913051.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-913487.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-913544.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-913555.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-915280.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-915554.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-916226.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-916549.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-918437-sh-mtime.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-921072.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-921408.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-924075.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-924265.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-927616.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-948686.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-948729/ soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-948729/bug-948729-force.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-948729/bug-948729-mode-script.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-948729/bug-948729.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-949242.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-949298.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-949930.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-957877.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-958691.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-958790.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-961307.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-961615.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-961669.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-963541.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-963678.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-964059.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-966018.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-969193.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-970070.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-973073.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-974972.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-976800.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-977246.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-977797.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-978794.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-979365.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-982174.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-983477.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/bugs/bug-985074.t soc2013/mikema/gluster_port/tests_FreeBSD/bugs/getlk_owner.c soc2013/mikema/gluster_port/tests_FreeBSD/bugs/overlap.py (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/cluster.rc (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/dht.rc soc2013/mikema/gluster_port/tests_FreeBSD/fallocate.rc soc2013/mikema/gluster_port/tests_FreeBSD/features/ soc2013/mikema/gluster_port/tests_FreeBSD/features/glupy.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/fileio.rc soc2013/mikema/gluster_port/tests_FreeBSD/include.rc soc2013/mikema/gluster_port/tests_FreeBSD/nfs.rc soc2013/mikema/gluster_port/tests_FreeBSD/performance/ soc2013/mikema/gluster_port/tests_FreeBSD/performance/open-behind.t (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/performance/quick-read.t soc2013/mikema/gluster_port/tests_FreeBSD/utils/ soc2013/mikema/gluster_port/tests_FreeBSD/utils/create-files.py (contents, props changed) soc2013/mikema/gluster_port/tests_FreeBSD/volume.rc soc2013/mikema/gluster_port/xlators/ soc2013/mikema/gluster_port/xlators/Makefile.am soc2013/mikema/gluster_port/xlators/Makefile.in soc2013/mikema/gluster_port/xlators/bindings/ soc2013/mikema/gluster_port/xlators/bindings/Makefile.am soc2013/mikema/gluster_port/xlators/bindings/python/ soc2013/mikema/gluster_port/xlators/bindings/python/Makefile.am soc2013/mikema/gluster_port/xlators/bindings/python/src/ soc2013/mikema/gluster_port/xlators/bindings/python/src/Makefile.am soc2013/mikema/gluster_port/xlators/bindings/python/src/gluster.py soc2013/mikema/gluster_port/xlators/bindings/python/src/glusterstack.py soc2013/mikema/gluster_port/xlators/bindings/python/src/glustertypes.py soc2013/mikema/gluster_port/xlators/bindings/python/src/python.c soc2013/mikema/gluster_port/xlators/bindings/python/src/testxlator.py soc2013/mikema/gluster_port/xlators/cluster/ soc2013/mikema/gluster_port/xlators/cluster/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/afr/ soc2013/mikema/gluster_port/xlators/cluster/afr/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/afr/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/afr/src/ soc2013/mikema/gluster_port/xlators/cluster/afr/src/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/afr/src/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-common.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-dir-read.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-dir-read.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-dir-write.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-dir-write.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-inode-read.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-inode-read.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-inode-write.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-inode-write.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-lk-common.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-mem-types.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-open.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-algorithm.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-algorithm.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-common.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-common.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-data.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-entry.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal-metadata.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heal.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heald.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-self-heald.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-transaction.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr-transaction.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/afr.h soc2013/mikema/gluster_port/xlators/cluster/afr/src/pump.c soc2013/mikema/gluster_port/xlators/cluster/afr/src/pump.h soc2013/mikema/gluster_port/xlators/cluster/dht/ soc2013/mikema/gluster_port/xlators/cluster/dht/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/dht/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/dht/src/ soc2013/mikema/gluster_port/xlators/cluster/dht/src/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/dht/src/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-common.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-common.h soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-diskusage.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-hashfn.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-helper.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-inode-read.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-inode-write.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-layout.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-linkfile.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-mem-types.h soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-rebalance.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-rename.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-selfheal.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht-shared.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/dht.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/nufa.c soc2013/mikema/gluster_port/xlators/cluster/dht/src/switch.c soc2013/mikema/gluster_port/xlators/cluster/ha/ soc2013/mikema/gluster_port/xlators/cluster/ha/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/ha/src/ soc2013/mikema/gluster_port/xlators/cluster/ha/src/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/ha/src/ha-helpers.c soc2013/mikema/gluster_port/xlators/cluster/ha/src/ha-mem-types.h soc2013/mikema/gluster_port/xlators/cluster/ha/src/ha.c soc2013/mikema/gluster_port/xlators/cluster/ha/src/ha.h soc2013/mikema/gluster_port/xlators/cluster/map/ soc2013/mikema/gluster_port/xlators/cluster/map/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/map/src/ soc2013/mikema/gluster_port/xlators/cluster/map/src/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/map/src/map-helper.c soc2013/mikema/gluster_port/xlators/cluster/map/src/map-mem-types.h soc2013/mikema/gluster_port/xlators/cluster/map/src/map.c soc2013/mikema/gluster_port/xlators/cluster/map/src/map.h soc2013/mikema/gluster_port/xlators/cluster/stripe/ soc2013/mikema/gluster_port/xlators/cluster/stripe/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/stripe/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/stripe/src/ soc2013/mikema/gluster_port/xlators/cluster/stripe/src/Makefile.am soc2013/mikema/gluster_port/xlators/cluster/stripe/src/Makefile.in soc2013/mikema/gluster_port/xlators/cluster/stripe/src/stripe-helpers.c soc2013/mikema/gluster_port/xlators/cluster/stripe/src/stripe-mem-types.h soc2013/mikema/gluster_port/xlators/cluster/stripe/src/stripe.c soc2013/mikema/gluster_port/xlators/cluster/stripe/src/stripe.h soc2013/mikema/gluster_port/xlators/debug/ soc2013/mikema/gluster_port/xlators/debug/Makefile.am soc2013/mikema/gluster_port/xlators/debug/Makefile.in soc2013/mikema/gluster_port/xlators/debug/error-gen/ soc2013/mikema/gluster_port/xlators/debug/error-gen/Makefile.am soc2013/mikema/gluster_port/xlators/debug/error-gen/Makefile.in soc2013/mikema/gluster_port/xlators/debug/error-gen/src/ soc2013/mikema/gluster_port/xlators/debug/error-gen/src/Makefile.am soc2013/mikema/gluster_port/xlators/debug/error-gen/src/Makefile.in soc2013/mikema/gluster_port/xlators/debug/error-gen/src/error-gen-mem-types.h soc2013/mikema/gluster_port/xlators/debug/error-gen/src/error-gen.c soc2013/mikema/gluster_port/xlators/debug/error-gen/src/error-gen.h soc2013/mikema/gluster_port/xlators/debug/io-stats/ soc2013/mikema/gluster_port/xlators/debug/io-stats/Makefile.am soc2013/mikema/gluster_port/xlators/debug/io-stats/Makefile.in soc2013/mikema/gluster_port/xlators/debug/io-stats/src/ soc2013/mikema/gluster_port/xlators/debug/io-stats/src/Makefile.am soc2013/mikema/gluster_port/xlators/debug/io-stats/src/Makefile.in soc2013/mikema/gluster_port/xlators/debug/io-stats/src/io-stats-mem-types.h soc2013/mikema/gluster_port/xlators/debug/io-stats/src/io-stats.c soc2013/mikema/gluster_port/xlators/debug/trace/ soc2013/mikema/gluster_port/xlators/debug/trace/Makefile.am soc2013/mikema/gluster_port/xlators/debug/trace/Makefile.in soc2013/mikema/gluster_port/xlators/debug/trace/src/ soc2013/mikema/gluster_port/xlators/debug/trace/src/Makefile.am soc2013/mikema/gluster_port/xlators/debug/trace/src/Makefile.in soc2013/mikema/gluster_port/xlators/debug/trace/src/trace-mem-types.h soc2013/mikema/gluster_port/xlators/debug/trace/src/trace.c soc2013/mikema/gluster_port/xlators/debug/trace/src/trace.h soc2013/mikema/gluster_port/xlators/encryption/ soc2013/mikema/gluster_port/xlators/encryption/Makefile.am soc2013/mikema/gluster_port/xlators/encryption/Makefile.in soc2013/mikema/gluster_port/xlators/encryption/rot-13/ soc2013/mikema/gluster_port/xlators/encryption/rot-13/Makefile.am soc2013/mikema/gluster_port/xlators/encryption/rot-13/Makefile.in soc2013/mikema/gluster_port/xlators/encryption/rot-13/src/ soc2013/mikema/gluster_port/xlators/encryption/rot-13/src/Makefile.am soc2013/mikema/gluster_port/xlators/encryption/rot-13/src/Makefile.in soc2013/mikema/gluster_port/xlators/encryption/rot-13/src/rot-13.c soc2013/mikema/gluster_port/xlators/encryption/rot-13/src/rot-13.h soc2013/mikema/gluster_port/xlators/features/ soc2013/mikema/gluster_port/xlators/features/Makefile.am soc2013/mikema/gluster_port/xlators/features/Makefile.in soc2013/mikema/gluster_port/xlators/features/filter/ soc2013/mikema/gluster_port/xlators/features/filter/Makefile.am soc2013/mikema/gluster_port/xlators/features/filter/src/ soc2013/mikema/gluster_port/xlators/features/filter/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/filter/src/filter-mem-types.h soc2013/mikema/gluster_port/xlators/features/filter/src/filter.c soc2013/mikema/gluster_port/xlators/features/glupy/ soc2013/mikema/gluster_port/xlators/features/glupy/Makefile soc2013/mikema/gluster_port/xlators/features/glupy/Makefile.am soc2013/mikema/gluster_port/xlators/features/glupy/Makefile.in soc2013/mikema/gluster_port/xlators/features/glupy/doc/ soc2013/mikema/gluster_port/xlators/features/glupy/doc/README.md soc2013/mikema/gluster_port/xlators/features/glupy/doc/TESTING soc2013/mikema/gluster_port/xlators/features/glupy/doc/test.vol soc2013/mikema/gluster_port/xlators/features/glupy/src/ soc2013/mikema/gluster_port/xlators/features/glupy/src/.deps/ soc2013/mikema/gluster_port/xlators/features/glupy/src/.deps/glupy.Plo soc2013/mikema/gluster_port/xlators/features/glupy/src/Makefile soc2013/mikema/gluster_port/xlators/features/glupy/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/glupy/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/glupy/src/debug-trace.py soc2013/mikema/gluster_port/xlators/features/glupy/src/glupy.c soc2013/mikema/gluster_port/xlators/features/glupy/src/glupy.h soc2013/mikema/gluster_port/xlators/features/glupy/src/gluster.py soc2013/mikema/gluster_port/xlators/features/glupy/src/helloworld.py soc2013/mikema/gluster_port/xlators/features/glupy/src/negative.py soc2013/mikema/gluster_port/xlators/features/index/ soc2013/mikema/gluster_port/xlators/features/index/Makefile.am soc2013/mikema/gluster_port/xlators/features/index/Makefile.in soc2013/mikema/gluster_port/xlators/features/index/src/ soc2013/mikema/gluster_port/xlators/features/index/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/index/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/index/src/index-mem-types.h soc2013/mikema/gluster_port/xlators/features/index/src/index.c soc2013/mikema/gluster_port/xlators/features/index/src/index.h soc2013/mikema/gluster_port/xlators/features/locks/ soc2013/mikema/gluster_port/xlators/features/locks/Makefile.am soc2013/mikema/gluster_port/xlators/features/locks/Makefile.in soc2013/mikema/gluster_port/xlators/features/locks/src/ soc2013/mikema/gluster_port/xlators/features/locks/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/locks/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/locks/src/clear.c soc2013/mikema/gluster_port/xlators/features/locks/src/clear.h soc2013/mikema/gluster_port/xlators/features/locks/src/common.c soc2013/mikema/gluster_port/xlators/features/locks/src/common.h soc2013/mikema/gluster_port/xlators/features/locks/src/entrylk.c soc2013/mikema/gluster_port/xlators/features/locks/src/inodelk.c soc2013/mikema/gluster_port/xlators/features/locks/src/locks-mem-types.h soc2013/mikema/gluster_port/xlators/features/locks/src/locks.h soc2013/mikema/gluster_port/xlators/features/locks/src/posix.c soc2013/mikema/gluster_port/xlators/features/locks/src/reservelk.c soc2013/mikema/gluster_port/xlators/features/locks/tests/ soc2013/mikema/gluster_port/xlators/features/locks/tests/unit-test.c soc2013/mikema/gluster_port/xlators/features/mac-compat/ soc2013/mikema/gluster_port/xlators/features/mac-compat/Makefile.am soc2013/mikema/gluster_port/xlators/features/mac-compat/Makefile.in soc2013/mikema/gluster_port/xlators/features/mac-compat/src/ soc2013/mikema/gluster_port/xlators/features/mac-compat/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/mac-compat/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/mac-compat/src/mac-compat.c soc2013/mikema/gluster_port/xlators/features/marker/ soc2013/mikema/gluster_port/xlators/features/marker/Makefile.am soc2013/mikema/gluster_port/xlators/features/marker/Makefile.in soc2013/mikema/gluster_port/xlators/features/marker/src/ soc2013/mikema/gluster_port/xlators/features/marker/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/marker/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/marker/src/marker-common.c soc2013/mikema/gluster_port/xlators/features/marker/src/marker-common.h soc2013/mikema/gluster_port/xlators/features/marker/src/marker-mem-types.h soc2013/mikema/gluster_port/xlators/features/marker/src/marker-quota-helper.c soc2013/mikema/gluster_port/xlators/features/marker/src/marker-quota-helper.h soc2013/mikema/gluster_port/xlators/features/marker/src/marker-quota.c soc2013/mikema/gluster_port/xlators/features/marker/src/marker-quota.h soc2013/mikema/gluster_port/xlators/features/marker/src/marker.c soc2013/mikema/gluster_port/xlators/features/marker/src/marker.h soc2013/mikema/gluster_port/xlators/features/marker/utils/ soc2013/mikema/gluster_port/xlators/features/marker/utils/Makefile soc2013/mikema/gluster_port/xlators/features/marker/utils/Makefile.am soc2013/mikema/gluster_port/xlators/features/marker/utils/Makefile.in soc2013/mikema/gluster_port/xlators/features/marker/utils/src/ soc2013/mikema/gluster_port/xlators/features/marker/utils/src/.deps/ soc2013/mikema/gluster_port/xlators/features/marker/utils/src/.deps/gsyncd.Po soc2013/mikema/gluster_port/xlators/features/marker/utils/src/.deps/procdiggy.Po soc2013/mikema/gluster_port/xlators/features/marker/utils/src/Makefile soc2013/mikema/gluster_port/xlators/features/marker/utils/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/marker/utils/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/marker/utils/src/gsyncd.c soc2013/mikema/gluster_port/xlators/features/marker/utils/src/procdiggy.c soc2013/mikema/gluster_port/xlators/features/marker/utils/src/procdiggy.h soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/ soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/Makefile soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/Makefile.am soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/Makefile.in soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/README.md soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/__codecheck.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/__init__.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/configinterface.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/gconf.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/gsyncd.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/libcxattr.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/master.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/monitor.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/repce.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/resource.py soc2013/mikema/gluster_port/xlators/features/marker/utils/syncdaemon/syncdutils.py soc2013/mikema/gluster_port/xlators/features/path-convertor/ soc2013/mikema/gluster_port/xlators/features/path-convertor/Makefile.am soc2013/mikema/gluster_port/xlators/features/path-convertor/src/ soc2013/mikema/gluster_port/xlators/features/path-convertor/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/path-convertor/src/path-mem-types.h soc2013/mikema/gluster_port/xlators/features/path-convertor/src/path.c soc2013/mikema/gluster_port/xlators/features/protect/ soc2013/mikema/gluster_port/xlators/features/protect/Makefile.am soc2013/mikema/gluster_port/xlators/features/protect/Makefile.in soc2013/mikema/gluster_port/xlators/features/protect/src/ soc2013/mikema/gluster_port/xlators/features/protect/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/protect/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/protect/src/prot_client.c soc2013/mikema/gluster_port/xlators/features/protect/src/prot_dht.c soc2013/mikema/gluster_port/xlators/features/protect/src/prot_server.c soc2013/mikema/gluster_port/xlators/features/quiesce/ soc2013/mikema/gluster_port/xlators/features/quiesce/Makefile.am soc2013/mikema/gluster_port/xlators/features/quiesce/Makefile.in soc2013/mikema/gluster_port/xlators/features/quiesce/src/ soc2013/mikema/gluster_port/xlators/features/quiesce/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/quiesce/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/quiesce/src/quiesce-mem-types.h soc2013/mikema/gluster_port/xlators/features/quiesce/src/quiesce.c soc2013/mikema/gluster_port/xlators/features/quiesce/src/quiesce.h soc2013/mikema/gluster_port/xlators/features/quota/ soc2013/mikema/gluster_port/xlators/features/quota/Makefile.am soc2013/mikema/gluster_port/xlators/features/quota/Makefile.in soc2013/mikema/gluster_port/xlators/features/quota/src/ soc2013/mikema/gluster_port/xlators/features/quota/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/quota/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/quota/src/quota-mem-types.h soc2013/mikema/gluster_port/xlators/features/quota/src/quota.c soc2013/mikema/gluster_port/xlators/features/quota/src/quota.h soc2013/mikema/gluster_port/xlators/features/read-only/ soc2013/mikema/gluster_port/xlators/features/read-only/Makefile.am soc2013/mikema/gluster_port/xlators/features/read-only/Makefile.in soc2013/mikema/gluster_port/xlators/features/read-only/src/ soc2013/mikema/gluster_port/xlators/features/read-only/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/read-only/src/Makefile.in soc2013/mikema/gluster_port/xlators/features/read-only/src/read-only-common.c soc2013/mikema/gluster_port/xlators/features/read-only/src/read-only-common.h soc2013/mikema/gluster_port/xlators/features/read-only/src/read-only.c soc2013/mikema/gluster_port/xlators/features/read-only/src/worm.c soc2013/mikema/gluster_port/xlators/features/trash/ soc2013/mikema/gluster_port/xlators/features/trash/Makefile.am soc2013/mikema/gluster_port/xlators/features/trash/src/ soc2013/mikema/gluster_port/xlators/features/trash/src/Makefile.am soc2013/mikema/gluster_port/xlators/features/trash/src/trash-mem-types.h soc2013/mikema/gluster_port/xlators/features/trash/src/trash.c soc2013/mikema/gluster_port/xlators/features/trash/src/trash.h soc2013/mikema/gluster_port/xlators/lib/ soc2013/mikema/gluster_port/xlators/lib/src/ soc2013/mikema/gluster_port/xlators/lib/src/libxlator.c soc2013/mikema/gluster_port/xlators/lib/src/libxlator.h soc2013/mikema/gluster_port/xlators/meta/ soc2013/mikema/gluster_port/xlators/meta/Makefile.am soc2013/mikema/gluster_port/xlators/meta/src/ soc2013/mikema/gluster_port/xlators/meta/src/Makefile.am soc2013/mikema/gluster_port/xlators/meta/src/meta-mem-types.h soc2013/mikema/gluster_port/xlators/meta/src/meta.c soc2013/mikema/gluster_port/xlators/meta/src/meta.h soc2013/mikema/gluster_port/xlators/meta/src/misc.c soc2013/mikema/gluster_port/xlators/meta/src/misc.h soc2013/mikema/gluster_port/xlators/meta/src/tree.c soc2013/mikema/gluster_port/xlators/meta/src/tree.h soc2013/mikema/gluster_port/xlators/meta/src/view.c soc2013/mikema/gluster_port/xlators/meta/src/view.h soc2013/mikema/gluster_port/xlators/mgmt/ soc2013/mikema/gluster_port/xlators/mgmt/Makefile.am soc2013/mikema/gluster_port/xlators/mgmt/Makefile.in soc2013/mikema/gluster_port/xlators/mgmt/glusterd/ soc2013/mikema/gluster_port/xlators/mgmt/glusterd/Makefile.am soc2013/mikema/gluster_port/xlators/mgmt/glusterd/Makefile.in soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/ soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/Makefile.am soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/Makefile.in soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-brick-ops.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-geo-rep.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-handler.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-handshake.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-hooks.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-hooks.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-log-ops.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-mem-types.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-mountbroker.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-mountbroker.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-op-sm.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-op-sm.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-pmap.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-pmap.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-quota.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-rebalance.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-replace-brick.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-sm.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-sm.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-store.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-store.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-syncop.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-syncop.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-utils.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-utils.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-volgen.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-volgen.h soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-volume-ops.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd-volume-set.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd.c soc2013/mikema/gluster_port/xlators/mgmt/glusterd/src/glusterd.h soc2013/mikema/gluster_port/xlators/mount/ soc2013/mikema/gluster_port/xlators/mount/Makefile.am soc2013/mikema/gluster_port/xlators/mount/Makefile.in soc2013/mikema/gluster_port/xlators/mount/fuse/ soc2013/mikema/gluster_port/xlators/mount/fuse/Makefile.am soc2013/mikema/gluster_port/xlators/mount/fuse/Makefile.in soc2013/mikema/gluster_port/xlators/mount/fuse/src/ soc2013/mikema/gluster_port/xlators/mount/fuse/src/Makefile.am soc2013/mikema/gluster_port/xlators/mount/fuse/src/Makefile.in soc2013/mikema/gluster_port/xlators/mount/fuse/src/fuse-bridge.c soc2013/mikema/gluster_port/xlators/mount/fuse/src/fuse-bridge.h soc2013/mikema/gluster_port/xlators/mount/fuse/src/fuse-helpers.c soc2013/mikema/gluster_port/xlators/mount/fuse/src/fuse-mem-types.h soc2013/mikema/gluster_port/xlators/mount/fuse/src/fuse-resolve.c soc2013/mikema/gluster_port/xlators/mount/fuse/src/glfs-fuse-bridge.h soc2013/mikema/gluster_port/xlators/mount/fuse/utils/ soc2013/mikema/gluster_port/xlators/mount/fuse/utils/Makefile.am soc2013/mikema/gluster_port/xlators/mount/fuse/utils/Makefile.in soc2013/mikema/gluster_port/xlators/mount/fuse/utils/mount.glusterfs.in (contents, props changed) soc2013/mikema/gluster_port/xlators/mount/fuse/utils/mount_glusterfs.in (contents, props changed) soc2013/mikema/gluster_port/xlators/nfs/ soc2013/mikema/gluster_port/xlators/nfs/Makefile.am soc2013/mikema/gluster_port/xlators/nfs/Makefile.in soc2013/mikema/gluster_port/xlators/nfs/server/ soc2013/mikema/gluster_port/xlators/nfs/server/Makefile.am soc2013/mikema/gluster_port/xlators/nfs/server/Makefile.in soc2013/mikema/gluster_port/xlators/nfs/server/src/ soc2013/mikema/gluster_port/xlators/nfs/server/src/Makefile.am soc2013/mikema/gluster_port/xlators/nfs/server/src/Makefile.in soc2013/mikema/gluster_port/xlators/nfs/server/src/acl3.c soc2013/mikema/gluster_port/xlators/nfs/server/src/acl3.h soc2013/mikema/gluster_port/xlators/nfs/server/src/mount3.c soc2013/mikema/gluster_port/xlators/nfs/server/src/mount3.h soc2013/mikema/gluster_port/xlators/nfs/server/src/mount3udp_svc.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-common.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-common.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-fops.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-fops.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-generics.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-generics.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-inodes.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-inodes.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs-mem-types.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3-fh.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3-fh.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3-helpers.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3-helpers.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nfs3.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nlm4.c soc2013/mikema/gluster_port/xlators/nfs/server/src/nlm4.h soc2013/mikema/gluster_port/xlators/nfs/server/src/nlmcbk_svc.c soc2013/mikema/gluster_port/xlators/performance/ soc2013/mikema/gluster_port/xlators/performance/Makefile.am soc2013/mikema/gluster_port/xlators/performance/Makefile.in soc2013/mikema/gluster_port/xlators/performance/io-cache/ soc2013/mikema/gluster_port/xlators/performance/io-cache/Makefile.am soc2013/mikema/gluster_port/xlators/performance/io-cache/Makefile.in soc2013/mikema/gluster_port/xlators/performance/io-cache/src/ soc2013/mikema/gluster_port/xlators/performance/io-cache/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/io-cache/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/io-cache/src/io-cache.c soc2013/mikema/gluster_port/xlators/performance/io-cache/src/io-cache.h soc2013/mikema/gluster_port/xlators/performance/io-cache/src/ioc-inode.c soc2013/mikema/gluster_port/xlators/performance/io-cache/src/ioc-mem-types.h soc2013/mikema/gluster_port/xlators/performance/io-cache/src/page.c soc2013/mikema/gluster_port/xlators/performance/io-threads/ soc2013/mikema/gluster_port/xlators/performance/io-threads/Makefile.am soc2013/mikema/gluster_port/xlators/performance/io-threads/Makefile.in soc2013/mikema/gluster_port/xlators/performance/io-threads/src/ soc2013/mikema/gluster_port/xlators/performance/io-threads/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/io-threads/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/io-threads/src/io-threads.c soc2013/mikema/gluster_port/xlators/performance/io-threads/src/io-threads.h soc2013/mikema/gluster_port/xlators/performance/io-threads/src/iot-mem-types.h soc2013/mikema/gluster_port/xlators/performance/md-cache/ soc2013/mikema/gluster_port/xlators/performance/md-cache/Makefile.am soc2013/mikema/gluster_port/xlators/performance/md-cache/Makefile.in soc2013/mikema/gluster_port/xlators/performance/md-cache/src/ soc2013/mikema/gluster_port/xlators/performance/md-cache/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/md-cache/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/md-cache/src/md-cache-mem-types.h soc2013/mikema/gluster_port/xlators/performance/md-cache/src/md-cache.c soc2013/mikema/gluster_port/xlators/performance/open-behind/ soc2013/mikema/gluster_port/xlators/performance/open-behind/Makefile.am soc2013/mikema/gluster_port/xlators/performance/open-behind/Makefile.in soc2013/mikema/gluster_port/xlators/performance/open-behind/src/ soc2013/mikema/gluster_port/xlators/performance/open-behind/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/open-behind/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/open-behind/src/open-behind-mem-types.h soc2013/mikema/gluster_port/xlators/performance/open-behind/src/open-behind.c soc2013/mikema/gluster_port/xlators/performance/quick-read/ soc2013/mikema/gluster_port/xlators/performance/quick-read/Makefile.am soc2013/mikema/gluster_port/xlators/performance/quick-read/Makefile.in soc2013/mikema/gluster_port/xlators/performance/quick-read/src/ soc2013/mikema/gluster_port/xlators/performance/quick-read/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/quick-read/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/quick-read/src/quick-read-mem-types.h soc2013/mikema/gluster_port/xlators/performance/quick-read/src/quick-read.c soc2013/mikema/gluster_port/xlators/performance/quick-read/src/quick-read.h soc2013/mikema/gluster_port/xlators/performance/read-ahead/ soc2013/mikema/gluster_port/xlators/performance/read-ahead/Makefile.am soc2013/mikema/gluster_port/xlators/performance/read-ahead/Makefile.in soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/ soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/page.c soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/read-ahead-mem-types.h soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/read-ahead.c soc2013/mikema/gluster_port/xlators/performance/read-ahead/src/read-ahead.h soc2013/mikema/gluster_port/xlators/performance/symlink-cache/ soc2013/mikema/gluster_port/xlators/performance/symlink-cache/Makefile.am soc2013/mikema/gluster_port/xlators/performance/symlink-cache/Makefile.in soc2013/mikema/gluster_port/xlators/performance/symlink-cache/src/ soc2013/mikema/gluster_port/xlators/performance/symlink-cache/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/symlink-cache/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/symlink-cache/src/symlink-cache.c soc2013/mikema/gluster_port/xlators/performance/write-behind/ soc2013/mikema/gluster_port/xlators/performance/write-behind/Makefile.am soc2013/mikema/gluster_port/xlators/performance/write-behind/Makefile.in soc2013/mikema/gluster_port/xlators/performance/write-behind/src/ soc2013/mikema/gluster_port/xlators/performance/write-behind/src/Makefile.am soc2013/mikema/gluster_port/xlators/performance/write-behind/src/Makefile.in soc2013/mikema/gluster_port/xlators/performance/write-behind/src/write-behind-mem-types.h soc2013/mikema/gluster_port/xlators/performance/write-behind/src/write-behind.c soc2013/mikema/gluster_port/xlators/playground/ soc2013/mikema/gluster_port/xlators/playground/Makefile.am soc2013/mikema/gluster_port/xlators/playground/Makefile.in soc2013/mikema/gluster_port/xlators/playground/template/ soc2013/mikema/gluster_port/xlators/playground/template/Makefile.am soc2013/mikema/gluster_port/xlators/playground/template/Makefile.in soc2013/mikema/gluster_port/xlators/playground/template/src/ soc2013/mikema/gluster_port/xlators/playground/template/src/Makefile.am soc2013/mikema/gluster_port/xlators/playground/template/src/Makefile.in soc2013/mikema/gluster_port/xlators/playground/template/src/template.c soc2013/mikema/gluster_port/xlators/playground/template/src/template.h soc2013/mikema/gluster_port/xlators/protocol/ soc2013/mikema/gluster_port/xlators/protocol/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/ soc2013/mikema/gluster_port/xlators/protocol/auth/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/auth/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/addr/ soc2013/mikema/gluster_port/xlators/protocol/auth/addr/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/auth/addr/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/addr/src/ soc2013/mikema/gluster_port/xlators/protocol/auth/addr/src/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/auth/addr/src/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/addr/src/addr.c soc2013/mikema/gluster_port/xlators/protocol/auth/login/ soc2013/mikema/gluster_port/xlators/protocol/auth/login/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/auth/login/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/login/src/ soc2013/mikema/gluster_port/xlators/protocol/auth/login/src/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/auth/login/src/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/auth/login/src/login.c soc2013/mikema/gluster_port/xlators/protocol/client/ soc2013/mikema/gluster_port/xlators/protocol/client/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/client/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/client/src/ soc2013/mikema/gluster_port/xlators/protocol/client/src/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/client/src/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/client/src/client-callback.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client-handshake.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client-helpers.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client-lk.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client-mem-types.h soc2013/mikema/gluster_port/xlators/protocol/client/src/client-rpc-fops.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client.c soc2013/mikema/gluster_port/xlators/protocol/client/src/client.h soc2013/mikema/gluster_port/xlators/protocol/server/ soc2013/mikema/gluster_port/xlators/protocol/server/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/server/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/server/src/ soc2013/mikema/gluster_port/xlators/protocol/server/src/Makefile.am soc2013/mikema/gluster_port/xlators/protocol/server/src/Makefile.in soc2013/mikema/gluster_port/xlators/protocol/server/src/authenticate.c soc2013/mikema/gluster_port/xlators/protocol/server/src/authenticate.h soc2013/mikema/gluster_port/xlators/protocol/server/src/server-handshake.c soc2013/mikema/gluster_port/xlators/protocol/server/src/server-helpers.c soc2013/mikema/gluster_port/xlators/protocol/server/src/server-helpers.h soc2013/mikema/gluster_port/xlators/protocol/server/src/server-mem-types.h soc2013/mikema/gluster_port/xlators/protocol/server/src/server-resolve.c soc2013/mikema/gluster_port/xlators/protocol/server/src/server-rpc-fops.c soc2013/mikema/gluster_port/xlators/protocol/server/src/server.c soc2013/mikema/gluster_port/xlators/protocol/server/src/server.h soc2013/mikema/gluster_port/xlators/storage/ soc2013/mikema/gluster_port/xlators/storage/Makefile.am soc2013/mikema/gluster_port/xlators/storage/Makefile.in soc2013/mikema/gluster_port/xlators/storage/bd_map/ soc2013/mikema/gluster_port/xlators/storage/bd_map/Makefile.am soc2013/mikema/gluster_port/xlators/storage/bd_map/Makefile.in soc2013/mikema/gluster_port/xlators/storage/bd_map/src/ soc2013/mikema/gluster_port/xlators/storage/bd_map/src/Makefile.am soc2013/mikema/gluster_port/xlators/storage/bd_map/src/Makefile.in soc2013/mikema/gluster_port/xlators/storage/bd_map/src/bd_map.c soc2013/mikema/gluster_port/xlators/storage/bd_map/src/bd_map.h soc2013/mikema/gluster_port/xlators/storage/bd_map/src/bd_map_help.c soc2013/mikema/gluster_port/xlators/storage/bd_map/src/bd_map_help.h soc2013/mikema/gluster_port/xlators/storage/posix/ soc2013/mikema/gluster_port/xlators/storage/posix/Makefile.am soc2013/mikema/gluster_port/xlators/storage/posix/Makefile.in soc2013/mikema/gluster_port/xlators/storage/posix/src/ soc2013/mikema/gluster_port/xlators/storage/posix/src/Makefile.am soc2013/mikema/gluster_port/xlators/storage/posix/src/Makefile.in soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-aio.c soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-aio.h soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-handle.c soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-handle.h soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-helpers.c soc2013/mikema/gluster_port/xlators/storage/posix/src/posix-mem-types.h soc2013/mikema/gluster_port/xlators/storage/posix/src/posix.c soc2013/mikema/gluster_port/xlators/storage/posix/src/posix.h soc2013/mikema/gluster_port/xlators/system/ soc2013/mikema/gluster_port/xlators/system/Makefile.am soc2013/mikema/gluster_port/xlators/system/Makefile.in soc2013/mikema/gluster_port/xlators/system/posix-acl/ soc2013/mikema/gluster_port/xlators/system/posix-acl/Makefile.am soc2013/mikema/gluster_port/xlators/system/posix-acl/Makefile.in soc2013/mikema/gluster_port/xlators/system/posix-acl/src/ soc2013/mikema/gluster_port/xlators/system/posix-acl/src/Makefile.am soc2013/mikema/gluster_port/xlators/system/posix-acl/src/Makefile.in soc2013/mikema/gluster_port/xlators/system/posix-acl/src/posix-acl-xattr.c soc2013/mikema/gluster_port/xlators/system/posix-acl/src/posix-acl-xattr.h soc2013/mikema/gluster_port/xlators/system/posix-acl/src/posix-acl.c soc2013/mikema/gluster_port/xlators/system/posix-acl/src/posix-acl.h Added: soc2013/mikema/gluster_port/AUTHORS ============================================================================== Added: soc2013/mikema/gluster_port/CONTRIBUTING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/CONTRIBUTING Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,25 @@ + Developer's Certificate of Origin 1.1 + + By making a contribution to this project, I certify that: + + (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + + (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + + (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + + (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. Added: soc2013/mikema/gluster_port/COPYING-GPLV2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/COPYING-GPLV2 Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: soc2013/mikema/gluster_port/COPYING-LGPLV3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/COPYING-LGPLV3 Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: soc2013/mikema/gluster_port/ChangeLog ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/ChangeLog Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1 @@ +ChangeLog is maintained by "git log". Added: soc2013/mikema/gluster_port/INSTALL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/INSTALL Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,32 @@ +Installation Instructions +************************* + +Run ./configure after untaring the package. + + bash# ./configure + GlusterFS configure summary + =========================== + FUSE client : yes + Infiniband verbs : yes + epoll IO multiplex : yes + Berkeley-DB : yes + libglusterfsclient : yes + mod_glusterfs : yes + argp-standalone : no + +The configure summary will tell you what all components will be built with +GlusterFS. Other than 'argp-standalone' if something else says 'no', that +feature in GlusterFS will not be built. 'argp-standalone' package will only +be used if the system doesn't have a proper argp package installed. + +Now just run 'make' and later run 'make install' to install the package. + + bash# make + bash# make install + +Installation complete :-) + + bash# glusterfs --version + +Make sure your version is the latest from the release, and the one you +just installed :-) Added: soc2013/mikema/gluster_port/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/Makefile.am Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,26 @@ +EXTRA_DIST = autogen.sh \ + COPYING-GPLV2 COPYING-LGPLV3 \ + INSTALL README AUTHORS THANKS NEWS \ + glusterfs.spec glusterfs-api.pc.in \ + error-codes.json gf-error-codes.h.template \ + gen-headers.py + +SUBDIRS = argp-standalone libglusterfs rpc api xlators glusterfsd \ + $(FUSERMOUNT_SUBDIR) doc extras cli + +pkgconfigdir = @pkgconfigdir@ +pkgconfig_DATA = glusterfs-api.pc + +CLEANFILES = + +gitclean: distclean + find . -name Makefile.in -exec rm -f {} \; + find . -name Makefile -exec rm -f {} \; + find . -name mount.glusterfs -exec rm -f {} \; + rm -fr autom4te.cache + rm -f missing aclocal.m4 config.h.in config.guess config.sub ltmain.sh install-sh configure depcomp + rm -fr argp-standalone/autom4te.cache + rm -f argp-standalone/aclocal.m4 argp-standalone/config.h.in argp-standalone/configure argp-standalone/depcomp argp-standalone/install-sh argp-standalone/missing + +dist-hook: + (cd $(srcdir) && git diff && echo ===== git log ==== && git log) > $(distdir)/ChangeLog Added: soc2013/mikema/gluster_port/Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/mikema/gluster_port/Makefile.in Mon Sep 23 16:56:52 2013 (r257653) @@ -0,0 +1,924 @@ +# Makefile.in generated by automake 1.12.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/glusterfs-api.pc.in $(srcdir)/glusterfs.spec.in \ + $(top_srcdir)/configure \ + $(top_srcdir)/contrib/uuid/uuid_types.h.in AUTHORS ChangeLog \ + INSTALL NEWS THANKS config.guess config.sub depcomp install-sh \ + ltmain.sh missing py-compile +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/contrib/aclocal/mkdirp.m4 \ + $(top_srcdir)/contrib/aclocal/python.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = contrib/uuid/uuid_types.h glusterfs-api.pc \ + glusterfs.spec +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_LIBTOOLFLAGS = @AM_LIBTOOLFLAGS@ +AM_MAKEFLAGS = @AM_MAKEFLAGS@ +AR = @AR@ +ARGP_STANDALONE_CPPFLAGS = @ARGP_STANDALONE_CPPFLAGS@ +ARGP_STANDALONE_LDADD = @ARGP_STANDALONE_LDADD@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_PYTHON_INC = @BUILD_PYTHON_INC@ +BUILD_PYTHON_LIB = @BUILD_PYTHON_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONTRIBDIR = @CONTRIBDIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DTRACE = @DTRACE@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FUSERMOUNT_SUBDIR = @FUSERMOUNT_SUBDIR@ +FUSE_CLIENT_SUBDIR = @FUSE_CLIENT_SUBDIR@ +GF_CFLAGS = @GF_CFLAGS@ +GF_CPPFLAGS = @GF_CPPFLAGS@ +GF_DISTRIBUTION = @GF_DISTRIBUTION@ +GF_FUSE_CFLAGS = @GF_FUSE_CFLAGS@ +GF_FUSE_LDADD = @GF_FUSE_LDADD@ +GF_GLUSTERFS_CFLAGS = @GF_GLUSTERFS_CFLAGS@ +GF_GLUSTERFS_LIBS = @GF_GLUSTERFS_LIBS@ +GF_HOST_OS = @GF_HOST_OS@ +GF_LDADD = @GF_LDADD@ +GF_LDFLAGS = @GF_LDFLAGS@ +GLUPY_SUBDIR = @GLUPY_SUBDIR@ +GLUPY_SUBDIR_MAKEFILE = @GLUPY_SUBDIR_MAKEFILE@ +GLUPY_SUBDIR_SRC_MAKEFILE = @GLUPY_SUBDIR_SRC_MAKEFILE@ +GREP = @GREP@ +HAVE_BACKTRACE = @HAVE_BACKTRACE@ +HAVE_LINKAT = @HAVE_LINKAT@ +HAVE_MALLOC_STATS = @HAVE_MALLOC_STATS@ +HAVE_SPINLOCK = @HAVE_SPINLOCK@ +HAVE_STRNLEN = @HAVE_STRNLEN@ +IBVERBS_SUBDIR = @IBVERBS_SUBDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBAIO = @LIBAIO@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OCF_SUBDIR = @OCF_SUBDIR@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RDMA_SUBDIR = @RDMA_SUBDIR@ +RLLIBS = @RLLIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIZEOF_INT = @SIZEOF_INT@ +SIZEOF_LONG = @SIZEOF_LONG@ +SIZEOF_LONG_LONG = @SIZEOF_LONG_LONG@ +SIZEOF_SHORT = @SIZEOF_SHORT@ +STRIP = @STRIP@ +SYNCDAEMON_COMPILE = @SYNCDAEMON_COMPILE@ +SYNCDAEMON_SUBDIR = @SYNCDAEMON_SUBDIR@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +initdir = @initdir@ +install_sh = @install_sh@ +launchddir = @launchddir@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +mountutildir = @mountutildir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfigdir = @pkgconfigdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +systemddir = @systemddir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = autogen.sh \ + COPYING-GPLV2 COPYING-LGPLV3 \ + INSTALL README AUTHORS THANKS NEWS \ + glusterfs.spec glusterfs-api.pc.in \ + error-codes.json gf-error-codes.h.template \ + gen-headers.py + +SUBDIRS = argp-standalone libglusterfs rpc api xlators glusterfsd \ + $(FUSERMOUNT_SUBDIR) doc extras cli + +pkgconfig_DATA = glusterfs-api.pc +CLEANFILES = +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 17:22:42 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id ECB21BAF for ; Mon, 23 Sep 2013 17:22:42 +0000 (UTC) (envelope-from dpl@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8C752C31 for ; Mon, 23 Sep 2013 17:22:42 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NHMgLh035496 for ; Mon, 23 Sep 2013 17:22:42 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NHMgtF035489 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 17:22:42 GMT (envelope-from dpl@FreeBSD.org) Date: Mon, 23 Sep 2013 17:22:42 GMT Message-Id: <201309231722.r8NHMgtF035489@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257655 - soc2013/dpl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 17:22:43 -0000 Author: dpl Date: Mon Sep 23 17:22:42 2013 New Revision: 257655 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257655 Log: Added partial benchmarking suite. Will rewrite it for xz soon. Added: soc2013/dpl/testbzip2.sh Deleted: soc2013/dpl/caller.c Added: soc2013/dpl/testbzip2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/dpl/testbzip2.sh Mon Sep 23 17:22:42 2013 (r257655) @@ -0,0 +1,48 @@ +#!/bin/sh + +# Create the files that we'll be using. +makefiles () +{ + for i in $* + do + dd if=/dev/random of=$i bs=1024 count=$i 2>&- + done +} + +# Operate with std bzip2. +bzip () +{ + for i in $* + do + time -h bzip2 $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> cbzip2time + done + for i in $* + do + time -h bzip2 -d `echo ${i}.bz2` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> dbzip2time + done +} + +# Operate with Capsicum bzip2. +cbzip () +{ + for i in $* + do + time -h ./bzip2 $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> ccbzip2time + done + for i in $* + do + time -h ./bzip2 -d `echo ${i}.bz2` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> dcbzip2time + done +} + + +rm *time +rm 1* +makefiles 1 10 100 1000 10000 +bzip 1 10 100 1000 10000 +rm *bz2 +cbzip 1 10 100 1000 10000 + + +ministat -s cbzip2time ccbzip2time +ministat -s dbzip2time dcbzip2time From owner-svn-soc-all@FreeBSD.ORG Mon Sep 23 18:31:20 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D0C3A2B1 for ; Mon, 23 Sep 2013 18:31:20 +0000 (UTC) (envelope-from syuu@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC83A2094 for ; Mon, 23 Sep 2013 18:31:20 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8NIVKeX069079 for ; Mon, 23 Sep 2013 18:31:20 GMT (envelope-from syuu@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8NIVK1D069073 for svn-soc-all@FreeBSD.org; Mon, 23 Sep 2013 18:31:20 GMT (envelope-from syuu@FreeBSD.org) Date: Mon, 23 Sep 2013 18:31:20 GMT Message-Id: <201309231831.r8NIVK1D069073@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to syuu@FreeBSD.org using -f From: syuu@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257657 - in soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb: . gpl include/hw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 18:31:21 -0000 Author: syuu Date: Mon Sep 23 18:31:20 2013 New Revision: 257657 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257657 Log: move timer func to core.c, host device handling fix Added: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/combined-packet.c Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/core.c soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/host-libusb.c soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/include/hw/usb.h Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/core.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/core.c Mon Sep 23 17:35:23 2013 (r257656) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/core.c Mon Sep 23 18:31:20 2013 (r257657) @@ -869,3 +869,61 @@ return NULL; } + +static void timer_handler(union sigval sigv) +{ + Timer *timer = (Timer *)sigv.sigval_ptr; + timer->func(timer->arg); +} + +Timer *new_timer(timer_func_t func, void *arg) +{ + Timer *timer = (Timer *)calloc(1, sizeof(*timer)); + if (!timer) { + perror("calloc"); + exit(1); + } + timer->se.sigev_notify = SIGEV_THREAD; + timer->se.sigev_value.sigval_ptr = (Timer *)timer; + timer->se.sigev_notify_function = timer_handler; + timer->func = func; + timer->arg = arg; + if (timer_create(CLOCK_MONOTONIC, &timer->se, &timer->timerid)) { + perror("timer_create"); + exit(1); + } + return timer; +} + +void mod_timer(Timer *timer, int64_t ns) +{ + struct itimerspec its; + + memset(&its, 0, sizeof(its)); + its.it_value = ns_to_timerspec(ns); + timer_settime(timer->timerid, 0, &its, 0); +} + +void del_timer(Timer *timer) +{ + struct itimerspec its; + + memset(&its, 0, sizeof(its)); + timer_settime(timer->timerid, 0, &its, 0); +} + +int64_t get_clock_ns(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) { + perror("clock_gettime"); + exit(1); + } + return timespec_to_ns(&ts); +} + +int64_t get_ticks_per_sec(void) +{ + return (1000000000L); +} + Added: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/combined-packet.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/gpl/combined-packet.c Mon Sep 23 18:31:20 2013 (r257657) @@ -0,0 +1,187 @@ +/* + * QEMU USB packet combining code (for input pipelining) + * + * Copyright(c) 2012 Red Hat, Inc. + * + * Red Hat Authors: + * Hans de Goede + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or(at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#include +#include +#include "hw/usb.h" +#include "usb/gpl/iov.h" +#include "trace.h" + +static void usb_combined_packet_add(USBCombinedPacket *combined, USBPacket *p) +{ + qemu_iovec_concat(&combined->iov, &p->iov, 0, p->iov.size); + QTAILQ_INSERT_TAIL(&combined->packets, p, combined_entry); + p->combined = combined; +} + +/* Note will free combined when the last packet gets removed */ +static void usb_combined_packet_remove(USBCombinedPacket *combined, + USBPacket *p) +{ + assert(p->combined == combined); + p->combined = NULL; + QTAILQ_REMOVE(&combined->packets, p, combined_entry); + if (QTAILQ_EMPTY(&combined->packets)) { + free(combined); + } +} + +/* Also handles completion of non combined packets for pipelined input eps */ +void usb_combined_input_packet_complete(USBDevice *dev, USBPacket *p) +{ + USBCombinedPacket *combined = p->combined; + USBEndpoint *ep = p->ep; + USBPacket *next; + int status, actual_length; + bool short_not_ok, done = false; + + if (combined == NULL) { + usb_packet_complete_one(dev, p); + goto leave; + } + + assert(combined->first == p && p == QTAILQ_FIRST(&combined->packets)); + + status = combined->first->status; + actual_length = combined->first->actual_length; + short_not_ok = QTAILQ_LAST(&combined->packets, packets_head)->short_not_ok; + + QTAILQ_FOREACH_SAFE(p, &combined->packets, combined_entry, next) { + if (!done) { + /* Distribute data over uncombined packets */ + if (actual_length >= p->iov.size) { + p->actual_length = p->iov.size; + } else { + /* Send short or error packet to complete the transfer */ + p->actual_length = actual_length; + done = true; + } + /* Report status on the last packet */ + if (done || next == NULL) { + p->status = status; + } else { + p->status = USB_RET_SUCCESS; + } + p->short_not_ok = short_not_ok; + /* Note will free combined when the last packet gets removed! */ + usb_combined_packet_remove(combined, p); + usb_packet_complete_one(dev, p); + actual_length -= p->actual_length; + } else { + /* Remove any leftover packets from the queue */ + p->status = USB_RET_REMOVE_FROM_QUEUE; + /* Note will free combined on the last packet! */ + dev->port->ops->complete(dev->port, p); + } + } + /* Do not use combined here, it has been freed! */ +leave: + /* Check if there are packets in the queue waiting for our completion */ + usb_ep_combine_input_packets(ep); +} + +/* May only be called for combined packets! */ +void usb_combined_packet_cancel(USBDevice *dev, USBPacket *p) +{ + USBCombinedPacket *combined = p->combined; + assert(combined != NULL); + USBPacket *first = p->combined->first; + + /* Note will free combined on the last packet! */ + usb_combined_packet_remove(combined, p); + if (p == first) { + usb_device_cancel_packet(dev, p); + } +} + +/* + * Large input transfers can get split into multiple input packets, this + * function recombines them, removing the short_not_ok checks which all but + * the last packet of such splits transfers have, thereby allowing input + * transfer pipelining (which we cannot do on short_not_ok transfers) + */ +void usb_ep_combine_input_packets(USBEndpoint *ep) +{ + USBPacket *p, *u, *next, *prev = NULL, *first = NULL; + USBPort *port = ep->dev->port; + int totalsize; + + assert(ep->pipeline); + assert(ep->pid == USB_TOKEN_IN); + + QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) { + /* Empty the queue on a halt */ + if (ep->halted) { + p->status = USB_RET_REMOVE_FROM_QUEUE; + port->ops->complete(port, p); + continue; + } + + /* Skip packets already submitted to the device */ + if (p->state == USB_PACKET_ASYNC) { + prev = p; + continue; + } + usb_packet_check_state(p, USB_PACKET_QUEUED); + + /* + * If the previous (combined) packet has the short_not_ok flag set + * stop, as we must not submit packets to the device after a transfer + * ending with short_not_ok packet. + */ + if (prev && prev->short_not_ok) { + break; + } + + if (first) { + if (first->combined == NULL) { + USBCombinedPacket *combined = calloc(1, sizeof(USBCombinedPacket)); + + combined->first = first; + QTAILQ_INIT(&combined->packets); + qemu_iovec_init(&combined->iov, 2); + usb_combined_packet_add(combined, first); + } + usb_combined_packet_add(first->combined, p); + } else { + first = p; + } + + /* Is this packet the last one of a (combined) transfer? */ + totalsize = (p->combined) ? p->combined->iov.size : p->iov.size; + if ((p->iov.size % ep->max_packet_size) != 0 || !p->short_not_ok || + next == NULL || + /* Work around for Linux usbfs bulk splitting + migration */ + (totalsize == 16348 && p->int_req)) { + usb_device_handle_data(ep->dev, first); + assert(first->status == USB_RET_ASYNC); + if (first->combined) { + QTAILQ_FOREACH(u, &first->combined->packets, combined_entry) { + usb_packet_set_state(u, USB_PACKET_ASYNC); + } + } else { + usb_packet_set_state(first, USB_PACKET_ASYNC); + } + first = NULL; + prev = p; + } + } +} Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c Mon Sep 23 17:35:23 2013 (r257656) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/hcd-uhci.c Mon Sep 23 18:31:20 2013 (r257657) @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include "pci_emul.h" @@ -180,14 +178,6 @@ uint16_t ctrl; } UHCIPort; -typedef void(*timer_func_t)(void*); -typedef struct Timer { - timer_t timerid; - struct sigevent se; - timer_func_t func; - void *arg; -} Timer; - struct UHCIState { // PCIDevice dev; // MemoryRegion io_bar; @@ -249,8 +239,6 @@ static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td); static void uhci_process_frame(UHCIState *s); -#define SECINNS (1000000000L) - static int pci_dma_read(struct pci_uhci_softc *sc, uintptr_t addr, void *buf, size_t len) { void *haddr; @@ -280,82 +268,6 @@ return 0; } - -static int64_t timespec_to_ns(struct timespec *ts) -{ - return ((int64_t)(ts->tv_sec * SECINNS) + ts->tv_nsec); -} - -static struct timespec ns_to_timerspec(int64_t ns) -{ - struct timespec ts; - ts.tv_sec = ns / SECINNS; - ts.tv_nsec = ns % SECINNS; -// fprintf(usblog, "%s:%d tv_sec:%lu tv_nsec:%lu\n", -// __func__, __LINE__, ts.tv_sec, ts.tv_nsec); - return ts; -} - -static int64_t get_clock_ns(void) -{ - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts)) { - perror("clock_gettime"); - exit(1); - } - return timespec_to_ns(&ts); -} - -static int64_t get_ticks_per_sec(void) -{ - return (1000000000L); -} - -void timer_handler(union sigval sigv) -{ - Timer *timer = (Timer *)sigv.sigval_ptr; - timer->func(timer->arg); -} - -static Timer *new_timer(timer_func_t func, void *arg) -{ - Timer *timer = (Timer *)calloc(1, sizeof(*timer)); - if (!timer) { - perror("calloc"); - exit(1); - } - timer->se.sigev_notify = SIGEV_THREAD; - timer->se.sigev_value.sigval_ptr = (Timer *)timer; - timer->se.sigev_notify_function = timer_handler; - timer->func = func; - timer->arg = arg; -// fprintf(usblog, "%s:%d timer:%p\n", __func__, __LINE__, timer); - if (timer_create(CLOCK_MONOTONIC, &timer->se, &timer->timerid)) { - perror("timer_create"); - exit(1); - } - return timer; -} - -static void mod_timer(Timer *timer, int64_t ns) -{ - struct itimerspec its; - -// fprintf(usblog, "%s:%d timer:%p ns:%ld\n", __func__, __LINE__, timer, ns); - memset(&its, 0, sizeof(its)); - its.it_value = ns_to_timerspec(ns); - timer_settime(timer->timerid, 0, &its, 0); -} - -static void del_timer(Timer *timer) -{ - struct itimerspec its; - - memset(&its, 0, sizeof(its)); - timer_settime(timer->timerid, 0, &its, 0); -// fprintf(usblog, "%s:%d timer:%p\n", __func__, __LINE__, timer); -} - static inline int32_t uhci_queue_token(UHCI_TD *td) { if ((td->token & (0xf << 15)) == 0) { @@ -1702,6 +1614,8 @@ extern void usb_serial_class_initfn(USBDeviceClass *uc, void *data); extern USBDevice *usb_hub_init(USBBus *bus); void usb_hub_class_initfn(USBDeviceClass *uc, void *data); +extern USBDevice *usb_host_init2(USBBus *bus); +void usb_host_class_initfn(USBDeviceClass *uc, void *data); static int pci_uhci_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { @@ -1772,12 +1686,17 @@ usb_hub_class_initfn(&dev->klass, NULL); usb_qdev_init(dev); } -#endif { USBDevice *dev = usb_serial_init(&sc->sc_st.bus); usb_serial_class_initfn(&dev->klass, NULL); usb_qdev_init(dev); } +#endif + { + USBDevice *dev = usb_host_init2(&sc->sc_st.bus); + usb_host_class_initfn(&dev->klass, NULL); + usb_qdev_init(dev); + } return (0); } Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/host-libusb.c ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/host-libusb.c Mon Sep 23 17:35:23 2013 (r257656) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/host-libusb.c Mon Sep 23 18:31:20 2013 (r257657) @@ -37,6 +37,7 @@ #include #include #include +#include //#include "qemu-common.h" //#include "monitor/monitor.h" @@ -48,10 +49,6 @@ /* ------------------------------------------------------------------------ */ #define TYPE_USB_HOST_DEVICE "usb-host" -#if 0 -#define USB_HOST_DEVICE(obj) \ - OBJECT_CHECK(USBHostDevice, (obj), TYPE_USB_HOST_DEVICE) -#endif #define USB_HOST_DEVICE(obj) ((struct USBHostDevice *)obj) typedef struct USBHostDevice USBHostDevice; @@ -100,14 +97,18 @@ bool claimed; } ifs[USB_MAX_INTERFACES]; +#if 0 /* callbacks & friends */ -// QEMUBH *bh_nodev; -// QEMUBH *bh_postld; -// Notifier exit; + QEMUBH *bh_nodev; + QEMUBH *bh_postld; + Notifier exit; +#endif /* request queues */ QTAILQ_HEAD(, USBHostRequest) requests; QTAILQ_HEAD(, USBHostIsoRing) isorings; + + pthread_t poll_tid; }; struct USBHostRequest { @@ -152,7 +153,6 @@ #define BULK_TIMEOUT 0 /* unlimited */ #define INTR_TIMEOUT 0 /* unlimited */ -#if 0 static const char *speed_name[] = { [LIBUSB_SPEED_UNKNOWN] = "?", [LIBUSB_SPEED_LOW] = "1.5", @@ -160,7 +160,6 @@ [LIBUSB_SPEED_HIGH] = "480", [LIBUSB_SPEED_SUPER] = "5000", }; -#endif static const unsigned int speed_map[] = { [LIBUSB_SPEED_LOW] = USB_SPEED_LOW, @@ -197,6 +196,8 @@ static libusb_context *ctx; static uint32_t loglevel; +static struct pollfd fds[1024]; +static int fds_idx = 0; static void usb_host_handle_fd(void *opaque) { @@ -206,19 +207,36 @@ static void usb_host_add_fd(int fd, short events, void *user_data) { -/* - qemu_set_fd_handler(fd, - (events & POLLIN) ? usb_host_handle_fd : NULL, - (events & POLLOUT) ? usb_host_handle_fd : NULL, - ctx); -*/ + fds[fds_idx].fd = fd; + fds[fds_idx].events = events; + fds_idx++; } static void usb_host_del_fd(int fd, void *user_data) { -/* - qemu_set_fd_handler(fd, NULL, NULL, NULL); -*/ + int i, j = 0; + struct pollfd temp[1024]; + + memset(temp, 0, sizeof(temp)); + for (i = 0; i < fds_idx; i++) { + if (fds[i].fd == fd) + continue; + temp[j] = fds[i]; + j++; + } + memcpy(fds, temp, sizeof(fds)); + fds_idx--; +} + +static void * +usb_host_poll_thread(void *param) +{ + struct USBHostDevice *s = (USBHostDevice *)param; + while (s->dh) { + poll(fds, fds_idx - 1, -1); + usb_host_handle_fd(NULL); + } + return NULL; } static int usb_host_init(void) @@ -439,8 +457,8 @@ QTAILQ_REMOVE(&xfer->ring->inflight, xfer, next); if (QTAILQ_EMPTY(&xfer->ring->inflight)) { -// USBHostDevice *s = xfer->ring->host; -// trace_usb_host_iso_stop(s->bus_num, s->addr, xfer->ring->ep->nr); + USBHostDevice *s = xfer->ring->host; + trace_usb_host_iso_stop(s->bus_num, s->addr, xfer->ring->ep->nr); } if (xfer->ring->ep->pid == USB_TOKEN_IN) { QTAILQ_INSERT_TAIL(&xfer->ring->copy, xfer, next); @@ -722,14 +740,12 @@ static void usb_host_ep_update(USBHostDevice *s) { -#if 0 static const char *tname[] = { [USB_ENDPOINT_XFER_CONTROL] = "control", [USB_ENDPOINT_XFER_ISOC] = "isoc", [USB_ENDPOINT_XFER_BULK] = "bulk", [USB_ENDPOINT_XFER_INT] = "int", }; -#endif USBDevice *udev = USB_DEVICE(s); struct libusb_config_descriptor *conf; const struct libusb_interface_descriptor *intf; @@ -771,9 +787,9 @@ return; } -// trace_usb_host_parse_endpoint(s->bus_num, s->addr, ep, -// (devep & USB_DIR_IN) ? "in" : "out", -// tname[type], true); + trace_usb_host_parse_endpoint(s->bus_num, s->addr, ep, + (devep & USB_DIR_IN) ? "in" : "out", + tname[type], true); usb_ep_set_max_packet_size(udev, pid, ep, endp->wMaxPacketSize); usb_ep_set_type(udev, pid, ep, type); @@ -831,6 +847,8 @@ goto fail; } + pthread_create(&s->poll_tid, NULL, usb_host_poll_thread, (void *)s); + trace_usb_host_open_success(bus_num, addr); return 0; @@ -895,6 +913,7 @@ } qemu_bh_schedule(s->bh_nodev); */ + usb_host_nodev_bh(s); } /* @@ -909,7 +928,7 @@ } */ -static int usb_host_initfn(USBDevice *udev) +int usb_host_initfn(USBDevice *udev) { USBHostDevice *s = USB_HOST_DEVICE(udev); @@ -1321,14 +1340,15 @@ static int usb_host_post_load(void *opaque, int version_id) { -/* USBHostDevice *dev = opaque; +/* if (!dev->bh_postld) { dev->bh_postld = qemu_bh_new(usb_host_post_load_bh, dev); } qemu_bh_schedule(dev->bh_postld); */ + usb_host_post_load_bh(dev); return 0; } @@ -1359,12 +1379,10 @@ USB_HOST_OPT_PIPELINE, true), DEFINE_PROP_END_OF_LIST(), }; +#endif -static void usb_host_class_initfn(ObjectClass *klass, void *data) +void usb_host_class_initfn(USBDeviceClass *uc, void *data) { - DeviceClass *dc = DEVICE_CLASS(klass); - USBDeviceClass *uc = USB_DEVICE_CLASS(klass); - uc->init = usb_host_initfn; uc->product_desc = "USB Host Device"; uc->cancel_packet = usb_host_cancel_packet; @@ -1373,10 +1391,13 @@ uc->handle_reset = usb_host_handle_reset; uc->handle_destroy = usb_host_handle_destroy; uc->flush_ep_queue = usb_host_flush_ep_queue; +#if 0 dc->vmsd = &vmstate_usb_host; dc->props = usb_host_dev_properties; +#endif } +#if 0 static TypeInfo usb_host_dev_info = { .name = TYPE_USB_HOST_DEVICE, .parent = TYPE_USB_DEVICE, @@ -1394,8 +1415,8 @@ /* ------------------------------------------------------------------------ */ +static Timer *usb_auto_timer = NULL; #if 0 -static QEMUTimer *usb_auto_timer; static VMChangeStateEntry *usb_vmstate; static void usb_host_vm_state(void *unused, int running, RunState state) @@ -1420,6 +1441,7 @@ } // if (runstate_is_running()) { + { n = libusb_get_device_list(ctx, &devs); for (i = 0; i < n; i++) { if (libusb_get_device_descriptor(devs[i], &ddesc) != 0) { @@ -1468,7 +1490,7 @@ } break; } -// } + } libusb_free_device_list(devs, 1); QTAILQ_FOREACH(s, &hostdevs, next) { @@ -1484,35 +1506,32 @@ s->seen = 0; } -#if 0 if (unconnected == 0) { /* nothing to watch */ if (usb_auto_timer) { - qemu_del_timer(usb_auto_timer); + del_timer(usb_auto_timer); trace_usb_host_auto_scan_disabled(); } return; } -#endif } #if 0 if (!usb_vmstate) { usb_vmstate = qemu_add_vm_change_state_handler(usb_host_vm_state, NULL); } +#endif if (!usb_auto_timer) { - usb_auto_timer = qemu_new_timer_ms(rt_clock, usb_host_auto_check, NULL); + usb_auto_timer = new_timer(usb_host_auto_check, NULL); if (!usb_auto_timer) { return; } trace_usb_host_auto_scan_enabled(); } - qemu_mod_timer(usb_auto_timer, qemu_get_clock_ms(rt_clock) + 2000); -#endif + mod_timer(usb_auto_timer, 2000); } -#if 0 -void usb_host_info(Monitor *mon, const QDict *qdict) +void usb_host_info(void) { libusb_device **devs; struct libusb_device_descriptor ddesc; @@ -1532,13 +1551,13 @@ continue; } usb_host_get_port(devs[i], port, sizeof(port)); - monitor_printf(mon, " Bus %d, Addr %d, Port %s, Speed %s Mb/s\n", + fprintf(usblog, " Bus %d, Addr %d, Port %s, Speed %s Mb/s\n", libusb_get_bus_number(devs[i]), libusb_get_device_address(devs[i]), port, speed_name[libusb_get_device_speed(devs[i])]); - monitor_printf(mon, " Class %02x:", ddesc.bDeviceClass); - monitor_printf(mon, " USB device %04x:%04x", + fprintf(usblog, " Class %02x:", ddesc.bDeviceClass); + fprintf(usblog, " USB device %04x:%04x", ddesc.idVendor, ddesc.idProduct); if (ddesc.iProduct) { libusb_device_handle *handle; @@ -1548,11 +1567,35 @@ ddesc.iProduct, name, sizeof(name)); libusb_close(handle); - monitor_printf(mon, ", %s", name); + fprintf(usblog, ", %s", name); } } - monitor_printf(mon, "\n"); + fprintf(usblog, "\n"); } libusb_free_device_list(devs, 1); } -#endif + +USBDevice *usb_host_init2(USBBus *bus) +{ + USBDevice *dev; + USBHostDevice *s; + char label[32]; + static int index; + + snprintf(label, sizeof(label), "usbhost%d", index++); + + dev = usb_create(bus, "usb-host", sizeof(USBHostDevice)); + if (!dev) { + return NULL; + } + s = (USBHostDevice *)dev; + s->iso_urb_count = 4; + s->iso_urb_frames = 32; + s->bootindex = -1; + s->match.vendor_id = 0x17ef; + s->match.product_id = 0x6009; + memset(fds, 0, sizeof(fds)); + usb_host_info(); + + return dev; +} Modified: soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/include/hw/usb.h ============================================================================== --- soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/include/hw/usb.h Mon Sep 23 17:35:23 2013 (r257656) +++ soc2013/syuu/bhyve_usb/usr.sbin/bhyve/usb/include/hw/usb.h Mon Sep 23 18:31:20 2013 (r257657) @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include "qemu/queue.h" #define container_of(p, stype, field) ((stype *)(((uint8_t *)(p)) - offsetof(stype, field))) @@ -619,6 +621,35 @@ void qemu_iovec_init(IOVector *qiov, int alloc_hint); void qemu_iovec_reset(IOVector *qiov); void qemu_iovec_add(IOVector *qiov, void *base, size_t len); +void qemu_iovec_concat(IOVector *dst, + IOVector *src, size_t soffset, size_t sbytes); void qemu_iovec_destroy(IOVector *qiov); +#define SECINNS (1000000000L) + +static inline int64_t timespec_to_ns(struct timespec *ts) +{ + return ((int64_t)(ts->tv_sec * SECINNS) + ts->tv_nsec); +} + +static inline struct timespec ns_to_timerspec(int64_t ns) +{ + struct timespec ts; + ts.tv_sec = ns / SECINNS; + ts.tv_nsec = ns % SECINNS; + return ts; +} + +typedef void(*timer_func_t)(void*); +typedef struct Timer { + timer_t timerid; + struct sigevent se; + timer_func_t func; + void *arg; +} Timer; +Timer *new_timer(timer_func_t func, void *arg); +void mod_timer(Timer *timer, int64_t ns); +void del_timer(Timer *timer); +int64_t get_clock_ns(void); +int64_t get_ticks_per_sec(void); #endif From owner-svn-soc-all@FreeBSD.ORG Tue Sep 24 15:11:58 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 831DAA96 for ; Tue, 24 Sep 2013 15:11:58 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 557D423B8 for ; Tue, 24 Sep 2013 15:11:58 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8OFBwqq027949 for ; Tue, 24 Sep 2013 15:11:58 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8OFBwOs027932 for svn-soc-all@FreeBSD.org; Tue, 24 Sep 2013 15:11:58 GMT (envelope-from zcore@FreeBSD.org) Date: Tue, 24 Sep 2013 15:11:58 GMT Message-Id: <201309241511.r8OFBwOs027932@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257691 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Sep 2013 15:11:58 -0000 Author: zcore Date: Tue Sep 24 15:11:58 2013 New Revision: 257691 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257691 Log: code cleanup w/o any functionaly change rename some functions/vars, unify coding style and reduce LoCs Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Tue Sep 24 14:52:43 2013 (r257690) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Tue Sep 24 15:11:58 2013 (r257691) @@ -107,7 +107,7 @@ struct ahci_ioreq { struct blockif_req io_req; - struct ahci_port *io_pr; + struct ahci_port *io_port; STAILQ_ENTRY(ahci_ioreq) io_list; uint8_t *cfis; uint32_t len; @@ -118,7 +118,7 @@ struct ahci_port { struct blockif_ctxt *bctx; - struct pci_ahci_softc *pr_sc; + struct pci_ahci_softc *psc; uint64_t cmd_lst; uint64_t rfis; int atapi; @@ -187,7 +187,8 @@ }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) -static inline void lba_to_msf(uint8_t *buf, int lba) +static inline void +lba2msf(uint8_t *buf, int lba) { lba += 150; buf[0] = (lba / 75) / 60; @@ -205,9 +206,9 @@ int i; for (i = 0; i < sc->ports; i++) { - struct ahci_port *pr; - pr = &sc->port[i]; - if (pr->is & pr->ie) + struct ahci_port *p; + p = &sc->port[i]; + if (p->is & p->ie) sc->is |= (1 << i); } @@ -216,8 +217,9 @@ pci_generate_msi(sc->asc_pi, 0); } -static void ahci_write_fis(struct ahci_port *p, enum sata_fis_type ft, - uint8_t *fis) +static void +ahci_send_fis(struct ahci_port *p, enum sata_fis_type ft, + uint8_t *fis) { int offset, len, irq; @@ -247,12 +249,13 @@ memcpy(p->rfis + offset, fis, len); if (irq) { p->is |= irq; - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); } } -static void ahci_write_fis_sdb(struct ahci_port *p, int slot, - uint32_t tfd) +static void +ahci_send_fis_sdb(struct ahci_port *p, int slot, + uint32_t tfd) { uint8_t fis[8]; uint8_t error; @@ -265,11 +268,12 @@ if (fis[2] & ATA_S_ERROR) p->is |= AHCI_P_IX_TFE; p->tfd = tfd; - ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); + ahci_send_fis(p, FIS_TYPE_SETDEVBITS, fis); } -static void ahci_write_fis_d2h(struct ahci_port *p, int slot, - uint8_t *cfis, uint32_t tfd) +static void +ahci_send_fis_d2h(struct ahci_port *p, int slot, + uint8_t *cfis, uint32_t tfd) { uint8_t fis[20]; uint8_t error; @@ -294,10 +298,11 @@ p->is |= AHCI_P_IX_TFE; p->tfd = tfd; p->ci &= ~(1 << slot); - ahci_write_fis(p, FIS_TYPE_REGD2H, fis); + ahci_send_fis(p, FIS_TYPE_REGD2H, fis); } -static void ahci_write_reset_fis_d2h(struct ahci_port *p) +static void +ahci_send_reset_fis_d2h(struct ahci_port *p) { uint8_t fis[20]; @@ -310,33 +315,33 @@ fis[6] = 0xeb; } fis[12] = 1; - ahci_write_fis(p, FIS_TYPE_REGD2H, fis); + ahci_send_fis(p, FIS_TYPE_REGD2H, fis); } static void -ahci_port_reset(struct ahci_port *pr) +ahci_port_reset(struct ahci_port *p) { - pr->sctl = 0; - pr->serr = 0; - pr->sact = 0; - pr->xfermode = ATA_UDMA6; - pr->mult_sectors = 128; + p->sctl = 0; + p->serr = 0; + p->sact = 0; + p->xfermode = ATA_UDMA6; + p->mult_sectors = 128; - if (!pr->bctx) { - pr->ssts = ATA_SS_DET_NO_DEVICE; - pr->sig = 0xFFFFFFFF; - pr->tfd = 0x7F; + if (!p->bctx) { + p->ssts = ATA_SS_DET_NO_DEVICE; + p->sig = 0xFFFFFFFF; + p->tfd = 0x7F; return; } - pr->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN2 | + p->ssts = ATA_SS_DET_PHY_ONLINE | ATA_SS_SPD_GEN2 | ATA_SS_IPM_ACTIVE; - pr->tfd = (1 << 8) | ATA_S_DSC | ATA_S_DMA; - if (!pr->atapi) { - pr->sig = PxSIG_ATA; - pr->tfd |= ATA_S_READY; + p->tfd = (1 << 8) | ATA_S_DSC | ATA_S_DMA; + if (!p->atapi) { + p->sig = PxSIG_ATA; + p->tfd |= ATA_S_READY; } else - pr->sig = PxSIG_ATAPI; - ahci_write_reset_fis_d2h(pr); + p->sig = PxSIG_ATAPI; + ahci_send_reset_fis_d2h(p); } static void @@ -388,7 +393,7 @@ uint32_t len; struct ahci_ioreq *aior; struct blockif_req *breq; - struct pci_ahci_softc *sc = p->pr_sc; + struct pci_ahci_softc *sc = p->psc; struct ahci_prdt_entry *prdt = (struct ahci_prdt_entry *)(cfis + 0x80); struct ahci_cmd_hdr *hdr = p->cmd_lst + slot * AHCI_CL_SIZE; @@ -505,7 +510,7 @@ from = buf; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); for (i = 0; i < hdr->prdtl && len; i++) { - uint8_t *ptr = paddr_guest2host(ahci_ctx(p->pr_sc), + uint8_t *ptr = paddr_guest2host(ahci_ctx(p->psc), prdt->dba, prdt->dbc + 1); memcpy(ptr, from, prdt->dbc + 1); len -= (prdt->dbc + 1); @@ -575,7 +580,7 @@ p->is |= AHCI_P_IX_DP; } p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); } static void @@ -617,7 +622,7 @@ p->is |= AHCI_P_IX_DHR; } p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); } static void @@ -644,7 +649,7 @@ len = acmd[4]; cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; write_prdt(p, slot, cfis, buf, len); - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); } static void @@ -659,7 +664,7 @@ be32enc(buf + 4, 2048); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; write_prdt(p, slot, cfis, buf, sizeof(buf)); - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); } static void @@ -685,49 +690,40 @@ p->asc = 0x24; tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); return; } + memset(buf, 0, sizeof(buf)); bp = buf + 2; *bp++ = 1; *bp++ = 1; if (start_track <= 1) { - *bp++ = 0; + bp++; *bp++ = 0x14; *bp++ = 1; - *bp++ = 0; - if (msf) { - *bp++ = 0; - lba_to_msf(bp, 0); - bp += 3; - } else { - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - } + bp++; + if (msf) + lba2msf(bp + 1, 0); + bp += 4; } - *bp++ = 0; + bp++; *bp++ = 0x14; *bp++ = 0xaa; - *bp++ = 0; + bp++; sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); sectors >>= 2; - if (msf) { - *bp++ = 0; - lba_to_msf(bp, sectors); - bp += 3; - } else { + if (msf) + lba2msf(bp + 1, sectors); + else be32enc(bp, sectors); - bp += 4; - } + bp += 4; size = bp - buf; be16enc(buf, size - 2); if (len > size) len = size; write_prdt(p, slot, cfis, buf, len); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; } case 1: @@ -742,88 +738,54 @@ len = sizeof(buf); write_prdt(p, slot, cfis, buf, len); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; } case 2: { int msf, size; uint64_t sectors; - uint8_t start_track, *bp, buf[50]; + uint8_t start_track, buf[48]; msf = (acmd[1] >> 1) & 1; start_track = acmd[6]; - bp = buf + 2; - *bp++ = 1; - *bp++ = 1; - - *bp++ = 1; - *bp++ = 0x14; - *bp++ = 0; - *bp++ = 0xa0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 1; - *bp++ = 0; - *bp++ = 0; - - *bp++ = 1; - *bp++ = 0x14; - *bp++ = 0; - *bp++ = 0xa1; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 1; - *bp++ = 0; - *bp++ = 0; + memset(buf, 0, sizeof(buf)); + buf[2] = 1; + buf[3] = 1; - *bp++ = 1; - *bp++ = 0x14; - *bp++ = 0; - *bp++ = 0xa2; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; + buf[4] = 1; + buf[5] = 0x14; + buf[7] = 0xa0; + buf[12] = 1; + + buf[15] = 1; + buf[16] = 0x14; + buf[18] = 0xa1; + buf[23] = 1; + + buf[26] = 1; + buf[27] = 0x14; + buf[29] = 0xa2; sectors = blockif_size(p->bctx) / blockif_sectsz(p->bctx); sectors >>= 2; - if (msf) { - *bp++ = 0; - lba_to_msf(bp, sectors); - bp += 3; - } else { - be32enc(bp, sectors); - bp += 4; - } + if (msf) + lba2msf(buf + 34, sectors); + else + be32enc(buf + 33, sectors); - *bp++ = 1; - *bp++ = 0x14; - *bp++ = 0; - *bp++ = 1; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - if (msf) { - *bp++ = 0; - lba_to_msf(bp, 0); - bp += 3; - } else { - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - *bp++ = 0; - } + buf[37] = 1; + buf[38] = 0x14; + buf[40] = 1; + if (msf) + lba2msf(buf + 45, 0); - size = bp - buf; + size = sizeof(buf); be16enc(buf, size - 2); if (len > size) len = size; write_prdt(p, slot, cfis, buf, len); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; } default: @@ -833,7 +795,7 @@ p->asc = 0x24; tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); break; } } @@ -849,7 +811,7 @@ struct ahci_ioreq *aior; struct blockif_req *breq; uint8_t *acmd = cfis + 0x40; - struct pci_ahci_softc *sc = p->pr_sc; + struct pci_ahci_softc *sc = p->psc; struct ahci_prdt_entry *prdt = (struct ahci_prdt_entry *)(cfis + 0x80); struct ahci_cmd_hdr *hdr = p->cmd_lst + slot * AHCI_CL_SIZE; @@ -861,7 +823,7 @@ len = be32dec(acmd + 6); if (len == 0) { cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); } lba *= 2048; len *= 2048; @@ -917,7 +879,7 @@ buf[12] = p->asc; write_prdt(p, slot, cfis, buf, len); cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); } static void @@ -941,7 +903,7 @@ tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR; break; } - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); } static void @@ -1013,7 +975,7 @@ break; } cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); } static void @@ -1045,7 +1007,7 @@ tfd = ATA_S_READY | ATA_S_DSC; } cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); } static void @@ -1064,7 +1026,7 @@ switch (acmd[0]) { case TEST_UNIT_READY: cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; case INQUIRY: atapi_inquiry(p, slot, cfis); @@ -1075,7 +1037,7 @@ case PREVENT_ALLOW: /* TODO */ cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; case READ_TOC: atapi_read_toc(p, slot, cfis); @@ -1100,7 +1062,7 @@ cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; p->sense_key = ATA_SENSE_ILLEGAL_REQUEST; p->asc = 0x20; - ahci_write_fis_d2h(p, slot, cfis, (p->sense_key << 12) | + ahci_send_fis_d2h(p, slot, cfis, (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR); break; } @@ -1143,7 +1105,7 @@ } p->is |= AHCI_P_IX_DP; p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); break; } case ATA_SET_MULTI: @@ -1157,7 +1119,7 @@ } p->is |= AHCI_P_IX_DP; p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); break; case ATA_READ_DMA: case ATA_WRITE_DMA: @@ -1177,7 +1139,7 @@ case ATA_STANDBY_IMMEDIATE: case ATA_IDLE_IMMEDIATE: case ATA_SLEEP: - ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + ahci_send_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); break; case ATA_ATAPI_IDENTIFY: handle_atapi_identify(p, slot, cfis); @@ -1187,7 +1149,7 @@ p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; p->is |= AHCI_P_IX_TFE; p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); } else handle_packet_cmd(p, slot, cfis); break; @@ -1196,7 +1158,7 @@ p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; p->is |= AHCI_P_IX_TFE; p->ci &= ~(1 << slot); - ahci_generate_intr(p->pr_sc); + ahci_generate_intr(p->psc); break; } } @@ -1210,7 +1172,7 @@ struct ahci_prdt_entry *prdt; struct pci_ahci_softc *sc; - sc = p->pr_sc; + sc = p->psc; hdr = p->cmd_lst + slot * AHCI_CL_SIZE; cfl = (hdr->flags & 0x1f) * 4; cfis = paddr_guest2host(ahci_ctx(sc), hdr->ctba, @@ -1280,11 +1242,11 @@ DPRINTF("%s %d\n", __func__, err); aior = br->br_param; - p = aior->io_pr; + p = aior->io_port; cfis = aior->cfis; slot = aior->slot; pending = aior->prdtl; - sc = p->pr_sc; + sc = p->psc; hdr = p->cmd_lst + slot * AHCI_CL_SIZE; if (cfis[2] == ATA_WRITE_FPDMA_QUEUED || cfis[2] == ATA_READ_FPDMA_QUEUED) @@ -1317,9 +1279,9 @@ if (ncq) { p->sact &= ~(1 << slot); - ahci_write_fis_sdb(p, slot, tfd); + ahci_send_fis_sdb(p, slot, tfd); } else - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); out: pthread_mutex_unlock(&sc->mtx); DPRINTF("%s exit\n", __func__); @@ -1339,11 +1301,11 @@ DPRINTF("%s %d\n", __func__, err); aior = br->br_param; - p = aior->io_pr; + p = aior->io_port; cfis = aior->cfis; slot = aior->slot; pending = aior->prdtl; - sc = p->pr_sc; + sc = p->psc; hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE; pthread_mutex_lock(&sc->mtx); @@ -1369,7 +1331,7 @@ } cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; - ahci_write_fis_d2h(p, slot, cfis, tfd); + ahci_send_fis_d2h(p, slot, cfis, tfd); out: pthread_mutex_unlock(&sc->mtx); @@ -1377,27 +1339,27 @@ } static void -pci_ahci_ioreq_init(struct ahci_port *pr) +pci_ahci_ioreq_init(struct ahci_port *p) { - struct ahci_ioreq *vr; + struct ahci_ioreq *aior; int i; - pr->ioqsz = blockif_queuesz(pr->bctx); - pr->ioreq = calloc(pr->ioqsz, sizeof(struct ahci_ioreq)); - STAILQ_INIT(&pr->iofhd); + p->ioqsz = blockif_queuesz(p->bctx); + p->ioreq = calloc(p->ioqsz, sizeof(struct ahci_ioreq)); + STAILQ_INIT(&p->iofhd); /* * Add all i/o request entries to the free queue */ - for (i = 0; i < pr->ioqsz; i++) { - vr = &pr->ioreq[i]; - vr->io_pr = pr; - if (!pr->atapi) - vr->io_req.br_callback = ata_ioreq_cb; + for (i = 0; i < p->ioqsz; i++) { + aior = &p->ioreq[i]; + aior->io_port = p; + if (!p->atapi) + aior->io_req.br_callback = ata_ioreq_cb; else - vr->io_req.br_callback = atapi_ioreq_cb; - vr->io_req.br_param = vr; - STAILQ_INSERT_TAIL(&pr->iofhd, vr, io_list); + aior->io_req.br_callback = atapi_ioreq_cb; + aior->io_req.br_param = aior; + STAILQ_INSERT_TAIL(&p->iofhd, aior, io_list); } } @@ -1455,7 +1417,7 @@ } sc->port[i].bctx = bctxt; - sc->port[i].pr_sc = sc; + sc->port[i].psc = sc; /* * Allocate blockif request structures and add them * to the free list From owner-svn-soc-all@FreeBSD.ORG Tue Sep 24 22:09:39 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 34F97A2E for ; Tue, 24 Sep 2013 22:09:39 +0000 (UTC) (envelope-from dpl@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08C272F93 for ; Tue, 24 Sep 2013 22:09:39 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8OM9c1O050482 for ; Tue, 24 Sep 2013 22:09:38 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8OM9cgA050466 for svn-soc-all@FreeBSD.org; Tue, 24 Sep 2013 22:09:38 GMT (envelope-from dpl@FreeBSD.org) Date: Tue, 24 Sep 2013 22:09:38 GMT Message-Id: <201309242209.r8OM9cgA050466@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257704 - soc2013/dpl/benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Sep 2013 22:09:39 -0000 Author: dpl Date: Tue Sep 24 22:09:38 2013 New Revision: 257704 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257704 Log: Updated the benchmarking suite. It now works well. Added: soc2013/dpl/benchmark/ soc2013/dpl/benchmark/testbzip2.sh (contents, props changed) soc2013/dpl/benchmark/testxz.sh (contents, props changed) Added: soc2013/dpl/benchmark/testbzip2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/dpl/benchmark/testbzip2.sh Tue Sep 24 22:09:38 2013 (r257704) @@ -0,0 +1,47 @@ +#!/bin/sh + +# Create the files that we'll be using. +createfiles () +{ + for i in $* + do + dd if=/dev/random of=$i bs=1024 count=$i 2>&- + done +} + +# Operate with std bzip2. +bzip () +{ + for i in $* + do + time -h bzip2 $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> compressbzip2time + done + for i in $* + do + time -h bzip2 -d `echo ${i}.bz2` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> decompressbzip2time + done +} + +# Operate with Capsicum bzip2. +cbzip () +{ + for i in $* + do + time -h ./bzip2 $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> compresscbzip2time + done + for i in $* + do + time -h ./bzip2 -d `echo ${i}.bz2` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> decompresscbzip2time + done +} + + +rm *time 1* +createfiles 1 10 100 1000 10000 +bzip 1 10 100 1000 10000 +cbzip 1 10 100 1000 10000 + + +ministat -s compressbzip2time compresscbzip2time +ministat -s decompressbzip2time decompresscbzip2time +rm *time 1* Added: soc2013/dpl/benchmark/testxz.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/dpl/benchmark/testxz.sh Tue Sep 24 22:09:38 2013 (r257704) @@ -0,0 +1,46 @@ +#!/bin/sh + +# Create the files that we'll be using. +createfiles () +{ + for i in $* + do + dd if=/dev/random of=$i bs=1024 count=$i 2>&- + done +} + +# Operate with std bzip2. +xzcomp () +{ + for i in $* + do + time -h xz $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> compressxztime + done + for i in $* + do + time -h xz -d `echo ${i}.xz` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> decompressxztime + done +} + +# Operate with Capsicum bzip2. +cxzcomp () +{ + for i in $* + do + time -h ./xz $i 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> compresscxztime + done + for i in $* + do + time -h ./xz -d `echo ${i}.xz` 2>&1 | tr -d 's' |tr , . | awk '{ print $1 }' >> decompresscxztime + done +} + + +rm 1* *time +createfiles 1 10 100 1000 10000 +xzcomp 1 10 100 1000 10000 +cxzcomp 1 10 100 1000 10000 + +ministat -s compressxztime compresscxztime +ministat -s decompressxztime decompresscxztime +rm 1* *time From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 12:30:28 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B66A7360 for ; Thu, 26 Sep 2013 12:30:28 +0000 (UTC) (envelope-from ambarisha@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9599526BA for ; Thu, 26 Sep 2013 12:30:28 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QCUSgO068461 for ; Thu, 26 Sep 2013 12:30:28 GMT (envelope-from ambarisha@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QCUSQn068334 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 12:30:28 GMT (envelope-from ambarisha@FreeBSD.org) Date: Thu, 26 Sep 2013 12:30:28 GMT Message-Id: <201309261230.r8QCUSQn068334@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ambarisha@FreeBSD.org using -f From: ambarisha@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257719 - in soc2013/ambarisha/head/usr.bin: dmget dms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 12:30:28 -0000 Author: ambarisha Date: Thu Sep 26 12:30:28 2013 New Revision: 257719 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257719 Log: Fixed the compilation warnings in dms and dmget Added: soc2013/ambarisha/head/usr.bin/dmget/utils.h soc2013/ambarisha/head/usr.bin/dms/mirror.h soc2013/ambarisha/head/usr.bin/dms/utils.h Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c soc2013/ambarisha/head/usr.bin/dmget/dmget.h soc2013/ambarisha/head/usr.bin/dmget/fetch.c soc2013/ambarisha/head/usr.bin/dmget/utils.c soc2013/ambarisha/head/usr.bin/dms/dms.c soc2013/ambarisha/head/usr.bin/dms/mirror.c soc2013/ambarisha/head/usr.bin/dms/utils.c soc2013/ambarisha/head/usr.bin/dms/worker.c Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 12:30:28 2013 (r257719) @@ -8,10 +8,11 @@ #include #include #include - +#include #include "dm.h" #include "dmget.h" +#include "utils.h" dm_auth_t dmAuthMethod; stat_display_t dmStatDisplayMethod; @@ -222,12 +223,12 @@ } static int -send_signal(int sock) +send_signal(int sock, int sig) { struct dmmsg msg; msg.op = DMSIG; - msg.buf = &signal; - msg.len = sizeof(signal); + msg.buf = (char *)&sig; + msg.len = sizeof(sig); return (send_dmmsg(sock, msg)); } @@ -409,8 +410,13 @@ goto failure; } - if (sigint || siginfo) { - send_signal(sock); + if (sigint) { + send_signal(sock, SIGINT); + goto signal; + } + + if (siginfo) { + send_signal(sock, SIGINFO); goto signal; } Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/dmget.h Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dmget/dmget.h Thu Sep 26 12:30:28 2013 (r257719) @@ -17,7 +17,7 @@ char *scheme; char *host; char user[AUTH_USERLEN+1]; - char pwd[AUTH_PWDLEN+1] + char pwd[AUTH_PWDLEN+1]; }; extern int dmLastErrCode; Modified: soc2013/ambarisha/head/usr.bin/dmget/fetch.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 12:30:28 2013 (r257719) @@ -261,7 +261,7 @@ dmreq.B_size = B_size; dmreq.S_size = S_size; dmreq.URL = URL; - dmreq.path = path; + dmreq.path = (char *)path; dmreq.T_secs = T_secs; if (i_flag) dmreq.i_filename = i_filename; Modified: soc2013/ambarisha/head/usr.bin/dmget/utils.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/utils.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dmget/utils.c Thu Sep 26 12:30:28 2013 (r257719) @@ -1,13 +1,15 @@ -#include #include +#include +#include +#include #include +#include + #include "dm.h" /* Utils for handling messages */ -extern char *dm_errstr; - int send_dmmsg(int socket, struct dmmsg msg) { @@ -50,7 +52,7 @@ struct dmmsg *msg = (struct dmmsg *) malloc(sizeof(struct dmmsg)); if (msg == NULL) { fprintf(stderr, "send_dmmsg: malloc: insufficient memory\n"); - return -1; + return NULL; } err = read(sock, &bufsize, sizeof(bufsize)); @@ -68,7 +70,7 @@ err = read(sock, &(msg->op), sizeof(msg->op)); if (err == 0) { - fprintf(stderr,stderr, "recv_dmmsg: remote end" + fprintf(stderr, "recv_dmmsg: remote end" " closed connection\n"); goto error; } else if (err == -1) { @@ -89,7 +91,7 @@ err = read(sock, msg->buf, bufsize); if (err == 0) { msg->len = 0; - fprintf(stderr,stderr, "recv_dmmsg: remote end" + fprintf(stderr,"recv_dmmsg: remote end" " closed connection\n"); free(msg->buf); free(msg); Added: soc2013/ambarisha/head/usr.bin/dmget/utils.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/ambarisha/head/usr.bin/dmget/utils.h Thu Sep 26 12:30:28 2013 (r257719) @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +#include + +#include "dm.h" + +/* Utils for handling messages */ + +int +send_dmmsg(int socket, struct dmmsg msg); + +struct dmmsg * +recv_dmmsg(int sock); + +void +free_dmmsg(struct dmmsg **msg); Modified: soc2013/ambarisha/head/usr.bin/dms/dms.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 12:30:28 2013 (r257719) @@ -10,22 +10,25 @@ #include #include #include +#include #include "dm.h" #include "dms.h" +#include "utils.h" +#include "mirror.h" static int dm_err; static char dm_errstr[512]; int stop; - struct dmjob *jobs; pthread_mutex_t job_queue_mutex; extern struct dmmirr *mirrors; extern pthread_mutex_t mirror_list_mutex; -void *run_worker(struct dmjob *job); +extern void *run_worker(void *); +extern int send_report(int, struct dmrep); static int read_fd(int sock) @@ -349,97 +352,31 @@ static void run_event_loop(int socket) { - int i, ret, maxfd = socket; + int ret, csock; + struct sockaddr_un cliaddr; + size_t cliaddrlen; struct dmjob *cur; void *retptr; - fd_set fdset; jobs = NULL; job_queue_mutex = PTHREAD_MUTEX_INITIALIZER; + mirrors = NULL; mirror_list_mutex = PTHREAD_MUTEX_INITIALIZER; load_mirrors(); signal(SIGINT, sigint_handler); while (!stop) { - - /* Prepare fdset and make select call */ - FD_ZERO(&fdset); - maxfd = socket; - FD_SET(socket, &fdset); - - /* Acquire job queue lock */ - ret = pthread_mutex_lock(&job_queue_mutex); - if (ret == -1) { - fprintf(stderr, "handle_request: Attempt to acquire" - " job queue mutex failed\n"); - return -1; - } - - cur = jobs; - while (cur != NULL) { - FD_SET(cur->client, &fdset); - if (cur->client > maxfd) - maxfd = cur->client; - cur = cur->next; - } - - ret = pthread_mutex_unlock(&job_queue_mutex); - if (ret == -1) { - fprintf(stderr, "handle_request: Couldn't release " - "job queue lock\n"); - - return -1; - } - /* Job queue lock released */ - - ret = select(maxfd + 1, &fdset, NULL, NULL, NULL); - if (ret == -1) { + cliaddrlen = sizeof(cliaddr); + csock = accept(socket, (struct sockaddr *) &cliaddr, + &cliaddrlen); + if (csock == -1) { fprintf(stderr, "run_event_loop: " - "select: %s\n", strerror(errno)); + "select: %s\n", strerror(errno)); goto wrap_up; } - /* Acquire job queue lock */ - ret = pthread_mutex_lock(&job_queue_mutex); - if (ret == -1) { - fprintf(stderr, "handle_request: Attempt to acquire" - " job queue mutex failed\n"); - return -1; - } - - cur = jobs; - while (cur != NULL) { - ret = service_job(cur, &fdset); - if (ret > 0) { - close(cur->client); - jobs = rm_job(jobs, cur); - rm_dmjob(&cur); - } - cur = cur->next; - } - - ret = pthread_mutex_unlock(&job_queue_mutex); - if (ret == -1) { - fprintf(stderr, "handle_request: Couldn't release " - "job queue lock\n"); - - return -1; - } - /* Job queue lock released */ - - if (FD_ISSET(socket, &fdset)) { - struct sockaddr_un cliaddr; - size_t cliaddrlen = sizeof(cliaddr); - int csock = accept(socket, (struct sockaddr *) &cliaddr, - &cliaddrlen); - if (csock == -1) { - fprintf(stderr, "run_event_loop: " - "select: %s\n", strerror(errno)); - goto wrap_up; - } - handle_request(csock); - } + handle_request(csock); } wrap_up: @@ -449,7 +386,7 @@ if (ret == -1) { fprintf(stderr, "handle_request: Attempt to acquire" " job queue mutex failed\n"); - return -1; + return; } cur = jobs; @@ -467,7 +404,7 @@ fprintf(stderr, "handle_request: Couldn't release " "job queue lock\n"); - return -1; + return; } /* Job queue lock released */ Modified: soc2013/ambarisha/head/usr.bin/dms/mirror.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 12:30:28 2013 (r257719) @@ -1,15 +1,19 @@ +#include +#include +#include +#include + #include #include + #include "dm.h" #include "dms.h" +#include "mirror.h" #define MAX_SAMPLES 256 #define MAX_CONNS 5 #define MIRRORS_FILE "mirrors.list" -struct dmmirr *mirrors; -pthread_mutex_t mirror_list_mutex; - static const char *MIRROR_LIST[] = { "ftp.freebsd.org" }; Added: soc2013/ambarisha/head/usr.bin/dms/mirror.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/ambarisha/head/usr.bin/dms/mirror.h Thu Sep 26 12:30:28 2013 (r257719) @@ -0,0 +1,12 @@ +#ifndef _MIRROR_H_ +#define _MIRROR_H_ + +struct dmmirr *mirrors; +pthread_mutex_t mirror_list_mutex; + +int load_mirrors(void); +int save_mirrors(void); +void update_mirror(struct dmmirr *, struct xferstat *); +struct dmmirr *get_mirror(void); + +#endif Modified: soc2013/ambarisha/head/usr.bin/dms/utils.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/utils.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dms/utils.c Thu Sep 26 12:30:28 2013 (r257719) @@ -1,13 +1,15 @@ -#include #include +#include +#include +#include #include +#include + #include "dm.h" /* Utils for handling messages */ -extern char *dm_errstr; - int send_dmmsg(int socket, struct dmmsg msg) { @@ -50,7 +52,7 @@ struct dmmsg *msg = (struct dmmsg *) malloc(sizeof(struct dmmsg)); if (msg == NULL) { fprintf(stderr, "send_dmmsg: malloc: insufficient memory\n"); - return -1; + return NULL; } err = read(sock, &bufsize, sizeof(bufsize)); @@ -68,7 +70,7 @@ err = read(sock, &(msg->op), sizeof(msg->op)); if (err == 0) { - fprintf(stderr,stderr, "recv_dmmsg: remote end" + fprintf(stderr, "recv_dmmsg: remote end" " closed connection\n"); goto error; } else if (err == -1) { @@ -89,7 +91,7 @@ err = read(sock, msg->buf, bufsize); if (err == 0) { msg->len = 0; - fprintf(stderr,stderr, "recv_dmmsg: remote end" + fprintf(stderr,"recv_dmmsg: remote end" " closed connection\n"); free(msg->buf); free(msg); Added: soc2013/ambarisha/head/usr.bin/dms/utils.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/ambarisha/head/usr.bin/dms/utils.h Thu Sep 26 12:30:28 2013 (r257719) @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +#include + +#include "dm.h" + +/* Utils for handling messages */ + +int +send_dmmsg(int socket, struct dmmsg msg); + +struct dmmsg * +recv_dmmsg(int sock); + +void +free_dmmsg(struct dmmsg **msg); Modified: soc2013/ambarisha/head/usr.bin/dms/worker.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 10:33:15 2013 (r257718) +++ soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 12:30:28 2013 (r257719) @@ -1,7 +1,10 @@ #include #include +#include #include +#include +#include #include #include #include @@ -10,15 +13,16 @@ #include #include "dms.h" +#include "utils.h" #include "dm.h" +#include "mirror.h" +#define TMP_EXT ".tmp" static const char *prefixes = " kMGTP"; extern struct dmjob *jobs; extern pthread_mutex_t job_queue_mutex; -#define TMP_EXT ".tmp" - static int authenticate(struct url *url) { @@ -316,6 +320,50 @@ } static int +check_signal(int signum, struct dmjob *dmjob) +{ + struct timeval tv; + struct dmmsg *msg; + int *sig, ret; + fd_set fds; + + if (signum == SIGINT && dmjob->sigint != 0) + return 1; + if (signum == SIGINFO && dmjob->siginfo != 0) + return 1; + if (signum == SIGALRM && dmjob->sigalrm != 0) + return 1; + + do { + FD_ZERO(&fds); + FD_SET(dmjob->client, &fds); + + tv.tv_sec = 0; + tv.tv_usec = 0; + + ret = select(dmjob->client + 1, &fds, NULL, NULL, &tv); + msg = recv_dmmsg(dmjob->client); + sig = (int *)msg->buf; + if (*sig == SIGINT) + dmjob->sigint = 1; + else if (*sig == SIGINFO) + dmjob->siginfo = 1; + else if (*sig == SIGALRM) + dmjob->sigalrm = 1; + + } while (ret == 1); + + if (signum == SIGINT && dmjob->sigint != 0) + return dmjob->sigint; + if (signum == SIGINFO && dmjob->siginfo != 0) + return dmjob->siginfo; + if (signum == SIGALRM && dmjob->sigalrm != 0) + return dmjob->sigalrm; + + return 0; +} + +static int fetch(struct dmjob *dmjob, FILE *f, struct url_stat us) { struct stat sb, nsb; @@ -393,12 +441,9 @@ if (dmjob->timeout) alarm(dmjob->timeout); - if (dmjob->sigalrm || dmjob->sigint) + if (check_signal(SIGALRM, dmjob) || check_signal(SIGINT, dmjob)) goto signal; - if (dmjob->sigint) - goto signal; - /* check that size is as expected */ /*if (dmreq->S_size) { if (us.size == -1) { @@ -511,7 +556,7 @@ * from scratch if we want the whole file */ dmjob->url->offset = 0; - if (dmjob->sigint) + if (check_signal(SIGINT, dmjob)) goto signal; } @@ -555,13 +600,13 @@ /* suck in the data */ dmjob->siginfo_en = 1; - while (!dmjob->sigint) { + while (!check_signal(SIGINT, dmjob)) { if (us.size != -1 && us.size - count < dmreq->B_size && us.size - count >= 0) size = us.size - count; else size = dmreq->B_size; - if (dmjob->siginfo) { + if (check_signal(SIGINFO, dmjob)) { stat_end(&xs, dmjob); dmjob->siginfo = 0; } @@ -570,7 +615,7 @@ break; if ((readcnt = fread(buf, 1, size, f)) < size) { - if (ferror(f) && errno == EINTR && !dmjob->sigint) + if (ferror(f) && errno == EINTR && !check_signal(SIGINT, dmjob)) clearerr(f); else if (readcnt == 0) { break; @@ -581,7 +626,7 @@ stat_update(&xs, count += readcnt, dmjob); for (ptr = buf; readcnt > 0; ptr += wr, readcnt -= wr) if ((wr = fwrite(ptr, 1, readcnt, of)) < readcnt) { - if (ferror(of) && errno == EINTR && !dmjob->sigint) + if (ferror(of) && errno == EINTR && !check_signal(SIGINT, dmjob)) clearerr(of); else break; @@ -590,7 +635,7 @@ break; } - if (!dmjob->sigalrm) + if (!check_signal(SIGALRM, dmjob)) dmjob->sigalrm = ferror(f) && errno == ETIMEDOUT; dmjob->siginfo_en = 0; @@ -616,9 +661,9 @@ } /* timed out or interrupted? */ - if (dmjob->sigalrm) + if (check_signal(SIGALRM, dmjob)) warnx("transfer timed out"); - if (dmjob->sigint) { + if (check_signal(SIGINT, dmjob)) { warnx("transfer interrupted"); goto failure; } @@ -627,7 +672,7 @@ if (f == NULL) goto failure; - if (!dmjob->sigalrm) { + if (!check_signal(SIGALRM, dmjob)) { /* check the status of our files */ if (ferror(f)) warn("%s", dmreq->URL); @@ -648,7 +693,7 @@ * If the transfer timed out and we didn't know how much to * expect, assume the worst (i.e. we didn't get all of it) */ - if (dmjob->sigalrm && us.size == -1) { + if (check_signal(SIGALRM, dmjob) && us.size == -1) { warnx("%s may be truncated", dmreq->path); goto failure_keep; } @@ -829,36 +874,6 @@ return fetch(dmjob, f, us); } -/* TODO: This handler isn't registered as SIGUSR1 interrupts the download - * Figure out a proper way to handle this - * */ -void -sig_handler(int sig) -{ - struct dmjob *tmp = jobs; - struct dmmsg *msg; - int *clisig; - pthread_t tid = pthread_self(); - if (sig == SIGUSR1) { - /* TODO: Umm...Locking? */ - while (tmp != NULL) { - if (pthread_equal(tid, tmp->worker) != 0) - break; - tmp = tmp->next; - } - - msg = recv_dmmsg(tmp->client); - clisig = msg->buf; - if (*clisig == SIGINT) - tmp->sigint = 1; - else if (*clisig == SIGINFO) - tmp->siginfo = 1; - else if (*clisig == SIGALRM) { - tmp->sigalrm = 1; - } - } -} - int send_report(int sock, struct dmrep report) { @@ -908,7 +923,7 @@ if (ret == -1) { fprintf(stderr, "handle_request: Attempt to acquire" " job queue mutex failed\n"); - return -1; + return NULL; } tmp = jobs; @@ -926,7 +941,7 @@ fprintf(stderr, "handle_request: Couldn't release " "job queue lock\n"); - return -1; + return NULL; } /* Job queue lock released */ @@ -942,7 +957,7 @@ if (ret == -1) { fprintf(stderr, "handle_request: Attempt to acquire" " job queue mutex failed\n"); - return -1; + return NULL; } /* Serve any outstanding requests from the local tmp file */ @@ -972,8 +987,7 @@ if (ret == -1) { fprintf(stderr, "handle_request: Couldn't release " "job queue lock\n"); - - return -1; + return NULL; } /* Job queue lock released */ From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 12:32:13 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 56F683EF for ; Thu, 26 Sep 2013 12:32:13 +0000 (UTC) (envelope-from ambarisha@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 433A926D2 for ; Thu, 26 Sep 2013 12:32:13 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QCWD81061772 for ; Thu, 26 Sep 2013 12:32:13 GMT (envelope-from ambarisha@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QCWDW6061725 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 12:32:13 GMT (envelope-from ambarisha@FreeBSD.org) Date: Thu, 26 Sep 2013 12:32:13 GMT Message-Id: <201309261232.r8QCWDW6061725@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ambarisha@FreeBSD.org using -f From: ambarisha@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257720 - soc2013/ambarisha/head/usr.bin/dms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 12:32:13 -0000 Author: ambarisha Date: Thu Sep 26 12:32:12 2013 New Revision: 257720 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257720 Log: Job migration first changes Modified: soc2013/ambarisha/head/usr.bin/dms/dms.c soc2013/ambarisha/head/usr.bin/dms/dms.h soc2013/ambarisha/head/usr.bin/dms/mirror.c soc2013/ambarisha/head/usr.bin/dms/mirror.h soc2013/ambarisha/head/usr.bin/dms/worker.c Modified: soc2013/ambarisha/head/usr.bin/dms/dms.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 12:30:28 2013 (r257719) +++ soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 12:32:12 2013 (r257720) @@ -144,6 +144,7 @@ dmjob->siginfo = 0; dmjob->siginfo_en = 0; dmjob->state = RUNNING; + dmjob->preempted = 0; dmjob->url = NULL; return dmjob; } Modified: soc2013/ambarisha/head/usr.bin/dms/dms.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.h Thu Sep 26 12:30:28 2013 (r257719) +++ soc2013/ambarisha/head/usr.bin/dms/dms.h Thu Sep 26 12:32:12 2013 (r257720) @@ -7,6 +7,8 @@ #define MINBUFSIZE 4096 #define MAX_SAMPLES 256 +#include "dm.h" + struct dmjob { int ofd; int client; @@ -15,6 +17,7 @@ int siginfo; int siginfo_en; unsigned timeout; + int preempted; enum { RUNNING = 0, @@ -26,6 +29,7 @@ struct dmreq *request; struct url *url; struct dmmirr *mirror; + struct xferstat oldstat; struct dmjob *next; struct dmjob *prev; Modified: soc2013/ambarisha/head/usr.bin/dms/mirror.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 12:30:28 2013 (r257719) +++ soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 12:32:12 2013 (r257720) @@ -103,6 +103,7 @@ /* TODO: What if fscanf fails? */ } + mirror->nconns = 0; return mirror; } @@ -168,7 +169,7 @@ /* Profile list lock */ ret = pthread_mutex_lock(&mirror_list_mutex); if (ret == -1) { - fprintf(stderr, "get_mirror: Attempt to acquire" + fprintf(stderr, "load_mirrors: Attempt to acquire" " profile list mutex failed\n"); return -1; } @@ -181,7 +182,7 @@ ret = pthread_mutex_unlock(&mirror_list_mutex); if (ret == -1) { - fprintf(stderr, "get_mirror: Couldn't release " + fprintf(stderr, "load_mirrors: Couldn't release " "profile list lock\n"); return -1; } @@ -202,7 +203,7 @@ /* Profile list lock */ ret = pthread_mutex_lock(&mirror_list_mutex); if (ret == -1) { - fprintf(stderr, "get_mirror: Attempt to acquire" + fprintf(stderr, "save_mirrors: Attempt to acquire" " profile list mutex failed\n"); return -1; } @@ -214,7 +215,7 @@ ret = pthread_mutex_unlock(&mirror_list_mutex); if (ret == -1) { - fprintf(stderr, "get_mirror: Couldn't release " + fprintf(stderr, "save_mirrors: Couldn't release " "profile list lock\n"); return -1; } @@ -229,6 +230,7 @@ { struct timeval tv; double speed; + int ret; gettimeofday(&tv, NULL); if (tv.tv_sec - dmmirr->timestamps[dmmirr->index].tv_sec < 60) @@ -236,11 +238,54 @@ speed = get_speed(xs); + /* Profile list lock */ + ret = pthread_mutex_lock(&mirror_list_mutex); + if (ret == -1) { + fprintf(stderr, "update_mirror: Attempt to acquire" + " profile list mutex failed\n"); + return; + } + /* TODO: This assumes that workers and sites have 1-1 correspondence */ dmmirr->index = (dmmirr->index + 1) % MAX_SAMPLES; dmmirr->timestamps[dmmirr->index] = tv; dmmirr->samples[dmmirr->index] = speed; dmmirr->remark = ACTIVE; + + ret = pthread_mutex_unlock(&mirror_list_mutex); + if (ret == -1) { + fprintf(stderr, "update_mirror: Couldn't release " + "profile list lock\n"); + return; + } + /* Profile list lock released */ +} + +double +get_average_speed(struct dmmirr *dmmirr) +{ + int i, cnt; + double average; + struct timeval now; + long week_sec; + + week_sec = 7 * 24 * 60 * 60; + + i = dmmirr->index; + cnt = 0; + average = 0.0; + + do { + gettimeofday(&now, NULL); + if (dmmirr->timestamps[i].tv_sec < now.tv_sec - week_sec) + break; + average = (average * cnt + dmmirr->samples[i]) / (cnt + 1); + cnt++; + + i = (i - 1) % MAX_SAMPLES; + } while (i != dmmirr->index); + + return average; } struct dmmirr * @@ -249,12 +294,8 @@ struct dmmirr *cur, *tmp; double tmpmax = -1.0; int cnt, ret, i; - struct timeval now; - long week_sec; double average; - week_sec = 7 * 24 * 60 * 60; - /* Profile list lock */ ret = pthread_mutex_lock(&mirror_list_mutex); if (ret == -1) { @@ -277,19 +318,7 @@ if (cur->nconns > MAX_CONNS) goto next; - - i = cur->index; - cnt = 0; - average = 0.0; - do { - gettimeofday(&now, NULL); - if (cur->timestamps[i].tv_sec < now.tv_sec - week_sec) - break; - average = (average * cnt + cur->samples[i]) / (cnt + 1); - cnt++; - - i = (i - 1) % MAX_SAMPLES; - } while (i != cur->index); + average = get_average_speed(cur); if (average > tmpmax) { tmpmax = average; @@ -298,10 +327,10 @@ next: cur = cur->next; } - /* TODO: If we couldn't pick up a mirror? */ success: + tmp->nconns++; ret = pthread_mutex_unlock(&mirror_list_mutex); if (ret == -1) { fprintf(stderr, "get_mirror: Couldn't release " @@ -309,6 +338,32 @@ return NULL; } /* Profile list lock released */ - + return tmp; } + +int +release_mirror(struct dmmirr *dmmirr) +{ + int ret; + + /* Profile list lock */ + ret = pthread_mutex_lock(&mirror_list_mutex); + if (ret == -1) { + fprintf(stderr, "update_mirror: Attempt to acquire" + " profile list mutex failed\n"); + return -1; + } + + dmmirr->nconns--; + + ret = pthread_mutex_unlock(&mirror_list_mutex); + if (ret == -1) { + fprintf(stderr, "update_mirror: Couldn't release " + "profile list lock\n"); + return -1; + } + /* Profile list lock released */ + + return 0; +} Modified: soc2013/ambarisha/head/usr.bin/dms/mirror.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/mirror.h Thu Sep 26 12:30:28 2013 (r257719) +++ soc2013/ambarisha/head/usr.bin/dms/mirror.h Thu Sep 26 12:32:12 2013 (r257720) @@ -8,5 +8,7 @@ int save_mirrors(void); void update_mirror(struct dmmirr *, struct xferstat *); struct dmmirr *get_mirror(void); +int release_mirror(struct dmmirr *); +double get_average_speed(struct dmmirr *); #endif Modified: soc2013/ambarisha/head/usr.bin/dms/worker.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 12:30:28 2013 (r257719) +++ soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 12:32:12 2013 (r257720) @@ -92,6 +92,24 @@ return strcmp(j1->request->URL, j2->request->URL); } +static long +get_eta(struct dmjob *dmjob, struct dmmirr *dmmirr) +{ + long eta, elapsed, speed, received, expected; + if (dmmirr == dmjob->mirror) { + elapsed = dmjob->oldstat.last.tv_sec - dmjob->oldstat.start.tv_sec; + received = dmjob->oldstat.rcvd - dmjob->oldstat.offset; + expected = dmjob->oldstat.size - dmjob->oldstat.rcvd; + eta = (long)((double) elapsed * expected / received); + } else { + expected = dmjob->oldstat.size; + speed = get_average_speed(dmmirr); + eta = (long)((double) expected / speed); + } + + return eta; +} + static void stat_send(struct xferstat *xs, int force) { @@ -177,6 +195,15 @@ stat_start(struct xferstat *xs, const char *name, off_t size, off_t offset, struct dmjob *dmjob) { + /* If there is no absolute progress because of a premption, + * do nothing. Otherwise update status incase there's a + * preemption later + */ + + if (dmjob->preempted != 0 && + dmjob->oldstat.rcvd > xs->rcvd) + return; + snprintf(xs->name, sizeof xs->name, "%s", name); gettimeofday(&xs->start, NULL); xs->last.tv_sec = xs->last.tv_usec = 0; @@ -185,7 +212,8 @@ xs->rcvd = offset; xs->lastrcvd = offset; - update_mirror(dmjob->mirror , xs); + update_mirror(dmjob->mirror, xs); + dmjob->oldstat = *xs; if ((dmjob->request->flags & V_TTY) && dmjob->request->v_level > 0) stat_send(xs, 1); @@ -196,6 +224,16 @@ static void stat_end(struct xferstat *xs, struct dmjob *dmjob) { + /* If there is no absolute progress because of a premption, + * do nothing. Otherwise update status incase there's a + * preemption later + */ + + if (dmjob->preempted != 0 && + dmjob->oldstat.rcvd > xs->rcvd) + return; + dmjob->oldstat = *xs; + gettimeofday(&xs->last, NULL); update_mirror(dmjob->mirror , xs); if ((dmjob->request->flags & V_TTY) && dmjob->request->v_level > 0) { @@ -210,7 +248,18 @@ static void stat_update(struct xferstat *xs, off_t rcvd, struct dmjob *dmjob) { + /* If there is no absolute progress because of a premption, + * do nothing. Otherwise update status incase there's a + * preemption later + */ + + if (dmjob->preempted != 0 && + dmjob->oldstat.rcvd > xs->rcvd) + return; + xs->rcvd = rcvd; + dmjob->oldstat = *xs; + update_mirror(dmjob->mirror , xs); if ((dmjob->request->flags & V_TTY) && dmjob->request->v_level > 0) stat_send(xs, 0); @@ -231,6 +280,9 @@ struct dmreq *dmreq = dmjob->request; struct stat sb; int r; + + /* Init flags */ + *flags = '\0'; if (dmjob->url != NULL) return 0; @@ -319,6 +371,46 @@ return (r); } +static struct dmjob * +find_potential_job(struct dmmirr *dmmirr) +{ + int ret; + long cureta, neweta; + struct dmjob *tmp; + + /* Acquire job queue lock */ + ret = pthread_mutex_lock(&job_queue_mutex); + if (ret == -1) { + fprintf(stderr, "handle_request: Attempt to acquire" + " job queue mutex failed\n"); + return NULL; + } + + tmp = jobs; + while (tmp != NULL) { + cureta = get_eta(tmp, tmp->mirror); + neweta = get_eta(tmp, dmmirr); + + if (neweta < cureta) { + /* notify the current owner worker to let go */ + tmp->preempted = 1; + break; + } + + tmp = tmp->next; + } + + ret = pthread_mutex_unlock(&job_queue_mutex); + if (ret == -1) { + fprintf(stderr, "handle_request: Couldn't release " + "job queue lock\n"); + return NULL; + } + /* Job queue lock released */ + + return tmp; +} + static int check_signal(int signum, struct dmjob *dmjob) { @@ -926,6 +1018,7 @@ return NULL; } + /* check if this is a duplicate */ tmp = jobs; while (tmp != NULL) { if (tmp != dmjob && compare_jobs(tmp, dmjob) == 0) { @@ -940,12 +1033,11 @@ if (ret == -1) { fprintf(stderr, "handle_request: Couldn't release " "job queue lock\n"); - return NULL; } /* Job queue lock released */ - /* check if this is a duplicate */ +start: ret = mk_url(dmjob, flags); dmjob->worker = pthread_self(); @@ -968,11 +1060,10 @@ continue; } - if (f == NULL) { + if (f == NULL) ret = -1; - } else { + else ret = validate_and_copy(dmjob, f, us); - } report.status = ret; report.errcode = fetchLastErrCode; @@ -993,14 +1084,22 @@ /* remove the local tmp file */ if (f != NULL) { - tmppath = (char *) malloc(strlen(dmjob->request->path) + strlen(TMP_EXT)); + tmppath = (char *) malloc(strlen(dmjob->request->path) + + strlen(TMP_EXT)); strcpy(tmppath, dmjob->request->path); strcat(tmppath, TMP_EXT); remove(tmppath); free(tmppath); } + + + /* Check if this worker can prempt any downloads */ + dmjob = find_potential_job(dmjob->mirror); + if (dmjob != NULL) + goto start; + release_mirror(dmjob->mirror); /* TODO : What is this? Yew!! */ sleep(10); } From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 12:37:47 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A5AE9653 for ; Thu, 26 Sep 2013 12:37:47 +0000 (UTC) (envelope-from ambarisha@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 920EE2722 for ; Thu, 26 Sep 2013 12:37:47 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QCbl6k061517 for ; Thu, 26 Sep 2013 12:37:47 GMT (envelope-from ambarisha@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QCblcd061499 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 12:37:47 GMT (envelope-from ambarisha@FreeBSD.org) Date: Thu, 26 Sep 2013 12:37:47 GMT Message-Id: <201309261237.r8QCblcd061499@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ambarisha@FreeBSD.org using -f From: ambarisha@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257721 - in soc2013/ambarisha/head/usr.bin: dmget dms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 12:37:47 -0000 Author: ambarisha Date: Thu Sep 26 12:37:47 2013 New Revision: 257721 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257721 Log: Worker uses "preempted" flag to clean up. Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c soc2013/ambarisha/head/usr.bin/dmget/fetch.c soc2013/ambarisha/head/usr.bin/dms/dms.c soc2013/ambarisha/head/usr.bin/dms/worker.c Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 12:32:12 2013 (r257720) +++ soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 12:37:47 2013 (r257721) @@ -22,8 +22,8 @@ int dmLastErrCode; char dmLastErrString[MAXERRSTRING]; -static int sigint; -static int siginfo; +static volatile sig_atomic_t sigint; +static volatile sig_atomic_t siginfo; static int dmg_error; static char dmg_errstr[512]; Modified: soc2013/ambarisha/head/usr.bin/dmget/fetch.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 12:32:12 2013 (r257720) +++ soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 12:37:47 2013 (r257721) @@ -91,7 +91,7 @@ static int chksum_type = NO_CHKSUM; /* (SHA1/MD5/NO)_CHKSUM */ static char chksum[MAX_CHKSUM_LEN]; -static int sigint; /* SIGINT received */ +static volatile sig_atomic_t sigint; /* SIGINT received */ static long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ static long http_timeout = TIMEOUT;/* default timeout for HTTP transfers */ Modified: soc2013/ambarisha/head/usr.bin/dms/dms.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 12:32:12 2013 (r257720) +++ soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 12:37:47 2013 (r257721) @@ -20,7 +20,7 @@ static int dm_err; static char dm_errstr[512]; -int stop; +volatile sig_atomic_t stop; struct dmjob *jobs; pthread_mutex_t job_queue_mutex; Modified: soc2013/ambarisha/head/usr.bin/dms/worker.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 12:32:12 2013 (r257720) +++ soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 12:37:47 2013 (r257721) @@ -371,6 +371,28 @@ return (r); } +static char * +get_tmpfn(const char *fn) +{ + /* TODO: Not good assumes type of opaque pthread_t type + * Fix this by having a pthread_t -> id mapping + */ + unsigned int tid = (unsigned long)pthread_self(); + char idstr[8]; + sprintf(idstr, ".%u", tid); + + char *tmpfn = (char *) malloc(strlen(fn) + strlen(idstr) + strlen(TMP_EXT) + 1); + if (tmpfn == NULL) { + fprintf(stderr, "dms: Insufficient memory\n"); + return NULL; + } + + strcpy(tmpfn, fn); + strcat(tmpfn, idstr); + strcat(tmpfn, TMP_EXT); + return tmpfn; +} + static struct dmjob * find_potential_job(struct dmmirr *dmmirr) { @@ -470,6 +492,7 @@ char *ptr; char *buf; struct dmreq *dmreq = dmjob->request; + pthread_t tid = pthread_self(); of = NULL; tmppath = NULL; @@ -535,6 +558,9 @@ if (check_signal(SIGALRM, dmjob) || check_signal(SIGINT, dmjob)) goto signal; + + if (dmjob->preempted && dmjob->worker != tid) + goto preempted; /* check that size is as expected */ /*if (dmreq->S_size) { @@ -650,6 +676,9 @@ dmjob->url->offset = 0; if (check_signal(SIGINT, dmjob)) goto signal; + + if (dmjob->preempted && dmjob->worker != tid) + goto preempted; } @@ -692,7 +721,8 @@ /* suck in the data */ dmjob->siginfo_en = 1; - while (!check_signal(SIGINT, dmjob)) { + while (!check_signal(SIGINT, dmjob) && + (dmjob->preempted == 0 || dmjob->worker == tid)) { if (us.size != -1 && us.size - count < dmreq->B_size && us.size - count >= 0) size = us.size - count; @@ -703,11 +733,15 @@ dmjob->siginfo = 0; } + if (dmjob->preempted && dmjob->worker != tid) + goto preempted; + if (size == 0) break; if ((readcnt = fread(buf, 1, size, f)) < size) { - if (ferror(f) && errno == EINTR && !check_signal(SIGINT, dmjob)) + if (ferror(f) && errno == EINTR && !check_signal(SIGINT, dmjob) && + (dmjob->preempted == 0 || dmjob->worker == tid)) clearerr(f); else if (readcnt == 0) { break; @@ -731,8 +765,16 @@ dmjob->sigalrm = ferror(f) && errno == ETIMEDOUT; dmjob->siginfo_en = 0; + if (dmjob->preempted && dmjob->worker != tid) + goto preempted; + + stat_end(&xs, dmjob); +preempted: + r = -1; + goto done; + /* * If the transfer timed out or was interrupted, we still want to * set the mtime in case the file is not removed (-r or -R) and @@ -887,13 +929,9 @@ } */ - tmpreq.path = (char *) malloc(strlen(dmreq->path) + strlen(TMP_EXT)); - if (tmpreq.path == NULL) { - fprintf(stderr, "dmXGet: Insufficient memory\n"); + tmpreq.path = get_tmpfn(dmreq->path); + if (tmpreq.path == NULL) goto done; - } - strcpy(tmpreq.path, dmreq->path); - strcat(tmpreq.path, TMP_EXT); tmpjob.ofd = open(tmpreq.path, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); @@ -905,11 +943,14 @@ goto done; } - fetch(&tmpjob, f, *us); - fclose(f); + ret = fetch(&tmpjob, f, *us); + if (ret == -1) { + f = NULL; + goto done; + } + fclose(f); f = fopen(tmpreq.path, "r"); - done: free(tmpjob.url->doc); free(tmpjob.url); @@ -1008,7 +1049,7 @@ int ret; FILE *f; char *tmppath; - char flags[8]; + char flags[8], tid[8]; /* Acquire job queue lock */ ret = pthread_mutex_lock(&job_queue_mutex); @@ -1043,6 +1084,8 @@ /* fetch the remote file into a local tmp file */ f = dmXGet(dmjob, &us); + if (f == NULL && dmjob->preempted && dmjob->worker != pthread_self()) + return NULL; /* Acquire job queue lock */ ret = pthread_mutex_lock(&job_queue_mutex); @@ -1084,13 +1127,11 @@ /* remove the local tmp file */ if (f != NULL) { - tmppath = (char *) malloc(strlen(dmjob->request->path) + - strlen(TMP_EXT)); - strcpy(tmppath, dmjob->request->path); - strcat(tmppath, TMP_EXT); - - remove(tmppath); - free(tmppath); + tmppath = get_tmpfn(dmjob->request->path); + if (tmppath != NULL) { + remove(tmppath); + free(tmppath); + } } From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 13:01:44 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 03135D0 for ; Thu, 26 Sep 2013 13:01:44 +0000 (UTC) (envelope-from ambarisha@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D59EC288B for ; Thu, 26 Sep 2013 13:01:43 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QD1hrH041669 for ; Thu, 26 Sep 2013 13:01:43 GMT (envelope-from ambarisha@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QD1hB2041653 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 13:01:43 GMT (envelope-from ambarisha@FreeBSD.org) Date: Thu, 26 Sep 2013 13:01:43 GMT Message-Id: <201309261301.r8QD1hB2041653@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ambarisha@FreeBSD.org using -f From: ambarisha@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257722 - soc2013/ambarisha/head/usr.bin/dmget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 13:01:44 -0000 Author: ambarisha Date: Thu Sep 26 13:01:43 2013 New Revision: 257722 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257722 Log: Added dms status dump functionality to dmget with -X command line switch Added: soc2013/ambarisha/head/usr.bin/dmget/dmsumm.c soc2013/ambarisha/head/usr.bin/dmget/dmsumm.h Modified: soc2013/ambarisha/head/usr.bin/dmget/Makefile soc2013/ambarisha/head/usr.bin/dmget/dm.h soc2013/ambarisha/head/usr.bin/dmget/fetch.c Modified: soc2013/ambarisha/head/usr.bin/dmget/Makefile ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/Makefile Thu Sep 26 12:37:47 2013 (r257721) +++ soc2013/ambarisha/head/usr.bin/dmget/Makefile Thu Sep 26 13:01:43 2013 (r257722) @@ -2,7 +2,7 @@ .include -SRCS= fetch.c utils.c dmget.c +SRCS= fetch.c utils.c dmget.c dmsumm.c PROG= dmget CSTD?= c99 .if ${MK_OPENSSL} != "no" Modified: soc2013/ambarisha/head/usr.bin/dmget/dm.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/dm.h Thu Sep 26 12:37:47 2013 (r257721) +++ soc2013/ambarisha/head/usr.bin/dmget/dm.h Thu Sep 26 13:01:43 2013 (r257722) @@ -68,6 +68,21 @@ char *buf; }; +struct dmsumm { + char name[64]; + char mirror[64]; + + enum { + RUNNING = 0, + DONE, + DUPLICATE + } state; + + off_t size; + off_t rcvd; + long eta; +}; + struct xferstat { char name[64]; struct timeval start; /* start of transfer */ @@ -85,5 +100,7 @@ #define DMAUTHRESP 4 #define DMSIG 5 #define DMSTAT 6 +#define DMDUMPREQ 7 +#define DMDUMPRESP 8 #endif /* _DMCLIENT_H */ Added: soc2013/ambarisha/head/usr.bin/dmget/dmsumm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/ambarisha/head/usr.bin/dmget/dmsumm.c Thu Sep 26 13:01:43 2013 (r257722) @@ -0,0 +1,86 @@ + +#include + +#include +#include + +#include "dmsumm.h" +#include "dm.h" +#include "utils.h" + +int +receive_summary(int sock, struct dmsumm **summs, int *nsumms) +{ + struct dmmsg *dmmsg; + + dmmsg = recv_dmmsg(sock); + if (dmmsg == NULL) + return -1; + + *nsumms = dmmsg->len / sizeof(struct dmsumm); + *summs = (struct dmsumm *)dmmsg->buf; + + return 0; +} + +int +output_summary(FILE *outf, struct dmsumm *summs, int nsumms) +{ + int i; + double percent; + + for (i = 0; i < nsumms; i++) { + percent = 100 * summs[i].rcvd / summs[i].size ; + fprintf(outf, "%64s\t""%f%%\t""%d\t""%64s\t", + summs[i].name, percent, summs[i].eta, + summs[i].mirror); + } +} + +int +dump_status_summary(FILE *outf) +{ + int sock, ret, nsumms; + struct sockaddr_un dms_addr; + struct dmmsg dmmsg; + struct dmsumm *summs; + + sock = socket(AF_UNIX, SOCK_STREAM, 0); + if (sock == -1) { + fprintf(stderr, "dmget: Could not create socket" + " (%s)\n", strerror(errno)); + return -1; + } + + dms_addr.sun_family = AF_UNIX; + strncpy(dms_addr.sun_path, DMS_UDS_PATH, sizeof(dms_addr.sun_path)); + ret = connect(sock, (struct sockaddr *) &dms_addr, sizeof(dms_addr)); + if (ret == -1) { + fprintf(stderr, "dmget: Could not connect to daemon" + " (%s)\n", strerror(errno)); + return -1; + } + + //if (sigint) + // goto signal; + + dmmsg.op = DMDUMPREQ; + dmmsg.len = 0; + dmmsg.buf = NULL; + ret = send_dmmsg(sock, dmmsg); + if (ret == -1) { + close(sock); + return -1; + } + + ret = receive_summary(sock, &summs, &nsumms); + if (ret == -1) { + close(sock); + return -1; + } + + output_summary(outf, summs, nsumms); + + free(summs); + return nsumms; +} Added: soc2013/ambarisha/head/usr.bin/dmget/dmsumm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2013/ambarisha/head/usr.bin/dmget/dmsumm.h Thu Sep 26 13:01:43 2013 (r257722) @@ -0,0 +1,6 @@ +#ifndef _DM_STATUS_H_ +#define _DM_STATUS_H_ + +int dump_status_summary(FILE *); + +#endif Modified: soc2013/ambarisha/head/usr.bin/dmget/fetch.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 12:37:47 2013 (r257721) +++ soc2013/ambarisha/head/usr.bin/dmget/fetch.c Thu Sep 26 13:01:43 2013 (r257722) @@ -49,6 +49,7 @@ #include "dmget.h" #include "dm.h" +#include "dmsumm.h" #define MINBUFSIZE 4096 #define TIMEOUT 120 @@ -354,7 +355,7 @@ int c, e, r; while ((c = getopt(argc, argv, - "146AaB:bc:C:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:")) != -1) + "146AaB:bc:C:dFf:Hh:i:lMmN:nPpo:qRrS:sT:tUvw:X")) != -1) switch (c) { case '1': once_flag = 1; @@ -471,6 +472,9 @@ if (*optarg == '\0' || *end != '\0') errx(1, "invalid delay (%s)", optarg); break; + case 'X': + dump_status_summary(fdopen(STDOUT_FILENO, "w")); + exit(0); default: usage(); exit(1); From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 13:03:31 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 21061103 for ; Thu, 26 Sep 2013 13:03:31 +0000 (UTC) (envelope-from ambarisha@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB83289D for ; Thu, 26 Sep 2013 13:03:31 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QD3Uga066112 for ; Thu, 26 Sep 2013 13:03:30 GMT (envelope-from ambarisha@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QD3UDO066083 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 13:03:30 GMT (envelope-from ambarisha@FreeBSD.org) Date: Thu, 26 Sep 2013 13:03:30 GMT Message-Id: <201309261303.r8QD3UDO066083@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to ambarisha@FreeBSD.org using -f From: ambarisha@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257723 - in soc2013/ambarisha/head/usr.bin: dmget dms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 13:03:31 -0000 Author: ambarisha Date: Thu Sep 26 13:03:30 2013 New Revision: 257723 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257723 Log: Fixed some bugs in job migration and status dump Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c soc2013/ambarisha/head/usr.bin/dmget/utils.c soc2013/ambarisha/head/usr.bin/dms/dm.h soc2013/ambarisha/head/usr.bin/dms/dms.c soc2013/ambarisha/head/usr.bin/dms/dms.h soc2013/ambarisha/head/usr.bin/dms/mirror.c soc2013/ambarisha/head/usr.bin/dms/utils.c soc2013/ambarisha/head/usr.bin/dms/utils.h soc2013/ambarisha/head/usr.bin/dms/worker.c Modified: soc2013/ambarisha/head/usr.bin/dmget/dmget.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dmget/dmget.c Thu Sep 26 13:03:30 2013 (r257723) @@ -281,7 +281,6 @@ ret = sigsafe_write(sock, reqbuf, bufsize); free(reqbuf); - if (ret == -1) return -1; @@ -406,9 +405,8 @@ while (!sigint) { struct dmmsg *msg; msg = recv_dmmsg(sock); - if (msg == NULL) { + if (msg == NULL) goto failure; - } if (sigint) { send_signal(sock, SIGINT); Modified: soc2013/ambarisha/head/usr.bin/dmget/utils.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dmget/utils.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dmget/utils.c Thu Sep 26 13:03:30 2013 (r257723) @@ -13,10 +13,12 @@ int send_dmmsg(int socket, struct dmmsg msg) { + printf("IN DMMSG\n"); int bufsize = sizeof(bufsize); // Buffer size bufsize += 1; // Op bufsize += msg.len; // Signal number + printf("About to send message\n"); char *sndbuf = (char *) malloc(bufsize); if (sndbuf == NULL) { fprintf(stderr, "send_dmmsg: malloc: insufficient memory\n"); @@ -30,10 +32,14 @@ *(sndbuf + i) = msg.op; i++; - memcpy(sndbuf + i, msg.buf, msg.len); - i += msg.len; + if (msg.len != 0) { + memcpy(sndbuf + i, msg.buf, msg.len); + i += msg.len; + } int nbytes = write(socket, sndbuf, bufsize); + perror("send_dmmsg write"); + printf("%d bytes sent\n", nbytes); free(sndbuf); if (nbytes == -1) { @@ -79,6 +85,13 @@ } bufsize -= sizeof(msg->op); + + /* This is to accommodate for 0 length messages */ + if (bufsize == 0) { + msg->len = 0; + msg->buf = NULL; + return msg; + } msg->buf = (char *) malloc(bufsize); if (msg == NULL) { Modified: soc2013/ambarisha/head/usr.bin/dms/dm.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dm.h Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/dm.h Thu Sep 26 13:03:30 2013 (r257723) @@ -18,6 +18,8 @@ #define MAX_CHKSUM_LEN SHA_DIGEST_LENGTH /* TODO: Any better alternative? */ +typedef enum { RUNNING = 0, DONE, DUPLICATE } state_t; + struct dmres { int status; int errcode; @@ -68,6 +70,15 @@ char *buf; }; +struct dmsumm { + char name[64]; + char mirror[64]; + state_t state; + off_t size; + off_t rcvd; + long eta; +}; + struct xferstat { char name[64]; struct timeval start; /* start of transfer */ @@ -85,5 +96,7 @@ #define DMAUTHRESP 4 #define DMSIG 5 #define DMSTAT 6 +#define DMDUMPREQ 7 +#define DMDUMPRESP 8 #endif /* _DMCLIENT_H */ Modified: soc2013/ambarisha/head/usr.bin/dms/dms.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/dms.c Thu Sep 26 13:03:30 2013 (r257723) @@ -17,12 +17,14 @@ #include "utils.h" #include "mirror.h" -static int dm_err; -static char dm_errstr[512]; +#define MAX_SUMMS 32 -volatile sig_atomic_t stop; -struct dmjob *jobs; -pthread_mutex_t job_queue_mutex; +static int dm_err; +static char dm_errstr[512]; + +volatile sig_atomic_t stop; +struct dmjob *jobs; +pthread_mutex_t job_queue_mutex; extern struct dmmirr *mirrors; extern pthread_mutex_t mirror_list_mutex; @@ -103,7 +105,7 @@ new->next = head; } -static struct dmjob * +struct dmjob * rm_job(struct dmjob *head, struct dmjob *job) { if (job->next != NULL) @@ -123,6 +125,7 @@ { int ret; struct dmmirr *cur; + struct dmjob *dmjob = (struct dmjob *) malloc(sizeof(struct dmjob)); if (dmjob == NULL) { fprintf(stderr, "mk_dmjob: malloc: insufficient memory\n"); @@ -241,7 +244,7 @@ return dmreq; } -static void +void rm_dmreq(struct dmreq **dmreq) { if (*dmreq == NULL) @@ -263,6 +266,50 @@ free((*dmjob)->url); } +static void +send_job_summaries(int sock) +{ + struct dmsumm summs[MAX_SUMMS]; + int i, ret; + struct dmmsg dmmsg; + struct dmjob *tmp = jobs; + + /* Acquire job queue lock */ + ret = pthread_mutex_lock(&job_queue_mutex); + if (ret == -1) { + fprintf(stderr, "send_job_summaries: Attempt to acquire" + " job queue mutex failed\n"); + return; + } + + for (i = 0; i < MAX_SUMMS; i++) { + void *temp = tmp->url->doc; + strncpy(summs[i].name, tmp->url->doc, sizeof(summs[i].name)); + strncpy(summs[i].mirror, tmp->mirror->name, + sizeof(summs[i].name)); + + summs[i].state = tmp->state; + summs[i].size = tmp->oldstat.size; + summs[i].rcvd = tmp->oldstat.rcvd; + summs[i].eta = get_eta(&(tmp->oldstat)); + } + + ret = pthread_mutex_unlock(&job_queue_mutex); + if (ret == -1) { + fprintf(stderr, "send_job_summaries: Couldn't release " + "job queue lock\n"); + return; + } + /* Job queue lock released */ + + dmmsg.op = DMDUMPRESP; + dmmsg.len = i * sizeof(struct dmsumm); + dmmsg.buf = (char *)summs; + + send_dmmsg(sock, dmmsg); + return; +} + static int handle_request(int csock) { @@ -273,6 +320,7 @@ int ret; pid_t pid; + msg = recv_dmmsg(csock); if (msg == NULL) { report.status = -1; @@ -311,6 +359,9 @@ pthread_create(&(dmjob->worker), NULL, run_worker, dmjob); pthread_detach(dmjob->worker); goto done; + case DMDUMPREQ: + send_job_summaries(csock); + goto done; default: free_dmmsg(&msg); goto error; @@ -326,6 +377,7 @@ rm_dmjob(&dmjob); ret = -1; done: + free_dmmsg(&msg); return ret; } @@ -376,7 +428,6 @@ "select: %s\n", strerror(errno)); goto wrap_up; } - handle_request(csock); } @@ -414,6 +465,7 @@ int main(int argc, char **argv) { int sock, err; + sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock == -1) { fprintf(stderr, "main: socket: %s\n", strerror(errno)); Modified: soc2013/ambarisha/head/usr.bin/dms/dms.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/dms.h Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/dms.h Thu Sep 26 13:03:30 2013 (r257723) @@ -18,13 +18,7 @@ int siginfo_en; unsigned timeout; int preempted; - - enum { - RUNNING = 0, - DONE, - DUPLICATE - } state; - + state_t state; pthread_t worker; struct dmreq *request; struct url *url; @@ -42,7 +36,7 @@ }; struct dmmirr { - char name[512]; + char name[256]; int index; enum { Modified: soc2013/ambarisha/head/usr.bin/dms/mirror.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/mirror.c Thu Sep 26 13:03:30 2013 (r257723) @@ -86,6 +86,8 @@ mirror->remark = NOT_TRIED; } else if (strcmp(rem, "FAILED") == 0) { mirror->remark = FAILED; + } else if (strcmp(rem, "ACTIVE") == 0) { + mirror->remark = ACTIVE; } else { fprintf(stderr, "WARNING: Unknown mirror state in mirrors.list\n"); } @@ -122,7 +124,12 @@ case FAILED: fputs("FAILED\n", f); break; + case ACTIVE: + fputs("ACTIVE\n", f); + break; } + + fprintf(f, "%u\n", mirror->index); for(i = 0; i < MAX_SAMPLES; i++) { fprintf(f, "%ld\t%f\n", mirror->timestamps[i].tv_sec, @@ -143,6 +150,7 @@ for(i = 0; i < sizeof(MIRROR_LIST) / sizeof(MIRROR_LIST[0]); i++) { fwrite(MIRROR_LIST[i], strlen(MIRROR_LIST[i]), 1, f); fprintf(f, "\nNOT_TRIED\n"); + fprintf(f, "0\n"); for (j = 0; j < MAX_SAMPLES; j++) fprintf(f, "0\t0\n"); } Modified: soc2013/ambarisha/head/usr.bin/dms/utils.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/utils.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/utils.c Thu Sep 26 13:03:30 2013 (r257723) @@ -30,8 +30,10 @@ *(sndbuf + i) = msg.op; i++; - memcpy(sndbuf + i, msg.buf, msg.len); - i += msg.len; + if (msg.len != 0) { + memcpy(sndbuf + i, msg.buf, msg.len); + i += msg.len; + } int nbytes = write(socket, sndbuf, bufsize); free(sndbuf); @@ -79,6 +81,13 @@ } bufsize -= sizeof(msg->op); + + /* This is to accommodate for 0 length messages */ + if (bufsize == 0) { + msg->len = 0; + msg->buf = NULL; + return msg; + } msg->buf = (char *) malloc(bufsize); if (msg == NULL) { @@ -118,3 +127,14 @@ free(*msg); *msg = NULL; } + +long +get_eta(struct xferstat *xs) +{ + long eta, elapsed, speed, received, expected; + elapsed = xs->last.tv_sec - xs->start.tv_sec; + received = xs->rcvd - xs->offset; + expected = xs->size - xs->rcvd; + eta = (long)((double) elapsed * expected / received); + return eta; +} Modified: soc2013/ambarisha/head/usr.bin/dms/utils.h ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/utils.h Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/utils.h Thu Sep 26 13:03:30 2013 (r257723) @@ -18,3 +18,6 @@ void free_dmmsg(struct dmmsg **msg); + +long +get_eta(struct xferstat *xs); Modified: soc2013/ambarisha/head/usr.bin/dms/worker.c ============================================================================== --- soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 13:01:43 2013 (r257722) +++ soc2013/ambarisha/head/usr.bin/dms/worker.c Thu Sep 26 13:03:30 2013 (r257723) @@ -93,20 +93,11 @@ } static long -get_eta(struct dmjob *dmjob, struct dmmirr *dmmirr) +mirr_eta(off_t size, struct dmmirr *dmmirr) { - long eta, elapsed, speed, received, expected; - if (dmmirr == dmjob->mirror) { - elapsed = dmjob->oldstat.last.tv_sec - dmjob->oldstat.start.tv_sec; - received = dmjob->oldstat.rcvd - dmjob->oldstat.offset; - expected = dmjob->oldstat.size - dmjob->oldstat.rcvd; - eta = (long)((double) elapsed * expected / received); - } else { - expected = dmjob->oldstat.size; - speed = get_average_speed(dmmirr); - eta = (long)((double) expected / speed); - } - + long expected, speed, eta; + speed = get_average_speed(dmmirr); + eta = (long)((double) size / speed); return eta; } @@ -377,8 +368,9 @@ /* TODO: Not good assumes type of opaque pthread_t type * Fix this by having a pthread_t -> id mapping */ - unsigned int tid = (unsigned long)pthread_self(); - char idstr[8]; + unsigned int tid = (unsigned int)pthread_self(); + char idstr[32]; + sprintf(idstr, ".%u", tid); char *tmpfn = (char *) malloc(strlen(fn) + strlen(idstr) + strlen(TMP_EXT) + 1); @@ -410,11 +402,10 @@ tmp = jobs; while (tmp != NULL) { - cureta = get_eta(tmp, tmp->mirror); - neweta = get_eta(tmp, dmmirr); + cureta = get_eta(&(tmp->oldstat)); + neweta = mirr_eta(tmp->oldstat.size, dmmirr); if (neweta < cureta) { - /* notify the current owner worker to let go */ tmp->preempted = 1; break; } @@ -456,6 +447,9 @@ tv.tv_usec = 0; ret = select(dmjob->client + 1, &fds, NULL, NULL, &tv); + if (!FD_ISSET(dmjob->client, &fds)) + break; + msg = recv_dmmsg(dmjob->client); sig = (int *)msg->buf; if (*sig == SIGINT) @@ -562,6 +556,7 @@ if (dmjob->preempted && dmjob->worker != tid) goto preempted; + /* check that size is as expected */ /*if (dmreq->S_size) { if (us.size == -1) { @@ -770,6 +765,7 @@ stat_end(&xs, dmjob); + goto signal; preempted: r = -1; @@ -932,9 +928,9 @@ tmpreq.path = get_tmpfn(dmreq->path); if (tmpreq.path == NULL) goto done; - + tmpjob.ofd = open(tmpreq.path, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); - + FILE *f = fetchXGet(tmpjob.url, us, flags); if (f == NULL) { close(tmpjob.ofd); @@ -946,6 +942,7 @@ ret = fetch(&tmpjob, f, *us); if (ret == -1) { f = NULL; + fprintf(stderr, "Failed now\n"); goto done; } @@ -984,6 +981,7 @@ /* Notify the client of the same */ return -1; } + break; case MD5_CHKSUM: MD5_Init(&md5_ctx); @@ -998,6 +996,7 @@ fprintf(stderr, "dms: checksum mismatch\n"); return -1; } + break; default: break; @@ -1045,6 +1044,7 @@ { struct dmrep report; struct dmjob *tmp; + struct dmmirr *dmmirr; struct url_stat us; int ret; FILE *f; @@ -1086,7 +1086,7 @@ f = dmXGet(dmjob, &us); if (f == NULL && dmjob->preempted && dmjob->worker != pthread_self()) return NULL; - + /* Acquire job queue lock */ ret = pthread_mutex_lock(&job_queue_mutex); if (ret == -1) { @@ -1095,6 +1095,7 @@ return NULL; } + /* Serve any outstanding requests from the local tmp file */ tmp = jobs; while (tmp != NULL) { @@ -1129,18 +1130,24 @@ if (f != NULL) { tmppath = get_tmpfn(dmjob->request->path); if (tmppath != NULL) { - remove(tmppath); +// remove(tmppath); free(tmppath); } } + dmmirr = dmjob->mirror; + + rm_dmreq(&(dmjob->request)); + jobs = rm_job(jobs, dmjob); /* Check if this worker can prempt any downloads */ - dmjob = find_potential_job(dmjob->mirror); - if (dmjob != NULL) + tmp = find_potential_job(dmmirr); + if (tmp != NULL) { + dmjob = tmp; goto start; - - release_mirror(dmjob->mirror); + } + + release_mirror(dmmirr); /* TODO : What is this? Yew!! */ sleep(10); } From owner-svn-soc-all@FreeBSD.ORG Thu Sep 26 14:27:31 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD50DC20 for ; Thu, 26 Sep 2013 14:27:31 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99C9C2DA4 for ; Thu, 26 Sep 2013 14:27:31 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8QERVNB068279 for ; Thu, 26 Sep 2013 14:27:31 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8QERVjw068268 for svn-soc-all@FreeBSD.org; Thu, 26 Sep 2013 14:27:31 GMT (envelope-from zcore@FreeBSD.org) Date: Thu, 26 Sep 2013 14:27:31 GMT Message-Id: <201309261427.r8QERVjw068268@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257728 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2013 14:27:31 -0000 Author: zcore Date: Thu Sep 26 14:27:31 2013 New Revision: 257728 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257728 Log: correct Copyright section Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.c soc2013/zcore/head/usr.sbin/bhyve/block_if.h soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/block_if.c Thu Sep 26 13:17:31 2013 (r257727) +++ soc2013/zcore/head/usr.sbin/bhyve/block_if.c Thu Sep 26 14:27:31 2013 (r257728) @@ -11,10 +11,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) Modified: soc2013/zcore/head/usr.sbin/bhyve/block_if.h ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/block_if.h Thu Sep 26 13:17:31 2013 (r257727) +++ soc2013/zcore/head/usr.sbin/bhyve/block_if.h Thu Sep 26 14:27:31 2013 (r257728) @@ -11,10 +11,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Thu Sep 26 13:17:31 2013 (r257727) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Thu Sep 26 14:27:31 2013 (r257728) @@ -11,10 +11,10 @@ * 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 NETAPP, INC ``AS IS'' AND + * 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 NETAPP, INC OR CONTRIBUTORS BE LIABLE + * 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) From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 10:06:14 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77BA6185 for ; Fri, 27 Sep 2013 10:06:14 +0000 (UTC) (envelope-from iori@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62A10206D for ; Fri, 27 Sep 2013 10:06:14 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RA6Ewp068891 for ; Fri, 27 Sep 2013 10:06:14 GMT (envelope-from iori@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RA6EPx068864 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 10:06:14 GMT (envelope-from iori@FreeBSD.org) Date: Fri, 27 Sep 2013 10:06:14 GMT Message-Id: <201309271006.r8RA6EPx068864@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iori@FreeBSD.org using -f From: iori@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257754 - in soc2013/iori/suspendresume/head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyveload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 10:06:14 -0000 Author: iori Date: Fri Sep 27 10:06:14 2013 New Revision: 257754 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257754 Log: last commit in SoC. PR: Add register test api (not working). If it works well, I can confirm the register reloading is working correctly or not. What I have to check about register save/load are below: - The registers to be saved is enough or not - The registers to be loaded is enough or not - What is the best way to save the registers into a file And I make memory dump with dd command, but it's throttled, so I have to know the good practice to save it. (device state is included on vmm memory device). Modified: soc2013/iori/suspendresume/head/lib/libvmmapi/vmmapi.c soc2013/iori/suspendresume/head/sys/amd64/include/vmm.h soc2013/iori/suspendresume/head/sys/amd64/include/vmm_dev.h soc2013/iori/suspendresume/head/sys/amd64/vmm/intel/vmx.c soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm.c soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm_dev.c soc2013/iori/suspendresume/head/usr.sbin/bhyveload/Makefile soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.8 soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.c Modified: soc2013/iori/suspendresume/head/lib/libvmmapi/vmmapi.c ============================================================================== --- soc2013/iori/suspendresume/head/lib/libvmmapi/vmmapi.c Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/lib/libvmmapi/vmmapi.c Fri Sep 27 10:06:14 2013 (r257754) @@ -124,6 +124,15 @@ } unsigned long +vm_set_allvstate(struct vmctx *ctx, struct vmstate *vmstate) +{ + int error; + + error = ioctl(ctx->fd, VM_RESTORE_VCPUSTATE, vmstate); + return error; +} + +unsigned long vm_get_allvstate(struct vmctx *ctx, struct vmstate *vmstate) { int error; @@ -132,6 +141,14 @@ return error; } +int +vm_polute_register(struct vmctx *ctx) +{ + int error; + error = ioctl(ctx->fd, VM_POLUTE_VCPUSTATE, NULL); + return error; +} + size_t vmm_get_mem_total(void) { @@ -316,6 +333,21 @@ } int +vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val) +{ + int error; + struct vm_register vmreg; + + bzero(&vmreg, sizeof(vmreg)); + vmreg.cpuid = vcpu; + vmreg.regnum = reg; + vmreg.regval = val; + + error = ioctl(ctx->fd, VM_SET_REGISTER, &vmreg); + return (error); +} + +int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *ret_val) { int error; Modified: soc2013/iori/suspendresume/head/sys/amd64/include/vmm.h ============================================================================== --- soc2013/iori/suspendresume/head/sys/amd64/include/vmm.h Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/sys/amd64/include/vmm.h Fri Sep 27 10:06:14 2013 (r257754) @@ -76,6 +76,7 @@ typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); typedef int (*vmi_reg_copy_t)(void *vmi, int ncpu, struct vm_registers **vmcpu); +typedef int (*vmi_reg_restore_t)(void *vmi, int ncpu, struct vm_registers **vmcpu); struct vmm_ops { vmm_init_func_t init; /* module wide initialization */ @@ -93,6 +94,7 @@ vmi_get_cap_t vmgetcap; vmi_set_cap_t vmsetcap; vmi_reg_copy_t vreg_copy; + vmi_reg_restore_t vreg_restore; }; extern struct vmm_ops vmm_ops_intel; @@ -129,6 +131,7 @@ cpuset_t vm_active_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); int vm_save_vcpustate(struct vm *vm, int i, struct vm_vcpustate *vmstate); +int vm_restore_vcpustate(struct vm *vm, int i, struct vm_vcpustate *vmstate); /* * Return 1 if device indicated by bus/slot/func is supposed to be a Modified: soc2013/iori/suspendresume/head/sys/amd64/include/vmm_dev.h ============================================================================== --- soc2013/iori/suspendresume/head/sys/amd64/include/vmm_dev.h Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/sys/amd64/include/vmm_dev.h Fri Sep 27 10:06:14 2013 (r257754) @@ -158,6 +158,7 @@ IOCNUM_SET_X2APIC_STATE, IOCNUM_GET_X2APIC_STATE, IOCNUM_SAVE_VCPUSTATE, + IOCNUM_RESTORE_VCPUSTATE, }; #define VM_RUN \ @@ -204,4 +205,6 @@ _IOWR('v', IOCNUM_GET_X2APIC_STATE, struct vm_x2apic) #define VM_SAVE_VCPUSTATE\ _IOWR('v', IOCNUM_SAVE_VCPUSTATE, struct vmstate) +#define VM_RESTORE_VCPUSTATE\ + _IOWR('v', IOCNUM_RESTORE_VCPUSTATE, struct vmstate) #endif Modified: soc2013/iori/suspendresume/head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- soc2013/iori/suspendresume/head/sys/amd64/vmm/intel/vmx.c Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/sys/amd64/vmm/intel/vmx.c Fri Sep 27 10:06:14 2013 (r257754) @@ -2007,8 +2007,8 @@ vmcpu[vcpu]->cr0 = (uint32_t)tmpreg; vmx_getreg(arg, vcpu, VM_REG_GUEST_CR3, &tmpreg); - vmcpu[vcpu]->cr3 = (uint32_t)tmpreg; + vmx_getreg(arg, vcpu, VM_REG_GUEST_CR4, &tmpreg); vmcpu[vcpu]->cr4 = (uint32_t)tmpreg; @@ -2034,6 +2034,68 @@ return 1; } +static int +vmx_cpu_regdisp(void *arg, int ncpu, struct vm_registers **vmcpu) +{ + struct vmx *vmx = arg; + int vcpu; + int buzy_count = 0; + int hostcpu; + + /*- This is a busy loop and must be fixed -*/ + for (vcpu = 0; vcpu < ncpu; vcpu++) + while (vcpu_is_running(vmx->vm, vcpu, &hostcpu)) + buzy_count++; + + printf("buzy_count waiting for vcpu stop is %d", buzy_count); + + /*- save all register and descriptor -*/ + for (vcpu = 0; vcpu < ncpu; vcpu++) { + vmx_setreg(arg, vcpu, VM_REG_GUEST_RAX, vmcpu[vcpu]->rax); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RBX, vmcpu[vcpu]->rbx); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RCX, vmcpu[vcpu]->rcx); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RDX, vmcpu[vcpu]->rdx); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RSI, vmcpu[vcpu]->rsi); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RDI, vmcpu[vcpu]->rdi); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RBP, vmcpu[vcpu]->rbp); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RSP, vmcpu[vcpu]->rsp); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R8, vmcpu[vcpu]->r8); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R9, vmcpu[vcpu]->r9); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R10, vmcpu[vcpu]->r10); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R11, vmcpu[vcpu]->r11); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R12, vmcpu[vcpu]->r12); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R13, vmcpu[vcpu]->r13); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R14, vmcpu[vcpu]->r14); + vmx_setreg(arg, vcpu, VM_REG_GUEST_R15, vmcpu[vcpu]->r15); + + vmx_setreg(arg, vcpu, VM_REG_GUEST_CR0, (uint64_t)vmcpu[vcpu]->cr0); + vmx_setreg(arg, vcpu, VM_REG_GUEST_CR3, (uint64_t)vmcpu[vcpu]->cr3); + vmx_setreg(arg, vcpu, VM_REG_GUEST_CR4, (uint64_t)vmcpu[vcpu]->cr4); + + vmx_setreg(arg, vcpu, VM_REG_GUEST_DR7, vmcpu[vcpu]->dr7); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RIP, vmcpu[vcpu]->rip); + vmx_setreg(arg, vcpu, VM_REG_GUEST_RFLAGS, vmcpu[vcpu]->rflags); + vmx_setreg(arg, vcpu, VM_REG_GUEST_EFER, vmcpu[vcpu]->efer); + + /* + vmx_setseg(arg, vcpu, VM_REG_GUEST_ES, *(vmcpu[vcpu]->es)); + vmx_setseg(arg, vcpu, VM_REG_GUEST_CS, *(vmcpu[vcpu]->cs)); + vmx_setseg(arg, vcpu, VM_REG_GUEST_SS, *(vmcpu[vcpu]->ss)); + vmx_setseg(arg, vcpu, VM_REG_GUEST_DS, *(vmcpu[vcpu]->ds)); + vmx_setseg(arg, vcpu, VM_REG_GUEST_FS, *(vmcpu[vcpu]->fs)); + vmx_setseg(arg, vcpu, VM_REG_GUEST_GS, *(vmcpu[vcpu]->gs)); + + vmx_setseg(arg, vcpu, VM_REG_GUEST_TR, *(vmcpu[vcpu]->tr)); + */ + + vmx_setdesc(arg, vcpu, VM_REG_GUEST_LDTR, vmcpu[vcpu]->ldtr); + vmx_setdesc(arg, vcpu, VM_REG_GUEST_IDTR, vmcpu[vcpu]->idtr); + vmx_setdesc(arg, vcpu, VM_REG_GUEST_GDTR, vmcpu[vcpu]->gdtr); + } + + return 1; +} + struct vmm_ops vmm_ops_intel = { vmx_init, vmx_cleanup, @@ -2049,5 +2111,7 @@ vmx_inject, vmx_getcap, vmx_setcap, - vmx_cpu_regcopy + vmx_cpu_regcopy, + vmx_cpu_regdisp, }; + Modified: soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm.c ============================================================================== --- soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm.c Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm.c Fri Sep 27 10:06:14 2013 (r257754) @@ -139,6 +139,8 @@ #define VREG_COPY(vmi, ncpu, vregs) \ (ops != NULL ? (*ops->vreg_copy)(vmi, ncpu, vregs) : ENXIO) +#define VREG_RESTORE(vmi, ncpu, vregs) \ + (ops != NULL ? (*ops->vreg_restore)(vmi, ncpu, vregs) : ENXIO) #define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) #define fpu_stop_emulating() clts() @@ -1094,34 +1096,35 @@ struct vm_registers **vmregs; struct vm_vcpustate kvmcpu; struct vm_registers kvmregs; - struct vcpu *vcpu, *kvcpu; + struct vcpu *vcpu; + struct savefpu* kfpu; vm->control = REQ_SUSPEND; for (vcpuid = 0; vcpuid < ncpu; vcpuid++) vm_interrupt_hostcpu(vm, vcpuid); - vmregs = construct_vmcpu_snapshot(2); + vmregs = construct_vmcpu_snapshot(ncpu); + ret = VREG_COPY(vm->cookie, ncpu, vmregs); - printf("vmcpu is %p", vmcpu); - copyin(vmcpu, &kvmcpu, sizeof(struct vm_vcpuidstate)); - printf("vreg is %p", kvmcpu.regs); + /* we have to know the addresses of non-integer registers or structured + * register. The addresses are used to save these registers and after + * save operation, this addresses are written back into virtual registers + * struct. + */ + copyin(vmcpu, &kvmcpu, sizeof(struct vm_vcpustate)); for (vcpuid = 0; vcpuid < ncpu; vcpuid++) { vcpu = &vm->vcpu[vcpuid]; printf("start to copy in\n"); /* vm_segment_registers */ - printf("1 to copy in\n"); copyin(kvmcpu.regs, &kvmregs, - sizeof(struct vm_vcpuidstate)); - - printf("rax=%lu\n", kvmregs.rax); + sizeof(struct vm_vcpustate)); printf("start to copy out\n"); /* vm_segment_registers */ copyout(vmregs[vcpuid]->cs, cs = kvmregs.cs, sizeof(struct segment_register)); - printf("1 to copy out\n"); copyout(vmregs[vcpuid]->ds, ds = kvmregs.ds, sizeof(struct segment_register)); copyout(vmregs[vcpuid]->ss, ss = kvmregs.ss, @@ -1132,9 +1135,10 @@ sizeof(struct segment_register)); copyout(vmregs[vcpuid]->gs, gs = kvmregs.gs, sizeof(struct segment_register)); - copyout(vcpu->guestfpu, kvcpu = kvmregs.vfpu, - sizeof(struct segment_register*)); +/* vm registers */ + copyout(vcpu->guestfpu, kfpu = kvmregs.vfpu, + sizeof(struct segment_register*)); copyout(vmregs[vcpuid], vmcpu->regs, sizeof(struct vm_registers)); copyout(&cs, &(kvmregs.cs), sizeof(struct segment_register*)); @@ -1143,6 +1147,7 @@ copyout(&es, &(kvmregs.es), sizeof(struct segment_register*)); copyout(&fs, &(kvmregs.fs), sizeof(struct segment_register*)); copyout(&gs, &(kvmregs.gs), sizeof(struct segment_register*)); + copyout(&kfpu, &(kvmregs.vfpu), sizeof(struct savefpu*)); vmcpu = kvmcpu.nextcpu; @@ -1152,3 +1157,51 @@ return ret; }; +int +vm_restore_vcpustate(struct vm *vm, int ncpu, struct vm_vcpustate *vmcpu) +{ + int ret; + int vcpuid; + struct vm_registers **vmregs; + struct vm_vcpustate kvmcpu; + struct vm_registers kvmregs; + struct vcpu *vcpu; + + printf("restoring vm is not implemented yet.\n"); + vmregs = construct_vmcpu_snapshot(ncpu); + + copyin(vmcpu, &kvmcpu, sizeof(struct vm_vcpustate)); + + for (vcpuid = 0; vcpuid != ncpu; vcpuid++) { + vcpu = &vm->vcpu[vcpuid]; + copyin(kvmcpu.regs, &kvmregs, + sizeof(struct vm_vcpustate)); + +/* vm_segment_registers */ + copyin(kvmregs.cs, vmregs[vcpuid]->cs, + sizeof(struct segment_register)); + + copyin(kvmregs.ds, vmregs[vcpuid]->ds, + sizeof(struct segment_register)); + + copyin(kvmregs.ss, vmregs[vcpuid]->ss, + sizeof(struct segment_register)); + + copyin(kvmregs.es, vmregs[vcpuid]->es, + sizeof(struct segment_register)); + + copyin(kvmregs.ds, vmregs[vcpuid]->fs, + sizeof(struct segment_register)); + + copyin(kvmregs.ds, vmregs[vcpuid]->gs, + sizeof(struct segment_register)); + + VREG_RESTORE(vm->cookie, ncpu, vmregs); + + copyin(kvmregs.vfpu, vcpu->guestfpu, + sizeof(struct segment_register*)); + } + ret = 1; + return ret; +} + Modified: soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm_dev.c Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/sys/amd64/vmm/vmm_dev.c Fri Sep 27 10:06:14 2013 (r257754) @@ -351,6 +351,15 @@ error = vm_get_x2apic_state(sc->vm, x2apic->cpuid, &x2apic->state); break; + case VM_RESTORE_VCPUSTATE: + vmstate = (struct vmstate *)data; + if (vmstate->bhyve_version == 0) + error = vm_restore_vcpustate(sc->vm, vmstate->ncpu, vmstate->vmcpu); + else { + printf("unknown bhyve save file version!\n"); + error = -1; + } + break; case VM_SAVE_VCPUSTATE: vmstate = (struct vmstate *)data; vmstate->bhyve_version = 0; Modified: soc2013/iori/suspendresume/head/usr.sbin/bhyveload/Makefile ============================================================================== --- soc2013/iori/suspendresume/head/usr.sbin/bhyveload/Makefile Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/usr.sbin/bhyveload/Makefile Fri Sep 27 10:06:14 2013 (r257754) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= bhyveload -SRCS= bhyveload.c +SRCS= bhyveload.c standalone.c MAN= bhyveload.8 DPADD+= ${LIBVMMAPI} Modified: soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.8 Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.8 Fri Sep 27 10:06:14 2013 (r257754) @@ -38,6 +38,7 @@ .Op Fl m Ar mem-size .Op Fl d Ar disk-path .Op Fl h Ar host-path +.Op Fl S Ar stand-binary:stand-addr .Ar vmname .Sh DESCRIPTION .Nm @@ -75,6 +76,13 @@ The .Ar host-path is the directory at the top of the guest's boot filesystem. +.It Fl S Ar stand-binary:stand-addr +The +.Ar stand-binary +is the pathname of the standalone guest program. +The +.Ar stand-addr +is the entrypoint address of the standalone guest program. .El .Sh EXAMPLES To create a virtual machine named Modified: soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.c Fri Sep 27 09:55:06 2013 (r257753) +++ soc2013/iori/suspendresume/head/usr.sbin/bhyveload/bhyveload.c Fri Sep 27 10:06:14 2013 (r257754) @@ -95,6 +95,9 @@ static void cb_exit(void *arg, int v); +extern int stand_load(struct loader_callbacks *cb, char *image, + uint64_t addr); + /* * Console i/o callbacks */ @@ -552,6 +555,7 @@ fprintf(stderr, "usage: %s [-m mem-size][-d ] [-h ] " + "[-S stand-binary:stand-addr] " "\n", progname); exit(1); } @@ -563,6 +567,8 @@ void (*func)(struct loader_callbacks *, void *, int, int); uint64_t mem_size; int opt, error; + uint64_t stand_addr; + char *stand_image; char *disk_image; progname = argv[0]; @@ -570,7 +576,7 @@ mem_size = 256 * MB; disk_image = NULL; - while ((opt = getopt(argc, argv, "d:h:m:")) != -1) { + while ((opt = getopt(argc, argv, "d:h:m:S:")) != -1) { switch (opt) { case 'd': disk_image = optarg; @@ -583,7 +589,26 @@ case 'm': mem_size = strtoul(optarg, NULL, 0) * MB; break; - + + case 'S': { + char *addr_str; + + stand_image = strtok(optarg, ":"); + if (stand_image == NULL) { + usage(); + break; + } + + addr_str = strtok(NULL, ":"); + if (addr_str == NULL) { + usage(); + break; + } + stand_addr = strtoll(addr_str, NULL, 0); + + break; + } + case '?': usage(); } @@ -621,6 +646,11 @@ term.c_lflag &= ~(ICANON|ECHO); term.c_iflag &= ~ICRNL; tcsetattr(0, TCSAFLUSH, &term); + if (stand_image) { + if (stand_load(&cb, stand_image, stand_addr)) + exit(1); + exit(0); + } h = dlopen("/boot/userboot.so", RTLD_LOCAL); if (!h) { printf("%s\n", dlerror()); From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 10:47:22 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D1753AA8 for ; Fri, 27 Sep 2013 10:47:22 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B04EE227D for ; Fri, 27 Sep 2013 10:47:22 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RAlMGs091040 for ; Fri, 27 Sep 2013 10:47:22 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RAlM5W091038 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 10:47:22 GMT (envelope-from bguan@FreeBSD.org) Date: Fri, 27 Sep 2013 10:47:22 GMT Message-Id: <201309271047.r8RAlM5W091038@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257755 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 10:47:22 -0000 Author: bguan Date: Fri Sep 27 10:47:22 2013 New Revision: 257755 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257755 Log: set the pipe methods for xen usb host controller Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.c Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.c ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.c Fri Sep 27 10:06:14 2013 (r257754) +++ soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.c Fri Sep 27 10:47:22 2013 (r257755) @@ -83,7 +83,7 @@ &xenhcidebug, 0, "Debug level"); TUNABLE_INT("hw.usb.xenhci.debug", &xenhcidebug); SYSCTL_INT(_hw_usb_xenhci, OID_AUTO, xenhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, - &xenhciroute, 0, "Routing bitmap for switching EHCI ports to XENHCI controller"); + &xenhciroute, 0, "Routing bitmap for switching XENHCI ports to XENHCI controller"); TUNABLE_INT("hw.usb.xenhci.xenhci_port_route", &xenhciroute); SYSCTL_INT(_hw_usb_xenhci, OID_AUTO, use_polling, CTLFLAG_RW | CTLFLAG_TUN, &xenhcipolling, 0, "Set to enable software interrupt polling for XENHCI controller"); @@ -92,19 +92,98 @@ #define XENHCI_INTR_ENDPT 1 +struct xenhci_std_temp { + struct xenhci_softc *sc; + struct usb_page_cache *pc; + xenhci_qtd_t *td; + xenhci_qtd_t *td_next; + + uint32_t average; + uint32_t qtd_status; + uint32_t len; + uint16_t max_frame_size; + uint8_t shortpkt; + uint8_t auto_data_toggle; + uint8_t setup_alt_next; + uint8_t last_frame; +}; + + extern struct usb_bus_methods xenhci_bus_methods; extern struct usb_pipe_methods xenhci_device_generic_methods; +usb_error_t xenhci_start_controller(struct xenhci_softc *); +usb_error_t xenhci_halt_controller(struct xenhci_softc *); +static void xenhci_do_poll(struct usb_bus *); static void xenhci_timeout(void *); static void xenhci_device_done(struct usb_xfer *, usb_error_t); -/* + + static void -xenhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) +xenhci_dump_itd(struct xenhci_softc *sc, xenhci_itd_t *itd) +{ +} + +#define XENHCI_APPEND_QH(sqh,last) (last) = _xenhci_append_qh(sqh,last) +static xenhci_qh_t * +_xenhci_append_qh(xenhci_qh_t *sqh, xenhci_qh_t *last) +{ + DPRINTFN(11, "%p to %p\n", sqh, last); + + if (sqh->prev != NULL) { + /* should not happen */ + DPRINTFN(0, "QH already linked!\n"); + return (last); + } + /* (sc->sc_bus.mtx) must be locked */ + + sqh->next = last->next; + sqh->qh_link = last->qh_link; + + sqh->prev = last; + + usb_pc_cpu_flush(sqh->page_cache); + + /* + * the last->next->prev is never followed: sqh->next->prev = sqh; + */ + + last->next = sqh; + last->qh_link = sqh->qh_self; + + usb_pc_cpu_flush(last->page_cache); + + return (sqh); +} + +#define XENHCI_APPEND_HS_TD(std,last) (last) = _xenhci_append_hs_td(std,last) +static xenhci_itd_t * +_xenhci_append_hs_td(xenhci_itd_t *std, xenhci_itd_t *last) { - //TODO need this method()? -}*/ + DPRINTFN(11, "%p to %p\n", std, last); + + /* (sc->sc_bus.mtx) must be locked */ + + std->next = last->next; + std->itd_next = last->itd_next; + + std->prev = last; + + usb_pc_cpu_flush(std->page_cache); + + /* + * the last->next->prev is never followed: std->next->prev = std; + */ + last->next = std; + last->itd_next = std->itd_self; + + usb_pc_cpu_flush(last->page_cache); + + return (std); +} +/***************************************************************/ usb_error_t xenhci_start_controller(struct xenhci_softc *sc) @@ -142,6 +221,9 @@ sc->sc_bus.devices = sc->sc_devices; sc->sc_bus.devices_max = XENHCI_MAX_DEVICES; + /* setup command queue mutex and condition varible */ + sx_init(&sc->sc_cmd_sx, "CMDQ lock"); + /* get all DMA memory */ //if (usb_bus_mem_alloc_all(&sc->sc_bus, // USB_GET_DMA_TAG(dev), &xenhci_iterate_hw_softc)) { @@ -163,6 +245,8 @@ * needed. */ usb_bus_mem_free_all(&sc->sc_bus, NULL); + + sx_destroy(&sc->sc_cmd_sx); } static void @@ -192,206 +276,6 @@ } } -static usb_error_t -xenhci_generic_done_sub(struct usb_xfer *xfer) -{ - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xenhci.c: xenhci_generic_done_sub()\n"); - #endif - - struct xenhci_td *td; - struct xenhci_td *td_alt_next; - uint32_t len; - uint8_t status; - - td = xfer->td_transfer_cache; - td_alt_next = td->alt_next; - - if (xfer->aframes != xfer->nframes) - usbd_xfer_set_frame_len(xfer, xfer->aframes, 0); - - while (1) { - - usb_pc_cpu_invalidate(td->page_cache); - - status = td->status; - len = td->remainder; - - DPRINTFN(4, "xfer=%p[%u/%u] rem=%u/%u status=%u\n", - xfer, (unsigned int)xfer->aframes, - (unsigned int)xfer->nframes, - (unsigned int)len, (unsigned int)td->len, - (unsigned int)status); - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xfer=%p[%u/%u] rem=%u/%u status=%u\n", - xfer, (unsigned int)xfer->aframes, - (unsigned int)xfer->nframes, - (unsigned int)len, (unsigned int)td->len, - (unsigned int)status); - #endif - - /* - * Verify the status length and - * add the length to "frlengths[]": - */ - if (len > td->len) { - /* should not happen */ - DPRINTF("Invalid status length, " - "0x%04x/0x%04x bytes\n", len, td->len); - - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]Invalid status length, " - "0x%04x/0x%04x bytes\n", len, td->len); - #endif - - status = XENHCI_TRB_ERROR_LENGTH; - } else if (xfer->aframes != xfer->nframes) { - xfer->frlengths[xfer->aframes] += td->len - len; - } - /* Check for last transfer */ - if (((void *)td) == xfer->td_transfer_last) { - td = NULL; - break; - } - /* Check for transfer error */ - if (status != XENHCI_TRB_ERROR_SHORT_PKT && - status != XENHCI_TRB_ERROR_SUCCESS) { - /* the transfer is finished */ - td = NULL; - break; - } - /* Check for short transfer */ - if (len > 0) { - if (xfer->flags_int.short_frames_ok || - xfer->flags_int.isochronous_xfr || - xfer->flags_int.control_xfr) { - /* follow alt next */ - td = td->alt_next; - } else { - /* the transfer is finished */ - td = NULL; - } - break; - } - td = td->obj_next; - - if (td->alt_next != td_alt_next) { - /* this USB frame is complete */ - break; - } - } - - /* update transfer cache */ - - xfer->td_transfer_cache = td; - - return ((status == XENHCI_TRB_ERROR_STALL) ? USB_ERR_STALLED : - (status != XENHCI_TRB_ERROR_SHORT_PKT && - status != XENHCI_TRB_ERROR_SUCCESS) ? USB_ERR_IOERROR : - USB_ERR_NORMAL_COMPLETION); -} - -static void -xenhci_generic_done(struct usb_xfer *xfer) -{ - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xenhci.c: xenhci_generic_done()\n"); - #endif - - usb_error_t err = 0; - - DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", - xfer, xfer->endpoint); - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xfer=%p endpoint=%p transfer done\n", - xfer, xfer->endpoint); - #endif - - /* reset scanner */ - xfer->td_transfer_cache = xfer->td_transfer_first; - - if (xfer->flags_int.control_xfr) { - if (xfer->flags_int.control_hdr) - err = xenhci_generic_done_sub(xfer); - - xfer->aframes = 1; - - if (xfer->td_transfer_cache == NULL) - goto done; - } - - while (xfer->aframes != xfer->nframes) { - - err = xenhci_generic_done_sub(xfer); - xfer->aframes++; - - if (xfer->td_transfer_cache == NULL) - goto done; - } - - if (xfer->flags_int.control_xfr && - !xfer->flags_int.control_act) - err = xenhci_generic_done_sub(xfer); -done: - /* transfer is complete */ - //xhci_device_done(xfer, err); -} - -static void -xenhci_activate_transfer(struct usb_xfer *xfer) -{ - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xenhci.c: xenhci_activate_transfer()\n"); - #endif - - struct xenhci_td *td; - - td = xfer->td_transfer_cache; - - usb_pc_cpu_invalidate(td->page_cache); - - if (!(td->td_trb[0].dwTrb3 & htole32(XENHCI_TRB_3_CYCLE_BIT))) { - - /* activate the transfer */ - td->td_trb[0].dwTrb3 |= htole32(XENHCI_TRB_3_CYCLE_BIT); - usb_pc_cpu_flush(td->page_cache); - - //xhci_endpoint_doorbell(xfer);//? - } -} - -static void -xenhci_skip_transfer(struct usb_xfer *xfer) -{ - #ifdef XENUSB_BEBUG - printf("[xenusb_debug]xenhci.c: xenhci_skip_transfer()\n"); - #endif - - struct xenhci_td *td; - struct xenhci_td *td_last; - - td = xfer->td_transfer_cache; - td_last = xfer->td_transfer_last; - - td = td->alt_next; - - usb_pc_cpu_invalidate(td->page_cache); - - if (!(td->td_trb[0].dwTrb3 & htole32(XENHCI_TRB_3_CYCLE_BIT))) { - - usb_pc_cpu_invalidate(td_last->page_cache); - - /* copy LINK TRB to current waiting location */ - td->td_trb[0].qwTrb0 = td_last->td_trb[td_last->ntrb].qwTrb0; - td->td_trb[0].dwTrb2 = td_last->td_trb[td_last->ntrb].dwTrb2; - usb_pc_cpu_flush(td->page_cache); - - td->td_trb[0].dwTrb3 = td_last->td_trb[td_last->ntrb].dwTrb3; - usb_pc_cpu_flush(td->page_cache); - - //xhci_endpoint_doorbell(xfer);//? - } -} /*------------------------------------------------------------------------* * xenhci_check_transfer @@ -403,8 +287,8 @@ printf("[xenusb_debug]xenhci.c: xenhci_check_transfer()\n"); #endif - struct xenhci_endpoint_ext *pepext; - int64_t offset; +// struct xenhci_endpoint_ext *pepext; +// int64_t offset; uint64_t td_event; uint32_t temp; uint32_t remainder; @@ -449,131 +333,19 @@ return; } - pepext = &sc->sc_hw.devs[index].endp[epno]; + //pepext = &sc->sc_hw.devs[index].endp[epno]; - if (pepext->trb_ep_mode != USB_EP_MODE_STREAMS) { - stream_id = 0; - DPRINTF("stream_id=0\n"); - } else if (stream_id >= XENHCI_MAX_STREAMS) { - DPRINTF("Invalid stream ID.\n"); - return; - } + //if (pepext->trb_ep_mode != USB_EP_MODE_STREAMS) { + // stream_id = 0; + // DPRINTF("stream_id=0\n"); + //} else if (stream_id >= XENHCI_MAX_STREAMS) { + // DPRINTF("Invalid stream ID.\n"); + // return; + //} /* try to find the USB transfer that generated the event */ for (i = 0; i != (XENHCI_MAX_TRANSFERS - 1); i++) { - struct usb_xfer *xfer; - struct xenhci_td *td; - - xfer = pepext->xfer[i + (XENHCI_MAX_TRANSFERS * stream_id)]; - if (xfer == NULL) - continue; - - td = xfer->td_transfer_cache; - - DPRINTFN(5, "Checking if 0x%016llx == (0x%016llx .. 0x%016llx)\n", - (long long)td_event, - (long long)td->td_self, - (long long)td->td_self + sizeof(td->td_trb)); - #ifdef XENUSB_BEBUG - printf("[gbtest]Checking if 0x%016llx == (0x%016llx .. 0x%016llx)\n", - (long long)td_event, - (long long)td->td_self, - (long long)td->td_self + sizeof(td->td_trb)); - #endif - - /* - * NOTE: Some XENHCI implementations might not trigger - * an event on the last LINK TRB so we need to - * consider both the last and second last event - * address as conditions for a successful transfer. - * - * NOTE: We assume that the XENHCI will only trigger one - * event per chain of TRBs. - */ - - offset = td_event - td->td_self; - - if (offset >= 0 && - offset < (int64_t)sizeof(td->td_trb)) { - - usb_pc_cpu_invalidate(td->page_cache); - - /* compute rest of remainder, if any */ - for (i = (offset / 16) + 1; i < td->ntrb; i++) { - temp = le32toh(td->td_trb[i].dwTrb2); - remainder += XENHCI_TRB_2_BYTES_GET(temp); - } - - DPRINTFN(5, "New remainder: %u\n", remainder); - - /* clear isochronous transfer errors */ - if (xfer->flags_int.isochronous_xfr) { - if (halted) { - halted = 0; - status = XENHCI_TRB_ERROR_SUCCESS; - remainder = td->len; - } - } - - /* "td->remainder" is verified later */ - td->remainder = remainder; - td->status = status; - - usb_pc_cpu_flush(td->page_cache); - - /* - * 1) Last transfer descriptor makes the - * transfer done - */ - if (((void *)td) == xfer->td_transfer_last) { - DPRINTF("TD is last\n"); - xenhci_generic_done(xfer); - break; - } - - /* - * 2) Any kind of error makes the transfer - * done - */ - if (halted) { - DPRINTF("TD has I/O error\n"); - xenhci_generic_done(xfer); - break; - } - - /* - * 3) If there is no alternate next transfer, - * a short packet also makes the transfer done - */ - if (td->remainder > 0) { - if (td->alt_next == NULL) { - DPRINTF( - "short TD has no alternate next\n"); - xenhci_generic_done(xfer); - break; - } - DPRINTF("TD has short pkt\n"); - if (xfer->flags_int.short_frames_ok || - xfer->flags_int.isochronous_xfr || - xfer->flags_int.control_xfr) { - /* follow the alt next */ - xfer->td_transfer_cache = td->alt_next; - xenhci_activate_transfer(xfer); - break; - } - xenhci_skip_transfer(xfer); - xenhci_generic_done(xfer); - break; - } - - /* - * 4) Transfer complete - go to next TD - */ - DPRINTF("Following next TD\n"); - xfer->td_transfer_cache = td->obj_next; - xenhci_activate_transfer(xfer); - break; /* there should only be one match */ - } + //TODO } } @@ -584,12 +356,13 @@ printf("[xenusb_debug]xenhci.c: xenhci_check_command()\n"); #endif - if (sc->sc_cmd_addr == trb->qwTrb0) { - DPRINTF("Received command event\n"); - sc->sc_cmd_result[0] = trb->dwTrb2; - sc->sc_cmd_result[1] = trb->dwTrb3; - cv_signal(&sc->sc_cmd_cv); - } +//TODO?? +// if (sc->sc_cmd_addr == trb->qwTrb0) { +// DPRINTF("Received command event\n"); +// sc->sc_cmd_result[0] = trb->dwTrb2; +// sc->sc_cmd_result[1] = trb->dwTrb3; +// cv_signal(&sc->sc_cmd_cv); +// } } static void @@ -609,16 +382,18 @@ uint8_t k; uint8_t t; - usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); + //usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); phwr = buf_res.buffer; /* Receive any events */ - usb_pc_cpu_invalidate(&sc->sc_hw.root_pc); + //usb_pc_cpu_invalidate(&sc->sc_hw.root_pc); - i = sc->sc_event_idx; - j = sc->sc_event_ccs; +// i = sc->sc_event_idx; +// j = sc->sc_event_ccs; +i=0; +j=0; t = 2; while (1) { @@ -673,8 +448,8 @@ } } - sc->sc_event_idx = i; - sc->sc_event_ccs = j; +// sc->sc_event_idx = i; +// sc->sc_event_ccs = j; /* * NOTE: The Event Ring Dequeue Pointer Register is 64-bit @@ -739,328 +514,40 @@ } - - - /*------------------------------------------------------------------------* * */ static void xenhci_setup_generic_chain_sub(struct xenhci_std_temp *temp) -{ - struct usb_page_search buf_res; - struct xenhci_td *td; - struct xenhci_td *td_next; - struct xenhci_td *td_alt_next; - struct xenhci_td *td_first; - uint32_t buf_offset; - uint32_t average; - uint32_t len_old; - uint32_t npkt_off; - uint32_t dword; - uint8_t shortpkt_old; - uint8_t precompute; - uint8_t x; - - td_alt_next = NULL; - buf_offset = 0; - shortpkt_old = temp->shortpkt; - len_old = temp->len; - npkt_off = 0; - precompute = 1; - -restart: - - td = temp->td; - td_next = td_first = temp->td_next; - - while (1) { - - if (temp->len == 0) { - - if (temp->shortpkt) - break; - - /* send a Zero Length Packet, ZLP, last */ - - temp->shortpkt = 1; - average = 0; - - } else { - - average = temp->average; - - if (temp->len < average) { - if (temp->len % temp->max_packet_size) { - temp->shortpkt = 1; - } - average = temp->len; - } - } - - if (td_next == NULL) - panic("%s: out of XHCI transfer descriptors!", __FUNCTION__); - - /* get next TD */ - - td = td_next; - td_next = td->obj_next; - - /* check if we are pre-computing */ - - if (precompute) { - - /* update remaining length */ - - temp->len -= average; - - continue; - } - /* fill out current TD */ - - td->len = average; - td->remainder = 0; - td->status = 0; - - /* update remaining length */ - - temp->len -= average; - - /* reset TRB index */ - - x = 0; - - if (temp->trb_type == XENHCI_TRB_TYPE_SETUP_STAGE) { - /* immediate data */ - - if (average > 8) - average = 8; - - td->td_trb[0].qwTrb0 = 0; - - usbd_copy_out(temp->pc, temp->offset + buf_offset, - (uint8_t *)(uintptr_t)&td->td_trb[0].qwTrb0, - average); - - dword = XENHCI_TRB_2_BYTES_SET(8) | - XENHCI_TRB_2_TDSZ_SET(0) | - XENHCI_TRB_2_IRQ_SET(0); - - td->td_trb[0].dwTrb2 = htole32(dword); - - dword = XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_SETUP_STAGE) | - XENHCI_TRB_3_IDT_BIT | XENHCI_TRB_3_CYCLE_BIT; - - /* check wLength */ - if (td->td_trb[0].qwTrb0 & - htole64(XENHCI_TRB_0_WLENGTH_MASK)) { - if (td->td_trb[0].qwTrb0 & htole64(1)) - dword |= XENHCI_TRB_3_TRT_IN; - else - dword |= XENHCI_TRB_3_TRT_OUT; - } - - td->td_trb[0].dwTrb3 = htole32(dword); -#ifdef USB_DEBUG - xhci_dump_trb(&td->td_trb[x]); -#endif - x++; - - } else do { - - uint32_t npkt; - - /* fill out buffer pointers */ - - if (average == 0) { - npkt = 0; - memset(&buf_res, 0, sizeof(buf_res)); - } else { - usbd_get_page(temp->pc, temp->offset + - buf_offset, &buf_res); - - /* get length to end of page */ - if (buf_res.length > average) - buf_res.length = average; - - /* check for maximum length */ - if (buf_res.length > XENHCI_TD_PAGE_SIZE) - buf_res.length = XENHCI_TD_PAGE_SIZE; - - npkt_off += buf_res.length; - - /* setup npkt */ - npkt = (len_old - npkt_off + temp->max_packet_size - 1) / - temp->max_packet_size; - - if (npkt > 31) - npkt = 31; - } - - /* fill out TRB's */ - td->td_trb[x].qwTrb0 = - htole64((uint64_t)buf_res.physaddr); - - dword = - XENHCI_TRB_2_BYTES_SET(buf_res.length) | - XENHCI_TRB_2_TDSZ_SET(npkt) | - XENHCI_TRB_2_IRQ_SET(0); - - td->td_trb[x].dwTrb2 = htole32(dword); - - switch (temp->trb_type) { - case XENHCI_TRB_TYPE_ISOCH: - /* BEI: Interrupts are inhibited until EOT */ - dword = XENHCI_TRB_3_CHAIN_BIT | XENHCI_TRB_3_CYCLE_BIT | - XENHCI_TRB_3_BEI_BIT | - XENHCI_TRB_3_TBC_SET(temp->tbc) | - XENHCI_TRB_3_TLBPC_SET(temp->tlbpc); - if (td != td_first) { - dword |= XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_NORMAL); - } else if (temp->do_isoc_sync != 0) { - temp->do_isoc_sync = 0; - /* wait until "isoc_frame" */ - dword |= XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_ISOCH) | - XENHCI_TRB_3_FRID_SET(temp->isoc_frame / 8); - } else { - /* start data transfer at next interval */ - dword |= XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_ISOCH) | - XENHCI_TRB_3_ISO_SIA_BIT; - } - if (temp->direction == UE_DIR_IN) - dword |= XENHCI_TRB_3_DIR_IN | XENHCI_TRB_3_ISP_BIT; - break; - case XENHCI_TRB_TYPE_DATA_STAGE: - dword = XENHCI_TRB_3_CHAIN_BIT | XENHCI_TRB_3_CYCLE_BIT | - XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_DATA_STAGE) | - XENHCI_TRB_3_TBC_SET(temp->tbc) | - XENHCI_TRB_3_TLBPC_SET(temp->tlbpc); - if (temp->direction == UE_DIR_IN) - dword |= XENHCI_TRB_3_DIR_IN | XENHCI_TRB_3_ISP_BIT; - break; - case XENHCI_TRB_TYPE_STATUS_STAGE: - dword = XENHCI_TRB_3_CHAIN_BIT | XENHCI_TRB_3_CYCLE_BIT | - XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_STATUS_STAGE) | - XENHCI_TRB_3_TBC_SET(temp->tbc) | - XENHCI_TRB_3_TLBPC_SET(temp->tlbpc); - if (temp->direction == UE_DIR_IN) - dword |= XHCI_TRB_3_DIR_IN; - break; - default: /* XENHCI_TRB_TYPE_NORMAL */ - /* BEI: Interrupts are inhibited until EOT */ - dword = XENHCI_TRB_3_CHAIN_BIT | XENHCI_TRB_3_CYCLE_BIT | - XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_NORMAL) | - XENHCI_TRB_3_BEI_BIT | - XENHCI_TRB_3_TBC_SET(temp->tbc) | - XENHCI_TRB_3_TLBPC_SET(temp->tlbpc); - if (temp->direction == UE_DIR_IN) - dword |= XENHCI_TRB_3_DIR_IN | XENHCI_TRB_3_ISP_BIT; - break; - } - td->td_trb[x].dwTrb3 = htole32(dword); - - average -= buf_res.length; - buf_offset += buf_res.length; -#ifdef USB_DEBUG - xhci_dump_trb(&td->td_trb[x]); -#endif - x++; - - } while (average != 0); - - td->td_trb[x-1].dwTrb3 |= htole32(XENHCI_TRB_3_IOC_BIT); - - /* store number of data TRB's */ - - td->ntrb = x; - - DPRINTF("NTRB=%u\n", x); - - /* fill out link TRB */ - - if (td_next != NULL) { - /* link the current TD with the next one */ - td->td_trb[x].qwTrb0 = htole64((uint64_t)td_next->td_self); - DPRINTF("LINK=0x%08llx\n", (long long)td_next->td_self); - } else { - /* this field will get updated later */ - DPRINTF("NOLINK\n"); - } - - dword = XENHCI_TRB_2_IRQ_SET(0); - - td->td_trb[x].dwTrb2 = htole32(dword); - - dword = XENHCI_TRB_3_TYPE_SET(XENHCI_TRB_TYPE_LINK) | - XENHCI_TRB_3_CYCLE_BIT | XENHCI_TRB_3_IOC_BIT; - - td->td_trb[x].dwTrb3 = htole32(dword); - - td->alt_next = td_alt_next; -#ifdef USB_DEBUG - xhci_dump_trb(&td->td_trb[x]); -#endif - usb_pc_cpu_flush(td->page_cache); - } - - if (precompute) { - precompute = 0; - - /* setup alt next pointer, if any */ - if (temp->last_frame) { - td_alt_next = NULL; - } else { - /* we use this field internally */ - td_alt_next = td_next; - } - - /* restore */ - temp->shortpkt = shortpkt_old; - temp->len = len_old; - goto restart; - } - - /* - * Remove cycle bit from the first TRB if we are - * stepping them: - */ - if (temp->step_td != 0) { - td_first->td_trb[0].dwTrb3 &= ~htole32(XENHCI_TRB_3_CYCLE_BIT); - usb_pc_cpu_flush(td_first->page_cache); - } - - /* remove chain bit because this is the last TRB in the chain */ - td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XENHCI_TRB_2_TDSZ_SET(15)); - td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XENHCI_TRB_3_CHAIN_BIT); - - usb_pc_cpu_flush(td->page_cache); +{//TODO + #ifdef XENUSB_BEBUG + printf("[xenusb_debug]xenhci.c: xenhci_setup_generic_chain_sub()\n"); + #endif - temp->td = td; - temp->td_next = td_next; } static void -xenhci_setup_generic_chain(struct usb_xfer *xfer) -{ - //struct xhci_std_temp temp; - struct xenhci_td *td; +xenhci_setup_generic_chain(struct usb_xfer *xfer, xenhci_qh_t **qh_last) +{//TODO + #ifdef XENUSB_BEBUG + printf("[xenusb_debug]xenhci.c: xenhci_setup_generic_chain()\n"); + #endif + + struct xenhci_std_temp temp; + struct usb_pipe_methods *methods; + xenhci_qh_t *qh; + xenhci_qtd_t *td; + uint32_t qh_endp; + uint32_t qh_endphub; uint32_t x; - uint32_t y; - uint8_t mult; - temp.do_isoc_sync = 0; - temp.step_td = 0; - temp.tbc = 0; - temp.tlbpc = 0; + DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", + xfer->address, UE_GET_ADDR(xfer->endpointno), + xfer->sumlen, usbd_get_speed(xfer->xroot->udev)); + temp.average = xfer->max_hc_frame_size; - temp.max_packet_size = xfer->max_packet_size; - temp.sc = XHCI_BUS2SC(xfer->xroot->bus); - temp.pc = NULL; - temp.last_frame = 0; - temp.offset = 0; - temp.multishort = xfer->flags_int.isochronous_xfr || - xfer->flags_int.control_xfr || - xfer->flags_int.short_frames_ok; + temp.max_frame_size = xfer->max_frame_size; + temp.sc = XENHCI_BUS2SC(xfer->xroot->bus); /* toggle the DMA set we are using */ xfer->flags_int.curr_dma_set ^= 1; @@ -1068,124 +555,62 @@ /* get next DMA set */ td = xfer->td_start[xfer->flags_int.curr_dma_set]; - temp.td = NULL; - temp.td_next = td; - xfer->td_transfer_first = td; xfer->td_transfer_cache = td; - if (xfer->flags_int.isochronous_xfr) { - uint8_t shift; - - /* compute multiplier for ISOCHRONOUS transfers */ - mult = xfer->endpoint->ecomp ? - UE_GET_SS_ISO_MULT(xfer->endpoint->ecomp->bmAttributes) - : 0; - /* check for USB 2.0 multiplier */ - if (mult == 0) { - mult = (xfer->endpoint->edesc-> - wMaxPacketSize[1] >> 3) & 3; - } - /* range check */ - if (mult > 2) - mult = 3; - else - mult++; - - //x = XREAD4(temp.sc, runt, XENHCI_MFINDEX); - x = 0; - - DPRINTF("MFINDEX=0x%08x\n", x); - - switch (usbd_get_speed(xfer->xroot->udev)) { - case USB_SPEED_FULL: - shift = 3; - temp.isoc_delta = 8; /* 1ms */ - x += temp.isoc_delta - 1; - x &= ~(temp.isoc_delta - 1); - break; - default: - shift = usbd_xfer_get_fps_shift(xfer); - temp.isoc_delta = 1U << shift; - x += temp.isoc_delta - 1; - x &= ~(temp.isoc_delta - 1); - /* simple frame load balancing */ - x += xfer->endpoint->usb_uframe; - break; - } - - y = XENHCI_MFINDEX_GET(x - xfer->endpoint->isoc_next); - - if ((xfer->endpoint->is_synced == 0) || - (y < (xfer->nframes << shift)) || - (XENHCI_MFINDEX_GET(-y) >= (128 * 8))) { - /* - * If there is data underflow or the pipe - * queue is empty we schedule the transfer a - * few frames ahead of the current frame - * position. Else two isochronous transfers - * might overlap. - */ - xfer->endpoint->isoc_next = XENHCI_MFINDEX_GET(x + (3 * 8)); - xfer->endpoint->is_synced = 1; - temp.do_isoc_sync = 1; + temp.td = NULL; + temp.td_next = td; + temp.qtd_status = 0; + temp.last_frame = 0; + temp.setup_alt_next = xfer->flags_int.short_frames_ok; - DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); + if (xfer->flags_int.control_xfr) { + if (xfer->endpoint->toggle_next) { + /* DATA1 is next */ + temp.qtd_status |= + htohc32(temp.sc, XENHCI_QTD_SET_TOGGLE(1)); } + temp.auto_data_toggle = 0; + } else { + temp.auto_data_toggle = 1; + } - /* compute isochronous completion time */ - - y = XENHCI_MFINDEX_GET(xfer->endpoint->isoc_next - (x & ~7)); - - xfer->isoc_time_complete = - usb_isoc_time_expand(&temp.sc->sc_bus, x / 8) + - (y / 8) + (((xfer->nframes << shift) + 7) / 8); - - x = 0; - temp.isoc_frame = xfer->endpoint->isoc_next; - temp.trb_type = XENHCI_TRB_TYPE_ISOCH; - - xfer->endpoint->isoc_next += xfer->nframes << shift; + if ((xfer->xroot->udev->parent_hs_hub != NULL) || + (xfer->xroot->udev->address != 0)) { + /* max 3 retries */ + temp.qtd_status |= + htohc32(temp.sc, XENHCI_QTD_SET_CERR(3)); + } + /* check if we should prepend a setup message */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 11:30:52 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3F55285E for ; Fri, 27 Sep 2013 11:30:52 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8D924FA for ; Fri, 27 Sep 2013 11:30:52 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RBUpqi016485 for ; Fri, 27 Sep 2013 11:30:51 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RBUph5016468 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 11:30:51 GMT (envelope-from bguan@FreeBSD.org) Date: Fri, 27 Sep 2013 11:30:51 GMT Message-Id: <201309271130.r8RBUph5016468@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257756 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 11:30:52 -0000 Author: bguan Date: Fri Sep 27 11:30:51 2013 New Revision: 257756 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257756 Log: create a thread to deal with USB request queue; get entry from the share ring; other little stuff work Modified: soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Modified: soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Fri Sep 27 10:47:22 2013 (r257755) +++ soc2013/bguan/head/sys/dev/xen/usbfront/usbfront.c Fri Sep 27 11:30:51 2013 (r257756) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -81,18 +82,21 @@ #include "xenbus_if.h" +#define XENHCI_VENDORID_XEN 0x0001 -static int usbfront_probe(device_t dev); -static int usbfront_attach(device_t dev); -static int usbfront_detach(device_t dev); -static int usbfront_suspend(device_t dev); -static int usbfront_resume(device_t dev); -static int talk_to_backend(device_t dev, struct xenhci_softc *sc); -static int setup_rings(device_t dev, struct xenhci_softc *sc); -static void destroy_rings(struct xenhci_softc *sc); -static void xenhci_notify_work(struct xenhci_softc *sc); -static void xu_intr(void *xsc); -static int usbfront_connect(device_t dev); +static int usbfront_probe(device_t dev); +static int usbfront_attach(device_t dev); +static int usbfront_detach(device_t dev); +static int usbfront_suspend(device_t dev); +static int usbfront_resume(device_t dev); +static int talk_to_backend(device_t dev, struct xenhci_softc *sc); +static int setup_rings(device_t dev, struct xenhci_softc *sc); +static void destroy_rings(struct xenhci_softc *sc); +static void xenhci_thread(void *arg); +static void xenhci_notify_work(struct xenhci_softc *sc); +static void xu_int(void *xsc); +static int usbfront_connect(device_t dev); +static void usbfront_free(struct xenhci_softc *sc); #define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) @@ -116,7 +120,7 @@ return (ENXIO); } -/* +/** * Setup supplies the backend dir, virtual device. We place an event * channel and shared frame entries. We watch backend to wait if it's * ok. @@ -192,11 +196,20 @@ sc->xb_dev = dev; sc->rh_numports = num_ports; sc->sc_noport = num_ports; - sprintf(sc->sc_vendor, "0x%04x", pci_get_vendor(dev)); + + switch (pci_get_vendor(dev)) { + case XENHCI_VENDORID_XEN: + sprintf(sc->sc_vendor, "Xen Device"); + break; + default: + DPRINTK("host controller vendor: 0x%x\n", pci_get_vendor(dev)); + sprintf(sc->sc_vendor, "0x%04x", pci_get_vendor(dev)); + } for (i = 0; i < USB_URB_RING_SIZE; i++) { sc->shadow[i].req.id = i + 1; - sc->shadow[i].urb = NULL; + //sc->shadow[i].urb = NULL; + sc->shadow[i].xfer = NULL; } sc->shadow[USB_URB_RING_SIZE-1].req.id = 0x0fff; @@ -250,12 +263,21 @@ DPRINTK("usbfront_detach: %s removed\n", xenbus_get_node(dev)); //TODO - //usbfront_free(sc); + usbfront_free(sc); + //mtx_destroy(&sc->xb_io_lock); + + xenhci_uninit(sc); return 0; } +static void +usbfront_free(struct xenhci_softc *sc) +{ + destroy_rings(sc); +} + static int usbfront_connect(device_t dev) @@ -271,18 +293,14 @@ //hcd = info_to_hcd(info); //snprintf(name, TASK_COMM_LEN, "xenhcd.%d", sc->sc_bus.busnum); - err = talk_to_backend(dev, sc); if (err) return err; - //sc->kthread = kthread_run(xenhcd_schedule, sc, name); - //if (IS_ERR(sc->kthread)) { - // err = PTR_ERR(sc->kthread); - // sc->kthread = NULL; - // xenbus_dev_fatal(dev, err, "Error creating thread"); - // return err; - //} + //err = kproc_create(xenhci_thread, sc, NULL, 0, 0, name); + err = kproc_create(xenhci_thread, sc, NULL, 0, 0, "xenhcd"); + if (err) + return err; /* prepare ring for hotplug notification */ for (idx = 0, i = 0; i < USB_CONN_RING_SIZE; i++) { @@ -372,7 +390,9 @@ } } -/* Common code used when first setting up, and when resuming. */ +/** + * Common code used when first setting up, and when resuming. + */ static int talk_to_backend(device_t dev, struct xenhci_softc *sc) { @@ -459,7 +479,9 @@ sc->conn_ring.sring = NULL; } -/* Create shared ring, alloc event channel. */ +/** + * Create shared ring, alloc event channel. + */ static int setup_rings(device_t dev, struct xenhci_softc *sc) { @@ -484,7 +506,6 @@ //sc->urb_ring.sring = NULL; goto fail; } - sc->urb_ring_ref = err; conn_sring = (usbif_conn_sring_t *)malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT|M_ZERO); if (!conn_sring) { @@ -500,17 +521,15 @@ //sc->conn_ring.sring = NULL; goto fail; } - sc->conn_ring_ref = err; err = bind_listening_port_to_irqhandler(xenbus_get_otherend_id(dev), - "xu", xu_intr, sc, INTR_TYPE_BIO | INTR_MPSAFE, &sc->irq); + "xu", xu_int, sc, INTR_TYPE_BIO | INTR_MPSAFE, &sc->irq); if (err) { xenbus_dev_fatal(dev, err, "bind_listening_port_to_irqhandler"); goto fail; } - sc->irq = err; return 0; fail: @@ -518,24 +537,228 @@ return err; } +//////////////////////////////////////////////// +static inline int get_id_from_freelist(struct xenhci_softc *sc) +{ + unsigned long free; + free = sc->shadow_free; + //BUG_ON(free >= USB_URB_RING_SIZE); //???? + sc->shadow_free = sc->shadow[free].req.id; + sc->shadow[free].req.id = (unsigned int)0x0fff; /* debug */ + return free; +} + +static inline void add_id_to_freelist(struct xenhci_softc *sc, + unsigned long id) +{ + sc->shadow[id].req.id = sc->shadow_free; + //sc->shadow[id].urb = NULL; + sc->shadow[id].xfer = NULL; + sc->shadow_free = id; +} + +static void xenhci_gnttab_done(struct usb_shadow *shadow) +{ + int nr_segs = 0; + int i; + + nr_segs = shadow->req.nr_buffer_segs; + + //??? + //if (usb_pipeisoc(shadow->req.pipe)) + nr_segs += shadow->req.u.isoc.nr_frame_desc_segs; + + for (i = 0; i < nr_segs; i++) + gnttab_end_foreign_access(shadow->req.seg[i].gref, 0UL); + + shadow->req.nr_buffer_segs = 0; + shadow->req.u.isoc.nr_frame_desc_segs = 0; +} + +/* +static void xenhci_giveback_urb(struct usbfront_info *info, struct urb *urb, int status) +} +*/ + + +/** + * Get response data from the backend + */ +static int +xenhci_xfer_request_done(struct xenhci_softc *sc) +{ + usbif_urb_response_t *resp; + //struct urb *urb; + struct usb_xfer *xfer; + + RING_IDX i, rp; + uint16_t id; + int more_req = 0; + + mtx_lock(&sc->lock); + rp = sc->urb_ring.sring->rsp_prod; + //rmb();??? /* ensure we see queued responses up to "rp" */ + + for (i = sc->urb_ring.rsp_cons; i != rp; i++) { + resp = RING_GET_RESPONSE(&sc->urb_ring, i); + id = resp->id; + + if (likely(usbif_pipesubmit(sc->shadow[id].req.pipe))) { + xenhci_gnttab_done(&sc->shadow[id]); + //urb = sc->shadow[id].urb; + xfer = sc->shadow[id].xfer; + //barrier(); + //if (likely(urb)) { + + //if (urb) { + if (xfer) { + //TODO + //xfer-> + + //urb->actual_length = resp->actual_length; + //urb->error_count = resp->error_count; + //urb->start_frame = resp->start_frame; + + //barrier(); + //xenhci_giveback_urb(sc, urb, resp->status); //??? + } + } + + add_id_to_freelist(sc, id); + } + sc->urb_ring.rsp_cons = i; + + if (i != sc->urb_ring.req_prod_pvt) + RING_FINAL_CHECK_FOR_RESPONSES(&sc->urb_ring, more_req); + else + sc->urb_ring.sring->rsp_event = i + 1; + + mtx_unlock(&sc->lock); + + //cond_resched(); + + return more_req; +} + +static int +xenhci_conn_notify(struct xenhci_softc *sc) +{ + usbif_conn_response_t *res; + usbif_conn_request_t *req; + RING_IDX rc, rp; + uint16_t id; + uint8_t portnum, speed; + int more_req = 0; + int notify; + int port_changed = 0; + //unsigned long flags; + + //spin_lock_irqsave(&sc->lock, flags); + mtx_lock(&sc->lock); + + rc = sc->conn_ring.rsp_cons; + rp = sc->conn_ring.sring->rsp_prod; + rmb(); /* ensure we see queued responses up to "rp" */ + + while (rc != rp) { + res = RING_GET_RESPONSE(&sc->conn_ring, rc); + id = res->id; + portnum = res->portnum; + speed = res->speed; + sc->conn_ring.rsp_cons = ++rc; + + //rhport_connect(sc, portnum, speed); + sc->ports[portnum-1].c_connection = 1; + if (sc->ports[portnum-1].c_connection) + port_changed = 1; + + //barrier(); + + req = RING_GET_REQUEST(&sc->conn_ring, sc->conn_ring.req_prod_pvt); + req->id = id; + sc->conn_ring.req_prod_pvt++; + } + + if (rc != sc->conn_ring.req_prod_pvt) + RING_FINAL_CHECK_FOR_RESPONSES(&sc->conn_ring, more_req); + else + sc->conn_ring.sring->rsp_event = rc + 1; + + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->conn_ring, notify); + if (notify) + notify_remote_via_irq(sc->irq); + + //spin_unlock_irqrestore(&sc->lock, flags); + mtx_unlock(&sc->lock); + + if (port_changed) { + //usb_hcd_poll_rh_status(sc_to_hcd(sc)); + printf("[gbtest]usb_hcd_poll_rh_status(sc_to_hcd(sc))???????????\n"); + } + //cond_resched(); + + return more_req; +} + +/** + * A thread to deal with the USB req queue. + * Get the reply data from share ring. + */ +static void +xenhci_thread(void *arg) +{ + struct xenhci_softc *sc = (struct xenhci_softc *) arg; + + for (;;) { + while(sc->waiting_resp == 0) {}; + sc->waiting_resp = 0; + + if (xenhci_xfer_request_done(sc)) + sc->waiting_resp = 1; + + if (xenhci_conn_notify(sc)) + sc->waiting_resp = 1; + +/* //mtx_lock(&xs.watch_events_lock); + //mtx_unlock(&xs.watch_events_lock); + + //??? + wait_event_interruptible( + info->wq, + info->waiting_resp || kthread_should_stop()); + info->waiting_resp = 0; + smp_mb(); + + if (xenhci_urb_request_done(sc)) + info->waiting_resp = 1; + + if (xenhci_conn_notify(sc)) + info->waiting_resp = 1; + +*/ //??? + } +} + static void xenhci_notify_work(struct xenhci_softc *sc) { printf("[gbdebug-pvusb]xenhci_notify_work()\n"); sc->waiting_resp = 1; - wakeup(&sc->wait_taskqueue); + wakeup(&sc->wait_taskqueue);//???? } static void -xu_intr(void *xsc) +xu_int(void *xsc) { - printf("[gbdebug-pvusb]xu_intr()\n"); + printf("[gbdebug-pvusb]xu_int()\n"); struct xenhci_softc *sc = xsc; xenhci_notify_work(sc); } -/* ** Driver registration ** */ +/** + * ** Driver registration ** + */ static device_method_t usbfront_methods[] = { /* Device interface */ DEVMETHOD(device_probe, usbfront_probe), From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 11:31:04 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D215E86E for ; Fri, 27 Sep 2013 11:31:04 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0E3A24FC for ; Fri, 27 Sep 2013 11:31:04 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RBV4Ne021272 for ; Fri, 27 Sep 2013 11:31:04 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RBV4Xp021270 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 11:31:04 GMT (envelope-from bguan@FreeBSD.org) Date: Fri, 27 Sep 2013 11:31:04 GMT Message-Id: <201309271131.r8RBV4Xp021270@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257757 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 11:31:04 -0000 Author: bguan Date: Fri Sep 27 11:31:04 2013 New Revision: 257757 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257757 Log: set the pipe methods for xen usb host controller Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Fri Sep 27 11:30:51 2013 (r257756) +++ soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Fri Sep 27 11:31:04 2013 (r257757) @@ -33,11 +33,13 @@ #include #include +#define XENUSB_BEBUG + #define XENHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) #define XENHCI_PAGE_SIZE 4096 /* bytes */ -//#define TASK_COMM_LEN 16 /* Task command name length */ +#define TASK_COMM_LEN 16 /* Task command name length (taken from Linux)*/ #define GRANT_INVALID_REF 0 @@ -61,10 +63,421 @@ LIST_HEAD(list_head, list_head); + +#define XENHCI_MAX_ENDPOINTS 32 /* hardcoded - do not change */ +#define XENHCI_MAX_EVENTS (16 * 13) +#define XENHCI_MAX_COMMANDS (16 * 1) +#define XENHCI_MAX_RSEG 1 +#define XENHCI_MAX_TRANSFERS 4 + +#if USB_MAX_EP_STREAMS == 8 +#define XENHCI_MAX_STREAMS 8 +#define XENHCI_MAX_STREAMS_LOG 3 +#elif USB_MAX_EP_STREAMS == 1 +#define XENHCI_MAX_STREAMS 1 +#define XENHCI_MAX_STREAMS_LOG 0 +#else +#error "The USB_MAX_EP_STREAMS value is not supported." +#endif + +#define XENHCI_TRB_ALIGN 16 /* bytes */ +#define XENHCI_TD_ALIGN 64 /* bytes */ + +#define XENHCI_TD_PAGE_NBUF 17 /* units, room enough for 64Kbytes */ +#define XENHCI_TD_PAGE_SIZE 4096 /* bytes */ +#define XENHCI_TD_PAYLOAD_MAX (XENHCI_TD_PAGE_SIZE * (XENHCI_TD_PAGE_NBUF - 1)) + +struct xenhci_trb { + volatile uint64_t qwTrb0; +#define XENHCI_TRB_0_WLENGTH_MASK (0xFFFFULL << 48) + volatile uint32_t dwTrb2; +#define XENHCI_TRB_2_ERROR_GET(x) (((x) >> 24) & 0xFF) +#define XENHCI_TRB_2_ERROR_SET(x) (((x) & 0xFF) << 24) +#define XENHCI_TRB_2_TDSZ_GET(x) (((x) >> 17) & 0x1F) +#define XENHCI_TRB_2_TDSZ_SET(x) (((x) & 0x1F) << 17) +#define XENHCI_TRB_2_REM_GET(x) ((x) & 0xFFFFFF) +#define XENHCI_TRB_2_REM_SET(x) ((x) & 0xFFFFFF) +#define XENHCI_TRB_2_BYTES_GET(x) ((x) & 0x1FFFF) +#define XENHCI_TRB_2_BYTES_SET(x) ((x) & 0x1FFFF) +#define XENHCI_TRB_2_IRQ_GET(x) (((x) >> 22) & 0x3FF) +#define XENHCI_TRB_2_IRQ_SET(x) (((x) & 0x3FF) << 22) +#define XENHCI_TRB_2_STREAM_GET(x) (((x) >> 16) & 0xFFFF) +#define XENHCI_TRB_2_STREAM_SET(x) (((x) & 0xFFFF) << 16) + + volatile uint32_t dwTrb3; +#define XENHCI_TRB_3_TYPE_GET(x) (((x) >> 10) & 0x3F) +#define XENHCI_TRB_3_TYPE_SET(x) (((x) & 0x3F) << 10) +#define XENHCI_TRB_3_CYCLE_BIT (1U << 0) +#define XENHCI_TRB_3_TC_BIT (1U << 1) /* command ring only */ +#define XENHCI_TRB_3_ENT_BIT (1U << 1) /* transfer ring only */ +#define XENHCI_TRB_3_ISP_BIT (1U << 2) +#define XENHCI_TRB_3_NSNOOP_BIT (1U << 3) +#define XENHCI_TRB_3_CHAIN_BIT (1U << 4) +#define XENHCI_TRB_3_IOC_BIT (1U << 5) +#define XENHCI_TRB_3_IDT_BIT (1U << 6) +#define XENHCI_TRB_3_TBC_GET(x) (((x) >> 7) & 3) +#define XENHCI_TRB_3_TBC_SET(x) (((x) & 3) << 7) +#define XENHCI_TRB_3_BEI_BIT (1U << 9) +#define XENHCI_TRB_3_DCEP_BIT (1U << 9) +#define XENHCI_TRB_3_PRSV_BIT (1U << 9) +#define XENHCI_TRB_3_BSR_BIT (1U << 9) +#define XENHCI_TRB_3_TRT_MASK (3U << 16) +#define XENHCI_TRB_3_TRT_NONE (0U << 16) +#define XENHCI_TRB_3_TRT_OUT (2U << 16) +#define XENHCI_TRB_3_TRT_IN (3U << 16) +#define XENHCI_TRB_3_DIR_IN (1U << 16) +#define XENHCI_TRB_3_TLBPC_GET(x) (((x) >> 16) & 0xF) +#define XENHCI_TRB_3_TLBPC_SET(x) (((x) & 0xF) << 16) +#define XENHCI_TRB_3_EP_GET(x) (((x) >> 16) & 0x1F) +#define XENHCI_TRB_3_EP_SET(x) (((x) & 0x1F) << 16) +#define XENHCI_TRB_3_FRID_GET(x) (((x) >> 20) & 0x7FF) +#define XENHCI_TRB_3_FRID_SET(x) (((x) & 0x7FF) << 20) +#define XENHCI_TRB_3_ISO_SIA_BIT (1U << 31) +#define XENHCI_TRB_3_SUSP_EP_BIT (1U << 23) +#define XENHCI_TRB_3_SLOT_GET(x) (((x) >> 24) & 0xFF) +#define XENHCI_TRB_3_SLOT_SET(x) (((x) & 0xFF) << 24) + +/* Commands */ +#define XENHCI_TRB_TYPE_RESERVED 0x00 +#define XENHCI_TRB_TYPE_NORMAL 0x01 +#define XENHCI_TRB_TYPE_SETUP_STAGE 0x02 +#define XENHCI_TRB_TYPE_DATA_STAGE 0x03 +#define XENHCI_TRB_TYPE_STATUS_STAGE 0x04 +#define XENHCI_TRB_TYPE_ISOCH 0x05 +#define XENHCI_TRB_TYPE_LINK 0x06 +#define XENHCI_TRB_TYPE_EVENT_DATA 0x07 +#define XENHCI_TRB_TYPE_NOOP 0x08 +#define XENHCI_TRB_TYPE_ENABLE_SLOT 0x09 +#define XENHCI_TRB_TYPE_DISABLE_SLOT 0x0A +#define XENHCI_TRB_TYPE_ADDRESS_DEVICE 0x0B +#define XENHCI_TRB_TYPE_CONFIGURE_EP 0x0C +#define XENHCI_TRB_TYPE_EVALUATE_CTX 0x0D +#define XENHCI_TRB_TYPE_RESET_EP 0x0E +#define XENHCI_TRB_TYPE_STOP_EP 0x0F +#define XENHCI_TRB_TYPE_SET_TR_DEQUEUE 0x10 +#define XENHCI_TRB_TYPE_RESET_DEVICE 0x11 +#define XENHCI_TRB_TYPE_FORCE_EVENT 0x12 +#define XENHCI_TRB_TYPE_NEGOTIATE_BW 0x13 +#define XENHCI_TRB_TYPE_SET_LATENCY_TOL 0x14 +#define XENHCI_TRB_TYPE_GET_PORT_BW 0x15 +#define XENHCI_TRB_TYPE_FORCE_HEADER 0x16 +#define XENHCI_TRB_TYPE_NOOP_CMD 0x17 + +/* Events */ +#define XENHCI_TRB_EVENT_TRANSFER 0x20 +#define XENHCI_TRB_EVENT_CMD_COMPLETE 0x21 +#define XENHCI_TRB_EVENT_PORT_STS_CHANGE 0x22 +#define XENHCI_TRB_EVENT_BW_REQUEST 0x23 +#define XENHCI_TRB_EVENT_DOORBELL 0x24 +#define XENHCI_TRB_EVENT_HOST_CTRL 0x25 +#define XENHCI_TRB_EVENT_DEVICE_NOTIFY 0x26 +#define XENHCI_TRB_EVENT_MFINDEX_WRAP 0x27 + +/* Error codes */ +#define XENHCI_TRB_ERROR_INVALID 0x00 +#define XENHCI_TRB_ERROR_SUCCESS 0x01 +#define XENHCI_TRB_ERROR_DATA_BUF 0x02 +#define XENHCI_TRB_ERROR_BABBLE 0x03 +#define XENHCI_TRB_ERROR_XACT 0x04 +#define XENHCI_TRB_ERROR_TRB 0x05 +#define XENHCI_TRB_ERROR_STALL 0x06 +#define XENHCI_TRB_ERROR_RESOURCE 0x07 +#define XENHCI_TRB_ERROR_BANDWIDTH 0x08 +#define XENHCI_TRB_ERROR_NO_SLOTS 0x09 +#define XENHCI_TRB_ERROR_STREAM_TYPE 0x0A +#define XENHCI_TRB_ERROR_SLOT_NOT_ON 0x0B +#define XENHCI_TRB_ERROR_ENDP_NOT_ON 0x0C +#define XENHCI_TRB_ERROR_SHORT_PKT 0x0D +#define XENHCI_TRB_ERROR_RING_UNDERRUN 0x0E +#define XENHCI_TRB_ERROR_RING_OVERRUN 0x0F +#define XENHCI_TRB_ERROR_VF_RING_FULL 0x10 +#define XENHCI_TRB_ERROR_PARAMETER 0x11 +#define XENHCI_TRB_ERROR_BW_OVERRUN 0x12 +#define XENHCI_TRB_ERROR_CONTEXT_STATE 0x13 +#define XENHCI_TRB_ERROR_NO_PING_RESP 0x14 +#define XENHCI_TRB_ERROR_EV_RING_FULL 0x15 +#define XENHCI_TRB_ERROR_INCOMPAT_DEV 0x16 +#define XENHCI_TRB_ERROR_MISSED_SERVICE 0x17 +#define XENHCI_TRB_ERROR_CMD_RING_STOP 0x18 +#define XENHCI_TRB_ERROR_CMD_ABORTED 0x19 +#define XENHCI_TRB_ERROR_STOPPED 0x1A +#define XENHCI_TRB_ERROR_LENGTH 0x1B +#define XENHCI_TRB_ERROR_BAD_MELAT 0x1D +#define XENHCI_TRB_ERROR_ISOC_OVERRUN 0x1F +#define XENHCI_TRB_ERROR_EVENT_LOST 0x20 +#define XENHCI_TRB_ERROR_UNDEFINED 0x21 +#define XENHCI_TRB_ERROR_INVALID_SID 0x22 +#define XENHCI_TRB_ERROR_SEC_BW 0x23 +#define XENHCI_TRB_ERROR_SPLIT_XACT 0x24 +} __aligned(4); + +struct xenhci_td { + struct xenhci_trb td_trb[XENHCI_TD_PAGE_NBUF + 1]; + +/* + * Extra information needed: + */ + uint64_t td_self; + struct xenhci_td *next; + struct xenhci_td *alt_next; + struct xenhci_td *obj_next; + struct usb_page_cache *page_cache; + uint32_t len; + uint32_t remainder; + uint8_t ntrb; + uint8_t status; +} __aligned(XENHCI_TRB_ALIGN); + +enum { + XENHCI_ST_DISABLED, + XENHCI_ST_ENABLED, + XENHCI_ST_DEFAULT, + XENHCI_ST_ADDRESSED, + XENHCI_ST_CONFIGURED, + XENHCI_ST_MAX +}; + +struct xenhci_event_ring_seg { + volatile uint64_t qwEvrsTablePtr; + volatile uint32_t dwEvrsTableSize; + volatile uint32_t dwEvrsReserved; +}; + +struct xenhci_hw_root { + struct xenhci_event_ring_seg hwr_ring_seg[XENHCI_MAX_RSEG]; + struct { + volatile uint64_t dummy; + } __aligned(64) padding; + struct xenhci_trb hwr_events[XENHCI_MAX_EVENTS]; + struct xenhci_trb hwr_commands[XENHCI_MAX_COMMANDS]; +}; + +struct xenhci_endpoint_ext { + struct xenhci_trb *trb; + struct usb_xfer *xfer[XENHCI_MAX_TRANSFERS * XENHCI_MAX_STREAMS]; + struct usb_page_cache *page_cache; + uint64_t physaddr; + uint8_t trb_used[XENHCI_MAX_STREAMS]; + uint8_t trb_index[XENHCI_MAX_STREAMS]; + uint8_t trb_halted; + uint8_t trb_running; + uint8_t trb_ep_mode; +}; +///////////////////////////////////////////// + +#define XENHCI_VIRTUAL_FRAMELIST_COUNT 128 /* units */ + + +/* Link types */ +#define XENHCI_LINK_TERMINATE 0x00000001 + + +/* + * Isochronous Transfer Descriptor. This descriptor is used for high speed + * transfers only. + */ +struct xenhci_itd { + volatile uint32_t itd_next; + volatile uint32_t itd_status[8]; +#define XENHCI_ITD_SET_LEN(x) ((x) << 16) +#define XENHCI_ITD_GET_LEN(x) (((x) >> 16) & 0xFFF) +#define XENHCI_ITD_IOC (1 << 15) +#define XENHCI_ITD_SET_PG(x) ((x) << 12) +#define XENHCI_ITD_GET_PG(x) (((x) >> 12) & 0x7) +#define XENHCI_ITD_SET_OFFS(x) (x) +#define XENHCI_ITD_GET_OFFS(x) (((x) >> 0) & 0xFFF) +#define XENHCI_ITD_ACTIVE (1 << 31) +#define XENHCI_ITD_DATABUFERR (1 << 30) +#define XENHCI_ITD_BABBLE (1 << 29) +#define XENHCI_ITD_XACTERR (1 << 28) + volatile uint32_t itd_bp[7]; + /* itd_bp[0] */ +#define XENHCI_ITD_SET_ADDR(x) (x) +#define XENHCI_ITD_GET_ADDR(x) (((x) >> 0) & 0x7F) +#define XENHCI_ITD_SET_ENDPT(x) ((x) << 8) +#define XENHCI_ITD_GET_ENDPT(x) (((x) >> 8) & 0xF) + /* itd_bp[1] */ +#define XENHCI_ITD_SET_DIR_IN (1 << 11) +#define XENHCI_ITD_SET_DIR_OUT (0 << 11) +#define XENHCI_ITD_SET_MPL(x) (x) +#define XENHCI_ITD_GET_MPL(x) (((x) >> 0) & 0x7FF) + volatile uint32_t itd_bp_hi[7]; +/* + * Extra information needed: + */ + uint32_t itd_self; + struct xenhci_itd *next; + struct xenhci_itd *prev; + struct xenhci_itd *obj_next; + struct usb_page_cache *page_cache; +} __aligned(XENHCI_ITD_ALIGN); + +typedef struct xenhci_itd xenhci_itd_t; + +/* + * Split Transaction Isochronous Transfer Descriptor. This descriptor is used + * for full speed transfers only. + */ +struct xenhci_sitd { + volatile uint32_t sitd_next; + volatile uint32_t sitd_portaddr; +#define XENHCI_SITD_SET_DIR_OUT (0 << 31) +#define XENHCI_SITD_SET_DIR_IN (1 << 31) +#define XENHCI_SITD_SET_ADDR(x) (x) +#define XENHCI_SITD_GET_ADDR(x) ((x) & 0x7F) +#define XENHCI_SITD_SET_ENDPT(x) ((x) << 8) +#define XENHCI_SITD_GET_ENDPT(x) (((x) >> 8) & 0xF) +#define XENHCI_SITD_GET_DIR(x) ((x) >> 31) +#define XENHCI_SITD_SET_PORT(x) ((x) << 24) +#define XENHCI_SITD_GET_PORT(x) (((x) >> 24) & 0x7F) +#define XENHCI_SITD_SET_HUBA(x) ((x) << 16) +#define XENHCI_SITD_GET_HUBA(x) (((x) >> 16) & 0x7F) + volatile uint32_t sitd_mask; +#define XENHCI_SITD_SET_SMASK(x) (x) +#define XENHCI_SITD_SET_CMASK(x) ((x) << 8) + volatile uint32_t sitd_status; +#define XENHCI_SITD_COMPLETE_SPLIT (1<<1) +#define XENHCI_SITD_START_SPLIT (0<<1) +#define XENHCI_SITD_MISSED_MICRO_FRAME (1<<2) +#define XENHCI_SITD_XACTERR (1<<3) +#define XENHCI_SITD_BABBLE (1<<4) +#define XENHCI_SITD_DATABUFERR (1<<5) +#define XENHCI_SITD_ERROR (1<<6) +#define XENHCI_SITD_ACTIVE (1<<7) +#define XENHCI_SITD_IOC (1<<31) +#define XENHCI_SITD_SET_LEN(len) ((len)<<16) +#define XENHCI_SITD_GET_LEN(x) (((x)>>16) & 0x3FF) + volatile uint32_t sitd_bp[2]; + volatile uint32_t sitd_back; + volatile uint32_t sitd_bp_hi[2]; +/* + * Extra information needed: + */ + uint32_t sitd_self; + struct xenhci_sitd *next; + struct xenhci_sitd *prev; + struct xenhci_sitd *obj_next; + struct usb_page_cache *page_cache; +} __aligned(XENHCI_SITD_ALIGN); + +typedef struct xenhci_sitd xenhci_sitd_t; + +/* Queue Element Transfer Descriptor */ +struct xenhci_qtd { + volatile uint32_t qtd_next; + volatile uint32_t qtd_altnext; + volatile uint32_t qtd_status; +#define XENHCI_QTD_GET_STATUS(x) (((x) >> 0) & 0xff) +#define XENHCI_QTD_SET_STATUS(x) ((x) << 0) +#define XENHCI_QTD_ACTIVE 0x80 +#define XENHCI_QTD_HALTED 0x40 +#define XENHCI_QTD_BUFERR 0x20 +#define XENHCI_QTD_BABBLE 0x10 +#define XENHCI_QTD_XACTERR 0x08 +#define XENHCI_QTD_MISSEDMICRO 0x04 +#define XENHCI_QTD_SPLITXSTATE 0x02 +#define XENHCI_QTD_PINGSTATE 0x01 +#define XENHCI_QTD_STATERRS 0x74 +#define XENHCI_QTD_GET_PID(x) (((x) >> 8) & 0x3) +#define XENHCI_QTD_SET_PID(x) ((x) << 8) +#define XENHCI_QTD_PID_OUT 0x0 +#define XENHCI_QTD_PID_IN 0x1 +#define XENHCI_QTD_PID_SETUP 0x2 +#define XENHCI_QTD_GET_CERR(x) (((x) >> 10) & 0x3) +#define XENHCI_QTD_SET_CERR(x) ((x) << 10) +#define XENHCI_QTD_GET_C_PAGE(x) (((x) >> 12) & 0x7) +#define XENHCI_QTD_SET_C_PAGE(x) ((x) << 12) +#define XENHCI_QTD_GET_IOC(x) (((x) >> 15) & 0x1) +#define XENHCI_QTD_IOC 0x00008000 +#define XENHCI_QTD_GET_BYTES(x) (((x) >> 16) & 0x7fff) +#define XENHCI_QTD_SET_BYTES(x) ((x) << 16) +#define XENHCI_QTD_GET_TOGGLE(x) (((x) >> 31) & 0x1) +#define XENHCI_QTD_SET_TOGGLE(x) ((x) << 31) +#define XENHCI_QTD_TOGGLE_MASK 0x80000000 +#define XENHCI_QTD_NBUFFERS 5 +#define XENHCI_QTD_PAYLOAD_MAX ((XENHCI_QTD_NBUFFERS-1)*XENHCI_PAGE_SIZE) + volatile uint32_t qtd_buffer[XENHCI_QTD_NBUFFERS]; + volatile uint32_t qtd_buffer_hi[XENHCI_QTD_NBUFFERS]; +/* + * Extra information needed: + */ + struct xenhci_qtd *alt_next; + struct xenhci_qtd *obj_next; + struct usb_page_cache *page_cache; + uint32_t qtd_self; + uint16_t len; +} __aligned(XENHCI_QTD_ALIGN); + +typedef struct xenhci_qtd xenhci_qtd_t; + +/* Queue Head Sub Structure */ +struct xenhci_qh_sub { + volatile uint32_t qtd_next; + volatile uint32_t qtd_altnext; + volatile uint32_t qtd_status; + volatile uint32_t qtd_buffer[XENHCI_QTD_NBUFFERS]; + volatile uint32_t qtd_buffer_hi[XENHCI_QTD_NBUFFERS]; +} __aligned(4); + +/* Queue Head */ +struct xenhci_qh { + volatile uint32_t qh_link; + volatile uint32_t qh_endp; +#define XENHCI_QH_GET_ADDR(x) (((x) >> 0) & 0x7f) /* endpoint addr */ +#define XENHCI_QH_SET_ADDR(x) (x) +#define XENHCI_QH_ADDRMASK 0x0000007f +#define XENHCI_QH_GET_INACT(x) (((x) >> 7) & 0x01) /* inactivate on next */ +#define XENHCI_QH_INACT 0x00000080 +#define XENHCI_QH_GET_ENDPT(x) (((x) >> 8) & 0x0f) /* endpoint no */ +#define XENHCI_QH_SET_ENDPT(x) ((x) << 8) +#define XENHCI_QH_GET_EPS(x) (((x) >> 12) & 0x03) /* endpoint speed */ +#define XENHCI_QH_SET_EPS(x) ((x) << 12) +#define XENHCI_QH_SPEED_FULL 0x0 +#define XENHCI_QH_SPEED_LOW 0x1 +#define XENHCI_QH_SPEED_HIGH 0x2 +#define XENHCI_QH_GET_DTC(x) (((x) >> 14) & 0x01) /* data toggle control */ +#define XENHCI_QH_DTC 0x00004000 +#define XENHCI_QH_GET_HRECL(x) (((x) >> 15) & 0x01) /* head of reclamation */ +#define XENHCI_QH_HRECL 0x00008000 +#define XENHCI_QH_GET_MPL(x) (((x) >> 16) & 0x7ff) /* max packet len */ +#define XENHCI_QH_SET_MPL(x) ((x) << 16) +#define XENHCI_QH_MPLMASK 0x07ff0000 +#define XENHCI_QH_GET_CTL(x) (((x) >> 27) & 0x01) /* control endpoint */ +#define XENHCI_QH_CTL 0x08000000 +#define XENHCI_QH_GET_NRL(x) (((x) >> 28) & 0x0f) /* NAK reload */ +#define XENHCI_QH_SET_NRL(x) ((x) << 28) + volatile uint32_t qh_endphub; +#define XENHCI_QH_GET_SMASK(x) (((x) >> 0) & 0xff) /* intr sched mask */ +#define XENHCI_QH_SET_SMASK(x) ((x) << 0) +#define XENHCI_QH_GET_CMASK(x) (((x) >> 8) & 0xff) /* split completion mask */ +#define XENHCI_QH_SET_CMASK(x) ((x) << 8) +#define XENHCI_QH_GET_HUBA(x) (((x) >> 16) & 0x7f) /* hub address */ +#define XENHCI_QH_SET_HUBA(x) ((x) << 16) +#define XENHCI_QH_GET_PORT(x) (((x) >> 23) & 0x7f) /* hub port */ +#define XENHCI_QH_SET_PORT(x) ((x) << 23) +#define XENHCI_QH_GET_MULT(x) (((x) >> 30) & 0x03) /* pipe multiplier */ +#define XENHCI_QH_SET_MULT(x) ((x) << 30) + volatile uint32_t qh_curqtd; + struct xenhci_qh_sub qh_qtd; +/* + * Extra information needed: + */ + struct xenhci_qh *next; + struct xenhci_qh *prev; + struct xenhci_qh *obj_next; + struct usb_page_cache *page_cache; + uint32_t qh_self; +} __aligned(XENHCI_QH_ALIGN); + +typedef struct xenhci_qh xenhci_qh_t; + +///////////////////////////////////////////// + /* ring request shadow */ struct usb_shadow { usbif_urb_request_t req; - struct urb *urb; + //struct urb *urb; + struct usb_xfer *xfer; }; /* virtual roothub port status */ @@ -103,7 +516,7 @@ union xenhci_hub_desc { struct usb_status stat; struct usb_port_status ps; - //struct usb_hub_ss_descriptor hubd; + struct usb_hub_descriptor hubd; uint8_t temp[128]; }; @@ -132,9 +545,11 @@ struct usb_callout sc_callout; union xenhci_hub_desc sc_hub_desc; + struct sx sc_cmd_sx;//TODO??? + struct usb_device *sc_devices[XENHCI_MAX_DEVICES]; - /* number of XHCI device slots */ + /* number of XENHCI device slots */ uint8_t sc_noslot; /* number of ports on root HUB */ uint8_t sc_noport; //<32 in xen @@ -143,10 +558,18 @@ /* root HUB device configuration */ uint8_t sc_conf; uint8_t sc_hub_idata[2]; + /* device configuration */ + uint8_t sc_addr; /* vendor string for root HUB */ char sc_vendor[16]; + // usb transfer + struct xenhci_qh *sc_async_p_last; + struct xenhci_qh *sc_intr_p_last[XENHCI_VIRTUAL_FRAMELIST_COUNT]; + struct xenhci_sitd *sc_isoc_fs_p_last[XENHCI_VIRTUAL_FRAMELIST_COUNT]; + struct xenhci_itd *sc_isoc_hs_p_last[XENHCI_VIRTUAL_FRAMELIST_COUNT]; + /* Virtual Host Controller has 4 urb queues */ LIST_ENTRY(list_head) pending_submit_list; //?? @@ -179,14 +602,44 @@ unsigned long shadow_free; /* ring response thread */ - struct task *kthread;//struct task_struct *kthread; + //struct task *kthread;//struct task_struct *kthread; //LIST_ENTRY(list_head) *wait_list; //wait_queue_head_t wq;?? struct taskqueue *wait_taskqueue; unsigned int waiting_resp;// }; +#define XENHCI_CMD_LOCK(sc) sx_xlock(&(sc)->sc_cmd_sx) +#define XENHCI_CMD_UNLOCK(sc) sx_xunlock(&(sc)->sc_cmd_sx) + +/* + * Normal little-endian only conversion routines. + */ +static __inline uint32_t +htohc32(const struct xenhci_softc *sc, const uint32_t v) +{ + return htole32(v); +} + +static __inline uint16_t +htohc16(const struct xenhci_softc *sc, const uint16_t v) +{ + return htole16(v); +} + +static __inline uint32_t +hc32toh(const struct xenhci_softc *sc, const uint32_t v) +{ + return le32toh(v); +} + +static __inline uint16_t +hc16toh(const struct xenhci_softc *sc, const uint16_t v) +{ + return le16toh(v); +} /* prototypes */ -usb_error_t xenhci_init(struct xenhci_softc *, device_t); +usb_error_t xenhci_init(struct xenhci_softc *, device_t); +void xenhci_uninit(struct xenhci_softc *); #endif /* _USBFRONT_H_ */ From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 11:31:18 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0541A87E for ; Fri, 27 Sep 2013 11:31:18 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D797A24FE for ; Fri, 27 Sep 2013 11:31:17 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RBVHs1021356 for ; Fri, 27 Sep 2013 11:31:17 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RBVHF8021354 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 11:31:17 GMT (envelope-from bguan@FreeBSD.org) Date: Fri, 27 Sep 2013 11:31:17 GMT Message-Id: <201309271131.r8RBVHF8021354@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257758 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 11:31:18 -0000 Author: bguan Date: Fri Sep 27 11:31:17 2013 New Revision: 257758 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257758 Log: set the pipe methods for xen usb host controller Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Fri Sep 27 11:31:04 2013 (r257757) +++ soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Fri Sep 27 11:31:17 2013 (r257758) @@ -1,8 +1,6 @@ -/* $FreeBSD: head/sys/dev/xen/usbfront/xenhcireg.h 251252 2013-06-02 12:00:16Z hselasky $ */ - /*- * Copyright (c) 2013 Bei Guan. All rights reserved. - * Taken from the dev/usb/controller/xhcireg.h + * Take from the dev/usb/controller/xhcireg.h * TODO Need to modify as required. * * Redistribution and use in source and binary forms, with or without @@ -30,89 +28,7 @@ #ifndef _XENHCIREG_H_ #define _XENHCIREG_H_ -/* XHCI PCI config registers */ -#define PCI_XHCI_CBMEM 0x10 /* configuration base MEM */ -#define PCI_XHCI_USBREV 0x60 /* RO USB protocol revision */ -#define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ -#define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ - -#define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ -#define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ - -/* XHCI capability registers */ -#define XHCI_CAPLENGTH 0x00 /* RO capability */ -#define XHCI_RESERVED 0x01 /* Reserved */ -#define XHCI_HCIVERSION 0x02 /* RO Interface version number */ -#define XHCI_HCIVERSION_0_9 0x0090 /* xHCI version 0.9 */ -#define XHCI_HCIVERSION_1_0 0x0100 /* xHCI version 1.0 */ -#define XHCI_HCSPARAMS1 0x04 /* RO structual parameters 1 */ -#define XHCI_HCS1_DEVSLOT_MAX(x)((x) & 0xFF) -#define XHCI_HCS1_IRQ_MAX(x) (((x) >> 8) & 0x3FF) -#define XHCI_HCS1_N_PORTS(x) (((x) >> 24) & 0xFF) -#define XHCI_HCSPARAMS2 0x08 /* RO structual parameters 2 */ -#define XHCI_HCS2_IST(x) ((x) & 0xF) -#define XHCI_HCS2_ERST_MAX(x) (((x) >> 4) & 0xF) -#define XHCI_HCS2_SPR(x) (((x) >> 24) & 0x1) -#define XHCI_HCS2_SPB_MAX(x) (((x) >> 27) & 0x7F) -#define XHCI_HCSPARAMS3 0x0C /* RO structual parameters 3 */ -#define XHCI_HCS3_U1_DEL(x) ((x) & 0xFF) -#define XHCI_HCS3_U2_DEL(x) (((x) >> 16) & 0xFFFF) -#define XHCI_HCSPARAMS0 0x10 /* RO capability parameters */ -#define XHCI_HCS0_AC64(x) ((x) & 0x1) /* 64-bit capable */ -#define XHCI_HCS0_BNC(x) (((x) >> 1) & 0x1) /* BW negotiation */ -#define XHCI_HCS0_CSZ(x) (((x) >> 2) & 0x1) /* context size */ -#define XHCI_HCS0_PPC(x) (((x) >> 3) & 0x1) /* port power control */ -#define XHCI_HCS0_PIND(x) (((x) >> 4) & 0x1) /* port indicators */ -#define XHCI_HCS0_LHRC(x) (((x) >> 5) & 0x1) /* light HC reset */ -#define XHCI_HCS0_LTC(x) (((x) >> 6) & 0x1) /* latency tolerance msg */ -#define XHCI_HCS0_NSS(x) (((x) >> 7) & 0x1) /* no secondary sid */ -#define XHCI_HCS0_PSA_SZ_MAX(x) (((x) >> 12) & 0xF) /* max pri. stream array size */ -#define XHCI_HCS0_XECP(x) (((x) >> 16) & 0xFFFF) /* extended capabilities pointer */ -#define XHCI_DBOFF 0x14 /* RO doorbell offset */ -#define XHCI_RTSOFF 0x18 /* RO runtime register space offset */ - -/* XHCI operational registers. Offset given by XHCI_CAPLENGTH register */ -#define XHCI_USBCMD 0x00 /* XHCI command */ -#define XHCI_CMD_RS 0x00000001 /* RW Run/Stop */ -#define XHCI_CMD_HCRST 0x00000002 /* RW Host Controller Reset */ -#define XHCI_CMD_INTE 0x00000004 /* RW Interrupter Enable */ -#define XHCI_CMD_HSEE 0x00000008 /* RW Host System Error Enable */ -#define XHCI_CMD_LHCRST 0x00000080 /* RO/RW Light Host Controller Reset */ -#define XHCI_CMD_CSS 0x00000100 /* RW Controller Save State */ -#define XHCI_CMD_CRS 0x00000200 /* RW Controller Restore State */ -#define XHCI_CMD_EWE 0x00000400 /* RW Enable Wrap Event */ -#define XHCI_CMD_EU3S 0x00000800 /* RW Enable U3 MFINDEX Stop */ -#define XHCI_USBSTS 0x04 /* XHCI status */ -#define XHCI_STS_HCH 0x00000001 /* RO - Host Controller Halted */ -#define XHCI_STS_HSE 0x00000004 /* RW - Host System Error */ -#define XHCI_STS_EINT 0x00000008 /* RW - Event Interrupt */ -#define XHCI_STS_PCD 0x00000010 /* RW - Port Change Detect */ -#define XHCI_STS_SSS 0x00000100 /* RO - Save State Status */ -#define XHCI_STS_RSS 0x00000200 /* RO - Restore State Status */ -#define XHCI_STS_SRE 0x00000400 /* RW - Save/Restore Error */ -#define XHCI_STS_CNR 0x00000800 /* RO - Controller Not Ready */ -#define XHCI_STS_HCE 0x00001000 /* RO - Host Controller Error */ -#define XHCI_PAGESIZE 0x08 /* XHCI page size mask */ -#define XHCI_PAGESIZE_4K 0x00000001 /* 4K Page Size */ -#define XHCI_PAGESIZE_8K 0x00000002 /* 8K Page Size */ -#define XHCI_PAGESIZE_16K 0x00000004 /* 16K Page Size */ -#define XHCI_PAGESIZE_32K 0x00000008 /* 32K Page Size */ -#define XHCI_PAGESIZE_64K 0x00000010 /* 64K Page Size */ -#define XHCI_DNCTRL 0x14 /* XHCI device notification control */ -#define XHCI_DNCTRL_MASK(n) (1U << (n)) -#define XHCI_CRCR_LO 0x18 /* XHCI command ring control */ -#define XHCI_CRCR_LO_RCS 0x00000001 /* RW - consumer cycle state */ -#define XHCI_CRCR_LO_CS 0x00000002 /* RW - command stop */ -#define XHCI_CRCR_LO_CA 0x00000004 /* RW - command abort */ -#define XHCI_CRCR_LO_CRR 0x00000008 /* RW - command ring running */ -#define XHCI_CRCR_LO_MASK 0x0000000F -#define XHCI_CRCR_HI 0x1C /* XHCI command ring control */ -#define XHCI_DCBAAP_LO 0x30 /* XHCI dev context BA pointer */ -#define XHCI_DCBAAP_HI 0x34 /* XHCI dev context BA pointer */ -#define XHCI_CONFIG 0x38 -#define XHCI_CONFIG_SLOTS_MASK 0x000000FF /* RW - number of device slots enabled */ - -/* XHCI port status registers */ +/* XENHCI port status registers */ #define XENHCI_PORTSC(n) (0x3F0 + (0x10 * (n))) /* XHCI port status */ #define XENHCI_PS_CCS 0x00000001 /* RO - current connect status */ #define XENHCI_PS_PED 0x00000002 /* RW - port enabled / disabled */ @@ -132,92 +48,15 @@ #define XENHCI_PS_PRC 0x00200000 /* RW - port reset change */ #define XENHCI_PS_PLC 0x00400000 /* RW - port link state change */ #define XENHCI_PS_CEC 0x00800000 /* RW - config error change */ -#define XHCI_PS_CAS 0x01000000 /* RO - cold attach status */ -#define XHCI_PS_WCE 0x02000000 /* RW - wake on connect enable */ -#define XHCI_PS_WDE 0x04000000 /* RW - wake on disconnect enable */ -#define XHCI_PS_WOE 0x08000000 /* RW - wake on over-current enable */ -#define XHCI_PS_DR 0x40000000 /* RO - device removable */ -#define XHCI_PS_WPR 0x80000000U /* RW - warm port reset */ +#define XENHCI_PS_CAS 0x01000000 /* RO - cold attach status */ +#define XENHCI_PS_WCE 0x02000000 /* RW - wake on connect enable */ +#define XENHCI_PS_WDE 0x04000000 /* RW - wake on disconnect enable */ +#define XENHCI_PS_WOE 0x08000000 /* RW - wake on over-current enable */ +#define XENHCI_PS_DR 0x40000000 /* RO - device removable */ +#define XENHCI_PS_WPR 0x80000000U /* RW - warm port reset */ #define XENHCI_PS_CLEAR 0x80FF01FFU /* command bits */ -#define XHCI_PORTPMSC(n) (0x3F4 + (0x10 * (n))) /* XHCI status and control */ -#define XHCI_PM3_U1TO_GET(x) (((x) >> 0) & 0xFF) /* RW - U1 timeout */ -#define XHCI_PM3_U1TO_SET(x) (((x) & 0xFF) << 0) /* RW - U1 timeout */ -#define XHCI_PM3_U2TO_GET(x) (((x) >> 8) & 0xFF) /* RW - U2 timeout */ -#define XHCI_PM3_U2TO_SET(x) (((x) & 0xFF) << 8) /* RW - U2 timeout */ -#define XHCI_PM3_FLA 0x00010000 /* RW - Force Link PM Accept */ -#define XHCI_PM2_L1S_GET(x) (((x) >> 0) & 0x7) /* RO - L1 status */ -#define XHCI_PM2_RWE 0x00000008 /* RW - remote wakup enable */ -#define XHCI_PM2_HIRD_GET(x) (((x) >> 4) & 0xF) /* RW - host initiated resume duration */ -#define XHCI_PM2_HIRD_SET(x) (((x) & 0xF) << 4) /* RW - host initiated resume duration */ -#define XHCI_PM2_L1SLOT_GET(x) (((x) >> 8) & 0xFF) /* RW - L1 device slot */ -#define XHCI_PM2_L1SLOT_SET(x) (((x) & 0xFF) << 8) /* RW - L1 device slot */ -#define XHCI_PM2_HLE 0x00010000 /* RW - hardware LPM enable */ -#define XHCI_PORTLI(n) (0x3F8 + (0x10 * (n))) /* XHCI port link info */ -#define XHCI_PLI3_ERR_GET(x) (((x) >> 0) & 0xFFFF) /* RO - port link errors */ -#define XHCI_PORTRSV(n) (0x3FC + (0x10 * (n))) /* XHCI port reserved */ - -/* XHCI runtime registers. Offset given by XHCI_CAPLENGTH + XHCI_RTSOFF registers */ -#define XHCI_MFINDEX 0x0000 /* RO - microframe index */ -#define XHCI_MFINDEX_GET(x) ((x) & 0x3FFF) -#define XHCI_IMAN(n) (0x0020 + (0x20 * (n))) /* XHCI interrupt management */ -#define XHCI_IMAN_INTR_PEND 0x00000001 /* RW - interrupt pending */ -#define XHCI_IMAN_INTR_ENA 0x00000002 /* RW - interrupt enable */ -#define XHCI_IMOD(n) (0x0024 + (0x20 * (n))) /* XHCI interrupt moderation */ -#define XHCI_IMOD_IVAL_GET(x) (((x) >> 0) & 0xFFFF) /* 250ns unit */ -#define XHCI_IMOD_IVAL_SET(x) (((x) & 0xFFFF) << 0) /* 250ns unit */ -#define XHCI_IMOD_ICNT_GET(x) (((x) >> 16) & 0xFFFF) /* 250ns unit */ -#define XHCI_IMOD_ICNT_SET(x) (((x) & 0xFFFF) << 16) /* 250ns unit */ -#define XHCI_IMOD_DEFAULT 0x000003E8U /* 8000 IRQ/second */ -#define XHCI_ERSTSZ(n) (0x0028 + (0x20 * (n))) /* XHCI event ring segment table size */ -#define XHCI_ERSTS_GET(x) ((x) & 0xFFFF) -#define XHCI_ERSTS_SET(x) ((x) & 0xFFFF) -#define XHCI_ERSTBA_LO(n) (0x0030 + (0x20 * (n))) /* XHCI event ring segment table BA */ -#define XHCI_ERSTBA_HI(n) (0x0034 + (0x20 * (n))) /* XHCI event ring segment table BA */ -#define XHCI_ERDP_LO(n) (0x0038 + (0x20 * (n))) /* XHCI event ring dequeue pointer */ -#define XHCI_ERDP_LO_SINDEX(x) ((x) & 0x7) /* RO - dequeue segment index */ -#define XHCI_ERDP_LO_BUSY 0x00000008 /* RW - event handler busy */ -#define XHCI_ERDP_HI(n) (0x003C + (0x20 * (n))) /* XHCI event ring dequeue pointer */ - -/* XHCI doorbell registers. Offset given by XHCI_CAPLENGTH + XHCI_DBOFF registers */ -#define XHCI_DOORBELL(n) (0x0000 + (4 * (n))) -#define XHCI_DB_TARGET_GET(x) ((x) & 0xFF) /* RW - doorbell target */ -#define XHCI_DB_TARGET_SET(x) ((x) & 0xFF) /* RW - doorbell target */ -#define XHCI_DB_SID_GET(x) (((x) >> 16) & 0xFFFF) /* RW - doorbell stream ID */ -#define XHCI_DB_SID_SET(x) (((x) & 0xFFFF) << 16) /* RW - doorbell stream ID */ - -/* XHCI legacy support */ -#define XHCI_XECP_ID(x) ((x) & 0xFF) -#define XHCI_XECP_NEXT(x) (((x) >> 8) & 0xFF) -#define XHCI_XECP_BIOS_SEM 0x0002 -#define XHCI_XECP_OS_SEM 0x0003 - -/* XHCI capability ID's */ -#define XHCI_ID_USB_LEGACY 0x0001 -#define XHCI_ID_PROTOCOLS 0x0002 -#define XHCI_ID_POWER_MGMT 0x0003 -#define XHCI_ID_VIRTUALIZATION 0x0004 -#define XHCI_ID_MSG_IRQ 0x0005 -#define XHCI_ID_USB_LOCAL_MEM 0x0006 +#define XENHCI_MFINDEX_GET(x) ((x) & 0x3FFF) -/* XHCI register R/W wrappers */ -#define XREAD1(sc, what, a) \ - bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off) -#define XREAD2(sc, what, a) \ - bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off) -#define XREAD4(sc, what, a) \ - bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off) -#define XWRITE1(sc, what, a, x) \ - bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off, (x)) -#define XWRITE2(sc, what, a, x) \ - bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off, (x)) -#define XWRITE4(sc, what, a, x) \ - bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, \ - (a) + (sc)->sc_##what##_off, (x)) #endif /* _XENHCIREG_H_ */ From owner-svn-soc-all@FreeBSD.ORG Fri Sep 27 11:36:25 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 84ED08F6 for ; Fri, 27 Sep 2013 11:36:25 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71A2A252D for ; Fri, 27 Sep 2013 11:36:25 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8RBaPVr022825 for ; Fri, 27 Sep 2013 11:36:25 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8RBaP6F022823 for svn-soc-all@FreeBSD.org; Fri, 27 Sep 2013 11:36:25 GMT (envelope-from bguan@FreeBSD.org) Date: Fri, 27 Sep 2013 11:36:25 GMT Message-Id: <201309271136.r8RBaP6F022823@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257759 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 11:36:25 -0000 Author: bguan Date: Fri Sep 27 11:36:25 2013 New Revision: 257759 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257759 Log: set the pipe methods for xen usb host controller Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Fri Sep 27 11:31:17 2013 (r257758) +++ soc2013/bguan/head/sys/dev/xen/usbfront/xenhcireg.h Fri Sep 27 11:36:25 2013 (r257759) @@ -35,12 +35,12 @@ #define XENHCI_PS_OCA 0x00000008 /* RO - over current active */ #define XENHCI_PS_PR 0x00000010 /* RW - port reset */ #define XENHCI_PS_PLS_GET(x) (((x) >> 5) & 0xF) /* RW - port link state */ -#define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ +#define XENHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ #define XENHCI_PS_PP 0x00000200 /* RW - port power */ #define XENHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ -#define XHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ -#define XHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ -#define XHCI_PS_LWS 0x00010000 /* RW - port link state write strobe */ +#define XENHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ +#define XENHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ +#define XENHCI_PS_LWS 0x00010000 /* RW - port link state write strobe */ #define XENHCI_PS_CSC 0x00020000 /* RW - connect status change */ #define XENHCI_PS_PEC 0x00040000 /* RW - port enable/disable change */ #define XENHCI_PS_WRC 0x00080000 /* RW - warm port reset change */