PERFORCE change 166043 for review

John Baldwin jhb at FreeBSD.org
Mon Jul 13 20:29:37 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166043

Change 166043 by jhb at jhb_jhbbsd on 2009/07/13 20:28:45

	IFC @166037

Affected files ...

.. //depot/projects/smpng/share/man/man9/Makefile#7 integrate
.. //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#26 integrate
.. //depot/projects/smpng/sys/amd64/amd64/exception.S#24 integrate
.. //depot/projects/smpng/sys/amd64/amd64/genassym.c#29 integrate
.. //depot/projects/smpng/sys/amd64/amd64/io_apic.c#26 integrate
.. //depot/projects/smpng/sys/amd64/amd64/machdep.c#82 integrate
.. //depot/projects/smpng/sys/amd64/amd64/msi.c#14 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#96 integrate
.. //depot/projects/smpng/sys/amd64/amd64/sys_machdep.c#11 integrate
.. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#43 integrate
.. //depot/projects/smpng/sys/amd64/conf/GENERIC#82 integrate
.. //depot/projects/smpng/sys/amd64/ia32/ia32_exception.S#6 integrate
.. //depot/projects/smpng/sys/amd64/ia32/ia32_reg.c#5 integrate
.. //depot/projects/smpng/sys/amd64/ia32/ia32_signal.c#23 integrate
.. //depot/projects/smpng/sys/amd64/include/param.h#25 integrate
.. //depot/projects/smpng/sys/amd64/include/pcb.h#18 integrate
.. //depot/projects/smpng/sys/amd64/include/pmap.h#33 integrate
.. //depot/projects/smpng/sys/amd64/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_sysvec.c#41 integrate
.. //depot/projects/smpng/sys/arm/include/param.h#12 integrate
.. //depot/projects/smpng/sys/arm/include/pmap.h#28 integrate
.. //depot/projects/smpng/sys/arm/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/bsm/audit_kevents.h#16 integrate
.. //depot/projects/smpng/sys/cam/ata/ata_all.c#1 branch
.. //depot/projects/smpng/sys/cam/ata/ata_all.h#1 branch
.. //depot/projects/smpng/sys/cam/ata/ata_da.c#1 branch
.. //depot/projects/smpng/sys/cam/ata/ata_xpt.c#1 branch
.. //depot/projects/smpng/sys/cam/cam.c#10 integrate
.. //depot/projects/smpng/sys/cam/cam.h#5 integrate
.. //depot/projects/smpng/sys/cam/cam_ccb.h#12 integrate
.. //depot/projects/smpng/sys/cam/cam_periph.c#33 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt.c#58 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt.h#7 integrate
.. //depot/projects/smpng/sys/cam/cam_xpt_internal.h#1 branch
.. //depot/projects/smpng/sys/cam/cam_xpt_periph.h#5 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_all.c#28 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#38 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_ch.c#19 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#86 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_pass.c#23 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_pt.c#17 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_sa.c#34 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_ses.c#22 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_sg.c#7 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_xpt.c#1 branch
.. //depot/projects/smpng/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c#3 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_proto.h#58 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscall.h#58 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscalls.c#58 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_sysent.c#59 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#62 integrate
.. //depot/projects/smpng/sys/compat/svr4/svr4_stat.c#24 integrate
.. //depot/projects/smpng/sys/conf/NOTES#175 integrate
.. //depot/projects/smpng/sys/conf/files#248 integrate
.. //depot/projects/smpng/sys/conf/newvers.sh#25 integrate
.. //depot/projects/smpng/sys/conf/options#174 integrate
.. //depot/projects/smpng/sys/contrib/dev/acpica/compiler/aslcompile.c#7 integrate
.. //depot/projects/smpng/sys/contrib/dev/acpica/compiler/aslutils.c#8 integrate
.. //depot/projects/smpng/sys/dev/aac/aac_disk.c#26 integrate
.. //depot/projects/smpng/sys/dev/acpi_support/acpi_hp.c#3 integrate
.. //depot/projects/smpng/sys/dev/advansys/advansys.c#17 integrate
.. //depot/projects/smpng/sys/dev/advansys/advlib.h#4 integrate
.. //depot/projects/smpng/sys/dev/ahci/ahci.c#1 branch
.. //depot/projects/smpng/sys/dev/ahci/ahci.h#1 branch
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_osm.h#19 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx_osm.h#21 integrate
.. //depot/projects/smpng/sys/dev/amd/amd.h#3 integrate
.. //depot/projects/smpng/sys/dev/ata/atapi-cam.c#41 integrate
.. //depot/projects/smpng/sys/dev/ata/atapi-cd.c#72 integrate
.. //depot/projects/smpng/sys/dev/ata/chipsets/ata-ahci.c#9 integrate
.. //depot/projects/smpng/sys/dev/ata/chipsets/ata-marvell.c#7 integrate
.. //depot/projects/smpng/sys/dev/ata/chipsets/ata-nvidia.c#7 integrate
.. //depot/projects/smpng/sys/dev/ath/ah_osdep.c#9 integrate
.. //depot/projects/smpng/sys/dev/ath/ah_osdep.h#6 integrate
.. //depot/projects/smpng/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#9 integrate
.. //depot/projects/smpng/sys/dev/ath/if_ath.c#80 integrate
.. //depot/projects/smpng/sys/dev/ath/if_athvar.h#49 integrate
.. //depot/projects/smpng/sys/dev/ciss/ciss.c#62 integrate
.. //depot/projects/smpng/sys/dev/ciss/cissvar.h#12 integrate
.. //depot/projects/smpng/sys/dev/cxgb/cxgb_sge.c#22 integrate
.. //depot/projects/smpng/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c#18 integrate
.. //depot/projects/smpng/sys/dev/drm/drm_pciids.h#14 integrate
.. //depot/projects/smpng/sys/dev/drm/r600_cp.c#4 integrate
.. //depot/projects/smpng/sys/dev/drm/radeon_drv.h#21 integrate
.. //depot/projects/smpng/sys/dev/e1000/e1000_82542.c#3 integrate
.. //depot/projects/smpng/sys/dev/hptrr/hptrr_config.c#3 integrate
.. //depot/projects/smpng/sys/dev/ipw/if_ipw.c#23 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#43 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwi.c#34 integrate
.. //depot/projects/smpng/sys/dev/iwn/if_iwn.c#10 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfi.c#28 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfivar.h#10 integrate
.. //depot/projects/smpng/sys/dev/mlx/mlx.c#23 integrate
.. //depot/projects/smpng/sys/dev/mlx/mlxvar.h#10 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt.h#26 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_pci.c#35 integrate
.. //depot/projects/smpng/sys/dev/mwl/if_mwl.c#4 integrate
.. //depot/projects/smpng/sys/dev/mwl/if_mwlvar.h#3 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2560.c#17 integrate
.. //depot/projects/smpng/sys/dev/ral/rt2661.c#12 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/feeder_rate.c#19 integrate
.. //depot/projects/smpng/sys/dev/sound/usb/uaudio.c#31 integrate
.. //depot/projects/smpng/sys/dev/trm/trm.h#6 integrate
.. //depot/projects/smpng/sys/dev/usb/usb_busdma.c#7 integrate
.. //depot/projects/smpng/sys/dev/wpi/if_wpi.c#12 integrate
.. //depot/projects/smpng/sys/dev/xl/if_xl.c#6 integrate
.. //depot/projects/smpng/sys/fs/fifofs/fifo_vnops.c#52 integrate
.. //depot/projects/smpng/sys/fs/nfs/nfs_commonkrpc.c#4 integrate
.. //depot/projects/smpng/sys/fs/nfs/nfs_var.h#4 integrate
.. //depot/projects/smpng/sys/fs/nfsclient/nfs_clrpcops.c#3 integrate
.. //depot/projects/smpng/sys/fs/nfsclient/nfs_clstate.c#6 integrate
.. //depot/projects/smpng/sys/fs/nfsclient/nfs_clvnops.c#8 integrate
.. //depot/projects/smpng/sys/geom/geom_dev.c#52 integrate
.. //depot/projects/smpng/sys/geom/part/g_part.c#21 integrate
.. //depot/projects/smpng/sys/geom/part/g_part_if.m#5 integrate
.. //depot/projects/smpng/sys/i386/conf/GENERIC#113 integrate
.. //depot/projects/smpng/sys/i386/i386/io_apic.c#28 integrate
.. //depot/projects/smpng/sys/i386/i386/msi.c#14 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#136 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c#38 integrate
.. //depot/projects/smpng/sys/i386/include/param.h#23 integrate
.. //depot/projects/smpng/sys/i386/include/pmap.h#45 integrate
.. //depot/projects/smpng/sys/i386/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/i386/xen/pmap.c#9 integrate
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#93 integrate
.. //depot/projects/smpng/sys/ia64/include/param.h#22 integrate
.. //depot/projects/smpng/sys/ia64/include/pmap.h#26 integrate
.. //depot/projects/smpng/sys/ia64/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/kern/init_sysent.c#95 integrate
.. //depot/projects/smpng/sys/kern/kern_exit.c#143 integrate
.. //depot/projects/smpng/sys/kern/kern_mbuf.c#34 integrate
.. //depot/projects/smpng/sys/kern/kern_prot.c#114 integrate
.. //depot/projects/smpng/sys/kern/subr_param.c#30 integrate
.. //depot/projects/smpng/sys/kern/sys_pipe.c#66 integrate
.. //depot/projects/smpng/sys/kern/syscalls.c#94 integrate
.. //depot/projects/smpng/sys/kern/syscalls.master#100 integrate
.. //depot/projects/smpng/sys/kern/systrace_args.c#20 integrate
.. //depot/projects/smpng/sys/kern/tty.c#97 integrate
.. //depot/projects/smpng/sys/kern/tty_pts.c#20 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket.c#128 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#151 integrate
.. //depot/projects/smpng/sys/mips/include/param.h#4 integrate
.. //depot/projects/smpng/sys/mips/include/pmap.h#6 integrate
.. //depot/projects/smpng/sys/mips/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/modules/Makefile#165 integrate
.. //depot/projects/smpng/sys/modules/ahci/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/cam/Makefile#13 integrate
.. //depot/projects/smpng/sys/modules/geom/geom_label/Makefile#4 integrate
.. //depot/projects/smpng/sys/modules/wlan/Makefile#14 integrate
.. //depot/projects/smpng/sys/net/if_media.h#27 integrate
.. //depot/projects/smpng/sys/net/route.c#50 integrate
.. //depot/projects/smpng/sys/net80211/_ieee80211.h#17 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211.c#44 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211.h#24 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_action.c#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_action.h#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_adhoc.c#9 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ageq.c#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_ageq.h#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_ddb.c#18 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_freebsd.h#21 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_hostap.c#13 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ht.c#13 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ht.h#10 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_hwmp.c#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_input.c#48 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#49 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.h#24 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_mesh.c#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_mesh.h#1 branch
.. //depot/projects/smpng/sys/net80211/ieee80211_node.c#51 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_node.h#32 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_output.c#45 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_proto.c#37 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_proto.h#28 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_scan.c#11 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_scan.h#9 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_scan_sta.c#14 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_sta.c#12 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_var.h#42 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_wds.c#11 integrate
.. //depot/projects/smpng/sys/netinet/tcp_offload.h#3 integrate
.. //depot/projects/smpng/sys/netinet/tcp_sack.c#31 integrate
.. //depot/projects/smpng/sys/netinet/tcp_syncache.c#73 integrate
.. //depot/projects/smpng/sys/netinet/tcp_syncache.h#7 integrate
.. //depot/projects/smpng/sys/netinet/tcp_var.h#71 integrate
.. //depot/projects/smpng/sys/netinet6/in6.c#62 integrate
.. //depot/projects/smpng/sys/nfs/nfs_common.c#17 integrate
.. //depot/projects/smpng/sys/pc98/conf/GENERIC#86 integrate
.. //depot/projects/smpng/sys/powerpc/aim/mmu_oea64.c#4 integrate
.. //depot/projects/smpng/sys/powerpc/include/param.h#17 integrate
.. //depot/projects/smpng/sys/powerpc/include/pmap.h#24 integrate
.. //depot/projects/smpng/sys/powerpc/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/sparc64/conf/GENERIC#98 integrate
.. //depot/projects/smpng/sys/sparc64/include/param.h#21 integrate
.. //depot/projects/smpng/sys/sparc64/include/pmap.h#34 integrate
.. //depot/projects/smpng/sys/sparc64/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/sun4v/conf/GENERIC#19 integrate
.. //depot/projects/smpng/sys/sun4v/include/param.h#4 integrate
.. //depot/projects/smpng/sys/sun4v/include/pmap.h#5 integrate
.. //depot/projects/smpng/sys/sun4v/include/vm.h#2 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/pmap.c#17 integrate
.. //depot/projects/smpng/sys/sys/disk.h#17 integrate
.. //depot/projects/smpng/sys/sys/namei.h#22 integrate
.. //depot/projects/smpng/sys/sys/param.h#152 integrate
.. //depot/projects/smpng/sys/sys/socketvar.h#66 integrate
.. //depot/projects/smpng/sys/sys/syscall.h#93 integrate
.. //depot/projects/smpng/sys/sys/syscall.mk#93 integrate
.. //depot/projects/smpng/sys/sys/syscallsubr.h#62 integrate
.. //depot/projects/smpng/sys/sys/sysproto.h#97 integrate
.. //depot/projects/smpng/sys/tools/sound/feeder_rate_mkfilter.awk#4 integrate
.. //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#79 integrate
.. //depot/projects/smpng/sys/vm/device_pager.c#27 integrate
.. //depot/projects/smpng/sys/vm/pmap.h#37 integrate
.. //depot/projects/smpng/sys/vm/vm.h#14 integrate
.. //depot/projects/smpng/sys/vm/vm_contig.c#51 integrate
.. //depot/projects/smpng/sys/vm/vm_extern.h#37 integrate
.. //depot/projects/smpng/sys/vm/vm_fault.c#78 integrate
.. //depot/projects/smpng/sys/vm/vm_map.c#101 integrate
.. //depot/projects/smpng/sys/vm/vm_object.c#112 integrate
.. //depot/projects/smpng/sys/vm/vm_object.h#40 integrate
.. //depot/projects/smpng/sys/vm/vm_page.c#106 integrate
.. //depot/projects/smpng/sys/vm/vm_phys.c#8 integrate
.. //depot/projects/smpng/sys/vm/vm_phys.h#4 integrate

