Module Name:    src
Committed By:   maxv
Date:           Sat Nov 21 12:34:48 UTC 2015

Modified Files:
        src/sys/arch/amd64/amd64: copy.S

Log Message:
Remove the amd64 implementation of fuword and suword. They are not used in
the MI+amd64 code - Christos replaced them yesterday by copy*.

They are both buggy:
 - suword does not properly check the userspace limit: 64 bits are copied,
   but the max address checked is VM_MAXUSER_ADDRESS-4, which means that 4
   bytes may overflow. Reported by Ed Schouten.
 - fuword is supposed to be symmetrical with suword. But it uses 32bit
   registers, so it stores 32bit values! Spotted by Chuck (chs@).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amd64/amd64/copy.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/copy.S
diff -u src/sys/arch/amd64/amd64/copy.S:1.18 src/sys/arch/amd64/amd64/copy.S:1.19
--- src/sys/arch/amd64/amd64/copy.S:1.18	Wed Jul  7 01:13:29 2010
+++ src/sys/arch/amd64/amd64/copy.S	Sat Nov 21 12:34:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.18 2010/07/07 01:13:29 chs Exp $	*/
+/*	$NetBSD: copy.S,v 1.19 2015/11/21 12:34:48 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -359,19 +359,6 @@ ENTRY(copystr)
 
 7:	ret
 
-ENTRY(fuword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-4,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-	movl	(%rdi),%eax
-	movq	$0,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-	
 ENTRY(fusword)
 	DEFERRED_SWITCH_CHECK
 	movq	$VM_MAXUSER_ADDRESS-2,%r11
@@ -411,22 +398,6 @@ ENTRY(fubyte)
 	ret
 	DEFERRED_SWITCH_CALL
 
-ENTRY(suword)
-	DEFERRED_SWITCH_CHECK
-	movq	$VM_MAXUSER_ADDRESS-4,%r11
-	cmpq	%r11,%rdi
-	ja	_C_LABEL(fusuaddrfault)
-
-	GET_CURPCB(%rcx)
-	leaq	_C_LABEL(fusufailure)(%rip),%r11
-	movq	%r11,PCB_ONFAULT(%rcx)
-
-	movq	%rsi,(%rdi)
-	xorq	%rax,%rax
-	movq	%rax,PCB_ONFAULT(%rcx)
-	ret
-	DEFERRED_SWITCH_CALL
-	
 ENTRY(susword)
 	DEFERRED_SWITCH_CHECK
 	movq	$VM_MAXUSER_ADDRESS-2,%r11

Reply via email to