Date: Mon, 12 Sep 2011 14:39:03 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r225511 - in user/attilio/vmcontention: contrib/top share/mk sys/amd64/amd64 sys/amd64/conf sys/amd64/ia32 sys/arm/conf sys/dev/ath/ath_rate/sample sys/dev/sound/pcm sys/dev/usb sys/dev... Message-ID: <201109121439.p8CEd3lF030150@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Mon Sep 12 14:39:03 2011 New Revision: 225511 URL: http://svn.freebsd.org/changeset/base/225511 Log: MFCMFC Added: user/attilio/vmcontention/sys/kern/subr_syscall.c - copied unchanged from r225507, head/sys/kern/subr_syscall.c Modified: user/attilio/vmcontention/sys/amd64/amd64/exception.S user/attilio/vmcontention/sys/amd64/amd64/genassym.c user/attilio/vmcontention/sys/amd64/amd64/trap.c user/attilio/vmcontention/sys/amd64/conf/GENERIC user/attilio/vmcontention/sys/amd64/ia32/ia32_syscall.c user/attilio/vmcontention/sys/arm/conf/HL200 user/attilio/vmcontention/sys/arm/conf/HL201 user/attilio/vmcontention/sys/arm/conf/KB920X user/attilio/vmcontention/sys/arm/conf/QILA9G20 user/attilio/vmcontention/sys/arm/conf/SAM9G20EK user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h user/attilio/vmcontention/sys/dev/sound/pcm/dsp.c user/attilio/vmcontention/sys/dev/usb/quirk/usb_quirk.c user/attilio/vmcontention/sys/dev/usb/usb_device.c user/attilio/vmcontention/sys/dev/usb/usb_dynamic.c user/attilio/vmcontention/sys/dev/usb/usb_dynamic.h user/attilio/vmcontention/sys/dev/usb/usbdi.h user/attilio/vmcontention/sys/i386/conf/GENERIC user/attilio/vmcontention/sys/i386/i386/trap.c user/attilio/vmcontention/sys/ia64/ia32/ia32_trap.c user/attilio/vmcontention/sys/ia64/ia64/trap.c user/attilio/vmcontention/sys/kern/subr_trap.c user/attilio/vmcontention/sys/kern/tty.c user/attilio/vmcontention/sys/mips/conf/OCTEON1 user/attilio/vmcontention/sys/pc98/conf/GENERIC user/attilio/vmcontention/sys/powerpc/aim/trap.c user/attilio/vmcontention/sys/powerpc/booke/trap.c user/attilio/vmcontention/sys/sparc64/conf/GENERIC user/attilio/vmcontention/sys/sparc64/sparc64/trap.c user/attilio/vmcontention/sys/sys/param.h user/attilio/vmcontention/sys/sys/proc.h Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/bind9/ (props changed) user/attilio/vmcontention/contrib/binutils/ (props changed) user/attilio/vmcontention/contrib/bzip2/ (props changed) user/attilio/vmcontention/contrib/compiler-rt/ (props changed) user/attilio/vmcontention/contrib/dialog/ (props changed) user/attilio/vmcontention/contrib/ee/ (props changed) user/attilio/vmcontention/contrib/expat/ (props changed) user/attilio/vmcontention/contrib/file/ (props changed) user/attilio/vmcontention/contrib/gcc/ (props changed) user/attilio/vmcontention/contrib/gdb/ (props changed) user/attilio/vmcontention/contrib/gdtoa/ (props changed) user/attilio/vmcontention/contrib/gnu-sort/ (props changed) user/attilio/vmcontention/contrib/groff/ (props changed) user/attilio/vmcontention/contrib/less/ (props changed) user/attilio/vmcontention/contrib/libpcap/ (props changed) user/attilio/vmcontention/contrib/libstdc++/ (props changed) user/attilio/vmcontention/contrib/llvm/ (props changed) user/attilio/vmcontention/contrib/llvm/tools/clang/ (props changed) user/attilio/vmcontention/contrib/ncurses/ (props changed) user/attilio/vmcontention/contrib/netcat/ (props changed) user/attilio/vmcontention/contrib/ntp/ (props changed) user/attilio/vmcontention/contrib/one-true-awk/ (props changed) user/attilio/vmcontention/contrib/openbsm/ (props changed) user/attilio/vmcontention/contrib/openpam/ (props changed) user/attilio/vmcontention/contrib/pf/ (props changed) user/attilio/vmcontention/contrib/sendmail/ (props changed) user/attilio/vmcontention/contrib/tcpdump/ (props changed) user/attilio/vmcontention/contrib/tcsh/ (props changed) user/attilio/vmcontention/contrib/tnftp/ (props changed) user/attilio/vmcontention/contrib/top/ (props changed) user/attilio/vmcontention/contrib/top/install-sh (props changed) user/attilio/vmcontention/contrib/tzcode/stdtime/ (props changed) user/attilio/vmcontention/contrib/tzcode/zic/ (props changed) user/attilio/vmcontention/contrib/tzdata/ (props changed) user/attilio/vmcontention/contrib/wpa/ (props changed) user/attilio/vmcontention/contrib/xz/ (props changed) user/attilio/vmcontention/crypto/openssh/ (props changed) user/attilio/vmcontention/crypto/openssl/ (props changed) user/attilio/vmcontention/gnu/lib/ (props changed) user/attilio/vmcontention/gnu/usr.bin/binutils/ (props changed) user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/ (props changed) user/attilio/vmcontention/gnu/usr.bin/gdb/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libc/stdtime/ (props changed) user/attilio/vmcontention/lib/libutil/ (props changed) user/attilio/vmcontention/lib/libz/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/mk/bsd.arch.inc.mk (props changed) user/attilio/vmcontention/share/zoneinfo/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/amd64/include/xen/ (props changed) user/attilio/vmcontention/sys/boot/ (props changed) user/attilio/vmcontention/sys/boot/i386/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/efi/ (props changed) user/attilio/vmcontention/sys/boot/ia64/ski/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/ (props changed) user/attilio/vmcontention/sys/boot/powerpc/ofw/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/sys/contrib/dev/acpica/ (props changed) user/attilio/vmcontention/sys/contrib/octeon-sdk/ (props changed) user/attilio/vmcontention/sys/contrib/pf/ (props changed) user/attilio/vmcontention/sys/contrib/x86emu/ (props changed) user/attilio/vmcontention/usr.bin/calendar/ (props changed) user/attilio/vmcontention/usr.bin/csup/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) user/attilio/vmcontention/usr.sbin/ndiscvt/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvctl/ (props changed) user/attilio/vmcontention/usr.sbin/rtadvd/ (props changed) user/attilio/vmcontention/usr.sbin/zic/ (props changed) Modified: user/attilio/vmcontention/sys/amd64/amd64/exception.S ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/exception.S Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/amd64/amd64/exception.S Mon Sep 12 14:39:03 2011 (r225511) @@ -380,8 +380,11 @@ IDTVEC(fast_syscall) movl $TF_HASSEGS,TF_FLAGS(%rsp) cld FAKE_MCOUNT(TF_RIP(%rsp)) - movq %rsp,%rdi - call syscall + movq PCPU(CURTHREAD),%rdi + movq %rsp,TD_FRAME(%rdi) + movl TF_RFLAGS(%rsp),%esi + andl $PSL_T,%esi + call amd64_syscall 1: movq PCPU(CURPCB),%rax /* Disable interrupts before testing PCB_FULL_IRET. */ cli @@ -395,18 +398,14 @@ IDTVEC(fast_syscall) movq %rsp, %rdi call ast jmp 1b + + .align 16 2: /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RAX(%rsp),%rax /* return value 1 */ - movq TF_RBX(%rsp),%rbx /* C preserved */ - movq TF_RBP(%rsp),%rbp /* C preserved */ - movq TF_R12(%rsp),%r12 /* C preserved */ - movq TF_R13(%rsp),%r13 /* C preserved */ - movq TF_R14(%rsp),%r14 /* C preserved */ - movq TF_R15(%rsp),%r15 /* C preserved */ movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%r9 /* user stack pointer */ Modified: user/attilio/vmcontention/sys/amd64/amd64/genassym.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/genassym.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/amd64/amd64/genassym.c Mon Sep 12 14:39:03 2011 (r225511) @@ -87,6 +87,7 @@ ASSYM(TD_PCB, offsetof(struct thread, td ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_TID, offsetof(struct thread, td_tid)); +ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); Modified: user/attilio/vmcontention/sys/amd64/amd64/trap.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/amd64/amd64/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -883,41 +883,38 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + +void amd64_syscall(struct thread *td, int traced); /* * syscall - system call request C handler * * A system call is essentially treated as a trap. */ void -syscall(struct trapframe *frame) +amd64_syscall(struct thread *td, int traced) { - struct thread *td; struct syscall_args sa; - register_t orig_tf_rflags; int error; ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { + if (ISPL(td->td_frame->tf_cs) != SEL_UPL) { panic("syscall"); /* NOT REACHED */ } #endif - orig_tf_rflags = frame->tf_rflags; - td = curthread; - td->td_frame = frame; - error = syscallenter(td, &sa); /* * Traced syscall. */ - if (orig_tf_rflags & PSL_T) { - frame->tf_rflags &= ~PSL_T; + if (__predict_false(traced)) { + td->td_frame->tf_rflags &= ~PSL_T; ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGTRAP; ksi.ksi_code = TRAP_TRACE; - ksi.ksi_addr = (void *)frame->tf_rip; + ksi.ksi_addr = (void *)td->td_frame->tf_rip; trapsignal(td, &ksi); } Modified: user/attilio/vmcontention/sys/amd64/conf/GENERIC ============================================================================== --- user/attilio/vmcontention/sys/amd64/conf/GENERIC Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/amd64/conf/GENERIC Mon Sep 12 14:39:03 2011 (r225511) @@ -326,7 +326,7 @@ device uath # Atheros AR5523 wireless device upgt # Conexant/Intersil PrismGT wireless NICs. device ural # Ralink Technology RT2500USB wireless NICs device urtw # Realtek RTL8187B/L wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code Modified: user/attilio/vmcontention/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/ia32/ia32_syscall.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/amd64/ia32/ia32_syscall.c Mon Sep 12 14:39:03 2011 (r225511) @@ -163,6 +163,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + void ia32_syscall(struct trapframe *frame) { Modified: user/attilio/vmcontention/sys/arm/conf/HL200 ============================================================================== --- user/attilio/vmcontention/sys/arm/conf/HL200 Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/arm/conf/HL200 Mon Sep 12 14:39:03 2011 (r225511) @@ -126,7 +126,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: user/attilio/vmcontention/sys/arm/conf/HL201 ============================================================================== --- user/attilio/vmcontention/sys/arm/conf/HL201 Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/arm/conf/HL201 Mon Sep 12 14:39:03 2011 (r225511) @@ -117,7 +117,7 @@ device udav # Davicom DM9601E USB #device rum # Ralink Technology RT2501USB wireless NICs #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: user/attilio/vmcontention/sys/arm/conf/KB920X ============================================================================== --- user/attilio/vmcontention/sys/arm/conf/KB920X Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/arm/conf/KB920X Mon Sep 12 14:39:03 2011 (r225511) @@ -126,7 +126,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # SCSI peripherals device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) Modified: user/attilio/vmcontention/sys/arm/conf/QILA9G20 ============================================================================== --- user/attilio/vmcontention/sys/arm/conf/QILA9G20 Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/arm/conf/QILA9G20 Mon Sep 12 14:39:03 2011 (r225511) @@ -142,7 +142,7 @@ device udav # Davicom DM9601E USB #device rum # Ralink Technology RT2501USB wireless NICs #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs # Wireless NIC cards #device wlan # 802.11 support Modified: user/attilio/vmcontention/sys/arm/conf/SAM9G20EK ============================================================================== --- user/attilio/vmcontention/sys/arm/conf/SAM9G20EK Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/arm/conf/SAM9G20EK Mon Sep 12 14:39:03 2011 (r225511) @@ -142,7 +142,7 @@ device udav # Davicom DM9601E USB #device rum # Ralink Technology RT2501USB wireless NICs #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs # Wireless NIC cards #device wlan # 802.11 support Modified: user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h Mon Sep 12 14:39:03 2011 (r225511) @@ -199,8 +199,8 @@ static unsigned calc_usecs_unicast_packe ctsduration += rt->info[cix].spAckDuration; /* XXX assumes short preamble */ - /* XXX assumes HT/20; the node info isn't yet available here */ - ctsduration += ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, is_ht40); + ctsduration += ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, + is_ht40, 0); if (cts) /* SIFS + ACK */ ctsduration += rt->info[cix].spAckDuration; @@ -210,8 +210,9 @@ static unsigned calc_usecs_unicast_packe tt += t_difs; /* XXX assumes short preamble */ - /* XXX assumes HT/20; the node info isn't yet available here */ - tt += (long_retries+1)*ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, 0, is_ht40); + tt += (long_retries+1)*ath_hal_pkt_txtime(sc->sc_ah, rt, length, rix, + is_ht40, 0); + tt += (long_retries+1)*(t_sifs + rt->info[rix].spAckDuration); for (x = 0; x <= short_retries + long_retries; x++) { Modified: user/attilio/vmcontention/sys/dev/sound/pcm/dsp.c ============================================================================== --- user/attilio/vmcontention/sys/dev/sound/pcm/dsp.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/sound/pcm/dsp.c Mon Sep 12 14:39:03 2011 (r225511) @@ -1062,7 +1062,8 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd { struct pcm_channel *chn, *rdch, *wrch; struct snddev_info *d; - int *arg_i, ret, tmp, xcmd; + u_long xcmd; + int *arg_i, ret, tmp; d = dsp_get_info(i_dev); if (!DSP_REGISTERED(d, i_dev)) Modified: user/attilio/vmcontention/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/quirk/usb_quirk.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/usb/quirk/usb_quirk.c Mon Sep 12 14:39:03 2011 (r225511) @@ -588,7 +588,7 @@ usb_test_quirk_by_info(const struct usbd } mtx_unlock(&usb_quirk_mtx); done: - return (usb_test_quirk_w(info, quirk)); + return (0); /* no quirk match */ } static struct usb_quirk_entry * Modified: user/attilio/vmcontention/sys/dev/usb/usb_device.c ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usb_device.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/usb/usb_device.c Mon Sep 12 14:39:03 2011 (r225511) @@ -1239,8 +1239,6 @@ static void usb_init_attach_arg(struct usb_device *udev, struct usb_attach_arg *uaa) { - uint8_t x; - memset(uaa, 0, sizeof(*uaa)); uaa->device = udev; @@ -1256,9 +1254,6 @@ usb_init_attach_arg(struct usb_device *u uaa->info.bDeviceProtocol = udev->ddesc.bDeviceProtocol; uaa->info.bConfigIndex = udev->curr_config_index; uaa->info.bConfigNum = udev->curr_config_no; - - for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) - uaa->info.autoQuirk[x] = udev->autoQuirk[x]; } /*------------------------------------------------------------------------* @@ -2389,8 +2384,22 @@ uint8_t usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk) { uint8_t found; + uint8_t x; + + if (quirk == UQ_NONE) + return (0); + + /* search the automatic per device quirks first */ + + for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) { + if (uaa->device->autoQuirk[x] == quirk) + return (1); + } + + /* search global quirk table, if any */ found = (usb_test_quirk_p) (&uaa->info, quirk); + return (found); } @@ -2723,7 +2732,8 @@ usbd_add_dynamic_quirk(struct usb_device uint8_t x; for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) { - if (udev->autoQuirk[x] == 0) { + if (udev->autoQuirk[x] == 0 || + udev->autoQuirk[x] == quirk) { udev->autoQuirk[x] = quirk; return (0); /* success */ } Modified: user/attilio/vmcontention/sys/dev/usb/usb_dynamic.c ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usb_dynamic.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/usb/usb_dynamic.c Mon Sep 12 14:39:03 2011 (r225511) @@ -50,12 +50,12 @@ #include <dev/usb/usb_process.h> #include <dev/usb/usb_device.h> #include <dev/usb/usb_dynamic.h> -#include <dev/usb/quirk/usb_quirk.h> /* function prototypes */ static usb_handle_req_t usb_temp_get_desc_w; static usb_temp_setup_by_index_t usb_temp_setup_by_index_w; static usb_temp_unsetup_t usb_temp_unsetup_w; +static usb_test_quirk_t usb_test_quirk_w; static usb_quirk_ioctl_t usb_quirk_ioctl_w; /* global variables */ @@ -72,19 +72,9 @@ usb_temp_setup_by_index_w(struct usb_dev return (USB_ERR_INVAL); } -uint8_t +static uint8_t usb_test_quirk_w(const struct usbd_lookup_info *info, uint16_t quirk) { - uint8_t x; - - if (quirk == UQ_NONE) - return (0); /* no match */ - - for (x = 0; x != USB_MAX_AUTO_QUIRK; x++) { - if (info->autoQuirk[x] == quirk) - return (1); /* match */ - } - return (0); /* no match */ } Modified: user/attilio/vmcontention/sys/dev/usb/usb_dynamic.h ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usb_dynamic.h Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/usb/usb_dynamic.h Mon Sep 12 14:39:03 2011 (r225511) @@ -57,6 +57,5 @@ extern devclass_t usb_devclass_ptr; void usb_temp_unload(void *); void usb_quirk_unload(void *); void usb_bus_unload(void *); -usb_test_quirk_t usb_test_quirk_w; #endif /* _USB_DYNAMIC_H_ */ Modified: user/attilio/vmcontention/sys/dev/usb/usbdi.h ============================================================================== --- user/attilio/vmcontention/sys/dev/usb/usbdi.h Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/dev/usb/usbdi.h Mon Sep 12 14:39:03 2011 (r225511) @@ -353,7 +353,6 @@ struct usbd_lookup_info { uint16_t idVendor; uint16_t idProduct; uint16_t bcdDevice; - uint16_t autoQuirk[USB_MAX_AUTO_QUIRK]; uint8_t bDeviceClass; uint8_t bDeviceSubClass; uint8_t bDeviceProtocol; Modified: user/attilio/vmcontention/sys/i386/conf/GENERIC ============================================================================== --- user/attilio/vmcontention/sys/i386/conf/GENERIC Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/i386/conf/GENERIC Mon Sep 12 14:39:03 2011 (r225511) @@ -339,7 +339,7 @@ device uath # Atheros AR5523 wireless device upgt # Conexant/Intersil PrismGT wireless NICs. device ural # Ralink Technology RT2500USB wireless NICs device urtw # Realtek RTL8187B/L wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code Modified: user/attilio/vmcontention/sys/i386/i386/trap.c ============================================================================== --- user/attilio/vmcontention/sys/i386/i386/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/i386/i386/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -1054,6 +1054,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * syscall - system call request C handler * Modified: user/attilio/vmcontention/sys/ia64/ia32/ia32_trap.c ============================================================================== --- user/attilio/vmcontention/sys/ia64/ia32/ia32_trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/ia64/ia32/ia32_trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -144,6 +144,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + static void ia32_syscall(struct trapframe *tf) { Modified: user/attilio/vmcontention/sys/ia64/ia64/trap.c ============================================================================== --- user/attilio/vmcontention/sys/ia64/ia64/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/ia64/ia64/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -929,6 +929,8 @@ cpu_fetch_syscall_args(struct thread *td return (0); } +#include "../../kern/subr_syscall.c" + /* * Process a system call. * Copied: user/attilio/vmcontention/sys/kern/subr_syscall.c (from r225507, head/sys/kern/subr_syscall.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/sys/kern/subr_syscall.c Mon Sep 12 14:39:03 2011 (r225511, copy of r225507, head/sys/kern/subr_syscall.c) @@ -0,0 +1,213 @@ +/*- + * Copyright (C) 1994, David Greenman + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org> + * + * This code is derived from software contributed to Berkeley by + * the University of Utah, and William Jolitz. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 + */ + +#include "opt_capsicum.h" +#include "opt_ktrace.h" +#include "opt_kdtrace.h" + +__FBSDID("$FreeBSD$"); + +#include <sys/capability.h> +#include <sys/ktr.h> +#ifdef KTRACE +#include <sys/uio.h> +#include <sys/ktrace.h> +#endif +#include <security/audit/audit.h> + +static inline int +syscallenter(struct thread *td, struct syscall_args *sa) +{ + struct proc *p; + int error, traced; + + PCPU_INC(cnt.v_syscall); + p = td->td_proc; + + td->td_pticks = 0; + if (td->td_ucred != p->p_ucred) + cred_update_thread(td); + if (p->p_flag & P_TRACED) { + traced = 1; + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_USERWR; + td->td_dbgflags |= TDB_SCE; + PROC_UNLOCK(p); + } else + traced = 0; + error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); +#ifdef KTRACE + if (KTRPOINT(td, KTR_SYSCALL)) + ktrsyscall(sa->code, sa->narg, sa->args); +#endif + + CTR6(KTR_SYSC, +"syscall: td=%p pid %d %s (%#lx, %#lx, %#lx)", + td, td->td_proc->p_pid, syscallname(p, sa->code), + sa->args[0], sa->args[1], sa->args[2]); + + if (error == 0) { + STOPEVENT(p, S_SCE, sa->narg); + PTRACESTOP_SC(p, td, S_PT_SCE); + if (td->td_dbgflags & TDB_USERWR) { + /* + * Reread syscall number and arguments if + * debugger modified registers or memory. + */ + error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); +#ifdef KTRACE + if (KTRPOINT(td, KTR_SYSCALL)) + ktrsyscall(sa->code, sa->narg, sa->args); +#endif + if (error != 0) + goto retval; + } + +#ifdef CAPABILITY_MODE + /* + * In capability mode, we only allow access to system calls + * flagged with SYF_CAPENABLED. + */ + if (IN_CAPABILITY_MODE(td) && + !(sa->callp->sy_flags & SYF_CAPENABLED)) { + error = ECAPMODE; + goto retval; + } +#endif + + error = syscall_thread_enter(td, sa->callp); + if (error != 0) + goto retval; + +#ifdef KDTRACE_HOOKS + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'entry', process the probe. + */ + if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) + (*systrace_probe_func)(sa->callp->sy_entry, sa->code, + sa->callp, sa->args, 0); +#endif + + AUDIT_SYSCALL_ENTER(sa->code, td); + error = (sa->callp->sy_call)(td, sa->args); + AUDIT_SYSCALL_EXIT(error, td); + + /* Save the latest error return value. */ + td->td_errno = error; + +#ifdef KDTRACE_HOOKS + /* + * If the systrace module has registered it's probe + * callback and if there is a probe active for the + * syscall 'return', process the probe. + */ + if (systrace_probe_func != NULL && sa->callp->sy_return != 0) + (*systrace_probe_func)(sa->callp->sy_return, sa->code, + sa->callp, NULL, (error) ? -1 : td->td_retval[0]); +#endif + syscall_thread_exit(td, sa->callp); + CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", + p, error, td->td_retval[0], td->td_retval[1]); + } + retval: + if (traced) { + PROC_LOCK(p); + td->td_dbgflags &= ~TDB_SCE; + PROC_UNLOCK(p); + } + (p->p_sysent->sv_set_syscall_retval)(td, error); + return (error); +} + +static inline void +syscallret(struct thread *td, int error, struct syscall_args *sa __unused) +{ + struct proc *p; + int traced; + + p = td->td_proc; + + /* + * Check for misbehavior. + */ + WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", + syscallname(p, sa->code)); + KASSERT(td->td_critnest == 0, + ("System call %s returning in a critical section", + syscallname(p, sa->code))); + KASSERT(td->td_locks == 0, + ("System call %s returning with %d locks held", + syscallname(p, sa->code), td->td_locks)); + + /* + * Handle reschedule and other end-of-syscall issues + */ + userret(td, td->td_frame); + + CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", + syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); + +#ifdef KTRACE + if (KTRPOINT(td, KTR_SYSRET)) + ktrsysret(sa->code, error, td->td_retval[0]); +#endif + + if (p->p_flag & P_TRACED) { + traced = 1; + PROC_LOCK(p); + td->td_dbgflags |= TDB_SCX; + PROC_UNLOCK(p); + } else + traced = 0; + /* + * This works because errno is findable through the + * register set. If we ever support an emulation where this + * is not the case, this code will need to be revisited. + */ + STOPEVENT(p, S_SCX, sa->code); + PTRACESTOP_SC(p, td, S_PT_SCX); + if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { + PROC_LOCK(p); + td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); + PROC_UNLOCK(p); + } +} Modified: user/attilio/vmcontention/sys/kern/subr_trap.c ============================================================================== --- user/attilio/vmcontention/sys/kern/subr_trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/kern/subr_trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -252,7 +252,6 @@ ast(struct trapframe *framep) mtx_assert(&Giant, MA_NOTOWNED); } -#ifdef HAVE_SYSCALL_ARGS_DEF const char * syscallname(struct proc *p, u_int code) { @@ -264,164 +263,3 @@ syscallname(struct proc *p, u_int code) return (unknown); return (sv->sv_syscallnames[code]); } - -int -syscallenter(struct thread *td, struct syscall_args *sa) -{ - struct proc *p; - int error, traced; - - PCPU_INC(cnt.v_syscall); - p = td->td_proc; - - td->td_pticks = 0; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - td->td_dbgflags |= TDB_SCE; - PROC_UNLOCK(p); - } else - traced = 0; - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - - CTR6(KTR_SYSC, -"syscall: td=%p pid %d %s (%#lx, %#lx, %#lx)", - td, td->td_proc->p_pid, syscallname(p, sa->code), - sa->args[0], sa->args[1], sa->args[2]); - - if (error == 0) { - STOPEVENT(p, S_SCE, sa->narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - if (error != 0) - goto retval; - } - -#ifdef CAPABILITY_MODE - /* - * In capability mode, we only allow access to system calls - * flagged with SYF_CAPENABLED. - */ - if (IN_CAPABILITY_MODE(td) && - !(sa->callp->sy_flags & SYF_CAPENABLED)) { - error = ECAPMODE; - goto retval; - } -#endif - - error = syscall_thread_enter(td, sa->callp); - if (error != 0) - goto retval; - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) - (*systrace_probe_func)(sa->callp->sy_entry, sa->code, - sa->callp, sa->args, 0); -#endif - - AUDIT_SYSCALL_ENTER(sa->code, td); - error = (sa->callp->sy_call)(td, sa->args); - AUDIT_SYSCALL_EXIT(error, td); - - /* Save the latest error return value. */ - td->td_errno = error; - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_return != 0) - (*systrace_probe_func)(sa->callp->sy_return, sa->code, - sa->callp, NULL, (error) ? -1 : td->td_retval[0]); -#endif - syscall_thread_exit(td, sa->callp); - CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", - p, error, td->td_retval[0], td->td_retval[1]); - } - retval: - if (traced) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_SCE; - PROC_UNLOCK(p); - } - (p->p_sysent->sv_set_syscall_retval)(td, error); - return (error); -} - -void -syscallret(struct thread *td, int error, struct syscall_args *sa __unused) -{ - struct proc *p; - int traced; - - p = td->td_proc; - - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - syscallname(p, sa->code)); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - syscallname(p, sa->code))); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - syscallname(p, sa->code), td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, td->td_frame); - - CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", - syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); - -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa->code, error, td->td_retval[0]); -#endif - - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags |= TDB_SCX; - PROC_UNLOCK(p); - } else - traced = 0; - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa->code); - PTRACESTOP_SC(p, td, S_PT_SCX); - if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { - PROC_LOCK(p); - td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); - PROC_UNLOCK(p); - } -} -#endif /* HAVE_SYSCALL_ARGS_DEF */ Modified: user/attilio/vmcontention/sys/kern/tty.c ============================================================================== --- user/attilio/vmcontention/sys/kern/tty.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/kern/tty.c Mon Sep 12 14:39:03 2011 (r225511) @@ -766,7 +766,7 @@ ttyil_ioctl(struct cdev *dev, u_long cmd struct thread *td) { struct tty *tp = dev->si_drv1; - int error = 0; + int error; tty_lock(tp); if (tty_gone(tp)) { @@ -777,6 +777,7 @@ ttyil_ioctl(struct cdev *dev, u_long cmd error = ttydevsw_cioctl(tp, dev2unit(dev), cmd, data, td); if (error != ENOIOCTL) goto done; + error = 0; switch (cmd) { case TIOCGETA: Modified: user/attilio/vmcontention/sys/mips/conf/OCTEON1 ============================================================================== --- user/attilio/vmcontention/sys/mips/conf/OCTEON1 Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/mips/conf/OCTEON1 Mon Sep 12 14:39:03 2011 (r225511) @@ -295,4 +295,4 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs Modified: user/attilio/vmcontention/sys/pc98/conf/GENERIC ============================================================================== --- user/attilio/vmcontention/sys/pc98/conf/GENERIC Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/pc98/conf/GENERIC Mon Sep 12 14:39:03 2011 (r225511) @@ -276,7 +276,7 @@ device bpf # Berkeley packet filter #device rum # Ralink Technology RT2501USB wireless NICs #device uath # Atheros AR5523 wireless NICs #device ural # Ralink Technology RT2500USB wireless NICs -#device zyd # ZyDAS zb1211/zb1211b wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support #device firewire # FireWire bus code Modified: user/attilio/vmcontention/sys/powerpc/aim/trap.c ============================================================================== --- user/attilio/vmcontention/sys/powerpc/aim/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/powerpc/aim/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -445,6 +445,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: user/attilio/vmcontention/sys/powerpc/booke/trap.c ============================================================================== --- user/attilio/vmcontention/sys/powerpc/booke/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/powerpc/booke/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -375,6 +375,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: user/attilio/vmcontention/sys/sparc64/conf/GENERIC ============================================================================== --- user/attilio/vmcontention/sys/sparc64/conf/GENERIC Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/sparc64/conf/GENERIC Mon Sep 12 14:39:03 2011 (r225511) @@ -257,7 +257,7 @@ device udav # Davicom DM9601E USB device rum # Ralink Technology RT2501USB wireless NICs device uath # Atheros AR5523 wireless NICs device ural # Ralink Technology RT2500USB wireless NICs -device zyd # ZyDAS zb1211/zb1211b wireless NICs +device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support device firewire # FireWire bus code Modified: user/attilio/vmcontention/sys/sparc64/sparc64/trap.c ============================================================================== --- user/attilio/vmcontention/sys/sparc64/sparc64/trap.c Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/sparc64/sparc64/trap.c Mon Sep 12 14:39:03 2011 (r225511) @@ -606,6 +606,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * Syscall handler * The arguments to the syscall are passed in the out registers by the caller, Modified: user/attilio/vmcontention/sys/sys/param.h ============================================================================== --- user/attilio/vmcontention/sys/sys/param.h Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/sys/param.h Mon Sep 12 14:39:03 2011 (r225511) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900043 /* Master, propagated to newvers */ +#define __FreeBSD_version 900044 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 Modified: user/attilio/vmcontention/sys/sys/proc.h ============================================================================== --- user/attilio/vmcontention/sys/sys/proc.h Mon Sep 12 14:32:35 2011 (r225510) +++ user/attilio/vmcontention/sys/sys/proc.h Mon Sep 12 14:39:03 2011 (r225511) @@ -873,9 +873,6 @@ void cpu_switch(struct thread *, struct void cpu_throw(struct thread *, struct thread *) __dead2; void unsleep(struct thread *); void userret(struct thread *, struct trapframe *); -struct syscall_args; -int syscallenter(struct thread *, struct syscall_args *); -void syscallret(struct thread *, int, struct syscall_args *); void cpu_exit(struct thread *); void exit1(struct thread *, int) __dead2;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109121439.p8CEd3lF030150>