Differences ...

==== //depot/projects/smpng/share/man/man9/Makefile#7 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/share/man/man9/Makefile,v 1.356 2009/06/24 17:01:17 thompsa Exp $
+# $FreeBSD: src/share/man/man9/Makefile,v 1.357 2009/07/11 17:36:59 cperciva Exp $
 
 MAN=	accept_filter.9 \
 	accf_data.9 \
@@ -698,7 +698,7 @@
 	kobj.9 kobj_init.9
 MLINKS+=kproc.9 kproc_create.9 \
 	kproc.9 kproc_exit.9 \
-	kproc.9 kproc_resume,.9 \
+	kproc.9 kproc_resume.9 \
 	kproc.9 kproc_shutdown.9 \
 	kproc.9 kproc_start.9 \
 	kproc.9 kproc_suspend.9 \

==== //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#26 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.168 2009/04/01 13:09:26 kib Exp $
+ * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.169 2009/07/09 09:34:11 kib Exp $
  */
 
 #include <machine/asmacros.h>
@@ -97,6 +97,7 @@
 ENTRY(cpu_switch)
 	/* Switch to new thread.  First, save context. */
 	movq	TD_PCB(%rdi),%r8
+	movb	$1,PCB_FULL_IRET(%r8)
 
 	movq	(%rsp),%rax			/* Hardware registers */
 	movq	%r15,PCB_R15(%r8)

