From owner-p4-projects@FreeBSD.ORG Sun Jun 19 13:42:21 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B22016A420; Sun, 19 Jun 2005 13:42:21 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E548416A41C for ; Sun, 19 Jun 2005 13:42:20 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D263943D1F for ; Sun, 19 Jun 2005 13:42:20 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5JDgKAI038664 for ; Sun, 19 Jun 2005 13:42:20 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5JDgKQc038661 for perforce@freebsd.org; Sun, 19 Jun 2005 13:42:20 GMT (envelope-from wsalamon@computer.org) Date: Sun, 19 Jun 2005 13:42:20 GMT Message-Id: <200506191342.j5JDgKQc038661@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 78717 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2005 13:42:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=78717 Change 78717 by wsalamon@rickenbacker on 2005/06/19 13:41:49 Define the needed trigger-related constants. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit.h#8 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit.h#8 (text+ko) ==== @@ -32,11 +32,18 @@ /* * Triggers for the audit daemon */ +#define AUDIT_TRIGGER_MIN 1 #define AUDIT_TRIGGER_LOW_SPACE 1 #define AUDIT_TRIGGER_OPEN_NEW 2 #define AUDIT_TRIGGER_READ_FILE 3 #define AUDIT_TRIGGER_CLOSE_AND_DIE 4 #define AUDIT_TRIGGER_NO_SPACE 5 +#define AUDIT_TRIGGER_MAX 5 + +/* + * File that will be read for trigger events from the kernel + */ +#define AUDIT_TRIGGER_FILE "/dev/audit" /* * Pre-defined audit IDs @@ -122,6 +129,7 @@ #define A_GETPINFO_ADDR 28 #define A_GETKAUDIT 29 #define A_SETKAUDIT 30 +#define A_SENDTRIGGER 31 /* * Audit policy controls. From owner-p4-projects@FreeBSD.ORG Sun Jun 19 13:45:25 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5E53C16A420; Sun, 19 Jun 2005 13:45:25 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38B4916A41C for ; Sun, 19 Jun 2005 13:45:25 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C38143D1F for ; Sun, 19 Jun 2005 13:45:25 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5JDjOQv038861 for ; Sun, 19 Jun 2005 13:45:24 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5JDjOdC038858 for perforce@freebsd.org; Sun, 19 Jun 2005 13:45:24 GMT (envelope-from wsalamon@computer.org) Date: Sun, 19 Jun 2005 13:45:24 GMT Message-Id: <200506191345.j5JDjOdC038858@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 78718 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2005 13:45:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=78718 Change 78718 by wsalamon@rickenbacker on 2005/06/19 13:45:07 Move the audit triggering into the auditon() syscall. Note that the audit.h file is still maintained outside of the OpenBSM project. This will change in the future. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#13 edit .. //depot/projects/trustedbsd/audit3/sys/bsm/audit_kernel.h#15 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#23 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#13 (text+ko) ==== @@ -54,11 +54,13 @@ /* * Triggers for the audit daemon */ +#define AUDIT_TRIGGER_MIN 1 #define AUDIT_TRIGGER_LOW_SPACE 1 #define AUDIT_TRIGGER_OPEN_NEW 2 #define AUDIT_TRIGGER_READ_FILE 3 #define AUDIT_TRIGGER_CLOSE_AND_DIE 4 #define AUDIT_TRIGGER_NO_SPACE 5 +#define AUDIT_TRIGGER_MAX 5 /* * Pre-defined audit IDs @@ -144,6 +146,7 @@ #define A_GETPINFO_ADDR 28 #define A_GETKAUDIT 29 #define A_SETKAUDIT 30 +#define A_SENDTRIGGER 31 /* * Audit policy controls. @@ -171,13 +174,6 @@ #define AU_FS_MINFREE 20 /* default min filesystem freespace, in percent */ -/* - * auditctl(2) commands - */ -#define AC_SETLOGFILE 1 -#define AC_SHUTDOWN 2 -#define AC_SENDTRIGGER 3 - __BEGIN_DECLS typedef uid_t au_id_t; ==== //depot/projects/trustedbsd/audit3/sys/bsm/audit_kernel.h#15 (text+ko) ==== @@ -136,6 +136,7 @@ long au_cond; long au_flags; long au_policy; + int au_trigger; au_evclass_map_t au_evclass; au_mask_t au_mask; auditinfo_t au_auinfo; ==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#23 (text+ko) ==== @@ -911,6 +911,7 @@ case A_GETCLASS: case A_GETPINFO: case A_GETPINFO_ADDR: + case A_SENDTRIGGER: error = copyin(uap->data, (void *)&udata, uap->length); if (error) return (error); @@ -1049,6 +1050,14 @@ case A_SETKAUDIT: return (ENOSYS); break; + case A_SENDTRIGGER: + if ((udata.au_trigger < AUDIT_TRIGGER_MIN) || + (udata.au_trigger > AUDIT_TRIGGER_MAX)) + return (EINVAL); + error = send_trigger(udata.au_trigger); + if (error) + return (error); + break; } /* Copy data back to userspace for the GET comands */ switch (uap->cmd) { From owner-p4-projects@FreeBSD.ORG Sun Jun 19 13:49:31 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD8C816A420; Sun, 19 Jun 2005 13:49:30 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 998FA16A41C for ; Sun, 19 Jun 2005 13:49:30 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B68843D1F for ; Sun, 19 Jun 2005 13:49:30 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5JDnUHI039020 for ; Sun, 19 Jun 2005 13:49:30 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5JDnU0Y039017 for perforce@freebsd.org; Sun, 19 Jun 2005 13:49:30 GMT (envelope-from wsalamon@computer.org) Date: Sun, 19 Jun 2005 13:49:30 GMT Message-Id: <200506191349.j5JDnU0Y039017@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 78719 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2005 13:49:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=78719 Change 78719 by wsalamon@rickenbacker on 2005/06/19 13:48:50 Update auditd and audit command to use the new triggering facility in auditon() syscall. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.c#5 edit .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.c#11 edit Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.c#5 (text+ko) ==== @@ -6,13 +6,16 @@ * */ +#include +#include +#include + +#include + #include +#include #include -#include #include -#include -#include -#include void usage() { @@ -35,15 +38,15 @@ switch(ch) { case 'n': - trigger = AUDITD_TRIGGER_OPEN_NEW; + trigger = AUDIT_TRIGGER_OPEN_NEW; break; case 's': - trigger = AUDITD_TRIGGER_READ_FILE; + trigger = AUDIT_TRIGGER_READ_FILE; break; case 't': - trigger = AUDITD_TRIGGER_CLOSE_AND_DIE; + trigger = AUDIT_TRIGGER_CLOSE_AND_DIE; break; case '?': @@ -52,7 +55,7 @@ break; } } - if (auditctl(AC_SENDTRIGGER, &trigger, sizeof(trigger)) < 0) { + if (auditon(A_SENDTRIGGER, &trigger, sizeof(trigger)) < 0) { perror("Error sending trigger"); exit(-1); } else { ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.c#11 (text+ko) ==== @@ -29,19 +29,19 @@ #include #include +#include +#include +#include + +#include #include -#include #include #include +#include #include -#include -#include #include #include - -#include -#include -#include +#include #include "auditd.h" #define NA_EVENT_STR_SIZE 25 @@ -186,7 +186,7 @@ if (open(fn, O_RDONLY | O_CREAT, S_IRUSR | S_IRGRP) < 0) { perror("File open"); } - else if (auditctl(AC_SETLOGFILE, &fn, sizeof(fn)) != 0) { + else if (auditctl(fn) != 0) { syslog(LOG_ERR, "auditctl failed setting log file! : %s\n", strerror(errno)); @@ -288,6 +288,7 @@ char TS[POSTFIX_LEN]; int aufd; token_t *tok; + long cond; /* Generate an audit record */ if((aufd = au_open()) == -1) { @@ -304,9 +305,10 @@ } /* flush contents */ - err_ret = auditctl(AC_SHUTDOWN, NULL, 0); + cond = AUC_DISABLED; + err_ret = auditon(A_SETCOND, &cond, sizeof(cond)); if (err_ret != 0) { - syslog(LOG_ERR, "auditctl failed! : %s\n", + syslog(LOG_ERR, "Disabling audit failed! : %s\n", strerror(errno)); err_ret = 1; } From owner-p4-projects@FreeBSD.ORG Sun Jun 19 14:06:52 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 08ECD16A420; Sun, 19 Jun 2005 14:06:52 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3CAD16A41C for ; Sun, 19 Jun 2005 14:06:51 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C064C43D55 for ; Sun, 19 Jun 2005 14:06:51 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5JE6prp039688 for ; Sun, 19 Jun 2005 14:06:51 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5JE6pSj039685 for perforce@freebsd.org; Sun, 19 Jun 2005 14:06:51 GMT (envelope-from wsalamon@computer.org) Date: Sun, 19 Jun 2005 14:06:51 GMT Message-Id: <200506191406.j5JE6pSj039685@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 78720 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2005 14:06:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=78720 Change 78720 by wsalamon@rickenbacker on 2005/06/19 14:05:58 Update the man page for auditon to include the trigger command and values. Affected files ... .. //depot/projects/trustedbsd/openbsm/man/auditon.2#4 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/man/auditon.2#4 (text+ko) ==== @@ -212,11 +212,27 @@ .It Dv A_GETCOND Return the current auditing condition. .Ft *data -must point to an long value which will be set to +must point to a long value which will be set to the current audit condition, either .Dv AUC_AUDITING or .Dv AUC_NOAUDIT . +.It Dv A_SENDTRIGGER +Send a trigger to the audit daemon. +.Fr *data +must point to a long value set to one of the acceptable +trigger values: +.Dv AUDIT_TRIGGER_LOW_SPACE +(low disk space where the audit log resides), +.Dv AUDIT_TRIGGER_OPEN_NEW +(open a new audit log file), +.Dv AUDIT_TRIGGER_READ_FILE +(read the audit_control file), +.Dv AUDIT_TRIGGER_CLOSE_AND_DIE +(close the current log file and exit), +or +.Dv AUDIT_TRIGGER_NO_SPACE +(no disk space left for audit log file). .El .Sh RETURN VALUES .Rv -std From owner-p4-projects@FreeBSD.ORG Mon Jun 20 19:38:06 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 18BFE16A422; Mon, 20 Jun 2005 19:38:06 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E259816A41C for ; Mon, 20 Jun 2005 19:38:05 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DFEB43D55 for ; Mon, 20 Jun 2005 19:38:05 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5KJc5oQ064302 for ; Mon, 20 Jun 2005 19:38:05 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5KJc4ml064299 for perforce@freebsd.org; Mon, 20 Jun 2005 19:38:04 GMT (envelope-from jhb@freebsd.org) Date: Mon, 20 Jun 2005 19:38:04 GMT Message-Id: <200506201938.j5KJc4ml064299@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78743 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 19:38:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=78743 Change 78743 by jhb@jhb_slimer on 2005/06/20 19:37:30 Implement round one of atomic changes: more macros, less identical functions. Affected files ... .. //depot/projects/smpng/sys/alpha/include/atomic.h#22 edit .. //depot/projects/smpng/sys/amd64/include/atomic.h#16 edit .. //depot/projects/smpng/sys/arm/include/atomic.h#12 edit .. //depot/projects/smpng/sys/i386/include/atomic.h#33 edit .. //depot/projects/smpng/sys/notes#43 edit Differences ... ==== //depot/projects/smpng/sys/alpha/include/atomic.h#22 (text+ko) ==== @@ -216,28 +216,6 @@ return result; } -#define atomic_set_char atomic_set_8 -#define atomic_clear_char atomic_clear_8 -#define atomic_add_char atomic_add_8 -#define atomic_subtract_char atomic_subtract_8 - -#define atomic_set_short atomic_set_16 -#define atomic_clear_short atomic_clear_16 -#define atomic_add_short atomic_add_16 -#define atomic_subtract_short atomic_subtract_16 - -#define atomic_set_int atomic_set_32 -#define atomic_clear_int atomic_clear_32 -#define atomic_add_int atomic_add_32 -#define atomic_subtract_int atomic_subtract_32 -#define atomic_readandclear_int atomic_readandclear_32 - -#define atomic_set_long atomic_set_64 -#define atomic_clear_long atomic_clear_64 -#define atomic_add_long atomic_add_64 -#define atomic_subtract_long atomic_subtract_64 -#define atomic_readandclear_long atomic_readandclear_64 - #define ATOMIC_ACQ_REL(NAME, WIDTH, TYPE) \ static __inline void \ atomic_##NAME##_acq_##WIDTH(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\ @@ -251,22 +229,9 @@ { \ alpha_mb(); \ atomic_##NAME##_##WIDTH(p, v); \ -} \ - \ -static __inline void \ -atomic_##NAME##_acq_##TYPE(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\ -{ \ - atomic_##NAME##_##WIDTH(p, v); \ - alpha_mb(); \ -} \ - \ -static __inline void \ -atomic_##NAME##_rel_##TYPE(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\ -{ \ - alpha_mb(); \ - atomic_##NAME##_##WIDTH(p, v); \ } +/* Variants of simple arithmetic with memory barriers. */ ATOMIC_ACQ_REL(set, 8, char) ATOMIC_ACQ_REL(clear, 8, char) ATOMIC_ACQ_REL(add, 8, char) @@ -289,11 +254,11 @@ /* * We assume that a = b will do atomic loads and stores. */ -#define ATOMIC_STORE_LOAD(TYPE, WIDTH) \ -static __inline u_##TYPE \ -atomic_load_acq_##WIDTH(volatile u_##TYPE *p) \ +#define ATOMIC_STORE_LOAD(WIDTH) \ +static __inline u_int##WIDTH##_t \ +atomic_load_acq_##WIDTH(volatile u_int##WIDTH##_t *p) \ { \ - u_##TYPE v; \ + u_int##WIDTH##_t v; \ \ v = *p; \ alpha_mb(); \ @@ -301,32 +266,14 @@ } \ \ static __inline void \ -atomic_store_rel_##WIDTH(volatile u_##TYPE *p, u_##TYPE v)\ -{ \ - alpha_mb(); \ - *p = v; \ -} \ -static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ -{ \ - u_##TYPE v; \ - \ - v = *p; \ - alpha_mb(); \ - return (v); \ -} \ - \ -static __inline void \ -atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ +atomic_store_rel_##WIDTH(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\ { \ alpha_mb(); \ *p = v; \ } -ATOMIC_STORE_LOAD(char, 8) -ATOMIC_STORE_LOAD(short, 16) -ATOMIC_STORE_LOAD(int, 32) -ATOMIC_STORE_LOAD(long, 64) +ATOMIC_STORE_LOAD(32) +ATOMIC_STORE_LOAD(64) #undef ATOMIC_STORE_LOAD @@ -384,17 +331,6 @@ return ret; } -#define atomic_cmpset_int atomic_cmpset_32 -#define atomic_cmpset_long atomic_cmpset_64 - -static __inline int -atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) -{ - - return (atomic_cmpset_long((volatile u_long *)dst, (u_long)exp, - (u_long)src)); -} - static __inline u_int32_t atomic_cmpset_acq_32(volatile u_int32_t *p, u_int32_t cmpval, u_int32_t newval) { @@ -429,10 +365,82 @@ return (atomic_cmpset_64(p, cmpval, newval)); } +/* Operations on chars. */ +#define atomic_set_char atomic_set_8 +#define atomic_set_acq_char atomic_set_acq_8 +#define atomic_set_rel_char atomic_set_rel_8 +#define atomic_clear_char atomic_clear_8 +#define atomic_clear_acq_char atomic_clear_acq_8 +#define atomic_clear_rel_char atomic_clear_rel_8 +#define atomic_add_char atomic_add_8 +#define atomic_add_acq_char atomic_add_acq_8 +#define atomic_add_rel_char atomic_add_rel_8 +#define atomic_subtract_char atomic_subtract_8 +#define atomic_subtract_acq_char atomic_subtract_acq_8 +#define atomic_subtract_rel_char atomic_subtract_rel_8 + +/* Operations on shorts. */ +#define atomic_set_short atomic_set_16 +#define atomic_set_acq_short atomic_set_acq_16 +#define atomic_set_rel_short atomic_set_rel_16 +#define atomic_clear_short atomic_clear_16 +#define atomic_clear_acq_short atomic_clear_acq_16 +#define atomic_clear_rel_short atomic_clear_rel_16 +#define atomic_add_short atomic_add_16 +#define atomic_add_acq_short atomic_add_acq_16 +#define atomic_add_rel_short atomic_add_rel_16 +#define atomic_subtract_short atomic_subtract_16 +#define atomic_subtract_acq_short atomic_subtract_acq_16 +#define atomic_subtract_rel_short atomic_subtract_rel_16 + +/* Operations on ints. */ +#define atomic_set_int atomic_set_32 +#define atomic_set_acq_int atomic_set_acq_32 +#define atomic_set_rel_int atomic_set_rel_32 +#define atomic_clear_int atomic_clear_32 +#define atomic_clear_acq_int atomic_clear_acq_32 +#define atomic_clear_rel_int atomic_clear_rel_32 +#define atomic_add_int atomic_add_32 +#define atomic_add_acq_int atomic_add_acq_32 +#define atomic_add_rel_int atomic_add_rel_32 +#define atomic_subtract_int atomic_subtract_32 +#define atomic_subtract_acq_int atomic_subtract_acq_32 +#define atomic_subtract_rel_int atomic_subtract_rel_32 +#define atomic_cmpset_int atomic_cmpset_32 #define atomic_cmpset_acq_int atomic_cmpset_acq_32 #define atomic_cmpset_rel_int atomic_cmpset_rel_32 +#define atomic_load_acq_int atomic_load_acq_32 +#define atomic_store_rel_int atomic_store_rel_32 +#define atomic_readandclear_int atomic_readandclear_32 + +/* Operations on longs. */ +#define atomic_set_long atomic_set_64 +#define atomic_set_acq_long atomic_set_acq_64 +#define atomic_set_rel_long atomic_set_rel_64 +#define atomic_clear_long atomic_clear_64 +#define atomic_clear_acq_long atomic_clear_acq_64 +#define atomic_clear_rel_long atomic_clear_rel_64 +#define atomic_add_long atomic_add_64 +#define atomic_add_acq_long atomic_add_acq_64 +#define atomic_add_rel_long atomic_add_rel_64 +#define atomic_subtract_long atomic_subtract_64 +#define atomic_subtract_acq_long atomic_subtract_acq_64 +#define atomic_subtract_rel_long atomic_subtract_rel_64 +#define atomic_cmpset_long atomic_cmpset_64 #define atomic_cmpset_acq_long atomic_cmpset_acq_64 #define atomic_cmpset_rel_long atomic_cmpset_rel_64 +#define atomic_load_acq_long atomic_load_acq_64 +#define atomic_store_rel_long atomic_store_rel_64 +#define atomic_readandclear_long atomic_readandclear_64 + +/* Operations on pointers. */ +static __inline int +atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) +{ + + return (atomic_cmpset_long((volatile u_long *)dst, (u_long)exp, + (u_long)src)); +} static __inline int atomic_cmpset_acq_ptr(volatile void *dst, void *exp, void *src) ==== //depot/projects/smpng/sys/amd64/include/atomic.h#16 (text+ko) ==== @@ -162,9 +162,6 @@ return (res); } -#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ - -#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE) #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ static __inline u_##TYPE \ @@ -234,6 +231,7 @@ #undef ATOMIC_ASM #undef ATOMIC_STORE_LOAD +/* Acquire and release variants are identical to the normal ones. */ #define atomic_set_acq_char atomic_set_char #define atomic_set_rel_char atomic_set_char #define atomic_clear_acq_char atomic_clear_char @@ -275,6 +273,7 @@ #define atomic_cmpset_acq_ptr atomic_cmpset_ptr #define atomic_cmpset_rel_ptr atomic_cmpset_ptr +/* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char #define atomic_set_acq_8 atomic_set_acq_char #define atomic_set_rel_8 atomic_set_rel_char @@ -290,6 +289,7 @@ #define atomic_load_acq_8 atomic_load_acq_char #define atomic_store_rel_8 atomic_store_rel_char +/* Operations on 16-bit words. */ #define atomic_set_16 atomic_set_short #define atomic_set_acq_16 atomic_set_acq_short #define atomic_set_rel_16 atomic_set_rel_short @@ -305,6 +305,7 @@ #define atomic_load_acq_16 atomic_load_acq_short #define atomic_store_rel_16 atomic_store_rel_short +/* Operations on 32-bit double words. */ #define atomic_set_32 atomic_set_int #define atomic_set_acq_32 atomic_set_acq_int #define atomic_set_rel_32 atomic_set_rel_int ==== //depot/projects/smpng/sys/arm/include/atomic.h#12 (text+ko) ==== @@ -283,7 +283,7 @@ #define atomic_store_rel_ptr atomic_store_ptr #define atomic_store_rel_int atomic_store_32 #define atomic_cmpset_rel_32 atomic_cmpset_32 -#define atomic_smpset_rel_ptr atomic_cmpset_ptr +#define atomic_cmpset_rel_ptr atomic_cmpset_ptr #define atomic_load_acq_int atomic_load_32 #define atomic_clear_ptr(ptr, bit) atomic_clear_32( \ (volatile uint32_t *)ptr, (uint32_t)bit) ==== //depot/projects/smpng/sys/i386/include/atomic.h#33 (text+ko) ==== @@ -172,10 +172,6 @@ #endif /* defined(CPU_DISABLE_CMPXCHG) */ -#endif /* __GNUCLIKE_ASM */ - -#ifdef __GNUCLIKE_ASM - #if defined(_KERNEL) && !defined(SMP) /* @@ -257,19 +253,14 @@ ATOMIC_ASM(add, int, "addl %1,%0", "ir", v); ATOMIC_ASM(subtract, int, "subl %1,%0", "ir", v); -ATOMIC_ASM(set, long, "orl %1,%0", "ir", v); -ATOMIC_ASM(clear, long, "andl %1,%0", "ir", ~v); -ATOMIC_ASM(add, long, "addl %1,%0", "ir", v); -ATOMIC_ASM(subtract, long, "subl %1,%0", "ir", v); - ATOMIC_STORE_LOAD(char, "cmpxchgb %b0,%1", "xchgb %b1,%0"); ATOMIC_STORE_LOAD(short,"cmpxchgw %w0,%1", "xchgw %w1,%0"); ATOMIC_STORE_LOAD(int, "cmpxchgl %0,%1", "xchgl %1,%0"); -ATOMIC_STORE_LOAD(long, "cmpxchgl %0,%1", "xchgl %1,%0"); #undef ATOMIC_ASM #undef ATOMIC_STORE_LOAD +/* Acquire and release variants are identical to the normal ones. */ #define atomic_set_acq_char atomic_set_char #define atomic_set_rel_char atomic_set_char #define atomic_clear_acq_char atomic_clear_char @@ -314,6 +305,7 @@ #define atomic_cmpset_acq_ptr atomic_cmpset_ptr #define atomic_cmpset_rel_ptr atomic_cmpset_ptr +/* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char #define atomic_set_acq_8 atomic_set_acq_char #define atomic_set_rel_8 atomic_set_rel_char @@ -329,6 +321,7 @@ #define atomic_load_acq_8 atomic_load_acq_char #define atomic_store_rel_8 atomic_store_rel_char +/* Operations on 16-bit words. */ #define atomic_set_16 atomic_set_short #define atomic_set_acq_16 atomic_set_acq_short #define atomic_set_rel_16 atomic_set_rel_short @@ -344,6 +337,7 @@ #define atomic_load_acq_16 atomic_load_acq_short #define atomic_store_rel_16 atomic_store_rel_short +/* Operations on 32-bit double words. */ #define atomic_set_32 atomic_set_int #define atomic_set_acq_32 atomic_set_acq_int #define atomic_set_rel_32 atomic_set_rel_int @@ -363,6 +357,16 @@ #define atomic_cmpset_rel_32 atomic_cmpset_rel_int #define atomic_readandclear_32 atomic_readandclear_int +/* Operations on longs. */ +#define atomic_set_long(p, v) atomic_set_int((u_int *)(p), (v)) +#define atomic_clear_long(p, v) atomic_clear_int((u_int *)(p), (v)) +#define atomic_add_long(p, v) atomic_add_int((u_int *)(p), (v)) +#define atomic_subtract_long(p, v) atomic_subtract_int((u_int *)(p), (v)) +#define atomic_cmpset_long(d, e, s) atomic_cmpset_int((u_int *)(d), (e), (s)) +#define atomic_load_acq_long(p) atomic_load_acq_int((u_int *)(p)) +#define atomic_store_rel_long(p, v) atomic_store_rel_int((u_int *)(p), (v)) +#define atomic_readandclear_long(p) atomic_readandclear_int((u_int *)(p)) + #if !defined(WANT_FUNCTIONS) static __inline int atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) ==== //depot/projects/smpng/sys/notes#43 (text+ko) ==== @@ -42,7 +42,7 @@ - sys + start over saving current state in the ktrace branch so I can break this up - use more macros and duplicate less identical functions - - implement + + implement - test - commit - stop using '+' with "m" arguments From owner-p4-projects@FreeBSD.ORG Mon Jun 20 21:14:03 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F01D16A420; Mon, 20 Jun 2005 21:14:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C708C16A41C for ; Mon, 20 Jun 2005 21:14:02 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA05D43D53 for ; Mon, 20 Jun 2005 21:14:02 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5KLE27d075014 for ; Mon, 20 Jun 2005 21:14:02 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5KLE2eL075011 for perforce@freebsd.org; Mon, 20 Jun 2005 21:14:02 GMT (envelope-from jhb@freebsd.org) Date: Mon, 20 Jun 2005 21:14:02 GMT Message-Id: <200506202114.j5KLE2eL075011@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78747 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 21:14:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=78747 Change 78747 by jhb@jhb_slimer on 2005/06/20 21:13:22 Compile. Affected files ... .. //depot/projects/smpng/sys/i386/include/atomic.h#34 edit .. //depot/projects/smpng/sys/kern/kern_exit.c#96 edit .. //depot/projects/smpng/sys/kern/kern_kse.c#21 edit .. //depot/projects/smpng/sys/kern/kern_shutdown.c#58 edit Differences ... ==== //depot/projects/smpng/sys/i386/include/atomic.h#34 (text+ko) ==== @@ -298,7 +298,6 @@ #define atomic_add_rel_long atomic_add_long #define atomic_subtract_acq_long atomic_subtract_long #define atomic_subtract_rel_long atomic_subtract_long -#define atomic_cmpset_long atomic_cmpset_int #define atomic_cmpset_acq_long atomic_cmpset_acq_int #define atomic_cmpset_rel_long atomic_cmpset_rel_int @@ -358,14 +357,14 @@ #define atomic_readandclear_32 atomic_readandclear_int /* Operations on longs. */ -#define atomic_set_long(p, v) atomic_set_int((u_int *)(p), (v)) -#define atomic_clear_long(p, v) atomic_clear_int((u_int *)(p), (v)) -#define atomic_add_long(p, v) atomic_add_int((u_int *)(p), (v)) -#define atomic_subtract_long(p, v) atomic_subtract_int((u_int *)(p), (v)) -#define atomic_cmpset_long(d, e, s) atomic_cmpset_int((u_int *)(d), (e), (s)) -#define atomic_load_acq_long(p) atomic_load_acq_int((u_int *)(p)) -#define atomic_store_rel_long(p, v) atomic_store_rel_int((u_int *)(p), (v)) -#define atomic_readandclear_long(p) atomic_readandclear_int((u_int *)(p)) +#define atomic_set_long(p, v) atomic_set_int((volatile u_int *)(p), (v)) +#define atomic_clear_long(p, v) atomic_clear_int((volatile u_int *)(p), (v)) +#define atomic_add_long(p, v) atomic_add_int((volatile u_int *)(p), (v)) +#define atomic_subtract_long(p, v) atomic_subtract_int((volatile u_int *)(p), (v)) +#define atomic_cmpset_long(d, e, s) atomic_cmpset_int((volatile u_int *)(d), (e), (s)) +#define atomic_load_acq_long(p) atomic_load_acq_int((volatile u_int *)(p)) +#define atomic_store_rel_long(p, v) atomic_store_rel_int((volatile u_int *)(p), (v)) +#define atomic_readandclear_long(p) atomic_readandclear_int((volatile u_int *)(p)) #if !defined(WANT_FUNCTIONS) static __inline int @@ -435,24 +434,8 @@ return (result); } -static __inline u_long -atomic_readandclear_long(volatile u_long *addr) -{ - u_long result; - - __asm __volatile ( - " xorl %0,%0 ; " - " xchgl %1,%0 ; " - "# atomic_readandclear_int" - : "=&r" (result) /* 0 (result) */ - : "m" (*addr)); /* 1 (addr) */ - - return (result); -} - #else /* !__GNUCLIKE_ASM */ -extern u_long atomic_readandclear_long(volatile u_long *); extern u_int atomic_readandclear_int(volatile u_int *); #endif /* __GNUCLIKE_ASM */ ==== //depot/projects/smpng/sys/kern/kern_exit.c#96 (text+ko) ==== @@ -505,8 +505,8 @@ wakeup(p->p_pptr); PROC_UNLOCK(p->p_pptr); - WITNESS_WARN(WARN_PANIC, &p->p_mtx, "process (pid %d) exiting", - p->p_pid); + WITNESS_WARN(WARN_PANIC, &p->p_mtx.mtx_object, + "process (pid %d) exiting", p->p_pid); mtx_lock_spin(&sched_lock); critical_exit(); ==== //depot/projects/smpng/sys/kern/kern_kse.c#21 (text+ko) ==== @@ -1313,7 +1313,7 @@ PROC_LOCK(p); if (kg->kg_upsleeps) wakeup(&kg->kg_completed); - WITNESS_WARN(WARN_PANIC, &p->p_mtx, + WITNESS_WARN(WARN_PANIC, &p->p_mtx.mtx_object, "thread exiting in userret"); mtx_lock_spin(&sched_lock); thread_stopped(p); ==== //depot/projects/smpng/sys/kern/kern_shutdown.c#58 (text+ko) ==== @@ -474,7 +474,7 @@ } #ifdef SMP -static volatile uintptr_t panic_thread; +static volatile void *panic_thread; #endif /* @@ -492,7 +492,7 @@ va_list ap; static char buf[256]; #ifdef SMP - uintptr_t tid; + void *tid; /* * We don't want multiple CPU's to panic at the same time, so we @@ -500,7 +500,7 @@ * panic_thread if we are spinning in case the panic on the first * CPU is canceled. */ - tid = (uintptr_t)td; + tid = td; if (panic_thread != tid) while (atomic_cmpset_ptr(&panic_thread, 0, tid) == 0) while (panic_thread != 0) From owner-p4-projects@FreeBSD.ORG Tue Jun 21 17:04:10 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3CAAB16A420; Tue, 21 Jun 2005 17:04:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF28416A41C for ; Tue, 21 Jun 2005 17:04:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C78FB43D53 for ; Tue, 21 Jun 2005 17:04:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LH49W1057372 for ; Tue, 21 Jun 2005 17:04:09 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LH49ck057369 for perforce@freebsd.org; Tue, 21 Jun 2005 17:04:09 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 17:04:09 GMT Message-Id: <200506211704.j5LH49ck057369@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78763 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:04:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=78763 Change 78763 by jhb@jhb_slimer on 2005/06/21 17:03:13 Another todo. Affected files ... .. //depot/projects/smpng/sys/notes#44 edit Differences ... ==== //depot/projects/smpng/sys/notes#44 (text+ko) ==== @@ -97,6 +97,8 @@ - fork counts? - Add a cache-line padded mtx_aligned union and use it for the mutex pools. - Robert wants intrcnt's for IPIs +- Add checks to msleep() and cv_wait*() to ensure they aren't called by an + interrupt thread. Active child branches: - jhb_intr - intr_event stuff From owner-p4-projects@FreeBSD.ORG Tue Jun 21 17:04:11 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F33916A430; Tue, 21 Jun 2005 17:04:11 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAEFA16A421 for ; Tue, 21 Jun 2005 17:04:10 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEECB43D53 for ; Tue, 21 Jun 2005 17:04:10 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LH4ANC057379 for ; Tue, 21 Jun 2005 17:04:10 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LH495X057375 for perforce@freebsd.org; Tue, 21 Jun 2005 17:04:09 GMT (envelope-from peter@freebsd.org) Date: Tue, 21 Jun 2005 17:04:09 GMT Message-Id: <200506211704.j5LH495X057375@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78764 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:04:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=78764 Change 78764 by peter@peter_daintree on 2005/06/21 17:03:14 IFC @78761 Affected files ... .. //depot/projects/hammer/Makefile#32 integrate .. //depot/projects/hammer/Makefile.inc1#95 integrate .. //depot/projects/hammer/contrib/amd/amd/amd.8#5 integrate .. //depot/projects/hammer/contrib/amd/amq/amq.8#5 integrate .. //depot/projects/hammer/contrib/amd/amq/pawd.1#4 integrate .. //depot/projects/hammer/contrib/amd/fixmount/fixmount.8#6 integrate .. //depot/projects/hammer/contrib/amd/fsinfo/fsinfo.8#7 integrate .. //depot/projects/hammer/contrib/amd/hlfsd/hlfsd.8#6 integrate .. //depot/projects/hammer/contrib/amd/mk-amd-map/mk-amd-map.8#4 integrate .. //depot/projects/hammer/contrib/amd/scripts/amd.conf.5#6 integrate .. //depot/projects/hammer/contrib/amd/wire-test/wire-test.8#4 integrate .. //depot/projects/hammer/contrib/com_err/compile_et.1#2 integrate .. //depot/projects/hammer/contrib/openpam/CREDITS#7 integrate .. //depot/projects/hammer/contrib/openpam/HISTORY#9 integrate .. //depot/projects/hammer/contrib/openpam/MANIFEST#7 integrate .. //depot/projects/hammer/contrib/openpam/Makefile.am#3 integrate .. //depot/projects/hammer/contrib/openpam/Makefile.in#4 integrate .. //depot/projects/hammer/contrib/openpam/RELNOTES#9 integrate .. //depot/projects/hammer/contrib/openpam/aclocal.m4#3 integrate .. //depot/projects/hammer/contrib/openpam/autogen.sh#2 integrate .. //depot/projects/hammer/contrib/openpam/bin/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/bin/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/bin/su/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/bin/su/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/configure#4 integrate .. //depot/projects/hammer/contrib/openpam/doc/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/doc/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/Makefile.am#3 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_borrow_cred.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_free_data.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_free_envlist.3#2 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_get_option.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_log.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_nullconv.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_readline.3#5 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_restore_cred.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_set_option.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/openpam_ttyconv.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam.conf.5#1 branch .. //depot/projects/hammer/contrib/openpam/doc/man/pam_acct_mgmt.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_authenticate.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_chauthtok.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_close_session.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_conv.3#5 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_end.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_error.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_get_authtok.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_get_data.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_get_item.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_get_user.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_getenv.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_getenvlist.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_info.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_open_session.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_prompt.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_putenv.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_set_data.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_set_item.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_setcred.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_setenv.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_acct_mgmt.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_authenticate.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_chauthtok.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_close_session.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_open_session.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_sm_setcred.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_start.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_strerror.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_verror.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_vinfo.3#9 integrate .. //depot/projects/hammer/contrib/openpam/doc/man/pam_vprompt.3#9 integrate .. //depot/projects/hammer/contrib/openpam/include/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/include/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/include/security/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/include/security/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/include/security/openpam_version.h#8 integrate .. //depot/projects/hammer/contrib/openpam/lib/Makefile.am#3 integrate .. //depot/projects/hammer/contrib/openpam/lib/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/lib/openpam_dynamic.c#5 integrate .. //depot/projects/hammer/contrib/openpam/lib/openpam_load.c#6 integrate .. //depot/projects/hammer/contrib/openpam/lib/openpam_readline.c#2 integrate .. //depot/projects/hammer/contrib/openpam/lib/openpam_ttyconv.c#11 integrate .. //depot/projects/hammer/contrib/openpam/ltmain.sh#4 integrate .. //depot/projects/hammer/contrib/openpam/misc/gendoc.pl#7 integrate .. //depot/projects/hammer/contrib/openpam/modules/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/modules/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_deny/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_deny/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_deny/pam_deny.c#5 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_permit/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_permit/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_unix/Makefile.am#2 integrate .. //depot/projects/hammer/contrib/openpam/modules/pam_unix/Makefile.in#3 integrate .. //depot/projects/hammer/contrib/pnpinfo/pnpinfo.8#2 integrate .. //depot/projects/hammer/etc/mtree/BSD.x11-4.dist#10 integrate .. //depot/projects/hammer/etc/pccard_ether#14 integrate .. //depot/projects/hammer/etc/rc.d/ipfilter#19 integrate .. //depot/projects/hammer/gnu/usr.bin/groff/tmac/mdoc.local#21 integrate .. //depot/projects/hammer/gnu/usr.bin/send-pr/send-pr.1#6 integrate .. //depot/projects/hammer/lib/libarchive/libarchive-formats.5#7 integrate .. //depot/projects/hammer/lib/libarchive/tar.5#10 integrate .. //depot/projects/hammer/lib/libautofs/libautofs.3#4 integrate .. //depot/projects/hammer/lib/libc/gen/sysctl.3#9 integrate .. //depot/projects/hammer/lib/libc/gen/ttyname.3#5 integrate .. //depot/projects/hammer/lib/libc/net/gai_strerror.3#3 integrate .. //depot/projects/hammer/lib/libc/net/getaddrinfo.3#12 integrate .. //depot/projects/hammer/lib/libc/net/getnameinfo.3#11 integrate .. //depot/projects/hammer/lib/libc/net/getnetent.3#6 integrate .. //depot/projects/hammer/lib/libc/net/inet6_rth_space.3#8 integrate .. //depot/projects/hammer/lib/libc/nls/catgets.3#3 integrate .. //depot/projects/hammer/lib/libc/sys/send.2#12 integrate .. //depot/projects/hammer/lib/libmd/sha.3#7 integrate .. //depot/projects/hammer/lib/libmd/sha256.3#2 integrate .. //depot/projects/hammer/lib/libpam/Makefile.inc#8 integrate .. //depot/projects/hammer/lib/libpam/libpam/Makefile#16 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_exec/pam_exec.8#5 integrate .. //depot/projects/hammer/lib/libsdp/sdp.3#7 integrate .. //depot/projects/hammer/lib/libthr/libthr.3#2 integrate .. //depot/projects/hammer/lib/msun/man/fenv.3#4 integrate .. //depot/projects/hammer/lib/msun/man/ieee.3#10 integrate .. //depot/projects/hammer/lib/msun/man/lround.3#3 integrate .. //depot/projects/hammer/lib/msun/man/math.3#12 integrate .. //depot/projects/hammer/lib/msun/man/round.3#5 integrate .. //depot/projects/hammer/lib/msun/man/trunc.3#3 integrate .. //depot/projects/hammer/release/Makefile#73 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/hardware/alpha/proc-alpha.sgml#17 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/installation/common/trouble.sgml#10 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#99 integrate .. //depot/projects/hammer/release/scripts/lib32-make.sh#1 branch .. //depot/projects/hammer/sbin/Makefile#37 integrate .. //depot/projects/hammer/sbin/ifconfig/af_inet.c#2 integrate .. //depot/projects/hammer/sbin/ifconfig/af_inet6.c#3 integrate .. //depot/projects/hammer/sbin/ifconfig/ifieee80211.c#11 integrate .. //depot/projects/hammer/sbin/mount/mount.8#17 integrate .. //depot/projects/hammer/sbin/savecore/savecore.c#11 integrate .. //depot/projects/hammer/share/man/man1/builtin.1#4 integrate .. //depot/projects/hammer/share/man/man3/pthread_atfork.3#2 integrate .. //depot/projects/hammer/share/man/man4/acpi.4#35 integrate .. //depot/projects/hammer/share/man/man4/carp.4#5 integrate .. //depot/projects/hammer/share/man/man4/cdce.4#3 integrate .. //depot/projects/hammer/share/man/man4/cpufreq.4#7 integrate .. //depot/projects/hammer/share/man/man4/ed.4#8 integrate .. //depot/projects/hammer/share/man/man4/geom.4#8 integrate .. //depot/projects/hammer/share/man/man4/hwpmc.4#4 integrate .. //depot/projects/hammer/share/man/man4/icmp6.4#5 integrate .. //depot/projects/hammer/share/man/man4/if_bridge.4#2 integrate .. //depot/projects/hammer/share/man/man4/ipw.4#3 integrate .. //depot/projects/hammer/share/man/man4/iwi.4#4 integrate .. //depot/projects/hammer/share/man/man4/man4.i386/acpi_fujitsu.4#2 integrate .. //depot/projects/hammer/share/man/man4/man4.i386/mcd.4#6 integrate .. //depot/projects/hammer/share/man/man4/man4.i386/pnp.4#3 integrate .. //depot/projects/hammer/share/man/man4/man4.i386/smapi.4#2 integrate .. //depot/projects/hammer/share/man/man4/ng_ccatm.4#3 integrate .. //depot/projects/hammer/share/man/man4/ng_nat.4#2 integrate .. //depot/projects/hammer/share/man/man4/ng_netflow.4#9 integrate .. //depot/projects/hammer/share/man/man4/ng_source.4#8 integrate .. //depot/projects/hammer/share/man/man4/ng_tcpmss.4#2 integrate .. //depot/projects/hammer/share/man/man4/nve.4#2 integrate .. //depot/projects/hammer/share/man/man4/ral.4#2 integrate .. //depot/projects/hammer/share/man/man4/sched_4bsd.4#2 integrate .. //depot/projects/hammer/share/man/man4/sched_ule.4#2 integrate .. //depot/projects/hammer/share/man/man4/snd_emu10k1.4#5 integrate .. //depot/projects/hammer/share/man/man4/snd_maestro3.4#4 integrate .. //depot/projects/hammer/share/man/man4/snd_via8233.4#2 integrate .. //depot/projects/hammer/share/man/man4/unix.4#5 integrate .. //depot/projects/hammer/share/man/man4/ural.4#2 integrate .. //depot/projects/hammer/share/man/man4/witness.4#6 integrate .. //depot/projects/hammer/share/man/man4/wlan_tkip.4#4 integrate .. //depot/projects/hammer/share/man/man5/autofs.5#3 integrate .. //depot/projects/hammer/share/man/man5/devfs.conf.5#2 integrate .. //depot/projects/hammer/share/man/man5/devfs.rules.5#2 integrate .. //depot/projects/hammer/share/man/man5/elf.5#9 integrate .. //depot/projects/hammer/share/man/man7/release.7#27 integrate .. //depot/projects/hammer/share/man/man9/MUTEX_PROFILING.9#6 integrate .. //depot/projects/hammer/share/man/man9/VFS_SYNC.9#7 integrate .. //depot/projects/hammer/share/man/man9/VFS_VGET.9#9 integrate .. //depot/projects/hammer/share/man/man9/VOP_GETPAGES.9#7 integrate .. //depot/projects/hammer/share/man/man9/alloc_unr.9#2 integrate .. //depot/projects/hammer/share/man/man9/bus_dma.9#16 integrate .. //depot/projects/hammer/share/man/man9/devclass_get_drivers.9#3 integrate .. //depot/projects/hammer/share/man/man9/device_find_child.9#4 integrate .. //depot/projects/hammer/share/man/man9/ifnet.9#20 integrate .. //depot/projects/hammer/share/man/man9/kthread.9#5 integrate .. //depot/projects/hammer/share/man/man9/ktr.9#7 integrate .. //depot/projects/hammer/share/man/man9/mbuf.9#21 integrate .. //depot/projects/hammer/share/man/man9/pci.9#6 integrate .. //depot/projects/hammer/share/man/man9/pmap.9#6 integrate .. //depot/projects/hammer/share/man/man9/rman.9#5 integrate .. //depot/projects/hammer/share/man/man9/taskqueue.9#12 integrate .. //depot/projects/hammer/share/man/man9/time.9#8 integrate .. //depot/projects/hammer/share/man/man9/timeout.9#10 integrate .. //depot/projects/hammer/share/man/man9/vfs_suser.9#3 integrate .. //depot/projects/hammer/sys/alpha/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/amd64/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/arm/arm/pmap.c#22 integrate .. //depot/projects/hammer/sys/arm/arm/trap.c#12 integrate .. //depot/projects/hammer/sys/arm/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/conf/NOTES#93 integrate .. //depot/projects/hammer/sys/conf/files#115 integrate .. //depot/projects/hammer/sys/conf/files.i386#61 integrate .. //depot/projects/hammer/sys/conf/files.pc98#47 integrate .. //depot/projects/hammer/sys/conf/options#77 integrate .. //depot/projects/hammer/sys/conf/options.i386#36 integrate .. //depot/projects/hammer/sys/dev/acpi_support/acpi_ibm.c#5 integrate .. //depot/projects/hammer/sys/dev/ed/if_ed.c#29 integrate .. //depot/projects/hammer/sys/dev/hwpmc/hwpmc_amd.c#5 integrate .. //depot/projects/hammer/sys/dev/uart/uart_cpu_alpha.c#8 integrate .. //depot/projects/hammer/sys/gnu/ext2fs/COPYRIGHT.INFO#2 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_alloc.c#6 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_balloc.c#5 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_bitops.h#3 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_bmap.c#9 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_extern.h#8 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_fs.h#4 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_fs_sb.h#4 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_inode.c#14 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_inode_cnv.c#4 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_linux_balloc.c#7 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_linux_ialloc.c#5 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_lookup.c#13 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_mount.h#8 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_readwrite.c#7 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_subr.c#6 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_vfsops.c#30 delete .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_vnops.c#26 delete .. //depot/projects/hammer/sys/gnu/ext2fs/fs.h#7 delete .. //depot/projects/hammer/sys/gnu/ext2fs/i386-bitops.h#3 delete .. //depot/projects/hammer/sys/gnu/ext2fs/inode.h#7 delete .. //depot/projects/hammer/sys/gnu/ext2fs/sparc64-bitops.h#3 delete .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_alloc.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_balloc.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_bmap.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_fs.h#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_fs_sb.h#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_inode.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_inode_cnv.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_linux_balloc.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_lookup.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_subr.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_vfsops.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/ext2_vnops.c#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/i386-bitops.h#2 integrate .. //depot/projects/hammer/sys/gnu/fs/ext2fs/sparc64-bitops.h#2 integrate .. //depot/projects/hammer/sys/gnu/fs/reiserfs/README#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_fs.h#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_fs_i.h#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_hashes.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_inode.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_item_ops.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_mount.h#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_namei.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_prints.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_stree.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#1 branch .. //depot/projects/hammer/sys/gnu/fs/reiserfs/reiserfs_vnops.c#1 branch .. //depot/projects/hammer/sys/gnu/reiserfs/README#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_fs.h#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_fs_i.h#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_fs_sb.h#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_hashes.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_inode.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_item_ops.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_mount.h#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_namei.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_prints.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_stree.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_vfsops.c#2 delete .. //depot/projects/hammer/sys/gnu/reiserfs/reiserfs_vnops.c#2 delete .. //depot/projects/hammer/sys/i386/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/i386/conf/NOTES#71 integrate .. //depot/projects/hammer/sys/i4b/driver/i4b_ipr.c#15 integrate .. //depot/projects/hammer/sys/i4b/driver/i4b_isppp.c#13 integrate .. //depot/projects/hammer/sys/ia64/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/kern/imgact_shell.c#11 integrate .. //depot/projects/hammer/sys/kern/kern_intr.c#37 integrate .. //depot/projects/hammer/sys/kern/kern_malloc.c#24 integrate .. //depot/projects/hammer/sys/kern/subr_disk.c#15 integrate .. //depot/projects/hammer/sys/kern/vfs_bio.c#56 integrate .. //depot/projects/hammer/sys/kern/vfs_cache.c#15 integrate .. //depot/projects/hammer/sys/kern/vfs_default.c#41 integrate .. //depot/projects/hammer/sys/kern/vfs_subr.c#85 integrate .. //depot/projects/hammer/sys/modules/Makefile#79 integrate .. //depot/projects/hammer/sys/modules/ext2fs/Makefile#3 integrate .. //depot/projects/hammer/sys/modules/libalias/Makefile#2 integrate .. //depot/projects/hammer/sys/modules/reiserfs/Makefile#2 integrate .. //depot/projects/hammer/sys/net/if.c#48 integrate .. //depot/projects/hammer/sys/netinet/in_gif.c#12 integrate .. //depot/projects/hammer/sys/netinet/ip_fw2.c#58 integrate .. //depot/projects/hammer/sys/netinet/libalias/alias_util.c#3 integrate .. //depot/projects/hammer/sys/netinet6/in6_gif.c#9 integrate .. //depot/projects/hammer/sys/nfsclient/nfs_bio.c#35 integrate .. //depot/projects/hammer/sys/pc98/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/pc98/conf/NOTES#45 integrate .. //depot/projects/hammer/sys/powerpc/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/sparc64/conf/.cvsignore#1 branch .. //depot/projects/hammer/sys/vm/uma_int.h#17 integrate .. //depot/projects/hammer/tools/regression/usr.bin/env/Makefile#1 branch .. //depot/projects/hammer/tools/regression/usr.bin/env/regress-env.rgdata#1 branch .. //depot/projects/hammer/tools/regression/usr.bin/env/regress-sb.rb#1 branch .. //depot/projects/hammer/usr.bin/env/Makefile#3 integrate .. //depot/projects/hammer/usr.bin/env/env.1#6 integrate .. //depot/projects/hammer/usr.bin/env/env.c#3 integrate .. //depot/projects/hammer/usr.bin/env/envopts.c#1 branch .. //depot/projects/hammer/usr.bin/env/envopts.h#1 branch .. //depot/projects/hammer/usr.bin/truss/syscalls.c#18 integrate .. //depot/projects/hammer/usr.sbin/ndiscvt/ndiscvt.8#6 integrate .. //depot/projects/hammer/usr.sbin/ndiscvt/ndisgen.8#2 integrate .. //depot/projects/hammer/usr.sbin/powerd/powerd.8#3 integrate .. //depot/projects/hammer/usr.sbin/pwd_mkdb/pwd_mkdb.c#10 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/dist.c#21 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/dist.h#9 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/menus.c#34 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/sysinstall.8#11 integrate .. //depot/projects/hammer/usr.sbin/wpa/hostapd/Makefile#2 integrate .. //depot/projects/hammer/usr.sbin/wpa/hostapd/hostapd.1#2 delete .. //depot/projects/hammer/usr.sbin/wpa/hostapd/hostapd.8#1 branch .. //depot/projects/hammer/usr.sbin/wpa/hostapd/hostapd.conf.5#1 branch .. //depot/projects/hammer/usr.sbin/wpa/hostapd_cli/Makefile#2 integrate .. //depot/projects/hammer/usr.sbin/wpa/hostapd_cli/hostapd_cli.1#2 delete .. //depot/projects/hammer/usr.sbin/wpa/hostapd_cli/hostapd_cli.8#1 branch .. //depot/projects/hammer/usr.sbin/wpa/wpa_cli/Makefile#2 integrate .. //depot/projects/hammer/usr.sbin/wpa/wpa_cli/wpa_cli.1#2 delete .. //depot/projects/hammer/usr.sbin/wpa/wpa_cli/wpa_cli.8#1 branch .. //depot/projects/hammer/usr.sbin/wpa/wpa_supplicant/Makefile#2 integrate .. //depot/projects/hammer/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.1#2 delete .. //depot/projects/hammer/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8#1 branch .. //depot/projects/hammer/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5#2 integrate Differences ... ==== //depot/projects/hammer/Makefile#32 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile,v 1.318 2005/03/02 12:33:22 harti Exp $ +# $FreeBSD: src/Makefile,v 1.319 2005/06/16 18:16:12 ru Exp $ # # The user-driven targets are: # @@ -71,7 +71,7 @@ obj objlink regress rerelease tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ - build32 install32 + build32 distribute32 install32 BITGTS= files includes BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} ==== //depot/projects/hammer/Makefile.inc1#95 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.497 2005/06/06 09:39:46 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.498 2005/06/16 18:16:12 ru Exp $ # # Make command line options: # -DNO_DYNAMICROOT do not link /bin and /sbin dynamically @@ -437,14 +437,18 @@ PROG=ld-elf32.so.1 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} .endfor -install32: - mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree - cd ${.CURDIR}/lib; ${LIB32MAKE} install - cd ${.CURDIR}/gnu/lib; ${LIB32MAKE} install +distribute32 install32: +.if make(distribute32) + mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree +.else + mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree +.endif + cd ${.CURDIR}/lib; ${LIB32MAKE} ${.TARGET:S/32$//} + cd ${.CURDIR}/gnu/lib; ${LIB32MAKE} ${.TARGET:S/32$//} .if !defined(NO_CRYPT) - cd ${.CURDIR}/secure/lib; ${LIB32MAKE} install + cd ${.CURDIR}/secure/lib; ${LIB32MAKE} ${.TARGET:S/32$//} .endif - cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32MAKE} install + cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32MAKE} ${.TARGET:S/32$//} .endif @@ -552,6 +556,9 @@ @echo ">>> Distributing everything" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute +.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) + ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32 +.endif distribution: cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} distribution ==== //depot/projects/hammer/contrib/amd/amd/amd.8#5 (text+ko) ==== @@ -39,7 +39,7 @@ .\" %W% (Berkeley) %G% .\" .\" $Id: amd.8,v 1.4.2.5 2004/01/06 03:15:16 ezk Exp $ -.\" $FreeBSD: src/contrib/amd/amd/amd.8,v 1.19 2004/07/06 13:16:44 mbr Exp $ +.\" $FreeBSD: src/contrib/amd/amd/amd.8,v 1.20 2005/06/16 20:21:01 ru Exp $ .\" .Dd April 19, 1994 .Dt AMD 8 @@ -50,7 +50,7 @@ .Sh SYNOPSIS .Nm amd .Fl H -.Nm amd +.Nm amd .Op Fl F Ar conf_file .Nm amd .Op Fl nprvHS @@ -83,7 +83,8 @@ .Sh DESCRIPTION .Nm Amd is a daemon that automatically mounts file systems whenever a file or directory -within that file system is accessed. File systems are automatically unmounted +within that file system is accessed. +File systems are automatically unmounted when they appear to be quiescent. .Pp .Nm Amd @@ -96,17 +97,19 @@ .Nm amd , which uses the map defined by .Ar mapname -to determine how to resolve the lookup. Generally, this will be a host name, +to determine how to resolve the lookup. +Generally, this will be a host name, some file system information and some mount options for the given file system. .Pp In the first form depicted above, .Nm amd -will print a short help string. In the second form, if no options are +will print a short help string. +In the second form, if no options are specified, or if the .Fl F -is used, -.Nm amd -will read configuration parameters from the file +is used, +.Nm amd +will read configuration parameters from the file .Ar conf_file which defaults to .Pa /etc/amd.conf . @@ -121,12 +124,15 @@ Specify a .Ar duration , in seconds, that a looked up name remains -cached when not in use. The default is 5 minutes. +cached when not in use. +The default is 5 minutes. .It Fl d Ar domain -Specify the local domain name. If this option is not +Specify the local domain name. +If this option is not given the domain name is determined from the hostname. .It Fl k Ar kernel-arch -Specifies the kernel architecture. This is used solely +Specifies the kernel architecture. +This is used solely to set the ${karch} selector. .It Fl l Ar logfile Specify a logfile in which to record mount and unmount events. @@ -136,31 +142,32 @@ .Em syslog , the log messages will be sent to the system log daemon by .Xr syslog 3 . -The default syslog facility used is LOG_DAEMON. +The default syslog facility used is LOG_DAEMON. If you wish to change it, append its name to the log file name, delimited by a single colon. -For example, if +For example, if .Ar logfile is the string .Dq Li syslog:local7 then .Nm amd -will log messages via +will log messages via .Xr syslog 3 using the LOG_LOCAL7 facility (if it exists on the system). .It Fl n Normalize hostnames. The name referred to by ${rhost} is normalized relative to the -host database before being used. The effect is to translate +host database before being used. +The effect is to translate aliases into ``official'' names. .It Fl o Ar op_sys_ver Override the compiled-in version number of the operating system. -Useful when the built in version is not desired for backward +Useful when the built in version is not desired for backward compatibility reasons. -For example, if the build in version is -.Dq 2.5.1 , +For example, if the build in version is +.Dq 2.5.1 , you can override it to -.Dq 5.5.1 , +.Dq 5.5.1 , and use older maps that were written with the latter in mind. .It Fl p Print @@ -172,7 +179,8 @@ Restart existing mounts. .Nm Amd will scan the mount file table to determine which file systems -are currently mounted. Whenever one of these would have +are currently mounted. +Whenever one of these would have been auto-mounted, .Nm amd .Em inherits @@ -182,25 +190,33 @@ .Ar interval , in tenths of a second, between .Tn NFS/RPC -retries (for UDP only). The default -is 0.8 seconds. The second value alters the retransmit counter, which -defaults to 11 retransmissions. Both of these values are used by the kernel -to communicate with amd. Useful defaults are supplied if either or both +retries (for UDP only). +The default +is 0.8 seconds. +The second value alters the retransmit counter, which +defaults to 11 retransmissions. +Both of these values are used by the kernel +to communicate with amd. +Useful defaults are supplied if either or both values are missing. .Pp Amd relies on the kernel RPC retransmit mechanism to trigger mount retries. -The values of these parameters change the overall retry interval. Too long +The values of these parameters change the overall retry interval. +Too long an interval gives poor interactive response; too short an interval causes excessive retries. .It Fl v -Version. Displays version and configuration information on standard error. +Version. +Displays version and configuration information on standard error. .It Fl w Ar interval Specify an .Ar interval , in seconds, between attempts to dismount file systems that have exceeded their -cached times. The default is 2 minutes. +cached times. +The default is 2 minutes. .It Fl x Ar options -Specify run-time logging options. The options are a comma separated list +Specify run-time logging options. +The options are a comma separated list chosen from: fatal, error, user, warn, info, map, stats, all. .It Fl y Ar domain Specify an alternative @@ -215,10 +231,12 @@ .It Fl C Ar cluster-name Specify an alternative HP-UX cluster name to use. .It Fl D Ar option -Select from a variety of debug options. Prefixing an +Select from a variety of debug options. +Prefixing an option with the string .Em no -reverses the effect of that option. Options are cumulative. +reverses the effect of that option. +Options are cumulative. The most useful option is .Ar all . .Pp @@ -232,40 +250,47 @@ .It Fl F Ar conf_file Specify an .Nm amd -configuration file to use. See +configuration file to use. +See .Xr amd.conf 5 -for description of this file's format. This configuration file is used to -specify any options in lieu of typing many of them on the command line. The +for description of this file's format. +This configuration file is used to +specify any options in lieu of typing many of them on the command line. +The .Nm amd.conf file includes directives for every command line option amd has, and many more that are only available via the configuration file -facility. The configuration file specified by this option is +facility. +The configuration file specified by this option is processed after all other options have been processed, regardless of the actual location of this option on the command line. .It Fl H Print help and usage string. .It Fl O Ar op_sys_name -Override the compiled-in name of the operating system. +Override the compiled-in name of the operating system. Useful when the built in name is not desired for backward compatibility reasons. For example, if the build in name is -.Dq sunos5 , +.Dq sunos5 , you can override it to .Dq sos5 and use older maps which were written with the latter in mind. .It Fl S Do not lock the running executable pages of .Nm amd -into memory. To improve +into memory. +To improve .Nm amd's -performance, systems that support the +performance, systems that support the .Xr plock 3 call, could lock the .Nm amd -process into memory. This way there is less chance the operating system will +process into memory. +This way there is less chance the operating system will schedule, page out, and swap the .Nm amd -process as needed. This tends to improve +process as needed. +This tends to improve .Nm amd's performance, at the cost of reserving the memory used by the .Nm amd @@ -277,7 +302,7 @@ .It Fl T Ar tag Specify a tag to use with .Xr amd.conf 5 . -All Map entries tagged with tag will be processed. +All Map entries tagged with tag will be processed. Map entries that are not tagged are always processed. Map entries that are tagged with a tag other than .Ar tag @@ -331,6 +356,11 @@ .Re .Pp .Pa http://www.cs.columbia.edu/~ezk/am-utils/ +.Sh HISTORY +The +.Nm amd +utility first appeared in +.Bx 4.4 . .Sh AUTHORS .An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , Department of Computing, Imperial College, London, UK. @@ -340,10 +370,5 @@ New York, USA. .Pp Other authors and contributors to am-utils are listed in the -.Pa AUTHORS +.Pa AUTHORS file distributed with am-utils. -.Sh HISTORY -The -.Nm amd -utility first appeared in -.Bx 4.4 . ==== //depot/projects/hammer/contrib/amd/amq/amq.8#5 (text+ko) ==== @@ -39,7 +39,7 @@ .\" %W% (Berkeley) %G% .\" .\" $Id: amq.8,v 1.3.2.8 2004/01/06 03:15:16 ezk Exp $ -.\" $FreeBSD: src/contrib/amd/amq/amq.8,v 1.11 2004/07/06 13:16:44 mbr Exp $ +.\" $FreeBSD: src/contrib/amd/amq/amq.8,v 1.12 2005/06/16 20:21:02 ru Exp $ .\" .Dd March 16, 1991 .Dt AMQ 8 @@ -81,17 +81,19 @@ .It Fl h Ar hostname Query alternate host .Ar hostname . -By default the local host is used. In an +By default the local host is used. +In an .Tn HP-UX cluster, the root server is queried by default, since that is the system on which the automounter is normally run. .It Fl l Ar log_file Tell amd to use .Ar log_file -as the log file name. +as the log file name. For security reasons, this must be the same log file which .Nm amd -used when started. This option is therefore only useful to +used when started. +This option is therefore only useful to refresh .Nm amd Ns \'s open file handle on the log file, so that it can be rotated and compressed via @@ -102,10 +104,11 @@ which occurred while mounting. .It Fl p Return the process ID of the remote or locally running -.Nm amd . +.Nm amd . Useful when you need to send a signal to the local .Nm amd -process, and would rather not have to search through the process table. This +process, and would rather not have to search through the process table. +This option is used in the .Pa ctl-amd script. @@ -113,51 +116,54 @@ Request the automounter to provide system-wide mount statistics. .It Fl u Request the automounter to unmount the named file systems -instead of providing information about them. Unmounts are requested, -not forced. They merely cause the mounted file system to timeout, +instead of providing information about them. +Unmounts are requested, +not forced. +They merely cause the mounted file system to timeout, which will be picked up by .Nm amd Ns \'s main scheduler thus causing the normal timeout action to be taken. .It Fl v -Request the automounter to provide version information. This is a subset +Request the automounter to provide version information. +This is a subset of the information provided by .Nm amd Ns \'s Fl v option. .It Fl x Ar log_options -Ask the automounter to use the logging options specified in +Ask the automounter to use the logging options specified in .Ar log_options from now on. .It Fl D Ar log_options -Ask the automounter to use the debugging options specified in +Ask the automounter to use the debugging options specified in .Ar debug_options from now on. .It Fl M -Pass a mount map entry to +Pass a mount map entry to .Nm amd and wait for it to be evaluated, possibly causing a mount. -This option is highly insecure. +This option is highly insecure. By default, .Nm amd -and +and .Nm amq do not support it. It is necessary to configure .Nm am-utils -with +with .Ar --enable-amq-mount to enable this option. .It Fl P Ar program_number -Contact an alternate running -.Nm amd +Contact an alternate running +.Nm amd that had registered itself on a different RPC -.Ar program_number -and apply all other operations to that instance of the automounter. -This is useful when running multiple copies of -.Nm amd , -and need to manage each one separately. -If not specified, +.Ar program_number +and apply all other operations to that instance of the automounter. +This is useful when running multiple copies of +.Nm amd , +and need to manage each one separately. +If not specified, .Nm amq -will use the default program number for +will use the default program number for .Nm amd , 300019. For security reasons, the only alternate program numbers @@ -166,14 +172,14 @@ .It Fl T Contact .Nm amd -using the TCP transport only. -Normally +using the TCP transport only. +Normally .Nm amq will try TCP, and if that fails, will try UDP. .It Fl U -Contact +Contact .Nm amd -using UDP (connectionless) transport only. +using UDP (connectionless) transport only. Normally .Nm amq will try TCP, and if that fails, will try UDP. @@ -195,6 +201,10 @@ .Sh SEE ALSO .Xr amd.conf 5 , .Xr amd 8 +.Sh HISTORY +.Nm Amq +first appeared in +.Bx 4.4 . .Sh AUTHORS .An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , Department of Computing, Imperial College, London, UK. @@ -202,13 +212,9 @@ .An Erez Zadok Aq ezk@cs.columbia.edu , Department of Computer Science, Columbia University, New York, USA. .Pp -.An Other authors and contributors to +.An Other authors and contributors to .Nm am-utils are listed in the -.Nm AUTHORS +.Nm AUTHORS file distributed with .Nm am-utils . -.Sh HISTORY -.Nm Amq -first appeared in -.Bx 4.4 . ==== //depot/projects/hammer/contrib/amd/amq/pawd.1#4 (text+ko) ==== @@ -39,7 +39,7 @@ .\" %W% (Berkeley) %G% .\" .\" $Id: pawd.1,v 1.3.2.4 2004/01/06 03:15:16 ezk Exp $ -.\" $FreeBSD: src/contrib/amd/amq/pawd.1,v 1.6 2004/07/06 13:16:44 mbr Exp $ +.\" $FreeBSD: src/contrib/amd/amq/pawd.1,v 1.7 2005/06/16 20:21:02 ru Exp $ .\" .Dd January 6, 1998 .Dt PAWD 1 @@ -54,17 +54,20 @@ .Nm is used to print the current working directory, adjusted to reflect proper paths that can be reused to go through the automounter for the shortest -possible path. In particular, the path printed back does not include any +possible path. +In particular, the path printed back does not include any of .Nm Amd Ns \'s -local mount points. Using them is unsafe, because +local mount points. +Using them is unsafe, because .Nm Amd may unmount managed file systems from the mount points, and thus including them in paths may not always find the files within. .Pp Without any arguments, .Nm -will print the automounter adjusted current working directory. With any +will print the automounter adjusted current working directory. +With any number of arguments, it will print the adjusted .Ar path of each one of the @@ -72,7 +75,7 @@ .Sh SEE ALSO .Xr pwd 1 , .Xr amd 8 , -.Xr amq 8 +.Xr amq 8 .Sh HISTORY The .Nm ==== //depot/projects/hammer/contrib/amd/fixmount/fixmount.8#6 (text+ko) ==== @@ -39,7 +39,7 @@ .\" %W% (Berkeley) %G% .\" .\" $Id: fixmount.8,v 1.3.2.6 2004/01/06 03:15:23 ezk Exp $ -.\" $FreeBSD: src/contrib/amd/fixmount/fixmount.8,v 1.11 2005/02/13 22:25:10 ru Exp $ +.\" $FreeBSD: src/contrib/amd/fixmount/fixmount.8,v 1.12 2005/06/16 20:21:02 ru Exp $ .\" .Dd February 26, 1993 .Dt FIXMOUNT 8 @@ -55,12 +55,13 @@ \&... .Sh DESCRIPTION .Nm -is a variant of +is a variant of .Xr showmount 8 that can delete bogus mount entries in remote .Xr mountd 8 -daemons. The actions specified by the options are performed for each -.Ar host +daemons. +The actions specified by the options are performed for each +.Ar host in turn. .Sh OPTIONS .Bl -tag -width Ds @@ -76,18 +77,22 @@ The actuality of mounts is verified using the entries in .Pa /etc/mtab . .It Fl v -Verify remote mounts. Similar to +Verify remote mounts. +Similar to .Fl r except that only a notification message is printed for each bogus entry -found. The remote mount table is not changed. +found. +The remote mount table is not changed. .It Fl A Issues a command to the remote mountd declaring that .Em all -of its file systems have been unmounted. This should be used with caution, as +of its file systems have been unmounted. +This should be used with caution, as it removes all remote mount entries pertaining to the local system, whether or not any file systems are still mounted locally. .It Fl v -Be quiet. Suppresses error messages due to timeouts and +Be quiet. +Suppresses error messages due to timeouts and .Dq Program not Registered , i.e., due to remote hosts not supporting RPC or not running .Nm mountd . @@ -118,6 +123,24 @@ .Xr rmtab 5 , .Xr mountd 8 , .Xr showmount 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 3.0 . +.Sh AUTHORS +.An Jan-Simon Pendry Aq jsp@doc.ic.ac.uk , +Department of Computing, Imperial College, London, UK. +.Pp +.An Erez Zadok Aq ezk@cs.columbia.edu , +Department of Computer Science, Columbia University, New York, USA. +.Pp +.An Other authors and contributors to +.Nm am-utils +are listed in the +.Nm AUTHORS +file distributed with +.Nm am-utils . .Sh BUGS No attempt is made to verify the information in .Pa /etc/mtab @@ -126,14 +149,14 @@ Since swap file mounts are not recorded in .Pa /etc/mtab , a heuristic specific to SunOS is used to determine whether such a mount -is actual (replacing the string -.Ql swap -with +is actual (replacing the string +.Ql swap +with .Ql root and verifying the resulting path). .Pp Symbolic links on the server will cause the path in the remote entry to differ -from the one in +from the one in .Pa /etc/mtab . To catch those cases, a file system is also deemed mounted if its .Em local @@ -146,10 +169,11 @@ .Pa /usr/share as well this will be handled correctly. .Pp -There is no way to clear a stale entry in a remote -.Nm mountd -after the local hostname (or whatever reverse name resolution -returns for it) has been changed. To take care of these cases, +There is no way to clear a stale entry in a remote >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Jun 21 17:11:21 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D12D616A420; Tue, 21 Jun 2005 17:11:20 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 93AB216A41C for ; Tue, 21 Jun 2005 17:11:20 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CEDA43D5D for ; Tue, 21 Jun 2005 17:11:20 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LHBKAJ057742 for ; Tue, 21 Jun 2005 17:11:20 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LHBK4Z057739 for perforce@freebsd.org; Tue, 21 Jun 2005 17:11:20 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 17:11:20 GMT Message-Id: <200506211711.j5LHBK4Z057739@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78766 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:11:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=78766 Change 78766 by jhb@jhb_slimer on 2005/06/21 17:10:23 Another todo. Affected files ... .. //depot/projects/smpng/sys/notes#45 edit Differences ... ==== //depot/projects/smpng/sys/notes#45 (text+ko) ==== @@ -99,6 +99,10 @@ - Robert wants intrcnt's for IPIs - Add checks to msleep() and cv_wait*() to ensure they aren't called by an interrupt thread. +- Add witness checks to thread exit to make sure dying threads don't leak + locks. Requested by Jeff. + + Implemented + - Untested Active child branches: - jhb_intr - intr_event stuff From owner-p4-projects@FreeBSD.ORG Tue Jun 21 17:31:47 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 008E816A424; Tue, 21 Jun 2005 17:31:46 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E89716A41C for ; Tue, 21 Jun 2005 17:31:46 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81CDD43D4C for ; Tue, 21 Jun 2005 17:31:46 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LHVkwP058685 for ; Tue, 21 Jun 2005 17:31:46 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LHVkIH058682 for perforce@freebsd.org; Tue, 21 Jun 2005 17:31:46 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 17:31:46 GMT Message-Id: <200506211731.j5LHVkIH058682@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78769 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:31:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=78769 Change 78769 by jhb@jhb_slimer on 2005/06/21 17:31:03 Revert some changes that aren't really needed and are just cluttering up this branch. Affected files ... .. //depot/projects/smpng/sys/i386/i386/machdep.c#95 edit .. //depot/projects/smpng/sys/i386/i386/sys_machdep.c#42 edit .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#67 edit .. //depot/projects/smpng/sys/notes#46 edit Differences ... ==== //depot/projects/smpng/sys/i386/i386/machdep.c#95 (text+ko) ==== @@ -1156,11 +1156,8 @@ pcb->pcb_gs = _udatasel; load_gs(_udatasel); - mtx_lock_spin(&sched_lock); if (td->td_proc->p_md.md_ldt) user_ldt_free(td); - else - mtx_unlock_spin(&sched_lock); bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = entry; ==== //depot/projects/smpng/sys/i386/i386/sys_machdep.c#42 (text+ko) ==== @@ -384,7 +384,7 @@ #endif /* - * Must be called with sched_lock held but not recursed. + * Must be called with either sched_lock free or held but not recursed. * If it does not return NULL, it will return with it owned. */ struct proc_ldt * @@ -392,8 +392,9 @@ { struct proc_ldt *pldt, *new_ldt; - mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED); - mtx_unlock_spin(&sched_lock); + if (mtx_owned(&sched_lock)) + mtx_unlock_spin(&sched_lock); + mtx_assert(&sched_lock, MA_NOTOWNED); MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); @@ -424,7 +425,7 @@ } /* - * Must be called with sched_lock held but not recursed. + * Must be called either with sched_lock free or held but not recursed. * If md_ldt is not NULL, it will return with sched_lock released. */ void @@ -436,6 +437,8 @@ if (pldt == NULL) return; + if (!mtx_owned(&sched_lock)) + mtx_lock_spin(&sched_lock); mtx_assert(&sched_lock, MA_OWNED | MA_NOTRECURSED); if (td == PCPU_GET(curthread)) { lldt(_default_ldt); @@ -695,8 +698,7 @@ if (len < NLDT + 1) len = NLDT + 1; - /* allocate user ldt */ - mtx_lock_spin(&sched_lock); + /* Allocate a user ldt. */ pldt = mdp->md_ldt; if (!pldt || len > pldt->ldt_len) { struct proc_ldt *new_ldt; @@ -705,6 +707,8 @@ if (new_ldt == NULL) return (ENOMEM); pldt = mdp->md_ldt; + + /* sched_lock was acquired by user_ldt_alloc. */ if (pldt) { if (new_ldt->ldt_len > pldt->ldt_len) { old_ldt_base = pldt->ldt_base; @@ -720,7 +724,7 @@ } else { /* * If other threads already did the work, - * do nothing + * do nothing. */ mtx_unlock_spin(&sched_lock); kmem_free(kernel_map, @@ -741,7 +745,6 @@ set_user_ldt(mdp); mtx_unlock_spin(&sched_lock); #endif - } else - mtx_unlock_spin(&sched_lock); + } return (0); } ==== //depot/projects/smpng/sys/i386/i386/vm_machdep.c#67 (text+ko) ==== @@ -155,7 +155,6 @@ struct mdproc *mdp1 = &p1->p_md; struct proc_ldt *pldt; - mtx_lock_spin(&sched_lock); pldt = mdp1->md_ldt; if (pldt && pldt->ldt_refcnt > 1) { pldt = user_ldt_alloc(mdp1, pldt->ldt_len); @@ -164,8 +163,7 @@ mdp1->md_ldt = pldt; set_user_ldt(mdp1); user_ldt_free(td1); - } else - mtx_unlock_spin(&sched_lock); + } } return; } @@ -300,7 +298,6 @@ cpu_exit(struct thread *td) { - mtx_lock_spin(&sched_lock); if (td->td_proc->p_md.md_ldt) { /* Reset pc->pcb_gs and %gs before invalidating it. */ @@ -308,15 +305,13 @@ load_gs(_udatasel); user_ldt_free(td); - } else - mtx_unlock_spin(&sched_lock); + } } void cpu_thread_exit(struct thread *td) { - #ifdef DEV_NPX npxexit(td); #endif ==== //depot/projects/smpng/sys/notes#46 (text+ko) ==== @@ -3,10 +3,6 @@ - Consolidate linux module version and dependencies into MI location. - Untested -- Redo sched_lock locking for i386 ldt to not use mtx_owned(). This is - the only user of mtx_owned() on spin locks and keeps us from optimizing - spin locks on UP kernels to only do critical sections. - - Untested - Fixup asm constraints to use '+' rather than declaring a variable in both the input and output sections with '0', etc. in both the at386 and pc98 bus headers. Also removes bogus 'cc' clobbers. gcc already clobbers 'cc' From owner-p4-projects@FreeBSD.ORG Tue Jun 21 17:36:54 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8750B16A420; Tue, 21 Jun 2005 17:36:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61AAF16A41C for ; Tue, 21 Jun 2005 17:36:53 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EFFD43D48 for ; Tue, 21 Jun 2005 17:36:53 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LHarPU058868 for ; Tue, 21 Jun 2005 17:36:53 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LHaquH058865 for perforce@freebsd.org; Tue, 21 Jun 2005 17:36:52 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 17:36:52 GMT Message-Id: <200506211736.j5LHaquH058865@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78770 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 17:36:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=78770 Change 78770 by jhb@jhb_slimer on 2005/06/21 17:36:25 More nits. Affected files ... .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#68 edit Differences ... ==== //depot/projects/smpng/sys/i386/i386/vm_machdep.c#68 (text+ko) ==== @@ -298,12 +298,13 @@ cpu_exit(struct thread *td) { + /* + * If this process has a custom LDT, release it. Reset pc->pcb_gs + * and %gs before we free it in case they refer to an LDT entry. + */ if (td->td_proc->p_md.md_ldt) { - - /* Reset pc->pcb_gs and %gs before invalidating it. */ td->td_pcb->pcb_gs = _udatasel; load_gs(_udatasel); - user_ldt_free(td); } } From owner-p4-projects@FreeBSD.ORG Tue Jun 21 19:17:56 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9EBD216A420; Tue, 21 Jun 2005 19:17:55 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78C4D16A41C for ; Tue, 21 Jun 2005 19:17:55 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D47E43D4C for ; Tue, 21 Jun 2005 19:17:55 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LJHtsh062369 for ; Tue, 21 Jun 2005 19:17:55 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LJHs2I062366 for perforce@freebsd.org; Tue, 21 Jun 2005 19:17:54 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 19:17:54 GMT Message-Id: <200506211917.j5LJHs2I062366@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78772 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 19:17:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=78772 Change 78772 by jhb@jhb_slimer on 2005/06/21 19:17:37 Move the readandclear functions up closer to the other real functions and add some more comments. Affected files ... .. //depot/projects/smpng/sys/amd64/include/atomic.h#17 edit .. //depot/projects/smpng/sys/i386/include/atomic.h#35 edit Differences ... ==== //depot/projects/smpng/sys/amd64/include/atomic.h#17 (text+ko) ==== @@ -231,6 +231,48 @@ #undef ATOMIC_ASM #undef ATOMIC_STORE_LOAD +#if !defined(WANT_FUNCTIONS) + +/* Read the current value and store a zero in the destination. */ +#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE) + +static __inline u_int +atomic_readandclear_int(volatile u_int *addr) +{ + u_int result; + + __asm __volatile ( + " xorl %0,%0 ; " + " xchgl %1,%0 ; " + "# atomic_readandclear_int" + : "=&r" (result) /* 0 (result) */ + : "m" (*addr)); /* 1 (addr) */ + + return (result); +} + +static __inline u_long +atomic_readandclear_long(volatile u_long *addr) +{ + u_long result; + + __asm __volatile ( + " xorq %0,%0 ; " + " xchgq %1,%0 ; " + "# atomic_readandclear_int" + : "=&r" (result) /* 0 (result) */ + : "m" (*addr)); /* 1 (addr) */ + + return (result); +} + +#else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ + +extern u_long atomic_readandclear_long(volatile u_long *); +extern u_int atomic_readandclear_int(volatile u_int *); + +#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ + /* Acquire and release variants are identical to the normal ones. */ #define atomic_set_acq_char atomic_set_char #define atomic_set_rel_char atomic_set_char @@ -325,7 +367,7 @@ #define atomic_cmpset_rel_32 atomic_cmpset_rel_int #define atomic_readandclear_32 atomic_readandclear_int -#if !defined(WANT_FUNCTIONS) +/* Operations on pointers. */ static __inline int atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) { @@ -376,44 +418,5 @@ #undef ATOMIC_PTR -#if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE) - -static __inline u_int -atomic_readandclear_int(volatile u_int *addr) -{ - u_int result; - - __asm __volatile ( - " xorl %0,%0 ; " - " xchgl %1,%0 ; " - "# atomic_readandclear_int" - : "=&r" (result) /* 0 (result) */ - : "m" (*addr)); /* 1 (addr) */ - - return (result); -} - -static __inline u_long -atomic_readandclear_long(volatile u_long *addr) -{ - u_long result; - - __asm __volatile ( - " xorq %0,%0 ; " - " xchgq %1,%0 ; " - "# atomic_readandclear_int" - : "=&r" (result) /* 0 (result) */ - : "m" (*addr)); /* 1 (addr) */ - - return (result); -} - -#else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ - -extern u_long atomic_readandclear_long(volatile u_long *); -extern u_int atomic_readandclear_int(volatile u_int *); - -#endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ - #endif /* !defined(WANT_FUNCTIONS) */ #endif /* ! _MACHINE_ATOMIC_H_ */ ==== //depot/projects/smpng/sys/i386/include/atomic.h#35 (text+ko) ==== @@ -260,6 +260,32 @@ #undef ATOMIC_ASM #undef ATOMIC_STORE_LOAD +#if !defined(WANT_FUNCTIONS) + +/* Read the current value and store a zero in the destination. */ +#ifdef __GNUCLIKE_ASM + +static __inline u_int +atomic_readandclear_int(volatile u_int *addr) +{ + u_int result; + + __asm __volatile ( + " xorl %0,%0 ; " + " xchgl %1,%0 ; " + "# atomic_readandclear_int" + : "=&r" (result) /* 0 (result) */ + : "m" (*addr)); /* 1 (addr) */ + + return (result); +} + +#else /* !__GNUCLIKE_ASM */ + +extern u_int atomic_readandclear_int(volatile u_int *); + +#endif /* __GNUCLIKE_ASM */ + /* Acquire and release variants are identical to the normal ones. */ #define atomic_set_acq_char atomic_set_char #define atomic_set_rel_char atomic_set_char @@ -366,7 +392,7 @@ #define atomic_store_rel_long(p, v) atomic_store_rel_int((volatile u_int *)(p), (v)) #define atomic_readandclear_long(p) atomic_readandclear_int((volatile u_int *)(p)) -#if !defined(WANT_FUNCTIONS) +/* Operations on pointers. */ static __inline int atomic_cmpset_ptr(volatile void *dst, void *exp, void *src) { @@ -417,28 +443,5 @@ #undef ATOMIC_PTR -#ifdef __GNUCLIKE_ASM - -static __inline u_int -atomic_readandclear_int(volatile u_int *addr) -{ - u_int result; - - __asm __volatile ( - " xorl %0,%0 ; " - " xchgl %1,%0 ; " - "# atomic_readandclear_int" - : "=&r" (result) /* 0 (result) */ - : "m" (*addr)); /* 1 (addr) */ - - return (result); -} - -#else /* !__GNUCLIKE_ASM */ - -extern u_int atomic_readandclear_int(volatile u_int *); - -#endif /* __GNUCLIKE_ASM */ - #endif /* !defined(WANT_FUNCTIONS) */ #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-p4-projects@FreeBSD.ORG Tue Jun 21 19:22:02 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8DF4716A424; Tue, 21 Jun 2005 19:22:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 652AA16A423 for ; Tue, 21 Jun 2005 19:22:01 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2110C43D5F for ; Tue, 21 Jun 2005 19:22:00 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LJM0xr062579 for ; Tue, 21 Jun 2005 19:22:00 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LJM0Bo062574 for perforce@freebsd.org; Tue, 21 Jun 2005 19:22:00 GMT (envelope-from jhb@freebsd.org) Date: Tue, 21 Jun 2005 19:22:00 GMT Message-Id: <200506211922.j5LJM0Bo062574@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78773 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 19:22:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=78773 Change 78773 by jhb@jhb_slimer on 2005/06/21 19:21:48 Whitespace fixes. Affected files ... .. //depot/projects/smpng/sys/alpha/include/atomic.h#23 edit Differences ... ==== //depot/projects/smpng/sys/alpha/include/atomic.h#23 (text+ko) ==== @@ -216,7 +216,7 @@ return result; } -#define ATOMIC_ACQ_REL(NAME, WIDTH, TYPE) \ +#define ATOMIC_ACQ_REL(NAME, WIDTH) \ static __inline void \ atomic_##NAME##_acq_##WIDTH(volatile u_int##WIDTH##_t *p, u_int##WIDTH##_t v)\ { \ @@ -232,29 +232,29 @@ } /* Variants of simple arithmetic with memory barriers. */ -ATOMIC_ACQ_REL(set, 8, char) -ATOMIC_ACQ_REL(clear, 8, char) -ATOMIC_ACQ_REL(add, 8, char) -ATOMIC_ACQ_REL(subtract, 8, char) -ATOMIC_ACQ_REL(set, 16, short) -ATOMIC_ACQ_REL(clear, 16, short) -ATOMIC_ACQ_REL(add, 16, short) -ATOMIC_ACQ_REL(subtract, 16, short) -ATOMIC_ACQ_REL(set, 32, int) -ATOMIC_ACQ_REL(clear, 32, int) -ATOMIC_ACQ_REL(add, 32, int) -ATOMIC_ACQ_REL(subtract, 32, int) -ATOMIC_ACQ_REL(set, 64, long) -ATOMIC_ACQ_REL(clear, 64, long) -ATOMIC_ACQ_REL(add, 64, long) -ATOMIC_ACQ_REL(subtract, 64, long) +ATOMIC_ACQ_REL(set, 8) +ATOMIC_ACQ_REL(clear, 8) +ATOMIC_ACQ_REL(add, 8) +ATOMIC_ACQ_REL(subtract, 8) +ATOMIC_ACQ_REL(set, 16) +ATOMIC_ACQ_REL(clear, 16) +ATOMIC_ACQ_REL(add, 16) +ATOMIC_ACQ_REL(subtract, 16) +ATOMIC_ACQ_REL(set, 32) +ATOMIC_ACQ_REL(clear, 32) +ATOMIC_ACQ_REL(add, 32) +ATOMIC_ACQ_REL(subtract, 32) +ATOMIC_ACQ_REL(set, 64) +ATOMIC_ACQ_REL(clear, 64) +ATOMIC_ACQ_REL(add, 64) +ATOMIC_ACQ_REL(subtract, 64) #undef ATOMIC_ACQ_REL /* * We assume that a = b will do atomic loads and stores. */ -#define ATOMIC_STORE_LOAD(WIDTH) \ +#define ATOMIC_STORE_LOAD(WIDTH) \ static __inline u_int##WIDTH##_t \ atomic_load_acq_##WIDTH(volatile u_int##WIDTH##_t *p) \ { \ @@ -366,72 +366,72 @@ } /* Operations on chars. */ -#define atomic_set_char atomic_set_8 -#define atomic_set_acq_char atomic_set_acq_8 -#define atomic_set_rel_char atomic_set_rel_8 -#define atomic_clear_char atomic_clear_8 -#define atomic_clear_acq_char atomic_clear_acq_8 -#define atomic_clear_rel_char atomic_clear_rel_8 -#define atomic_add_char atomic_add_8 -#define atomic_add_acq_char atomic_add_acq_8 -#define atomic_add_rel_char atomic_add_rel_8 -#define atomic_subtract_char atomic_subtract_8 -#define atomic_subtract_acq_char atomic_subtract_acq_8 -#define atomic_subtract_rel_char atomic_subtract_rel_8 +#define atomic_set_char atomic_set_8 +#define atomic_set_acq_char atomic_set_acq_8 +#define atomic_set_rel_char atomic_set_rel_8 +#define atomic_clear_char atomic_clear_8 +#define atomic_clear_acq_char atomic_clear_acq_8 +#define atomic_clear_rel_char atomic_clear_rel_8 +#define atomic_add_char atomic_add_8 +#define atomic_add_acq_char atomic_add_acq_8 +#define atomic_add_rel_char atomic_add_rel_8 +#define atomic_subtract_char atomic_subtract_8 +#define atomic_subtract_acq_char atomic_subtract_acq_8 +#define atomic_subtract_rel_char atomic_subtract_rel_8 /* Operations on shorts. */ -#define atomic_set_short atomic_set_16 -#define atomic_set_acq_short atomic_set_acq_16 -#define atomic_set_rel_short atomic_set_rel_16 -#define atomic_clear_short atomic_clear_16 -#define atomic_clear_acq_short atomic_clear_acq_16 -#define atomic_clear_rel_short atomic_clear_rel_16 -#define atomic_add_short atomic_add_16 -#define atomic_add_acq_short atomic_add_acq_16 -#define atomic_add_rel_short atomic_add_rel_16 -#define atomic_subtract_short atomic_subtract_16 -#define atomic_subtract_acq_short atomic_subtract_acq_16 -#define atomic_subtract_rel_short atomic_subtract_rel_16 +#define atomic_set_short atomic_set_16 +#define atomic_set_acq_short atomic_set_acq_16 +#define atomic_set_rel_short atomic_set_rel_16 +#define atomic_clear_short atomic_clear_16 +#define atomic_clear_acq_short atomic_clear_acq_16 +#define atomic_clear_rel_short atomic_clear_rel_16 +#define atomic_add_short atomic_add_16 +#define atomic_add_acq_short atomic_add_acq_16 +#define atomic_add_rel_short atomic_add_rel_16 +#define atomic_subtract_short atomic_subtract_16 +#define atomic_subtract_acq_short atomic_subtract_acq_16 +#define atomic_subtract_rel_short atomic_subtract_rel_16 /* Operations on ints. */ -#define atomic_set_int atomic_set_32 -#define atomic_set_acq_int atomic_set_acq_32 -#define atomic_set_rel_int atomic_set_rel_32 -#define atomic_clear_int atomic_clear_32 -#define atomic_clear_acq_int atomic_clear_acq_32 -#define atomic_clear_rel_int atomic_clear_rel_32 -#define atomic_add_int atomic_add_32 -#define atomic_add_acq_int atomic_add_acq_32 -#define atomic_add_rel_int atomic_add_rel_32 -#define atomic_subtract_int atomic_subtract_32 -#define atomic_subtract_acq_int atomic_subtract_acq_32 -#define atomic_subtract_rel_int atomic_subtract_rel_32 +#define atomic_set_int atomic_set_32 +#define atomic_set_acq_int atomic_set_acq_32 +#define atomic_set_rel_int atomic_set_rel_32 +#define atomic_clear_int atomic_clear_32 +#define atomic_clear_acq_int atomic_clear_acq_32 +#define atomic_clear_rel_int atomic_clear_rel_32 +#define atomic_add_int atomic_add_32 +#define atomic_add_acq_int atomic_add_acq_32 +#define atomic_add_rel_int atomic_add_rel_32 +#define atomic_subtract_int atomic_subtract_32 +#define atomic_subtract_acq_int atomic_subtract_acq_32 +#define atomic_subtract_rel_int atomic_subtract_rel_32 #define atomic_cmpset_int atomic_cmpset_32 #define atomic_cmpset_acq_int atomic_cmpset_acq_32 #define atomic_cmpset_rel_int atomic_cmpset_rel_32 #define atomic_load_acq_int atomic_load_acq_32 #define atomic_store_rel_int atomic_store_rel_32 -#define atomic_readandclear_int atomic_readandclear_32 +#define atomic_readandclear_int atomic_readandclear_32 /* Operations on longs. */ -#define atomic_set_long atomic_set_64 -#define atomic_set_acq_long atomic_set_acq_64 -#define atomic_set_rel_long atomic_set_rel_64 -#define atomic_clear_long atomic_clear_64 -#define atomic_clear_acq_long atomic_clear_acq_64 -#define atomic_clear_rel_long atomic_clear_rel_64 -#define atomic_add_long atomic_add_64 -#define atomic_add_acq_long atomic_add_acq_64 -#define atomic_add_rel_long atomic_add_rel_64 -#define atomic_subtract_long atomic_subtract_64 -#define atomic_subtract_acq_long atomic_subtract_acq_64 -#define atomic_subtract_rel_long atomic_subtract_rel_64 +#define atomic_set_long atomic_set_64 +#define atomic_set_acq_long atomic_set_acq_64 +#define atomic_set_rel_long atomic_set_rel_64 +#define atomic_clear_long atomic_clear_64 +#define atomic_clear_acq_long atomic_clear_acq_64 +#define atomic_clear_rel_long atomic_clear_rel_64 +#define atomic_add_long atomic_add_64 +#define atomic_add_acq_long atomic_add_acq_64 +#define atomic_add_rel_long atomic_add_rel_64 +#define atomic_subtract_long atomic_subtract_64 +#define atomic_subtract_acq_long atomic_subtract_acq_64 +#define atomic_subtract_rel_long atomic_subtract_rel_64 #define atomic_cmpset_long atomic_cmpset_64 #define atomic_cmpset_acq_long atomic_cmpset_acq_64 #define atomic_cmpset_rel_long atomic_cmpset_rel_64 #define atomic_load_acq_long atomic_load_acq_64 #define atomic_store_rel_long atomic_store_rel_64 -#define atomic_readandclear_long atomic_readandclear_64 +#define atomic_readandclear_long atomic_readandclear_64 /* Operations on pointers. */ static __inline int @@ -470,7 +470,7 @@ atomic_store_rel_long((volatile u_long *)p, (u_long)v); } -#define ATOMIC_PTR(NAME) \ +#define ATOMIC_PTR(NAME) \ static __inline void \ atomic_##NAME##_ptr(volatile void *p, uintptr_t v) \ { \ From owner-p4-projects@FreeBSD.ORG Tue Jun 21 19:40:24 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B9E3716A420; Tue, 21 Jun 2005 19:40:23 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9502516A41C for ; Tue, 21 Jun 2005 19:40:23 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D0F943D1F for ; Tue, 21 Jun 2005 19:40:23 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LJeNNo063225 for ; Tue, 21 Jun 2005 19:40:23 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LJeNi8063222 for perforce@freebsd.org; Tue, 21 Jun 2005 19:40:23 GMT (envelope-from peter@freebsd.org) Date: Tue, 21 Jun 2005 19:40:23 GMT Message-Id: <200506211940.j5LJeNi8063222@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78774 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 19:40:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=78774 Change 78774 by peter@peter_daintree on 2005/06/21 19:40:04 Switch dumps over to doing sparse ELF dumps, taken from ia64 with as few tweaks as possible. Hence the first/next glue to walk walk the phys_avail[] array. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#9 edit .. //depot/projects/hammer/sys/sys/kerneldump.h#3 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#9 (text+ko) ==== @@ -1,40 +1,31 @@ /*- - * Copyright (c) 2002 Poul-Henning Kamp - * Copyright (c) 2002 Networks Associates Technology, Inc. + * Copyright (c) 2002 Marcel Moolenaar * All rights reserved. * - * This software was developed for the FreeBSD Project by Poul-Henning Kamp - * and NAI Labs, the Security Research Division of Network Associates, Inc. - * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the - * DARPA CHATS research program. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.9 2003/07/25 21:15:44 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/ia64/ia64/dump_machdep.c,v 1.12 2005/01/06 22:18:22 imp Exp $"); #include #include @@ -44,92 +35,307 @@ #include #include #include +#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +#define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) +#define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) + +struct md_pa { + vm_paddr_t md_start; + vm_paddr_t md_end; +}; + +typedef int callback_t(struct md_pa *, int, void *); + static struct kerneldumpheader kdh; +static off_t dumplo, fileofs; + +/* Handle buffered writes. */ +static char buffer[DEV_BSIZE]; +static size_t fragsz; + +static struct md_pa * +md_pa_first(void) +{ + struct md_pa *mdp; -void -dumpsys(struct dumperinfo *di) + mdp = (struct md_pa *)&phys_avail[0]; + if (mdp->md_start == 0 && mdp->md_end == 0) + mdp = NULL; + return (mdp); +} + +static struct md_pa * +md_pa_next(struct md_pa *mdp) { - off_t dumplo; - vm_offset_t a, addr; - u_int count, left, u; - void *va; - int i, mb; - int c; + + mdp++; + if (mdp->md_start == 0 && mdp->md_end == 0) + mdp = NULL; + return (mdp); +} - printf("Dumping %ld MB\n", Maxmem / (1024*1024 / PAGE_SIZE)); +/* XXX should be MI */ +static void +mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen, + uint32_t blksz) +{ - /* Fill in the kernel dump header */ - strcpy(kdh.magic, KERNELDUMPMAGIC); - strcpy(kdh.architecture, "amd64"); - kdh.version = htod32(KERNELDUMPVERSION); - kdh.architectureversion = htod32(KERNELDUMP_I386_VERSION); - kdh.dumplength = htod64(Maxmem * (off_t)PAGE_SIZE); - kdh.dumptime = htod64(time_second); - kdh.blocksize = htod32(di->blocksize); - strncpy(kdh.hostname, hostname, sizeof kdh.hostname); - strncpy(kdh.versionstring, version, sizeof kdh.versionstring); + bzero(kdh, sizeof(*kdh)); + strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic)); + strncpy(kdh->architecture, MACHINE_ARCH, sizeof(kdh->architecture)); + kdh->version = htod32(KERNELDUMPVERSION); + kdh->architectureversion = htod32(archver); + kdh->dumplength = htod64(dumplen); + kdh->dumptime = htod64(time_second); + kdh->blocksize = htod32(blksz); + strncpy(kdh->hostname, hostname, sizeof(kdh->hostname)); + strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); if (panicstr != NULL) - strncpy(kdh.panicstring, panicstr, sizeof kdh.panicstring); - kdh.parity = kerneldump_parity(&kdh); + strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); + kdh->parity = kerneldump_parity(kdh); +} + +static int +buf_write(struct dumperinfo *di, char *ptr, size_t sz) +{ + size_t len; + int error; - /* - * Check if we will have enough room to save the coredump. - * The partition size needed is the sum of: - * Memory to save + header + trailer + Room to leave untouched - * at partition head. (an arbitrary amount). - */ - if (di->mediasize < - Maxmem * (off_t)PAGE_SIZE + sizeof kdh * 2 + 64*1024) { - printf("\nDump failed. Partition too small.\n"); - return; + while (sz) { + len = DEV_BSIZE - fragsz; + if (len > sz) + len = sz; + bcopy(ptr, buffer + fragsz, len); + fragsz += len; + ptr += len; + sz -= len; + if (fragsz == DEV_BSIZE) { + error = di->dumper(di->priv, buffer, 0, dumplo, + DEV_BSIZE); + if (error) + return error; + dumplo += DEV_BSIZE; + fragsz = 0; + } } - dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE; - dumplo -= sizeof kdh * 2; - i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh); - if (i) - printf("\nDump failed writing header (%d)\n", i); - dumplo += sizeof kdh; - i = 0; - addr = 0; - va = 0; - mb = 0; - for (count = 0; count < Maxmem;) { - left = Maxmem - count; - if (left > MAXDUMPPGS) - left = MAXDUMPPGS; - for (u = 0; u < left; u++) { - a = addr + u * PAGE_SIZE; - if (!is_physical_memory(a)) - a = 0; - va = pmap_kenter_temporary(trunc_page(a), u); + + return (0); +} + +static int +buf_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = di->dumper(di->priv, buffer, 0, dumplo, DEV_BSIZE); + dumplo += DEV_BSIZE; + return (error); +} + +static int +cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + vm_offset_t pa; + uint64_t pgs; + size_t counter, sz; + int c, error, twiddle; + + error = 0; /* catch case in which chunk size is 0 */ + counter = 0; /* Update twiddle every 16MB */ + twiddle = 0; + pgs = (mdp->md_end - mdp->md_start) / PAGE_SIZE; + pa = mdp->md_start; + + printf(" chunk %d: %ld pages ", seqnr, (long)pgs); + + while (pgs) { + sz = (pgs > (DFLTPHYS >> PAGE_SHIFT)) + ? DFLTPHYS : pgs << PAGE_SHIFT; + counter += sz; + if (counter >> 24) { + printf("%c\b", "|/-\\"[twiddle++ & 3]); + counter &= (1<<24) - 1; } - i = count / (16*1024*1024 / PAGE_SIZE); - if (i != mb) { - printf(" %d", count / (1024 * 1024 / PAGE_SIZE)); - mb = i; - } - i = di->dumper(di->priv, va, 0, dumplo, left * PAGE_SIZE); - if (i) + error = di->dumper(di->priv, (void*)pa, 0, dumplo, sz); + if (error) break; - count += left; - dumplo += left * PAGE_SIZE; - addr += left * PAGE_SIZE; - if ((c = cncheckc()) == 0x03) { - printf("\nDump aborted.\n"); - return; - } else if (c != -1) - printf("[CTRL-C to abort] "); + dumplo += sz; + pgs -= sz >> PAGE_SHIFT; + pa += sz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf("(CTRL-C to abort) "); + } + printf("... %s\n", (error) ? "fail" : "ok"); + return (error); +} + +static int +cb_dumphdr(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + Elf64_Phdr phdr; + uint64_t size; + int error; + + size = mdp->md_end - mdp->md_start; + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = mdp->md_start; + phdr.p_paddr = mdp->md_start; + phdr.p_filesz = size; + phdr.p_memsz = size; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); +} + +static int +cb_size(struct md_pa *mdp, int seqnr, void *arg) +{ + uint64_t *sz = (uint64_t*)arg; + + *sz += (uint64_t)(mdp->md_end - mdp->md_start); + return (0); +} + +static int +foreach_chunk(callback_t cb, void *arg) +{ + struct md_pa *mdp; + int error, seqnr; + + seqnr = 0; + mdp = md_pa_first(); + while (mdp != NULL) { + error = (*cb)(mdp, seqnr++, arg); + if (error) + return (-error); + mdp = md_pa_next(mdp); + } + return (seqnr); +} + +void +dumpsys(struct dumperinfo *di) +{ + Elf64_Ehdr ehdr; + uint64_t dumpsize; + off_t hdrgap; + size_t hdrsz; + int error; + + bzero(&ehdr, sizeof(ehdr)); + ehdr.e_ident[EI_MAG0] = ELFMAG0; + ehdr.e_ident[EI_MAG1] = ELFMAG1; + ehdr.e_ident[EI_MAG2] = ELFMAG2; + ehdr.e_ident[EI_MAG3] = ELFMAG3; + ehdr.e_ident[EI_CLASS] = ELFCLASS64; +#if BYTE_ORDER == LITTLE_ENDIAN + ehdr.e_ident[EI_DATA] = ELFDATA2LSB; +#else + ehdr.e_ident[EI_DATA] = ELFDATA2MSB; +#endif + ehdr.e_ident[EI_VERSION] = EV_CURRENT; + ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ + ehdr.e_type = ET_CORE; + ehdr.e_machine = EM_X86_64; + ehdr.e_phoff = sizeof(ehdr); + ehdr.e_flags = 0; + ehdr.e_ehsize = sizeof(ehdr); + ehdr.e_phentsize = sizeof(Elf64_Phdr); + ehdr.e_shentsize = sizeof(Elf64_Shdr); + + /* Calculate dump size. */ + dumpsize = 0L; + ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; + fileofs = MD_ALIGN(hdrsz); + dumpsize += fileofs; + hdrgap = fileofs - DEV_ALIGN(hdrsz); + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; } - if (i) - printf("\nDump failed writing data (%d)\n", i); - i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh); - if (i) - printf("\nDump failed writing trailer (%d)\n", i); - di->dumper(di->priv, NULL, 0, 0, 0); /* tell them we are done */ + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + + mkdumpheader(&kdh, KERNELDUMP_IA64_VERSION, dumpsize, di->blocksize); + + printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, + ehdr.e_phnum); + + /* Dump leader */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump ELF header */ + error = buf_write(di, (char*)&ehdr, sizeof(ehdr)); + if (error) + goto fail; + + /* Dump program headers */ + error = foreach_chunk(cb_dumphdr, di); + if (error < 0) + goto fail; + buf_flush(di); + + /* + * All headers are written using blocked I/O, so we know the + * current offset is (still) block aligned. Skip the alignement + * in the file to have the segment contents aligned at page + * boundary. We cannot use MD_ALIGN on dumplo, because we don't + * care and may very well be unaligned within the dump device. + */ + dumplo += hdrgap; + + /* Dump memory chunks (updates dumplo) */ + error = foreach_chunk(cb_dumpdata, di); + if (error < 0) + goto fail; + + /* Dump trailer */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + + /* Signal completion, signoff and exit stage left. */ + di->dumper(di->priv, NULL, 0, 0, 0); printf("\nDump complete\n"); return; + + fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); } ==== //depot/projects/hammer/sys/sys/kerneldump.h#3 (text+ko) ==== @@ -69,6 +69,7 @@ #define KERNELDUMP_I386_VERSION 1 #define KERNELDUMP_IA64_VERSION 1 #define KERNELDUMP_SPARC64_VERSION 1 +#define KERNELDUMP_AMD64_VERSION 2 uint64_t dumplength; /* excl headers */ uint64_t dumptime; uint32_t blocksize; From owner-p4-projects@FreeBSD.ORG Tue Jun 21 20:25:19 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E690116A420; Tue, 21 Jun 2005 20:25:18 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF7AC16A41C for ; Tue, 21 Jun 2005 20:25:18 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9998843D53 for ; Tue, 21 Jun 2005 20:25:18 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LKPIMr064932 for ; Tue, 21 Jun 2005 20:25:18 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LKPIDk064929 for perforce@freebsd.org; Tue, 21 Jun 2005 20:25:18 GMT (envelope-from peter@freebsd.org) Date: Tue, 21 Jun 2005 20:25:18 GMT Message-Id: <200506212025.j5LKPIDk064929@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78777 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 20:25:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=78777 Change 78777 by peter@peter_daintree on 2005/06/21 20:24:31 Bugfix: ki_tdev is a dev_t now. Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_proc.c#30 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_proc.c#30 (text+ko) ==== @@ -300,7 +300,7 @@ #if 0 kp->ki_tdev = t_cdev.si_udev; #else - kp->ki_tdev = NULL; + kp->ki_tdev = NODEV; #endif } if (tty.t_pgrp != NULL) { From owner-p4-projects@FreeBSD.ORG Tue Jun 21 20:25:20 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6106516A446; Tue, 21 Jun 2005 20:25:19 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13C4B16A42C for ; Tue, 21 Jun 2005 20:25:19 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E863E43D53 for ; Tue, 21 Jun 2005 20:25:18 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LKPIDu064939 for ; Tue, 21 Jun 2005 20:25:18 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LKPIfX064935 for perforce@freebsd.org; Tue, 21 Jun 2005 20:25:18 GMT (envelope-from peter@freebsd.org) Date: Tue, 21 Jun 2005 20:25:18 GMT Message-Id: <200506212025.j5LKPIfX064935@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78778 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 20:25:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=78778 Change 78778 by peter@peter_daintree on 2005/06/21 20:24:48 Read ELF crashdumps Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#7 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#7 (text+ko) ==== @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,8 @@ #include #include +#include + #include #include "kvm_private.h" @@ -71,18 +74,67 @@ #endif struct vmstate { + void *mmapbase; + size_t mmapsize; pml4_entry_t *PML4; }; +/* + * Map the ELF headers into the process' address space. We do this in two + * steps: first the ELF header itself and using that information the whole + * set of headers. + */ +static int +_kvm_maphdrs(kvm_t *kd, size_t sz) +{ + struct vmstate *vm = kd->vmst; + + /* munmap() previous mmap(). */ + if (vm->mmapbase != NULL) { + munmap(vm->mmapbase, vm->mmapsize); + vm->mmapbase = NULL; + } + + vm->mmapsize = sz; + vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->mmapbase == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot mmap corefile"); + return (-1); + } + + return (0); +} + +/* + * Translate a physical memory address to a file-offset in the crash-dump. + */ +static size_t +_kvm_pa2off(kvm_t *kd, uint64_t pa, u_long *ofs) +{ + Elf_Ehdr *e = kd->vmst->mmapbase; + Elf_Phdr *p = (Elf_Phdr*)((char*)e + e->e_phoff); + int n = e->e_phnum; + + while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz)) + p++, n--; + if (n == 0) + return (0); + + *ofs = (pa - p->p_paddr) + p->p_offset; + return (PAGE_SIZE - ((size_t)pa & PAGE_MASK)); +} + void _kvm_freevtop(kvm_t *kd) { - if (kd->vmst != 0) { - if (kd->vmst->PML4) { - free(kd->vmst->PML4); - } - free(kd->vmst); - } + struct vmstate *vm = kd->vmst; + + if (vm->mmapbase != NULL) + munmap(vm->mmapbase, vm->mmapsize); + if (vm->PML4) + free(vm->PML4); + free(vm); + kd->vmst = NULL; } int @@ -93,15 +145,24 @@ u_long pa; u_long kernbase; pml4_entry_t *PML4; + Elf_Ehdr *ehdr; + size_t hdrsz; - vm = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm)); - if (vm == 0) { + kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm)); + if (kd->vmst == 0) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } - kd->vmst = vm; vm->PML4 = 0; + if (_kvm_maphdrs(kd, sizeof(Elf_Ehdr)) == -1) + return (-1); + + ehdr = kd->vmst->mmapbase; + hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; + if (_kvm_maphdrs(kd, hdrsz) == -1) + return (-1); + nlist[0].n_name = "kernbase"; nlist[1].n_name = 0; @@ -132,8 +193,8 @@ return (0); } -static int -_kvm_vatop(kvm_t *kd, u_long va, u_long *pa) +int +_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa) { struct vmstate *vm; u_long offset; @@ -149,9 +210,11 @@ u_long pdeindex; u_long pteindex; int i; + u_long ofs; + size_t s; if (ISALIVE(kd)) { - _kvm_err(kd, 0, "kvm_vatop called in live kernel!"); + _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); return((off_t)0); } @@ -175,13 +238,17 @@ pdpeindex = (va >> PDPSHIFT) & (NPDPEPG-1); pdpe_pa = ((u_long)pml4e & PG_FRAME) + (pdpeindex * sizeof(pdp_entry_t)); - /* XXX This has to be a physical address read, kvm_read is virtual */ - if (lseek(kd->pmfd, pdpe_pa, 0) == -1) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek pdpe_pa"); + s = _kvm_pa2off(kd, pdpe_pa, &ofs); + if (s <= sizeof pdpe) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: pdpe_pa not found"); + goto invalid; + } + if (lseek(kd->pmfd, ofs, 0) == -1) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek pdpe_pa"); goto invalid; } if (read(kd->pmfd, &pdpe, sizeof pdpe) != sizeof pdpe) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: read pdpe"); + _kvm_syserr(kd, kd->program, "_kvm_kvatop: read pdpe"); goto invalid; } if (((u_long)pdpe & PG_V) == 0) @@ -191,13 +258,17 @@ pdeindex = (va >> PDRSHIFT) & (NPDEPG-1); pde_pa = ((u_long)pdpe & PG_FRAME) + (pdeindex * sizeof(pd_entry_t)); - /* XXX This has to be a physical address read, kvm_read is virtual */ - if (lseek(kd->pmfd, pde_pa, 0) == -1) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek pde_pa"); + s = _kvm_pa2off(kd, pde_pa, &ofs); + if (s <= sizeof pde) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: pde_pa not found"); + goto invalid; + } + if (lseek(kd->pmfd, ofs, 0) == -1) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek pde_pa"); goto invalid; } if (read(kd->pmfd, &pde, sizeof pde) != sizeof pde) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: read pde"); + _kvm_syserr(kd, kd->program, "_kvm_kvatop: read pde"); goto invalid; } if (((u_long)pde & PG_V) == 0) @@ -216,13 +287,17 @@ pteindex = (va >> PAGE_SHIFT) & (NPTEPG-1); pte_pa = ((u_long)pde & PG_FRAME) + (pteindex * sizeof(pt_entry_t)); - /* XXX This has to be a physical address read, kvm_read is virtual */ + s = _kvm_pa2off(kd, pte_pa, &ofs); + if (s <= sizeof pte) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: pte_pa not found"); + goto invalid; + } if (lseek(kd->pmfd, pte_pa, 0) == -1) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek"); + _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek"); goto invalid; } if (read(kd->pmfd, &pte, sizeof pte) != sizeof pte) { - _kvm_syserr(kd, kd->program, "_kvm_vatop: read"); + _kvm_syserr(kd, kd->program, "_kvm_kvatop: read"); goto invalid; } if (((u_long)pte & PG_V) == 0) @@ -235,9 +310,3 @@ _kvm_err(kd, 0, "invalid address (%x)", va); return (0); } - -int -_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa) -{ - return (_kvm_vatop(kd, va, pa)); -} From owner-p4-projects@FreeBSD.ORG Tue Jun 21 20:26:21 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0039616A420; Tue, 21 Jun 2005 20:26:20 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B71EA16A41C for ; Tue, 21 Jun 2005 20:26:20 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A718443D53 for ; Tue, 21 Jun 2005 20:26:20 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5LKQKH8065046 for ; Tue, 21 Jun 2005 20:26:20 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5LKQKJ7065043 for perforce@freebsd.org; Tue, 21 Jun 2005 20:26:20 GMT (envelope-from peter@freebsd.org) Date: Tue, 21 Jun 2005 20:26:20 GMT Message-Id: <200506212026.j5LKQKJ7065043@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78779 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 20:26:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=78779 Change 78779 by peter@peter_daintree on 2005/06/21 20:26:07 Comment on the bits I stole from kvm_ia64.c Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#8 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#8 (text+ko) ==== @@ -82,7 +82,7 @@ /* * Map the ELF headers into the process' address space. We do this in two * steps: first the ELF header itself and using that information the whole - * set of headers. + * set of headers. (Taken from kvm_ia64.c) */ static int _kvm_maphdrs(kvm_t *kd, size_t sz) @@ -107,6 +107,7 @@ /* * Translate a physical memory address to a file-offset in the crash-dump. + * (Taken from kvm_ia64.c) */ static size_t _kvm_pa2off(kvm_t *kd, uint64_t pa, u_long *ofs) From owner-p4-projects@FreeBSD.ORG Wed Jun 22 01:36:39 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED8CC16A422; Wed, 22 Jun 2005 01:36:38 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8E1416A41F for ; Wed, 22 Jun 2005 01:36:38 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97C0743D53 for ; Wed, 22 Jun 2005 01:36:38 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5M1acqo091414 for ; Wed, 22 Jun 2005 01:36:38 GMT (envelope-from ps@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5M1acB1091411 for perforce@freebsd.org; Wed, 22 Jun 2005 01:36:38 GMT (envelope-from ps@freebsd.org) Date: Wed, 22 Jun 2005 01:36:38 GMT Message-Id: <200506220136.j5M1acB1091411@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ps@freebsd.org using -f From: Paul Saab To: Perforce Change Reviews Cc: Subject: PERFORCE change 78791 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 01:36:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=78791 Change 78791 by ps@butter.corp on 2005/06/22 01:36:25 the dumper routines expect a virtual address, not a physical one. Peter, you can clean this up, but it works. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#10 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#10 (text+ko) ==== @@ -149,14 +149,16 @@ cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; - vm_offset_t pa; + vm_paddr_t a, pa; + void *va; uint64_t pgs; size_t counter, sz; - int c, error, twiddle; + int i, c, error, twiddle; error = 0; /* catch case in which chunk size is 0 */ counter = 0; /* Update twiddle every 16MB */ twiddle = 0; + va = 0; pgs = (mdp->md_end - mdp->md_start) / PAGE_SIZE; pa = mdp->md_start; @@ -170,7 +172,11 @@ printf("%c\b", "|/-\\"[twiddle++ & 3]); counter &= (1<<24) - 1; } - error = di->dumper(di->priv, (void*)pa, 0, dumplo, sz); + for (i = 0; i < sz >> PAGE_SHIFT; i++) { + a = pa + i * PAGE_SIZE; + va = pmap_kenter_temporary(trunc_page(a), i); + } + error = di->dumper(di->priv, (void*)va, 0, dumplo, sz); if (error) break; dumplo += sz; From owner-p4-projects@FreeBSD.ORG Wed Jun 22 17:40:59 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A36C816A420; Wed, 22 Jun 2005 17:40:58 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66DCB16A41C for ; Wed, 22 Jun 2005 17:40:58 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 481F643D1F for ; Wed, 22 Jun 2005 17:40:58 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MHewfA057980 for ; Wed, 22 Jun 2005 17:40:58 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MHevcl057977 for perforce@freebsd.org; Wed, 22 Jun 2005 17:40:57 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 17:40:57 GMT Message-Id: <200506221740.j5MHevcl057977@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78813 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 17:40:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=78813 Change 78813 by peter@peter_overcee on 2005/06/22 17:40:51 Try and include the kernel code+data+bss in the crashdump. We could use the bios SMAP for the data source, but then we need to re-implement the Maxmem stuff to avoid dumping unused stuff. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#11 edit .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#126 edit .. //depot/projects/hammer/sys/amd64/include/pmap.h#53 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#11 (text+ko) ==== @@ -51,7 +51,7 @@ struct md_pa { vm_paddr_t md_start; - vm_paddr_t md_end; + vm_paddr_t md_size; }; typedef int callback_t(struct md_pa *, int, void *); @@ -63,15 +63,26 @@ static char buffer[DEV_BSIZE]; static size_t fragsz; +/* 20 phys_avail entry pairs correspond to 10 md_pa's */ +static struct md_pa dump_avail[10]; + static struct md_pa * md_pa_first(void) { - struct md_pa *mdp; + int n; - mdp = (struct md_pa *)&phys_avail[0]; - if (mdp->md_start == 0 && mdp->md_end == 0) - mdp = NULL; - return (mdp); + bzero(&dump_avail, sizeof(dump_avail)); + for (n = 0; n < sizeof(dump_avail) / sizeof(dump_avail[0]); n++) { + if (phys_avail[n * 2] == 0 && phys_avail[n * 2 + 1] == 0) + break; + dump_avail[n].md_start = phys_avail[n * 2]; + dump_avail[n].md_size = phys_avail[n * 2 + 1] - phys_avail[n * 2]; + if (dump_avail[n].md_start == kernphys[1]) { + dump_avail[n].md_start = kernphys[0]; + dump_avail[n].md_size += kernphys[1] - kernphys[0]; + } + } + return (&dump_avail[0]); } static struct md_pa * @@ -79,7 +90,7 @@ { mdp++; - if (mdp->md_start == 0 && mdp->md_end == 0) + if (mdp->md_start == 0 && mdp->md_size == 0) mdp = NULL; return (mdp); } @@ -159,7 +170,7 @@ counter = 0; /* Update twiddle every 16MB */ twiddle = 0; va = 0; - pgs = (mdp->md_end - mdp->md_start) / PAGE_SIZE; + pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; printf(" chunk %d: %ld pages ", seqnr, (long)pgs); @@ -202,7 +213,7 @@ uint64_t size; int error; - size = mdp->md_end - mdp->md_start; + size = mdp->md_size; bzero(&phdr, sizeof(phdr)); phdr.p_type = PT_LOAD; phdr.p_flags = PF_R; /* XXX */ @@ -223,7 +234,7 @@ { uint64_t *sz = (uint64_t*)arg; - *sz += (uint64_t)(mdp->md_end - mdp->md_start); + *sz += (uint64_t)mdp->md_size; return (0); } @@ -290,7 +301,7 @@ dumplo = di->mediaoffset + di->mediasize - dumpsize; dumplo -= sizeof(kdh) * 2; - mkdumpheader(&kdh, KERNELDUMP_IA64_VERSION, dumpsize, di->blocksize); + mkdumpheader(&kdh, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, ehdr.e_phnum); ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#126 (text+ko) ==== @@ -848,6 +848,8 @@ u_int basemem; +vm_paddr_t kernphys[2]; + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -990,6 +992,12 @@ dcons_addr = 0; /* + * Keep track of where the kernel lives for crash dumps. + */ + kernphys[0] = 0x100000; + kernphys[1] = first; + + /* * physmap is in bytes, so when converting to page boundaries, * round up the start address and round down the end address. */ @@ -1006,7 +1014,7 @@ /* * block out kernel memory as not available. */ - if (pa >= 0x100000 && pa < first) + if (pa >= kernphys[0] && pa < kernphys[1]) continue; /* ==== //depot/projects/hammer/sys/amd64/include/pmap.h#53 (text+ko) ==== @@ -282,6 +282,7 @@ extern pt_entry_t *CMAP1; extern vm_paddr_t avail_end; extern vm_paddr_t phys_avail[]; +extern vm_paddr_t kernphys[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; From owner-p4-projects@FreeBSD.ORG Wed Jun 22 17:42:02 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8426A16A45D; Wed, 22 Jun 2005 17:42:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30C1F16A456 for ; Wed, 22 Jun 2005 17:42:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 066D043D1D for ; Wed, 22 Jun 2005 17:42:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MHfxC6058071 for ; Wed, 22 Jun 2005 17:41:59 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MHfx7b058068 for perforce@freebsd.org; Wed, 22 Jun 2005 17:41:59 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 17:41:59 GMT Message-Id: <200506221741.j5MHfx7b058068@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78814 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 17:42:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=78814 Change 78814 by peter@peter_overcee on 2005/06/22 17:41:47 grab ps's fix for libkvm bootstrap Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#9 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#9 (text+ko) ==== @@ -228,6 +228,7 @@ */ if (vm->PML4 == 0) { *pa = va; + _kvm_pa2off(kd, va, pa); return (PAGE_SIZE - offset); } From owner-p4-projects@FreeBSD.ORG Wed Jun 22 17:46:06 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A418116A420; Wed, 22 Jun 2005 17:46:05 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EBC616A41C for ; Wed, 22 Jun 2005 17:46:05 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CDC843D48 for ; Wed, 22 Jun 2005 17:46:05 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MHk5L9058348 for ; Wed, 22 Jun 2005 17:46:05 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MHk5V7058345 for perforce@freebsd.org; Wed, 22 Jun 2005 17:46:05 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 17:46:05 GMT Message-Id: <200506221746.j5MHk5V7058345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78815 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 17:46:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=78815 Change 78815 by peter@peter_melody on 2005/06/22 17:45:21 Also include page zero size we modify it in the kernel sometimes. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#12 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#12 (text+ko) ==== @@ -81,6 +81,10 @@ dump_avail[n].md_start = kernphys[0]; dump_avail[n].md_size += kernphys[1] - kernphys[0]; } + if (dump_avail[n].md_start == PAGE_SIZE) { + dump_avail[n].md_start = 0; + dump_avail[n].md_size += PAGE_SIZE; + } } return (&dump_avail[0]); } @@ -90,7 +94,7 @@ { mdp++; - if (mdp->md_start == 0 && mdp->md_size == 0) + if (mdp->md_size == 0) mdp = NULL; return (mdp); } From owner-p4-projects@FreeBSD.ORG Wed Jun 22 18:37:09 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 24A6616A420; Wed, 22 Jun 2005 18:37:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0EF916A41C for ; Wed, 22 Jun 2005 18:37:08 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEDE343D48 for ; Wed, 22 Jun 2005 18:37:08 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MIb8kX062446 for ; Wed, 22 Jun 2005 18:37:08 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MIb8hP062443 for perforce@freebsd.org; Wed, 22 Jun 2005 18:37:08 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 18:37:08 GMT Message-Id: <200506221837.j5MIb8hP062443@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78819 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 18:37:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=78819 Change 78819 by peter@peter_overcee on 2005/06/22 18:36:07 There is a MAXDUMPPGS param.h setting, use that. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#13 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#13 (text+ko) ==== @@ -180,8 +180,8 @@ printf(" chunk %d: %ld pages ", seqnr, (long)pgs); while (pgs) { - sz = (pgs > (DFLTPHYS >> PAGE_SHIFT)) - ? DFLTPHYS : pgs << PAGE_SHIFT; + sz = (pgs > MAXDUMPPGS) ? + MAXDUMPPGS << PAGE_SHIFT : pgs << PAGE_SHIFT; counter += sz; if (counter >> 24) { printf("%c\b", "|/-\\"[twiddle++ & 3]); From owner-p4-projects@FreeBSD.ORG Wed Jun 22 18:48:23 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0F53B16A420; Wed, 22 Jun 2005 18:48:23 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE32516A41C for ; Wed, 22 Jun 2005 18:48:22 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFCF243D1F for ; Wed, 22 Jun 2005 18:48:22 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MImMUR062835 for ; Wed, 22 Jun 2005 18:48:22 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MImMbc062832 for perforce@freebsd.org; Wed, 22 Jun 2005 18:48:22 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 18:48:22 GMT Message-Id: <200506221848.j5MImMbc062832@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78820 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 18:48:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=78820 Change 78820 by peter@peter_overcee on 2005/06/22 18:48:16 Build the dump_avail[] list once only, in case that is somehow messing things up. Eliminate some PAGE_SHIFT abuse while here on ps's suggestion. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#14 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#14 (text+ko) ==== @@ -66,17 +66,18 @@ /* 20 phys_avail entry pairs correspond to 10 md_pa's */ static struct md_pa dump_avail[10]; -static struct md_pa * -md_pa_first(void) +static void +md_pa_init(void) { - int n; + int n, idx; bzero(&dump_avail, sizeof(dump_avail)); for (n = 0; n < sizeof(dump_avail) / sizeof(dump_avail[0]); n++) { - if (phys_avail[n * 2] == 0 && phys_avail[n * 2 + 1] == 0) + idx = n * 2; + if (phys_avail[idx] == 0 && phys_avail[idx + 1] == 0) break; - dump_avail[n].md_start = phys_avail[n * 2]; - dump_avail[n].md_size = phys_avail[n * 2 + 1] - phys_avail[n * 2]; + dump_avail[n].md_start = phys_avail[idx]; + dump_avail[n].md_size = phys_avail[idx + 1] - phys_avail[idx]; if (dump_avail[n].md_start == kernphys[1]) { dump_avail[n].md_start = kernphys[0]; dump_avail[n].md_size += kernphys[1] - kernphys[0]; @@ -86,6 +87,11 @@ dump_avail[n].md_size += PAGE_SIZE; } } +} + +static struct md_pa * +md_pa_first(void) +{ return (&dump_avail[0]); } @@ -167,7 +173,7 @@ vm_paddr_t a, pa; void *va; uint64_t pgs; - size_t counter, sz; + size_t counter, sz, chunk; int i, c, error, twiddle; error = 0; /* catch case in which chunk size is 0 */ @@ -180,22 +186,24 @@ printf(" chunk %d: %ld pages ", seqnr, (long)pgs); while (pgs) { - sz = (pgs > MAXDUMPPGS) ? - MAXDUMPPGS << PAGE_SHIFT : pgs << PAGE_SHIFT; + chunk = pgs; + if (chunk > MAXDUMPPGS) + chunk = MAXDUMPPGS; + sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { printf("%c\b", "|/-\\"[twiddle++ & 3]); counter &= (1<<24) - 1; } - for (i = 0; i < sz >> PAGE_SHIFT; i++) { + for (i = 0; i < chunk; i++) { a = pa + i * PAGE_SIZE; va = pmap_kenter_temporary(trunc_page(a), i); } - error = di->dumper(di->priv, (void*)va, 0, dumplo, sz); + error = di->dumper(di->priv, va, 0, dumplo, sz); if (error) break; dumplo += sz; - pgs -= sz >> PAGE_SHIFT; + pgs -= chunk; pa += sz; /* Check for user abort. */ @@ -289,6 +297,8 @@ ehdr.e_phentsize = sizeof(Elf64_Phdr); ehdr.e_shentsize = sizeof(Elf64_Shdr); + md_pa_init(); + /* Calculate dump size. */ dumpsize = 0L; ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); From owner-p4-projects@FreeBSD.ORG Wed Jun 22 21:51:03 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4EB7B16A420; Wed, 22 Jun 2005 21:51:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D0CB16A41C for ; Wed, 22 Jun 2005 21:51:03 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AE8B43D1D for ; Wed, 22 Jun 2005 21:51:03 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MLp2ki076739 for ; Wed, 22 Jun 2005 21:51:02 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MLp2XY076736 for perforce@freebsd.org; Wed, 22 Jun 2005 21:51:02 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 21:51:02 GMT Message-Id: <200506222151.j5MLp2XY076736@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78823 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 21:51:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=78823 Change 78823 by peter@peter_melody on 2005/06/22 21:51:01 Fix some more oops!'s in the kvm code. 1) store PML4 pointer in the right struct 2) don't forget to do the pa2ofs thing for returned values Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#10 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#10 (text+ko) ==== @@ -141,7 +141,6 @@ int _kvm_initvtop(kvm_t *kd) { - struct vmstate *vm; struct nlist nlist[2]; u_long pa; u_long kernbase; @@ -149,12 +148,12 @@ Elf_Ehdr *ehdr; size_t hdrsz; - kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm)); + kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); if (kd->vmst == 0) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } - vm->PML4 = 0; + kd->vmst->PML4 = 0; if (_kvm_maphdrs(kd, sizeof(Elf_Ehdr)) == -1) return (-1); @@ -190,7 +189,7 @@ _kvm_err(kd, kd->program, "cannot read KPML4phys"); return (-1); } - vm->PML4 = PML4; + kd->vmst->PML4 = PML4; return (0); } @@ -283,6 +282,7 @@ #define PAGE2M_MASK (NBPDR - 1) #define PG_FRAME2M (~PAGE2M_MASK) *pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK); + _kvm_pa2off(kd, *pa, pa); return (NBPDR - (va & PAGE2M_MASK)); } @@ -306,6 +306,7 @@ goto invalid; *pa = ((u_long)pte & PG_FRAME) + offset; + _kvm_pa2off(kd, *pa, pa); return (PAGE_SIZE - offset); invalid: From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:12:44 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9975016A437; Wed, 22 Jun 2005 23:12:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 651A016A424 for ; Wed, 22 Jun 2005 23:12:43 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5246D43D4C for ; Wed, 22 Jun 2005 23:12:43 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNChWE079828 for ; Wed, 22 Jun 2005 23:12:43 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNChhL079825 for perforce@freebsd.org; Wed, 22 Jun 2005 23:12:43 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:12:43 GMT Message-Id: <200506222312.j5MNChhL079825@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78827 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:12:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=78827 Change 78827 by peter@peter_melody on 2005/06/22 23:12:08 Include a few more bits (dmesg etc) in the dump Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#15 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#15 (text+ko) ==== @@ -79,19 +79,30 @@ dump_avail[n].md_start = phys_avail[idx]; dump_avail[n].md_size = phys_avail[idx + 1] - phys_avail[idx]; if (dump_avail[n].md_start == kernphys[1]) { + /* Include the kernel, that would be helpful! */ dump_avail[n].md_start = kernphys[0]; dump_avail[n].md_size += kernphys[1] - kernphys[0]; } if (dump_avail[n].md_start == PAGE_SIZE) { + /* Include page zero */ dump_avail[n].md_start = 0; dump_avail[n].md_size += PAGE_SIZE; } + if (dump_avail[n].md_start == 0 && dump_avail[n].md_size >= 0x98000) { + /* Include mpboot code and/or bios EBDA */ + dump_avail[n].md_size = 0xA0000; + } + if (phys_avail[idx + 1] == avail_end) { + /* Include msgbuf, that would be helpful! */ + dump_avail[n].md_size += (Maxmem << PAGE_SHIFT) - avail_end; + } } } static struct md_pa * md_pa_first(void) { + return (&dump_avail[0]); } From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:12:46 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 51EDE16A45A; Wed, 22 Jun 2005 23:12:45 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DABAF16A42C for ; Wed, 22 Jun 2005 23:12:44 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B484643D5D for ; Wed, 22 Jun 2005 23:12:43 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNChsf079835 for ; Wed, 22 Jun 2005 23:12:43 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNChMh079831 for perforce@freebsd.org; Wed, 22 Jun 2005 23:12:43 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:12:43 GMT Message-Id: <200506222312.j5MNChMh079831@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:12:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=78828 Change 78828 by peter@peter_melody on 2005/06/22 23:12:33 Freeze things for the dump snapshot. Affected files ... .. //depot/projects/hammer/sys/kern/kern_shutdown.c#35 edit Differences ... ==== //depot/projects/hammer/sys/kern/kern_shutdown.c#35 (text+ko) ==== @@ -230,10 +230,12 @@ return; } + mtx_lock_spin(&sched_lock); savectx(&dumppcb); dumptid = curthread->td_tid; dumping++; dumpsys(&dumper); + mtx_unlock_spin(&sched_lock); } /* From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:13:46 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A96DC16A420; Wed, 22 Jun 2005 23:13:45 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8426016A41C for ; Wed, 22 Jun 2005 23:13:45 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E01C43D4C for ; Wed, 22 Jun 2005 23:13:45 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNDjBY080020 for ; Wed, 22 Jun 2005 23:13:45 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNDjfi080017 for perforce@freebsd.org; Wed, 22 Jun 2005 23:13:45 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:13:45 GMT Message-Id: <200506222313.j5MNDjfi080017@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78829 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:13:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=78829 Change 78829 by peter@peter_melody on 2005/06/22 23:12:56 Snarf Soren's fix for ad_dump while here Affected files ... .. //depot/projects/hammer/sys/dev/ata/ata-disk.c#33 edit Differences ... ==== //depot/projects/hammer/sys/dev/ata/ata-disk.c#33 (text+ko) ==== @@ -327,7 +327,6 @@ do { DELAY(20); } while (ch->hw.end_transaction(&request) == ATA_OP_CONTINUES); - ata_finish(&request); } if (request.status & ATA_S_ERROR) return EIO; From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:45:25 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ACF4416A420; Wed, 22 Jun 2005 23:45:24 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DCC816A41C for ; Wed, 22 Jun 2005 23:45:24 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C7ED43D48 for ; Wed, 22 Jun 2005 23:45:24 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNjOaC081147 for ; Wed, 22 Jun 2005 23:45:24 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNjOkL081144 for perforce@freebsd.org; Wed, 22 Jun 2005 23:45:24 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:45:24 GMT Message-Id: <200506222345.j5MNjOkL081144@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78831 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:45:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=78831 Change 78831 by peter@peter_melody on 2005/06/22 23:45:03 do two different kread's so we can differentiate the error. Affected files ... .. //depot/projects/hammer/sbin/dmesg/dmesg.c#11 edit Differences ... ==== //depot/projects/hammer/sbin/dmesg/dmesg.c#11 (text+ko) ==== @@ -125,8 +125,10 @@ if (nl[X_MSGBUF].n_type == 0) errx(1, "%s: msgbufp not found", nlistf ? nlistf : "namelist"); - if (KREAD(nl[X_MSGBUF].n_value, bufp) || KREAD((long)bufp, cur)) - errx(1, "kvm_read: %s", kvm_geterr(kd)); + if (KREAD(nl[X_MSGBUF].n_value, bufp)) + errx(1, "kvm_read: msgbufp: %s", kvm_geterr(kd)); + if (KREAD((long)bufp, cur)) + errx(1, "kvm_read: msgbuf: %s", kvm_geterr(kd)); if (cur.msg_magic != MSG_MAGIC) errx(1, "kernel message buffer has different magic " "number"); From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:46:27 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8DE1B16A420; Wed, 22 Jun 2005 23:46:26 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5182C16A41C for ; Wed, 22 Jun 2005 23:46:26 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A52543D48 for ; Wed, 22 Jun 2005 23:46:26 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNkQ2p081193 for ; Wed, 22 Jun 2005 23:46:26 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNkPLH081190 for perforce@freebsd.org; Wed, 22 Jun 2005 23:46:25 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:46:25 GMT Message-Id: <200506222346.j5MNkPLH081190@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78832 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:46:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=78832 Change 78832 by peter@peter_melody on 2005/06/22 23:46:13 Umm, marcel, this is bad. The buffer is for kvm.c to write into for the future. This means libkvm will write into a freed buffer. Affected files ... .. //depot/projects/hammer/gnu/usr.bin/gdb/kgdb/main.c#6 edit Differences ... ==== //depot/projects/hammer/gnu/usr.bin/gdb/kgdb/main.c#6 (text+ko) ==== @@ -409,7 +409,6 @@ kvm = kvm_openfiles(kernel, vmcore, NULL, O_RDONLY, s); if (kvm == NULL) errx(1, s); - free(s); kgdb_thr_init(); } From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:52:34 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4727916A420; Wed, 22 Jun 2005 23:52:34 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 216C016A41C for ; Wed, 22 Jun 2005 23:52:34 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEDA743D4C for ; Wed, 22 Jun 2005 23:52:33 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNqXDd081404 for ; Wed, 22 Jun 2005 23:52:33 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNqXc0081401 for perforce@freebsd.org; Wed, 22 Jun 2005 23:52:33 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:52:33 GMT Message-Id: <200506222352.j5MNqXc0081401@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78833 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:52:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=78833 Change 78833 by peter@peter_daintree on 2005/06/22 23:52:12 Use the correct file offset. DOH! Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#11 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#11 (text+ko) ==== @@ -294,7 +294,7 @@ _kvm_syserr(kd, kd->program, "_kvm_kvatop: pte_pa not found"); goto invalid; } - if (lseek(kd->pmfd, pte_pa, 0) == -1) { + if (lseek(kd->pmfd, ofs, 0) == -1) { _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek"); goto invalid; } From owner-p4-projects@FreeBSD.ORG Wed Jun 22 23:54:38 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7A66316A420; Wed, 22 Jun 2005 23:54:37 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2681216A41C for ; Wed, 22 Jun 2005 23:54:37 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A0DC43D1D for ; Wed, 22 Jun 2005 23:54:37 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5MNsaqI081455 for ; Wed, 22 Jun 2005 23:54:36 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5MNsaIM081452 for perforce@freebsd.org; Wed, 22 Jun 2005 23:54:36 GMT (envelope-from peter@freebsd.org) Date: Wed, 22 Jun 2005 23:54:36 GMT Message-Id: <200506222354.j5MNsaIM081452@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78834 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 23:54:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=78834 Change 78834 by peter@peter_melody on 2005/06/22 23:54:20 Make the error reporting consistent. Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_amd64.c#12 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_amd64.c#12 (text+ko) ==== @@ -210,7 +210,7 @@ u_long pdeindex; u_long pteindex; int i; - u_long ofs; + u_long a, ofs; size_t s; if (ISALIVE(kd)) { @@ -226,22 +226,27 @@ * not yet set) then return pa == va to avoid infinite recursion. */ if (vm->PML4 == 0) { - *pa = va; - _kvm_pa2off(kd, va, pa); - return (PAGE_SIZE - offset); + s = _kvm_pa2off(kd, va, pa); + if (s == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: bootstrap data not in dump"); + goto invalid; + } else + return (PAGE_SIZE - offset); } pml4eindex = (va >> PML4SHIFT) & (NPML4EPG - 1); pml4e = vm->PML4[pml4eindex]; - if (((u_long)pml4e & PG_V) == 0) + if (((u_long)pml4e & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: pml4e not valid"); goto invalid; + } pdpeindex = (va >> PDPSHIFT) & (NPDPEPG-1); pdpe_pa = ((u_long)pml4e & PG_FRAME) + (pdpeindex * sizeof(pdp_entry_t)); s = _kvm_pa2off(kd, pdpe_pa, &ofs); if (s <= sizeof pdpe) { - _kvm_syserr(kd, kd->program, "_kvm_kvatop: pdpe_pa not found"); + _kvm_err(kd, kd->program, "_kvm_kvatop: pdpe_pa not found"); goto invalid; } if (lseek(kd->pmfd, ofs, 0) == -1) { @@ -252,10 +257,11 @@ _kvm_syserr(kd, kd->program, "_kvm_kvatop: read pdpe"); goto invalid; } - if (((u_long)pdpe & PG_V) == 0) + if (((u_long)pdpe & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: pdpe not valid"); goto invalid; + } - pdeindex = (va >> PDRSHIFT) & (NPDEPG-1); pde_pa = ((u_long)pdpe & PG_FRAME) + (pdeindex * sizeof(pd_entry_t)); @@ -265,15 +271,17 @@ goto invalid; } if (lseek(kd->pmfd, ofs, 0) == -1) { - _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek pde_pa"); + _kvm_err(kd, kd->program, "_kvm_kvatop: lseek pde_pa"); goto invalid; } if (read(kd->pmfd, &pde, sizeof pde) != sizeof pde) { _kvm_syserr(kd, kd->program, "_kvm_kvatop: read pde"); goto invalid; } - if (((u_long)pde & PG_V) == 0) + if (((u_long)pde & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: pde not valid"); goto invalid; + } if ((u_long)pde & PG_PS) { /* @@ -281,9 +289,13 @@ */ #define PAGE2M_MASK (NBPDR - 1) #define PG_FRAME2M (~PAGE2M_MASK) - *pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK); - _kvm_pa2off(kd, *pa, pa); - return (NBPDR - (va & PAGE2M_MASK)); + a = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK); + s = _kvm_pa2off(kd, a, pa); + if (s == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: 2MB page address not in dump"); + goto invalid; + } else + return (NBPDR - (va & PAGE2M_MASK)); } pteindex = (va >> PAGE_SHIFT) & (NPTEPG-1); @@ -291,7 +303,7 @@ s = _kvm_pa2off(kd, pte_pa, &ofs); if (s <= sizeof pte) { - _kvm_syserr(kd, kd->program, "_kvm_kvatop: pte_pa not found"); + _kvm_err(kd, kd->program, "_kvm_kvatop: pte_pa not found"); goto invalid; } if (lseek(kd->pmfd, ofs, 0) == -1) { @@ -302,14 +314,20 @@ _kvm_syserr(kd, kd->program, "_kvm_kvatop: read"); goto invalid; } - if (((u_long)pte & PG_V) == 0) + if (((u_long)pte & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: pte not valid"); goto invalid; + } - *pa = ((u_long)pte & PG_FRAME) + offset; - _kvm_pa2off(kd, *pa, pa); - return (PAGE_SIZE - offset); + a = ((u_long)pte & PG_FRAME) + offset; + s = _kvm_pa2off(kd, a, pa); + if (s == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: address not in dump"); + goto invalid; + } else + return (PAGE_SIZE - offset); invalid: - _kvm_err(kd, 0, "invalid address (%x)", va); + _kvm_err(kd, 0, "invalid address (0x%lx)", (unsigned long)va); return (0); } From owner-p4-projects@FreeBSD.ORG Thu Jun 23 00:04:50 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 292FA16A420; Thu, 23 Jun 2005 00:04:50 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF9B816A41C for ; Thu, 23 Jun 2005 00:04:49 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B94DC43D1D for ; Thu, 23 Jun 2005 00:04:49 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N04nVn081834 for ; Thu, 23 Jun 2005 00:04:49 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N04nkx081831 for perforce@freebsd.org; Thu, 23 Jun 2005 00:04:49 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 00:04:49 GMT Message-Id: <200506230004.j5N04nkx081831@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78835 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 00:04:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=78835 Change 78835 by peter@peter_daintree on 2005/06/23 00:04:15 Attempt to double the ata dump speed by halving the transaction rate. Affected files ... .. //depot/projects/hammer/sys/sys/param.h#62 edit Differences ... ==== //depot/projects/hammer/sys/sys/param.h#62 (text+ko) ==== @@ -128,7 +128,7 @@ #define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ #endif #ifndef MAXDUMPPGS -#define MAXDUMPPGS (DFLTPHYS/PAGE_SIZE) +#define MAXDUMPPGS (MAXPHYS/PAGE_SIZE) #endif /* From owner-p4-projects@FreeBSD.ORG Thu Jun 23 00:07:54 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 79C8116A420; Thu, 23 Jun 2005 00:07:54 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D57516A41C for ; Thu, 23 Jun 2005 00:07:54 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1609343D4C for ; Thu, 23 Jun 2005 00:07:53 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N07rUD081994 for ; Thu, 23 Jun 2005 00:07:53 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N07rbZ081991 for perforce@freebsd.org; Thu, 23 Jun 2005 00:07:53 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 00:07:53 GMT Message-Id: <200506230007.j5N07rbZ081991@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78836 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 00:07:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=78836 Change 78836 by peter@peter_melody on 2005/06/23 00:07:34 Partition too small is far more informative than ** DUMP FAILED (ERROR 28) ** Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#16 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#16 (text+ko) ==== @@ -378,6 +378,8 @@ if (error == ECANCELED) printf("\nDump aborted\n"); + else if (error == ENOSPC) + printf("\nDump failed. Partition too small.\n"); else printf("\n** DUMP FAILED (ERROR %d) **\n", error); } From owner-p4-projects@FreeBSD.ORG Thu Jun 23 01:45:54 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B7E5216A420; Thu, 23 Jun 2005 01:45:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6004F16A41C for ; Thu, 23 Jun 2005 01:45:53 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D99B43D58 for ; Thu, 23 Jun 2005 01:45:53 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N1jrpZ092479 for ; Thu, 23 Jun 2005 01:45:53 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N1jrCU092476 for perforce@freebsd.org; Thu, 23 Jun 2005 01:45:53 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 01:45:53 GMT Message-Id: <200506230145.j5N1jrCU092476@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78840 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 01:45:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=78840 Change 78840 by peter@peter_daintree on 2005/06/23 01:45:13 Don't print the meaningless Maxmem "largest memory address" with the implication that it is how much memory the machine has. Memory remapping makes this a joke. Instead, display physmem as 'usable memory' which is far more useful. It doesn't count the hole that the kernel lives in though. That should be fixed before this is even considered for committing. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#127 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#127 (text+ko) ==== @@ -187,8 +187,8 @@ #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); + printf("usable memory = %ju (%ju MB)\n", ptoa((uintmax_t)physmem), + ptoa((uintmax_t)physmem) / 1048576); realmem = Maxmem; /* * Display any holes after the first chunk of extended memory. From owner-p4-projects@FreeBSD.ORG Thu Jun 23 04:19:59 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E865516A420; Thu, 23 Jun 2005 04:19:58 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B37E916A41C for ; Thu, 23 Jun 2005 04:19:58 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 799C943D49 for ; Thu, 23 Jun 2005 04:19:58 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N4JwoO099873 for ; Thu, 23 Jun 2005 04:19:58 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N4JwGA099870 for perforce@freebsd.org; Thu, 23 Jun 2005 04:19:58 GMT (envelope-from scottl@freebsd.org) Date: Thu, 23 Jun 2005 04:19:58 GMT Message-Id: <200506230419.j5N4JwGA099870@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 78841 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 04:19:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=78841 Change 78841 by scottl@scottl-junior on 2005/06/23 04:18:58 Partial IFC Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#3 integrate .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#14 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_all.c#3 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#3 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_ch.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#5 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_low.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_sa.c#4 integrate .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_target.c#4 integrate Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_periph.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.58 2005/01/05 22:34:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.59 2005/02/20 23:45:49 scottl Exp $"); #include #include @@ -445,6 +445,10 @@ if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break; } + if (*p_drv == NULL) { + printf("camperiphfree: attempt to free non-existant periph\n"); + return; + } if (periph->periph_dtor != NULL) periph->periph_dtor(periph); ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#14 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.149 2005/02/09 11:44:15 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.153 2005/05/11 17:39:33 kan Exp $"); #include #include @@ -2379,7 +2379,7 @@ break; } - if (pdrv == NULL) { + if (*pdrv == NULL) { cdm->status = CAM_DEV_MATCH_ERROR; return(0); } @@ -4871,6 +4871,7 @@ device->qfrozen_cnt = 0; device->flags = CAM_DEV_UNCONFIGURED; device->tag_delay_count = 0; + device->tag_saved_openings = 0; device->refcount = 1; callout_handle_init(&device->c_handle); @@ -4958,6 +4959,9 @@ if (result == CAM_REQ_CMP && (diff < 0)) { dev->flags |= CAM_DEV_RESIZE_QUEUE_NEEDED; } + if ((dev->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 + || (dev->inq_flags & SID_CmdQue) != 0) + dev->tag_saved_openings = newopenings; /* Adjust the global limit */ xpt_max_ccbs += diff; splx(s); @@ -5189,7 +5193,6 @@ struct cam_path *path; cam_status status; - path = request_ccb->ccb_h.path; status = xpt_create_path(&path, xpt_periph, path_id, target_id, lun_id); if (status != CAM_REQ_CMP) { @@ -5205,8 +5208,8 @@ free(scan_info, M_TEMP); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); - break; } + break; } xpt_setup_ccb(&request_ccb->ccb_h, path, request_ccb->ccb_h.pinfo.priority); @@ -5224,7 +5227,6 @@ } } -void xpt_find_quirk(struct cam_ed *device) { caddr_t match; @@ -5854,7 +5856,11 @@ device->flags &= ~CAM_DEV_TAG_AFTER_COUNT; xpt_freeze_devq(path, /*count*/1); device->inq_flags |= SID_CmdQue; - newopenings = min(device->quirk->maxtags, sim->max_tagged_dev_openings); + if (device->tag_saved_openings != 0) + newopenings = device->tag_saved_openings; + else + newopenings = min(device->quirk->maxtags, + sim->max_tagged_dev_openings); xpt_dev_ccbq_resize(path, newopenings); xpt_setup_ccb(&crs.ccb_h, path, /*priority*/1); crs.ccb_h.func_code = XPT_REL_SIMQ; @@ -6032,6 +6038,7 @@ if (done_ccb->ccb_h.status == CAM_REQ_CMP) { done_ccb->ccb_h.func_code = XPT_SCAN_BUS; done_ccb->ccb_h.cbfcnp = xpt_finishconfig; + done_ccb->crcn.flags = 0; xpt_action(done_ccb); return; } ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_all.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.46 2005/01/05 22:34:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.48 2005/04/14 03:52:50 mjacob Exp $"); #include @@ -1971,7 +1971,7 @@ * errors on finicky architectures. We don't * ensure that the sense data is pointer aligned. */ - bcopy(&csio->sense_data, sense, + bcopy(&csio->sense_data, &sense, sizeof(struct scsi_sense_data *)); } } else { @@ -2312,6 +2312,15 @@ int i; int num_syncrates; + /* + * It's a bug if period is zero, but if it is anyway, don't + * die with a divide fault- instead return something which + * 'approximates' async + */ + if (period_factor == 0) { + return (3300); + } + num_syncrates = sizeof(scsi_syncrates) / sizeof(scsi_syncrates[0]); /* See if the period is in the "exception" table */ for (i = 0; i < num_syncrates; i++) { ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#3 (text+ko) ==== @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.92 2005/01/30 08:12:36 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.93 2005/03/26 06:05:06 ken Exp $"); #include "opt_cd.h" @@ -1929,10 +1929,16 @@ /* * If we don't have media loaded, check for it. If still don't * have media loaded, we can only do a load or eject. + * + * We only care whether media is loaded if this is a cd-specific ioctl + * (thus the IOCGROUP check below). Note that this will break if + * anyone adds any ioctls into the switch statement below that don't + * have their ioctl group set to 'c'. */ if (((softc->flags & CD_FLAG_VALID_MEDIA) == 0) && ((cmd != CDIOCCLOSE) - && (cmd != CDIOCEJECT))) { + && (cmd != CDIOCEJECT)) + && (IOCGROUP(cmd) == 'c')) { error = cdcheckmedia(periph); if (error != 0) { cam_periph_unlock(periph); ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_ch.c#4 (text+ko) ==== @@ -68,7 +68,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_ch.c,v 1.41 2005/01/05 22:34:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_ch.c,v 1.42 2005/03/26 04:21:11 ken Exp $"); #include #include @@ -1157,6 +1157,8 @@ * Fill in the user status array. */ st_hdr = (struct read_element_status_header *)data; + pg_hdr = (struct read_element_status_page_header *)((uintptr_t)st_hdr + + sizeof(struct read_element_status_header)); avail = scsi_2btoul(st_hdr->count); if (avail != cesr->cesr_element_count) { ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#5 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.173 2005/01/05 22:34:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.180 2005/06/09 17:35:04 pjd Exp $"); #include @@ -203,6 +203,7 @@ { /* * Doesn't like the synchronize cache command. + * Reported by: Blaz Zupan */ {T_DIRECT, SIP_MEDIA_FIXED, quantum, "MAVERICK 540S", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE @@ -216,6 +217,14 @@ }, { /* + * Doesn't like the synchronize cache command. + * Reported by: walter@pelissero.de + */ + {T_DIRECT, SIP_MEDIA_FIXED, quantum, "LPS540S", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * Doesn't work correctly with 6 byte reads/writes. * Returns illegal request, and points to byte 9 of the * 6-byte CDB. @@ -231,6 +240,14 @@ }, { /* + * Doesn't like the synchronize cache command. + * Reported by: walter@pelissero.de + */ + {T_DIRECT, SIP_MEDIA_FIXED, "CONNER", "CP3500*", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * The CISS RAID controllers do not support SYNC_CACHE */ {T_DIRECT, SIP_MEDIA_FIXED, "COMPAQ", "RAID*", "*"}, @@ -314,7 +331,30 @@ * Frontier Labs NEX IA+ Digital Audio Player, rev 1.10/0.01 * PR: kern/70158 */ - {T_DIRECT, SIP_MEDIA_REMOVABLE, "FL" , "NexIA+*", "*"}, + {T_DIRECT, SIP_MEDIA_REMOVABLE, "FL" , "Nex*", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * ZICPlay USB MP3 Player with FM + * PR: kern/75057 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "ACTIONS*" , "USB DISK*", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * TEAC USB floppy mechanisms + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "TEAC" , "FD-05*", "*"}, + /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Kingston DataTraveler II+ USB Pen-Drive. + * Reported by: Pawel Jakub Dawidek + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston" , "DataTraveler II+", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, }; ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_low.c#4 (text+ko) ==== @@ -2,7 +2,7 @@ /* $NetBSD$ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.22 2005/01/05 22:34:34 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.23 2005/03/19 06:32:57 scottl Exp $"); #define SCSI_LOW_STATICS #define SCSI_LOW_DEBUG @@ -1421,7 +1421,6 @@ CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(slp->sl_si.sim)); cam_sim_free(slp->sl_si.sim, /*free_simq*/TRUE); - free(slp->sl_si.sim, M_DEVBUF); return ENODEV; } ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_sa.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.102 2005/01/05 22:34:35 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.104 2005/04/14 04:51:18 mjacob Exp $"); #include #include @@ -810,10 +810,29 @@ } break; + case MTIOCTOP: + { + struct mtop *mt = (struct mtop *) arg; + + /* + * Check to make sure it's an OP we can perform + * with no media inserted. + */ + switch (mt->mt_op) { + case MTSETBSIZ: + case MTSETDNSTY: + case MTCOMP: + mt = NULL; + /* FALLTHROUGH */ + default: + break; + } + if (mt != NULL) { + break; + } + /* FALLTHROUGH */ + } case MTIOCSETEOTMODEL: - case MTSETBSIZ: - case MTSETDNSTY: - case MTCOMP: /* * We need to acquire the peripheral here rather * than at open time because we are sharing writable @@ -1822,8 +1841,8 @@ * will now attempt to rewind/load it. */ softc->flags &= ~SA_FLAG_TAPE_MOUNTED; - if (CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO)) { - xpt_print_path(ccb->ccb_h.path); + if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) { + xpt_print_path(periph->path); printf("error %d on TUR in samount\n", error); } } @@ -1887,7 +1906,7 @@ rblim = (struct scsi_read_block_limits_data *) malloc(8192, M_TEMP, M_WAITOK); if (rblim == NULL) { - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("no memory for test read\n"); xpt_release_ccb(ccb); error = ENOMEM; @@ -1909,7 +1928,7 @@ softc->device_stats); QFRLS(ccb); if (error) { - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("unable to rewind after test read\n"); xpt_release_ccb(ccb); goto exit; @@ -2074,7 +2093,7 @@ if ((softc->max_blk < softc->media_blksize) || (softc->min_blk > softc->media_blksize && softc->media_blksize)) { - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("BLOCK LIMITS (%d..%d) could not match current " "block settings (%d)- adjusting\n", softc->min_blk, softc->max_blk, softc->media_blksize); @@ -2109,7 +2128,7 @@ error = sasetparams(periph, SA_PARAM_BLOCKSIZE, softc->media_blksize, 0, 0, SF_NO_PRINT); if (error) { - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("unable to set fixed blocksize to %d\n", softc->media_blksize); goto exit; @@ -2136,7 +2155,7 @@ softc->last_media_blksize = 512; goto tryagain; } - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("unable to set variable blocksize\n"); goto exit; } @@ -2194,7 +2213,7 @@ if (error == 0) { softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF; } else { - xpt_print_path(ccb->ccb_h.path); + xpt_print_path(periph->path); printf("unable to set buffered mode\n"); } error = 0; /* not an error */ ==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_target.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.65 2005/02/12 04:51:19 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.66 2005/03/31 12:19:41 phk Exp $"); #include #include @@ -1035,6 +1035,7 @@ return; *dev = make_dev(&targ_cdevsw, unit2minor(u), UID_ROOT, GID_WHEEL, 0600, "targ%d", u); + dev_ref(*dev); (*dev)->si_flags |= SI_CHEAPCLONE; } From owner-p4-projects@FreeBSD.ORG Thu Jun 23 06:49:01 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EC2DA16A420; Thu, 23 Jun 2005 06:49:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C568D16A41C for ; Thu, 23 Jun 2005 06:49:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95E1B43D49 for ; Thu, 23 Jun 2005 06:49:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N6n0nq012481 for ; Thu, 23 Jun 2005 06:49:00 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N6n02h012478 for perforce@freebsd.org; Thu, 23 Jun 2005 06:49:00 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 06:49:00 GMT Message-Id: <200506230649.j5N6n02h012478@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78848 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 06:49:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=78848 Change 78848 by peter@peter_daintree on 2005/06/23 06:48:04 Cosmetic and doc bugs Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#37 edit .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#52 edit .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#128 edit .. //depot/projects/hammer/sys/amd64/amd64/support.S#29 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#37 (text+ko) ==== @@ -30,7 +30,7 @@ */ /* - * Machine dependent interrupt code for i386. For the i386, we have to + * Machine dependent interrupt code for amd64. For amd64, we have to * deal with different PICs. Thus, we use the passed in vector to lookup * an interrupt source associated with that vector. The interrupt source * describes which PIC the source belongs to and includes methods to handle ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#52 (text+ko) ==== @@ -839,7 +839,7 @@ #ifdef SMP /* * Inter Processor Interrupt functions. The lapic_ipi_*() functions are - * private to the sys/i386 code. The public interface for the rest of the + * private to the sys/amd64 code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ int ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#128 (text+ko) ==== @@ -661,7 +661,7 @@ CTLFLAG_RW, &wall_cmos_clock, 0, ""); /* - * Initialize 386 and configure to run kernel + * Initialize amd64 and configure to run kernel */ /* ==== //depot/projects/hammer/sys/amd64/amd64/support.S#29 (text+ko) ==== @@ -202,13 +202,7 @@ /*****************************************************************************/ /* * Access user memory from inside the kernel. These routines and possibly - * the math- and DOS emulators should be the only places that do this. - * - * We have to access the memory with user's permissions, so use a segment - * selector with RPL 3. For writes to user space we have to additionally - * check the PTE for write permission, because the 386 does not check - * write permissions when we are executing with EPL 0. The 486 does check - * this if the WP bit is set in CR0, so we can use a simpler version here. + * should be the only places that do this. * * These routines set curpcb->onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler @@ -592,7 +586,7 @@ ret /* - * Handling of special 386 registers and descriptor tables etc + * Handling of special amd64 registers and descriptor tables etc * %rdi */ /* void lgdt(struct region_descriptor *rdp); */ From owner-p4-projects@FreeBSD.ORG Thu Jun 23 08:04:33 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 377EE16A420; Thu, 23 Jun 2005 08:04:33 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C21F16A41C for ; Thu, 23 Jun 2005 08:04:33 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4DBA43D53 for ; Thu, 23 Jun 2005 08:04:32 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N84WwX015605 for ; Thu, 23 Jun 2005 08:04:32 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N84WgI015602 for perforce@freebsd.org; Thu, 23 Jun 2005 08:04:32 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 08:04:32 GMT Message-Id: <200506230804.j5N84WgI015602@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78850 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 08:04:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=78850 Change 78850 by peter@peter_overcee on 2005/06/23 08:04:02 Stomp on another source of 'trap xx with interrupts disabled'. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/exception.S#37 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/exception.S#37 (text+ko) ==== @@ -119,7 +119,7 @@ subq $TF_ERR,%rsp; \ movq $(a),TF_TRAPNO(%rsp) ; \ movq $0,TF_ADDR(%rsp) ; \ - jmp alltraps_noen + jmp alltraps IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) From owner-p4-projects@FreeBSD.ORG Thu Jun 23 08:34:11 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7540116A420; Thu, 23 Jun 2005 08:34:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 497A216A41C for ; Thu, 23 Jun 2005 08:34:10 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CBA643D53 for ; Thu, 23 Jun 2005 08:34:10 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5N8Y9TE016897 for ; Thu, 23 Jun 2005 08:34:09 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5N8Y90n016894 for perforce@freebsd.org; Thu, 23 Jun 2005 08:34:09 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 08:34:09 GMT Message-Id: <200506230834.j5N8Y90n016894@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78852 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 08:34:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=78852 Change 78852 by peter@peter_overcee on 2005/06/23 08:33:41 Attempt to recover from the wrong gsbase state after a fault from doreti()::iretq. Even though we're coming from kernel mode we have to swapgs and friends before enabling interrupts. XXX may need to move load_gs and load_fs from C to asm in order to do the magic there too. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/exception.S#38 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/exception.S#38 (text+ko) ==== @@ -126,8 +126,6 @@ TRAP_ERR(T_SEGNPFLT) IDTVEC(stk) TRAP_ERR(T_STKFLT) -IDTVEC(prot) - TRAP_ERR(T_PROTFLT) IDTVEC(align) TRAP_ERR(T_ALIGNFLT) @@ -203,7 +201,8 @@ testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs -1: movq %rdi,TF_RDI(%rsp) /* free up a GP register */ +1: + movq %rdi,TF_RDI(%rsp) /* free up a GP register */ movq %cr2,%rdi /* preserve %cr2 before .. */ movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ testl $PSL_I,TF_RFLAGS(%rsp) @@ -211,6 +210,30 @@ sti jmp alltraps_pushregs_no_rdi + /* + * We have to special-case this one. If we get a trap in doreti() at + * the iretq stage, we'll reenter with the wrong gs state. We'll have + * to do a special the swapgs in this case even coming from the kernel. + * XXX linux has a trap handler for their equivalent of load_gs(). + */ +IDTVEC(prot) + subq $TF_ERR,%rsp + movq $T_PROTFLT,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq %rdi,TF_RDI(%rsp) /* free up a GP register */ + leaq doreti_iret(%rip),%rdi + cmpq %rdi,TF_RIP(%rsp) + je 2f /* kernel but with user gsbase!! */ + testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ + jz 1f /* already running with kernel GS.base */ +2: + swapgs +1: + testl $PSL_I,TF_RFLAGS(%rsp) + jz alltraps_pushregs_no_rdi + sti + jmp alltraps_pushregs_no_rdi + /* * Fast syscall entry point. We enter here with just our new %cs/%ss set, * and the new privilige level. We are still running on the old user stack From owner-p4-projects@FreeBSD.ORG Thu Jun 23 15:49:31 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3629316A420; Thu, 23 Jun 2005 15:49:31 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB02116A41C for ; Thu, 23 Jun 2005 15:49:30 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C901143D55 for ; Thu, 23 Jun 2005 15:49:30 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5NFnUAA047782 for ; Thu, 23 Jun 2005 15:49:30 GMT (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5NFnUql047778 for perforce@freebsd.org; Thu, 23 Jun 2005 15:49:30 GMT (envelope-from areisse@nailabs.com) Date: Thu, 23 Jun 2005 15:49:30 GMT Message-Id: <200506231549.j5NFnUql047778@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Cc: Subject: PERFORCE change 78862 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 15:49:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=78862 Change 78862 by areisse@areisse_tislabs on 2005/06/23 15:48:39 Install new flask autogenerated files in the kernel source, so that avc messages use the correct names. Affected files ... .. //depot/projects/trustedbsd/sebsd/sys/security/sebsd/avc/av_perm_to_string.h#7 edit .. //depot/projects/trustedbsd/sebsd/sys/security/sebsd/avc/av_permissions.h#8 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/sys/security/sebsd/avc/av_perm_to_string.h#7 (text+ko) ==== @@ -105,23 +105,11 @@ { SECCLASS_CAPABILITY, CAPABILITY__FOWNER, "fowner" }, { SECCLASS_CAPABILITY, CAPABILITY__FSETID, "fsetid" }, { SECCLASS_CAPABILITY, CAPABILITY__KILL, "kill" }, - { SECCLASS_CAPABILITY, CAPABILITY__LINK_DIR, "link_dir" }, { SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap" }, { SECCLASS_CAPABILITY, CAPABILITY__SETGID, "setgid" }, { SECCLASS_CAPABILITY, CAPABILITY__SETUID, "setuid" }, - { SECCLASS_CAPABILITY, CAPABILITY__MAC_DOWNGRADE, "mac_downgrade" }, - { SECCLASS_CAPABILITY, CAPABILITY__MAC_READ, "mac_read" }, - { SECCLASS_CAPABILITY, CAPABILITY__MAC_RELABEL_SUBJ, "mac_relabel_subj" }, - { SECCLASS_CAPABILITY, CAPABILITY__MAC_UPGRADE, "mac_upgrade" }, - { SECCLASS_CAPABILITY, CAPABILITY__MAC_WRITE, "mac_write" }, - { SECCLASS_CAPABILITY, CAPABILITY__INF_NOFLOAT_OBJ, "inf_nofloat_obj" }, - { SECCLASS_CAPABILITY, CAPABILITY__INF_NOFLOAT_SUBJ, "inf_nofloat_subj" }, - { SECCLASS_CAPABILITY, CAPABILITY__INF_RELABEL_OBJ, "inf_relabel_obj" }, - { SECCLASS_CAPABILITY, CAPABILITY__INF_RELABEL_SUBJ, "inf_relabel_subj" }, { SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control" }, { SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write" }, - { SECCLASS_CAPABILITY, CAPABILITY__SETPCAP, "setpcap" }, - { SECCLASS_CAPABILITY, CAPABILITY__XXX_INVALID1, "xxx_invalid1" }, { SECCLASS_CAPABILITY, CAPABILITY__LINUX_IMMUTABLE, "linux_immutable" }, { SECCLASS_CAPABILITY, CAPABILITY__NET_BIND_SERVICE, "net_bind_service" }, { SECCLASS_CAPABILITY, CAPABILITY__NET_BROADCAST, "net_broadcast" }, @@ -141,7 +129,6 @@ { SECCLASS_CAPABILITY, CAPABILITY__SYS_TIME, "sys_time" }, { SECCLASS_CAPABILITY, CAPABILITY__SYS_TTY_CONFIG, "sys_tty_config" }, { SECCLASS_CAPABILITY, CAPABILITY__MKNOD, "mknod" }, - { SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease" }, { SECCLASS_PASSWD, PASSWD__PASSWD, "passwd" }, { SECCLASS_PASSWD, PASSWD__CHFN, "chfn" }, { SECCLASS_PASSWD, PASSWD__CHSH, "chsh" }, ==== //depot/projects/trustedbsd/sebsd/sys/security/sebsd/avc/av_permissions.h#8 (text+ko) ==== @@ -582,43 +582,30 @@ #define CAPABILITY__FOWNER 0x0000000000000010UL #define CAPABILITY__FSETID 0x0000000000000020UL #define CAPABILITY__KILL 0x0000000000000040UL -#define CAPABILITY__LINK_DIR 0x0000000000000080UL -#define CAPABILITY__SETFCAP 0x0000000000000100UL -#define CAPABILITY__SETGID 0x0000000000000200UL -#define CAPABILITY__SETUID 0x0000000000000400UL -#define CAPABILITY__MAC_DOWNGRADE 0x0000000000000800UL -#define CAPABILITY__MAC_READ 0x0000000000001000UL -#define CAPABILITY__MAC_RELABEL_SUBJ 0x0000000000002000UL -#define CAPABILITY__MAC_UPGRADE 0x0000000000004000UL -#define CAPABILITY__MAC_WRITE 0x0000000000008000UL -#define CAPABILITY__INF_NOFLOAT_OBJ 0x0000000000010000UL -#define CAPABILITY__INF_NOFLOAT_SUBJ 0x0000000000020000UL -#define CAPABILITY__INF_RELABEL_OBJ 0x0000000000040000UL -#define CAPABILITY__INF_RELABEL_SUBJ 0x0000000000080000UL -#define CAPABILITY__AUDIT_CONTROL 0x0000000000100000UL -#define CAPABILITY__AUDIT_WRITE 0x0000000000200000UL -#define CAPABILITY__SETPCAP 0x0000000000400000UL -#define CAPABILITY__XXX_INVALID1 0x0000000000800000UL -#define CAPABILITY__LINUX_IMMUTABLE 0x0000000001000000UL -#define CAPABILITY__NET_BIND_SERVICE 0x0000000002000000UL -#define CAPABILITY__NET_BROADCAST 0x0000000004000000UL -#define CAPABILITY__NET_ADMIN 0x0000000008000000UL -#define CAPABILITY__NET_RAW 0x0000000010000000UL -#define CAPABILITY__IPC_LOCK 0x0000000020000000UL -#define CAPABILITY__IPC_OWNER 0x0000000040000000UL -#define CAPABILITY__SYS_MODULE 0x0000000080000000UL -#define CAPABILITY__SYS_RAWIO 0x0000000100000000UL -#define CAPABILITY__SYS_CHROOT 0x0000000200000000UL -#define CAPABILITY__SYS_PTRACE 0x0000000400000000UL -#define CAPABILITY__SYS_PACCT 0x0000000800000000UL -#define CAPABILITY__SYS_ADMIN 0x0000001000000000UL -#define CAPABILITY__SYS_BOOT 0x0000002000000000UL -#define CAPABILITY__SYS_NICE 0x0000004000000000UL -#define CAPABILITY__SYS_RESOURCE 0x0000008000000000UL -#define CAPABILITY__SYS_TIME 0x0000010000000000UL -#define CAPABILITY__SYS_TTY_CONFIG 0x0000020000000000UL -#define CAPABILITY__MKNOD 0x0000040000000000UL -#define CAPABILITY__LEASE 0x0000080000000000UL +#define CAPABILITY__SETFCAP 0x0000000000000080UL +#define CAPABILITY__SETGID 0x0000000000000100UL +#define CAPABILITY__SETUID 0x0000000000000200UL +#define CAPABILITY__AUDIT_CONTROL 0x0000000000000400UL +#define CAPABILITY__AUDIT_WRITE 0x0000000000000800UL +#define CAPABILITY__LINUX_IMMUTABLE 0x0000000000001000UL +#define CAPABILITY__NET_BIND_SERVICE 0x0000000000002000UL +#define CAPABILITY__NET_BROADCAST 0x0000000000004000UL +#define CAPABILITY__NET_ADMIN 0x0000000000008000UL +#define CAPABILITY__NET_RAW 0x0000000000010000UL +#define CAPABILITY__IPC_LOCK 0x0000000000020000UL +#define CAPABILITY__IPC_OWNER 0x0000000000040000UL +#define CAPABILITY__SYS_MODULE 0x0000000000080000UL +#define CAPABILITY__SYS_RAWIO 0x0000000000100000UL +#define CAPABILITY__SYS_CHROOT 0x0000000000200000UL +#define CAPABILITY__SYS_PTRACE 0x0000000000400000UL +#define CAPABILITY__SYS_PACCT 0x0000000000800000UL +#define CAPABILITY__SYS_ADMIN 0x0000000001000000UL +#define CAPABILITY__SYS_BOOT 0x0000000002000000UL +#define CAPABILITY__SYS_NICE 0x0000000004000000UL +#define CAPABILITY__SYS_RESOURCE 0x0000000008000000UL +#define CAPABILITY__SYS_TIME 0x0000000010000000UL +#define CAPABILITY__SYS_TTY_CONFIG 0x0000000020000000UL +#define CAPABILITY__MKNOD 0x0000000040000000UL #define PASSWD__PASSWD 0x0000000000000001UL #define PASSWD__CHFN 0x0000000000000002UL From owner-p4-projects@FreeBSD.ORG Thu Jun 23 18:54:00 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CEB9416A420; Thu, 23 Jun 2005 18:53:59 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FEFF16A41C; Thu, 23 Jun 2005 18:53:59 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FFE243D4C; Thu, 23 Jun 2005 18:53:59 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from [10.50.41.231] (Not Verified[65.202.103.25]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Thu, 23 Jun 2005 15:07:33 -0400 From: John Baldwin To: Peter Wemm Date: Thu, 23 Jun 2005 14:44:07 -0400 User-Agent: KMail/1.8 References: <200506222312.j5MNChMh079831@repoman.freebsd.org> In-Reply-To: <200506222312.j5MNChMh079831@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506231444.08027.jhb@FreeBSD.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 78828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 18:54:00 -0000 On Wednesday 22 June 2005 07:12 pm, Peter Wemm wrote: > http://perforce.freebsd.org/chv.cgi?CH=78828 > > Change 78828 by peter@peter_melody on 2005/06/22 23:12:33 > > Freeze things for the dump snapshot. This may be a bad idea since we may panic with sched_lock held and it would be very nice to get a dump there and not just deadlock. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-p4-projects@FreeBSD.ORG Thu Jun 23 19:19:00 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 46DFF16A420; Thu, 23 Jun 2005 19:19:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EA0A16A41F for ; Thu, 23 Jun 2005 19:19:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 062EE43D1D for ; Thu, 23 Jun 2005 19:19:00 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5NJIx5k063150 for ; Thu, 23 Jun 2005 19:18:59 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5NJIxGm063147 for perforce@freebsd.org; Thu, 23 Jun 2005 19:18:59 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 19:18:59 GMT Message-Id: <200506231918.j5NJIxGm063147@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78868 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 19:19:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=78868 Change 78868 by peter@peter_melody on 2005/06/23 19:18:38 Do a progress countdown for the crashdumps instead of twiddle. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#17 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/dump_machdep.c#17 (text+ko) ==== @@ -177,6 +177,8 @@ return (error); } +#define PG2MB(pgs) ((pgs + (1 << 8) - 1) >> 8) + static int cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) { @@ -194,7 +196,7 @@ pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; - printf(" chunk %d: %ld pages ", seqnr, (long)pgs); + printf(" chunk %d: %ldMB (%ld pages)", seqnr, PG2MB(pgs), pgs); while (pgs) { chunk = pgs; @@ -203,7 +205,7 @@ sz = chunk << PAGE_SHIFT; counter += sz; if (counter >> 24) { - printf("%c\b", "|/-\\"[twiddle++ & 3]); + printf(" %ld", PG2MB(pgs)); counter &= (1<<24) - 1; } for (i = 0; i < chunk; i++) { @@ -222,9 +224,9 @@ if (c == 0x03) return (ECANCELED); if (c != -1) - printf("(CTRL-C to abort) "); + printf(" (CTRL-C to abort) "); } - printf("... %s\n", (error) ? "fail" : "ok"); + printf(" ... %s\n", (error) ? "fail" : "ok"); return (error); } From owner-p4-projects@FreeBSD.ORG Thu Jun 23 19:52:41 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0816A16A420; Thu, 23 Jun 2005 19:52:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C87C616A41C for ; Thu, 23 Jun 2005 19:52:40 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1E1943D1D for ; Thu, 23 Jun 2005 19:52:40 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5NJqewV064452 for ; Thu, 23 Jun 2005 19:52:40 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5NJqekE064447 for perforce@freebsd.org; Thu, 23 Jun 2005 19:52:40 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 19:52:40 GMT Message-Id: <200506231952.j5NJqekE064447@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78869 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 19:52:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=78869 Change 78869 by peter@peter_overcee on 2005/06/23 19:51:44 Fix comment typo. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/support.S#30 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/support.S#30 (text+ko) ==== @@ -201,8 +201,8 @@ /* copyout and fubyte family */ /*****************************************************************************/ /* - * Access user memory from inside the kernel. These routines and possibly - * should be the only places that do this. + * Access user memory from inside the kernel. These routines should be + * the only places that do this. * * These routines set curpcb->onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler From owner-p4-projects@FreeBSD.ORG Thu Jun 23 23:01:25 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ACEEC16A420; Thu, 23 Jun 2005 23:01:24 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8492F16A41C for ; Thu, 23 Jun 2005 23:01:24 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A18443D1F for ; Thu, 23 Jun 2005 23:01:24 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5NN1O45079643 for ; Thu, 23 Jun 2005 23:01:24 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5NN1Nfg079640 for perforce@freebsd.org; Thu, 23 Jun 2005 23:01:23 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 23:01:23 GMT Message-Id: <200506232301.j5NN1Nfg079640@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78879 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 23:01:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=78879 Change 78879 by peter@peter_daintree on 2005/06/23 23:01:07 IFC @78878 Affected files ... .. //depot/projects/hammer/contrib/ipfilter/IPFILTER.LICENCE#3 delete .. //depot/projects/hammer/contrib/ipfilter/QNX_OCL.txt#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_fil_freebsd.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_htable.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_htable.h#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_irc_pxy.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_lookup.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_lookup.h#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_pool.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_pool.h#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_pptp_pxy.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_rpcb_pxy.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_scan.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_scan.h#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_sync.c#2 delete .. //depot/projects/hammer/contrib/ipfilter/ip_sync.h#2 delete .. //depot/projects/hammer/contrib/ipfilter/lib/ipf_dotuning.c#2 integrate .. //depot/projects/hammer/games/random/random.c#7 integrate .. //depot/projects/hammer/lib/libc/sparc64/fpu/fpu_qp.c#6 integrate .. //depot/projects/hammer/lib/libdevinfo/devinfo.c#6 integrate .. //depot/projects/hammer/lib/libpthread/thread/thr_private.h#33 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_private.h#25 integrate .. //depot/projects/hammer/sbin/dhclient/dhclient-script.8#2 integrate .. //depot/projects/hammer/sbin/dhclient/dhclient.8#2 integrate .. //depot/projects/hammer/sbin/dhclient/dhclient.conf.5#2 integrate .. //depot/projects/hammer/sbin/dhclient/dhclient.leases.5#2 integrate .. //depot/projects/hammer/sbin/dhclient/dhcp-options.5#2 integrate .. //depot/projects/hammer/share/man/man4/fwohci.4#10 integrate .. //depot/projects/hammer/share/man/man4/man4.sparc64/Makefile#3 integrate .. //depot/projects/hammer/share/man/man4/man4.sparc64/auxio.4#4 integrate .. //depot/projects/hammer/share/man/man4/man4.sparc64/central.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/clkbrd.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/creator.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/ebus.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/eeprom.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/fhc.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/machfb.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/ofw_console.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/openfirm.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/openprom.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/rtc.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/sbus.4#1 branch .. //depot/projects/hammer/share/man/man4/man4.sparc64/snd_audiocs.4#2 integrate .. //depot/projects/hammer/share/man/man4/ohci.4#6 integrate .. //depot/projects/hammer/sys/arm/arm/db_interface.c#5 integrate .. //depot/projects/hammer/sys/arm/arm/pmap.c#23 integrate .. //depot/projects/hammer/sys/arm/arm/trap.c#13 integrate .. //depot/projects/hammer/sys/arm/arm/vm_machdep.c#15 integrate .. //depot/projects/hammer/sys/arm/include/atomic.h#8 integrate .. //depot/projects/hammer/sys/arm/xscale/i80321/iq31244_machdep.c#12 integrate .. //depot/projects/hammer/sys/compat/linux/linux_stats.c#22 integrate .. //depot/projects/hammer/sys/contrib/ipfilter/netinet/fil.c#10 integrate .. //depot/projects/hammer/sys/contrib/ipfilter/netinet/ip_htable.c#2 integrate .. //depot/projects/hammer/sys/dev/amr/amr.c#22 integrate .. //depot/projects/hammer/sys/dev/fatm/if_fatm.c#11 integrate .. //depot/projects/hammer/sys/dev/hatm/if_hatmvar.h#8 integrate .. //depot/projects/hammer/sys/dev/iwi/if_iwi.c#5 integrate .. //depot/projects/hammer/sys/dev/utopia/utopia.c#10 integrate .. //depot/projects/hammer/sys/i386/i386/sys_machdep.c#19 integrate .. //depot/projects/hammer/sys/i386/i386/vm_machdep.c#45 integrate .. //depot/projects/hammer/sys/kern/kern_jail.c#18 integrate .. //depot/projects/hammer/sys/kern/kern_kse.c#23 integrate .. //depot/projects/hammer/sys/kern/kern_ktrace.c#19 integrate .. //depot/projects/hammer/sys/kern/kern_mbuf.c#6 integrate .. //depot/projects/hammer/sys/kern/vfs_syscalls.c#50 integrate .. //depot/projects/hammer/sys/netinet/ip_mroute.c#26 integrate .. //depot/projects/hammer/sys/netinet/tcp_sack.c#19 integrate .. //depot/projects/hammer/sys/sys/mutex.h#19 integrate .. //depot/projects/hammer/tools/regression/usr.bin/env/regress-env.rgdata#2 integrate .. //depot/projects/hammer/usr.bin/env/env.1#7 integrate .. //depot/projects/hammer/usr.bin/env/env.c#4 integrate .. //depot/projects/hammer/usr.bin/env/envopts.c#2 integrate .. //depot/projects/hammer/usr.sbin/ntp/config.h#7 integrate .. //depot/projects/hammer/usr.sbin/pkg_install/create/pkg_create.1#9 integrate Differences ... ==== //depot/projects/hammer/contrib/ipfilter/lib/ipf_dotuning.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/contrib/ipfilter/lib/ipf_dotuning.c,v 1.3 2005/04/26 14:27:12 darrenr Exp $ */ +/* $FreeBSD: src/contrib/ipfilter/lib/ipf_dotuning.c,v 1.4 2005/06/23 14:19:02 darrenr Exp $ */ #include "ipf.h" #include "netinet/ipl.h" @@ -33,6 +33,7 @@ printtunable(&tu); } } else if ((t = strchr(s, '=')) != NULL) { + tu.ipft_cookie = NULL; *t++ = '\0'; strncpy(tu.ipft_name, s, sizeof(tu.ipft_name)); if (sscanf(t, "%lu", &tu.ipft_vlong) == 1) { @@ -45,13 +46,16 @@ return; } } else { + tu.ipft_cookie = NULL; strncpy(tu.ipft_name, s, sizeof(tu.ipft_name)); if ((*iocfn)(fd, SIOCIPFGET, &obj) == -1) { perror("ioctl(SIOCIPFGET)"); return; } - if (tu.ipft_cookie == NULL) + if (tu.ipft_cookie == NULL) { + fprintf(stderr, "Null cookie for %s\n", s); return; + } tu.ipft_name[sizeof(tu.ipft_name) - 1] = '\0'; printtunable(&tu); ==== //depot/projects/hammer/games/random/random.c#7 (text+ko) ==== @@ -46,7 +46,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/games/random/random.c,v 1.18 2005/05/27 15:29:01 jhb Exp $"); +__FBSDID("$FreeBSD: src/games/random/random.c,v 1.19 2005/06/22 15:24:00 jhb Exp $"); #include @@ -62,6 +62,12 @@ #include "randomize_fd.h" +/* + * The random() function is defined to return values between 0 and + * 2^31 - 1 inclusive in random(3). + */ +#define RANDOM_MAX 0x7fffffffL + static void usage(void); int @@ -158,7 +164,7 @@ /* Compute a random exit status between 0 and denom - 1. */ if (random_exit) - return (int)((denom * random()) / RAND_MAX); + return (int)((denom * random()) / RANDOM_MAX); /* * Select whether to print the first line. (Prime the pump.) @@ -166,7 +172,7 @@ * 0 (which has a 1 / denom chance of being true), we select the * line. */ - selected = (int)(denom * random() / RAND_MAX) == 0; + selected = (int)(denom * random() / RANDOM_MAX) == 0; while ((ch = getchar()) != EOF) { if (selected) (void)putchar(ch); @@ -176,7 +182,7 @@ err(2, "stdout"); /* Now see if the next line is to be printed. */ - selected = (int)(denom * random() / RAND_MAX) == 0; + selected = (int)(denom * random() / RANDOM_MAX) == 0; } } if (ferror(stdin)) ==== //depot/projects/hammer/lib/libc/sparc64/fpu/fpu_qp.c#6 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_qp.c,v 1.6 2005/05/27 10:00:22 stefanf Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/sparc64/fpu/fpu_qp.c,v 1.7 2005/06/21 21:13:07 stefanf Exp $"); #include #include @@ -86,11 +86,12 @@ #define FCC_LE(fcc) ((fcc) == FSR_CC_EQ || (fcc) == FSR_CC_LT) #define FCC_LT(fcc) ((fcc) == FSR_CC_LT) #define FCC_NE(fcc) ((fcc) != FSR_CC_EQ) +#define FCC_ID(fcc) (fcc) #define _QP_CMP(name, cmpe, test) \ -int _Qp_f ## name(u_int *a, u_int *b) ; \ +int _Qp_ ## name(u_int *a, u_int *b) ; \ int \ -_Qp_f ## name(u_int *a, u_int *b) \ +_Qp_ ## name(u_int *a, u_int *b) \ { \ struct fpemu fe; \ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :); \ @@ -137,9 +138,11 @@ _QP_QTOT(ui, i, u_int) _QP_QTOT(ux, x, u_long, &u.a) -_QP_CMP(eq, 0, FCC_EQ) -_QP_CMP(ge, 0, FCC_GE) -_QP_CMP(gt, 0, FCC_GT) -_QP_CMP(le, 0, FCC_LE) -_QP_CMP(lt, 0, FCC_LT) -_QP_CMP(ne, 0, FCC_NE) +_QP_CMP(feq, 0, FCC_EQ) +_QP_CMP(fge, 0, FCC_GE) +_QP_CMP(fgt, 0, FCC_GT) +_QP_CMP(fle, 0, FCC_LE) +_QP_CMP(flt, 0, FCC_LT) +_QP_CMP(fne, 0, FCC_NE) +_QP_CMP(cmp, 0, FCC_ID) +_QP_CMP(cmpe, 1, FCC_ID) ==== //depot/projects/hammer/lib/libdevinfo/devinfo.c#6 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libdevinfo/devinfo.c,v 1.7 2005/05/20 12:46:34 charnier Exp $"); +__FBSDID("$FreeBSD: src/lib/libdevinfo/devinfo.c,v 1.8 2005/06/22 15:20:11 jhb Exp $"); /* * An interface to the FreeBSD kernel's bus/device information interface. @@ -367,6 +367,7 @@ free(dr); } devinfo_initted = 0; + devinfo_generation = 0; } /* ==== //depot/projects/hammer/lib/libpthread/thread/thr_private.h#33 (text+ko) ==== @@ -31,7 +31,7 @@ * * Private thread definitions for the uthread kernel. * - * $FreeBSD: src/lib/libpthread/thread/thr_private.h,v 1.122 2005/02/13 18:38:06 deischen Exp $ + * $FreeBSD: src/lib/libpthread/thread/thr_private.h,v 1.123 2005/06/22 22:35:49 davidxu Exp $ */ #ifndef _THR_PRIVATE_H @@ -106,7 +106,7 @@ do { \ (dst)->tv_sec = (src)->tv_sec + (val)->tv_sec; \ (dst)->tv_nsec = (src)->tv_nsec + (val)->tv_nsec; \ - if ((dst)->tv_nsec > 1000000000) { \ + if ((dst)->tv_nsec >= 1000000000) { \ (dst)->tv_sec++; \ (dst)->tv_nsec -= 1000000000; \ } \ ==== //depot/projects/hammer/lib/libthr/thread/thr_private.h#25 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libthr/thread/thr_private.h,v 1.46 2005/04/12 03:00:28 davidxu Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_private.h,v 1.47 2005/06/22 22:38:56 davidxu Exp $ */ #ifndef _THR_PRIVATE_H @@ -94,7 +94,7 @@ do { \ (dst)->tv_sec = (src)->tv_sec + (val)->tv_sec; \ (dst)->tv_nsec = (src)->tv_nsec + (val)->tv_nsec; \ - if ((dst)->tv_nsec > 1000000000) { \ + if ((dst)->tv_nsec >= 1000000000) { \ (dst)->tv_sec++; \ (dst)->tv_nsec -= 1000000000; \ } \ ==== //depot/projects/hammer/sbin/dhclient/dhclient-script.8#2 (text+ko) ==== @@ -36,6 +36,8 @@ .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. .\" +.\" $FreeBSD: src/sbin/dhclient/dhclient-script.8,v 1.2 2005/06/22 14:55:59 ru Exp $ +.\" .Dd January 1, 1997 .Dt DHCLIENT-SCRIPT 8 .Os @@ -65,21 +67,23 @@ .Xr dhclient 8 needs to invoke the client configuration script, it sets up a number of environment variables and runs -.Nm dhclient-script . +.Nm . In all cases, .Va $reason is set to the name of the reason why the script has been invoked. The following reasons are currently defined: -MEDIUM, PREINIT, ARPCHECK, ARPSEND, BOUND, RENEW, REBIND, REBOOT, -EXPIRE, FAIL and TIMEOUT. -.Bl -tag -width "ARPCHECK" -.It MEDIUM +.Li MEDIUM , PREINIT , ARPCHECK , ARPSEND , BOUND , RENEW , REBIND , REBOOT , +.Li EXPIRE , FAIL +and +.Li TIMEOUT . +.Bl -tag -width ".Li ARPCHECK" +.It Li MEDIUM The DHCP client is requesting that an interface's media type be set. The interface name is passed in .Va $interface , and the media type is passed in .Va $medium . -.It PREINIT +.It Li PREINIT The DHCP client is requesting that an interface be configured as required in order to send packets prior to receiving an actual address. .\" For clients which use the BSD socket library, @@ -98,25 +102,29 @@ .Va $alias_ip_address , and that IP alias should be deleted from the interface, along with any routes to it. -.It ARPSEND +.It Li ARPSEND The DHCP client is requesting that an address that has been offered to it be checked to see if somebody else is using it, by sending an ARP request for that address. -It's not clear how to implement this, so no examples exist yet. +It is not clear how to implement this, so no examples exist yet. The IP address to check is passed in .Va $new_ip_address , and the interface name is passed in .Va $interface . -.It ARPCHECK +.It Li ARPCHECK The DHCP client wants to know if a response to the ARP request sent -using ARPSEND has been received. +using +.Li ARPSEND +has been received. If one has, the script should exit with a nonzero status, indicating that the offered address has already been requested and should be declined. +The .Va $new_ip_address and .Va $interface -are set as with ARPSEND. -.It BOUND +variables are set as with +.Li ARPSEND . +.It Li BOUND The DHCP client has done an initial binding to a new address. The new IP address is passed in .Va $new_ip_address , @@ -128,10 +136,11 @@ described in .Xr dhcp-options 5 , except that dashes -.Pq Sq - +.Pq Ql - are replaced by underscores -.Pq Sq _ -in order to make valid shell variables, and the variable names start with new_. +.Pq Ql _ +in order to make valid shell variables, and the variable names start with +.Dq Li new_ . So for example, the new subnet mask would be passed in .Va $new_subnet_mask . .Pp @@ -154,48 +163,63 @@ .Va $alias_ip_address , and other DHCP options that are set for the alias (e.g., subnet mask) will be passed in variables named as described previously except starting with -$alias_ instead of $new_. +.Dq Li $alias_ +instead of +.Dq Li $new_ . Care should be taken that the alias IP address not be used if it is identical to the bound IP address .Pq Va $new_ip_address , since the other alias parameters may be incorrect in this case. -.It RENEW -When a binding has been renewed, the script is called as in BOUND, -except that in addition to all the variables starting with $new_, -there is another set of variables starting with $old_. -Persistent settings that may have changed need to be deleted \- for example, +.It Li RENEW +When a binding has been renewed, the script is called as in +.Li BOUND , +except that in addition to all the variables starting with +.Dq Li $new_ , +there is another set of variables starting with +.Dq Li $old_ . +Persistent settings that may have changed need to be deleted - for example, if a local route to the bound address is being configured, the old local route should be deleted. If the default route has changed, the old default route should be deleted. If the static routes have changed, the old ones should be deleted. -Otherwise, processing can be done as with BOUND. -.It REBIND +Otherwise, processing can be done as with +.Li BOUND . +.It Li REBIND The DHCP client has rebound to a new DHCP server. -This can be handled as with RENEW, except that if the IP address has changed, +This can be handled as with +.Li RENEW , +except that if the IP address has changed, the ARP table should be cleared. -.It REBOOT +.It Li REBOOT The DHCP client has successfully reacquired its old address after a reboot. -This can be processed as with BOUND. -.It EXPIRE +This can be processed as with +.Li BOUND . +.It Li EXPIRE The DHCP client has failed to renew its lease or acquire a new one, and the lease has expired. The IP address must be relinquished, and all related parameters should be -deleted, as in RENEW and REBIND. -.It FAIL +deleted, as in +.Li RENEW +and +.Li REBIND . +.It Li FAIL The DHCP client has been unable to contact any DHCP servers, and any leases that have been tested have not proved to be valid. The parameters from the last lease tested should be deconfigured. -This can be handled in the same way as EXPIRE. -.It TIMEOUT +This can be handled in the same way as +.Li EXPIRE . +.It Li TIMEOUT The DHCP client has been unable to contact any DHCP servers. However, an old lease has been identified, and its parameters have -been passed in as with BOUND. +been passed in as with +.Li BOUND . The client configuration script should test these parameters and, if it has reason to believe they are valid, should exit with a value of zero. If not, it should exit with a nonzero value. .El .Pp -The usual way to test a lease is to set up the network as with REBIND +The usual way to test a lease is to set up the network as with +.Li REBIND (since this may be called to test more than one lease) and then ping the first router defined in .Va $routers . @@ -221,6 +245,7 @@ .Xr dhcpd 8 , .Xr dhcrelay 8 .Sh AUTHORS +.An -nosplit The original version of .Nm was written for the Internet Software Consortium by @@ -234,13 +259,15 @@ was written by .An Kenneth R. Westerback Aq krw@openbsd.org . .Sh BUGS -If more than one interface is being used, there's no obvious way to -avoid clashes between server-supplied configuration parameters \- for -example, the stock dhclient-script rewrites +If more than one interface is being used, there is no obvious way to +avoid clashes between server-supplied configuration parameters - for +example, the stock +.Nm +rewrites .Pa /etc/resolv.conf . If more than one interface is being configured, .Pa /etc/resolv.conf will be repeatedly initialized to the values provided by one server, and then the other. -Assuming the information provided by both servers is valid, this shouldn't +Assuming the information provided by both servers is valid, this should not cause any real problems, but it could be confusing. ==== //depot/projects/hammer/sbin/dhclient/dhclient.8#2 (text+ko) ==== @@ -35,12 +35,15 @@ .\" Enterprises. To learn more about the Internet Software Consortium, .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. +.\" +.\" $FreeBSD: src/sbin/dhclient/dhclient.8,v 1.2 2005/06/22 14:55:59 ru Exp $ +.\" .Dd April 7, 2004 .Dt DHCLIENT 8 .Os .Sh NAME .Nm dhclient -.Nd Dynamic Host Configuration Protocol (DHCP) Client +.Nd "Dynamic Host Configuration Protocol (DHCP) client" .Sh SYNOPSIS .Nm .Op Fl dqu @@ -59,7 +62,7 @@ configure must be specified on the command line. .Pp The options are as follows: -.Bl -tag -width "-p port" +.Bl -tag -width ".Fl c Ar file" .It Fl c Ar file Specify an alternate location, .Ar file , @@ -110,11 +113,12 @@ restarts, .Nm keeps a list of leases it has been assigned in the -.Pa /var/db/dhclient.leases.IFNAME +.Pa /var/db/dhclient.leases. Ns Ar IFNAME file. -.Qq IFNAME +.Ar IFNAME represents the network interface of the DHCP client -.Pq e.g. em0 , +(e.g., +.Li em0 ) , one for each interface. On startup, after reading the .Xr dhclient.conf 5 @@ -128,7 +132,7 @@ is first invoked (generally during the initial system boot process). In that event, old leases from the -.Pa dhclient.leases.IFNAME +.Pa dhclient.leases. Ns Ar IFNAME file which have not yet expired are tested, and if they are determined to be valid, they are used until either they expire or the DHCP server becomes available. @@ -149,18 +153,20 @@ than cycling through the list of old leases. .Sh NOTES You must have the Berkeley Packet Filter (BPF) configured in your kernel. +The .Nm +utility requires at least one .Pa /dev/bpf* -file for each broadcast network interface that is attached to your system. +device for each broadcast network interface that is attached to your system. See .Xr bpf 4 for more information. .Sh FILES -.Bl -tag -width /var/db/dhclient.leases.IFNAME~ -compact +.Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME" -compact .It Pa /etc/dhclient.conf DHCP client configuration file -.It Pa /var/db/dhclient.leases.IFNAME +.It Pa /var/db/dhclient.leases. Ns Ar IFNAME database of acquired leases .El .Sh SEE ALSO @@ -171,7 +177,10 @@ .Xr dhcpd 8 , .Xr dhcrelay 8 .Sh AUTHORS +.An -nosplit +The .Nm +utility was written by .An Ted Lemon Aq mellon@fugue.com and ==== //depot/projects/hammer/sbin/dhclient/dhclient.conf.5#2 (text+ko) ==== @@ -36,6 +36,8 @@ .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. .\" +.\" $FreeBSD: src/sbin/dhclient/dhclient.conf.5,v 1.2 2005/06/22 14:55:59 ru Exp $ +.\" .Dd January 1, 1997 .Dt DHCLIENT.CONF 5 .Os @@ -58,7 +60,7 @@ Keywords in the file are case-insensitive. Comments may be placed anywhere within the file (except within quotes). Comments begin with the -.Sq # +.Ql # character and end at the end of the line. .Pp The @@ -70,23 +72,23 @@ the server, or values to prepend or append to information provided by the server. The configuration file can also be preinitialized with addresses to -use on networks that don't have DHCP servers. +use on networks that do not have DHCP servers. .Sh PROTOCOL TIMING The timing behaviour of the client need not be configured by the user. If no timing configuration is provided by the user, a fairly -reasonable timing behaviour will be used by default \- one which +reasonable timing behaviour will be used by default - one which results in fairly timely updates without placing an inordinate load on the server. .Pp The following statements can be used to adjust the timing behaviour of the DHCP client if required, however: -.Bl -tag -width Ds +.Bl -tag -width indent .It Ic timeout Ar time ; The .Ic timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the -time that it decides that it's not going to be able to contact a server. +time that it decides that it is not going to be able to contact a server. By default, this timeout is sixty seconds. After the timeout has passed, if there are any static leases defined in the configuration file, or any leases remaining in the lease database that @@ -122,7 +124,7 @@ .Pp By default, the .Ic select-timeout -is zero seconds \- that is, the client will take the first offer it sees. +is zero seconds - that is, the client will take the first offer it sees. .It Ic reboot Ar time ; When the client is restarted, it first tries to reacquire the last address it had. @@ -151,7 +153,9 @@ server and the second attempt to reach a server. Each time a message is sent, the interval between messages is incremented by twice the current interval multiplied by a random number between zero and one. -If it is greater than the backoff-cutoff amount, it is set to that +If it is greater than the +.Ic backoff-cutoff +amount, it is set to that amount. It defaults to ten seconds. .El @@ -160,7 +164,7 @@ specific information, and not send it other information that it is not prepared to accept. The protocol also allows the client to reject offers from servers if they -don't contain information the client needs, or if the information provided +do not contain information the client needs, or if the information provided is not satisfactory. .Pp There is a variety of data contained in offers that DHCP servers send @@ -169,29 +173,20 @@ .Em DHCP Options . DHCP Options are defined in .Xr dhcp-options 5 . -.Bl -tag -width Ds -.It Xo -.Ic request Op Ar option -.Oo , Ar ... option Oc ; -.Xc +.Bl -tag -width indent +.It Ic request Oo Ar option Oc Oo , Ar ... option Oc ; The .Ic request statement causes the client to request that any server responding to the client send the client its values for the specified options. -Only the option names should be specified in the request statement \- not +Only the option names should be specified in the request statement - not option parameters. -.It Xo -.Ic require Op Ar option -.Oo , Ar ... option Oc ; -.Xc +.It Ic require Oo Ar option Oc Oo , Ar ... option Oc ; The .Ic require statement lists options that must be sent in order for an offer to be accepted. Offers that do not contain all the listed options will be ignored. -.It Xo -.Ic send No { Op Ar option declaration -.Oo , Ar ... option declaration Oc } -.Xc +.It Ic send No { Oo Ar option declaration Oc Oo , Ar ... option declaration Oc } The .Ic send statement causes the client to send the specified options to the server with @@ -213,7 +208,7 @@ It may also receive information which is useful, but which needs to be supplemented with local information. To handle these needs, several option modifiers are available. -.Bl -tag -width Ds +.Bl -tag -width indent .It Xo .Ic default No { Op Ar option declaration .Oo , Ar ... option declaration Oc } @@ -245,7 +240,7 @@ .Ic prepend statement can only be used for options which allow more than one value to be given. -This restriction is not enforced \- if violated, the results are unpredictable. +This restriction is not enforced - if violated, the results are unpredictable. .It Xo .Ic append No { Op Ar option declaration .Oo , Ar ... option declaration Oc } @@ -259,16 +254,13 @@ .Ic append statement can only be used for options which allow more than one value to be given. -This restriction is not enforced \- if you ignore it, +This restriction is not enforced - if you ignore it, the behaviour will be unpredictable. .El .Sh LEASE DECLARATIONS The lease declaration: .Pp -.Xo -.Ic \ \& lease No { Ar lease-declaration -.Oo Ar ... lease-declaration Oc } -.Xc +.D1 Ic lease No { Ar lease-declaration Oo Ar ... lease-declaration Oc } .Pp The DHCP client may decide after some period of time (see .Sx PROTOCOL TIMING ) @@ -293,11 +285,13 @@ file. Such syntax is documented here for completeness. .Pp -A lease statement consists of the lease keyword, followed by a left +A lease statement consists of the +.Ic lease +keyword, followed by a left curly brace, followed by one or more lease declaration statements, followed by a right curly brace. The following lease declarations are possible: -.Bl -tag -width Ds +.Bl -tag -width indent .It Ic bootp ; The .Ic bootp @@ -305,7 +299,7 @@ BOOTP protocol rather than the DHCP protocol. It is never necessary to specify this in the client configuration file. The client uses this syntax in its lease database file. -.It Ic interface Ar \&"string\&" ; +.It Ic interface Qq Ar string ; The .Ic interface lease statement is used to indicate the interface on which the lease is valid. @@ -320,14 +314,15 @@ .Ic fixed-address statement is used to set the IP address of a particular lease. This is required for all lease statements. -The IP address must be specified as a dotted quad (e.g., 12.34.56.78). -.It Ic filename Ar \&"string\&" ; +The IP address must be specified as a dotted quad (e.g., +.Li 12.34.56.78 ) . +.It Ic filename Qq Ar string ; The .Ic filename statement specifies the name of the boot filename to use. This is not used by the standard client configuration script, but is included for completeness. -.It Ic server-name Ar \&"string\&" ; +.It Ic server-name Qq Ar string ; The .Ic server-name statement specifies the name of the boot server name to use. @@ -337,10 +332,10 @@ .Ic option statement is used to specify the value of an option supplied by the server, or, in the case of predefined leases declared in -.Nm dhclient.conf , +.Nm , the value that the user wishes the client configuration script to use if the predefined lease is used. -.It Ic script Ar \&"script-name\&" ; +.It Ic script Qq Ar script-name ; The .Ic script statement is used to specify the pathname of the DHCP client configuration @@ -353,16 +348,22 @@ any, and also called once if no valid lease can be identified. For more information, see .Xr dhclient.leases 5 . -.It Ic medium Ar \&"media setup\&" ; +.It Ic medium Qq Ar "media setup" ; The .Ic medium statement can be used on systems where network interfaces cannot automatically determine the type of network to which they are connected. -The media setup string is a system-dependent parameter which is passed +The +.Ar "media setup" +string is a system-dependent parameter which is passed to the DHCP client configuration script when initializing the interface. On .Ux -and UNIX-like systems, the argument is passed on the ifconfig command line +and +.Ux Ns -like +systems, the argument is passed on the +.Xr ifconfig 8 +command line when configuring the interface. .Pp The DHCP client automatically declares this parameter if it used a @@ -391,20 +392,21 @@ .El .Pp These declarations are automatically set in leases acquired by the -DHCP client, but must also be configured in predefined leases \- a +DHCP client, but must also be configured in predefined leases - a predefined lease whose expiry time has passed will not be used by the DHCP client. .Pp Dates are specified as follows: -.Pp -.Ar \ \& +.Bd -ragged -offset indent +.Ar .Sm off .Ar No / Ar No / Ar .Ar : : .Sm on +.Ed .Pp The weekday is present to make it easy for a human to tell when a -lease expires \- it's specified as a number from zero to six, with zero +lease expires - it is specified as a number from zero to six, with zero being Sunday. When declaring a predefined lease, it can always be specified as zero. The year is specified with the century, so it should generally be four @@ -421,7 +423,7 @@ addition to the lease they may acquire via DHCP, their interface also be configured with a predefined IP alias so that they can have a permanent IP address even while roaming. -The Internet Software Consortium DHCP client doesn't support roaming with +The Internet Software Consortium DHCP client does not support roaming with fixed addresses directly, but in order to facilitate such experimentation, the DHCP client can be set up to configure an IP alias using the .Ic alias @@ -436,19 +438,16 @@ declaration for the IP alias address, and a subnet-mask option declaration. A medium statement should never be included in an alias declaration. .Sh OTHER DECLARATIONS -.Bl -tag -width Ds +.Bl -tag -width indent .It Ic reject Ar ip-address ; The .Ic reject statement causes the DHCP client to reject offers from servers who use the specified address as a server identifier. This can be used to avoid being configured by rogue or misconfigured DHCP -servers, although it should be a last resort \- better to track down +servers, although it should be a last resort - better to track down the bad DHCP server and fix it. -.It Xo -.Ic interface Ar \&"name\&" No { Ar declarations -.Ar ... No } -.Xc +.It Ic interface Qo Ar name Qc { Ar declarations ... No } A client with more than one network interface may require different behaviour depending on which interface is being configured. All timing parameters and declarations other than lease and alias @@ -458,10 +457,7 @@ Interfaces for which there is no interface declaration will use the parameters declared outside of any interface declaration, or the default settings. -.It Xo -.Ic media Ar \&"media setup\&" -.Oo , Ar \&"media setup\&" , ... Oc ; -.Xc +.It Ic media Qo Ar "media setup" Qc Oo , Qo Ar "media setup" Qc , Ar ... Oc ; The .Ic media statement defines one or more media configuration parameters which may @@ -469,8 +465,8 @@ The DHCP client will cycle through each media setup string on the list, configuring the interface using that setup and attempting to boot, and then trying the next one. -This can be used for network interfaces which aren't capable of sensing -the media type unaided \- whichever media type succeeds in getting a request +This can be used for network interfaces which are not capable of sensing +the media type unaided - whichever media type succeeds in getting a request to the server and hearing the reply is probably right (no guarantees). .Pp The media setup is only used for the initial phase of address @@ -483,8 +479,11 @@ .El .Sh EXAMPLES The following configuration file is used on a laptop -which has an IP alias of 192.5.5.213, and has one interface, -ep0 (a 3Com 3C589C). +which has an IP alias of +.Li 192.5.5.213 , +and has one interface, +.Li ep0 +(a 3Com 3C589C). Booting intervals have been shortened somewhat from the default, because the client is known to spend most of its time on networks with little DHCP activity. @@ -519,20 +518,24 @@ .Pp This is a very complicated .Nm -file \- in general, yours should be much simpler. -In many cases, it's sufficient to just create an empty +file - in general, yours should be much simpler. +In many cases, it is sufficient to just create an empty .Nm -file \- the defaults are usually fine. +file - the defaults are usually fine. .Sh SEE ALSO .Xr dhclient.leases 5 , +.Xr dhcpd.conf 5 , .Xr dhcp-options 5 , -.Xr dhcpd.conf 5 , .Xr dhclient 8 , .Xr dhcpd 8 -.Pp -RFC 2132, RFC 2131. +.Rs +.%R "RFC 2132, RFC 2131" +.Re .Sh AUTHORS +.An -nosplit +The .Xr dhclient 8 +utility was written by .An Ted Lemon Aq mellon@vix.com under a contract with Vixie Labs. ==== //depot/projects/hammer/sbin/dhclient/dhclient.leases.5#2 (text+ko) ==== @@ -36,6 +36,8 @@ .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. .\" +.\" $FreeBSD: src/sbin/dhclient/dhclient.leases.5,v 1.2 2005/06/22 14:55:59 ru Exp $ +.\" .Dd January 1, 1997 .Dt DHCLIENT.LEASES 5 .Os @@ -52,33 +54,39 @@ The file is written as a log, so this is not an unusual occurrence. .Pp The lease file is named -.Qq dhclient.leases.IFNAME , +.Pa dhclient.leases. Ns Ar IFNAME , where -.Qq IFNAME +.Ar IFNAME represents the network interface the DHCP client acquired the lease on. For example, if .Xr dhclient 8 -is configured for the em0 network device, +is configured for the +.Li em0 +network device, the lease file will be named -.Qq dhclient.leases.em0 . +.Pa dhclient.leases.em0 . .Pp The format of the lease declarations is described in .Xr dhclient.conf 5 . .Sh FILES -.Bl -tag -width "/var/db/dhclient.leases.IFNAME " -.It /var/db/dhclient.leases.IFNAME +.Bl -tag -width ".Pa /var/db/dhclient.leases. Ns Ar IFNAME" +.It Pa /var/db/dhclient.leases. Ns Ar IFNAME Current lease file. .El .Sh SEE ALSO .Xr dhclient.conf 5 , +.Xr dhcpd.conf 5 , .Xr dhcp-options 5 , -.Xr dhcpd.conf 5 , .Xr dhclient 8 , .Xr dhcpd 8 -.Pp -RFC 2132, RFC 2131. +.Rs +.%R "RFC 2132, RFC 2131" +.Re .Sh AUTHORS +.An -nosplit +The .Xr dhclient 8 +utility was written by .An Ted Lemon Aq mellon@vix.com under a contract with Vixie Labs. ==== //depot/projects/hammer/sbin/dhclient/dhcp-options.5#2 (text+ko) ==== @@ -36,6 +36,8 @@ .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. .\" +.\" $FreeBSD: src/sbin/dhclient/dhcp-options.5,v 1.2 2005/06/22 14:55:59 ru Exp $ +.\" .Dd January 1, 1995 .Dt DHCP-OPTIONS 5 .Os >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Thu Jun 23 23:04:26 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0DB3016A421; Thu, 23 Jun 2005 23:04:26 +0000 (GMT) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA34316A41C; Thu, 23 Jun 2005 23:04:25 +0000 (GMT) (envelope-from peter@wemm.org) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 919DC43D53; Thu, 23 Jun 2005 23:04:25 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 4C29B2A8DA; Thu, 23 Jun 2005 16:04:25 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id F239EE2B3; Thu, 23 Jun 2005 16:04:24 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.3/8.13.1) with ESMTP id j5NN4NiW056211; Thu, 23 Jun 2005 16:04:23 -0700 (PDT) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.3/8.13.1/Submit) id j5NN4NWt056210; Thu, 23 Jun 2005 16:04:23 -0700 (PDT) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: John Baldwin Date: Thu, 23 Jun 2005 16:04:22 -0700 User-Agent: KMail/1.8 References: <200506222312.j5MNChMh079831@repoman.freebsd.org> <200506231444.08027.jhb@FreeBSD.org> In-Reply-To: <200506231444.08027.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506231604.23036.peter@wemm.org> Cc: Perforce Change Reviews , Peter Wemm Subject: Re: PERFORCE change 78828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 23:04:26 -0000 On Thursday 23 June 2005 11:44 am, John Baldwin wrote: > On Wednesday 22 June 2005 07:12 pm, Peter Wemm wrote: > > http://perforce.freebsd.org/chv.cgi?CH=78828 > > > > Change 78828 by peter@peter_melody on 2005/06/22 23:12:33 > > > > Freeze things for the dump snapshot. > > This may be a bad idea since we may panic with sched_lock held and it > would be very nice to get a dump there and not just deadlock. Yeah. I'm really not sure what to do though because with interrupts still happening, it upsets some of the driver dump routines. eg: when you call this from ddb. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Thu Jun 23 23:16:44 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 390D016A420; Thu, 23 Jun 2005 23:16:44 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11D2F16A41C for ; Thu, 23 Jun 2005 23:16:44 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D99D943D1F for ; Thu, 23 Jun 2005 23:16:43 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5NNGhan081171 for ; Thu, 23 Jun 2005 23:16:43 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5NNGh3g081168 for perforce@freebsd.org; Thu, 23 Jun 2005 23:16:43 GMT (envelope-from peter@freebsd.org) Date: Thu, 23 Jun 2005 23:16:43 GMT Message-Id: <200506232316.j5NNGh3g081168@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78881 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2005 23:16:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=78881 Change 78881 by peter@peter_daintree on 2005/06/23 23:15:52 Merge i386_hammer changes Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/identcpu.c#42 integrate .. //depot/projects/hammer/sys/amd64/amd64/initcpu.c#12 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#53 integrate .. //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#23 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#64 integrate .. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#73 integrate .. //depot/projects/hammer/sys/amd64/conf/NOTES#70 integrate .. //depot/projects/hammer/sys/amd64/include/md_var.h#32 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/identcpu.c#42 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/initcpu.c#12 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#53 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#23 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/trap.c#64 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#73 (text+ko) ==== @@ -206,14 +206,14 @@ void cpu_thread_exit(struct thread *td) { - struct pcb *pcb = td->td_pcb; if (td == PCPU_GET(fpcurthread)) fpudrop(); - if (pcb->pcb_flags & PCB_DBREGS) { - /* disable all hardware breakpoints */ + + /* Disable any hardware breakpoints. */ + if (td->td_pcb->pcb_flags & PCB_DBREGS) { reset_dbregs(); - pcb->pcb_flags &= ~PCB_DBREGS; + td->td_pcb->pcb_flags &= ~PCB_DBREGS; } } ==== //depot/projects/hammer/sys/amd64/conf/NOTES#70 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# (XXX from i386:NOTES,v 1.1200) +# (XXX from i386:NOTES,v 1.1201) # $FreeBSD: src/sys/amd64/conf/NOTES,v 1.35 2005/06/14 14:21:25 ups Exp $ # @@ -108,12 +108,6 @@ ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS -# -# Add support for the ReiserFS filesystem (used in Linux). Currently, -# this is limited to read-only access. -# -options REISERFS - device gzip #Exec gzipped a.out's. REQUIRES COMPAT_AOUT! ==== //depot/projects/hammer/sys/amd64/include/md_var.h#32 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Fri Jun 24 00:04:42 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 567BB16A420; Fri, 24 Jun 2005 00:04:42 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28FD416A41C for ; Fri, 24 Jun 2005 00:04:42 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F081843D1F for ; Fri, 24 Jun 2005 00:04:41 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5O04fm4085893 for ; Fri, 24 Jun 2005 00:04:41 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5O04fld085890 for perforce@freebsd.org; Fri, 24 Jun 2005 00:04:41 GMT (envelope-from peter@freebsd.org) Date: Fri, 24 Jun 2005 00:04:41 GMT Message-Id: <200506240004.j5O04fld085890@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78882 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 00:04:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=78882 Change 78882 by peter@peter_daintree on 2005/06/24 00:04:30 Turn this off again. It probably just needs to be intr_disable()/intr_restore(), but I don't have more time to mess with it. Affected files ... .. //depot/projects/hammer/sys/kern/kern_shutdown.c#36 edit Differences ... ==== //depot/projects/hammer/sys/kern/kern_shutdown.c#36 (text+ko) ==== @@ -230,12 +230,10 @@ return; } - mtx_lock_spin(&sched_lock); savectx(&dumppcb); dumptid = curthread->td_tid; dumping++; dumpsys(&dumper); - mtx_unlock_spin(&sched_lock); } /* From owner-p4-projects@FreeBSD.ORG Fri Jun 24 02:53:07 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3EC5116A420; Fri, 24 Jun 2005 02:53:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B55416A41C for ; Fri, 24 Jun 2005 02:53:07 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD60243D48 for ; Fri, 24 Jun 2005 02:53:06 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5O2r6xt099148 for ; Fri, 24 Jun 2005 02:53:06 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5O2r6ls099145 for perforce@freebsd.org; Fri, 24 Jun 2005 02:53:06 GMT (envelope-from peter@freebsd.org) Date: Fri, 24 Jun 2005 02:53:06 GMT Message-Id: <200506240253.j5O2r6ls099145@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 78888 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 02:53:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=78888 Change 78888 by peter@peter_daintree on 2005/06/24 02:52:33 IFC @78887 Affected files ... .. //depot/projects/hammer/gnu/usr.bin/gdb/kgdb/main.c#7 integrate .. //depot/projects/hammer/lib/libkvm/kvm_proc.c#31 integrate .. //depot/projects/hammer/sys/amd64/amd64/exception.S#39 integrate .. //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#38 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#54 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#129 integrate .. //depot/projects/hammer/sys/amd64/amd64/support.S#31 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#65 integrate .. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#74 integrate .. //depot/projects/hammer/sys/conf/options#78 integrate .. //depot/projects/hammer/sys/i386/i386/local_apic.c#17 integrate .. //depot/projects/hammer/sys/i386/i386/trap.c#34 integrate .. //depot/projects/hammer/sys/kern/kern_clock.c#26 integrate .. //depot/projects/hammer/sys/kern/kern_exec.c#51 integrate .. //depot/projects/hammer/sys/kern/sched_4bsd.c#40 integrate .. //depot/projects/hammer/sys/kern/sched_ule.c#61 integrate Differences ... ==== //depot/projects/hammer/gnu/usr.bin/gdb/kgdb/main.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/main.c,v 1.6 2005/03/02 18:40:04 marcel Exp $"); +__FBSDID("$FreeBSD: src/gnu/usr.bin/gdb/kgdb/main.c,v 1.7 2005/06/24 00:50:12 peter Exp $"); #include #include ==== //depot/projects/hammer/lib/libkvm/kvm_proc.c#31 (text+ko) ==== @@ -42,7 +42,7 @@ #endif #include -__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.86 2005/03/20 10:37:56 pjd Exp $"); +__FBSDID("$FreeBSD: src/lib/libkvm/kvm_proc.c,v 1.87 2005/06/24 00:37:04 peter Exp $"); /* * Proc traversal interface for kvm. ps and w are (probably) the exclusive ==== //depot/projects/hammer/sys/amd64/amd64/exception.S#39 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.123 2005/05/22 23:28:17 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.124 2005/06/24 00:38:36 peter Exp $ */ #include "opt_atpic.h" ==== //depot/projects/hammer/sys/amd64/amd64/intr_machdep.c#38 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.14 2005/04/12 23:18:53 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.15 2005/06/24 00:45:01 peter Exp $ */ /* ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#54 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.15 2005/05/22 16:32:02 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.17 2005/06/24 00:45:01 peter Exp $"); #include "opt_hwpmc_hooks.h" ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#129 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.636 2005/05/05 18:19:53 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.637 2005/06/24 00:45:01 peter Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" ==== //depot/projects/hammer/sys/amd64/amd64/support.S#31 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.114 2005/04/10 18:12:07 alc Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.115 2005/06/24 00:45:01 peter Exp $ */ #include "opt_ddb.h" ==== //depot/projects/hammer/sys/amd64/amd64/trap.c#65 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.286 2005/05/30 06:29:28 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.287 2005/06/24 00:16:56 peter Exp $"); /* * AMD64 Trap and System call handling ==== //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#74 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.246 2005/04/23 02:32:30 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.247 2005/06/24 00:29:53 peter Exp $"); #include "opt_isa.h" #include "opt_cpu.h" ==== //depot/projects/hammer/sys/conf/options#78 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.507 2005/06/21 10:17:54 dumbbell Exp $ +# $FreeBSD: src/sys/conf/options,v 1.508 2005/06/24 00:16:57 peter Exp $ # # On the handling of kernel options # ==== //depot/projects/hammer/sys/i386/i386/local_apic.c#17 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.16 2005/04/19 04:01:23 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/local_apic.c,v 1.17 2005/06/24 00:16:57 peter Exp $"); #include "opt_hwpmc_hooks.h" ==== //depot/projects/hammer/sys/i386/i386/trap.c#34 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.274 2005/05/30 06:29:28 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.275 2005/06/24 00:16:57 peter Exp $"); /* * 386 Trap and System call handling ==== //depot/projects/hammer/sys/kern/kern_clock.c#26 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_clock.c,v 1.175 2005/05/30 06:29:29 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_clock.c,v 1.176 2005/06/24 00:16:57 peter Exp $"); #include "opt_compat.h" #include "opt_hwpmc_hooks.h" ==== //depot/projects/hammer/sys/kern/kern_exec.c#51 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.273 2005/06/09 19:45:08 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.274 2005/06/24 00:16:57 peter Exp $"); #include "opt_hwpmc_hooks.h" #include "opt_ktrace.h" ==== //depot/projects/hammer/sys/kern/sched_4bsd.c#40 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.76 2005/06/09 19:43:08 ups Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.77 2005/06/24 00:16:57 peter Exp $"); #include "opt_hwpmc_hooks.h" ==== //depot/projects/hammer/sys/kern/sched_ule.c#61 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.152 2005/06/07 02:59:16 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sched_ule.c,v 1.153 2005/06/24 00:16:57 peter Exp $"); #include "opt_hwpmc_hooks.h" #include "opt_sched.h" From owner-p4-projects@FreeBSD.ORG Fri Jun 24 12:02:04 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EA60D16A420; Fri, 24 Jun 2005 12:02:03 +0000 (GMT) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AADDB16A41F for ; Fri, 24 Jun 2005 12:02:03 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from mail21.sea5.speakeasy.net (mail21.sea5.speakeasy.net [69.17.117.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6923943D55 for ; Fri, 24 Jun 2005 12:02:03 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 22556 invoked from network); 24 Jun 2005 12:02:03 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender ) by mail21.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 24 Jun 2005 12:02:02 -0000 Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j5OC1slO034293; Fri, 24 Jun 2005 08:01:55 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Peter Wemm Date: Fri, 24 Jun 2005 08:01:48 -0400 User-Agent: KMail/1.8 References: <200506222312.j5MNChMh079831@repoman.freebsd.org> <200506231444.08027.jhb@FreeBSD.org> <200506231604.23036.peter@wemm.org> In-Reply-To: <200506231604.23036.peter@wemm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200506240801.49597.jhb@FreeBSD.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx Cc: Perforce Change Reviews , Peter Wemm Subject: Re: PERFORCE change 78828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 12:02:04 -0000 On Thursday 23 June 2005 07:04 pm, Peter Wemm wrote: > On Thursday 23 June 2005 11:44 am, John Baldwin wrote: > > On Wednesday 22 June 2005 07:12 pm, Peter Wemm wrote: > > > http://perforce.freebsd.org/chv.cgi?CH=3D78828 > > > > > > Change 78828 by peter@peter_melody on 2005/06/22 23:12:33 > > > > > > Freeze things for the dump snapshot. > > > > This may be a bad idea since we may panic with sched_lock held and it > > would be very nice to get a dump there and not just deadlock. > > Yeah. I'm really not sure what to do though because with interrupts > still happening, it upsets some of the driver dump routines. eg: when > you call this from ddb. You could just use intr_disable() and intr_restore() directly perhaps? =2D-=20 John Baldwin =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org From owner-p4-projects@FreeBSD.ORG Fri Jun 24 15:52:06 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8DC0C16A420; Fri, 24 Jun 2005 15:52:05 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6110A16A41C for ; Fri, 24 Jun 2005 15:52:05 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 393C043D53 for ; Fri, 24 Jun 2005 15:52:05 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5OFq562055848 for ; Fri, 24 Jun 2005 15:52:05 GMT (envelope-from ps@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5OFq4Wu055845 for perforce@freebsd.org; Fri, 24 Jun 2005 15:52:04 GMT (envelope-from ps@freebsd.org) Date: Fri, 24 Jun 2005 15:52:04 GMT Message-Id: <200506241552.j5OFq4Wu055845@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ps@freebsd.org using -f From: Paul Saab To: Perforce Change Reviews Cc: Subject: PERFORCE change 78910 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 15:52:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=78910 Change 78910 by ps@butter.corp on 2005/06/24 15:51:48 Follow amd64's lead and convert over to ELF crashdumps. Obtained from: peter via amd64 Affected files ... .. //depot/projects/hammer/sys/i386/i386/dump_machdep.c#6 edit .. //depot/projects/hammer/sys/i386/i386/machdep.c#52 edit .. //depot/projects/hammer/sys/i386/include/pmap.h#21 edit Differences ... ==== //depot/projects/hammer/sys/i386/i386/dump_machdep.c#6 (text+ko) ==== @@ -1,40 +1,31 @@ /*- - * Copyright (c) 2002 Poul-Henning Kamp - * Copyright (c) 2002 Networks Associates Technology, Inc. + * Copyright (c) 2002 Marcel Moolenaar * All rights reserved. * - * This software was developed for the FreeBSD Project by Poul-Henning Kamp - * and NAI Labs, the Security Research Division of Network Associates, Inc. - * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the - * DARPA CHATS research program. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The names of the authors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.9 2003/08/25 09:48:46 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/ia64/ia64/dump_machdep.c,v 1.12 2005/01/06 22:18:22 imp Exp $"); #include #include @@ -44,92 +35,353 @@ #include #include #include +#include #include CTASSERT(sizeof(struct kerneldumpheader) == 512); +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +#define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) +#define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) + +struct md_pa { + vm_paddr_t md_start; + vm_paddr_t md_size; +}; + +typedef int callback_t(struct md_pa *, int, void *); + static struct kerneldumpheader kdh; +static off_t dumplo, fileofs; -void -dumpsys(struct dumperinfo *di) +/* Handle buffered writes. */ +static char buffer[DEV_BSIZE]; +static size_t fragsz; + +/* 20 phys_avail entry pairs correspond to 10 md_pa's */ +static struct md_pa dump_avail[10]; + +static void +md_pa_init(void) +{ + int n, idx; + + bzero(&dump_avail, sizeof(dump_avail)); + for (n = 0; n < sizeof(dump_avail) / sizeof(dump_avail[0]); n++) { + idx = n * 2; + if (phys_avail[idx] == 0 && phys_avail[idx + 1] == 0) + break; + dump_avail[n].md_start = phys_avail[idx]; + dump_avail[n].md_size = phys_avail[idx + 1] - phys_avail[idx]; + if (dump_avail[n].md_start == kernphys[1]) { + /* Include the kernel, that would be helpful! */ + dump_avail[n].md_start = kernphys[0]; + dump_avail[n].md_size += kernphys[1] - kernphys[0]; + } + if (dump_avail[n].md_start == PAGE_SIZE) { + /* Include page zero */ + dump_avail[n].md_start = 0; + dump_avail[n].md_size += PAGE_SIZE; + } + if (dump_avail[n].md_start == 0 && dump_avail[n].md_size >= 0x98000) { + /* Include mpboot code and/or bios EBDA */ + dump_avail[n].md_size = 0xA0000; + } + if (phys_avail[idx + 1] == avail_end) { + /* Include msgbuf, that would be helpful! */ + dump_avail[n].md_size += (Maxmem << PAGE_SHIFT) - avail_end; + } + } +} + +static struct md_pa * +md_pa_first(void) +{ + + return (&dump_avail[0]); +} + +static struct md_pa * +md_pa_next(struct md_pa *mdp) { - off_t dumplo; - vm_offset_t a, addr; - u_int count, left, u; - void *va; - int i, mb; - int c; + + mdp++; + if (mdp->md_size == 0) + mdp = NULL; + return (mdp); +} - printf("Dumping %ld MB\n", Maxmem / (1024*1024 / PAGE_SIZE)); +/* XXX should be MI */ +static void +mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen, + uint32_t blksz) +{ - /* Fill in the kernel dump header */ - strcpy(kdh.magic, KERNELDUMPMAGIC); - strcpy(kdh.architecture, "i386"); - kdh.version = htod32(KERNELDUMPVERSION); - kdh.architectureversion = htod32(KERNELDUMP_I386_VERSION); - kdh.dumplength = htod64(Maxmem * (off_t)PAGE_SIZE); - kdh.dumptime = htod64(time_second); - kdh.blocksize = htod32(di->blocksize); - strncpy(kdh.hostname, hostname, sizeof kdh.hostname); - strncpy(kdh.versionstring, version, sizeof kdh.versionstring); + bzero(kdh, sizeof(*kdh)); + strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic)); + strncpy(kdh->architecture, MACHINE_ARCH, sizeof(kdh->architecture)); + kdh->version = htod32(KERNELDUMPVERSION); + kdh->architectureversion = htod32(archver); + kdh->dumplength = htod64(dumplen); + kdh->dumptime = htod64(time_second); + kdh->blocksize = htod32(blksz); + strncpy(kdh->hostname, hostname, sizeof(kdh->hostname)); + strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); if (panicstr != NULL) - strncpy(kdh.panicstring, panicstr, sizeof kdh.panicstring); - kdh.parity = kerneldump_parity(&kdh); + strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring)); + kdh->parity = kerneldump_parity(kdh); +} + +static int +buf_write(struct dumperinfo *di, char *ptr, size_t sz) +{ + size_t len; + int error; - /* - * Check if we will have enough room to save the coredump. - * The partition size needed is the sum of: - * Memory to save + header + trailer + Room to leave untouched - * at partition head. (an arbitrary amount). - */ - if (di->mediasize < - Maxmem * (off_t)PAGE_SIZE + sizeof kdh * 2 + 64*1024) { - printf("\nDump failed. Partition too small.\n"); - return; + while (sz) { + len = DEV_BSIZE - fragsz; + if (len > sz) + len = sz; + bcopy(ptr, buffer + fragsz, len); + fragsz += len; + ptr += len; + sz -= len; + if (fragsz == DEV_BSIZE) { + error = di->dumper(di->priv, buffer, 0, dumplo, + DEV_BSIZE); + if (error) + return error; + dumplo += DEV_BSIZE; + fragsz = 0; + } } - dumplo = di->mediaoffset + di->mediasize - Maxmem * (off_t)PAGE_SIZE; - dumplo -= sizeof kdh * 2; - i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh); - if (i) - printf("\nDump failed writing header (%d)\n", i); - dumplo += sizeof kdh; - i = 0; - addr = 0; + + return (0); +} + +static int +buf_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = di->dumper(di->priv, buffer, 0, dumplo, DEV_BSIZE); + dumplo += DEV_BSIZE; + return (error); +} + +#define PG2MB(pgs) ((pgs + (1 << 8) - 1) >> 8) + +static int +cb_dumpdata(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + vm_paddr_t a, pa; + void *va; + uint64_t pgs; + size_t counter, sz, chunk; + int i, c, error, twiddle; + + error = 0; /* catch case in which chunk size is 0 */ + counter = 0; /* Update twiddle every 16MB */ + twiddle = 0; va = 0; - mb = 0; - for (count = 0; count < Maxmem;) { - left = Maxmem - count; - if (left > MAXDUMPPGS) - left = MAXDUMPPGS; - for (u = 0; u < left; u++) { - a = addr + u * PAGE_SIZE; - if (!is_physical_memory(a)) - a = 0; - va = pmap_kenter_temporary(trunc_page(a), u); + pgs = mdp->md_size / PAGE_SIZE; + pa = mdp->md_start; + + printf(" chunk %d: %lldMB (%lld pages)", seqnr, PG2MB(pgs), pgs); + + while (pgs) { + chunk = pgs; + if (chunk > MAXDUMPPGS) + chunk = MAXDUMPPGS; + sz = chunk << PAGE_SHIFT; + counter += sz; + if (counter >> 24) { + printf(" %lld", PG2MB(pgs)); + counter &= (1<<24) - 1; } - i = count / (16*1024*1024 / PAGE_SIZE); - if (i != mb) { - printf(" %d", count / (1024 * 1024 / PAGE_SIZE)); - mb = i; + for (i = 0; i < chunk; i++) { + a = pa + i * PAGE_SIZE; + va = pmap_kenter_temporary(trunc_page(a), i); } - i = di->dumper(di->priv, va, 0, dumplo, left * PAGE_SIZE); - if (i) + error = di->dumper(di->priv, va, 0, dumplo, sz); + if (error) break; - count += left; - dumplo += left * PAGE_SIZE; - addr += left * PAGE_SIZE; - if ((c = cncheckc()) == 0x03) { - printf("\nDump aborted.\n"); - return; - } else if (c != -1) - printf("[CTRL-C to abort] "); + dumplo += sz; + pgs -= chunk; + pa += sz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + printf(" ... %s\n", (error) ? "fail" : "ok"); + return (error); +} + +static int +cb_dumphdr(struct md_pa *mdp, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + Elf_Phdr phdr; + uint64_t size; + int error; + + size = mdp->md_size; + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = mdp->md_start; + phdr.p_paddr = mdp->md_start; + phdr.p_filesz = size; + phdr.p_memsz = size; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); +} + +static int +cb_size(struct md_pa *mdp, int seqnr, void *arg) +{ + uint64_t *sz = (uint64_t*)arg; + + *sz += (uint64_t)mdp->md_size; + return (0); +} + +static int +foreach_chunk(callback_t cb, void *arg) +{ + struct md_pa *mdp; + int error, seqnr; + + seqnr = 0; + mdp = md_pa_first(); + while (mdp != NULL) { + error = (*cb)(mdp, seqnr++, arg); + if (error) + return (-error); + mdp = md_pa_next(mdp); + } + return (seqnr); +} + +void +dumpsys(struct dumperinfo *di) +{ + Elf_Ehdr ehdr; + uint64_t dumpsize; + off_t hdrgap; + size_t hdrsz; + int error; + + bzero(&ehdr, sizeof(ehdr)); + ehdr.e_ident[EI_MAG0] = ELFMAG0; + ehdr.e_ident[EI_MAG1] = ELFMAG1; + ehdr.e_ident[EI_MAG2] = ELFMAG2; + ehdr.e_ident[EI_MAG3] = ELFMAG3; + ehdr.e_ident[EI_CLASS] = ELF_CLASS; +#if BYTE_ORDER == LITTLE_ENDIAN + ehdr.e_ident[EI_DATA] = ELFDATA2LSB; +#else + ehdr.e_ident[EI_DATA] = ELFDATA2MSB; +#endif + ehdr.e_ident[EI_VERSION] = EV_CURRENT; + ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ + ehdr.e_type = ET_CORE; + ehdr.e_machine = EM_386; + ehdr.e_phoff = sizeof(ehdr); + ehdr.e_flags = 0; + ehdr.e_ehsize = sizeof(ehdr); + ehdr.e_phentsize = sizeof(Elf_Phdr); + ehdr.e_shentsize = sizeof(Elf_Shdr); + + md_pa_init(); + + /* Calculate dump size. */ + dumpsize = 0L; + ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; + fileofs = MD_ALIGN(hdrsz); + dumpsize += fileofs; + hdrgap = fileofs - DEV_ALIGN(hdrsz); + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; } - if (i) - printf("\nDump failed writing data (%d)\n", i); - i = di->dumper(di->priv, &kdh, 0, dumplo, sizeof kdh); - if (i) - printf("\nDump failed writing trailer (%d)\n", i); - di->dumper(di->priv, NULL, 0, 0, 0); /* tell them we are done */ + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + + mkdumpheader(&kdh, KERNELDUMP_I386_VERSION, dumpsize, di->blocksize); + + printf("Dumping %llu MB (%d chunks)\n", (long long)dumpsize >> 20, + ehdr.e_phnum); + + /* Dump leader */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump ELF header */ + error = buf_write(di, (char*)&ehdr, sizeof(ehdr)); + if (error) + goto fail; + + /* Dump program headers */ + error = foreach_chunk(cb_dumphdr, di); + if (error < 0) + goto fail; + buf_flush(di); + + /* + * All headers are written using blocked I/O, so we know the + * current offset is (still) block aligned. Skip the alignement + * in the file to have the segment contents aligned at page + * boundary. We cannot use MD_ALIGN on dumplo, because we don't + * care and may very well be unaligned within the dump device. + */ + dumplo += hdrgap; + + /* Dump memory chunks (updates dumplo) */ + error = foreach_chunk(cb_dumpdata, di); + if (error < 0) + goto fail; + + /* Dump trailer */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + + /* Signal completion, signoff and exit stage left. */ + di->dumper(di->priv, NULL, 0, 0, 0); printf("\nDump complete\n"); return; + + fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else if (error == ENOSPC) + printf("\nDump failed. Partition too small.\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); } ==== //depot/projects/hammer/sys/i386/i386/machdep.c#52 (text+ko) ==== @@ -185,6 +185,7 @@ long realmem = 0; vm_paddr_t phys_avail[10]; +vm_paddr_t kernphys[2]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -1879,6 +1880,12 @@ getenv_quad("dcons.size", &dcons_size) == 0) dcons_addr = 0; + /* + * Keep track of where the kernel lives for crash dumps. + */ + kernphys[0] = KERNLOAD; + kernphys[1] = first; + /* * physmap is in bytes, so when converting to page boundaries, * round up the start address and round down the end address. @@ -1896,7 +1903,7 @@ /* * block out kernel memory as not available. */ - if (pa >= KERNLOAD && pa < first) + if (pa >= kernphys[0] && pa < kernphys[1]) continue; /* ==== //depot/projects/hammer/sys/i386/include/pmap.h#21 (text+ko) ==== @@ -346,6 +346,7 @@ extern pt_entry_t *CMAP1; extern vm_paddr_t avail_end; extern vm_paddr_t phys_avail[]; +extern vm_paddr_t kernphys[]; extern int pseflag; extern int pgeflag; extern char *ptvmmap; /* poor name! */ From owner-p4-projects@FreeBSD.ORG Fri Jun 24 16:19:41 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0773516A42A; Fri, 24 Jun 2005 16:19:40 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97D9416A41F for ; Fri, 24 Jun 2005 16:19:39 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74DE143D53 for ; Fri, 24 Jun 2005 16:19:39 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5OGJdVj058317 for ; Fri, 24 Jun 2005 16:19:39 GMT (envelope-from ps@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5OGJddF058314 for perforce@freebsd.org; Fri, 24 Jun 2005 16:19:39 GMT (envelope-from ps@freebsd.org) Date: Fri, 24 Jun 2005 16:19:39 GMT Message-Id: <200506241619.j5OGJddF058314@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ps@freebsd.org using -f From: Paul Saab To: Perforce Change Reviews Cc: Subject: PERFORCE change 78912 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 16:19:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=78912 Change 78912 by ps@butter.corp on 2005/06/24 16:19:25 checkpoint for new elf crashdump parsing. This does not support PAE yet. Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_i386.c#2 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_i386.c#2 (text+ko) ==== @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,8 @@ #include #include +#include + #include #include "kvm_private.h" @@ -71,36 +74,98 @@ #endif struct vmstate { + void *mmapbase; + size_t mmapsize; pd_entry_t *PTD; }; +/* + * Map the ELF headers into the process' address space. We do this in two + * steps: first the ELF header itself and using that information the whole + * set of headers. (Taken from kvm_ia64.c) + */ +static int +_kvm_maphdrs(kvm_t *kd, size_t sz) +{ + struct vmstate *vm = kd->vmst; + + /* munmap() previous mmap(). */ + if (vm->mmapbase != NULL) { + munmap(vm->mmapbase, vm->mmapsize); + vm->mmapbase = NULL; + } + + vm->mmapsize = sz; + vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->mmapbase == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot mmap corefile"); + return (-1); + } + return (0); +} + +/* + * Translate a physical memory address to a file-offset in the crash-dump. + * (Taken from kvm_ia64.c) + */ +static size_t +_kvm_pa2off(kvm_t *kd, uint64_t pa, u_long *ofs) +{ + Elf_Ehdr *e = kd->vmst->mmapbase; + Elf_Phdr *p = (Elf_Phdr*)((char*)e + e->e_phoff); + int n = e->e_phnum; + + while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz)) { +printf("%d %.8x %.8x %.8x\n", n, pa, p->p_paddr, p->p_paddr + p->p_memsz); + p++, n--; + } +printf("%d %.8x %.8x %.8x\n", n, pa, p->p_paddr, p->p_paddr + p->p_memsz); + + if (n == 0) + return (0); + + *ofs = (pa - p->p_paddr) + p->p_offset; + return (PAGE_SIZE - ((size_t)pa & PAGE_MASK)); +} + void _kvm_freevtop(kvm_t *kd) { - if (kd->vmst != 0) { - if (kd->vmst->PTD) { - free(kd->vmst->PTD); - } - free(kd->vmst); - } + struct vmstate *vm = kd->vmst; + + if (vm->mmapbase != NULL) + munmap(vm->mmapbase, vm->mmapsize); + + if (vm->PTD) + free(vm->PTD); + free(vm); + kd->vmst = NULL; } int _kvm_initvtop(kvm_t *kd) { - struct vmstate *vm; struct nlist nlist[2]; u_long pa; u_long kernbase; pd_entry_t *PTD; + Elf_Ehdr *ehdr; + size_t hdrsz; - vm = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm)); - if (vm == 0) { + kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); + if (kd->vmst == 0) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); } - kd->vmst = vm; - vm->PTD = 0; + kd->vmst->PTD = 0; + + if (_kvm_maphdrs(kd, sizeof(Elf_Ehdr)) == -1) + return (-1); + + ehdr = kd->vmst->mmapbase; + hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; + if (_kvm_maphdrs(kd, hdrsz) == -1) + return (-1); nlist[0].n_name = "kernbase"; nlist[1].n_name = 0; @@ -127,21 +192,24 @@ _kvm_err(kd, kd->program, "cannot read PTD"); return (-1); } - vm->PTD = PTD; + kd->vmst->PTD = PTD; return (0); } -static int -_kvm_vatop(kvm_t *kd, u_long va, u_long *pa) +int +_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa) { struct vmstate *vm; u_long offset; u_long pte_pa; + u_long pde_pa; pd_entry_t pde; pt_entry_t pte; u_long pdeindex; u_long pteindex; - int i; + size_t s; + u_long a, ofs; + if (ISALIVE(kd)) { _kvm_err(kd, 0, "vatop called in live kernel!"); @@ -156,8 +224,13 @@ * not yet set) then return pa == va to avoid infinite recursion. */ if (vm->PTD == 0) { - *pa = va; - return (PAGE_SIZE - offset); + s = _kvm_pa2off(kd, va, pa); + if (s == 0) { + _kvm_err(kd, kd->program, + "_kvm_kvatop: bootstrap data not in dump"); + goto invalid; + } else + return (PAGE_SIZE - offset); } pdeindex = va >> PDRSHIFT; @@ -174,15 +247,27 @@ */ #define PAGE4M_MASK (NBPDR - 1) #define PG_FRAME4M (~PAGE4M_MASK) - *pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK); + pde_pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK); + s = _kvm_pa2off(kd, pde_pa, &ofs); + if (s <= sizeof pde) { + _kvm_syserr(kd, kd->program, "_kvm_kvatop: pde_pa not found"); + goto invalid; + } + *pa = ofs; return (NBPDR - (va & PAGE4M_MASK)); } pteindex = (va >> PAGE_SHIFT) & (NPTEPG-1); pte_pa = ((u_long)pde & PG_FRAME) + (pteindex * sizeof(pt_entry_t)); + s = _kvm_pa2off(kd, pte_pa, &ofs); + if (s <= sizeof pte) { + _kvm_err(kd, kd->program, "_kvm_kvatop: pdpe_pa not found"); + goto invalid; + } + /* XXX This has to be a physical address read, kvm_read is virtual */ - if (lseek(kd->pmfd, pte_pa, 0) == -1) { + if (lseek(kd->pmfd, ofs, 0) == -1) { _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek"); goto invalid; } @@ -193,16 +278,15 @@ if (((u_long)pte & PG_V) == 0) goto invalid; - *pa = ((u_long)pte & PG_FRAME) + offset; - return (PAGE_SIZE - offset); + a = ((u_long)pte & PG_FRAME) + offset; + s =_kvm_pa2off(kd, a, pa); + if (s == 0) { + _kvm_err(kd, kd->program, "_kvm_kvatop: address not in dump"); + goto invalid; + } else + return (PAGE_SIZE - offset); invalid: _kvm_err(kd, 0, "invalid address (%x)", va); return (0); } - -int -_kvm_kvatop(kvm_t *kd, u_long va, u_long *pa) -{ - return (_kvm_vatop(kd, va, pa)); -} From owner-p4-projects@FreeBSD.ORG Fri Jun 24 17:31:10 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E1A4A16A41F; Fri, 24 Jun 2005 17:31:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7A0816A428 for ; Fri, 24 Jun 2005 17:31:09 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79F2643D1F for ; Fri, 24 Jun 2005 17:31:09 +0000 (GMT) (envelope-from ps@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5OHV9hX068367 for ; Fri, 24 Jun 2005 17:31:09 GMT (envelope-from ps@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5OHV9pF068364 for perforce@freebsd.org; Fri, 24 Jun 2005 17:31:09 GMT (envelope-from ps@freebsd.org) Date: Fri, 24 Jun 2005 17:31:09 GMT Message-Id: <200506241731.j5OHV9pF068364@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ps@freebsd.org using -f From: Paul Saab To: Perforce Change Reviews Cc: Subject: PERFORCE change 78921 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 17:31:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=78921 Change 78921 by ps@butter.corp on 2005/06/24 17:31:01 remove some debugging code that snuck in. Affected files ... .. //depot/projects/hammer/lib/libkvm/kvm_i386.c#3 edit Differences ... ==== //depot/projects/hammer/lib/libkvm/kvm_i386.c#3 (text+ko) ==== @@ -116,10 +116,8 @@ int n = e->e_phnum; while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz)) { -printf("%d %.8x %.8x %.8x\n", n, pa, p->p_paddr, p->p_paddr + p->p_memsz); p++, n--; } -printf("%d %.8x %.8x %.8x\n", n, pa, p->p_paddr, p->p_paddr + p->p_memsz); if (n == 0) return (0); From owner-p4-projects@FreeBSD.ORG Fri Jun 24 17:50:38 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6552D16A420; Fri, 24 Jun 2005 17:50:38 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F58E16A41C for ; Fri, 24 Jun 2005 17:50:38 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2193E43D1F for ; Fri, 24 Jun 2005 17:50:38 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5OHocSa069307 for ; Fri, 24 Jun 2005 17:50:38 GMT (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5OHobpx069304 for perforce@freebsd.org; Fri, 24 Jun 2005 17:50:37 GMT (envelope-from areisse@nailabs.com) Date: Fri, 24 Jun 2005 17:50:37 GMT Message-Id: <200506241750.j5OHobpx069304@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Cc: Subject: PERFORCE change 78926 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 17:50:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=78926 Change 78926 by areisse@areisse_ibook on 2005/06/24 17:49:53 Add a new entry point and kernel call for requesting new object labels from policies. Currently, the interface is best suited for the Flask policy and its concept of type changes on creation, but it is hoped to be adaptable. A utility program for using the entry point (compute_label) is also included. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/mach_cmds/Makefile#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/bsd/sys/mac_policy.h#6 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/kern/security.c#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/mac.h#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/security.defs#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/security/mac_base.c#4 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#5 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/mach_cmds/Makefile#2 (text+ko) ==== @@ -1,7 +1,7 @@ include ../../Makeconfig -all: mgetpmac prboot ca +all: mgetpmac prboot ca compute_label VPATH = $(EXPORT_HDRS)/osfmk/mach CFLAGS += -g @@ -18,8 +18,8 @@ ca: ca.o security.o $(CC) -o $@ security.o ca.o -mlhs: security.o mlhs.o - $(CC) -o $@ $^ +compute_label: compute_label.o security.o + $(CC) -o $@ security.o compute_label.o server: server.o security.o $(CC) -o $@ security.o server.o @@ -28,6 +28,7 @@ install: all install -o $(BINOWN) -g $(BINGRP) -m 755 ca $(DESTDIR)/usr/bin + install -o $(BINOWN) -g $(BINGRP) -m 755 compute_label $(DESTDIR)/usr/bin install -o $(BINOWN) -g $(BINGRP) -m 755 mgetpmac $(DESTDIR)/usr/bin install -o $(BINOWN) -g $(BINGRP) -m 755 prboot $(DESTDIR)/usr/bin ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/bsd/sys/mac_policy.h#6 (text+ko) ==== @@ -267,6 +267,9 @@ void (*mpo_relabel_cred)(struct ucred *cred, struct label *newlabel); + int (*mpo_request_object_label)(struct label *subj, struct label *obj, + const char *serv, struct label *out); + /* * Access control checks. */ ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/kern/security.c#2 (text+ko) ==== @@ -212,3 +212,77 @@ ipc_port_multiple_unlock(); return KERN_INVALID_ARGUMENT; } + +kern_return_t +mac_request_label( + ipc_space_t space, + mach_port_name_t sub, + mach_port_name_t obj, + labelstr_t serv, + mach_port_name_t *outlabel) +{ + ipc_entry_t subi, obji; + ipc_object_t subp, objp; + ipc_labelh_t outlh; + ipc_port_t sport; + kern_return_t kr; + struct label *objl, *subl; + int rc; + + if (space == IS_NULL || space->is_task == NULL) + return KERN_INVALID_TASK; + + if (!MACH_PORT_VALID(obj) || !MACH_PORT_VALID(sub)) + return KERN_INVALID_NAME; + + kr = ipc_right_lookup_two_write(space, obj, &obji, sub, &subi); + if (kr != KERN_SUCCESS) + return kr; + + objp = obji->ie_object; + subp = subi->ie_object; + + outlh = labelh_new(); + + ipc_port_multiple_lock(); /* serialize (not necessary for LH, but simpler) */ + io_lock(objp); + io_lock(subp); + is_write_unlock (space); + + objl = io_getlabel(objp); + if (objl == NULL) + goto errout; + subl = io_getlabel(subp); + if (subl == NULL) + goto errout; + + mac_init_port_label(&outlh->lh_label); + rc = mac_request_object_label(subl, objl, serv, &outlh->lh_label); + io_unlocklabel(subp); + io_unlock(subp); + io_unlocklabel(objp); + io_unlock(objp); + ipc_port_multiple_unlock(); + + ip_lock(outlh->lh_port); + sport = ipc_port_make_send_locked(outlh->lh_port); + ip_release(outlh->lh_port); + ip_unlock(outlh->lh_port); + *outlabel = ipc_port_copyout_send(outlh->lh_port,space); + + if (rc == /*EINVAL*/ 22) + return KERN_INVALID_ARGUMENT; + else if (rc != 0) + return KERN_NO_ACCESS; + else + return 0; + +errout: + io_unlocklabel(subp); + io_unlock(subp); + io_unlocklabel(objp); + io_unlock(objp); + ipc_port_multiple_unlock(); + labelh_release(outlh); + return KERN_INVALID_ARGUMENT; +} ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/mac.h#5 (text+ko) ==== @@ -60,4 +60,8 @@ int mac_check_task_service_access (task_t self, task_t obj, const char *perm); +int mac_request_object_label (struct label *subj, struct label *obj, + const char *serv, struct label *out); + void mac_check_ipc_methods (struct label *task, struct label *port, int msgid, msg_access_vector_t *av); + ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/security.defs#3 (text+ko) ==== @@ -58,3 +58,9 @@ routine mac_label_new(task : ipc_space_t; out name : mach_port_name_t; label : labelstr_t); + +routine mac_request_label(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + out newlabel : mach_port_name_t); ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/security/mac_base.c#4 (text+ko) ==== @@ -546,6 +546,16 @@ } int +mac_request_object_label(struct label *subj, struct label *obj, + const char *s, struct label *out) +{ + int error; + + MAC_CHECK (request_object_label, subj, obj, s, out); + return error; +} + +int mac_check_structmac_consistent(struct mac *mac) { ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#5 (text+ko) ==== @@ -1251,6 +1251,25 @@ NULL, NULL); } +static int +sebsd_request_label (struct label *subj, struct label *obj, const char *s, + struct label *out) +{ + struct task_security_struct *tsec, *psec, *osec; + struct class_datum *cld; + struct perm_datum *p; + + psec = SLOT(obj); + tsec = SLOT(subj); + osec = SLOT(out); + + cld = hashtab_search (policydb.p_classes.table, s); + if (cld == NULL) + return EINVAL; + + return security_change_sid (tsec->sid, psec->sid, cld->value, &osec->sid); +} + extern int selinux_enforcing; static void @@ -2613,6 +2632,8 @@ .mpo_associate_vnode_extattr = sebsd_associate_vnode_extattr, .mpo_associate_vnode_devfs = sebsd_associate_vnode_devfs, + .mpo_request_object_label = sebsd_request_label, + /* Transition */ .mpo_execve_will_transition = sebsd_execve_will_transition, .mpo_execve_transition = sebsd_execve_transition, From owner-p4-projects@FreeBSD.ORG Fri Jun 24 18:11:04 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4021C16A420; Fri, 24 Jun 2005 18:11:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16D3316A41C for ; Fri, 24 Jun 2005 18:11:04 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E179243D1F for ; Fri, 24 Jun 2005 18:11:03 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j5OIB3nY070209 for ; Fri, 24 Jun 2005 18:11:03 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j5OIB3aW070199 for perforce@freebsd.org; Fri, 24 Jun 2005 18:11:03 GMT (envelope-from jhb@freebsd.org) Date: Fri, 24 Jun 2005 18:11:03 GMT Message-Id: <200506241811.j5OIB3aW070199@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 78928 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 18:11:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=78928 Change 78928 by jhb@jhb_slimer on 2005/06/24 18:10:31 IFC @78925. Affected files ... .. //depot/projects/smpng/sys/alpha/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/amd64/amd64/exception.S#13 integrate .. //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#12 integrate .. //depot/projects/smpng/sys/amd64/amd64/local_apic.c#15 integrate .. //depot/projects/smpng/sys/amd64/amd64/machdep.c#41 integrate .. //depot/projects/smpng/sys/amd64/amd64/support.S#13 integrate .. //depot/projects/smpng/sys/amd64/amd64/trap.c#27 integrate .. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#27 integrate .. //depot/projects/smpng/sys/amd64/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#8 integrate .. //depot/projects/smpng/sys/arm/arm/db_interface.c#5 integrate .. //depot/projects/smpng/sys/arm/arm/pmap.c#18 integrate .. //depot/projects/smpng/sys/arm/arm/trap.c#12 integrate .. //depot/projects/smpng/sys/arm/arm/vm_machdep.c#13 integrate .. //depot/projects/smpng/sys/arm/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/arm/include/atomic.h#13 integrate .. //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#12 integrate .. //depot/projects/smpng/sys/cam/cam_xpt.c#30 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#20 integrate .. //depot/projects/smpng/sys/compat/linux/linux_stats.c#28 integrate .. //depot/projects/smpng/sys/conf/NOTES#99 integrate .. //depot/projects/smpng/sys/conf/files#142 integrate .. //depot/projects/smpng/sys/conf/files.i386#84 integrate .. //depot/projects/smpng/sys/conf/files.pc98#75 integrate .. //depot/projects/smpng/sys/conf/options#100 integrate .. //depot/projects/smpng/sys/conf/options.i386#48 integrate .. //depot/projects/smpng/sys/conf/options.pc98#47 integrate .. //depot/projects/smpng/sys/contrib/ipfilter/netinet/fil.c#18 integrate .. //depot/projects/smpng/sys/contrib/ipfilter/netinet/ip_htable.c#2 integrate .. //depot/projects/smpng/sys/dev/acpi_support/acpi_ibm.c#4 integrate .. //depot/projects/smpng/sys/dev/aic/aic_pccard.c#10 integrate .. //depot/projects/smpng/sys/dev/amr/amr.c#31 integrate .. //depot/projects/smpng/sys/dev/an/if_an_pccard.c#16 integrate .. //depot/projects/smpng/sys/dev/ata/ata-card.c#27 integrate .. //depot/projects/smpng/sys/dev/awi/if_awi_pccard.c#15 integrate .. //depot/projects/smpng/sys/dev/cs/if_cs_pccard.c#12 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed_pccard.c#29 integrate .. //depot/projects/smpng/sys/dev/ep/if_ep_pccard.c#18 integrate .. //depot/projects/smpng/sys/dev/ex/if_ex_pccard.c#10 integrate .. //depot/projects/smpng/sys/dev/fatm/if_fatm.c#13 integrate .. //depot/projects/smpng/sys/dev/fdc/fdc_pccard.c#7 integrate .. //depot/projects/smpng/sys/dev/fe/if_fe_pccard.c#14 integrate .. //depot/projects/smpng/sys/dev/hatm/if_hatmvar.h#9 integrate .. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_amd.c#3 integrate .. //depot/projects/smpng/sys/dev/iwi/if_iwi.c#3 integrate .. //depot/projects/smpng/sys/dev/ncv/ncr53c500_pccard.c#18 integrate .. //depot/projects/smpng/sys/dev/nsp/nsp_pccard.c#14 integrate .. //depot/projects/smpng/sys/dev/owi/if_owi_pccard.c#5 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs#45 integrate .. //depot/projects/smpng/sys/dev/pccard/pccardvar.h#21 integrate .. //depot/projects/smpng/sys/dev/ral/if_ral_pccard.c#2 integrate .. //depot/projects/smpng/sys/dev/sn/if_sn_pccard.c#14 integrate .. //depot/projects/smpng/sys/dev/stg/tmc18c30_pccard.c#15 integrate .. //depot/projects/smpng/sys/dev/uart/uart_cpu_alpha.c#7 integrate .. //depot/projects/smpng/sys/dev/utopia/utopia.c#10 integrate .. //depot/projects/smpng/sys/dev/wi/if_wi_pccard.c#34 integrate .. //depot/projects/smpng/sys/dev/xe/if_xe_pccard.c#18 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_fs.h#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_fs_sb.h#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_linux_balloc.c#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_vfsops.c#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/i386-bitops.h#2 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/sparc64-bitops.h#2 integrate .. //depot/projects/smpng/sys/gnu/fs/reiserfs/README#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_fs.h#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_fs_i.h#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_fs_sb.h#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_hashes.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_inode.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_item_ops.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_mount.h#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_namei.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_prints.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_stree.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#1 branch .. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_vnops.c#1 branch .. //depot/projects/smpng/sys/gnu/reiserfs/README#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_fs.h#3 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_fs_i.h#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_fs_sb.h#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_hashes.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_inode.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_item_ops.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_mount.h#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_namei.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_prints.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_stree.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_vfsops.c#2 delete .. //depot/projects/smpng/sys/gnu/reiserfs/reiserfs_vnops.c#2 delete .. //depot/projects/smpng/sys/i386/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/i386/conf/NOTES#102 integrate .. //depot/projects/smpng/sys/i386/i386/local_apic.c#31 integrate .. //depot/projects/smpng/sys/i386/i386/sys_machdep.c#43 integrate .. //depot/projects/smpng/sys/i386/i386/trap.c#78 integrate .. //depot/projects/smpng/sys/i386/i386/vm_machdep.c#69 integrate .. //depot/projects/smpng/sys/i4b/driver/i4b_ipr.c#22 integrate .. //depot/projects/smpng/sys/i4b/driver/i4b_isppp.c#14 integrate .. //depot/projects/smpng/sys/ia64/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/kern/imgact_shell.c#11 integrate .. //depot/projects/smpng/sys/kern/kern_clock.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_exec.c#86 integrate .. //depot/projects/smpng/sys/kern/kern_intr.c#68 integrate .. //depot/projects/smpng/sys/kern/kern_jail.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_kse.c#22 integrate .. //depot/projects/smpng/sys/kern/kern_ktrace.c#45 integrate .. //depot/projects/smpng/sys/kern/kern_malloc.c#36 integrate .. //depot/projects/smpng/sys/kern/kern_mbuf.c#6 integrate .. //depot/projects/smpng/sys/kern/sched_4bsd.c#52 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#58 integrate .. //depot/projects/smpng/sys/kern/subr_disk.c#26 integrate .. //depot/projects/smpng/sys/kern/vfs_cache.c#29 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#104 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#91 integrate .. //depot/projects/smpng/sys/modules/Makefile#98 integrate .. //depot/projects/smpng/sys/modules/libalias/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/reiserfs/Makefile#2 integrate .. //depot/projects/smpng/sys/net/if.c#67 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c#10 integrate .. //depot/projects/smpng/sys/netinet/in_gif.c#15 integrate .. //depot/projects/smpng/sys/netinet/ip_fw2.c#54 integrate .. //depot/projects/smpng/sys/netinet/ip_mroute.c#40 integrate .. //depot/projects/smpng/sys/netinet/libalias/alias_util.c#2 integrate .. //depot/projects/smpng/sys/netinet/tcp_sack.c#12 integrate .. //depot/projects/smpng/sys/netinet6/in6_gif.c#10 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_bio.c#42 integrate .. //depot/projects/smpng/sys/pc98/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/pc98/conf/NOTES#39 integrate .. //depot/projects/smpng/sys/powerpc/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/sparc64/conf/.cvsignore#1 branch .. //depot/projects/smpng/sys/sys/mutex.h#57 integrate .. //depot/projects/smpng/sys/vm/uma_int.h#27 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/exception.S#13 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.123 2005/05/22 23:28:17 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.124 2005/06/24 00:38:36 peter Exp $ */ #include "opt_atpic.h" @@ -119,7 +119,7 @@ subq $TF_ERR,%rsp; \ movq $(a),TF_TRAPNO(%rsp) ; \ movq $0,TF_ADDR(%rsp) ; \ - jmp alltraps_noen + jmp alltraps IDTVEC(tss) TRAP_ERR(T_TSSFLT) IDTVEC(missing) ==== //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#12 (text+ko) ==== @@ -26,11 +26,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.14 2005/04/12 23:18:53 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.15 2005/06/24 00:45:01 peter Exp $ */ /* - * Machine dependent interrupt code for i386. For the i386, we have to + * Machine dependent interrupt code for amd64. For amd64, we have to * deal with different PICs. Thus, we use the passed in vector to lookup * an interrupt source associated with that vector. The interrupt source * describes which PIC the source belongs to and includes methods to handle ==== //depot/projects/smpng/sys/amd64/amd64/local_apic.c#15 (text+ko) ==== @@ -32,7 +32,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.15 2005/05/22 16:32:02 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.17 2005/06/24 00:45:01 peter Exp $"); + +#include "opt_hwpmc_hooks.h" #include #include @@ -837,7 +839,7 @@ #ifdef SMP /* * Inter Processor Interrupt functions. The lapic_ipi_*() functions are - * private to the sys/i386 code. The public interface for the rest of the + * private to the sys/amd64 code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ int ==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#41 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.636 2005/05/05 18:19:53 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.637 2005/06/24 00:45:01 peter Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -661,7 +661,7 @@ CTLFLAG_RW, &wall_cmos_clock, 0, ""); /* - * Initialize 386 and configure to run kernel + * Initialize amd64 and configure to run kernel */ /* ==== //depot/projects/smpng/sys/amd64/amd64/support.S#13 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.114 2005/04/10 18:12:07 alc Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.115 2005/06/24 00:45:01 peter Exp $ */ #include "opt_ddb.h" @@ -201,14 +201,8 @@ /* copyout and fubyte family */ /*****************************************************************************/ /* - * Access user memory from inside the kernel. These routines and possibly - * the math- and DOS emulators should be the only places that do this. - * - * We have to access the memory with user's permissions, so use a segment - * selector with RPL 3. For writes to user space we have to additionally - * check the PTE for write permission, because the 386 does not check - * write permissions when we are executing with EPL 0. The 486 does check - * this if the WP bit is set in CR0, so we can use a simpler version here. + * Access user memory from inside the kernel. These routines should be + * the only places that do this. * * These routines set curpcb->onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler @@ -592,7 +586,7 @@ ret /* - * Handling of special 386 registers and descriptor tables etc + * Handling of special amd64 registers and descriptor tables etc * %rdi */ /* void lgdt(struct region_descriptor *rdp); */ ==== //depot/projects/smpng/sys/amd64/amd64/trap.c#27 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.286 2005/05/30 06:29:28 jkoshy Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.287 2005/06/24 00:16:56 peter Exp $"); /* * AMD64 Trap and System call handling @@ -46,6 +46,7 @@ #include "opt_clock.h" #include "opt_cpu.h" +#include "opt_hwpmc_hooks.h" #include "opt_isa.h" #include "opt_ktrace.h" ==== //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#27 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.246 2005/04/23 02:32:30 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.247 2005/06/24 00:29:53 peter Exp $"); #include "opt_isa.h" #include "opt_cpu.h" @@ -206,14 +206,14 @@ void cpu_thread_exit(struct thread *td) { - struct pcb *pcb = td->td_pcb; if (td == PCPU_GET(fpcurthread)) fpudrop(); - if (pcb->pcb_flags & PCB_DBREGS) { - /* disable all hardware breakpoints */ + + /* Disable any hardware breakpoints. */ + if (td->td_pcb->pcb_flags & PCB_DBREGS) { reset_dbregs(); - pcb->pcb_flags &= ~PCB_DBREGS; + td->td_pcb->pcb_flags &= ~PCB_DBREGS; } } ==== //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#8 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.9 2005/04/05 15:28:06 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.10 2005/06/24 17:41:27 jhb Exp $"); #include #include @@ -113,7 +113,8 @@ * Allocate temporary demand zeroed space for argument and * environment strings */ - args->buf = (char *) kmem_alloc_wait(exec_map, PATH_MAX + ARG_MAX); + args->buf = (char *) kmem_alloc_wait(exec_map, + PATH_MAX + ARG_MAX + MAXSHELLCMDLEN); if (args->buf == NULL) return (ENOMEM); args->begin_argv = args->buf; ==== //depot/projects/smpng/sys/arm/arm/db_interface.c#5 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.4 2005/01/05 21:58:47 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.5 2005/06/23 11:38:47 cognet Exp $"); #include "opt_ddb.h" #include @@ -71,27 +71,29 @@ int db_access_abt_sp (struct db_variable *, db_expr_t *, int); int db_access_irq_sp (struct db_variable *, db_expr_t *, int); +static db_varfcn_t db_frame; + #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { - { "spsr", DB_OFFSET(tf_spsr), FCN_NULL, }, - { "r0", DB_OFFSET(tf_r0), FCN_NULL, }, - { "r1", DB_OFFSET(tf_r1), FCN_NULL, }, - { "r2", DB_OFFSET(tf_r2), FCN_NULL, }, - { "r3", DB_OFFSET(tf_r3), FCN_NULL, }, - { "r4", DB_OFFSET(tf_r4), FCN_NULL, }, - { "r5", DB_OFFSET(tf_r5), FCN_NULL, }, - { "r6", DB_OFFSET(tf_r6), FCN_NULL, }, - { "r7", DB_OFFSET(tf_r7), FCN_NULL, }, - { "r8", DB_OFFSET(tf_r8), FCN_NULL, }, - { "r9", DB_OFFSET(tf_r9), FCN_NULL, }, - { "r10", DB_OFFSET(tf_r10), FCN_NULL, }, - { "r11", DB_OFFSET(tf_r11), FCN_NULL, }, - { "r12", DB_OFFSET(tf_r12), FCN_NULL, }, - { "usr_sp", DB_OFFSET(tf_usr_sp), FCN_NULL, }, - { "usr_lr", DB_OFFSET(tf_usr_lr), FCN_NULL, }, - { "svc_sp", DB_OFFSET(tf_svc_sp), FCN_NULL, }, - { "svc_lr", DB_OFFSET(tf_svc_lr), FCN_NULL, }, - { "pc", DB_OFFSET(tf_pc), FCN_NULL, }, + { "spsr", DB_OFFSET(tf_spsr), db_frame }, + { "r0", DB_OFFSET(tf_r0), db_frame }, + { "r1", DB_OFFSET(tf_r1), db_frame }, + { "r2", DB_OFFSET(tf_r2), db_frame }, + { "r3", DB_OFFSET(tf_r3), db_frame }, + { "r4", DB_OFFSET(tf_r4), db_frame }, + { "r5", DB_OFFSET(tf_r5), db_frame }, + { "r6", DB_OFFSET(tf_r6), db_frame }, + { "r7", DB_OFFSET(tf_r7), db_frame }, + { "r8", DB_OFFSET(tf_r8), db_frame }, + { "r9", DB_OFFSET(tf_r9), db_frame }, + { "r10", DB_OFFSET(tf_r10), db_frame }, + { "r11", DB_OFFSET(tf_r11), db_frame }, + { "r12", DB_OFFSET(tf_r12), db_frame }, + { "usr_sp", DB_OFFSET(tf_usr_sp), db_frame }, + { "usr_lr", DB_OFFSET(tf_usr_lr), db_frame }, + { "svc_sp", DB_OFFSET(tf_svc_sp), db_frame }, + { "svc_lr", DB_OFFSET(tf_svc_lr), db_frame }, + { "pc", DB_OFFSET(tf_pc), db_frame }, { "und_sp", &nil, db_access_und_sp, }, { "abt_sp", &nil, db_access_abt_sp, }, { "irq_sp", &nil, db_access_irq_sp, }, @@ -103,8 +105,10 @@ db_access_und_sp(struct db_variable *vp, db_expr_t *valp, int rw) { - if (rw == DB_VAR_GET) + if (rw == DB_VAR_GET) { *valp = get_stackptr(PSR_UND32_MODE); + return (1); + } return(0); } @@ -112,8 +116,10 @@ db_access_abt_sp(struct db_variable *vp, db_expr_t *valp, int rw) { - if (rw == DB_VAR_GET) + if (rw == DB_VAR_GET) { *valp = get_stackptr(PSR_ABT32_MODE); + return (1); + } return(0); } @@ -121,11 +127,28 @@ db_access_irq_sp(struct db_variable *vp, db_expr_t *valp, int rw) { - if (rw == DB_VAR_GET) + if (rw == DB_VAR_GET) { *valp = get_stackptr(PSR_IRQ32_MODE); + return (1); + } return(0); } +int db_frame(struct db_variable *vp, db_expr_t *valp, int rw) +{ + int *reg; + + if (kdb_frame == NULL) + return (0); + + reg = (int *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + if (rw == DB_VAR_GET) + *valp = *reg; + else + *reg = *valp; + return(1); +} + void db_show_mdpcpu(struct pcpu *pc) { ==== //depot/projects/smpng/sys/arm/arm/pmap.c#18 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.34 2005/06/10 13:31:30 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.36 2005/06/23 11:37:41 cognet Exp $"); #include #include #include @@ -1089,6 +1089,9 @@ #ifndef PMAP_INCLUDE_PTE_SYNC struct l2_bucket *l2b; pt_entry_t *ptep, pte; +#ifdef ARM_USE_SMALL_ALLOC + pd_entry_t *pde; +#endif vm_offset_t va = (vm_offset_t)mem & ~PAGE_MASK; /* @@ -1100,7 +1103,8 @@ * correct. */ #ifdef ARM_USE_SMALL_ALLOC - if (flags & UMA_SLAB_KMEM) { + pde = &kernel_pmap->pm_l1->l1_kva[L1_IDX(va)]; + if (!l1pte_section_p(*pde)) { #endif l2b = pmap_get_l2_bucket(pmap_kernel(), va); ptep = &l2b->l2b_kva[l2pte_index(va)]; @@ -2406,6 +2410,7 @@ #ifdef ARM_USE_SMALL_ALLOC extern struct mtx smallalloc_mtx; extern vm_offset_t alloc_curaddr; +extern vm_offset_t alloc_firstaddr; #endif void @@ -2561,7 +2566,7 @@ kernel_vm_end = pmap_curmaxkvaddr; #ifdef ARM_USE_SMALL_ALLOC mtx_init(&smallalloc_mtx, "Small alloc page list", NULL, MTX_DEF); - alloc_curaddr = lastaddr; + alloc_firstaddr = alloc_curaddr = lastaddr; #endif } ==== //depot/projects/smpng/sys/arm/arm/trap.c#12 (text+ko) ==== @@ -82,7 +82,7 @@ #include "opt_ktrace.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.15 2005/05/25 13:46:32 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.17 2005/06/23 11:39:18 cognet Exp $"); #include @@ -118,12 +118,12 @@ #include #include #include -#if !defined(DDB) -#define kdb_trap kgdb_trap + +#ifdef KDB +#include #endif - void swi_handler(trapframe_t *); void undefinedinstruction(trapframe_t *); @@ -406,8 +406,8 @@ #ifdef DEBUG last_fault_code = fsr; #endif - if (pmap_fault_fixup(user ? vmspace_pmap(td->td_proc->p_vmspace) : - kernel_pmap, va, ftype, user)) { + if (pmap_fault_fixup(vmspace_pmap(td->td_proc->p_vmspace), va, ftype, + user)) { goto out; } @@ -512,8 +512,8 @@ tf->tf_svc_sp, tf->tf_svc_lr); printf(", pc =%08x\n\n", tf->tf_pc); -#if defined(DDB) || defined(KGDB) - kdb_trap(T_FAULT, tf); +#ifdef KDB + kdb_trap(fsr, 0, tf); #endif panic("Fatal abort"); /*NOTREACHED*/ ==== //depot/projects/smpng/sys/arm/arm/vm_machdep.c#13 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.15 2005/06/07 23:04:24 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.16 2005/06/23 11:37:41 cognet Exp $"); #include #include @@ -380,6 +380,7 @@ MALLOC_DEFINE(M_VMSMALLALLOC, "VM Small alloc", "VM Small alloc data"); vm_offset_t alloc_curaddr; +vm_offset_t alloc_firstaddr; extern int doverbose; @@ -463,15 +464,12 @@ /* No more free pages, need to alloc more. */ mtx_unlock(&smallalloc_mtx); if (!(wait & M_WAITOK)) { - *flags = UMA_SLAB_KMEM; ret = (void *)kmem_malloc(kmem_map, bytes, wait); return (ret); } /* Try to alloc 1MB of contiguous memory. */ ret = arm_uma_do_alloc(&sp, bytes, zone == l2zone ? SECTION_PT : SECTION_CACHE); - if (!sp) - *flags = UMA_SLAB_KMEM; mtx_lock(&smallalloc_mtx); if (sp) { for (int i = 0; i < (0x100000 / PAGE_SIZE) - 1; @@ -490,10 +488,6 @@ TAILQ_REMOVE(head, sp, pg_list); TAILQ_INSERT_HEAD(&free_pgdesc, sp, pg_list); ret = sp->addr; - if (ret == NULL) - panic("NULL"); - if (ret < (void *)0xa0000000) - panic("BLA %p", ret); } mtx_unlock(&smallalloc_mtx); if ((wait & M_ZERO)) @@ -507,7 +501,7 @@ pd_entry_t *pd; pt_entry_t *pt; - if (flags & UMA_SLAB_KMEM) + if (mem < (void *)alloc_firstaddr) kmem_free(kmem_map, (vm_offset_t)mem, size); else { struct arm_small_page *sp; ==== //depot/projects/smpng/sys/arm/include/atomic.h#13 (text+ko) ==== @@ -33,7 +33,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/include/atomic.h,v 1.7 2005/05/24 21:42:31 cognet Exp $ + * $FreeBSD: src/sys/arm/include/atomic.h,v 1.8 2005/06/23 21:54:17 jhb Exp $ */ #ifndef _MACHINE_ATOMIC_H_ ==== //depot/projects/smpng/sys/arm/xscale/i80321/iq31244_machdep.c#12 (text+ko) ==== @@ -48,7 +48,7 @@ #include "opt_msgbuf.h" #include -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.12 2005/06/07 23:04:24 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.13 2005/06/23 11:40:45 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include @@ -101,8 +101,7 @@ #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_IOPXS 1 #define KERNEL_PT_BEFOREKERN 2 -#define KERNEL_PT_PHYS 3 -#define KERNEL_PT_AFKERNEL 4 /* L2 table for mapping after kernel */ +#define KERNEL_PT_AFKERNEL 3 /* L2 table for mapping after kernel */ #define KERNEL_PT_AFKERNEL_NUM 9 /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ @@ -319,18 +318,13 @@ &kernel_pt_table[KERNEL_PT_IOPXS]); pmap_link_l2pt(l1pagetable, KERNBASE, &kernel_pt_table[KERNEL_PT_BEFOREKERN]); - pmap_link_l2pt(l1pagetable, SDRAM_START, - &kernel_pt_table[KERNEL_PT_PHYS]); - pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, - 0x100000, + pmap_map_chunk(l1pagetable, KERNBASE, SDRAM_START, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); pmap_map_chunk(l1pagetable, KERNBASE + 0x100000, SDRAM_START + 0x100000, 0x100000, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, KERNBASE + 0x200000, SDRAM_START + 0x200000, (((uint32_t)(&end) - KERNBASE - 0x200000) + L1_S_SIZE) & ~(L1_S_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_map_entry(l1pagetable, minidataclean.pv_pa, minidataclean.pv_pa, - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); freemem_after = ((int)&end + PAGE_SIZE) & ~(PAGE_SIZE - 1); afterkern = round_page(((vm_offset_t)&end + L1_S_SIZE) & ~(L1_S_SIZE - 1)); @@ -338,6 +332,9 @@ pmap_link_l2pt(l1pagetable, afterkern + i * 0x00100000, &kernel_pt_table[KERNEL_PT_AFKERNEL + i]); } + pmap_map_entry(l1pagetable, afterkern, minidataclean.pv_pa, + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + #ifdef ARM_USE_SMALL_ALLOC if ((freemem_after + 2 * PAGE_SIZE) <= afterkern) { @@ -349,7 +346,7 @@ #endif /* Map the Mini-Data cache clean area. */ - xscale_setup_minidata(l1pagetable, minidataclean.pv_pa, + xscale_setup_minidata(l1pagetable, afterkern, minidataclean.pv_pa); /* Map the vector page. */ @@ -428,7 +425,7 @@ - pmap_curmaxkvaddr = afterkern; + pmap_curmaxkvaddr = afterkern + PAGE_SIZE; pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; ==== //depot/projects/smpng/sys/cam/cam_xpt.c#30 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.153 2005/05/11 17:39:33 kan Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.154 2005/06/24 08:09:05 avatar Exp $"); #include #include @@ -5107,6 +5107,8 @@ devq = bus->sim->devq; cam_devq_resize(devq, devq->alloc_queue.array_size - 1); splx(s); + camq_fini(&device->drvq); + camq_fini(&device->ccbq.queue); free(device, M_DEVBUF); xpt_release_target(bus, target); } else ==== //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#20 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.35 2005/06/11 14:58:20 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.36 2005/06/24 17:41:28 jhb Exp $"); #include "opt_compat.h" @@ -237,7 +237,8 @@ * Allocate temporary demand zeroed space for argument and * environment strings */ - args->buf = (char *) kmem_alloc_wait(exec_map, PATH_MAX + ARG_MAX); + args->buf = (char *) kmem_alloc_wait(exec_map, + PATH_MAX + ARG_MAX + MAXSHELLCMDLEN); if (args->buf == NULL) return (ENOMEM); args->begin_argv = args->buf; ==== //depot/projects/smpng/sys/compat/linux/linux_stats.c#28 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.71 2005/06/09 18:49:19 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.72 2005/06/23 22:13:29 pjd Exp $"); #include "opt_mac.h" @@ -331,9 +331,6 @@ if (dev != NULL && vfinddev(dev, &vp)) { if (vp->v_mount == NULL) return (EINVAL); - error = prison_canseemount(td->td_ucred, vp->v_mount); - if (error) - return (error); #ifdef MAC error = mac_check_mount_stat(td->td_ucred, vp->v_mount); if (error) ==== //depot/projects/smpng/sys/conf/NOTES#99 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1324 2005/06/14 14:21:24 ups Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1325 2005/06/21 10:17:54 dumbbell Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -918,6 +918,12 @@ # options EXT2FS +# +# Add support for the ReiserFS filesystem (used in Linux). Currently, +# this is limited to read-only access. +# +options REISERFS + # Use real implementations of the aio_* system calls. There are numerous # stability and security issues in the current aio code that make it # unsuitable for inclusion on machines with untrusted local users. ==== //depot/projects/smpng/sys/conf/files#142 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1027 2005/06/15 02:36:11 rodrigc Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1030 2005/06/21 10:17:54 dumbbell Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -583,6 +583,8 @@ dev/hme/if_hme.c optional hme dev/hme/if_hme_pci.c optional hme pci dev/hme/if_hme_sbus.c optional hme sbus +dev/hwpmc/hwpmc_logging.c optional hwpmc +dev/hwpmc/hwpmc_mod.c optional hwpmc dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida @@ -1068,12 +1070,16 @@ gnu/fs/ext2fs/ext2_subr.c optional ext2fs gnu/fs/ext2fs/ext2_vfsops.c optional ext2fs gnu/fs/ext2fs/ext2_vnops.c optional ext2fs -# -# Support for hardware performance monitoring counters +gnu/fs/reiserfs/reiserfs_hashes.c optional reiserfs \ + warning "kernel contains GPL contaminated ReiserFS filesystem" +gnu/fs/reiserfs/reiserfs_inode.c optional reiserfs +gnu/fs/reiserfs/reiserfs_item_ops.c optional reiserfs +gnu/fs/reiserfs/reiserfs_namei.c optional reiserfs +gnu/fs/reiserfs/reiserfs_prints.c optional reiserfs +gnu/fs/reiserfs/reiserfs_stree.c optional reiserfs +gnu/fs/reiserfs/reiserfs_vfsops.c optional reiserfs +gnu/fs/reiserfs/reiserfs_vnops.c optional reiserfs # -dev/hwpmc/hwpmc_mod.c optional hwpmc -dev/hwpmc/hwpmc_logging.c optional hwpmc -# # isdn4bsd device drivers # i4b/driver/i4b_trace.c optional i4btrc @@ -1591,7 +1597,6 @@ netinet/libalias/alias_ftp.c optional libalias netinet/libalias/alias_irc.c optional libalias netinet/libalias/alias_nbt.c optional libalias -netinet/libalias/alias_old.c optional libalias netinet/libalias/alias_pptp.c optional libalias netinet/libalias/alias_proxy.c optional libalias netinet/libalias/alias_skinny.c optional libalias ==== //depot/projects/smpng/sys/conf/files.i386#84 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.i386,v 1.536 2005/06/12 00:47:21 marcel Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.538 2005/06/21 10:17:54 dumbbell Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -224,15 +224,6 @@ geom/geom_bsd_enc.c standard geom/geom_mbr.c standard geom/geom_mbr_enc.c standard -gnu/reiserfs/reiserfs_hashes.c optional reiserfs \ - warning "kernel contains GPL contaminated ReiserFS filesystem" -gnu/reiserfs/reiserfs_inode.c optional reiserfs -gnu/reiserfs/reiserfs_item_ops.c optional reiserfs -gnu/reiserfs/reiserfs_namei.c optional reiserfs -gnu/reiserfs/reiserfs_prints.c optional reiserfs -gnu/reiserfs/reiserfs_stree.c optional reiserfs -gnu/reiserfs/reiserfs_vfsops.c optional reiserfs -gnu/reiserfs/reiserfs_vnops.c optional reiserfs dev/acpica/acpi_if.m standard i386/acpica/OsdEnvironment.c optional acpi i386/acpica/acpi_machdep.c optional acpi ==== //depot/projects/smpng/sys/conf/files.pc98#75 (text+ko) ==== @@ -3,7 +3,7 @@ # # modified for PC-9801/PC-9821 # -# $FreeBSD: src/sys/conf/files.pc98,v 1.326 2005/06/12 00:47:21 marcel Exp $ +# $FreeBSD: src/sys/conf/files.pc98,v 1.327 2005/06/21 10:17:54 dumbbell Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -157,15 +157,6 @@ geom/geom_bsd_enc.c standard geom/geom_pc98.c standard geom/geom_pc98_enc.c standard -gnu/reiserfs/reiserfs_hashes.c optional reiserfs \ - warning "kernel contains GPL contaminated ReiserFS filesystem" -gnu/reiserfs/reiserfs_inode.c optional reiserfs -gnu/reiserfs/reiserfs_item_ops.c optional reiserfs -gnu/reiserfs/reiserfs_namei.c optional reiserfs -gnu/reiserfs/reiserfs_prints.c optional reiserfs -gnu/reiserfs/reiserfs_stree.c optional reiserfs -gnu/reiserfs/reiserfs_vfsops.c optional reiserfs -gnu/reiserfs/reiserfs_vnops.c optional reiserfs i386/bios/apm.c optional apm #i386/i386/apic_vector.s optional apic i386/i386/atomic.c standard \ ==== //depot/projects/smpng/sys/conf/options#100 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.506 2005/06/10 08:05:12 glebius Exp $ +# $FreeBSD: src/sys/conf/options,v 1.508 2005/06/24 00:16:57 peter Exp $ # # On the handling of kernel options # @@ -177,6 +177,7 @@ PORTALFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h +REISERFS opt_dontuse.h SMBFS opt_dontuse.h UDF opt_dontuse.h UMAPFS opt_dontuse.h @@ -706,4 +707,4 @@ LOOKUP_SHARED opt_vfs.h # HWPMC options -HWPMC_HOOKS opt_global.h +HWPMC_HOOKS ==== //depot/projects/smpng/sys/conf/options.i386#48 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.i386,v 1.222 2005/05/24 12:28:21 dumbbell Exp $ +# $FreeBSD: src/sys/conf/options.i386,v 1.223 2005/06/21 10:17:54 dumbbell Exp $ # Options specific to the i386 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -120,9 +120,6 @@ # Enables NETGRAPH support for Cronyx adapters NETGRAPH_CRONYX opt_ng_cronyx.h -# ReiserFS -REISERFS opt_dontuse.h - # ------------------------------- # isdn4bsd: passive ISA cards # ------------------------------- ==== //depot/projects/smpng/sys/conf/options.pc98#47 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.pc98,v 1.186 2005/05/25 12:32:06 nyan Exp $ +# $FreeBSD: src/sys/conf/options.pc98,v 1.187 2005/06/24 13:19:09 des Exp $ # Options specific to the pc98 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -72,9 +72,6 @@ # Enables NETGRAPH support for Cronyx adapters NETGRAPH_CRONYX opt_ng_cronyx.h -# ReiserFS -REISERFS opt_dontuse.h - # ------------------------------- # isdn4bsd: passive PCI cards # ------------------------------- ==== //depot/projects/smpng/sys/contrib/ipfilter/netinet/fil.c#18 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/contrib/ipfilter/netinet/fil.c,v 1.45 2005/04/27 03:48:09 darrenr Exp $ */ +/* $FreeBSD: src/sys/contrib/ipfilter/netinet/fil.c,v 1.46 2005/06/23 14:19:02 darrenr Exp $ */ /* * Copyright (C) 1993-2003 by Darren Reed. @@ -136,7 +136,7 @@ #if !defined(lint) static const char sccsid[] = "@(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed"; -static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/fil.c,v 1.45 2005/04/27 03:48:09 darrenr Exp $"; +static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/fil.c,v 1.46 2005/06/23 14:19:02 darrenr Exp $"; /* static const char rcsid[] = "@(#)Id: fil.c,v 2.243.2.57 2005/03/28 10:47:50 darrenr Exp"; */ #endif @@ -3998,10 +3998,15 @@ fprev = &fg->fg_start; } - for (f = *fprev; (f = *fprev) != NULL; fprev = &f->fr_next) - if (fp->fr_collect <= f->fr_collect) + ftail = fprev; + for (f = *ftail; (f = *ftail) != NULL; ftail = &f->fr_next) { + if (fp->fr_collect <= f->fr_collect) { + ftail = fprev; + f = NULL; break; - ftail = fprev; + } + fprev = ftail; + } /* * Copy in extra data for the rule. @@ -4140,14 +4145,17 @@ WRITE_ENTER(&ipf_mutex); bzero((char *)frcache, sizeof(frcache)); - for (; (f = *ftail) != NULL; ftail = &f->fr_next) - if ((fp->fr_cksum == f->fr_cksum) && - (f->fr_dsize == fp->fr_dsize) && - !bcmp((char *)&f->fr_func, - (char *)&fp->fr_func, FR_CMPSIZ) && - (!ptr || !f->fr_data || + for (; (f = *ftail) != NULL; ftail = &f->fr_next) { + if ((fp->fr_cksum != f->fr_cksum) || + (f->fr_dsize != fp->fr_dsize)) + continue; + if (bcmp((char *)&f->fr_func, (char *)&fp->fr_func, FR_CMPSIZ)) + continue; + if ((!ptr && !f->fr_data) || + (ptr && f->fr_data && !bcmp((char *)ptr, (char *)f->fr_data, f->fr_dsize))) break; + } /* * If zero'ing statistics, copy current to caller and zero. @@ -4193,12 +4201,40 @@ } >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jun 24 18:37:15 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DCACB16A420; Fri, 24 Jun 2005 18:37:14 +0000 (GMT) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97C7816A41C; Fri, 24 Jun 2005 18:37:14 +0000 (GMT) (envelope-from peter@wemm.org) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C7E343D49; Fri, 24 Jun 2005 18:37:14 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 617392A8F9; Fri, 24 Jun 2005 11:37:14 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id F20C9E2B3; Fri, 24 Jun 2005 11:37:13 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.3/8.13.1) with ESMTP id j5OIbCRU087560; Fri, 24 Jun 2005 11:37:12 -0700 (PDT) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.3/8.13.1/Submit) id j5OIbCYP087559; Fri, 24 Jun 2005 11:37:12 -0700 (PDT) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: Paul Saab Date: Fri, 24 Jun 2005 11:37:11 -0700 User-Agent: KMail/1.8 References: <200506241619.j5OGJddF058314@repoman.freebsd.org> In-Reply-To: <200506241619.j5OGJddF058314@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506241137.11938.peter@wemm.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 78912 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 18:37:15 -0000 On Friday 24 June 2005 09:19 am, Paul Saab wrote: > checkpoint for new elf crashdump parsing. This does not > support PAE yet. For the viewers on the side, the old kvm_i386.c doesn't support PAE either. This is one thing we mean to change. :-) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 From owner-p4-projects@FreeBSD.ORG Fri Jun 24 19:33:14 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7D4DD16A420; Fri, 24 Jun 2005 19:33:13 +0000 (GMT) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50F1616A41C; Fri, 24 Jun 2005 19:33:13 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2567C43D1D; Fri, 24 Jun 2005 19:33:13 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 6865346B80; Fri, 24 Jun 2005 15:33:12 -0400 (EDT) Date: Fri, 24 Jun 2005 20:36:36 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Peter Wemm In-Reply-To: <200506231604.23036.peter@wemm.org> Message-ID: <20050624203602.M42596@fledge.watson.org> References: <200506222312.j5MNChMh079831@repoman.freebsd.org> <200506231444.08027.jhb@FreeBSD.org> <200506231604.23036.peter@wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Perforce Change Reviews , Peter Wemm , John Baldwin Subject: Re: PERFORCE change 78828 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2005 19:33:14 -0000 On Thu, 23 Jun 2005, Peter Wemm wrote: > On Thursday 23 June 2005 11:44 am, John Baldwin wrote: >> On Wednesday 22 June 2005 07:12 pm, Peter Wemm wrote: >>> http://perforce.freebsd.org/chv.cgi?CH=78828 >>> >>> Change 78828 by peter@peter_melody on 2005/06/22 23:12:33 >>> >>> Freeze things for the dump snapshot. >> >> This may be a bad idea since we may panic with sched_lock held and it >> would be very nice to get a dump there and not just deadlock. > > Yeah. I'm really not sure what to do though because with interrupts > still happening, it upsets some of the driver dump routines. eg: when > you call this from ddb. Aren't we supposed to be running with interrupts disabled, and having IPI'd the other processors to stop (along with a barrier to make sure they did), and operating entirely polled? Robert N M Watson