svn commit: r208651 - head/sys/i386/xen
Author: alc Date: Sun May 30 04:44:32 2010 New Revision: 208651 URL: http://svn.freebsd.org/changeset/base/208651 Log: Merge various changes from i386/i386/pmap.c: The remaining, unmerged portions of r175404 Retire PMAP_DIAGNOSTIC. Any useful diagnostics that were conditionally compiled under PMAP_DIAGNOSTIC are now KASSERT()s. (Note: The kernel option DIAGNOSTIC still disables inlining of certain pmap functions.) Eliminate dead code from pmap_enter(). This code implemented an assertion. On i386, an equivalent check is already implemented. However, on amd64, a small change is required to implement an equivalent check. Eliminate \n from a nearby panic string. Use KASSERT() to reimplement pmap_copy()'s two assertions. Merge portions of r177659 To date, we have assumed that the TLB will only set the PG_M bit in a PTE if that PTE has the PG_RW bit set. However, this assumption does not hold on recent processors from Intel. For example, consider a PTE that has the PG_RW bit set but the PG_M bit clear. Suppose this PTE is cached in the TLB and later the PG_RW bit is cleared in the PTE, but the corresponding TLB entry is not (yet) invalidated. Historically, upon a write access using this (stale) TLB entry, the TLB would observe that the PG_RW bit had been cleared and initiate a page fault, aborting the setting of the PG_M bit in the PTE. Now, however, P4- and Core2-family processors will set the PG_M bit before observing that the PG_RW bit is clear and initiating a page fault. In other words, the write does not occur but the PG_M bit is still set. The real impact of this difference is not that great. Specifically, we should no longer assert that any PTE with the PG_M bit set must also have the PG_RW bit set, and we should ignore the state of the PG_M bit unless the PG_RW bit is set. r208609 Defer freeing any page table pages in pmap_remove_all() until after the page queues lock is released. This may reduce the amount of time that the page queues lock is held by pmap_remove_all(). r208645 When I pushed down the page queues lock into pmap_is_modified(), I created an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls vm_page_dirty() must perform the call first. Otherwise, pmap_is_modified() could return FALSE without acquiring the page queues lock because the page is not (currently) writeable, and the caller to pmap_is_modified() might believe that the page's dirty field is clear because it has not seen the effect of the vm_page_dirty() call. When I pushed down the page queues lock into pmap_is_modified(), I overlooked one place where this ordering dependence is violated: pmap_enter(). In a rare situation pmap_enter() can be called to replace a dirty mapping to one page with a mapping to another page. (I say rare because replacements generally occur as a result of a copy-on-write fault, and so the old page is not dirty.) This change delays clearing PG_WRITEABLE until after vm_page_dirty() has been called. Fixing the ordering dependency also makes it easy to introduce a small optimization: When pmap_enter() used to replace a mapping to one page with a mapping to another page, it freed the pv entry for the first mapping and later called the pv entry allocator for the new mapping. Now, pmap_enter() attempts to recycle the old pv entry, saving two calls to the pv entry allocator. There is no point in setting PG_WRITEABLE on unmanaged pages, so don't. Update a comment to reflect this. Tidy up the variable declarations at the start of pmap_enter(). Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c == --- head/sys/i386/xen/pmap.cSun May 30 03:45:41 2010(r208650) +++ head/sys/i386/xen/pmap.cSun May 30 04:44:32 2010(r208651) @@ -103,8 +103,6 @@ __FBSDID("$FreeBSD$"); * and to when physical maps must be made correct. */ -#define PMAP_DIAGNOSTIC - #include "opt_cpu.h" #include "opt_pmap.h" #include "opt_msgbuf.h" @@ -168,13 +166,11 @@ __FBSDID("$FreeBSD$"); #define PMAP_SHPGPERPROC 200 #endif -#if defined(DIAGNOSTIC) -#define PMAP_DIAGNOSTIC -#endif +#define DIAGNOSTIC -#if !defined(PMAP_DIAGNOSTIC) +#if !defined(DIAGNOSTIC) #ifdef __GNUC_GNU_INLINE__ -#define PMAP_INLINEinline +#define PMAP_INLINE__attribute__((__gnu_inline__)) inline #else #define PMAP_INLINEextern inline #endif @@ -298,6 +294,9 @@ SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, map static voidfree_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t locked_pmap, int try); +static voidpmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static pv_entry_t pmap_pvh_remove(struct md_page *
Re: svn commit: r208649 - head/usr.sbin/newsyslog
Hi gordon. On Sat, 29 May 2010 22:55:59 + (UTC) Gordon Tetlow wrote: > Log: > Add file include processing for newsyslog. > Format for the include line in /etc/newsyslog.conf is: >/etc/defaults/newsyslog.conf Oohh my god, that's great! Do you have any works to support following? 1. include from /usr/local/etc/newsyslog.d/* 2. not supported glob pattern is OK. I want to add and remove to /etc/newsyslog.conf, safe and simlply like: echo include ports > /etc/newsyslog.conf sed -i "" "/include ports/d" /etc/newsyslog.conf And 3. same to syslog.conf -- Norikatsu Shigemura ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208650 - head/sys/dev/fdc
Author: jkim Date: Sun May 30 03:45:41 2010 New Revision: 208650 URL: http://svn.freebsd.org/changeset/base/208650 Log: Fix a regression from r200554, which broke fdc(4) attachment to acpi(4). I removed too many lines and a wrong pointer was accidentally passed down. Tested by:Scott Allendorf (scott-allendorf at uiowa dot edu), kib MFC after:3 days Modified: head/sys/dev/fdc/fdc_acpi.c Modified: head/sys/dev/fdc/fdc_acpi.c == --- head/sys/dev/fdc/fdc_acpi.c Sat May 29 22:55:59 2010(r208649) +++ head/sys/dev/fdc/fdc_acpi.c Sun May 30 03:45:41 2010(r208650) @@ -96,6 +96,7 @@ fdc_acpi_attach(device_t dev) { struct fdc_data *sc; ACPI_BUFFER buf; + ACPI_OBJECT *obj; device_t bus; int error; @@ -131,7 +132,8 @@ fdc_acpi_attach(device_t dev) } /* Add fd child devices as specified. */ - error = fdc_acpi_probe_children(bus, dev, buf.Pointer); + obj = buf.Pointer; + error = fdc_acpi_probe_children(bus, dev, obj->Buffer.Pointer); out: if (buf.Pointer) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208649 - head/usr.sbin/newsyslog
Author: gordon Date: Sat May 29 22:55:59 2010 New Revision: 208649 URL: http://svn.freebsd.org/changeset/base/208649 Log: Add file include processing for newsyslog. Format for the include line in /etc/newsyslog.conf is: /etc/defaults/newsyslog.conf Other notes of interest: Globbing is supported in statements. Properly detect circular include loop dependencies. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after:2 months Modified: head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:55:59 2010 (r208649) @@ -111,6 +111,7 @@ __FBSDID("$FreeBSD$"); #defineDEFAULT_MARKER "" #defineDEBUG_MARKER"" +#defineINCLUDE_MARKER "" struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -149,6 +150,11 @@ struct zipwork_entry { char zw_fname[1]; /* the file to compress */ }; +struct include_entry { + STAILQ_ENTRY(include_entry) inc_nextp; + const char *file; /* Name of file to process */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -156,6 +162,7 @@ typedef enum { STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ @@ -189,10 +196,12 @@ char hostname[MAXHOSTNAMELEN];/* hostna static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p); + struct conf_entry *defconf_p, struct ilist *inclist); +static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); +static int isglobstr(const char *); static char *missing_field(char *p, char *errline); static void change_attrs(const char *, const struct conf_entry *); static fk_entry do_entry(struct conf_entry *); @@ -731,13 +740,15 @@ static struct cflist * get_worklist(char **files) { FILE *f; - const char *fname; char **given; - struct cflist *filelist, *globlist, *cmdlist; + struct cflist *cmdlist, *filelist, *globlist; struct conf_entry *defconf, *dupent, *ent; + struct ilist inclist; + struct include_entry *inc; int gmatch, fnres; defconf = NULL; + STAILQ_INIT(&inclist); filelist = malloc(sizeof(struct cflist)); if (filelist == NULL) @@ -748,21 +759,29 @@ get_worklist(char **files) err(1, "malloc of globlist"); STAILQ_INIT(globlist); - fname = conf; - if (fname == NULL) - fname = _PATH_CONF; + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, "malloc of inc"); + inc->file = conf; + if (inc->file == NULL) + inc->file = _PATH_CONF; + STAILQ_INSERT_TAIL(&inclist, inc, inc_nextp); + + STAILQ_FOREACH(inc, &inclist, inc_nextp) { + if (strcmp(inc->file, "-") != 0) + f = fopen(inc->file, "r"); + else { + f = stdin; + inc->file = ""; + } + if (!f) + err(1, "%s", inc->file); - if (strcmp(fname, "-") != 0) - f = fopen(fname, "r"); - else { - f = stdin; - fname = ""; + if (verbose) + printf("Processing %s\n", inc->file); + parse_file(f, filelist, globlist, defconf, &inclist); + (void) fclose(f); } - if (!f) - err(1, "%s", fname); - - parse_file(f, filelist, globlist, defconf); - (void) fclose(f); /* * All config-file information has been read in and turned into @@ -965,14 +984,16 @@ expand_globs(struct cflist *work_p, stru */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, -struct conf_entry *defconf_p) +struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; struct conf_entry *working; struct passwd *pwd; struct group *grp; + glob_t pglob; int eol, ptm_opts, res, special; + size_t i; errline = NULL; while (fgets(line, BUFSIZ, cf)) { @@ -1017,6 +1038,37 @@ parse_file(FILE *cf, struct cflist *work
svn commit: r208648 - head/usr.sbin/newsyslog
Author: gordon Date: Sat May 29 22:52:17 2010 New Revision: 208648 URL: http://svn.freebsd.org/changeset/base/208648 Log: Convert newsyslog to using queue(3) macros instead of a home rolled version. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after:2 months Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 20:24:01 2010 (r208647) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #defineDEBUG_MARKER"" struct conf_entry { + STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ char *pid_file; /* PID file */ char *r_reason; /* The reason this file is being rotated */ @@ -129,7 +130,6 @@ struct conf_entry { int flags; /* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */ int sig;/* Signal to send */ int def_cfg;/* Using the rule for this file */ - struct conf_entry *next;/* Linked list pointer */ }; struct sigwork_entry { @@ -153,6 +153,7 @@ typedef enum { FREE_ENT, KEEP_ENT } fk_entry; +STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); @@ -186,9 +187,9 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ -static struct conf_entry *get_worklist(char **files); -static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p); +static struct cflist *get_worklist(char **files); +static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); @@ -205,9 +206,8 @@ static struct zipwork_entry * sigwork_entry *, int, const char *); static void set_swpid(struct sigwork_entry *, const struct conf_entry *); static int sizefile(const char *); -static void expand_globs(struct conf_entry **work_p, - struct conf_entry **glob_p); -static void free_clist(struct conf_entry **firstent); +static void expand_globs(struct cflist *work_p, struct cflist *glob_p); +static void free_clist(struct cflist *list); static void free_entry(struct conf_entry *ent); static struct conf_entry *init_entry(const char *fname, struct conf_entry *src_entry); @@ -233,8 +233,8 @@ static void createlog(const struct conf_ int main(int argc, char **argv) { - fk_entry free_or_keep; - struct conf_entry *p, *q; + struct cflist *worklist; + struct conf_entry *p; struct sigwork_entry *stmp; struct zipwork_entry *ztmp; @@ -247,18 +247,17 @@ main(int argc, char **argv) if (needroot && getuid() && geteuid()) errx(1, "must have root privs"); - p = q = get_worklist(argv); + worklist = get_worklist(argv); /* * Rotate all the files which need to be rotated. Note that * some users have *hundreds* of entries in newsyslog.conf! */ - while (p) { - free_or_keep = do_entry(p); - p = p->next; - if (free_or_keep == FREE_ENT) - free_entry(q); - q = p; + while (!STAILQ_EMPTY(worklist)) { + p = STAILQ_FIRST(worklist); + STAILQ_REMOVE_HEAD(worklist, cf_nextp); + if (do_entry(p) == FREE_ENT) + free_entry(p); } /* @@ -365,7 +364,6 @@ init_entry(const char *fname, struct con tempwork->sig = SIGHUP; tempwork->def_cfg = 0; } - tempwork->next = NULL; return (tempwork); } @@ -403,21 +401,18 @@ free_entry(struct conf_entry *ent) } static void -free_clist(struct conf_entry **firstent) +free_clist(struct cflist *list) { - struct conf_entry *ent, *nextent; - - if (firstent == NULL) - return; /* There is nothing to do. */ + struct conf_entry *ent; - ent = *firstent; - firstent = NULL; - - while (ent) { - nextent = ent->next; + while (!STAILQ_EMPTY(list)) { + ent = STAILQ_FIRST(list); + STAILQ_REMOVE_HEAD(list, cf_nextp); free_entry(ent); - ent = nextent; } + + free(list); + list = NULL; } static fk_entry @@ -732,17 +727,26 @@ usage(void) * Parse a configuration file and
Re: svn commit: r208644 - head/sys/dev/ath/ath_hal/ar5211
On 29 May 2010, at 17:14, Rui Paulo wrote: > Author: rpaulo > Date: Sat May 29 16:14:02 2010 > New Revision: 208644 > URL: http://svn.freebsd.org/changeset/base/208644 > > Log: > Due to the way HALDEBUG() is defined, we need to add curly brackets > when using it as a sole if clause instruction. > While there, fix 'const static' typo. > > Submitted by:Arnaud Lacombe This should read a...@netbsd.org. Regards, -- Rui Paulo ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208647 - in head: sbin/mount share/man/man5
Author: jilles Date: Sat May 29 20:24:01 2010 New Revision: 208647 URL: http://svn.freebsd.org/changeset/base/208647 Log: Clarify devfs manpages slightly. mount(8): add xref to devfs(5) devfs(5): change example to something more likely to be useful (it is not necessary to mount a devfs on /dev manually, but for chroots/jails it is often needed), mention since when devfs is preferred to device nodes on ufs PR: 146600 MFC after:2 weeks Modified: head/sbin/mount/mount.8 head/share/man/man5/devfs.5 Modified: head/sbin/mount/mount.8 == --- head/sbin/mount/mount.8 Sat May 29 18:26:44 2010(r208646) +++ head/sbin/mount/mount.8 Sat May 29 20:24:01 2010(r208647) @@ -525,6 +525,7 @@ support for a particular file system mig .Xr nmount 2 , .Xr acl 3 , .Xr mac 4 , +.Xr devfs 5 , .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , Modified: head/share/man/man5/devfs.5 == --- head/share/man/man5/devfs.5 Sat May 29 18:26:44 2010(r208646) +++ head/share/man/man5/devfs.5 Sat May 29 20:24:01 2010(r208647) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd May 29, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -80,9 +80,9 @@ mount point. To mount a .Nm volume located on -.Pa /dev : +.Pa /mychroot/dev : .Pp -.Dl "mount -t devfs devfs /dev" +.Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , .Xr mount 8 @@ -90,7 +90,9 @@ volume located on The .Nm file system first appeared in -.Fx 2.0 . +.Fx 2.0 +and became the preferred method for accessing devices in +.Fx 5.0 . The .Nm manual page first appeared in ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208646 - head/sys/ia64/ia64
Author: alc Date: Sat May 29 18:26:44 2010 New Revision: 208646 URL: http://svn.freebsd.org/changeset/base/208646 Log: Don't set PG_WRITEABLE in pmap_enter() unless the page is managed. Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c == --- head/sys/ia64/ia64/pmap.c Sat May 29 17:10:45 2010(r208645) +++ head/sys/ia64/ia64/pmap.c Sat May 29 18:26:44 2010(r208646) @@ -1595,7 +1595,7 @@ validate: if (icache_inval) ia64_sync_icache(va, PAGE_SIZE); - if ((prot & VM_PROT_WRITE) != 0) + if ((prot & VM_PROT_WRITE) != 0 && managed) vm_page_flag_set(m, PG_WRITEABLE); vm_page_unlock_queues(); pmap_switch(oldpmap); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208645 - in head/sys: amd64/amd64 i386/i386 vm
Author: alc Date: Sat May 29 17:10:45 2010 New Revision: 208645 URL: http://svn.freebsd.org/changeset/base/208645 Log: When I pushed down the page queues lock into pmap_is_modified(), I created an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls vm_page_dirty() must perform the call first. Otherwise, pmap_is_modified() could return FALSE without acquiring the page queues lock because the page is not (currently) writeable, and the caller to pmap_is_modified() might believe that the page's dirty field is clear because it has not seen the effect of the vm_page_dirty() call. When I pushed down the page queues lock into pmap_is_modified(), I overlooked one place where this ordering dependence is violated: pmap_enter(). In a rare situation pmap_enter() can be called to replace a dirty mapping to one page with a mapping to another page. (I say rare because replacements generally occur as a result of a copy-on-write fault, and so the old page is not dirty.) This change delays clearing PG_WRITEABLE until after vm_page_dirty() has been called. Fixing the ordering dependency also makes it easy to introduce a small optimization: When pmap_enter() used to replace a mapping to one page with a mapping to another page, it freed the pv entry for the first mapping and later called the pv entry allocator for the new mapping. Now, pmap_enter() attempts to recycle the old pv entry, saving two calls to the pv entry allocator. There is no point in setting PG_WRITEABLE on unmanaged pages, so don't. Update a comment to reflect this. Tidy up the variable declarations at the start of pmap_enter(). Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Sat May 29 16:14:02 2010(r208644) +++ head/sys/amd64/amd64/pmap.c Sat May 29 17:10:45 2010(r208645) @@ -3128,11 +3128,11 @@ void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { - vm_paddr_t pa; pd_entry_t *pde; pt_entry_t *pte; - vm_paddr_t opa; - pt_entry_t origpte, newpte; + pt_entry_t newpte, origpte; + pv_entry_t pv; + vm_paddr_t opa, pa; vm_page_t mpte, om; boolean_t invlva; @@ -3200,6 +3200,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } goto validate; } + + pv = NULL; + /* * Mapping has changed, invalidate old range and fall through to * handle validating new mapping. @@ -3209,7 +3212,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pmap->pm_stats.wired_count--; if (origpte & PG_MANAGED) { om = PHYS_TO_VM_PAGE(opa); - pmap_remove_entry(pmap, om, va); + pv = pmap_pvh_remove(&om->md, pmap, va); } if (mpte != NULL) { mpte->wire_count--; @@ -3226,9 +3229,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - pmap_insert_entry(pmap, va, m); + if (pv == NULL) + pv = get_pv_entry(pmap, FALSE); + pv->pv_va = va; + TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); pa |= PG_MANAGED; - } + } else if (pv != NULL) + free_pv_entry(pmap, pv); /* * Increment counters @@ -3243,7 +3250,8 @@ validate: newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V); if ((prot & VM_PROT_WRITE) != 0) { newpte |= PG_RW; - vm_page_flag_set(m, PG_WRITEABLE); + if ((newpte & PG_MANAGED) != 0) + vm_page_flag_set(m, PG_WRITEABLE); } if ((prot & VM_PROT_EXECUTE) == 0) newpte |= pg_nx; @@ -3278,6 +3286,10 @@ validate: if ((newpte & PG_RW) == 0) invlva = TRUE; } + if ((origpte & PG_MANAGED) != 0 && + TAILQ_EMPTY(&om->md.pv_list) && + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list)) + vm_page_flag_clear(om, PG_WRITEABLE); if (invlva) pmap_invalidate_page(pmap, va); } else Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Sat May 29 16:14:02 2010(r208
svn commit: r208644 - head/sys/dev/ath/ath_hal/ar5211
Author: rpaulo Date: Sat May 29 16:14:02 2010 New Revision: 208644 URL: http://svn.freebsd.org/changeset/base/208644 Log: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. While there, fix 'const static' typo. Submitted by: Arnaud Lacombe MFC after:1 week Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c == --- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Sat May 29 16:11:51 2010(r208643) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Sat May 29 16:14:02 2010(r208644) @@ -46,7 +46,7 @@ typedef struct { } CHAN_INFO_2GHZ; #define CI_2GHZ_INDEX_CORRECTION 19 -const static CHAN_INFO_2GHZ chan2GHzData[] = { +static const CHAN_INFO_2GHZ chan2GHzData[] = { { 1, 0x46, 96 }, /* 2312 -19 */ { 1, 0x46, 97 }, /* 2317 -18 */ { 1, 0x46, 98 }, /* 2322 -17 */ @@ -926,9 +926,10 @@ ar5211IsNfGood(struct ath_hal *ah, struc if (!getNoiseFloorThresh(ah, chan, &nfThresh)) return AH_FALSE; - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) + if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF did not complete in calibration window\n", __func__); + } nf = ar5211GetNoiseFloor(ah); if (nf > nfThresh) { HALDEBUG(ah, HAL_DEBUG_ANY, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208643 - head/sys/dev/ath/ath_hal/ar5210
Author: rpaulo Date: Sat May 29 16:11:51 2010 New Revision: 208643 URL: http://svn.freebsd.org/changeset/base/208643 Log: Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. Submitted by: Arnaud Lacombe MFC after:1 week Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c == --- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Sat May 29 16:10:07 2010(r208642) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Sat May 29 16:11:51 2010(r208643) @@ -526,9 +526,10 @@ ar5210PerCalibrationN(struct ath_hal *ah /* AGC calibration (this was added to make the NF threshold check work) */ OS_REG_WRITE(ah, AR_PHY_AGCCTL, OS_REG_READ(ah, AR_PHY_AGCCTL) | AR_PHY_AGC_CAL); - if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) + if (!ath_hal_wait(ah, AR_PHY_AGCCTL, AR_PHY_AGC_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: AGC calibration timeout\n", __func__); + } /* Rewrite our AGC values we stored off earlier (return AGC to normal operation) */ OS_REG_WRITE(ah, 0x9858, reg9858); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208642 - head/sys/dev/ath/ath_hal
Author: rpaulo Date: Sat May 29 16:10:07 2010 New Revision: 208642 URL: http://svn.freebsd.org/changeset/base/208642 Log: Don't shadow the global variable 'version'. Submitted by: Arnaud Lacombe MFC after:1 week Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v1.c == --- head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 29 13:05:41 2010 (r208641) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 29 16:10:07 2010 (r208642) @@ -112,7 +112,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a { HAL_EEPROM_v1 *ee = AH_PRIVATE(ah)->ah_eeprom; uint16_t athvals[AR_EEPROM_ATHEROS_MAX];/* XXX off stack */ - uint16_t protect, version, eeval; + uint16_t protect, eeprom_version, eeval; uint32_t sum; int i, loc; @@ -138,18 +138,18 @@ ath_hal_v1EepromAttach(struct ath_hal *a HALDEBUG(ah, HAL_DEBUG_ATTACH, "EEPROM protect 0x%x\n", protect); /* XXX check proper access before continuing */ - if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &version)) { + if (!ath_hal_eepromRead(ah, AR_EEPROM_VERSION, &eeprom_version)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to read EEPROM version\n", __func__); return HAL_EEREAD; } - if (((version>>12) & 0xf) != 1) { + if (((eeprom_version>>12) & 0xf) != 1) { /* * This code only groks the version 1 EEPROM layout. */ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unsupported EEPROM version 0x%x found\n", - __func__, version); + __func__, eeprom_version); return HAL_EEVERSION; } @@ -183,7 +183,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a return HAL_ENOMEM; } - ee->ee_version = version; + ee->ee_version = eeprom_version; ee->ee_protect = protect; ee->ee_antenna = athvals[2]; ee->ee_biasCurrents = athvals[3]; @@ -243,7 +243,7 @@ ath_hal_v1EepromAttach(struct ath_hal *a } AH_PRIVATE(ah)->ah_eeprom = ee; - AH_PRIVATE(ah)->ah_eeversion = version; + AH_PRIVATE(ah)->ah_eeversion = eeprom_version; AH_PRIVATE(ah)->ah_eepromDetach = v1EepromDetach; AH_PRIVATE(ah)->ah_eepromGet = v1EepromGet; AH_PRIVATE(ah)->ah_eepromSet = v1EepromSet; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208639 - head/sys/pc98/pc98
Author: nyan Date: Sat May 29 09:12:02 2010 New Revision: 208639 URL: http://svn.freebsd.org/changeset/base/208639 Log: MFi386: the part of revision 181809 Use SEL_KPL macro. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c == --- head/sys/pc98/pc98/machdep.cSat May 29 09:07:40 2010 (r208638) +++ head/sys/pc98/pc98/machdep.cSat May 29 09:12:02 2010 (r208639) @@ -1439,7 +1439,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0x0, .ssd_type = 0, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 0, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 0, @@ -1448,7 +1448,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xf, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1475,7 +1475,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xf, .ssd_type = SDT_MEMERA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1484,7 +1484,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x0, .ssd_limit = 0xf, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, @@ -1511,7 +1511,7 @@ struct soft_segment_descriptor gdt_segs[ { .ssd_base = 0x400, .ssd_limit = 0xf, .ssd_type = SDT_MEMRWA, - .ssd_dpl = 0, + .ssd_dpl = SEL_KPL, .ssd_p = 1, .ssd_xx = 0, .ssd_xx1 = 0, .ssd_def32 = 1, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r208638 - head/sys/pc98/pc98
Author: nyan Date: Sat May 29 09:07:40 2010 New Revision: 208638 URL: http://svn.freebsd.org/changeset/base/208638 Log: MFi386: revision 178471 - Add an integer argument to idle to indicate how likely we are to wake from idle over the next tick. - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are suspended in cpu specific states. This function can fail and cause the scheduler to fall back to another mechanism (ipi). - Implement support for mwait in cpu_idle() on i386/amd64 machines that support it. mwait is a higher performance way to synchronize cpus as compared to hlt & ipis. - Allow selecting the idle routine by name via sysctl machdep.idle. This replaces machdep.cpu_idle_hlt. Only idle routines supported by the current machine are permitted. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c == --- head/sys/pc98/pc98/machdep.cSat May 29 09:07:25 2010 (r208637) +++ head/sys/pc98/pc98/machdep.cSat May 29 09:07:40 2010 (r208638) @@ -1108,6 +1108,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * return (0); } + /* * Shutdown the CPU as much as possible */ @@ -1118,70 +1119,177 @@ cpu_halt(void) __asm__ ("hlt"); } -/* - * Hook to idle the CPU when possible. In the SMP case we default to - * off because a halted cpu will not currently pick up a new thread in the - * run queue until the next timer tick. If turned on this will result in - * approximately a 4.2% loss in real time performance in buildworld tests - * (but improves user and sys times oddly enough), and saves approximately - * 5% in power consumption on an idle machine (tests w/2xCPU 1.1GHz P3). - * - * XXX we need to have a cpu mask of idle cpus and generate an IPI or - * otherwise generate some sort of interrupt to wake up cpus sitting in HLT. - * Then we can have our cake and eat it too. - * - * XXX I'm turning it on for SMP as well by default for now. It seems to - * help lock contention somewhat, and this is critical for HTT. -Peter - */ -static int cpu_idle_hlt = 1; -TUNABLE_INT("machdep.cpu_idle_hlt", &cpu_idle_hlt); -SYSCTL_INT(_machdep, OID_AUTO, cpu_idle_hlt, CTLFLAG_RW, -&cpu_idle_hlt, 0, "Idle loop HLT enable"); - static void -cpu_idle_default(void) +cpu_idle_hlt(int busy) { /* -* we must absolutely guarentee that hlt is the -* absolute next instruction after sti or we -* introduce a timing window. +* we must absolutely guarentee that hlt is the next instruction +* after sti or we introduce a timing window. */ - __asm __volatile("sti; hlt"); + disable_intr(); + if (sched_runnable()) + enable_intr(); + else + __asm __volatile("sti; hlt"); } -/* - * Note that we have to be careful here to avoid a race between checking - * sched_runnable() and actually halting. If we don't do this, we may waste - * the time between calling hlt and the next interrupt even though there - * is a runnable process. - */ +static void +cpu_idle_spin(int busy) +{ + return; +} + +void (*cpu_idle_fn)(int) = cpu_idle_hlt; + void cpu_idle(int busy) { - -#ifdef SMP +#if defined(SMP) if (mp_grab_cpu_hlt()) return; #endif + cpu_idle_fn(busy); +} + +/* + * mwait cpu power states. Lower 4 bits are sub-states. + */ +#defineMWAIT_C00xf0 +#defineMWAIT_C10x00 +#defineMWAIT_C20x10 +#defineMWAIT_C30x20 +#defineMWAIT_C40x30 + +#defineMWAIT_DISABLED 0x0 +#defineMWAIT_WOKEN 0x1 +#defineMWAIT_WAITING 0x2 + +static void +cpu_idle_mwait(int busy) +{ + int *mwait; - if (cpu_idle_hlt) { - disable_intr(); - if (sched_runnable()) - enable_intr(); - else - (*cpu_idle_hook)(); + mwait = (int *)PCPU_PTR(monitorbuf); + *mwait = MWAIT_WAITING; + if (sched_runnable()) + return; + cpu_monitor(mwait, 0, 0); + if (*mwait == MWAIT_WAITING) + cpu_mwait(0, MWAIT_C1); +} + +static void +cpu_idle_mwait_hlt(int busy) +{ + int *mwait; + + mwait = (int *)PCPU_PTR(monitorbuf); + if (busy == 0) { + *mwait = MWAIT_DISABLED; + cpu_idle_hlt(busy); + return; } + *mwait = MWAIT_WAITING; + if (sched_runnable()) + return; + cpu_monitor(mwait, 0, 0); + if (*mwait == MWAIT_WAITING) + cpu_mwait(0, MWAIT_C1); } int cpu_idle_wakeup(int cpu) { + struct pcpu *pcpu; + int *mwait; - return (0); + if (cpu_idle_fn == cpu_idle_spin) + return (1); + if (cpu_idle_fn != cpu_idle_mwait && cpu