==== //depot/projects/smpng/sys/amd64/amd64/exception.S#24 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.138 2009/04/01 13:09:26 kib Exp $
+ * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.140 2009/07/10 10:29:16 kib Exp $
  */
 
 #include "opt_atpic.h"
@@ -162,19 +162,20 @@
 	.globl	alltraps
 	.type	alltraps, at function
 alltraps:
+	movq	%rdi,TF_RDI(%rsp)
 	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
 	jz	alltraps_testi		/* already running with kernel GS.base */
 	swapgs
+	movq	PCPU(CURPCB),%rdi
+	movb	$0,PCB_FULL_IRET(%rdi)
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
 alltraps_testi:
 	testl	$PSL_I,TF_RFLAGS(%rsp)
-	jz	alltraps_pushregs
+	jz	alltraps_pushregs_no_rdi
 	sti
-alltraps_pushregs:
-	movq	%rdi,TF_RDI(%rsp)
 alltraps_pushregs_no_rdi:
 	movq	%rsi,TF_RSI(%rsp)
 	movq	%rdx,TF_RDX(%rsp)
@@ -233,14 +234,17 @@
 	.globl	alltraps_noen
 	.type	alltraps_noen, at function
 alltraps_noen:
+	movq	%rdi,TF_RDI(%rsp)
 	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
 	jz	1f	/* already running with kernel GS.base */
 	swapgs
