From owner-svn-src-projects@FreeBSD.ORG Sun Aug 29 02:42:03 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3066106566B; Sun, 29 Aug 2010 02:42:03 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BD48FC0A; Sun, 29 Aug 2010 02:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7T2g3Lg050414; Sun, 29 Aug 2010 02:42:03 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7T2g3U0050411; Sun, 29 Aug 2010 02:42:03 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201008290242.o7T2g3U0050411@svn.freebsd.org> From: Andrew Turner Date: Sun, 29 Aug 2010 02:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211954 - projects/arm_eabi/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2010 02:42:03 -0000 Author: andrew Date: Sun Aug 29 02:42:03 2010 New Revision: 211954 URL: http://svn.freebsd.org/changeset/base/211954 Log: Align the stack to an 8 byte boundary as required by the AAPCS Modified: projects/arm_eabi/sys/arm/arm/exception.S projects/arm_eabi/sys/arm/arm/vm_machdep.c Modified: projects/arm_eabi/sys/arm/arm/exception.S ============================================================================== --- projects/arm_eabi/sys/arm/arm/exception.S Sat Aug 28 23:50:09 2010 (r211953) +++ projects/arm_eabi/sys/arm/arm/exception.S Sun Aug 29 02:42:03 2010 (r211954) @@ -80,7 +80,9 @@ ASENTRY_NP(swi_entry) PUSHFRAME mov r0, sp /* Pass the frame to any function */ + sub sp, sp, #4 bl _C_LABEL(swi_handler) /* It's a SWI ! */ + add sp, sp, #4 DO_AST PULLFRAME Modified: projects/arm_eabi/sys/arm/arm/vm_machdep.c ============================================================================== --- projects/arm_eabi/sys/arm/arm/vm_machdep.c Sat Aug 28 23:50:09 2010 (r211953) +++ projects/arm_eabi/sys/arm/arm/vm_machdep.c Sun Aug 29 02:42:03 2010 (r211954) @@ -391,6 +391,8 @@ cpu_thread_alloc(struct thread *td) PAGE_SIZE) - 1; td->td_frame = (struct trapframe *) ((u_int)td->td_kstack + USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1; + /* Ensure the frame is aligned to an 8 byte boundary */ + td->td_frame = (struct trapframe *)((u_int)td->td_frame & ~7); #ifdef __XSCALE__ #ifndef CPU_XSCALE_CORE3 pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE); From owner-svn-src-projects@FreeBSD.ORG Sun Aug 29 02:51:18 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F37410656AB; Sun, 29 Aug 2010 02:51:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310AC8FC13; Sun, 29 Aug 2010 02:51:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7T2pI1d050616; Sun, 29 Aug 2010 02:51:18 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7T2pI6d050614; Sun, 29 Aug 2010 02:51:18 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201008290251.o7T2pI6d050614@svn.freebsd.org> From: Andrew Turner Date: Sun, 29 Aug 2010 02:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211955 - projects/arm_eabi/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Aug 2010 02:51:18 -0000 Author: andrew Date: Sun Aug 29 02:51:17 2010 New Revision: 211955 URL: http://svn.freebsd.org/changeset/base/211955 Log: More style(9) fixes Modified: projects/arm_eabi/sys/arm/arm/trap.c Modified: projects/arm_eabi/sys/arm/arm/trap.c ============================================================================== --- projects/arm_eabi/sys/arm/arm/trap.c Sun Aug 29 02:42:03 2010 (r211954) +++ projects/arm_eabi/sys/arm/arm/trap.c Sun Aug 29 02:51:17 2010 (r211955) @@ -891,8 +891,8 @@ cpu_fetch_syscall_args(struct thread *td if (sa->code >= p->p_sysent->sv_size) sa->callp = &p->p_sysent->sv_table[0]; - else - sa->callp = &p->p_sysent->sv_table[sa->code]; + else + sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; KASSERT(sa->narg <= sizeof(sa->args) / sizeof(sa->args[0]), From owner-svn-src-projects@FreeBSD.ORG Mon Aug 30 06:50:34 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3477210656BD; Mon, 30 Aug 2010 06:50:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 203448FC0A; Mon, 30 Aug 2010 06:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7U6oYca086499; Mon, 30 Aug 2010 06:50:34 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7U6oXOw086494; Mon, 30 Aug 2010 06:50:33 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201008300650.o7U6oXOw086494@svn.freebsd.org> From: Andrew Turner Date: Mon, 30 Aug 2010 06:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211985 - in projects/arm_eabi/contrib/binutils: bfd binutils gas/config include/elf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2010 06:50:34 -0000 Author: andrew Date: Mon Aug 30 06:50:33 2010 New Revision: 211985 URL: http://svn.freebsd.org/changeset/base/211985 Log: Start to back port changed from binutils 2.16 for EABI. Mark binaries built with the EABI to be marked correctly. Modified: projects/arm_eabi/contrib/binutils/bfd/elf32-arm.h projects/arm_eabi/contrib/binutils/binutils/readelf.c projects/arm_eabi/contrib/binutils/gas/config/tc-arm.c projects/arm_eabi/contrib/binutils/include/elf/arm.h Modified: projects/arm_eabi/contrib/binutils/bfd/elf32-arm.h ============================================================================== --- projects/arm_eabi/contrib/binutils/bfd/elf32-arm.h Mon Aug 30 00:31:30 2010 (r211984) +++ projects/arm_eabi/contrib/binutils/bfd/elf32-arm.h Mon Aug 30 06:50:33 2010 (r211985) @@ -110,7 +110,10 @@ bfd_boolean bfd_elf32_arm_process_before #endif -#define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) +/* In lieu of proper flags, assume all EABIv4 objects are interworkable. */ +#define INTERWORK_FLAG(abfd) \ + (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER4 \ + || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK)) /* The linker script knows the section names for placement. The entry_names are used to do simple name mangling on the stubs. @@ -2666,6 +2669,22 @@ elf32_arm_print_private_bfd_data (abfd, | EF_ARM_MAPSYMSFIRST); break; + case EF_ARM_EABI_VER3: + fprintf (file, _(" [Version3 EABI]")); + break; + + case EF_ARM_EABI_VER4: + fprintf (file, _(" [Version4 EABI]")); + + if (flags & EF_ARM_BE8) + fprintf (file, _(" [BE8]")); + + if (flags & EF_ARM_LE8) + fprintf (file, _(" [LE8]")); + + flags &= ~(EF_ARM_LE8 | EF_ARM_BE8); + break; + default: fprintf (file, _(" ")); break; Modified: projects/arm_eabi/contrib/binutils/binutils/readelf.c ============================================================================== --- projects/arm_eabi/contrib/binutils/binutils/readelf.c Mon Aug 30 00:31:30 2010 (r211984) +++ projects/arm_eabi/contrib/binutils/binutils/readelf.c Mon Aug 30 06:50:33 2010 (r211985) @@ -1740,6 +1740,37 @@ decode_ARM_machine_flags (unsigned e_fla } break; + case EF_ARM_EABI_VER3: + strcat (buf, ", Version3 EABI"); + break; + + case EF_ARM_EABI_VER4: + strcat (buf, ", Version4 EABI"); + while (e_flags) + { + unsigned flag; + + /* Process flags one bit at a time. */ + flag = e_flags & - e_flags; + e_flags &= ~ flag; + + switch (flag) + { + case EF_ARM_BE8: + strcat (buf, ", BE8"); + break; + + case EF_ARM_LE8: + strcat (buf, ", LE8"); + break; + + default: + unknown = 1; + break; + } + } + break; + case EF_ARM_EABI_UNKNOWN: strcat (buf, ", GNU EABI"); while (e_flags) Modified: projects/arm_eabi/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- projects/arm_eabi/contrib/binutils/gas/config/tc-arm.c Mon Aug 30 00:31:30 2010 (r211984) +++ projects/arm_eabi/contrib/binutils/gas/config/tc-arm.c Mon Aug 30 06:50:33 2010 (r211985) @@ -191,6 +191,9 @@ static int march_cpu_opt = -1; static int march_fpu_opt = -1; static int mfpu_opt = -1; static int mfloat_abi_opt = -1; +#ifdef OBJ_ELF +static int meabi_flags = EF_ARM_EABI_UNKNOWN; +#endif /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ @@ -11680,36 +11683,52 @@ md_begin () { unsigned int flags = 0; - /* Set the flags in the private structure. */ - if (uses_apcs_26) flags |= F_APCS26; - if (support_interwork) flags |= F_INTERWORK; - if (uses_apcs_float) flags |= F_APCS_FLOAT; - if (pic_code) flags |= F_PIC; - if ((cpu_variant & FPU_ANY) == FPU_NONE - || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ - { - flags |= F_SOFT_FLOAT; - } - switch (mfloat_abi_opt) +#if defined OBJ_ELF + flags = meabi_flags; + + switch (meabi_flags) { - case ARM_FLOAT_ABI_SOFT: - case ARM_FLOAT_ABI_SOFTFP: - flags |= F_SOFT_FLOAT; + case EF_ARM_EABI_UNKNOWN: +#endif + /* Set the flags in the private structure. */ + if (uses_apcs_26) flags |= F_APCS26; + if (support_interwork) flags |= F_INTERWORK; + if (uses_apcs_float) flags |= F_APCS_FLOAT; + if (pic_code) flags |= F_PIC; + if ((cpu_variant & FPU_ANY) == FPU_NONE + || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ + flags |= F_SOFT_FLOAT; + + switch (mfloat_abi_opt) + { + case ARM_FLOAT_ABI_SOFT: + case ARM_FLOAT_ABI_SOFTFP: + flags |= F_SOFT_FLOAT; + break; + + case ARM_FLOAT_ABI_HARD: + if (flags & F_SOFT_FLOAT) + as_bad (_("hard-float conflicts with specified fpu")); + break; + } + + /* Using VFP conventions (even if soft-float). */ + if (cpu_variant & FPU_VFP_EXT_NONE) + flags |= F_VFP_FLOAT; + +#if defined OBJ_ELF + if (cpu_variant & FPU_ARCH_MAVERICK) + flags |= EF_ARM_MAVERICK_FLOAT; break; - case ARM_FLOAT_ABI_HARD: - if (flags & F_SOFT_FLOAT) - as_bad (_("hard-float conflicts with specified fpu")); + case EF_ARM_EABI_VER4: + /* No additional flags to set. */ break; - } - /* Using VFP conventions (even if soft-float). */ - if (cpu_variant & FPU_VFP_EXT_NONE) flags |= F_VFP_FLOAT; -#if defined OBJ_ELF - if (cpu_variant & FPU_ARCH_MAVERICK) - flags |= EF_ARM_MAVERICK_FLOAT; + default: + abort (); + } #endif - bfd_set_private_flags (stdoutput, flags); /* We have run out flags in the COFF header to encode the @@ -13441,6 +13460,22 @@ static struct arm_float_abi_option_table {NULL, 0} }; +struct arm_eabi_option_table +{ + char *name; + unsigned int value; +}; + +#ifdef OBJ_ELF +/* We only know how to output GNU and ver 4 (AAELF) formats. */ +static struct arm_eabi_option_table arm_eabis[] = +{ + {"gnu", EF_ARM_EABI_UNKNOWN}, + {"4", EF_ARM_EABI_VER4}, + {NULL, 0} +}; +#endif + struct arm_long_option_table { char *option; /* Substring to match. */ @@ -13604,6 +13639,23 @@ arm_parse_float_abi (str) return 0; } +#ifdef OBJ_ELF +static int +arm_parse_eabi (char * str) +{ + struct arm_eabi_option_table *opt; + + for (opt = arm_eabis; opt->name != NULL; opt++) + if (streq (opt->name, str)) + { + meabi_flags = opt->value; + return 1; + } + as_bad (_("unknown EABI `%s'\n"), str); + return 0; +} +#endif + struct arm_long_option_table arm_long_opts[] = { {"mcpu=", N_("\t assemble for CPU "), @@ -13614,6 +13666,10 @@ struct arm_long_option_table arm_long_op arm_parse_fpu, NULL}, {"mfloat-abi=", N_("\t assemble for floating point ABI "), arm_parse_float_abi, NULL}, +#ifdef OBJ_ELF + {"meabi=", N_("\t assemble for eabi version "), + arm_parse_eabi, NULL}, +#endif {NULL, NULL, 0, NULL} }; Modified: projects/arm_eabi/contrib/binutils/include/elf/arm.h ============================================================================== --- projects/arm_eabi/contrib/binutils/include/elf/arm.h Mon Aug 30 00:31:30 2010 (r211984) +++ projects/arm_eabi/contrib/binutils/include/elf/arm.h Mon Aug 30 06:50:33 2010 (r211985) @@ -42,10 +42,16 @@ #define EF_ARM_MAPSYMSFIRST 0x10 /* NB conflicts with EF_APCS_FLOAT */ #define EF_ARM_EABIMASK 0xFF000000 +/* Constants defined in AAELF. */ +#define EF_ARM_BE8 0x00800000 +#define EF_ARM_LE8 0x00400000 + #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) #define EF_ARM_EABI_UNKNOWN 0x00000000 #define EF_ARM_EABI_VER1 0x01000000 #define EF_ARM_EABI_VER2 0x02000000 +#define EF_ARM_EABI_VER3 0x03000000 +#define EF_ARM_EABI_VER4 0x04000000 /* Local aliases for some flags to match names used by COFF port. */ #define F_INTERWORK EF_ARM_INTERWORK From owner-svn-src-projects@FreeBSD.ORG Mon Aug 30 14:04:29 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56BC61065698; Mon, 30 Aug 2010 14:04:29 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46B5B8FC18; Mon, 30 Aug 2010 14:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7UE4Tac096894; Mon, 30 Aug 2010 14:04:29 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7UE4TjA096892; Mon, 30 Aug 2010 14:04:29 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201008301404.o7UE4TjA096892@svn.freebsd.org> From: Attilio Rao Date: Mon, 30 Aug 2010 14:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211997 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2010 14:04:29 -0000 Author: attilio Date: Mon Aug 30 14:04:29 2010 New Revision: 211997 URL: http://svn.freebsd.org/changeset/base/211997 Log: Use 'dumping' for discriminating against dump in progress. Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Mon Aug 30 13:26:07 2010 (r211996) +++ projects/sv/sys/net/netdump_client.c Mon Aug 30 14:04:29 2010 (r211997) @@ -1161,25 +1161,25 @@ netdump_trigger(void *arg, int howto) u_int cpumap=0; #endif - if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable) { + if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable || cold || + dumping) return; - } - nd_enable = 0; + dumping++; if (!nd_nic) { printf("netdump_trigger: Can't netdump: no NIC given\n"); - nd_enable = 1; + dumping--; return; } if (nd_server.s_addr == INADDR_ANY) { printf("netdump_trigger: Can't netdump; no server IP given\n"); - nd_enable = 1; + dumping--; return; } if (nd_client.s_addr == INADDR_ANY) { printf("netdump_trigger: Can't netdump; no client IP given\n"); - nd_enable = 1; + dumping--; return; } @@ -1226,7 +1226,7 @@ netdump_trigger(void *arg, int howto) if(error) { printf("netdump_trigger: Could not acquire lock on %s\n", nd_nic->if_xname); - nd_enable = 1; + dumping--; return; } @@ -1298,7 +1298,7 @@ cleanup: restart_cpus(cpumap); } #endif - nd_enable = 1; + dumping--; } /*- @@ -1440,11 +1440,6 @@ DECLARE_MODULE(netdump, netdump_mod, SI_ DB_COMMAND(netdump, ddb_force_netdump) { - if(!nd_enable) { - db_printf("Netdump not enabled -- could be in progress"); - return; - } - netdump_trigger(NULL, RB_DUMP); } #endif From owner-svn-src-projects@FreeBSD.ORG Mon Aug 30 15:06:56 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5421B106566B; Mon, 30 Aug 2010 15:06:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446FF8FC15; Mon, 30 Aug 2010 15:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7UF6uaJ098356; Mon, 30 Aug 2010 15:06:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7UF6uoX098354; Mon, 30 Aug 2010 15:06:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201008301506.o7UF6uoX098354@svn.freebsd.org> From: Attilio Rao Date: Mon, 30 Aug 2010 15:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212001 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2010 15:06:56 -0000 Author: attilio Date: Mon Aug 30 15:06:55 2010 New Revision: 212001 URL: http://svn.freebsd.org/changeset/base/212001 Log: Don't bump dumping too early. Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Mon Aug 30 14:44:22 2010 (r212000) +++ projects/sv/sys/net/netdump_client.c Mon Aug 30 15:06:55 2010 (r212001) @@ -1164,24 +1164,21 @@ netdump_trigger(void *arg, int howto) if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable || cold || dumping) return; - dumping++; if (!nd_nic) { printf("netdump_trigger: Can't netdump: no NIC given\n"); - dumping--; return; } if (nd_server.s_addr == INADDR_ANY) { printf("netdump_trigger: Can't netdump; no server IP given\n"); - dumping--; return; } if (nd_client.s_addr == INADDR_ANY) { printf("netdump_trigger: Can't netdump; no client IP given\n"); - dumping--; return; } + dumping++; /* * netdump is invoked as a shutdown handler instead of as From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 09:47:56 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 981A11065695; Wed, 1 Sep 2010 09:47:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9798FC0A; Wed, 1 Sep 2010 09:47:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o819lu7g057844; Wed, 1 Sep 2010 09:47:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o819lu9N057842; Wed, 1 Sep 2010 09:47:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009010947.o819lu9N057842@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 09:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212085 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 09:47:56 -0000 Author: attilio Date: Wed Sep 1 09:47:56 2010 New Revision: 212085 URL: http://svn.freebsd.org/changeset/base/212085 Log: We don't need to stop the CPUs: - If we entered the debugger via a panic breakpoint() already did that - If we are running a reboot(2) instance with RB_DUMP it is not due Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 08:32:40 2010 (r212084) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 09:47:56 2010 (r212085) @@ -1157,10 +1157,7 @@ netdump_trigger(void *arg, int howto) uint8_t broken_state[NETDUMP_BROKEN_STATE_BUFFER_SIZE]; void (*old_if_input)(struct ifnet *, struct mbuf *)=NULL; int error; -#ifdef SMP - u_int cpumap=0; -#endif - + if ((howto&(RB_HALT|RB_DUMP))!=RB_DUMP || !nd_enable || cold || dumping) return; @@ -1190,34 +1187,6 @@ netdump_trigger(void *arg, int howto) /***** Beyond this point, don't return: goto abort *****/ - /* Stop all the other CPUs */ -#ifdef SMP - if (smp_active != 0) { - printf("netdump_trigger called on cpu#%d\n", PCPU_GET(cpuid)); - - cpumap = PCPU_GET(other_cpus) & ~ stopped_cpus; - if (cpumap != 0) { - unsigned long long end_ts; - - printf("netdump_trigger: Stopping other CPUs\n"); - - /* 1 second */ - end_ts = rdtsc() + 1ULL * tsc_freq; - - ipi_selected(cpumap, IPI_STOP); - - while ((atomic_load_acq_int(&stopped_cpus) & cpumap) - != cpumap) { - if (rdtsc() > end_ts) { - printf("netdump_trigger: Stopping other" - "CPUs timed out. Continuing " - "anyway.\n"); - break; - } - } - } - } -#endif bzero(broken_state, sizeof(broken_state)); error = nd_nic->if_netdump->break_lock(nd_nic, &broke_lock, broken_state, sizeof(broken_state)); @@ -1290,11 +1259,6 @@ cleanup: /* Even if we broke the lock, this seems like the most sane thing to * do */ nd_nic->if_netdump->release_lock(nd_nic); -#ifdef SMP - if (cpumap) { - restart_cpus(cpumap); - } -#endif dumping--; } From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 09:51:48 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FE4A1065679; Wed, 1 Sep 2010 09:51:48 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB6C8FC0A; Wed, 1 Sep 2010 09:51:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o819pm7v057952; Wed, 1 Sep 2010 09:51:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o819pmT2057950; Wed, 1 Sep 2010 09:51:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009010951.o819pmT2057950@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 09:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212086 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 09:51:48 -0000 Author: attilio Date: Wed Sep 1 09:51:47 2010 New Revision: 212086 URL: http://svn.freebsd.org/changeset/base/212086 Log: It is not necessary to disable interrupts here neither useful: 1) The code path is quite heavy and disabling indiscriminately interrupts for that long is not a good approach 2) The context (callers) may provide such type of protection, if anything, because they know more about the surrounding Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 09:47:56 2010 (r212085) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 09:51:47 2010 (r212086) @@ -1198,9 +1198,6 @@ netdump_trigger(void *arg, int howto) /* At this point, we should 'own' the driver lock */ - /* We don't want interrupts potentially messing with our dump process */ - critical_enter(); - /* Make the card use *our* receive callback */ old_if_input = nd_nic->if_input; nd_nic->if_input = netdump_pkt_in; @@ -1255,7 +1252,6 @@ abort: cleanup: if (old_if_input) nd_nic->if_input = old_if_input; - critical_exit(); /* Even if we broke the lock, this seems like the most sane thing to * do */ nd_nic->if_netdump->release_lock(nd_nic); From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 09:59:46 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63D161065698; Wed, 1 Sep 2010 09:59:46 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3842E8FC08; Wed, 1 Sep 2010 09:59:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o819xktm058169; Wed, 1 Sep 2010 09:59:46 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o819xkjT058167; Wed, 1 Sep 2010 09:59:46 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009010959.o819xkjT058167@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 09:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212088 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 09:59:46 -0000 Author: attilio Date: Wed Sep 1 09:59:45 2010 New Revision: 212088 URL: http://svn.freebsd.org/changeset/base/212088 Log: - Rename the too generic label 'abort' into 'trig_abort' - Reorganize some paths in order to cleanup a bit and get rid of the successful label Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 09:53:24 2010 (r212087) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 09:59:45 2010 (r212088) @@ -1185,7 +1185,7 @@ netdump_trigger(void *arg, int howto) */ savectx(&dumppcb); - /***** Beyond this point, don't return: goto abort *****/ + /***** Beyond this point, don't return: goto trig_abort *****/ bzero(broken_state, sizeof(broken_state)); error = nd_nic->if_netdump->break_lock(nd_nic, &broke_lock, broken_state, sizeof(broken_state)); @@ -1195,20 +1195,18 @@ netdump_trigger(void *arg, int howto) dumping--; return; } - - /* At this point, we should 'own' the driver lock */ - - /* Make the card use *our* receive callback */ - old_if_input = nd_nic->if_input; - nd_nic->if_input = netdump_pkt_in; /* Check if we can use polling */ if (!(nd_nic->if_capenable & IFCAP_POLLING)) { printf("netdump_trigger: Can't dump: interface %s does not have" " polling enabled.\n", nd_nic->if_xname); - goto abort; + dumping--; + return; } + /* Make the card use *our* receive callback */ + old_if_input = nd_nic->if_input; + nd_nic->if_input = netdump_pkt_in; if (nd_gw.s_addr == INADDR_ANY) { nd_gw.s_addr = nd_server.s_addr; } @@ -1216,11 +1214,11 @@ netdump_trigger(void *arg, int howto) printf("netdump in progress. searching for server.. "); if (netdump_arp_server()) { printf("Failed to locate server MAC address\n"); - goto abort; + goto trig_abort; } if (netdump_send(NETDUMP_HERALD, 0, NULL, 0) != 0) { printf("Failed to contact netdump server\n"); - goto abort; + goto trig_abort; } printf("dumping to %s (%6D)\n", inet_ntoa(nd_server), nd_gw_mac.octet, ":"); @@ -1237,19 +1235,19 @@ netdump_trigger(void *arg, int howto) /* in dump_machdep.c */ dumpsys(&dumper); - if (dump_failed) - goto abort; + if (dump_failed) { + printf("Failed to dump the actual raw datas\n"); + goto trig_abort; + } if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0) { - goto abort; + printf("Failed to close the transaction\n"); + goto trig_abort; } printf("\nnetdump finished.\n"); printf("cancelling normal dump\n"); set_dumper(NULL); - goto cleanup; -abort: - printf("\nnetdump failed, proceeding to normal dump\n"); -cleanup: +trig_abort: if (old_if_input) nd_nic->if_input = old_if_input; /* Even if we broke the lock, this seems like the most sane thing to From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 10:07:40 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB97D1065675; Wed, 1 Sep 2010 10:07:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA82B8FC23; Wed, 1 Sep 2010 10:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o81A7eCN058396; Wed, 1 Sep 2010 10:07:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o81A7efq058394; Wed, 1 Sep 2010 10:07:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009011007.o81A7efq058394@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 10:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212089 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 10:07:40 -0000 Author: attilio Date: Wed Sep 1 10:07:40 2010 New Revision: 212089 URL: http://svn.freebsd.org/changeset/base/212089 Log: - Tweak some comments - Move down the 'dumping' bump in order to match what doadump() does Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 09:59:45 2010 (r212088) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 10:07:40 2010 (r212089) @@ -1175,17 +1175,18 @@ netdump_trigger(void *arg, int howto) printf("netdump_trigger: Can't netdump; no client IP given\n"); return; } - dumping++; /* - * netdump is invoked as a shutdown handler instead of as - * a real dumpdev dump routine. (networks are shut down - * before dumpsys() gets called.) make sure the dump context - * is set so a debugger can find the stack trace. + * netdump is invoked as a pre-sync handler instead of as + * a real dumpdev dump routine (that is because shutdown handlers + * run as post-sync handlers, earlier than dumping routines + * taking place, and thus network and devices may not be further + * available). + * Make sure, artificially, the dump context is set so a debugger + * can find the stack trace. */ savectx(&dumppcb); - - /***** Beyond this point, don't return: goto trig_abort *****/ + dumping++; bzero(broken_state, sizeof(broken_state)); error = nd_nic->if_netdump->break_lock(nd_nic, &broke_lock, broken_state, sizeof(broken_state)); @@ -1250,8 +1251,6 @@ netdump_trigger(void *arg, int howto) trig_abort: if (old_if_input) nd_nic->if_input = old_if_input; - /* Even if we broke the lock, this seems like the most sane thing to - * do */ nd_nic->if_netdump->release_lock(nd_nic); dumping--; } From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 10:50:58 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C28E810656A9; Wed, 1 Sep 2010 10:50:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B17AE8FC0A; Wed, 1 Sep 2010 10:50:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o81Aow7D061596; Wed, 1 Sep 2010 10:50:58 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o81AowFP061594; Wed, 1 Sep 2010 10:50:58 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009011050.o81AowFP061594@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 10:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212090 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 10:50:58 -0000 Author: attilio Date: Wed Sep 1 10:50:58 2010 New Revision: 212090 URL: http://svn.freebsd.org/changeset/base/212090 Log: Fix a lock-leak due to wrong movement. Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 10:07:40 2010 (r212089) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 10:50:58 2010 (r212090) @@ -1197,17 +1197,17 @@ netdump_trigger(void *arg, int howto) return; } + /* Make the card use *our* receive callback */ + old_if_input = nd_nic->if_input; + nd_nic->if_input = netdump_pkt_in; + /* Check if we can use polling */ if (!(nd_nic->if_capenable & IFCAP_POLLING)) { printf("netdump_trigger: Can't dump: interface %s does not have" " polling enabled.\n", nd_nic->if_xname); - dumping--; - return; + goto trig_abort; } - /* Make the card use *our* receive callback */ - old_if_input = nd_nic->if_input; - nd_nic->if_input = netdump_pkt_in; if (nd_gw.s_addr == INADDR_ANY) { nd_gw.s_addr = nd_server.s_addr; } From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 19:22:20 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A9131065693; Wed, 1 Sep 2010 19:22:20 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19D938FC1E; Wed, 1 Sep 2010 19:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o81JMJrX077542; Wed, 1 Sep 2010 19:22:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o81JMJFh077539; Wed, 1 Sep 2010 19:22:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009011922.o81JMJFh077539@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 19:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212106 - in projects/sv/sys: net netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 19:22:20 -0000 Author: attilio Date: Wed Sep 1 19:22:19 2010 New Revision: 212106 URL: http://svn.freebsd.org/changeset/base/212106 Log: The break lock happens while the system panicked but it is not an useful operation as, at that point, the other CPUs might be already stopped. It is more correct to just skip locking entirely for the interfaces, as long as the asserts won't whine in panicstr != NULL conditions (to be added asap). The 'acquire_lock' and 'release_lock' semantic is just left for the normal RB_DUMP reboot(2) invokation case (reboot -d, for example). Discussed with: emaste, rstone Modified: projects/sv/sys/net/netdump_client.c projects/sv/sys/netinet/netdump.h Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 18:41:59 2010 (r212105) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 19:22:19 2010 (r212106) @@ -1153,8 +1153,6 @@ static void netdump_trigger(void *arg, int howto) { struct dumperinfo dumper; - int broke_lock = 0; - uint8_t broken_state[NETDUMP_BROKEN_STATE_BUFFER_SIZE]; void (*old_if_input)(struct ifnet *, struct mbuf *)=NULL; int error; @@ -1188,8 +1186,7 @@ netdump_trigger(void *arg, int howto) savectx(&dumppcb); dumping++; - bzero(broken_state, sizeof(broken_state)); - error = nd_nic->if_netdump->break_lock(nd_nic, &broke_lock, broken_state, sizeof(broken_state)); + error = nd_nic->if_netdump->acquire_lock(nd_nic); if(error) { printf("netdump_trigger: Could not acquire lock on %s\n", nd_nic->if_xname); @@ -1256,50 +1253,6 @@ trig_abort: } /*- - * Public primitives. - */ - -/* this isn't declared in any header file... */ -extern int system_panic; - -int -netdump_break_lock(struct mtx *lock, const char *name, int *broke_lock, - uint8_t *broken_state, u_int index, u_int bstatesz) -{ - /* XXX: Technically this might be bad because it's possible to be called - from within a critical section (such as when the software watchdog - triggers), although it's only a trylock */ - if (!mtx_trylock(lock)) { - if(system_panic) { - /* The lock is already held. Attempting to use the card is - * probably unsafe at this point, but since we're panicking - * anyway, there's nothing to lose. Be horrible and break the - * lock. - */ - critical_enter(); /* No interrupts so that this is less likely - * to mess up - */ - if(bstatesz >= (index + sizeof(*lock))) { - bcopy(lock, broken_state + index, sizeof(*lock)); - } else { - printf("Netdump: cannot save state of lock %s!", name); - } - - _release_lock_quick(lock); - mtx_destroy(lock); - mtx_init(lock, name, MTX_NETWORK_LOCK, - MTX_DEF); - *broke_lock = 1; - critical_exit();/* We can't grab a lock in a critical section */ - mtx_lock(lock); - } else { - return EAGAIN; - } - } - return 0; -} - -/*- * KLD specific code. */ Modified: projects/sv/sys/netinet/netdump.h ============================================================================== --- projects/sv/sys/netinet/netdump.h Wed Sep 1 18:41:59 2010 (r212105) +++ projects/sv/sys/netinet/netdump.h Wed Sep 1 19:22:19 2010 (r212106) @@ -61,19 +61,13 @@ struct netdump_msg { #ifdef _KERNEL -struct mtx; - struct netdump_methods { void (*test_get_lock)(struct ifnet *); - int (*break_lock)(struct ifnet *, int *, uint8_t *, u_int); + void (*acquire_lock)(struct ifnet *); void (*release_lock)(struct ifnet *); int (*poll_locked)(struct ifnet *, enum poll_cmd, int); }; -int netdump_break_lock(struct mtx *lock, const char *name, - int *broke_lock, uint8_t *broken_state, u_int index, - u_int bstatesz); - #endif #endif /* !_NETINET_NETDUMP_H_ */ From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 19:23:49 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CDD10656AE; Wed, 1 Sep 2010 19:23:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65F218FC13; Wed, 1 Sep 2010 19:23:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o81JNnhU077619; Wed, 1 Sep 2010 19:23:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o81JNnDG077617; Wed, 1 Sep 2010 19:23:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009011923.o81JNnDG077617@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 19:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212107 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 19:23:49 -0000 Author: attilio Date: Wed Sep 1 19:23:49 2010 New Revision: 212107 URL: http://svn.freebsd.org/changeset/base/212107 Log: acquire_lock() is void-return. Fix it. Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 19:22:19 2010 (r212106) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 19:23:49 2010 (r212107) @@ -1186,13 +1186,7 @@ netdump_trigger(void *arg, int howto) savectx(&dumppcb); dumping++; - error = nd_nic->if_netdump->acquire_lock(nd_nic); - - if(error) { - printf("netdump_trigger: Could not acquire lock on %s\n", nd_nic->if_xname); - dumping--; - return; - } + nd_nic->if_netdump->acquire_lock(nd_nic); /* Make the card use *our* receive callback */ old_if_input = nd_nic->if_input; From owner-svn-src-projects@FreeBSD.ORG Wed Sep 1 19:27:42 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536291065673; Wed, 1 Sep 2010 19:27:42 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 435BB8FC14; Wed, 1 Sep 2010 19:27:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o81JRglj077718; Wed, 1 Sep 2010 19:27:42 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o81JRg33077716; Wed, 1 Sep 2010 19:27:42 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009011927.o81JRg33077716@svn.freebsd.org> From: Attilio Rao Date: Wed, 1 Sep 2010 19:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212108 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2010 19:27:42 -0000 Author: attilio Date: Wed Sep 1 19:27:41 2010 New Revision: 212108 URL: http://svn.freebsd.org/changeset/base/212108 Log: As announced earlier, just lock in non-panicking conditions. The code could be different and require any implementation of acquire_lock and release_lock virtual functions to skip in panicstr != NULL case, but that would be too error prone, so just handle locally. Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Wed Sep 1 19:23:49 2010 (r212107) +++ projects/sv/sys/net/netdump_client.c Wed Sep 1 19:27:41 2010 (r212108) @@ -1186,7 +1186,8 @@ netdump_trigger(void *arg, int howto) savectx(&dumppcb); dumping++; - nd_nic->if_netdump->acquire_lock(nd_nic); + if (panicstr == NULL) + nd_nic->if_netdump->acquire_lock(nd_nic); /* Make the card use *our* receive callback */ old_if_input = nd_nic->if_input; @@ -1242,7 +1243,8 @@ netdump_trigger(void *arg, int howto) trig_abort: if (old_if_input) nd_nic->if_input = old_if_input; - nd_nic->if_netdump->release_lock(nd_nic); + if (panicstr == NULL) + nd_nic->if_netdump->release_lock(nd_nic); dumping--; } From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 09:33:48 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC9C51065759; Thu, 2 Sep 2010 09:33:48 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C96FD8FC14; Thu, 2 Sep 2010 09:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o829XmGf098353; Thu, 2 Sep 2010 09:33:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o829XmS9098339; Thu, 2 Sep 2010 09:33:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009020933.o829XmS9098339@svn.freebsd.org> From: Attilio Rao Date: Thu, 2 Sep 2010 09:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212142 - in projects/sv/sys: amd64/amd64 arm/arm geom i386/i386 ia64/ia64 net powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 09:33:48 -0000 Author: attilio Date: Thu Sep 2 09:33:48 2010 New Revision: 212142 URL: http://svn.freebsd.org/changeset/base/212142 Log: Introduce a flag field for the dumpers and use it immediately for the DIF_NET flag. This flag is responsible for toggling a netdump and having a correct set of dumplo in the dumping routines. Modified: projects/sv/sys/amd64/amd64/dump_machdep.c projects/sv/sys/amd64/amd64/minidump_machdep.c projects/sv/sys/arm/arm/dump_machdep.c projects/sv/sys/arm/arm/minidump_machdep.c projects/sv/sys/geom/geom_disk.c projects/sv/sys/i386/i386/dump_machdep.c projects/sv/sys/i386/i386/minidump_machdep.c projects/sv/sys/ia64/ia64/dump_machdep.c projects/sv/sys/net/netdump_client.c projects/sv/sys/powerpc/powerpc/dump_machdep.c projects/sv/sys/sparc64/sparc64/dump_machdep.c projects/sv/sys/sun4v/sun4v/dump_machdep.c projects/sv/sys/sys/conf.h Modified: projects/sv/sys/amd64/amd64/dump_machdep.c ============================================================================== --- projects/sv/sys/amd64/amd64/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/amd64/amd64/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -297,12 +297,17 @@ dumpsys(struct dumperinfo *di) hdrgap = fileofs - DEV_ALIGN(hdrsz); /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); Modified: projects/sv/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- projects/sv/sys/amd64/amd64/minidump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/amd64/amd64/minidump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -243,12 +243,17 @@ minidumpsys(struct dumperinfo *di) dumpsize += PAGE_SIZE; /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; progress = dumpsize; /* Initialize mdhdr */ Modified: projects/sv/sys/arm/arm/dump_machdep.c ============================================================================== --- projects/sv/sys/arm/arm/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/arm/arm/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -304,12 +304,17 @@ dumpsys(struct dumperinfo *di) hdrgap = fileofs - DEV_ALIGN(hdrsz); /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_ARM_VERSION, dumpsize, di->blocksize); Modified: projects/sv/sys/arm/arm/minidump_machdep.c ============================================================================== --- projects/sv/sys/arm/arm/minidump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/arm/arm/minidump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -277,13 +277,18 @@ minidumpsys(struct dumperinfo *di) dumpsize += PAGE_SIZE; /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; - } + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + } progress = dumpsize; /* Initialize mdhdr */ Modified: projects/sv/sys/geom/geom_disk.c ============================================================================== --- projects/sv/sys/geom/geom_disk.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/geom/geom_disk.c Thu Sep 2 09:33:48 2010 (r212142) @@ -182,6 +182,7 @@ g_disk_kerneldump(struct bio *bp, struct di.blocksize = dp->d_sectorsize; di.maxiosize = dp->d_maxsize; di.mediaoffset = gkd->offset; + di.flags = 0; if ((gkd->offset + gkd->length) > dp->d_mediasize) gkd->length = dp->d_mediasize - gkd->offset; di.mediasize = gkd->length; Modified: projects/sv/sys/i386/i386/dump_machdep.c ============================================================================== --- projects/sv/sys/i386/i386/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/i386/i386/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -297,12 +297,17 @@ dumpsys(struct dumperinfo *di) hdrgap = fileofs - DEV_ALIGN(hdrsz); /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_I386_VERSION, dumpsize, di->blocksize); Modified: projects/sv/sys/i386/i386/minidump_machdep.c ============================================================================== --- projects/sv/sys/i386/i386/minidump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/i386/i386/minidump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -243,12 +243,17 @@ minidumpsys(struct dumperinfo *di) dumpsize += PAGE_SIZE; /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; progress = dumpsize; /* Initialize mdhdr */ Modified: projects/sv/sys/ia64/ia64/dump_machdep.c ============================================================================== --- projects/sv/sys/ia64/ia64/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/ia64/ia64/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -232,12 +232,17 @@ dumpsys(struct dumperinfo *di) hdrgap = fileofs - DEV_ALIGN(hdrsz); /* Determine dump offset on device. */ - if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; - goto fail; + if ((di->flags & DIF_NET) != 0) + dumplo = 0; + else { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; } - dumplo = di->mediaoffset + di->mediasize - dumpsize; - dumplo -= sizeof(kdh) * 2; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_IA64_VERSION, dumpsize, di->blocksize); Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/net/netdump_client.c Thu Sep 2 09:33:48 2010 (r212142) @@ -1223,7 +1223,7 @@ netdump_trigger(void *arg, int howto) dumper.dumper = netdump_dumper; dumper.priv = NULL; dumper.blocksize = NETDUMP_DATASIZE; - dumper.flags = DF_NET; + dumper.flags = DIF_NET; /* in dump_machdep.c */ dumpsys(&dumper); Modified: projects/sv/sys/powerpc/powerpc/dump_machdep.c ============================================================================== --- projects/sv/sys/powerpc/powerpc/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/powerpc/powerpc/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -233,8 +233,8 @@ dumpsys(struct dumperinfo *di) dumpsize += fileofs; hdrgap = fileofs - DEV_ALIGN(hdrsz); - /* For block devices, determine the dump offset on the device. */ - if (di->mediasize > 0) { + /* Determine dump offset on device. */ + if ((di->flags & DIF_NET) == 0 && di->mediasize > 0) { if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { error = ENOSPC; Modified: projects/sv/sys/sparc64/sparc64/dump_machdep.c ============================================================================== --- projects/sv/sys/sparc64/sparc64/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/sparc64/sparc64/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -167,7 +167,8 @@ dumpsys(struct dumperinfo *di) } /* Determine dump offset on device. */ - dumplo = di->mediaoffset + di->mediasize - totsize; + dumplo = (di->flags & DIF_NET) != 0 ? 0 : + di->mediaoffset + di->mediasize - totsize; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); Modified: projects/sv/sys/sun4v/sun4v/dump_machdep.c ============================================================================== --- projects/sv/sys/sun4v/sun4v/dump_machdep.c Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/sun4v/sun4v/dump_machdep.c Thu Sep 2 09:33:48 2010 (r212142) @@ -170,7 +170,8 @@ dumpsys(struct dumperinfo *di) } /* Determine dump offset on device. */ - dumplo = di->mediaoffset + di->mediasize - totsize; + dumplo = (di->flags & DIF_NET) != 0 ? 0 : + di->mediaoffset + di->mediasize - totsize; mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_SPARC64_VERSION, size, di->blocksize); Modified: projects/sv/sys/sys/conf.h ============================================================================== --- projects/sv/sys/sys/conf.h Thu Sep 2 07:49:45 2010 (r212141) +++ projects/sv/sys/sys/conf.h Thu Sep 2 09:33:48 2010 (r212142) @@ -317,6 +317,8 @@ EVENTHANDLER_DECLARE(dev_clone, dev_clon /* Stuff relating to kernel-dump */ +#define DIF_NET 0x01 /* Dump over network. */ + struct dumperinfo { dumper_t *dumper; /* Dumping function. */ void *priv; /* Private parts. */ @@ -324,6 +326,7 @@ struct dumperinfo { u_int maxiosize; /* Max size allowed for an individual I/O */ off_t mediaoffset; /* Initial offset in bytes. */ off_t mediasize; /* Space available in bytes. */ + u_int flags; /* Dump device flags. */ }; int set_dumper(struct dumperinfo *); From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 09:41:43 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48A61065719; Thu, 2 Sep 2010 09:41:43 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3B7A8FC18; Thu, 2 Sep 2010 09:41:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o829fhd8098562; Thu, 2 Sep 2010 09:41:43 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o829fh50098559; Thu, 2 Sep 2010 09:41:43 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009020941.o829fh50098559@svn.freebsd.org> From: Attilio Rao Date: Thu, 2 Sep 2010 09:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212143 - in projects/sv/sys: kern sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 09:41:43 -0000 Author: attilio Date: Thu Sep 2 09:41:43 2010 New Revision: 212143 URL: http://svn.freebsd.org/changeset/base/212143 Log: Make dumppcb and dumptid nomore static and remove an unuseful comment on the dumping externalization. Modified: projects/sv/sys/kern/kern_shutdown.c projects/sv/sys/sys/conf.h Modified: projects/sv/sys/kern/kern_shutdown.c ============================================================================== --- projects/sv/sys/kern/kern_shutdown.c Thu Sep 2 09:33:48 2010 (r212142) +++ projects/sv/sys/kern/kern_shutdown.c Thu Sep 2 09:41:43 2010 (r212143) @@ -127,8 +127,8 @@ int rebooting; /* system is rebooting static struct dumperinfo dumper; /* our selected dumper */ /* Context information for dump-debuggers. */ -static struct pcb dumppcb; /* Registers. */ -static lwpid_t dumptid; /* Thread ID. */ +struct pcb dumppcb; /* Registers. */ +lwpid_t dumptid; /* Thread ID. */ static void boot(int) __dead2; static void poweroff_wait(void *, int); Modified: projects/sv/sys/sys/conf.h ============================================================================== --- projects/sv/sys/sys/conf.h Thu Sep 2 09:33:48 2010 (r212142) +++ projects/sv/sys/sys/conf.h Thu Sep 2 09:41:43 2010 (r212143) @@ -332,7 +332,10 @@ struct dumperinfo { int set_dumper(struct dumperinfo *); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); void dumpsys(struct dumperinfo *); -extern int dumping; /* system is dumping */ + +extern int dumping; +extern struct pcb dumppcb; +extern lwpid_t dumptid; #endif /* _KERNEL */ From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 09:45:07 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA881065703; Thu, 2 Sep 2010 09:45:07 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1D68FC13; Thu, 2 Sep 2010 09:45:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o829j7cu098702; Thu, 2 Sep 2010 09:45:07 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o829j7lQ098700; Thu, 2 Sep 2010 09:45:07 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009020945.o829j7lQ098700@svn.freebsd.org> From: Attilio Rao Date: Thu, 2 Sep 2010 09:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212144 - projects/sv/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 09:45:07 -0000 Author: attilio Date: Thu Sep 2 09:45:06 2010 New Revision: 212144 URL: http://svn.freebsd.org/changeset/base/212144 Log: - Fix a bug where dumptid was not set - Remove a now unuseful externalization stub Modified: projects/sv/sys/net/netdump_client.c Modified: projects/sv/sys/net/netdump_client.c ============================================================================== --- projects/sv/sys/net/netdump_client.c Thu Sep 2 09:41:43 2010 (r212143) +++ projects/sv/sys/net/netdump_client.c Thu Sep 2 09:45:06 2010 (r212144) @@ -125,8 +125,6 @@ static int sysctl_force_crash(SYSCTL_HA static int sysctl_ip(SYSCTL_HANDLER_ARGS); static int sysctl_nic(SYSCTL_HANDLER_ARGS); -extern struct pcb dumppcb; /* cheat. dumppcb is a static! */ - static eventhandler_tag nd_tag = NULL; /* record of our shutdown event */ static uint32_t nd_seqno = 1; /* current sequence number */ static uint64_t rcvd_acks; /* flags for out of order acks */ @@ -1184,6 +1182,7 @@ netdump_trigger(void *arg, int howto) * can find the stack trace. */ savectx(&dumppcb); + dumptid = curthread->td_tid; dumping++; if (panicstr == NULL) From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 15:00:26 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A5610657DF; Thu, 2 Sep 2010 15:00:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7FB308FC0C; Thu, 2 Sep 2010 15:00:25 +0000 (UTC) Received: by eyx24 with SMTP id 24so354644eyx.13 for ; Thu, 02 Sep 2010 08:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=pUifwB1qe1NPML1INW0pYQTfl+8y3PzkUz8A5YHSY/s=; b=buThCmu6G8HjJnvk/LUzSktlSRannnhiKFeGkAjYY3lCuWeok3pZmniRqYxjDl4+GE ENuBSlSJq8tfzlCIjbGEMz8U2iXW4T5RuAqTtFtasfdwp+j1ACLBO4tPA8yPCPetsYDJ MJ5RdyEcDSFMqgE/yLJhD6Y1YrNdcZB2l/ZS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=EVu9/3yE0Twd45JvvL7cpSbe+kTF5jOza3CGB4JfdBBAkRNIbsUbyYiHM9IacBUFfv z/0fblj9NHbME/6QMIbmlR4oBW+vQBDsUwcfDZrjlvplekSe6GqaU+E8Tvw+AxGgayQv anR4KShVtQjwVY9mADG5kzebtVc6sD3WuzpRk= MIME-Version: 1.0 Received: by 10.213.89.205 with SMTP id f13mr1753085ebm.52.1283438113159; Thu, 02 Sep 2010 07:35:13 -0700 (PDT) Received: by 10.213.28.19 with HTTP; Thu, 2 Sep 2010 07:35:13 -0700 (PDT) In-Reply-To: <201009020933.o829XmS9098339@svn.freebsd.org> References: <201009020933.o829XmS9098339@svn.freebsd.org> Date: Thu, 2 Sep 2010 10:35:13 -0400 Message-ID: From: Ryan Stone To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212142 - in projects/sv/sys: amd64/amd64 arm/arm geom i386/i386 ia64/ia64 net powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 15:00:26 -0000 On Thu, Sep 2, 2010 at 5:33 AM, Attilio Rao wrote: > Log: > Introduce a flag field for the dumpers and use it immediately for the > DIF_NET flag. > This flag is responsible for toggling a netdump and having a correct set > of dumplo in the dumping routines. > To be honest, I'd be happier if the DIF_NET flag disappeared entirely. It seems to me that dumpsys shouldn't need knowledge of disk geometry -- especially now when there may not be a disk at all. It seems to me that the correct interface would be for dumpsys to pass the offset into the core file to the dumper, and the dumper should convert that to a value appropriate for the dump device. From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 19:43:10 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D4D4106585E; Thu, 2 Sep 2010 19:43:10 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 094E98FC1B; Thu, 2 Sep 2010 19:43:09 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Thu, 2 Sep 2010 15:43:09 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 2DFB933C00; Thu, 2 Sep 2010 15:43:09 -0400 (EDT) Date: Thu, 2 Sep 2010 15:43:09 -0400 From: Ed Maste To: Ryan Stone Message-ID: <20100902194309.GA36288@sandvine.com> References: <201009020933.o829XmS9098339@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Attilio Rao , svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212142 - in projects/sv/sys: amd64/amd64 arm/arm geom i386/i386 ia64/ia64 net powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 19:43:10 -0000 On Thu, Sep 02, 2010 at 10:35:13AM -0400, Ryan Stone wrote: > On Thu, Sep 2, 2010 at 5:33 AM, Attilio Rao wrote: > > Log: > > Introduce a flag field for the dumpers and use it immediately for the > > DIF_NET flag. > > This flag is responsible for toggling a netdump and having a correct set > > of dumplo in the dumping routines. > > > > To be honest, I'd be happier if the DIF_NET flag disappeared entirely. > It seems to me that dumpsys shouldn't need knowledge of disk geometry > -- especially now when there may not be a disk at all. It seems to me > that the correct interface would be for dumpsys to pass the offset > into the core file to the dumper, and the dumper should convert that > to a value appropriate for the dump device. I agree; in fact, on my ToDo list I've got: 14. dump_write API change to take offset (and add di->mediaoffset itself) * makes netdumping slightly cleaner If this is the only use of DIF_NET flag then we certainly should be able to get rid of it. - Ed From owner-svn-src-projects@FreeBSD.ORG Thu Sep 2 19:53:04 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85880106582D; Thu, 2 Sep 2010 19:53:04 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0233A8FC14; Thu, 2 Sep 2010 19:53:03 +0000 (UTC) Received: by qwg5 with SMTP id 5so981313qwg.13 for ; Thu, 02 Sep 2010 12:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=UAoc34+qkfue6l3M9pVOGJ0lQ+BLveDnIpQfE8K7nqM=; b=GGh1PcL+2CjVqMxHt5ZfrQH6fcDHFxGSmgx/SwAzovMMRjuiE5W2tAMgFrbwklXp/3 n0BR1Gh4Vf9WoNcYTwtT0ZCbl3lm7dzK6pvupnDWv5PLEeaUL1hQ2yOjrptGYN6E4K/6 +m50bwbotCfiXA2WfR/sCshMpRJ/7ndarQMAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ufrELzvQYwZ57chHspRj8RomJ1qGrj2m73GJ1t8uLNSY6q8eD32CVpwyCL//bwyK0q 3siniD4Vp5GA/cy9nTTAdWZUlsLGj8haSi3ed9cJ9q+tlEA+vinqD4LmfXYL6qzIYlIl AG5jrixe6PBKO9XDOsyYsBBNfhcFdtDR4bVGI= MIME-Version: 1.0 Received: by 10.224.53.35 with SMTP id k35mr6841998qag.250.1283457182991; Thu, 02 Sep 2010 12:53:02 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.222.209 with HTTP; Thu, 2 Sep 2010 12:53:02 -0700 (PDT) In-Reply-To: <20100902194309.GA36288@sandvine.com> References: <201009020933.o829XmS9098339@svn.freebsd.org> <20100902194309.GA36288@sandvine.com> Date: Thu, 2 Sep 2010 21:53:02 +0200 X-Google-Sender-Auth: 6_Ch-mGqrdwCEGgxRaKjnq1SKhs Message-ID: From: Attilio Rao To: Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, Ryan Stone Subject: Re: svn commit: r212142 - in projects/sv/sys: amd64/amd64 arm/arm geom i386/i386 ia64/ia64 net powerpc/powerpc sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 19:53:04 -0000 2010/9/2 Ed Maste : > On Thu, Sep 02, 2010 at 10:35:13AM -0400, Ryan Stone wrote: > >> On Thu, Sep 2, 2010 at 5:33 AM, Attilio Rao wrote: >> > Log: >> > =C2=A0Introduce a flag field for the dumpers and use it immediately fo= r the >> > =C2=A0DIF_NET flag. >> > =C2=A0This flag is responsible for toggling a netdump and having a cor= rect set >> > =C2=A0of dumplo in the dumping routines. >> > >> >> To be honest, I'd be happier if the DIF_NET flag disappeared entirely. >> =C2=A0It seems to me that dumpsys shouldn't need knowledge of disk geome= try >> -- especially now when there may not be a disk at all. =C2=A0It seems to= me >> that the correct interface would be for dumpsys to pass the offset >> into the core file to the dumper, and the dumper should convert that >> to a value appropriate for the dump device. > > I agree; in fact, on my ToDo list I've got: > > 14. dump_write API change to take offset (and add di->mediaoffset itself) > =C2=A0* makes netdumping slightly cleaner > > If this is the only use of DIF_NET flag then we certainly should be > able to get rid of it. Yes, I think that it should be eas(ish)y to do and I think it is a good ide= a. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein