From owner-svn-src-projects@FreeBSD.ORG Mon Nov 3 07:52:19 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EEA106564A; Mon, 3 Nov 2008 07:52:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC6188FC13; Mon, 3 Nov 2008 07:52:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA37qJqI060205; Mon, 3 Nov 2008 07:52:19 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA37qJGa060194; Mon, 3 Nov 2008 07:52:19 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811030752.mA37qJGa060194@svn.freebsd.org> From: Kip Macy Date: Mon, 3 Nov 2008 07:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184585 - in projects/releng_7_xen/sys: conf dev/xen/console dev/xen/netfront i386/conf i386/i386 i386/include i386/isa i386/pci kern libkern sys xen/xenbus X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 07:52:19 -0000 Author: kmacy Date: Mon Nov 3 07:52:18 2008 New Revision: 184585 URL: http://svn.freebsd.org/changeset/base/184585 Log: Checkpoint current state of integration - still need to resolve 3 or 4 files Added: projects/releng_7_xen/sys/i386/conf/XEN projects/releng_7_xen/sys/libkern/strcspn.c (contents, props changed) Modified: projects/releng_7_xen/sys/conf/files projects/releng_7_xen/sys/conf/files.i386 projects/releng_7_xen/sys/conf/options.i386 projects/releng_7_xen/sys/dev/xen/console/console.c projects/releng_7_xen/sys/dev/xen/netfront/netfront.c projects/releng_7_xen/sys/i386/i386/genassym.c projects/releng_7_xen/sys/i386/i386/intr_machdep.c projects/releng_7_xen/sys/i386/i386/local_apic.c projects/releng_7_xen/sys/i386/i386/machdep.c projects/releng_7_xen/sys/i386/i386/swtch.s projects/releng_7_xen/sys/i386/i386/sys_machdep.c projects/releng_7_xen/sys/i386/i386/vm_machdep.c projects/releng_7_xen/sys/i386/include/apicvar.h projects/releng_7_xen/sys/i386/include/asmacros.h projects/releng_7_xen/sys/i386/include/cpufunc.h projects/releng_7_xen/sys/i386/include/param.h projects/releng_7_xen/sys/i386/include/pcpu.h projects/releng_7_xen/sys/i386/include/pmap.h projects/releng_7_xen/sys/i386/include/segments.h projects/releng_7_xen/sys/i386/include/smp.h projects/releng_7_xen/sys/i386/include/vmparam.h projects/releng_7_xen/sys/i386/isa/npx.c projects/releng_7_xen/sys/i386/pci/pci_cfgreg.c projects/releng_7_xen/sys/i386/pci/pci_pir.c projects/releng_7_xen/sys/kern/kern_fork.c projects/releng_7_xen/sys/kern/kern_synch.c projects/releng_7_xen/sys/kern/subr_trap.c projects/releng_7_xen/sys/sys/libkern.h projects/releng_7_xen/sys/xen/xenbus/xenbus_xs.c Modified: projects/releng_7_xen/sys/conf/files ============================================================================== --- projects/releng_7_xen/sys/conf/files Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/conf/files Mon Nov 3 07:52:18 2008 (r184585) @@ -2201,3 +2201,19 @@ gnu/fs/xfs/xfs_iomap.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_behavior.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + + +xen/gnttab.c optional xen +xen/features.c optional xen +xen/evtchn/evtchn.c optional xen +xen/evtchn/evtchn_dev.c optional xen +xen/xenbus/xenbus_client.c optional xen +xen/xenbus/xenbus_comms.c optional xen +xen/xenbus/xenbus_dev.c optional xen +xen/xenbus/xenbus_probe.c optional xen +xen/xenbus/xenbus_probe_backend.c optional xen +xen/xenbus/xenbus_xs.c optional xen +dev/xen/console/console.c optional xen +dev/xen/console/xencons_ring.c optional xen +dev/xen/blkfront/blkfront.c optional xen +dev/xen/netfront/netfront.c optional xen Modified: projects/releng_7_xen/sys/conf/files.i386 ============================================================================== --- projects/releng_7_xen/sys/conf/files.i386 Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/conf/files.i386 Mon Nov 3 07:52:18 2008 (r184585) @@ -261,8 +261,8 @@ i386/cpufreq/smist.c optional cpufreq i386/i386/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" i386/i386/autoconf.c standard -i386/i386/bios.c standard -i386/i386/bioscall.s standard +i386/i386/bios.c optional native +i386/i386/bioscall.s optional native i386/i386/bpf_jit_machdep.c optional bpf_jitter i386/i386/busdma_machdep.c standard i386/i386/db_disasm.c optional ddb @@ -271,7 +271,8 @@ i386/i386/db_trace.c optional ddb i386/i386/dump_machdep.c standard i386/i386/elan-mmcr.c optional cpu_elan | cpu_soekris i386/i386/elf_machdep.c standard -i386/i386/exception.s standard +i386/i386/exception.s optional native +i386/xen/exception.s optional xen i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode i386/i386/i686_mem.c optional mem @@ -282,23 +283,28 @@ i386/i386/intr_machdep.c standard i386/i386/io.c optional io i386/i386/io_apic.c optional apic i386/i386/k6_mem.c optional mem -i386/i386/legacy.c standard +i386/i386/legacy.c optional native i386/i386/local_apic.c optional apic -i386/i386/locore.s standard no-obj +i386/i386/locore.s optional native no-obj +i386/xen/locore.s optional xen no-obj i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard +i386/xen/xen_machdep.c optional xen i386/i386/mem.c optional mem i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp -i386/i386/mp_machdep.c optional smp +i386/i386/mp_machdep.c optional native smp +i386/xen/mp_machdep.c optional xen smp i386/i386/mp_watchdog.c optional mp_watchdog smp -i386/i386/mpboot.s optional smp -i386/i386/mptable.c optional apic +i386/i386/mpboot.s optional smp native +i386/i386/mptable.c optional apic native +i386/xen/mptable.c optional apic xen i386/i386/mptable_pci.c optional apic pci i386/i386/msi.c optional apic pci i386/i386/nexus.c standard i386/i386/perfmon.c optional perfmon -i386/i386/pmap.c standard +i386/i386/pmap.c optional native +i386/xen/pmap.c optional xen i386/i386/ptrace_machdep.c standard i386/i386/stack_machdep.c optional ddb | stack i386/i386/support.s standard @@ -328,9 +334,10 @@ i386/ibcs2/ibcs2_util.c optional ibcs2 i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c standard +i386/isa/atpic.c optional atpic #i386/isa/atpic_vector.s standard -i386/isa/clock.c standard +i386/isa/clock.c optional native +i386/xen/clock.c optional xen i386/isa/dpms.c optional dpms i386/isa/elcr.c standard i386/isa/elink.c optional ep | ie Modified: projects/releng_7_xen/sys/conf/options.i386 ============================================================================== --- projects/releng_7_xen/sys/conf/options.i386 Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/conf/options.i386 Mon Nov 3 07:52:18 2008 (r184585) @@ -150,3 +150,6 @@ STOP_NMI opt_cpu.h # BPF just-in-time compiler BPF_JITTER opt_bpf.h + +NATIVE opt_global.h +XEN opt_global.h Modified: projects/releng_7_xen/sys/dev/xen/console/console.c ============================================================================== --- projects/releng_7_xen/sys/dev/xen/console/console.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/dev/xen/console/console.c Mon Nov 3 07:52:18 2008 (r184585) @@ -1,5 +1,5 @@ #include -__FBSDID("$FreeBSD$"); + #include #include @@ -18,8 +18,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include @@ -32,7 +32,9 @@ __FBSDID("$FreeBSD$"); static char driver_name[] = "xc"; devclass_t xc_devclass; /* do not make static */ -static void xcoutwakeup(struct tty *); +static void xcstart (struct tty *); +static int xcparam (struct tty *, struct termios *); +static void xcstop (struct tty *, int); static void xc_timeout(void *); static void __xencons_tx_flush(void); static boolean_t xcons_putc(int c); @@ -42,7 +44,7 @@ static void xc_shutdown(void *arg, int h static int xc_mute; static void xcons_force_flush(void); -static void xencons_priv_interrupt(void *); +static int xencons_priv_interrupt(void *); static cn_probe_t xccnprobe; static cn_init_t xccninit; @@ -72,7 +74,7 @@ static unsigned int cnsl_evt_reg; static unsigned int wc, wp; /* write_cons, write_prod */ #define CDEV_MAJOR 12 -#define XCUNIT(x) (dev2unit(x)) +#define XCUNIT(x) (minor(x)) #define ISTTYOPEN(tp) ((tp) && ((tp)->t_state & TS_ISOPEN)) #define CN_LOCK_INIT(x, _name) \ mtx_init(&x, _name, NULL, MTX_SPIN|MTX_RECURSE) @@ -93,20 +95,34 @@ static unsigned int wc, wp; /* write_con static struct tty *xccons; -static tsw_open_t xcopen; -static tsw_close_t xcclose; +struct xc_softc { + int xc_unit; + struct cdev *xc_dev; +}; + -static struct ttydevsw xc_ttydevsw = { - .tsw_flags = TF_NOPREFIX, - .tsw_open = xcopen, - .tsw_close = xcclose, - .tsw_outwakeup = xcoutwakeup, +static d_open_t xcopen; +static d_close_t xcclose; +static d_ioctl_t xcioctl; + +static struct cdevsw xc_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_TTY | D_NEEDGIANT, + .d_name = driver_name, + .d_open = xcopen, + .d_close = xcclose, + .d_read = ttyread, + .d_write = ttywrite, + .d_ioctl = xcioctl, + .d_poll = ttypoll, + .d_kqfilter = ttykqfilter, }; static void xccnprobe(struct consdev *cp) { cp->cn_pri = CN_REMOTE; + cp->cn_tp = xccons; sprintf(cp->cn_name, "%s0", driver_name); } @@ -209,20 +225,32 @@ xc_identify(driver_t *driver, device_t p static int xc_probe(device_t dev) { + struct xc_softc *sc = (struct xc_softc *)device_get_softc(dev); + sc->xc_unit = device_get_unit(dev); return (0); } static int xc_attach(device_t dev) { + struct xc_softc *sc = (struct xc_softc *)device_get_softc(dev); + if (xen_start_info->flags & SIF_INITDOMAIN) { xc_consdev.cn_putc = xccnputc_dom0; } - xccons = tty_alloc(&xc_ttydevsw, NULL, NULL); - tty_makedev(xccons, NULL, "xc%r", 0); + sc->xc_dev = make_dev(&xc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "xc%r", 0); + xccons = ttyalloc(); + + sc->xc_dev->si_drv1 = (void *)sc; + sc->xc_dev->si_tty = xccons; + + xccons->t_oproc = xcstart; + xccons->t_param = xcparam; + xccons->t_stop = xcstop; + xccons->t_dev = sc->xc_dev; callout_init(&xc_callout, 0); @@ -236,9 +264,8 @@ xc_attach(device_t dev) VIRQ_CONSOLE, 0, "console", - NULL, xencons_priv_interrupt, - INTR_TYPE_TTY) < 0); + NULL, INTR_TYPE_TTY) < 0); } @@ -266,15 +293,11 @@ xencons_rx(char *buf, unsigned len) { int i; struct tty *tp = xccons; - - if (xen_console_up) { - tty_lock(tp); - for (i = 0; i < len; i++) - ttydisc_rint(tp, buf[i], 0); - ttydisc_rint_done(tp); - tty_unlock(tp); - } else { - for (i = 0; i < len; i++) + + for (i = 0; i < len; i++) { + if (xen_console_up) + (*linesw[tp->t_line]->l_rint)(buf[i], tp); + else rbuf[RBUF_MASK(rp++)] = buf[i]; } } @@ -282,7 +305,7 @@ xencons_rx(char *buf, unsigned len) static void __xencons_tx_flush(void) { - int sz; + int sz, work_done = 0; CN_LOCK(cn_mtx); while (wc != wp) { @@ -299,8 +322,16 @@ __xencons_tx_flush(void) break; wc += sent; } + work_done = 1; } CN_UNLOCK(cn_mtx); + + /* + * ttwakeup calls routines using blocking locks + * + */ + if (work_done && xen_console_up && curthread->td_critnest == 0) + ttwakeup(xccons); } void @@ -309,7 +340,7 @@ xencons_tx(void) __xencons_tx_flush(); } -static void +static int xencons_priv_interrupt(void *arg) { @@ -320,21 +351,79 @@ xencons_priv_interrupt(void *arg) xencons_rx(rbuf, l); xencons_tx(); + return (FILTER_HANDLED); } -static int -xcopen(struct tty *tp) +int +xcopen(struct cdev *dev, int flag, int mode, struct thread *td) { + struct xc_softc *sc; + int unit = XCUNIT(dev); + struct tty *tp; + int s, error; + + sc = (struct xc_softc *)device_get_softc( + devclass_get_device(xc_devclass, unit)); + if (sc == NULL) + return (ENXIO); + + tp = dev->si_tty; + s = spltty(); + if (!ISTTYOPEN(tp)) { + tp->t_state |= TS_CARR_ON; + ttychars(tp); + tp->t_iflag = TTYDEF_IFLAG; + tp->t_oflag = TTYDEF_OFLAG; + tp->t_cflag = TTYDEF_CFLAG|CLOCAL; + tp->t_lflag = TTYDEF_LFLAG; + tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; + xcparam(tp, &tp->t_termios); + ttsetwater(tp); + } else if (tp->t_state & TS_XCLUDE && suser(td)) { + splx(s); + return (EBUSY); + } + splx(s); xen_console_up = 1; + + error = (*linesw[tp->t_line]->l_open)(dev, tp); + return error; +} + +int +xcclose(struct cdev *dev, int flag, int mode, struct thread *td) +{ + struct tty *tp = dev->si_tty; + + if (tp == NULL) + return (0); + xen_console_up = 0; + + spltty(); + (*linesw[tp->t_line]->l_close)(tp, flag); + tty_close(tp); + spl0(); return (0); } -static void -xcclose(struct tty *tp) + +int +xcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { + struct tty *tp = dev->si_tty; + int error; + + error = (*linesw[tp->t_line]->l_ioctl)(tp, cmd, data, flag, td); + if (error != ENOIOCTL) + return (error); - xen_console_up = 0; + error = ttioctl(tp, cmd, data, flag); + + if (error != ENOIOCTL) + return (error); + + return (ENOTTY); } static inline int @@ -349,15 +438,31 @@ __xencons_put_char(int ch) static void -xcoutwakeup(struct tty *tp) +xcstart(struct tty *tp) { boolean_t cons_full = FALSE; - char c; - while (ttydisc_getc(tp, &c, 1) == 1 && !cons_full) - cons_full = xcons_putc(c); + CN_LOCK(cn_mtx); + if (tp->t_state & (TS_TIMEOUT | TS_TTSTOP)) { + CN_UNLOCK(cn_mtx); + + ttwwakeup(tp); + return; + } - if (cons_full) { + tp->t_state |= TS_BUSY; + CN_UNLOCK(cn_mtx); + + while (tp->t_outq.c_cc != 0 && !cons_full) + cons_full = xcons_putc(getc(&tp->t_outq)); + + /* if the console is close to full leave our state as busy */ + if (!cons_full) { + CN_LOCK(cn_mtx); + tp->t_state &= ~TS_BUSY; + CN_UNLOCK(cn_mtx); + ttwwakeup(tp); + } else { /* let the timeout kick us in a bit */ xc_start_needed = TRUE; } @@ -365,6 +470,17 @@ xcoutwakeup(struct tty *tp) } static void +xcstop(struct tty *tp, int flag) +{ + + if (tp->t_state & TS_BUSY) { + if ((tp->t_state & TS_TTSTOP) == 0) { + tp->t_state |= TS_FLUSH; + } + } +} + +static void xc_timeout(void *v) { struct tty *tp; @@ -372,19 +488,33 @@ xc_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); - while ((c = xccncheckc(NULL)) != -1) - ttydisc_rint(tp, c, 0); + while ((c = xccncheckc(NULL)) != -1) { + if (tp->t_state & TS_ISOPEN) { + (*linesw[tp->t_line]->l_rint)(c, tp); + } + } if (xc_start_needed) { xc_start_needed = FALSE; - xcoutwakeup(tp); + xcstart(tp); } - tty_unlock(tp); callout_reset(&xc_callout, XC_POLLTIME, xc_timeout, tp); } +/* + * Set line parameters. + */ +int +xcparam(struct tty *tp, struct termios *t) +{ + tp->t_ispeed = t->c_ispeed; + tp->t_ospeed = t->c_ospeed; + tp->t_cflag = t->c_cflag; + return (0); +} + + static device_method_t xc_methods[] = { DEVMETHOD(device_identify, xc_identify), DEVMETHOD(device_probe, xc_probe), @@ -395,7 +525,7 @@ static device_method_t xc_methods[] = { static driver_t xc_driver = { driver_name, xc_methods, - 0, + sizeof(struct xc_softc), }; /*** Forcibly flush console data before dying. ***/ Modified: projects/releng_7_xen/sys/dev/xen/netfront/netfront.c ============================================================================== --- projects/releng_7_xen/sys/dev/xen/netfront/netfront.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/dev/xen/netfront/netfront.c Mon Nov 3 07:52:18 2008 (r184585) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -347,7 +348,7 @@ makembuf (struct mbuf *buf) m->m_len = buf->m_len; m_copydata(buf, 0, buf->m_pkthdr.len, mtod(m,caddr_t) ); - m->m_ext.ext_arg1 = (caddr_t *)(uintptr_t)(vtophys(mtod(m,caddr_t)) >> PAGE_SHIFT); + m->m_ext.ext_args = (caddr_t *)(uintptr_t)(vtophys(mtod(m,caddr_t)) >> PAGE_SHIFT); return m; } @@ -749,7 +750,7 @@ refill: if ((m_new = mbufq_dequeue(&sc->xn_rx_batch)) == NULL) break; - m_new->m_ext.ext_arg1 = (vm_paddr_t *)(uintptr_t)( + m_new->m_ext.ext_args = (vm_paddr_t *)(uintptr_t)( vtophys(m_new->m_ext.ext_buf) >> PAGE_SHIFT); id = xennet_rxidx(req_prod + i); @@ -1214,7 +1215,7 @@ xennet_get_responses(struct netfront_inf MULTI_update_va_mapping(mcl, (u_long)vaddr, (((vm_paddr_t)mfn) << PAGE_SHIFT) | PG_RW | PG_V | PG_M | PG_A, 0); - pfn = (uint32_t)m->m_ext.ext_arg1; + pfn = (uint32_t)m->m_ext.ext_args; mmu->ptr = ((vm_paddr_t)mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE; mmu->val = pfn; Added: projects/releng_7_xen/sys/i386/conf/XEN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/releng_7_xen/sys/i386/conf/XEN Mon Nov 3 07:52:18 2008 (r184585) @@ -0,0 +1,150 @@ +# +# GENERIC -- Generic kernel configuration file for FreeBSD/i386 +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD: head/sys/i386/conf/XEN 182902 2008-09-10 07:11:08Z kmacy $ + +cpu I686_CPU +ident GENERIC + +# To statically compile in device wiring instead of /boot/device.hints +#hints "GENERIC.hints" # Default places to look for devices. + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +#options SCHED_ULE # ULE scheduler +#options PREEMPTION # Enable kernel thread preemption +options SCHED_4BSD + +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options SCTP # Stream Control Transmission Protocol +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options MD_ROOT # MD is a potential root device +options NFSCLIENT # Network Filesystem Client +options NFSSERVER # Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options STACK # stack(9) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options AUDIT # Security event auditing + +# Debugging for use in -current +options KDB # Enable kernel debugger support. +options DDB # Support DDB. +options GDB # Support remote GDB. +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed + +options PAE +nooption NATIVE +option XEN +nodevice atpic +nodevice isa +options MCLSHIFT=12 + +# To make an SMP kernel, the next two lines are needed +options SMP # Symmetric MultiProcessor Kernel +device apic # I/O APIC + +# CPU frequency control +#device cpufreq + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse + +device kbdmux # keyboard multiplexer + +#device vga # VGA video card driver + +device splash # Splash screen and screen saver support + +# syscons is the default console driver, resembling an SCO console +#device sc + +# Power management support (see NOTES for more options) +#device apm +# Add suspend/resume support for the i8254. +device pmtimer + + +device pci + +# PCCARD (PCMCIA) support +# PCMCIA and cardbus bridge support +#device cbb # cardbus (yenta) bridge +#device pccard # PC Card (16-bit) bus +#device cardbus # CardBus (32-bit) bus + +# Serial (COM) ports +device uart # Generic UART driver + +# Parallel port +device ppc +device ppbus # Parallel port bus (required) +device lpt # Printer +device plip # TCP/IP over parallel +device ppi # Parallel port interface device +#device vpo # Requires scbus and da + +# If you've got a "dumb" serial or parallel PCI card that is +# supported by the puc(4) glue driver, uncomment the following +# line to enable it (connects to sio, uart and/or ppc drivers): +#device puc + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + Modified: projects/releng_7_xen/sys/i386/i386/genassym.c ============================================================================== --- projects/releng_7_xen/sys/i386/i386/genassym.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/i386/i386/genassym.c Mon Nov 3 07:52:18 2008 (r184585) @@ -228,3 +228,9 @@ ASSYM(MTX_RECURSECNT, offsetof(struct mt ASSYM(BUS_SPACE_HANDLE_BASE, offsetof(struct bus_space_handle, bsh_base)); ASSYM(BUS_SPACE_HANDLE_IAT, offsetof(struct bus_space_handle, bsh_iat)); #endif + +#ifdef XEN +#include +ASSYM(PC_CR3, offsetof(struct pcpu, pc_cr3)); +ASSYM(HYPERVISOR_VIRT_START, __HYPERVISOR_VIRT_START); +#endif Modified: projects/releng_7_xen/sys/i386/i386/intr_machdep.c ============================================================================== --- projects/releng_7_xen/sys/i386/i386/intr_machdep.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/i386/i386/intr_machdep.c Mon Nov 3 07:52:18 2008 (r184585) @@ -594,6 +594,12 @@ intr_shuffle_irqs(void *arg __unused) struct intsrc *isrc; int i; +#ifdef XEN + /* + * Doesn't work yet + */ + return; +#endif /* Don't bother on UP. */ if (mp_ncpus == 1) return; Modified: projects/releng_7_xen/sys/i386/i386/local_apic.c ============================================================================== --- projects/releng_7_xen/sys/i386/i386/local_apic.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/i386/i386/local_apic.c Mon Nov 3 07:52:18 2008 (r184585) @@ -1109,6 +1109,9 @@ apic_setup_io(void *dummy __unused) printf("%s: Failed to setup I/O APICs: returned %d\n", best_enum->apic_name, retval); +#ifdef XEN + return; +#endif /* * Finish setting up the local APIC on the BSP once we know how to * properly program the LINT pins. Modified: projects/releng_7_xen/sys/i386/i386/machdep.c ============================================================================== --- projects/releng_7_xen/sys/i386/i386/machdep.c Mon Nov 3 06:37:59 2008 (r184584) +++ projects/releng_7_xen/sys/i386/i386/machdep.c Mon Nov 3 07:52:18 2008 (r184585) @@ -142,6 +142,25 @@ int arch_i386_is_xbox = 0; uint32_t arch_i386_xbox_memsize = 0; #endif +#ifdef XEN +/* XEN includes */ +#include +#include +#include +#include +#include +#include + +void Xhypervisor_callback(void); +void failsafe_callback(void); + +extern trap_info_t trap_table[]; +struct proc_ldt default_proc_ldt; +extern int init_first; +int running_xen = 1; +extern unsigned long physfree; +#endif /* XEN */ + /* Sanity check for __curthread() */ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); @@ -288,8 +307,9 @@ cpu_startup(dummy) */ bufinit(); vm_pager_bufferinit(); - +#ifndef XEN cpu_setregs(); +#endif } /* @@ -1119,6 +1139,36 @@ cpu_est_clockrate(int cpu_id, uint64_t * return (0); } +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); + + +/* Other subsystems (e.g., ACPI) can hook this later. */ +void (*cpu_idle_hook)(void) = cpu_idle_default; + +#ifdef XEN + +void +cpu_halt(void) +{ + HYPERVISOR_shutdown(SHUTDOWN_poweroff); +} + +int scheduler_running; + +static void +cpu_idle_default(void) +{ + + enable_intr(); + idle_block(); +} + +#else /* * Shutdown the CPU as much as possible */ @@ -1144,10 +1194,6 @@ cpu_halt(void) * 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) @@ -1160,6 +1206,8 @@ cpu_idle_default(void) __asm __volatile("sti; hlt"); } +#endif + /* * 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 @@ -1184,9 +1232,6 @@ cpu_idle(void) } } -/* Other subsystems (e.g., ACPI) can hook this later. */ -void (*cpu_idle_hook)(void) = cpu_idle_default; - /* * Clear registers on exec */ @@ -1309,10 +1354,16 @@ SYSCTL_ULONG(_machdep, OID_AUTO, guessed */ int _default_ldt; + +#ifdef XEN +union descriptor *gdt; +union descriptor *ldt; +#else union descriptor gdt[NGDT * MAXCPU]; /* global descriptor table */ +union descriptor ldt[NLDT]; /* local descriptor table */ +#endif static struct gate_descriptor idt0[NIDT]; struct gate_descriptor *idt = &idt0[0]; /* interrupt descriptor table */ -union descriptor ldt[NLDT]; /* local descriptor table */ struct region_descriptor r_gdt, r_idt; /* table descriptors */ struct mtx dt_lock; /* lock for GDT and LDT */ @@ -1337,7 +1388,7 @@ struct soft_segment_descriptor gdt_segs[ { 0x0, /* segment base address */ 0x0, /* length */ 0, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 0, /* segment descriptor present */ 0, 0, 0, /* default 32 vs 16 bit size */ @@ -1346,7 +1397,7 @@ struct soft_segment_descriptor gdt_segs[ { 0x0, /* segment base address */ 0xfffff, /* length - all address space */ SDT_MEMRWA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 0, 0, 1, /* default 32 vs 16 bit size */ @@ -1373,7 +1424,7 @@ struct soft_segment_descriptor gdt_segs[ { 0x0, /* segment base address */ 0xfffff, /* length - all address space */ SDT_MEMERA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 0, 0, 1, /* default 32 vs 16 bit size */ @@ -1382,7 +1433,7 @@ struct soft_segment_descriptor gdt_segs[ { 0x0, /* segment base address */ 0xfffff, /* length - all address space */ SDT_MEMRWA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 0, 0, 1, /* default 32 vs 16 bit size */ @@ -1409,11 +1460,12 @@ struct soft_segment_descriptor gdt_segs[ { 0x400, /* segment base address */ 0xfffff, /* length */ SDT_MEMRWA, /* segment type */ - 0, /* segment descriptor priority level */ + SEL_KPL, /* segment descriptor priority level */ 1, /* segment descriptor present */ 0, 0, 1, /* default 32 vs 16 bit size */ 1 /* limit granularity (byte/page units)*/ }, +#ifndef XEN /* GPROC0_SEL 9 Proc 0 Tss Descriptor */ { 0x0, /* segment base address */ @@ -1505,6 +1557,7 @@ struct soft_segment_descriptor gdt_segs[ 0, 0, 0, /* default 32 vs 16 bit size */ 0 /* limit granularity (byte/page units)*/ }, +#endif /* !XEN */ }; static struct soft_segment_descriptor ldt_segs[] = { @@ -1742,7 +1795,16 @@ getmemsize(int first) goto physmap_done; } #endif - +#if defined(XEN) + has_smap = 0; + Maxmem = xen_start_info->nr_pages - init_first; + physmem = Maxmem; + basemem = 0; + physmap[0] = init_first << PAGE_SHIFT; + physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); + physmap_idx = 0; + goto physmap_done; +#endif hasbrokenint12 = 0; TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); bzero(&vmf, sizeof(vmf)); @@ -1904,7 +1966,7 @@ int15e820: vmf.vmf_ah = 0x88; vm86_intcall(0x15, &vmf); extmem = vmf.vmf_ax; -#else +#elif !defined(XEN) /* * Prefer the RTC value for extended memory. */ @@ -1995,6 +2057,7 @@ physmap_done: getenv_quad("dcons.size", &dcons_size) == 0) dcons_addr = 0; +#ifndef XEN /* * physmap is in bytes, so when converting to page boundaries, * round up the start address and round down the end address. @@ -2112,7 +2175,11 @@ do_next: } *pte = 0; invltlb(); - +#else + phys_avail[0] = physfree; + phys_avail[1] = xen_start_info->nr_pages*PAGE_SIZE; +#endif + /* * XXX * The last chunk must contain at least one page plus the message @@ -2135,8 +2202,227 @@ do_next: for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); +} + +#ifdef XEN +#define MTOPSIZE (1<<(14 + PAGE_SHIFT)) + +void +init386(first) + int first; +{ + unsigned long gdtmachpfn; + int error, gsel_tss, metadata_missing, x; + struct pcpu *pc; + struct callback_register event = { + .type = CALLBACKTYPE_event, + .address = {GSEL(GCODE_SEL, SEL_KPL), (unsigned long)Xhypervisor_callback }, + }; + struct callback_register failsafe = { + .type = CALLBACKTYPE_failsafe, + .address = {GSEL(GCODE_SEL, SEL_KPL), (unsigned long)failsafe_callback }, + }; + + thread0.td_kstack = proc0kstack; + thread0.td_pcb = (struct pcb *) + (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + + /* + * This may be done better later if it gets more high level + * components in it. If so just link td->td_proc here. + */ + proc_linkup0(&proc0, &thread0); + + metadata_missing = 0; + if (xen_start_info->mod_start) { + preload_metadata = (caddr_t)xen_start_info->mod_start; + preload_bootstrap_relocate(KERNBASE); + } else { + metadata_missing = 1; + } + if (envmode == 1) + kern_envp = static_env; + else if ((caddr_t)xen_start_info->cmd_line) + kern_envp = xen_setbootenv((caddr_t)xen_start_info->cmd_line); + + boothowto |= xen_boothowto(kern_envp); + + /* Init basic tunables, hz etc */ + init_param1(); + + /* + * XEN occupies a portion of the upper virtual address space + * At its base it manages an array mapping machine page frames + * to physical page frames - hence we need to be able to + * access 4GB - (64MB - 4MB + 64k) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 02:07:36 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAA0C1065670; Tue, 4 Nov 2008 02:07:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C88048FC0C; Tue, 4 Nov 2008 02:07:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA427ZC9083105; Tue, 4 Nov 2008 02:07:35 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA427Zm5083094; Tue, 4 Nov 2008 02:07:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811040207.mA427Zm5083094@svn.freebsd.org> From: Kip Macy Date: Tue, 4 Nov 2008 02:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184609 - in projects/releng_7_xen/sys: conf i386/conf i386/i386 i386/include i386/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 02:07:36 -0000 Author: kmacy Date: Tue Nov 4 02:07:34 2008 New Revision: 184609 URL: http://svn.freebsd.org/changeset/base/184609 Log: make XEN config build Modified: projects/releng_7_xen/sys/conf/files projects/releng_7_xen/sys/i386/conf/DEFAULTS projects/releng_7_xen/sys/i386/conf/XEN projects/releng_7_xen/sys/i386/i386/apic_vector.s projects/releng_7_xen/sys/i386/i386/machdep.c projects/releng_7_xen/sys/i386/i386/support.s projects/releng_7_xen/sys/i386/include/pmap.h projects/releng_7_xen/sys/i386/xen/clock.c projects/releng_7_xen/sys/i386/xen/mp_machdep.c projects/releng_7_xen/sys/i386/xen/pmap.c Modified: projects/releng_7_xen/sys/conf/files ============================================================================== --- projects/releng_7_xen/sys/conf/files Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/conf/files Tue Nov 4 02:07:34 2008 (r184609) @@ -1594,6 +1594,7 @@ libkern/strcasecmp.c standard libkern/strcat.c standard libkern/strcmp.c standard libkern/strcpy.c standard +libkern/strcspn.c standard libkern/strdup.c standard libkern/strlcat.c standard libkern/strlcpy.c standard Modified: projects/releng_7_xen/sys/i386/conf/DEFAULTS ============================================================================== --- projects/releng_7_xen/sys/i386/conf/DEFAULTS Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/conf/DEFAULTS Tue Nov 4 02:07:34 2008 (r184609) @@ -25,3 +25,5 @@ options GEOM_MBR # KSE support went from being default to a kernel option options KSE +options NATIVE +device atpic \ No newline at end of file Modified: projects/releng_7_xen/sys/i386/conf/XEN ============================================================================== --- projects/releng_7_xen/sys/i386/conf/XEN Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/conf/XEN Tue Nov 4 02:07:34 2008 (r184609) @@ -80,6 +80,7 @@ option XEN nodevice atpic nodevice isa options MCLSHIFT=12 +device genclock # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel Modified: projects/releng_7_xen/sys/i386/i386/apic_vector.s ============================================================================== --- projects/releng_7_xen/sys/i386/i386/apic_vector.s Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/i386/apic_vector.s Tue Nov 4 02:07:34 2008 (r184609) @@ -270,6 +270,7 @@ IDTVEC(invlcache) /* * Handler for IPIs sent via the per-cpu IPI bitmap. */ +#ifndef XEN .text SUPERALIGN_TEXT IDTVEC(ipi_intr_bitmap_handler) @@ -284,7 +285,8 @@ IDTVEC(ipi_intr_bitmap_handler) call ipi_bitmap_handler MEXITCOUNT jmp doreti - +#endif + /* * Executed by a CPU when it receives an IPI_STOP from another CPU. */ Modified: projects/releng_7_xen/sys/i386/i386/machdep.c ============================================================================== --- projects/releng_7_xen/sys/i386/i386/machdep.c Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/i386/machdep.c Tue Nov 4 02:07:34 2008 (r184609) @@ -1218,7 +1218,7 @@ void cpu_idle(void) { -#ifdef SMP +#if defined(SMP) && !defined(XEN) if (mp_grab_cpu_hlt()) return; #endif Modified: projects/releng_7_xen/sys/i386/i386/support.s ============================================================================== --- projects/releng_7_xen/sys/i386/i386/support.s Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/i386/support.s Tue Nov 4 02:07:34 2008 (r184609) @@ -1459,10 +1459,11 @@ END(bcmp) */ /* void lgdt(struct region_descriptor *rdp); */ ENTRY(lgdt) - /* reload the descriptor table */ +#ifndef XEN + /* reload the descriptor table */ movl 4(%esp),%eax lgdt (%eax) - +#endif /* flush the prefetch q */ jmp 1f nop Modified: projects/releng_7_xen/sys/i386/include/pmap.h ============================================================================== --- projects/releng_7_xen/sys/i386/include/pmap.h Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/include/pmap.h Tue Nov 4 02:07:34 2008 (r184609) @@ -470,7 +470,9 @@ void pmap_bootstrap(vm_paddr_t); int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_init_pat(void); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); +#ifndef XEN void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); +#endif void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kremove(vm_offset_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); Modified: projects/releng_7_xen/sys/i386/xen/clock.c ============================================================================== --- projects/releng_7_xen/sys/i386/xen/clock.c Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/xen/clock.c Tue Nov 4 02:07:34 2008 (r184609) @@ -908,27 +908,3 @@ idle_block(void) PANIC_IF(HYPERVISOR_set_timer_op(processed_system_time + NS_PER_TICK) != 0); HYPERVISOR_sched_op(SCHEDOP_block, 0); } - -int -timer_spkr_acquire(void) -{ - - return (0); -} - -int -timer_spkr_release(void) -{ - - return (0); -} - -void -timer_spkr_setfreq(int freq) -{ - -} - - - - Modified: projects/releng_7_xen/sys/i386/xen/mp_machdep.c ============================================================================== --- projects/releng_7_xen/sys/i386/xen/mp_machdep.c Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/xen/mp_machdep.c Tue Nov 4 02:07:34 2008 (r184609) @@ -154,40 +154,6 @@ extern void Xhypervisor_callback(void); extern void failsafe_callback(void); extern void pmap_lazyfix_action(void); -struct cpu_group * -cpu_topo(void) -{ - if (cpu_cores == 0) - cpu_cores = 1; - if (cpu_logical == 0) - cpu_logical = 1; - if (mp_ncpus % (cpu_cores * cpu_logical) != 0) { - printf("WARNING: Non-uniform processors.\n"); - printf("WARNING: Using suboptimal topology.\n"); - return (smp_topo_none()); - } - /* - * No multi-core or hyper-threaded. - */ - if (cpu_logical * cpu_cores == 1) - return (smp_topo_none()); - /* - * Only HTT no multi-core. - */ - if (cpu_logical > 1 && cpu_cores == 1) - return (smp_topo_1level(CG_SHARE_L1, cpu_logical, CG_FLAG_HTT)); - /* - * Only multi-core no HTT. - */ - if (cpu_cores > 1 && cpu_logical == 1) - return (smp_topo_1level(CG_SHARE_NONE, cpu_cores, 0)); - /* - * Both HTT and multi-core. - */ - return (smp_topo_2level(CG_SHARE_NONE, cpu_cores, - CG_SHARE_L1, cpu_logical, CG_FLAG_HTT)); -} - /* * Calculate usable address in base memory for AP trampoline code. */ @@ -381,7 +347,12 @@ smp_reschedule_interrupt(void *unused) #ifdef COUNT_IPIS (*ipi_preempt_counts[cpu])++; #endif - sched_preempt(curthread); + thread_lock(curthread); + if (curthread->td_critnest > 1) + curthread->td_owepreempt = 1; + else + mi_switch(SW_INVOL | SW_PREEMPT, NULL); + thread_unlock(curthread); } if (ipi_bitmap & (1 << IPI_AST)) { Modified: projects/releng_7_xen/sys/i386/xen/pmap.c ============================================================================== --- projects/releng_7_xen/sys/i386/xen/pmap.c Tue Nov 4 01:45:49 2008 (r184608) +++ projects/releng_7_xen/sys/i386/xen/pmap.c Tue Nov 4 02:07:34 2008 (r184609) @@ -2629,7 +2629,7 @@ retry: * insert this page into the given map NOW. */ void -pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, +pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { vm_paddr_t pa; @@ -3433,56 +3433,6 @@ pmap_page_exists_quick(pmap_t pmap, vm_p } /* - * pmap_page_wired_mappings: - * - * Return the number of managed mappings to the given physical page - * that are wired. - */ -int -pmap_page_wired_mappings(vm_page_t m) -{ - pv_entry_t pv; - pt_entry_t *pte; - pmap_t pmap; - int count; - - count = 0; - if ((m->flags & PG_FICTITIOUS) != 0) - return (count); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - sched_pin(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { - pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); - pte = pmap_pte_quick(pmap, pv->pv_va); - if ((*pte & PG_W) != 0) - count++; - PMAP_UNLOCK(pmap); - } - sched_unpin(); - return (count); -} - -/* - * Returns TRUE if the given page is mapped individually or as part of - * a 4mpage. Otherwise, returns FALSE. - */ -boolean_t -pmap_page_is_mapped(vm_page_t m) -{ - struct md_page *pvh; - - if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) - return (FALSE); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if (TAILQ_EMPTY(&m->md.pv_list)) { - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - return (!TAILQ_EMPTY(&pvh->pv_list)); - } else - return (TRUE); -} - -/* * Remove all pages from specified address space * this aids process exit speeds. Also, this code * is special cased for current process only, but @@ -4075,28 +4025,16 @@ pmap_activate(struct thread *td) critical_exit(); } -/* - * Increase the starting virtual address of the given mapping if a - * different alignment might result in more superpage mappings. - */ -void -pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, - vm_offset_t *addr, vm_size_t size) +vm_offset_t +pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size) { - vm_offset_t superpage_offset; - if (size < NBPDR) - return; - if (object != NULL && (object->flags & OBJ_COLORED) != 0) - offset += ptoa(object->pg_color); - superpage_offset = offset & PDRMASK; - if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR || - (*addr & PDRMASK) == superpage_offset) - return; - if ((*addr & PDRMASK) < superpage_offset) - *addr = (*addr & ~PDRMASK) + superpage_offset; - else - *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; + if ((obj == NULL) || (size < NBPDR) || (obj->type != OBJT_DEVICE)) { + return addr; + } + + addr = (addr + PDRMASK) & ~PDRMASK; + return addr; } #if defined(PMAP_DEBUG) From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 13:44:07 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9CD1065670; Tue, 4 Nov 2008 13:44:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8960D8FC2A; Tue, 4 Nov 2008 13:44:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Di7cq097981; Tue, 4 Nov 2008 13:44:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4Di7BG097980; Tue, 4 Nov 2008 13:44:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041344.mA4Di7BG097980@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184630 - projects/quota64/lib/libutil X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:44:07 -0000 Author: des Date: Tue Nov 4 13:44:07 2008 New Revision: 184630 URL: http://svn.freebsd.org/changeset/base/184630 Log: Avoid assigning a const char * to a char *. MFC after: 3 weeks Modified: projects/quota64/lib/libutil/login_class.c Modified: projects/quota64/lib/libutil/login_class.c ============================================================================== --- projects/quota64/lib/libutil/login_class.c Tue Nov 4 12:30:31 2008 (r184629) +++ projects/quota64/lib/libutil/login_class.c Tue Nov 4 13:44:07 2008 (r184630) @@ -142,14 +142,13 @@ substvar(const char * var, const struct int tildes = 0; int dollas = 0; char *p; + const char *q; if (pwd != NULL) { - /* Count the number of ~'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) - ++tildes; - /* Count the number of $'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) - ++dollas; + for (q = var; *q != '\0'; ++q) { + tildes += (*q == '~'); + dollas += (*q == '$'); + } } np = malloc(strlen(var) + (dollas * nlen) From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 13:44:44 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DBAE1065692; Tue, 4 Nov 2008 13:44:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6CD8FC08; Tue, 4 Nov 2008 13:44:44 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Dii8D098025; Tue, 4 Nov 2008 13:44:44 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DiiCa098024; Tue, 4 Nov 2008 13:44:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041344.mA4DiiCa098024@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184631 - projects/quota64/lib/libutil X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:44:44 -0000 Author: des Date: Tue Nov 4 13:44:43 2008 New Revision: 184631 URL: http://svn.freebsd.org/changeset/base/184631 Log: Avoid assigning a const char * to a char *. MFC after: 3 weeks Modified: projects/quota64/lib/libutil/login_cap.c Modified: projects/quota64/lib/libutil/login_cap.c ============================================================================== --- projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:44:07 2008 (r184630) +++ projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:44:43 2008 (r184631) @@ -61,6 +61,8 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; +static char path_login_conf[] = _PATH_LOGIN_CONF; + static char * allocstr(const char *str) { @@ -215,15 +217,14 @@ login_getclassbyname(char const *name, c if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { - login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - i++; /* only use 'secure' data */ + login_dbarray[i++] = userpath; } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) - login_dbarray[i++] = _PATH_LOGIN_CONF; + if (_secure_path(path_login_conf, 0, 0) != -1) + login_dbarray[i++] = path_login_conf; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 13:49:18 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E32701065677; Tue, 4 Nov 2008 13:49:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1F5D8FC18; Tue, 4 Nov 2008 13:49:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4DnIRI098204; Tue, 4 Nov 2008 13:49:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DnIOd098202; Tue, 4 Nov 2008 13:49:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041349.mA4DnIOd098202@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184632 - projects/quota64/lib/libutil X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:49:19 -0000 Author: des Date: Tue Nov 4 13:49:18 2008 New Revision: 184632 URL: http://svn.freebsd.org/changeset/base/184632 Log: Committed to wrong branch. Modified: projects/quota64/lib/libutil/login_cap.c projects/quota64/lib/libutil/login_class.c Modified: projects/quota64/lib/libutil/login_cap.c ============================================================================== --- projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:44:43 2008 (r184631) +++ projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:49:18 2008 (r184632) @@ -61,8 +61,6 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; -static char path_login_conf[] = _PATH_LOGIN_CONF; - static char * allocstr(const char *str) { @@ -217,14 +215,15 @@ login_getclassbyname(char const *name, c if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { + login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - login_dbarray[i++] = userpath; + i++; /* only use 'secure' data */ } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(path_login_conf, 0, 0) != -1) - login_dbarray[i++] = path_login_conf; + if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) + login_dbarray[i++] = _PATH_LOGIN_CONF; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); Modified: projects/quota64/lib/libutil/login_class.c ============================================================================== --- projects/quota64/lib/libutil/login_class.c Tue Nov 4 13:44:43 2008 (r184631) +++ projects/quota64/lib/libutil/login_class.c Tue Nov 4 13:49:18 2008 (r184632) @@ -142,13 +142,14 @@ substvar(const char * var, const struct int tildes = 0; int dollas = 0; char *p; - const char *q; if (pwd != NULL) { - for (q = var; *q != '\0'; ++q) { - tildes += (*q == '~'); - dollas += (*q == '$'); - } + /* Count the number of ~'s in var to substitute */ + for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) + ++tildes; + /* Count the number of $'s in var to substitute */ + for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) + ++dollas; } np = malloc(strlen(var) + (dollas * nlen) From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 13:54:07 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D831065673; Tue, 4 Nov 2008 13:54:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48B48FC19; Tue, 4 Nov 2008 13:54:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Ds7Ca098500; Tue, 4 Nov 2008 13:54:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4Ds7lg098497; Tue, 4 Nov 2008 13:54:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041354.mA4Ds7lg098497@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184636 - projects/quota64/lib/libutil X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:54:07 -0000 Author: des Date: Tue Nov 4 13:54:07 2008 New Revision: 184636 URL: http://svn.freebsd.org/changeset/base/184636 Log: MFH (r184633, r184635): build at WARNS level 6 Modified: projects/quota64/lib/libutil/Makefile projects/quota64/lib/libutil/login_cap.c projects/quota64/lib/libutil/login_class.c Modified: projects/quota64/lib/libutil/Makefile ============================================================================== --- projects/quota64/lib/libutil/Makefile Tue Nov 4 13:51:15 2008 (r184635) +++ projects/quota64/lib/libutil/Makefile Tue Nov 4 13:54:07 2008 (r184636) @@ -15,6 +15,8 @@ SRCS= _secure_path.c auth.c gr_util.c ex stub.c trimdomain.c uucplock.c INCS= libutil.h login_cap.h +WARNS?= 6 + CFLAGS+= -DLIBC_SCCS .if ${MK_INET6_SUPPORT} != "no" Modified: projects/quota64/lib/libutil/login_cap.c ============================================================================== --- projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:51:15 2008 (r184635) +++ projects/quota64/lib/libutil/login_cap.c Tue Nov 4 13:54:07 2008 (r184636) @@ -61,6 +61,8 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; +static char path_login_conf[] = _PATH_LOGIN_CONF; + static char * allocstr(const char *str) { @@ -215,15 +217,14 @@ login_getclassbyname(char const *name, c if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { - login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - i++; /* only use 'secure' data */ + login_dbarray[i++] = userpath; } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) - login_dbarray[i++] = _PATH_LOGIN_CONF; + if (_secure_path(path_login_conf, 0, 0) != -1) + login_dbarray[i++] = path_login_conf; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); Modified: projects/quota64/lib/libutil/login_class.c ============================================================================== --- projects/quota64/lib/libutil/login_class.c Tue Nov 4 13:51:15 2008 (r184635) +++ projects/quota64/lib/libutil/login_class.c Tue Nov 4 13:54:07 2008 (r184636) @@ -142,14 +142,13 @@ substvar(const char * var, const struct int tildes = 0; int dollas = 0; char *p; + const char *q; if (pwd != NULL) { - /* Count the number of ~'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) - ++tildes; - /* Count the number of $'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) - ++dollas; + for (q = var; *q != '\0'; ++q) { + tildes += (*q == '~'); + dollas += (*q == '$'); + } } np = malloc(strlen(var) + (dollas * nlen) From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 13:55:56 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B991065675; Tue, 4 Nov 2008 13:55:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36B18FC22; Tue, 4 Nov 2008 13:55:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Dttqc098591; Tue, 4 Nov 2008 13:55:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DttQM098590; Tue, 4 Nov 2008 13:55:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041355.mA4DttQM098590@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184637 - projects/quota64/lib/libutil X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:55:56 -0000 Author: des Date: Tue Nov 4 13:55:55 2008 New Revision: 184637 URL: http://svn.freebsd.org/changeset/base/184637 Log: Grrr, forgot to commit mergeinfo Modified: projects/quota64/lib/libutil/ (props changed) From owner-svn-src-projects@FreeBSD.ORG Tue Nov 4 14:20:08 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C71AD1065689; Tue, 4 Nov 2008 14:20:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49CA8FC17; Tue, 4 Nov 2008 14:20:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4EK84C099174; Tue, 4 Nov 2008 14:20:08 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4EK8Kh099172; Tue, 4 Nov 2008 14:20:08 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041420.mA4EK8Kh099172@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 14:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184639 - projects/quota64/libexec/rpc.rquotad X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 14:20:08 -0000 Author: des Date: Tue Nov 4 14:20:08 2008 New Revision: 184639 URL: http://svn.freebsd.org/changeset/base/184639 Log: MFH (r184638): build at WARNS level 6 Modified: projects/quota64/libexec/rpc.rquotad/ (props changed) projects/quota64/libexec/rpc.rquotad/Makefile projects/quota64/libexec/rpc.rquotad/rquotad.c Modified: projects/quota64/libexec/rpc.rquotad/Makefile ============================================================================== --- projects/quota64/libexec/rpc.rquotad/Makefile Tue Nov 4 14:17:49 2008 (r184638) +++ projects/quota64/libexec/rpc.rquotad/Makefile Tue Nov 4 14:20:08 2008 (r184639) @@ -4,6 +4,8 @@ PROG = rpc.rquotad SRCS = rquotad.c MAN = rpc.rquotad.8 +WARNS ?= 6 + DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Modified: projects/quota64/libexec/rpc.rquotad/rquotad.c ============================================================================== --- projects/quota64/libexec/rpc.rquotad/rquotad.c Tue Nov 4 14:17:49 2008 (r184638) +++ projects/quota64/libexec/rpc.rquotad/rquotad.c Tue Nov 4 14:20:08 2008 (r184639) @@ -1,39 +1,35 @@ /* * by Manuel Bouyer (bouyer@ensta.fr) - * + * * There is no copyright, you can use it as you want. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); #include -#include #include #include #include #include -#include + +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include -#include - #include - -#include -#include -#include -#include -#include +#include void rquota_service(struct svc_req *request, SVCXPRT *transp); void sendquota(struct svc_req *request, SVCXPRT *transp); @@ -56,15 +52,17 @@ struct fs_stat *fs_begin = NULL; int from_inetd = 1; -void +static void cleanup(int sig) { + + (void) sig; (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); exit(0); } int -main(int argc, char *argv[]) +main(void) { SVCXPRT *transp; int ok; @@ -101,19 +99,22 @@ main(int argc, char *argv[]) ok = svc_create(rquota_service, RQUOTAPROG, RQUOTAVERS, "udp"); if (!ok) { - syslog(LOG_ERR, "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", (!from_inetd)?"udp":"(inetd)"); + syslog(LOG_ERR, + "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", + from_inetd ? "(inetd)" : "udp"); exit(1); } - initfs(); /* init the fs_stat list */ + initfs(); svc_run(); syslog(LOG_ERR, "svc_run returned"); exit(1); } -void +void rquota_service(struct svc_req *request, SVCXPRT *transp) { + switch (request->rq_proc) { case NULLPROC: (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); @@ -133,7 +134,7 @@ rquota_service(struct svc_req *request, } /* read quota for the specified id, and send it */ -void +void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -183,7 +184,7 @@ sendquota(struct svc_req *request, SVCXP } } -void +void printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */ { char name[INET6_ADDRSTRLEN]; @@ -203,7 +204,7 @@ printerr_reply(SVCXPRT *transp) /* when } /* initialise the fs_tab list from entries in /etc/fstab */ -void +void initfs(void) { struct fs_stat *fs_current = NULL; @@ -222,10 +223,12 @@ initfs(void) fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat)); fs_current->fs_next = fs_next; /* next element */ - fs_current->fs_file = malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); + fs_current->fs_file = + malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); strcpy(fs_current->fs_file, fs->fs_file); - fs_current->qfpathname = malloc(sizeof(char) * (strlen(qfpathname) + 1)); + fs_current->qfpathname = + malloc(sizeof(char) * (strlen(qfpathname) + 1)); strcpy(fs_current->qfpathname, qfpathname); stat(fs_current->fs_file, &st); @@ -242,7 +245,7 @@ initfs(void) * Return 0 if fail, 1 otherwise */ int -getfsquota(long id, char *path, struct dqblk *dqblk) +getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; struct fs_stat *fs; @@ -301,8 +304,8 @@ hasquota(struct fstab *fs, char **qfnam { static char initname, usrname[100]; static char buf[BUFSIZ]; - char *opt, *cp; - char *qfextension[] = INITQFNAMES; + char *opt, *cp; + const char *qfextension[] = INITQFNAMES; if (!initname) { sprintf(usrname, "%s%s", qfextension[USRQUOTA], QUOTAFILENAME); @@ -321,7 +324,8 @@ hasquota(struct fstab *fs, char **qfnam *qfnamep = cp; return (1); } - sprintf(buf, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, qfextension[USRQUOTA]); + sprintf(buf, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, + qfextension[USRQUOTA]); *qfnamep = buf; return (1); } From owner-svn-src-projects@FreeBSD.ORG Thu Nov 6 09:59:57 2008 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA58E106564A; Thu, 6 Nov 2008 09:59:57 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99E898FC08; Thu, 6 Nov 2008 09:59:57 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA69xvQv051418; Thu, 6 Nov 2008 09:59:57 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA69xv8w051417; Thu, 6 Nov 2008 09:59:57 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811060959.mA69xv8w051417@svn.freebsd.org> From: Kip Macy Date: Thu, 6 Nov 2008 09:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184713 - projects/release_6_3_xen/sys/i386/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:59:57 -0000 Author: kmacy Date: Thu Nov 6 09:59:57 2008 New Revision: 184713 URL: http://svn.freebsd.org/changeset/base/184713 Log: printk state for recursive mappings issue Modified: projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Modified: projects/release_6_3_xen/sys/i386/xen/xen_machdep.c ============================================================================== --- projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Thu Nov 6 09:41:31 2008 (r184712) +++ projects/release_6_3_xen/sys/i386/xen/xen_machdep.c Thu Nov 6 09:59:57 2008 (r184713) @@ -974,6 +974,7 @@ initvalues(start_info_t *startinfo) /* unmap remaining pages from initial 4MB chunk * */ + printk("unmapping remaining pages\n"); for (tmpva = cur_space; (tmpva & ((1<<22)-1)) != 0; tmpva += PAGE_SIZE) { bzero((char *)tmpva, PAGE_SIZE); PT_SET_MA(tmpva, (vm_paddr_t)0); @@ -985,13 +986,17 @@ initvalues(start_info_t *startinfo) ((uint8_t *)IdlePTD) + ((KERNBASE >> 18) & PAGE_MASK), l1_pages*sizeof(pt_entry_t)); + printk("installing recursive mappings\n"); for (i = 0; i < 4; i++) { PT_SET_MA((uint8_t *)IdlePTDnew + i*PAGE_SIZE, IdlePTDnewma[i] | PG_V); } + printk("installing new cr3\n"); xen_load_cr3(VTOP(IdlePDPTnew)); + printk("installed new cr3\n"); xen_pgdpt_pin(xpmap_ptom(VTOP(IdlePDPTnew))); - + printk("pinned new pdpt\n"); + /* allocate remainder of nkpt pages */ cur_space_pt = cur_space; for (offset = (KERNBASE >> PDRSHIFT), i = l1_pages; i < nkpt;