+	movq	PCPU(CURPCB),%rdi
+	movb	$0,PCB_FULL_IRET(%rdi)
 1:	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
-	jmp	alltraps_pushregs
+	jmp	alltraps_pushregs_no_rdi
 
 IDTVEC(dblfault)
 	subq	$TF_ERR,%rsp
@@ -278,12 +282,13 @@
 IDTVEC(page)
 	subq	$TF_ERR,%rsp
 	movl	$T_PAGEFLT,TF_TRAPNO(%rsp)
+	movq	%rdi,TF_RDI(%rsp)	/* free up a GP register */
 	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
 	jz	1f			/* already running with kernel GS.base */
 	swapgs
-1:
-	movq	%rdi,TF_RDI(%rsp)	/* free up a GP register */
-	movq	%cr2,%rdi		/* preserve %cr2 before ..  */
+	movq	PCPU(CURPCB),%rdi
+	movb	$0,PCB_FULL_IRET(%rdi)
+1:	movq	%cr2,%rdi		/* preserve %cr2 before ..  */
 	movq	%rdi,TF_ADDR(%rsp)	/* enabling interrupts. */
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
@@ -311,7 +316,9 @@
 	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
 	jz	2f			/* already running with kernel GS.base */
 1:	swapgs
-2:	movw	%fs,TF_FS(%rsp)
+2:	movq	PCPU(CURPCB),%rdi
+	movb	$1,PCB_FULL_IRET(%rdi)	/* always full iret from GPF */
+	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
@@ -341,6 +348,8 @@
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
+	movq	PCPU(CURPCB),%r11
+	movb	$0,PCB_FULL_IRET(%r11)
 	sti
 	movq	$KUDSEL,TF_SS(%rsp)
 	movq	$KUCSEL,TF_CS(%rsp)
@@ -644,7 +653,8 @@
 	 */
 	testb	$SEL_RPL_MASK,TF_CS(%rsp)
 	jz	ld_regs
-
+	cmpb	$0,PCB_FULL_IRET(%r8)
+	je	ld_regs
 	testl	$TF_HASSEGS,TF_FLAGS(%rsp)
 	je	set_segs
 
@@ -756,38 +766,38 @@
 	.globl	ds_load_fault
 ds_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
-	movzwl	TF_DS(%rsp),%edx
-	movl	%edx,TF_ERR(%rsp)
+	movq	%rsp, %rdi
+	call	trap
 	movw	$KUDSEL,TF_DS(%rsp)
-	jmp	calltrap
+	jmp	doreti
 
 	ALIGN_TEXT
 	.globl	es_load_fault
 es_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
-	movzwl	TF_ES(%rsp),%edx
-	movl	%edx,TF_ERR(%rsp)
+	movq	%rsp, %rdi
+	call	trap
 	movw	$KUDSEL,TF_ES(%rsp)
