Date: Sat, 19 Jan 2013 21:57:26 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r245674 - in projects/counters: . bin/ps contrib/compiler-rt contrib/compiler-rt/lib contrib/compiler-rt/lib/arm lib lib/libc/arm lib/libc/arm/aeabi lib/libc/arm/gen lib/libc/quad lib/l... Message-ID: <201301192157.r0JLvQa8003434@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Sat Jan 19 21:57:25 2013 New Revision: 245674 URL: http://svnweb.freebsd.org/changeset/base/245674 Log: Merge head r243428 through r245673. Added: projects/counters/lib/libc/arm/Symbol_oabi.map - copied unchanged from r245673, head/lib/libc/arm/Symbol_oabi.map projects/counters/lib/libc/arm/aeabi/ - copied from r245673, head/lib/libc/arm/aeabi/ - copied from r245673, head/lib/libvmmapi/ - copied unchanged from r245673, head/share/man/man4/bhyve.4 - copied unchanged from r245673, head/sys/amd64/include/vmm.h - copied unchanged from r245673, head/sys/amd64/include/vmm_dev.h - copied unchanged from r245673, head/sys/amd64/include/vmm_instruction_emul.h - copied from r245673, head/sys/amd64/vmm/ - copied from r245673, head/sys/dev/blackhole/ - copied from r245673, head/sys/dev/bvm/ - copied from r245673, head/sys/modules/blackhole/ - copied from r245673, head/sys/modules/vmm/ projects/counters/tools/build/options/WITHOUT_PC_SYSINSTALL - copied unchanged from r245673, head/tools/build/options/WITHOUT_PC_SYSINSTALL - copied from r245673, head/usr.sbin/bhyve/ - copied from r245673, head/usr.sbin/bhyvectl/ - copied from r245673, head/usr.sbin/bhyveload/ Directory Properties: projects/counters/lib/libvmmapi/ (props changed) projects/counters/share/man/man4/bhyve.4 (props changed) projects/counters/sys/amd64/include/vmm.h (props changed) projects/counters/sys/amd64/include/vmm_dev.h (props changed) projects/counters/sys/amd64/include/vmm_instruction_emul.h (props changed) projects/counters/sys/amd64/vmm/ (props changed) projects/counters/sys/dev/blackhole/ (props changed) projects/counters/sys/dev/bvm/ (props changed) projects/counters/sys/modules/blackhole/ (props changed) projects/counters/sys/modules/vmm/ (props changed) projects/counters/usr.sbin/bhyve/ (props changed) projects/counters/usr.sbin/bhyvectl/ (props changed) projects/counters/usr.sbin/bhyveload/ (props changed) Modified: projects/counters/Makefile.inc1 projects/counters/UPDATING projects/counters/bin/ps/extern.h projects/counters/bin/ps/fmt.c projects/counters/bin/ps/ps.c projects/counters/contrib/compiler-rt/LICENSE.TXT projects/counters/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S projects/counters/contrib/compiler-rt/lib/arm/divsi3.S projects/counters/contrib/compiler-rt/lib/arm/udivsi3.S projects/counters/contrib/compiler-rt/lib/cmpdi2.c projects/counters/contrib/compiler-rt/lib/fixsfdi.c projects/counters/contrib/compiler-rt/lib/int_endianness.h projects/counters/contrib/compiler-rt/lib/int_lib.h projects/counters/contrib/compiler-rt/lib/ucmpdi2.c projects/counters/lib/Makefile projects/counters/lib/libc/arm/Makefile.inc projects/counters/lib/libc/arm/SYS.h projects/counters/lib/libc/arm/Symbol.map projects/counters/lib/libc/arm/gen/Makefile.inc projects/counters/lib/libc/quad/Makefile.inc projects/counters/lib/libcompiler_rt/Makefile projects/counters/lib/libthr/thread/thr_init.c projects/counters/lib/libthr/thread/thr_kern.c projects/counters/libexec/rtld-elf/Makefile projects/counters/sbin/newfs_msdos/newfs_msdos.c projects/counters/share/mk/bsd.libnames.mk projects/counters/share/mk/bsd.own.mk projects/counters/sys/amd64/amd64/pmap.c projects/counters/sys/arm/arm/intr.c projects/counters/sys/arm/arm/machdep.c projects/counters/sys/arm/include/intr.h projects/counters/sys/arm/ti/ti_scm.c projects/counters/sys/boot/fdt/dts/beaglebone.dts projects/counters/sys/cam/scsi/scsi_all.c projects/counters/sys/conf/files.amd64 projects/counters/sys/contrib/dev/acpica/components/disassembler/dmresrc.c projects/counters/sys/dev/usb/storage/umass.c projects/counters/sys/fs/ext2fs/ext2_inode.c projects/counters/sys/fs/nfsclient/nfs_clvnops.c projects/counters/sys/fs/nfsserver/nfs_nfsdport.c projects/counters/sys/fs/nfsserver/nfs_nfsdserv.c projects/counters/sys/i386/i386/pmap.c projects/counters/sys/modules/Makefile projects/counters/sys/nfsclient/nfs_vnops.c projects/counters/sys/nfsserver/nfs_srvsubs.c projects/counters/tools/build/mk/OptionalObsoleteFiles.inc projects/counters/usr.bin/w/w.c projects/counters/usr.bin/xinstall/Makefile projects/counters/usr.bin/xinstall/install.1 projects/counters/usr.bin/xinstall/xinstall.c projects/counters/usr.sbin/Makefile projects/counters/usr.sbin/Makefile.amd64 Directory Properties: projects/counters/ (props changed) projects/counters/contrib/compiler-rt/ (props changed) projects/counters/lib/libc/ (props changed) projects/counters/sbin/ (props changed) projects/counters/share/man/man4/ (props changed) projects/counters/sys/ (props changed) projects/counters/sys/boot/ (props changed) projects/counters/sys/conf/ (props changed) projects/counters/sys/contrib/dev/acpica/ (props changed) projects/counters/sys/contrib/dev/acpica/components/disassembler/ (props changed) Modified: projects/counters/Makefile.inc1 ============================================================================== --- projects/counters/Makefile.inc1 Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/Makefile.inc1 Sat Jan 19 21:57:25 2013 (r245674) @@ -704,7 +704,6 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale - rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} Modified: projects/counters/UPDATING ============================================================================== --- projects/counters/UPDATING Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/UPDATING Sat Jan 19 21:57:25 2013 (r245674) @@ -26,6 +26,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20130118: + The install(1) option -M has changed meaning and now takes an + argument that is a file or path to append logs to. In the + unlikely event that -M was the last option on the command line + and the command line contained at least two files and a target + directory the first file will have logs appended to it. The -M + option served little practical purpose in the last decade so it's + used expected to be extremely rare. + 20121223: After switching to Clang as the default compiler some users of ZFS on i386 systems started to experience stack overflow kernel panics. Modified: projects/counters/bin/ps/extern.h ============================================================================== --- projects/counters/bin/ps/extern.h Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/bin/ps/extern.h Sat Jan 19 21:57:25 2013 (r245674) @@ -51,7 +51,7 @@ char *elapsed(KINFO *, VARENT *); char *elapseds(KINFO *, VARENT *); char *emulname(KINFO *, VARENT *); VARENT *find_varentry(VAR *); -const char *fmt_argv(char **, char *, size_t); +const char *fmt_argv(char **, char *, char *, size_t); double getpcpu(const KINFO *); char *kvar(KINFO *, VARENT *); char *label(KINFO *, VARENT *); Modified: projects/counters/bin/ps/fmt.c ============================================================================== --- projects/counters/bin/ps/fmt.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/bin/ps/fmt.c Sat Jan 19 21:57:25 2013 (r245674) @@ -105,7 +105,7 @@ cmdpart(char *arg0) } const char * -fmt_argv(char **argv, char *cmd, size_t maxlen) +fmt_argv(char **argv, char *cmd, char *thread, size_t maxlen) { size_t len; char *ap, *cp; @@ -122,9 +122,14 @@ fmt_argv(char **argv, char *cmd, size_t cp = malloc(len); if (cp == NULL) errx(1, "malloc failed"); - if (ap == NULL) - sprintf(cp, "[%.*s]", (int)maxlen, cmd); - else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) + if (ap == NULL) { + if (thread != NULL) { + asprintf(&ap, "%s/%s", cmd, thread); + sprintf(cp, "[%.*s]", (int)maxlen, ap); + free(ap); + } else + sprintf(cp, "[%.*s]", (int)maxlen, cmd); + } else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) sprintf(cp, "%s (%.*s)", ap, (int)maxlen, cmd); else strcpy(cp, ap); Modified: projects/counters/bin/ps/ps.c ============================================================================== --- projects/counters/bin/ps/ps.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/bin/ps/ps.c Sat Jan 19 21:57:25 2013 (r245674) @@ -141,7 +141,7 @@ static void format_output(KINFO *); static void *expand_list(struct listinfo *); static const char * fmt(char **(*)(kvm_t *, const struct kinfo_proc *, int), - KINFO *, char *, int); + KINFO *, char *, char *, int); static void free_list(struct listinfo *); static void init_list(struct listinfo *, addelem_rtn, int, const char *); static char *kludge_oldps_options(const char *, char *, const char *); @@ -1163,11 +1163,12 @@ sizevars(void) static const char * fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki, - char *comm, int maxlen) + char *comm, char *thread, int maxlen) { const char *s; - s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, maxlen); + s = fmt_argv((*fn)(kd, ki->ki_p, termwidth), comm, + showthreads && ki->ki_p->ki_numthreads > 1 ? thread : NULL, maxlen); return (s); } @@ -1195,7 +1196,7 @@ saveuser(KINFO *ki) ki->ki_args = strdup("<defunct>"); else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) ki->ki_args = strdup(fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, MAXCOMLEN)); + ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN)); else asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm); if (ki->ki_args == NULL) @@ -1206,7 +1207,7 @@ saveuser(KINFO *ki) if (needenv) { if (UREADOK(ki)) ki->ki_env = strdup(fmt(kvm_getenvv, ki, - (char *)NULL, 0)); + (char *)NULL, (char *)NULL, 0)); else ki->ki_env = strdup("()"); if (ki->ki_env == NULL) Modified: projects/counters/contrib/compiler-rt/LICENSE.TXT ============================================================================== --- projects/counters/contrib/compiler-rt/LICENSE.TXT Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/LICENSE.TXT Sat Jan 19 21:57:25 2013 (r245674) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal Modified: projects/counters/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S ============================================================================== --- projects/counters/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/arm/aeabi_uldivmod.S Sat Jan 19 21:57:25 2013 (r245674) @@ -27,4 +27,5 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uldiv ldr r2, [sp, #8] ldr r3, [sp, #12] add sp, sp, #16 - pop {r11, pc} \ No newline at end of file + pop {r11, pc} + Modified: projects/counters/contrib/compiler-rt/lib/arm/divsi3.S ============================================================================== --- projects/counters/contrib/compiler-rt/lib/arm/divsi3.S Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/arm/divsi3.S Sat Jan 19 21:57:25 2013 (r245674) @@ -25,7 +25,16 @@ // Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3) DEFINE_COMPILERRT_FUNCTION(__divsi3) - ESTABLISH_FRAME +#if __ARM_ARCH_7S__ + tst r1,r1 + beq LOCAL_LABEL(divzero) + sdiv r0, r0, r1 + bx lr +LOCAL_LABEL(divzero): + mov r0,#0 + bx lr +#else +ESTABLISH_FRAME // Set aside the sign of the quotient. eor r4, r0, r1 // Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31). @@ -39,3 +48,4 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3) eor r0, r0, r4, asr #31 sub r0, r0, r4, asr #31 CLEAR_FRAME_AND_RETURN +#endif Modified: projects/counters/contrib/compiler-rt/lib/arm/udivsi3.S ============================================================================== --- projects/counters/contrib/compiler-rt/lib/arm/udivsi3.S Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/arm/udivsi3.S Sat Jan 19 21:57:25 2013 (r245674) @@ -33,6 +33,15 @@ // Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine. DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3) DEFINE_COMPILERRT_FUNCTION(__udivsi3) +#if __ARM_ARCH_7S__ + tst r1,r1 + beq LOCAL_LABEL(divzero) + udiv r0, r0, r1 + bx lr + LOCAL_LABEL(divzero): + mov r0,#0 + bx lr +#else // We use a simple digit by digit algorithm; before we get into the actual // divide loop, we must calculate the left-shift amount necessary to align // the MSB of the divisor with that of the dividend (If this shift is @@ -78,3 +87,4 @@ LOCAL_LABEL(return): // Move the quotient to r0 and return. mov r0, q CLEAR_FRAME_AND_RETURN +#endif Modified: projects/counters/contrib/compiler-rt/lib/cmpdi2.c ============================================================================== --- projects/counters/contrib/compiler-rt/lib/cmpdi2.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/cmpdi2.c Sat Jan 19 21:57:25 2013 (r245674) @@ -36,3 +36,16 @@ __cmpdi2(di_int a, di_int b) return 2; return 1; } + +#ifdef __ARM_EABI__ +/* Returns: if (a < b) returns -1 +* if (a == b) returns 0 +* if (a > b) returns 1 +*/ +COMPILER_RT_ABI si_int +__aeabi_lcmp(di_int a, di_int b) +{ + return __cmpdi2(a, b) - 1; +} +#endif + Modified: projects/counters/contrib/compiler-rt/lib/fixsfdi.c ============================================================================== --- projects/counters/contrib/compiler-rt/lib/fixsfdi.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/fixsfdi.c Sat Jan 19 21:57:25 2013 (r245674) @@ -23,7 +23,7 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -ARM_EABI_FNALIAS(d2lz, fixsfdi) +ARM_EABI_FNALIAS(f2lz, fixsfdi) COMPILER_RT_ABI di_int __fixsfdi(float a) Modified: projects/counters/contrib/compiler-rt/lib/int_endianness.h ============================================================================== --- projects/counters/contrib/compiler-rt/lib/int_endianness.h Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/int_endianness.h Sat Jan 19 21:57:25 2013 (r245674) @@ -31,7 +31,7 @@ /* .. */ -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__minix) #include <sys/endian.h> #if _BYTE_ORDER == _BIG_ENDIAN @@ -44,6 +44,19 @@ #endif /* *BSD */ +#if defined(__OpenBSD__) || defined(__Bitrig__) +#include <machine/endian.h> + +#if _BYTE_ORDER == _BIG_ENDIAN +#define _YUGA_LITTLE_ENDIAN 0 +#define _YUGA_BIG_ENDIAN 1 +#elif _BYTE_ORDER == _LITTLE_ENDIAN +#define _YUGA_LITTLE_ENDIAN 1 +#define _YUGA_BIG_ENDIAN 0 +#endif /* _BYTE_ORDER */ + +#endif /* OpenBSD and Bitrig. */ + /* .. */ /* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */ Modified: projects/counters/contrib/compiler-rt/lib/int_lib.h ============================================================================== --- projects/counters/contrib/compiler-rt/lib/int_lib.h Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/int_lib.h Sat Jan 19 21:57:25 2013 (r245674) @@ -25,7 +25,15 @@ #if __ARM_EABI__ # define ARM_EABI_FNALIAS(aeabi_name, name) \ void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); -# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) + +# if !defined(__clang__) && defined(__GNUC__) && \ + (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 5) +/* The pcs attribute was introduced in GCC 4.5.0 */ +# define COMPILER_RT_ABI +# else +# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) +# endif + #else # define ARM_EABI_FNALIAS(aeabi_name, name) # define COMPILER_RT_ABI Modified: projects/counters/contrib/compiler-rt/lib/ucmpdi2.c ============================================================================== --- projects/counters/contrib/compiler-rt/lib/ucmpdi2.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/contrib/compiler-rt/lib/ucmpdi2.c Sat Jan 19 21:57:25 2013 (r245674) @@ -36,3 +36,16 @@ __ucmpdi2(du_int a, du_int b) return 2; return 1; } + +#ifdef __ARM_EABI__ +/* Returns: if (a < b) returns -1 +* if (a == b) returns 0 +* if (a > b) returns 1 +*/ +COMPILER_RT_ABI si_int +__aeabi_ulcmp(di_int a, di_int b) +{ + return __ucmpdi2(a, b) - 1; +} +#endif + Modified: projects/counters/lib/Makefile ============================================================================== --- projects/counters/lib/Makefile Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/Makefile Sat Jan 19 21:57:25 2013 (r245674) @@ -115,6 +115,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libusbhid} \ ${_libusb} \ ${_libvgl} \ + ${_libvmmapi} \ libwrap \ liby \ libz \ @@ -198,6 +199,10 @@ _libproc= libproc _librtld_db= librtld_db .endif +.if ${MACHINE_CPUARCH} == "amd64" +_libvmmapi= libvmmapi +.endif + .if ${MACHINE_CPUARCH} == "ia64" _libefi= libefi .endif Modified: projects/counters/lib/libc/arm/Makefile.inc ============================================================================== --- projects/counters/lib/libc/arm/Makefile.inc Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libc/arm/Makefile.inc Sat Jan 19 21:57:25 2013 (r245674) @@ -8,3 +8,11 @@ SOFTFLOAT_BITS=32 # Long double is just double precision. MDSRCS+=machdep_ldisd.c SYM_MAPS+=${.CURDIR}/arm/Symbol.map + +.if ${MK_ARM_EABI} == "no" +# This contains the symbols that were removed when moving to the ARM EABI +SYM_MAPS+=${.CURDIR}/arm/Symbol_oabi.map +.else +.include "${.CURDIR}/arm/aeabi/Makefile.inc" +.endif + Modified: projects/counters/lib/libc/arm/SYS.h ============================================================================== --- projects/counters/lib/libc/arm/SYS.h Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libc/arm/SYS.h Sat Jan 19 21:57:25 2013 (r245674) @@ -39,7 +39,15 @@ #include <sys/syscall.h> #include <machine/swi.h> +#ifdef __ARM_EABI__ +#define SYSTRAP(x) \ + mov ip, r7; \ + ldr r7, =SYS_ ## x; \ + swi 0; \ + mov r7, ip +#else #define SYSTRAP(x) swi 0 | SYS_ ## x +#endif #define CERROR _C_LABEL(cerror) #define CURBRK _C_LABEL(curbrk) Modified: projects/counters/lib/libc/arm/Symbol.map ============================================================================== --- projects/counters/lib/libc/arm/Symbol.map Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libc/arm/Symbol.map Sat Jan 19 21:57:25 2013 (r245674) @@ -46,10 +46,6 @@ FBSDprivate_1.0 { _set_tp; __aeabi_read_tp; ___longjmp; - __umodsi3; - __modsi3; - __udivsi3; - __divsi3; __makecontext; __longjmp; signalcontext; Copied: projects/counters/lib/libc/arm/Symbol_oabi.map (from r245673, head/lib/libc/arm/Symbol_oabi.map) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/counters/lib/libc/arm/Symbol_oabi.map Sat Jan 19 21:57:25 2013 (r245674, copy of r245673, head/lib/libc/arm/Symbol_oabi.map) @@ -0,0 +1,16 @@ +/* + * $FreeBSD$ + */ + +/* + * This only needs to contain symbols that are not listed in + * symbol maps from other parts of libc (i.e., not found in + * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...) + * and are not used in the ARM EABI. + */ +FBSDprivate_1.0 { + __umodsi3; + __modsi3; + __udivsi3; + __divsi3; +}; Modified: projects/counters/lib/libc/arm/gen/Makefile.inc ============================================================================== --- projects/counters/lib/libc/arm/gen/Makefile.inc Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libc/arm/gen/Makefile.inc Sat Jan 19 21:57:25 2013 (r245674) @@ -3,4 +3,8 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c + +.if ${MK_ARM_EABI} == "no" +SRCS+= divsi3.S +.endif Modified: projects/counters/lib/libc/quad/Makefile.inc ============================================================================== --- projects/counters/lib/libc/quad/Makefile.inc Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libc/quad/Makefile.inc Sat Jan 19 21:57:25 2013 (r245674) @@ -8,6 +8,10 @@ SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c +.elif ${LIBC_ARCH} == "arm" && ${MK_ARM_EABI} != "no" + +SRCS+= adddi3.c anddi3.c floatunsdidf.c iordi3.c lshldi3.c notdi2.c \ + qdivrem.c subdi3.c xordi3.c .else SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c fixdfdi.c \ Modified: projects/counters/lib/libcompiler_rt/Makefile ============================================================================== --- projects/counters/lib/libcompiler_rt/Makefile Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libcompiler_rt/Makefile Sat Jan 19 21:57:25 2013 (r245674) @@ -136,18 +136,22 @@ SRCF+= adddf3 \ addsf3 \ divdf3 \ divsf3 \ - divsi3 \ extendsfdf2 \ fixdfsi \ fixsfsi \ floatsidf \ floatsisf \ - modsi3 \ muldf3 \ mulsf3 \ subdf3 \ subsf3 \ - truncdfsf2 \ + truncdfsf2 +.endif + +.if ${MACHINE_CPUARCH} != "mips" && \ + (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no") +SRCF+= divsi3 \ + modsi3 \ udivsi3 \ umodsi3 .endif @@ -181,6 +185,13 @@ SRCS+= ${file}.c . endif .endfor +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +SRCS+= aeabi_idivmod.S \ + aeabi_ldivmod.S \ + aeabi_uidivmod.S \ + aeabi_uldivmod.S +.endif + .if ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a Modified: projects/counters/lib/libthr/thread/thr_init.c ============================================================================== --- projects/counters/lib/libthr/thread/thr_init.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libthr/thread/thr_init.c Sat Jan 19 21:57:25 2013 (r245674) @@ -363,6 +363,12 @@ _libpthread_init(struct pthread *curthre _thr_signal_init(); if (_thread_event_mask & TD_CREATE) _thr_report_creation(curthread, curthread); + /* + * Always use our rtld lock implementation. + * It is faster because it postpones signal handlers + * instead of calling sigprocmask(2). + */ + _thr_rtld_init(); } } Modified: projects/counters/lib/libthr/thread/thr_kern.c ============================================================================== --- projects/counters/lib/libthr/thread/thr_kern.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/lib/libthr/thread/thr_kern.c Sat Jan 19 21:57:25 2013 (r245674) @@ -57,11 +57,6 @@ _thr_setthreaded(int threaded) return (0); __isthreaded = threaded; - if (threaded != 0) { - _thr_rtld_init(); - } else { - _thr_rtld_fini(); - } return (0); } Modified: projects/counters/libexec/rtld-elf/Makefile ============================================================================== --- projects/counters/libexec/rtld-elf/Makefile Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/libexec/rtld-elf/Makefile Sat Jan 19 21:57:25 2013 (r245674) @@ -42,6 +42,16 @@ LDFLAGS+= -shared -Wl,-Bsymbolic DPADD= ${LIBC_PIC} LDADD= -lc_pic +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +# Some of the required math functions (div & mod) are implemented in libgcc +# on ARM. The library also needs to be placed first to be correctly linked. +# As some of the functions are used before we have shared libraries. +DPADD+= ${LIBGCC} +LDADD+= -lgcc +.endif + + + .if ${MK_SYMVER} == "yes" LIBCDIR= ${TOPSRCDIR}/lib/libc VERSION_DEF= ${LIBCDIR}/Versions.def Modified: projects/counters/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- projects/counters/sbin/newfs_msdos/newfs_msdos.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/sbin/newfs_msdos/newfs_msdos.c Sat Jan 19 21:57:25 2013 (r245674) @@ -808,7 +808,7 @@ getdiskinfo(int fd, const char *fname, c struct stat st; if (fstat(fd, &st)) - err(1, "Cannot get disk size"); + err(1, "cannot get disk size"); /* create a fake geometry for a file image */ ms = st.st_size; dlp.d_secsize = 512; @@ -832,18 +832,18 @@ getdiskinfo(int fd, const char *fname, c if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) - errx(1, "Cannot get sector size, %s", strerror(errno)); + err(1, "cannot get sector size"); dlp.d_secperunit = ms / dlp.d_secsize; if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { - warnx("Cannot get number of sectors per track, %s", strerror(errno)); + warn("cannot get number of sectors per track"); dlp.d_nsectors = 63; } if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { - warnx("Cannot get number of heads, %s", strerror(errno)); + warn("cannot get number of heads"); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; else if (dlp.d_secperunit <= 63*16*1024) Copied: projects/counters/share/man/man4/bhyve.4 (from r245673, head/share/man/man4/bhyve.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/counters/share/man/man4/bhyve.4 Sat Jan 19 21:57:25 2013 (r245674, copy of r245673, head/share/man/man4/bhyve.4) @@ -0,0 +1,68 @@ +.\" +.\" Copyright (c) 2012 NetApp Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 5, 2013 +.Dt BHYVE 4 +.Os +.Sh NAME +.Nm bhyve +.Nd virtual machine monitor +.Sh SYNOPSIS +.Cd "/usr/sbin/bhyve" +.Cd "/usr/sbin/bhyveload" +.Cd "/usr/sbin/bhyvectl" +.Cd "/boot/kernel/vmm.ko" +.Sh DESCRIPTION +.Nm +is a virtual machine monitor that is hosted by FreeBSD. It is used to host +unmodified guest operating systems on top of FreeBSD. +.Pp +.Nm +relies heavily on hardware assist provided by the CPU and chipset to virtualize +processor and memory resources. +.Sh SEE ALSO +.Xr bhyve 8 , +.Xr bhyveload 8 , +.Xr bhyvectl 8 , +.Xr vmm 4 +.Sh HISTORY +.Nm +first appeared in +.Fx 10.0 , +and was developed at NetApp Inc. +.Sh AUTHORS +.Nm +was developed by +.An -nosplit +.An "Peter Grehan" Aq grehan@FreeBSD.org +and +.An "Neel Natu" Aq neel@FreeBSD.org +at NetApp Inc. +.Sh BUGS +.Nm +is considered experimental in +.Fx . Modified: projects/counters/share/mk/bsd.libnames.mk ============================================================================== --- projects/counters/share/mk/bsd.libnames.mk Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/share/mk/bsd.libnames.mk Sat Jan 19 21:57:25 2013 (r245674) @@ -162,6 +162,7 @@ LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a +LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a Modified: projects/counters/share/mk/bsd.own.mk ============================================================================== --- projects/counters/share/mk/bsd.own.mk Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/share/mk/bsd.own.mk Sat Jan 19 21:57:25 2013 (r245674) @@ -309,6 +309,7 @@ __DEFAULT_YES_OPTIONS = \ OPENSSH \ OPENSSL \ PAM \ + PC_SYSINSTALL \ PF \ PKGBOOTSTRAP \ PKGTOOLS \ Modified: projects/counters/sys/amd64/amd64/pmap.c ============================================================================== --- projects/counters/sys/amd64/amd64/pmap.c Sat Jan 19 17:22:12 2013 (r245673) +++ projects/counters/sys/amd64/amd64/pmap.c Sat Jan 19 21:57:25 2013 (r245674) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include <sys/param.h> +#include <sys/bus.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/ktr.h> @@ -133,6 +134,8 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_reserv.h> #include <vm/uma.h> +#include <machine/intr_machdep.h> +#include <machine/apicvar.h> #include <machine/cpu.h> #include <machine/cputypes.h> #include <machine/md_var.h> Copied: projects/counters/sys/amd64/include/vmm.h (from r245673, head/sys/amd64/include/vmm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/counters/sys/amd64/include/vmm.h Sat Jan 19 21:57:25 2013 (r245674, copy of r245673, head/sys/amd64/include/vmm.h) @@ -0,0 +1,293 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: vmm.h 482 2011-05-09 21:22:43Z grehan $ + */ + +#ifndef _VMM_H_ +#define _VMM_H_ + +#ifdef _KERNEL + +#define VM_MAX_NAMELEN 32 + +struct vm; +struct vm_memory_segment; +struct seg_desc; +struct vm_exit; +struct vm_run; +struct vlapic; + +enum x2apic_state; + +typedef int (*vmm_init_func_t)(void); +typedef int (*vmm_cleanup_func_t)(void); +typedef void * (*vmi_init_func_t)(struct vm *vm); /* instance specific apis */ +typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip); +typedef void (*vmi_cleanup_func_t)(void *vmi); +typedef int (*vmi_mmap_set_func_t)(void *vmi, vm_paddr_t gpa, + vm_paddr_t hpa, size_t length, + vm_memattr_t attr, int prot, + boolean_t superpages_ok); +typedef vm_paddr_t (*vmi_mmap_get_func_t)(void *vmi, vm_paddr_t gpa); +typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num, + uint64_t *retval); +typedef int (*vmi_set_register_t)(void *vmi, int vcpu, int num, + uint64_t val); +typedef int (*vmi_get_desc_t)(void *vmi, int vcpu, int num, + struct seg_desc *desc); +typedef int (*vmi_set_desc_t)(void *vmi, int vcpu, int num, + struct seg_desc *desc); +typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, + int type, int vector, + uint32_t code, int code_valid); +typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); +typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); + +struct vmm_ops { + vmm_init_func_t init; /* module wide initialization */ + vmm_cleanup_func_t cleanup; + + vmi_init_func_t vminit; /* vm-specific initialization */ + vmi_run_func_t vmrun; + vmi_cleanup_func_t vmcleanup; + vmi_mmap_set_func_t vmmmap_set; + vmi_mmap_get_func_t vmmmap_get; + vmi_get_register_t vmgetreg; + vmi_set_register_t vmsetreg; + vmi_get_desc_t vmgetdesc; + vmi_set_desc_t vmsetdesc; + vmi_inject_event_t vminject; + vmi_get_cap_t vmgetcap; + vmi_set_cap_t vmsetcap; +}; + +extern struct vmm_ops vmm_ops_intel; +extern struct vmm_ops vmm_ops_amd; + +struct vm *vm_create(const char *name); +void vm_destroy(struct vm *vm); +const char *vm_name(struct vm *vm); +int vm_malloc(struct vm *vm, vm_paddr_t gpa, size_t len); +int vm_map_mmio(struct vm *vm, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); +int vm_unmap_mmio(struct vm *vm, vm_paddr_t gpa, size_t len); +vm_paddr_t vm_gpa2hpa(struct vm *vm, vm_paddr_t gpa, size_t size); +int vm_gpabase2memseg(struct vm *vm, vm_paddr_t gpabase, + struct vm_memory_segment *seg); +int vm_get_register(struct vm *vm, int vcpu, int reg, uint64_t *retval); +int vm_set_register(struct vm *vm, int vcpu, int reg, uint64_t val); +int vm_get_seg_desc(struct vm *vm, int vcpu, int reg, + struct seg_desc *ret_desc); +int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, + struct seg_desc *desc); +int vm_get_pinning(struct vm *vm, int vcpu, int *cpuid); +int vm_set_pinning(struct vm *vm, int vcpu, int cpuid); +int vm_run(struct vm *vm, struct vm_run *vmrun); +int vm_inject_event(struct vm *vm, int vcpu, int type, + int vector, uint32_t error_code, int error_code_valid); +int vm_inject_nmi(struct vm *vm, int vcpu); +int vm_nmi_pending(struct vm *vm, int vcpuid); +void vm_nmi_clear(struct vm *vm, int vcpuid); +uint64_t *vm_guest_msrs(struct vm *vm, int cpu); +struct vlapic *vm_lapic(struct vm *vm, int cpu); +int vm_get_capability(struct vm *vm, int vcpu, int type, int *val); +int vm_set_capability(struct vm *vm, int vcpu, int type, int val); +int vm_get_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state *state); +int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state); +void vm_activate_cpu(struct vm *vm, int vcpu); +cpuset_t vm_active_cpus(struct vm *vm); +struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); + +/* + * Return 1 if device indicated by bus/slot/func is supposed to be a + * pci passthrough device. + * + * Return 0 otherwise. + */ +int vmm_is_pptdev(int bus, int slot, int func); + +void *vm_iommu_domain(struct vm *vm); + +enum vcpu_state { + VCPU_IDLE, + VCPU_RUNNING, + VCPU_CANNOT_RUN, +}; + +int vcpu_set_state(struct vm *vm, int vcpu, enum vcpu_state state); +enum vcpu_state vcpu_get_state(struct vm *vm, int vcpu); + +static int __inline +vcpu_is_running(struct vm *vm, int vcpu) +{ + return (vcpu_get_state(vm, vcpu) == VCPU_RUNNING); +} + +void *vcpu_stats(struct vm *vm, int vcpu); +void vm_interrupt_hostcpu(struct vm *vm, int vcpu); + +#endif /* KERNEL */ + +#include <machine/vmm_instruction_emul.h> + +#define VM_MAXCPU 8 /* maximum virtual cpus */ + +/* + * Identifiers for events that can be injected into the VM + */ +enum vm_event_type { + VM_EVENT_NONE, + VM_HW_INTR, + VM_NMI, + VM_HW_EXCEPTION, + VM_SW_INTR, + VM_PRIV_SW_EXCEPTION, + VM_SW_EXCEPTION, + VM_EVENT_MAX +}; + +/* + * Identifiers for architecturally defined registers. + */ +enum vm_reg_name { + VM_REG_GUEST_RAX, + VM_REG_GUEST_RBX, + VM_REG_GUEST_RCX, + VM_REG_GUEST_RDX, + VM_REG_GUEST_RSI, + VM_REG_GUEST_RDI, + VM_REG_GUEST_RBP, + VM_REG_GUEST_R8, + VM_REG_GUEST_R9, + VM_REG_GUEST_R10, + VM_REG_GUEST_R11, + VM_REG_GUEST_R12, + VM_REG_GUEST_R13, + VM_REG_GUEST_R14, + VM_REG_GUEST_R15, + VM_REG_GUEST_CR0, + VM_REG_GUEST_CR3, + VM_REG_GUEST_CR4, + VM_REG_GUEST_DR7, + VM_REG_GUEST_RSP, + VM_REG_GUEST_RIP, + VM_REG_GUEST_RFLAGS, + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS, + VM_REG_GUEST_LDTR, + VM_REG_GUEST_TR, + VM_REG_GUEST_IDTR, + VM_REG_GUEST_GDTR, + VM_REG_GUEST_EFER, + VM_REG_LAST +}; + +/* + * Identifiers for optional vmm capabilities + */ +enum vm_cap_type { + VM_CAP_HALT_EXIT, + VM_CAP_MTRAP_EXIT, + VM_CAP_PAUSE_EXIT, + VM_CAP_UNRESTRICTED_GUEST, + VM_CAP_MAX +}; + +enum x2apic_state { + X2APIC_ENABLED, + X2APIC_AVAILABLE, + X2APIC_DISABLED, + X2APIC_STATE_LAST +}; + +/* + * The 'access' field has the format specified in Table 21-2 of the Intel + * Architecture Manual vol 3b. + * + * XXX The contents of the 'access' field are architecturally defined except + * bit 16 - Segment Unusable. + */ +struct seg_desc { + uint64_t base; + uint32_t limit; + uint32_t access; +}; + +enum vm_exitcode { + VM_EXITCODE_INOUT, + VM_EXITCODE_VMX, + VM_EXITCODE_BOGUS, + VM_EXITCODE_RDMSR, + VM_EXITCODE_WRMSR, + VM_EXITCODE_HLT, + VM_EXITCODE_MTRAP, + VM_EXITCODE_PAUSE, + VM_EXITCODE_PAGING, + VM_EXITCODE_SPINUP_AP, + VM_EXITCODE_MAX +}; + +struct vm_exit { + enum vm_exitcode exitcode; + int inst_length; /* 0 means unknown */ + uint64_t rip; + union { + struct { + uint16_t bytes:3; /* 1 or 2 or 4 */ + uint16_t in:1; /* out is 0, in is 1 */ + uint16_t string:1; + uint16_t rep:1; + uint16_t port; + uint32_t eax; /* valid for out */ + } inout; + struct { + uint64_t gpa; + struct vie vie; + } paging; + /* + * VMX specific payload. Used when there is no "better" + * exitcode to represent the VM-exit. + */ + struct { + int error; /* vmx inst error */ + uint32_t exit_reason; + uint64_t exit_qualification; + } vmx; + struct { + uint32_t code; /* ecx value */ + uint64_t wval; + } msr; + struct { + int vcpu; + uint64_t rip; + } spinup_ap; + } u; +}; + +#endif /* _VMM_H_ */ Copied: projects/counters/sys/amd64/include/vmm_dev.h (from r245673, head/sys/amd64/include/vmm_dev.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/counters/sys/amd64/include/vmm_dev.h Sat Jan 19 21:57:25 2013 (r245674, copy of r245673, head/sys/amd64/include/vmm_dev.h) @@ -0,0 +1,215 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: vmm_dev.h 482 2011-05-09 21:22:43Z grehan $ + */ + +#ifndef _VMM_DEV_H_ +#define _VMM_DEV_H_ + +#ifdef _KERNEL +void vmmdev_init(void); +int vmmdev_cleanup(void); +#endif + +struct vm_memory_segment { + vm_paddr_t gpa; /* in */ + size_t len; /* in */ +}; + +struct vm_register { + int cpuid; + int regnum; /* enum vm_reg_name */ + uint64_t regval; +}; + +struct vm_seg_desc { /* data or code segment */ + int cpuid; + int regnum; /* enum vm_reg_name */ + struct seg_desc desc; +}; + +struct vm_pin { + int vm_cpuid; + int host_cpuid; /* -1 to unpin */ +}; + +struct vm_run { + int cpuid; + uint64_t rip; /* start running here */ + struct vm_exit vm_exit; +}; + +struct vm_event { + int cpuid; + enum vm_event_type type; + int vector; + uint32_t error_code; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301192157.r0JLvQa8003434>