-	jmp	calltrap
+	jmp	doreti
 
 	ALIGN_TEXT
 	.globl	fs_load_fault
 fs_load_fault:
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
-	movzwl	TF_FS(%rsp),%edx
-	movl	%edx,TF_ERR(%rsp)
+	movq	%rsp, %rdi
+	call	trap
 	movw	$KUF32SEL,TF_FS(%rsp)
-	jmp	calltrap
+	jmp	doreti
 
 	ALIGN_TEXT
 	.globl	gs_load_fault
 gs_load_fault:
 	popfq
 	movl	$T_PROTFLT,TF_TRAPNO(%rsp)
-	movzwl	TF_GS(%rsp),%edx
-	movl	%edx,TF_ERR(%rsp)
+	movq	%rsp, %rdi
+	call	trap
 	movw	$KUG32SEL,TF_GS(%rsp)
-	jmp	calltrap
+	jmp	doreti
 #ifdef HWPMC_HOOKS
 	ENTRY(end_exceptions)
 #endif

==== //depot/projects/smpng/sys/amd64/amd64/genassym.c#29 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.176 2009/07/01 07:34:28 dfr Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.177 2009/07/09 09:34:11 kib Exp $");
 
 #include "opt_compat.h"
 #include "opt_hwpmc_hooks.h"
@@ -141,6 +141,7 @@
 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
 ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp));
+ASSYM(PCB_FULL_IRET, offsetof(struct pcb, pcb_full_iret));
 ASSYM(PCB_DBREGS, PCB_DBREGS);
 ASSYM(PCB_32BIT, PCB_32BIT);
 ASSYM(PCB_GS32BIT, PCB_GS32BIT);

==== //depot/projects/smpng/sys/amd64/amd64/io_apic.c#26 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.34 2009/07/01 17:20:07 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/io_apic.c,v 1.35 2009/07/06 18:23:00 jhb Exp $");
 
 #include "opt_isa.h"
 
@@ -327,7 +327,7 @@
 {
 	struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
 	struct ioapic *io = (struct ioapic *)isrc->is_pic;
-	u_int old_vector;
+	u_int old_vector, new_vector;
 	u_int old_id;
 
 	/*
@@ -348,11 +348,14 @@
 	 * Allocate an APIC vector for this interrupt pin.  Once
 	 * we have a vector we program the interrupt pin.
 	 */
-	intpin->io_cpu = apic_id;
-	intpin->io_vector = apic_alloc_vector(apic_id, intpin->io_irq);
-	if (intpin->io_vector == 0)
+	new_vector = apic_alloc_vector(apic_id, intpin->io_irq);
+	if (new_vector == 0)
 		return (ENOSPC);
 
+	intpin->io_cpu = apic_id;
+	intpin->io_vector = new_vector;
+	if (isrc->is_handlers > 0)
+		apic_enable_vector(intpin->io_cpu, intpin->io_vector);
 	if (bootverbose) {
 		printf("ioapic%u: routing intpin %u (", io->io_id,
 		    intpin->io_intpin);
@@ -365,8 +368,11 @@
 	 * Free the old vector after the new one is established.  This is done
 	 * to prevent races where we could miss an interrupt.
 	 */
-	if (old_vector)
+	if (old_vector) {
+		if (isrc->is_handlers > 0)
+			apic_disable_vector(old_id, old_vector);
 		apic_free_vector(old_id, old_vector, intpin->io_irq);
+	}
 	return (0);
 }
 

==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#82 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.703 2009/06/23 22:42:39 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.705 2009/07/09 09:34:11 kib Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -100,8 +100,9 @@
 #ifndef KDB
 #error KDB must be enabled in order for DDB to work!
 #endif
+#include <ddb/ddb.h>
+#include <ddb/db_sym.h>
 #endif
-#include <ddb/ddb.h>
 
 #include <net/netisr.h>
 
@@ -381,6 +382,7 @@
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
+	td->td_pcb->pcb_full_iret = 1;
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -482,6 +484,7 @@
 	signotify(td);
 	PROC_UNLOCK(p);
 	td->td_pcb->pcb_flags |= PCB_FULLCTX;
+	td->td_pcb->pcb_full_iret = 1;
 	return (EJUSTRETURN);
 }
 
@@ -852,6 +855,7 @@
 	pcb->pcb_gsbase = 0;
 	pcb->pcb_flags &= ~(PCB_32BIT | PCB_GS32BIT);
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
+	pcb->pcb_full_iret = 1;
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;
@@ -1083,6 +1087,30 @@
 	IDTVEC(xmm), IDTVEC(dblfault),
 	IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
+#ifdef DDB
+/*
+ * Display the index and function name of any IDT entries that don't use
+ * the default 'rsvd' entry point.
+ */
+DB_SHOW_COMMAND(idt, db_show_idt)
+{
+	struct gate_descriptor *ip;
+	int idx;
+	uintptr_t func;
+
+	ip = idt;
+	for (idx = 0; idx < NIDT && !db_pager_quit; idx++) {
+		func = ((long)ip->gd_hioffset << 16 | ip->gd_looffset);
+		if (func != (uintptr_t)&IDTVEC(rsvd)) {
+			db_printf("%3d\t", idx);
+			db_printsym(func, DB_STGY_PROC);
+			db_printf("\n");
+		}
+		ip++;
+	}
+}
+#endif
+
 void
 sdtossd(sd, ssd)
 	struct user_segment_descriptor *sd;
@@ -2006,6 +2034,7 @@
 		td->td_pcb->pcb_gsbase = mcp->mc_gsbase;
 	}
 	td->td_pcb->pcb_flags |= PCB_FULLCTX;
+	td->td_pcb->pcb_full_iret = 1;
 	return (0);
 }
 

==== //depot/projects/smpng/sys/amd64/amd64/msi.c#14 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.13 2009/07/01 17:20:07 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.14 2009/07/06 18:23:00 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -230,6 +230,8 @@
 
 	msi->msi_cpu = apic_id;
 	msi->msi_vector = vector;
+	if (msi->msi_intsrc.is_handlers > 0)
+		apic_enable_vector(msi->msi_cpu, msi->msi_vector);
 	if (bootverbose)
 		printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n",
 		    msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq,
@@ -238,6 +240,8 @@
 		sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]);
 		sib->msi_cpu = apic_id;
 		sib->msi_vector = vector + i;
+		if (sib->msi_intsrc.is_handlers > 0)
+			apic_enable_vector(sib->msi_cpu, sib->msi_vector);
 		if (bootverbose)
 			printf(
 		    "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n",
@@ -249,9 +253,15 @@
 	 * Free the old vector after the new one is established.  This is done
 	 * to prevent races where we could miss an interrupt.
 	 */
+	if (msi->msi_intsrc.is_handlers > 0)
+		apic_disable_vector(old_id, old_vector);
 	apic_free_vector(old_id, old_vector, msi->msi_irq);
-	for (i = 1; i < msi->msi_count; i++)
+	for (i = 1; i < msi->msi_count; i++) {
+		sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]);
+		if (sib->msi_intsrc.is_handlers > 0)
+			apic_disable_vector(old_id, old_vector + i);
 		apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]);
+	}
 	return (0);
 }
 

==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#96 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.661 2009/06/14 19:51:43 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.663 2009/07/12 23:31:20 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -614,6 +614,7 @@
 {
 
 	TAILQ_INIT(&m->md.pv_list);
+	m->md.pat_mode = PAT_WRITE_BACK;
 }
 
 /*
@@ -1120,7 +1121,8 @@
 	endpte = pte + count;
 	while (pte < endpte) {
 		oldpte |= *pte;
-		pte_store(pte, VM_PAGE_TO_PHYS(*ma) | PG_G | PG_RW | PG_V);
+		pte_store(pte, VM_PAGE_TO_PHYS(*ma) | PG_G |
+		    pmap_cache_bits((*ma)->md.pat_mode, 0) | PG_RW | PG_V);
 		pte++;
 		ma++;
 	}
@@ -2218,11 +2220,19 @@
 		/*
 		 * Invalidate the 2MB page mapping and return "failure" if the
 		 * mapping was never accessed or the allocation of the new
-		 * page table page fails.
+		 * page table page fails.  If the 2MB page mapping belongs to
+		 * the direct map region of the kernel's address space, then
+		 * the page allocation request specifies the highest possible
+		 * priority (VM_ALLOC_INTERRUPT).  Otherwise, the priority is
+		 * normal.  Page table pages are preallocated for every other
+		 * part of the kernel address space, so the direct map region
+		 * is the only part of the kernel address space that must be
+		 * handled here.
 		 */
 		if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL,
-		    pmap_pde_pindex(va), VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL |
-		    VM_ALLOC_WIRED)) == NULL) {
+		    pmap_pde_pindex(va), (va >= DMAP_MIN_ADDRESS && va <
+		    DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) |
+		    VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) {
 			free = NULL;
 			pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free);
 			pmap_invalidate_page(pmap, trunc_2mpage(va));
@@ -3017,7 +3027,7 @@
 	/*
 	 * Now validate mapping with desired protection/wiring.
 	 */
-	newpte = (pt_entry_t)(pa | PG_V);
+	newpte = (pt_entry_t)(pa | pmap_cache_bits(m->md.pat_mode, 0) | PG_V);
 	if ((prot & VM_PROT_WRITE) != 0) {
 		newpte |= PG_RW;
 		vm_page_flag_set(m, PG_WRITEABLE);
@@ -3102,7 +3112,8 @@
 		    " in pmap %p", va, pmap);
 		return (FALSE);
 	}
-	newpde = VM_PAGE_TO_PHYS(m) | PG_PS | PG_V;
+	newpde = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 1) |
+	    PG_PS | PG_V;
 	if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) {
 		newpde |= PG_MANAGED;
 
@@ -3284,7 +3295,7 @@
 	 */
 	pmap->pm_stats.resident_count++;
 
-	pa = VM_PAGE_TO_PHYS(m);
+	pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0);
 	if ((prot & VM_PROT_EXECUTE) == 0)
 		pa |= pg_nx;
 
@@ -3325,6 +3336,7 @@
 	pd_entry_t *pde;
 	vm_paddr_t pa, ptepa;
 	vm_page_t p, pdpg;
+	int pat_mode;
 
 	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
 	KASSERT(object->type == OBJT_DEVICE,
@@ -3335,6 +3347,7 @@
 		p = vm_page_lookup(object, pindex);
 		KASSERT(p->valid == VM_PAGE_BITS_ALL,
 		    ("pmap_object_init_pt: invalid page %p", p));
+		pat_mode = p->md.pat_mode;
 
 		/*
 		 * Abort the mapping if the first page is not physically
@@ -3346,21 +3359,28 @@
 
 		/*
 		 * Skip the first page.  Abort the mapping if the rest of
-		 * the pages are not physically contiguous.
+		 * the pages are not physically contiguous or have differing
+		 * memory attributes.
 		 */
 		p = TAILQ_NEXT(p, listq);
 		for (pa = ptepa + PAGE_SIZE; pa < ptepa + size;
 		    pa += PAGE_SIZE) {
 			KASSERT(p->valid == VM_PAGE_BITS_ALL,
 			    ("pmap_object_init_pt: invalid page %p", p));
-			if (pa != VM_PAGE_TO_PHYS(p))
+			if (pa != VM_PAGE_TO_PHYS(p) ||
+			    pat_mode != p->md.pat_mode)
 				return;
 			p = TAILQ_NEXT(p, listq);
 		}
 
-		/* Map using 2MB pages. */
+		/*
+		 * Map using 2MB pages.  Since "ptepa" is 2M aligned and
+		 * "size" is a multiple of 2M, adding the PAT setting to "pa"
+		 * will not affect the termination of this loop.
+		 */ 
 		PMAP_LOCK(pmap);
-		for (pa = ptepa; pa < ptepa + size; pa += NBPDR) {
+		for (pa = ptepa | pmap_cache_bits(pat_mode, 1); pa < ptepa +
+		    size; pa += NBPDR) {
 			pdpg = pmap_allocpde(pmap, addr, M_NOWAIT);
 			if (pdpg == NULL) {
 				/*
@@ -4365,6 +4385,23 @@
 }
 
 /*
+ * Sets the memory attribute for the specified page.
+ */
+void
+pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
+{
+
+	m->md.pat_mode = ma;
+
+	/*
+	 * Update the direct mapping and flush the cache.
+	 */
+	if (pmap_change_attr(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), PAGE_SIZE,
+	    m->md.pat_mode))
+		panic("memory attribute change on the direct map failed");
+}
+
+/*
  * Changes the specified virtual address range's memory type to that given by
  * the parameter "mode".  The specified virtual address range must be
  * completely contained within either the direct map or the kernel map.  If

==== //depot/projects/smpng/sys/amd64/amd64/sys_machdep.c#11 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.93 2009/06/27 15:03:50 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/sys_machdep.c,v 1.94 2009/07/09 09:34:11 kib Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,6 +103,7 @@
 		error = amd64_get_ldt(td, largs);
 		break;
 	case I386_SET_LDT:
+		td->td_pcb->pcb_full_iret = 1;
 		if (largs->descs != NULL) {
 			lp = (struct user_segment_descriptor *)
 			    kmem_alloc(kernel_map, largs->num *
@@ -132,6 +133,7 @@
 
 	if (td != curthread)
 		return;
+	td->td_pcb->pcb_full_iret = 1;
 	critical_enter();
 	sd = PCPU_GET(gs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -146,6 +148,7 @@
 
 	if (td != curthread)
 		return;
+	td->td_pcb->pcb_full_iret = 1;
 	critical_enter();
 	sd = PCPU_GET(fs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -201,6 +204,7 @@
 		if (!error) {
 			pcb->pcb_fsbase = i386base;
 			td->td_frame->tf_fs = _ufssel;
+			pcb->pcb_full_iret = 1;
 			update_gdt_fsbase(td, i386base);
 		}
 		break;
@@ -212,6 +216,7 @@
 		error = copyin(uap->parms, &i386base, sizeof(i386base));
 		if (!error) {
 			pcb->pcb_gsbase = i386base;
+			pcb->pcb_full_iret = 1;
 			td->td_frame->tf_gs = _ugssel;
 			update_gdt_gsbase(td, i386base);
 		}
@@ -225,6 +230,7 @@
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_fsbase = a64base;
+				pcb->pcb_full_iret = 1;
 				td->td_frame->tf_fs = _ufssel;
 			} else
 				error = EINVAL;
@@ -240,6 +246,7 @@
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_gsbase = a64base;
+				pcb->pcb_full_iret = 1;
 				td->td_frame->tf_gs = _ugssel;
 			} else
 				error = EINVAL;
@@ -525,6 +532,7 @@
 	    uap->start, uap->num, (void *)uap->descs);
 #endif
 
+	td->td_pcb->pcb_full_iret = 1;
 	p = td->td_proc;
 	if (descs == NULL) {
 		/* Free descriptors */

==== //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#43 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.263 2009/04/01 13:09:26 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/vm_machdep.c,v 1.264 2009/07/09 09:34:11 kib Exp $");
 
 #include "opt_isa.h"
 #include "opt_cpu.h"
@@ -186,6 +186,9 @@
 	/* As an i386, do not copy io permission bitmap. */
 	pcb2->pcb_tssp = NULL;
 
+	/* New segment registers. */
+	pcb2->pcb_full_iret = 1;
+
 	/* Copy the LDT, if necessary. */
 	mdp1 = &td1->td_proc->p_md;
 	mdp2 = &p2->p_md;
@@ -336,6 +339,7 @@
 	 */
 	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
 	pcb2->pcb_flags &= ~PCB_FPUINITDONE;
+	pcb2->pcb_full_iret = 1;
 
 	/*
 	 * Create a new fresh stack for the new thread.
@@ -450,6 +454,7 @@
 	}
 #endif
 	td->td_pcb->pcb_fsbase = (register_t)tls_base;
+	td->td_pcb->pcb_full_iret = 1;
 	return (0);
 }
 

==== //depot/projects/smpng/sys/amd64/conf/GENERIC#82 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.530 2009/07/02 18:24:37 ed Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.531 2009/07/11 15:02:45 rpaulo Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -258,6 +258,7 @@
 device		wlan		# 802.11 support
 options 	IEEE80211_DEBUG	# enable debug msgs
 options 	IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
+options 	IEEE80211_SUPPORT_MESH	# enable 802.11s D3.0 support
 device		wlan_wep	# 802.11 WEP support
 device		wlan_ccmp	# 802.11 CCMP support
 device		wlan_tkip	# 802.11 TKIP support

==== //depot/projects/smpng/sys/amd64/ia32/ia32_exception.S#6 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.6 2009/04/01 13:09:26 kib Exp $
+ * $FreeBSD: src/sys/amd64/ia32/ia32_exception.S,v 1.7 2009/07/09 09:34:11 kib Exp $
  */
 
 #include <machine/asmacros.h>
@@ -42,10 +42,16 @@
 	SUPERALIGN_TEXT
 IDTVEC(int0x80_syscall)
 	swapgs
-	sti
 	pushq	$2			/* sizeof "int 0x80" */
 	subq	$TF_ERR,%rsp		/* skip over tf_trapno */
 	movq	%rdi,TF_RDI(%rsp)
+	movq	PCPU(CURPCB),%rdi
+	movb	$0,PCB_FULL_IRET(%rdi)
+	movw	%fs,TF_FS(%rsp)
+	movw	%gs,TF_GS(%rsp)
+	movw	%es,TF_ES(%rsp)
+	movw	%ds,TF_DS(%rsp)
+	sti
 	movq	%rsi,TF_RSI(%rsp)
 	movq	%rdx,TF_RDX(%rsp)
 	movq	%rcx,TF_RCX(%rsp)
@@ -60,10 +66,6 @@
 	movq	%r13,TF_R13(%rsp)
 	movq	%r14,TF_R14(%rsp)
 	movq	%r15,TF_R15(%rsp)
-	movw	%fs,TF_FS(%rsp)
-	movw	%gs,TF_GS(%rsp)
-	movw	%es,TF_ES(%rsp)
-	movw	%ds,TF_DS(%rsp)
 	movl	$TF_HASSEGS,TF_FLAGS(%rsp)
 	FAKE_MCOUNT(TF_RIP(%rsp))
 	movq	%rsp, %rdi

==== //depot/projects/smpng/sys/amd64/ia32/ia32_reg.c#5 (text+ko) ====

@@ -23,11 +23,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/ia32/ia32_reg.c,v 1.4 2009/04/01 13:09:26 kib Exp $
+ * $FreeBSD: src/sys/amd64/ia32/ia32_reg.c,v 1.5 2009/07/09 09:34:11 kib Exp $
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_reg.c,v 1.4 2009/04/01 13:09:26 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_reg.c,v 1.5 2009/07/09 09:34:11 kib Exp $");
 
 #include "opt_compat.h"
 
@@ -125,6 +125,7 @@
 	tp->tf_fs = regs->r_fs;
 	tp->tf_es = regs->r_es;
 	tp->tf_ds = regs->r_ds;
+	td->td_pcb->pcb_full_iret = 1;
 	tp->tf_flags = TF_HASSEGS;
 	tp->tf_rdi = regs->r_edi;
 	tp->tf_rsi = regs->r_esi;

==== //depot/projects/smpng/sys/amd64/ia32/ia32_signal.c#23 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.22 2009/04/01 13:09:26 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.23 2009/07/09 09:34:11 kib Exp $");
 
 #include "opt_compat.h"
 
@@ -159,6 +159,7 @@
 	ia32_get_fpcontext(td, mcp);
 	mcp->mc_fsbase = td->td_pcb->pcb_fsbase;
 	mcp->mc_gsbase = td->td_pcb->pcb_gsbase;
+	td->td_pcb->pcb_full_iret = 1;
 	return (0);

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list