public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [rft] Kill junk from s2ram resume paths
@ 2007-07-31 12:12 Pavel Machek
  2007-07-31 13:20 ` Rafael J. Wysocki
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2007-07-31 12:12 UTC (permalink / raw)
  To: kernel list, Rafael J. Wysocki, suspend-devel, seife

Hi!

This removes some stale debugging infrastructure from s2ram
paths. Also, there's no need to verify_cpu on x86-64 -- cpu can't
change during s2ram, and removed #if 0-ed code. Some testing would be
useful, perpahs it will even fix someone's machine :-). (VGA accesses
could theoretically hurt if vga is not present / if it is in some
strange state).

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index 1415da1..9719bd6 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -53,9 +38,6 @@ wakeup_code:
 # Uncomment this to make your computer start producing ugly noise as soon
 # as BIOS returns to this real-mode entry point.
 #	BEEP
- 	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
 
 	cli
 	cld
@@ -70,7 +52,6 @@ #	BEEP
 	BEEP
 1:
 	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
-	movw	$0x0e00 + 'S', %fs:(0x12)
 
 	pushl	$0						# Kill any dangerous flags
 	popfl
@@ -108,9 +89,6 @@ #	BEEP
 	# make sure %cr4 is set correctly (features, etc)
 	movl	real_save_cr4 - wakeup_code, %eax
 	movl	%eax, %cr4
-	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'i', %fs:(0x12)
 	
 	# need a gdt -- use lgdtl to force 32-bit operands, in case
 	# the GDT is located past 16 megabytes.
@@ -120,8 +98,6 @@ #	BEEP
 	movl	%eax, %cr0
 	jmp 1f
 1:
-	movw	$0x0e00 + 'n', %fs:(0x14)
-
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
@@ -145,7 +121,6 @@ real_save_efer_edx: 	.long 0
 real_save_efer_eax: 	.long 0
 
 bogus_real_magic:
-	movw	$0x0e00 + 'B', %fs:(0x12)
 	jmp bogus_real_magic
 
 /* This code uses an extended set of video mode numbers. These include:
@@ -170,29 +145,9 @@ #define VIDEO_FIRST_V7 0x0900
 # Setting of user mode (AX=mode ID) => CF=success
 mode_set:
 	movw	%ax, %bx
-#if 0
-	cmpb	$0xff, %ah
-	jz	setalias
-
-	testb	$VIDEO_RECALC>>8, %ah
-	jnz	_setrec
-
-	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
-	jnc	setres
-	
-	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
-	jz	setspc
-
-	cmpb	$VIDEO_FIRST_V7>>8, %ah
-	jz	setv7
-#endif
 	
 	cmpb	$VIDEO_FIRST_VESA>>8, %ah
 	jnc	check_vesa
-#if 0	
-	orb	%ah, %ah
-	jz	setmenu
-#endif
 	
 	decb	%ah
 #	jz	setbios				  Add bios modes later
@@ -232,7 +187,6 @@ wakeup_pmode_return:
 	movw	%ax, %es
 	movw	%ax, %fs
 	movw	%ax, %gs
-	movw	$0x0e00 + 'u', 0xb8016
 
 	# reload the gdt, as we need the full 32 bit address
 	lgdt	saved_gdt
diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S
index 13f1480..bc9af5d 100644
--- a/arch/x86_64/kernel/acpi/wakeup.S
+++ b/arch/x86_64/kernel/acpi/wakeup.S
@@ -41,7 +41,6 @@ wakeup_code:
 
 # Running in *copy* of this code, somewhere in low 1MB.
 
-	movb	$0xa1, %al	;  outb %al, $0x80
 	cli
 	cld
 	# setup data segment
@@ -65,11 +64,6 @@ # Running in *copy* of this code, somewh
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
-  	call	verify_cpu			# Verify the cpu supports long
-						# mode
-	testl	%eax, %eax
-	jnz	no_longmode
-
 	testl	$1, realmode_flags - wakeup_code
 	jz	1f
 	lcall   $0xc000,$3
@@ -88,8 +82,6 @@ # Running in *copy* of this code, somewh
 	movw	%ax,%fs
 	movw	$0x0e00 + 'L', %fs:(0x10)
 
-	movb	$0xa2, %al	;  outb %al, $0x80
-	
 	mov	%ds, %ax			# Find 32bit wakeup_code addr
 	movzx   %ax, %esi			# (Convert %ds:gdt to a liner ptr)
 	shll    $4, %esi
@@ -117,14 +109,10 @@ wakeup_32_vector:
 	.code32
 wakeup_32:
 # Running in this code, but at low address; paging is not yet turned on.
-	movb	$0xa5, %al	;  outb %al, $0x80
 
 	movl	$__KERNEL_DS, %eax
 	movl	%eax, %ds
 
-	movw	$0x0e00 + 'i', %ds:(0xb8012)
-	movb	$0xa8, %al	;  outb %al, $0x80;
-
 	/*
 	 * Prepare for entering 64bits mode
 	 */
@@ -200,16 +188,11 @@ wakeup_long64:
 	 */
 	lgdt	cpu_gdt_descr
 
-	movw	$0x0e00 + 'n', %ds:(0xb8014)
-	movb	$0xa9, %al	;  outb %al, $0x80
-
 	movq    saved_magic, %rax
 	movq    $0x123456789abcdef0, %rdx
 	cmpq    %rdx, %rax
 	jne     bogus_64_magic
 
-	movw	$0x0e00 + 'u', %ds:(0xb8016)
-	
 	nop
 	nop
 	movw	$__KERNEL_DS, %ax
@@ -256,20 +239,12 @@ realmode_flags:	.quad 0
 
 .code16
 bogus_real_magic:
-	movb	$0xba,%al	;  outb %al,$0x80
 	jmp bogus_real_magic
 
 .code64
 bogus_64_magic:
-	movb	$0xb3,%al	;  outb %al,$0x80
 	jmp bogus_64_magic
 
-.code16
-no_longmode:
-	movb    $0xbc,%al       ;  outb %al,$0x80
-	jmp no_longmode
-
-#include "../verify_cpu.S"
 	
 /* This code uses an extended set of video mode numbers. These include:
  * Aliases for standard modes
@@ -294,29 +269,9 @@ # Setting of user mode (AX=mode ID) => C
 .code16
 mode_seta:
 	movw	%ax, %bx
-#if 0
-	cmpb	$0xff, %ah
-	jz	setalias
-
-	testb	$VIDEO_RECALC>>8, %ah
-	jnz	_setrec
-
-	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
-	jnc	setres
-	
-	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
-	jz	setspc
-
-	cmpb	$VIDEO_FIRST_V7>>8, %ah
-	jz	setv7
-#endif
 	
 	cmpb	$VIDEO_FIRST_VESA>>8, %ah
 	jnc	check_vesaa
-#if 0	
-	orb	%ah, %ah
-	jz	setmenu
-#endif
 	
 	decb	%ah
 #	jz	setbios				  Add bios modes later

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 13:20 ` Rafael J. Wysocki
@ 2007-07-31 13:18   ` Pavel Machek
  2007-07-31 13:49     ` Rafael J. Wysocki
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2007-07-31 13:18 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: kernel list, suspend-devel, seife

Hi!

> > This removes some stale debugging infrastructure from s2ram
> > paths. Also, there's no need to verify_cpu on x86-64 -- cpu can't
> > change during s2ram, and removed #if 0-ed code. Some testing would be
> > useful, perpahs it will even fix someone's machine :-). (VGA accesses
> > could theoretically hurt if vga is not present / if it is in some
> > strange state).
> > 
> > Signed-off-by: Pavel Machek <pavel@suse.cz>
> > 
> > diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> > index 1415da1..9719bd6 100644
> > --- a/arch/i386/kernel/acpi/wakeup.S
> > +++ b/arch/i386/kernel/acpi/wakeup.S
> > @@ -53,9 +38,6 @@ wakeup_code:
> >  # Uncomment this to make your computer start producing ugly noise as soon
> >  # as BIOS returns to this real-mode entry point.
> >  #	BEEP
> > - 	movw	$0xb800, %ax
> > -	movw	%ax,%fs
> > -	movw	$0x0e00 + 'L', %fs:(0x10)
> 
> Hmm, was this a part of that yellow "Linux" string?

Yes. But I'm afraid that may cause problems if vga is not ready.

> >  # Running in *copy* of this code, somewhere in low 1MB.
> >  
> > -	movb	$0xa1, %al	;  outb %al, $0x80
> 
> Well, what was this for?

Debugging leds on port 80. I still have that card somewhere
:-). Interesting parties can reinsert it.

> > @@ -88,8 +82,6 @@ # Running in *copy* of this code, somewh
> >  	movw	%ax,%fs
> >  	movw	$0x0e00 + 'L', %fs:(0x10)
> 
> Why aren't you removing this line?

Mistake, killed.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 12:12 [rft] Kill junk from s2ram resume paths Pavel Machek
@ 2007-07-31 13:20 ` Rafael J. Wysocki
  2007-07-31 13:18   ` Pavel Machek
  0 siblings, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2007-07-31 13:20 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, suspend-devel, seife

Hi,

On Tuesday, 31 July 2007 14:12, Pavel Machek wrote:
> Hi!
> 
> This removes some stale debugging infrastructure from s2ram
> paths. Also, there's no need to verify_cpu on x86-64 -- cpu can't
> change during s2ram, and removed #if 0-ed code. Some testing would be
> useful, perpahs it will even fix someone's machine :-). (VGA accesses
> could theoretically hurt if vga is not present / if it is in some
> strange state).
> 
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> 
> diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> index 1415da1..9719bd6 100644
> --- a/arch/i386/kernel/acpi/wakeup.S
> +++ b/arch/i386/kernel/acpi/wakeup.S
> @@ -53,9 +38,6 @@ wakeup_code:
>  # Uncomment this to make your computer start producing ugly noise as soon
>  # as BIOS returns to this real-mode entry point.
>  #	BEEP
> - 	movw	$0xb800, %ax
> -	movw	%ax,%fs
> -	movw	$0x0e00 + 'L', %fs:(0x10)

Hmm, was this a part of that yellow "Linux" string?

>  	cli
>  	cld
> @@ -70,7 +52,6 @@ #	BEEP
>  	BEEP
>  1:
>  	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
> -	movw	$0x0e00 + 'S', %fs:(0x12)
>  
>  	pushl	$0						# Kill any dangerous flags
>  	popfl
> @@ -108,9 +89,6 @@ #	BEEP
>  	# make sure %cr4 is set correctly (features, etc)
>  	movl	real_save_cr4 - wakeup_code, %eax
>  	movl	%eax, %cr4
> -	movw	$0xb800, %ax
> -	movw	%ax,%fs
> -	movw	$0x0e00 + 'i', %fs:(0x12)

And this?

>  	# need a gdt -- use lgdtl to force 32-bit operands, in case
>  	# the GDT is located past 16 megabytes.
> @@ -120,8 +98,6 @@ #	BEEP
>  	movl	%eax, %cr0
>  	jmp 1f
>  1:
> -	movw	$0x0e00 + 'n', %fs:(0x14)
> -

And this?

>  	movl	real_magic - wakeup_code, %eax
>  	cmpl	$0x12345678, %eax
>  	jne	bogus_real_magic
> @@ -145,7 +121,6 @@ real_save_efer_edx: 	.long 0
>  real_save_efer_eax: 	.long 0
>  
>  bogus_real_magic:
> -	movw	$0x0e00 + 'B', %fs:(0x12)
>
>  	jmp bogus_real_magic
>  
>  /* This code uses an extended set of video mode numbers. These include:
> @@ -170,29 +145,9 @@ #define VIDEO_FIRST_V7 0x0900
>  # Setting of user mode (AX=mode ID) => CF=success
>  mode_set:
>  	movw	%ax, %bx
> -#if 0
> -	cmpb	$0xff, %ah
> -	jz	setalias
> -
> -	testb	$VIDEO_RECALC>>8, %ah
> -	jnz	_setrec
> -
> -	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
> -	jnc	setres
> -	
> -	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
> -	jz	setspc
> -
> -	cmpb	$VIDEO_FIRST_V7>>8, %ah
> -	jz	setv7
> -#endif
>  	
>  	cmpb	$VIDEO_FIRST_VESA>>8, %ah
>  	jnc	check_vesa
> -#if 0	
> -	orb	%ah, %ah
> -	jz	setmenu
> -#endif
>  	
>  	decb	%ah
>  #	jz	setbios				  Add bios modes later
> @@ -232,7 +187,6 @@ wakeup_pmode_return:
>  	movw	%ax, %es
>  	movw	%ax, %fs
>  	movw	%ax, %gs
> -	movw	$0x0e00 + 'u', 0xb8016
>  
>  	# reload the gdt, as we need the full 32 bit address
>  	lgdt	saved_gdt
> diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S
> index 13f1480..bc9af5d 100644
> --- a/arch/x86_64/kernel/acpi/wakeup.S
> +++ b/arch/x86_64/kernel/acpi/wakeup.S
> @@ -41,7 +41,6 @@ wakeup_code:
>  
>  # Running in *copy* of this code, somewhere in low 1MB.
>  
> -	movb	$0xa1, %al	;  outb %al, $0x80

Well, what was this for?

>  	cli
>  	cld
>  	# setup data segment
> @@ -65,11 +64,6 @@ # Running in *copy* of this code, somewh
>  	cmpl	$0x12345678, %eax
>  	jne	bogus_real_magic
>  
> -  	call	verify_cpu			# Verify the cpu supports long
> -						# mode
> -	testl	%eax, %eax
> -	jnz	no_longmode
> -

Yup, good idea.

>  	testl	$1, realmode_flags - wakeup_code
>  	jz	1f
>  	lcall   $0xc000,$3
> @@ -88,8 +82,6 @@ # Running in *copy* of this code, somewh
>  	movw	%ax,%fs
>  	movw	$0x0e00 + 'L', %fs:(0x10)

Why aren't you removing this line?

> -	movb	$0xa2, %al	;  outb %al, $0x80
> -	
>  	mov	%ds, %ax			# Find 32bit wakeup_code addr
>  	movzx   %ax, %esi			# (Convert %ds:gdt to a liner ptr)
>  	shll    $4, %esi
> @@ -117,14 +109,10 @@ wakeup_32_vector:
>  	.code32
>  wakeup_32:
>  # Running in this code, but at low address; paging is not yet turned on.
> -	movb	$0xa5, %al	;  outb %al, $0x80
>
>  	movl	$__KERNEL_DS, %eax
>  	movl	%eax, %ds
>  
> -	movw	$0x0e00 + 'i', %ds:(0xb8012)
> -	movb	$0xa8, %al	;  outb %al, $0x80;
> -
>  	/*
>  	 * Prepare for entering 64bits mode
>  	 */
> @@ -200,16 +188,11 @@ wakeup_long64:
>  	 */
>  	lgdt	cpu_gdt_descr
>  
> -	movw	$0x0e00 + 'n', %ds:(0xb8014)
> -	movb	$0xa9, %al	;  outb %al, $0x80
> -
>  	movq    saved_magic, %rax
>  	movq    $0x123456789abcdef0, %rdx
>  	cmpq    %rdx, %rax
>  	jne     bogus_64_magic
>  
> -	movw	$0x0e00 + 'u', %ds:(0xb8016)
> -	
>  	nop
>  	nop
>  	movw	$__KERNEL_DS, %ax
> @@ -256,20 +239,12 @@ realmode_flags:	.quad 0
>  
>  .code16
>  bogus_real_magic:
> -	movb	$0xba,%al	;  outb %al,$0x80
>  	jmp bogus_real_magic
>  
>  .code64
>  bogus_64_magic:
> -	movb	$0xb3,%al	;  outb %al,$0x80
>  	jmp bogus_64_magic
>  
> -.code16
> -no_longmode:
> -	movb    $0xbc,%al       ;  outb %al,$0x80
> -	jmp no_longmode
> -
> -#include "../verify_cpu.S"
>  	
>  /* This code uses an extended set of video mode numbers. These include:
>   * Aliases for standard modes
> @@ -294,29 +269,9 @@ # Setting of user mode (AX=mode ID) => C
>  .code16
>  mode_seta:
>  	movw	%ax, %bx
> -#if 0
> -	cmpb	$0xff, %ah
> -	jz	setalias
> -
> -	testb	$VIDEO_RECALC>>8, %ah
> -	jnz	_setrec
> -
> -	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
> -	jnc	setres
> -	
> -	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
> -	jz	setspc
> -
> -	cmpb	$VIDEO_FIRST_V7>>8, %ah
> -	jz	setv7
> -#endif
>  	
>  	cmpb	$VIDEO_FIRST_VESA>>8, %ah
>  	jnc	check_vesaa
> -#if 0	
> -	orb	%ah, %ah
> -	jz	setmenu
> -#endif
>  	
>  	decb	%ah
>  #	jz	setbios				  Add bios modes later
> 

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 13:18   ` Pavel Machek
@ 2007-07-31 13:49     ` Rafael J. Wysocki
  2007-07-31 14:01       ` Pavel Machek
  0 siblings, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2007-07-31 13:49 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list, suspend-devel, seife

Hi,

On Tuesday, 31 July 2007 15:18, Pavel Machek wrote:
> Hi!
> 
> > > This removes some stale debugging infrastructure from s2ram
> > > paths. Also, there's no need to verify_cpu on x86-64 -- cpu can't
> > > change during s2ram, and removed #if 0-ed code. Some testing would be
> > > useful, perpahs it will even fix someone's machine :-). (VGA accesses
> > > could theoretically hurt if vga is not present / if it is in some
> > > strange state).
> > > 
> > > Signed-off-by: Pavel Machek <pavel@suse.cz>
> > > 
> > > diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> > > index 1415da1..9719bd6 100644
> > > --- a/arch/i386/kernel/acpi/wakeup.S
> > > +++ b/arch/i386/kernel/acpi/wakeup.S
> > > @@ -53,9 +38,6 @@ wakeup_code:
> > >  # Uncomment this to make your computer start producing ugly noise as soon
> > >  # as BIOS returns to this real-mode entry point.
> > >  #	BEEP
> > > - 	movw	$0xb800, %ax
> > > -	movw	%ax,%fs
> > > -	movw	$0x0e00 + 'L', %fs:(0x10)
> > 
> > Hmm, was this a part of that yellow "Linux" string?
> 
> Yes. But I'm afraid that may cause problems if vga is not ready.

I agree.

> > >  # Running in *copy* of this code, somewhere in low 1MB.
> > >  
> > > -	movb	$0xa1, %al	;  outb %al, $0x80
> > 
> > Well, what was this for?
> 
> Debugging leds on port 80. I still have that card somewhere
> :-). Interesting parties can reinsert it.

Ah, I see.

Hmm, can you please write about that in the chanelog more explicitly?
Or just comment it out with a "uncomment this to get ..." text?

> > > @@ -88,8 +82,6 @@ # Running in *copy* of this code, somewh
> > >  	movw	%ax,%fs
> > >  	movw	$0x0e00 + 'L', %fs:(0x10)
> > 
> > Why aren't you removing this line?
> 
> Mistake, killed.

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 13:49     ` Rafael J. Wysocki
@ 2007-07-31 14:01       ` Pavel Machek
  2007-07-31 14:43         ` Stefan Seyfried
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2007-07-31 14:01 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: suspend-devel, seife, kernel list

Hi!

> > > >  # Running in *copy* of this code, somewhere in low 1MB.
> > > >  
> > > > -	movb	$0xa1, %al	;  outb %al, $0x80
> > > 
> > > Well, what was this for?
> > 
> > Debugging leds on port 80. I still have that card somewhere
> > :-). Interesting parties can reinsert it.
> 
> Ah, I see.
> 
> Hmm, can you please write about that in the chanelog more explicitly?
> Or just comment it out with a "uncomment this to get ..." text?

I still need someone with x86-64 to test it for me before I submit it
properly ;-). Updated patch follows.
								Pavel

diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index 1415da1..9cebef7 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -28,21 +28,6 @@ #define BEEP \
 	movb	$15, %al; 	\
 	outb	%al, $66;
 
-#define BEEP \
-	inb	$97, %al; 	\
-	outb	%al, $0x80; 	\
-	movb	$3, %al; 	\
-	outb	%al, $97; 	\
-	outb	%al, $0x80; 	\
-	movb	$-74, %al; 	\
-	outb	%al, $67; 	\
-	outb	%al, $0x80; 	\
-	movb	$-119, %al; 	\
-	outb	%al, $66; 	\
-	outb	%al, $0x80; 	\
-	movb	$15, %al; 	\
-	outb	%al, $66;
-
 ALIGN
 	.align	4096
 ENTRY(wakeup_start)
@@ -53,9 +38,6 @@ wakeup_code:
 # Uncomment this to make your computer start producing ugly noise as soon
 # as BIOS returns to this real-mode entry point.
 #	BEEP
- 	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
 
 	cli
 	cld
@@ -70,7 +52,6 @@ #	BEEP
 	BEEP
 1:
 	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
-	movw	$0x0e00 + 'S', %fs:(0x12)
 
 	pushl	$0						# Kill any dangerous flags
 	popfl
@@ -108,9 +89,6 @@ #	BEEP
 	# make sure %cr4 is set correctly (features, etc)
 	movl	real_save_cr4 - wakeup_code, %eax
 	movl	%eax, %cr4
-	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'i', %fs:(0x12)
 	
 	# need a gdt -- use lgdtl to force 32-bit operands, in case
 	# the GDT is located past 16 megabytes.
@@ -120,8 +98,6 @@ #	BEEP
 	movl	%eax, %cr0
 	jmp 1f
 1:
-	movw	$0x0e00 + 'n', %fs:(0x14)
-
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
@@ -145,7 +121,6 @@ real_save_efer_edx: 	.long 0
 real_save_efer_eax: 	.long 0
 
 bogus_real_magic:
-	movw	$0x0e00 + 'B', %fs:(0x12)
 	jmp bogus_real_magic
 
 /* This code uses an extended set of video mode numbers. These include:
@@ -170,29 +145,9 @@ #define VIDEO_FIRST_V7 0x0900
 # Setting of user mode (AX=mode ID) => CF=success
 mode_set:
 	movw	%ax, %bx
-#if 0
-	cmpb	$0xff, %ah
-	jz	setalias
-
-	testb	$VIDEO_RECALC>>8, %ah
-	jnz	_setrec
-
-	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
-	jnc	setres
-	
-	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
-	jz	setspc
-
-	cmpb	$VIDEO_FIRST_V7>>8, %ah
-	jz	setv7
-#endif
 	
 	cmpb	$VIDEO_FIRST_VESA>>8, %ah
 	jnc	check_vesa
-#if 0	
-	orb	%ah, %ah
-	jz	setmenu
-#endif
 	
 	decb	%ah
 #	jz	setbios				  Add bios modes later
@@ -232,7 +187,6 @@ wakeup_pmode_return:
 	movw	%ax, %es
 	movw	%ax, %fs
 	movw	%ax, %gs
-	movw	$0x0e00 + 'u', 0xb8016
 
 	# reload the gdt, as we need the full 32 bit address
 	lgdt	saved_gdt
@@ -256,7 +210,6 @@ wakeup_pmode_return:
 	jmp	*%eax
 
 bogus_magic:
-	movw	$0x0e00 + 'B', 0xb8018
 	jmp	bogus_magic
 
 
diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S
index 13f1480..fd09434 100644
--- a/arch/x86_64/kernel/acpi/wakeup.S
+++ b/arch/x86_64/kernel/acpi/wakeup.S
@@ -41,7 +41,6 @@ wakeup_code:
 
 # Running in *copy* of this code, somewhere in low 1MB.
 
-	movb	$0xa1, %al	;  outb %al, $0x80
 	cli
 	cld
 	# setup data segment
@@ -65,11 +64,6 @@ # Running in *copy* of this code, somewh
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
-  	call	verify_cpu			# Verify the cpu supports long
-						# mode
-	testl	%eax, %eax
-	jnz	no_longmode
-
 	testl	$1, realmode_flags - wakeup_code
 	jz	1f
 	lcall   $0xc000,$3
@@ -84,12 +78,6 @@ # Running in *copy* of this code, somewh
 	call	mode_seta
 1:
 
- 	movw	$0xb800, %ax
-	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
-
-	movb	$0xa2, %al	;  outb %al, $0x80
-	
 	mov	%ds, %ax			# Find 32bit wakeup_code addr
 	movzx   %ax, %esi			# (Convert %ds:gdt to a liner ptr)
 	shll    $4, %esi
@@ -117,14 +105,10 @@ wakeup_32_vector:
 	.code32
 wakeup_32:
 # Running in this code, but at low address; paging is not yet turned on.
-	movb	$0xa5, %al	;  outb %al, $0x80
 
 	movl	$__KERNEL_DS, %eax
 	movl	%eax, %ds
 
-	movw	$0x0e00 + 'i', %ds:(0xb8012)
-	movb	$0xa8, %al	;  outb %al, $0x80;
-
 	/*
 	 * Prepare for entering 64bits mode
 	 */
@@ -200,16 +184,11 @@ wakeup_long64:
 	 */
 	lgdt	cpu_gdt_descr
 
-	movw	$0x0e00 + 'n', %ds:(0xb8014)
-	movb	$0xa9, %al	;  outb %al, $0x80
-
 	movq    saved_magic, %rax
 	movq    $0x123456789abcdef0, %rdx
 	cmpq    %rdx, %rax
 	jne     bogus_64_magic
 
-	movw	$0x0e00 + 'u', %ds:(0xb8016)
-	
 	nop
 	nop
 	movw	$__KERNEL_DS, %ax
@@ -220,13 +199,11 @@ wakeup_long64:
 	movw	%ax, %gs
 	movq	saved_rsp, %rsp
 
-	movw	$0x0e00 + 'x', %ds:(0xb8018)
 	movq	saved_rbx, %rbx
 	movq	saved_rdi, %rdi
 	movq	saved_rsi, %rsi
 	movq	saved_rbp, %rbp
 
-	movw	$0x0e00 + '!', %ds:(0xb801a)
 	movq	saved_rip, %rax
 	jmp	*%rax
 
@@ -256,20 +233,12 @@ realmode_flags:	.quad 0
 
 .code16
 bogus_real_magic:
-	movb	$0xba,%al	;  outb %al,$0x80
 	jmp bogus_real_magic
 
 .code64
 bogus_64_magic:
-	movb	$0xb3,%al	;  outb %al,$0x80
 	jmp bogus_64_magic
 
-.code16
-no_longmode:
-	movb    $0xbc,%al       ;  outb %al,$0x80
-	jmp no_longmode
-
-#include "../verify_cpu.S"
 	
 /* This code uses an extended set of video mode numbers. These include:
  * Aliases for standard modes
@@ -294,29 +263,9 @@ # Setting of user mode (AX=mode ID) => C
 .code16
 mode_seta:
 	movw	%ax, %bx
-#if 0
-	cmpb	$0xff, %ah
-	jz	setalias
-
-	testb	$VIDEO_RECALC>>8, %ah
-	jnz	_setrec
-
-	cmpb	$VIDEO_FIRST_RESOLUTION>>8, %ah
-	jnc	setres
-	
-	cmpb	$VIDEO_FIRST_SPECIAL>>8, %ah
-	jz	setspc
-
-	cmpb	$VIDEO_FIRST_V7>>8, %ah
-	jz	setv7
-#endif
 	
 	cmpb	$VIDEO_FIRST_VESA>>8, %ah
 	jnc	check_vesaa
-#if 0	
-	orb	%ah, %ah
-	jz	setmenu
-#endif
 	
 	decb	%ah
 #	jz	setbios				  Add bios modes later

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 14:01       ` Pavel Machek
@ 2007-07-31 14:43         ` Stefan Seyfried
  2007-07-31 15:03           ` Rafael J. Wysocki
  2007-08-01 21:10           ` Stefan Seyfried
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Seyfried @ 2007-07-31 14:43 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Rafael J. Wysocki, suspend-devel, kernel list

On Tue, Jul 31, 2007 at 04:01:40PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > > >  # Running in *copy* of this code, somewhere in low 1MB.
> > > > >  
> > > > > -	movb	$0xa1, %al	;  outb %al, $0x80
> > > > 
> > > > Well, what was this for?
> > > 
> > > Debugging leds on port 80. I still have that card somewhere
> > > :-). Interesting parties can reinsert it.
> > 
> > Ah, I see.
> > 
> > Hmm, can you please write about that in the chanelog more explicitly?
> > Or just comment it out with a "uncomment this to get ..." text?
> 
> I still need someone with x86-64 to test it for me before I submit it
> properly ;-). Updated patch follows.

Compiling right now.

> 								Pavel
> 
> diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> index 1415da1..9cebef7 100644
> --- a/arch/i386/kernel/acpi/wakeup.S
> +++ b/arch/i386/kernel/acpi/wakeup.S
> @@ -28,21 +28,6 @@ #define BEEP \
>  	movb	$15, %al; 	\
>  	outb	%al, $66;
>  
> -#define BEEP \
> -	inb	$97, %al; 	\
> -	outb	%al, $0x80; 	\
> -	movb	$3, %al; 	\
> -	outb	%al, $97; 	\
> -	outb	%al, $0x80; 	\
> -	movb	$-74, %al; 	\
> -	outb	%al, $67; 	\
> -	outb	%al, $0x80; 	\
> -	movb	$-119, %al; 	\
> -	outb	%al, $66; 	\
> -	outb	%al, $0x80; 	\
> -	movb	$15, %al; 	\
> -	outb	%al, $66;
> -
>  ALIGN
>  	.align	4096
>  ENTRY(wakeup_start)

This hunk rejected for me (against 2.6.23-rc1), but i'm testing x86_64, so
it did not matter ;-)
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 15:03           ` Rafael J. Wysocki
@ 2007-07-31 14:58             ` Pavel Machek
  0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2007-07-31 14:58 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Stefan Seyfried, suspend-devel, kernel list

Hi!


> > > diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> > > index 1415da1..9cebef7 100644
> > > --- a/arch/i386/kernel/acpi/wakeup.S
> > > +++ b/arch/i386/kernel/acpi/wakeup.S
> > > @@ -28,21 +28,6 @@ #define BEEP \
> > >  	movb	$15, %al; 	\
> > >  	outb	%al, $66;
> > >  
> > > -#define BEEP \
> > > -	inb	$97, %al; 	\
> > > -	outb	%al, $0x80; 	\
> > > -	movb	$3, %al; 	\
> > > -	outb	%al, $97; 	\
> > > -	outb	%al, $0x80; 	\
> > > -	movb	$-74, %al; 	\
> > > -	outb	%al, $67; 	\
> > > -	outb	%al, $0x80; 	\
> > > -	movb	$-119, %al; 	\
> > > -	outb	%al, $66; 	\
> > > -	outb	%al, $0x80; 	\
> > > -	movb	$15, %al; 	\
> > > -	outb	%al, $66;
> > > -
> > >  ALIGN
> > >  	.align	4096
> > >  ENTRY(wakeup_start)
> > 
> > This hunk rejected for me (against 2.6.23-rc1), but i'm testing x86_64, so
> > it did not matter ;-)
> 
> I think it's gone in favor of the more sophisticated beeping
> > > support.

No. It was merge problem on my side, I actually had _two_ times the
beeping macro.
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 14:43         ` Stefan Seyfried
@ 2007-07-31 15:03           ` Rafael J. Wysocki
  2007-07-31 14:58             ` Pavel Machek
  2007-08-01 21:10           ` Stefan Seyfried
  1 sibling, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2007-07-31 15:03 UTC (permalink / raw)
  To: Stefan Seyfried; +Cc: Pavel Machek, suspend-devel, kernel list

On Tuesday, 31 July 2007 16:43, Stefan Seyfried wrote:
> On Tue, Jul 31, 2007 at 04:01:40PM +0200, Pavel Machek wrote:
> > Hi!
> > 
> > > > > >  # Running in *copy* of this code, somewhere in low 1MB.
> > > > > >  
> > > > > > -	movb	$0xa1, %al	;  outb %al, $0x80
> > > > > 
> > > > > Well, what was this for?
> > > > 
> > > > Debugging leds on port 80. I still have that card somewhere
> > > > :-). Interesting parties can reinsert it.
> > > 
> > > Ah, I see.
> > > 
> > > Hmm, can you please write about that in the chanelog more explicitly?
> > > Or just comment it out with a "uncomment this to get ..." text?
> > 
> > I still need someone with x86-64 to test it for me before I submit it
> > properly ;-). Updated patch follows.
> 
> Compiling right now.
> 
> > 								Pavel
> > 
> > diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
> > index 1415da1..9cebef7 100644
> > --- a/arch/i386/kernel/acpi/wakeup.S
> > +++ b/arch/i386/kernel/acpi/wakeup.S
> > @@ -28,21 +28,6 @@ #define BEEP \
> >  	movb	$15, %al; 	\
> >  	outb	%al, $66;
> >  
> > -#define BEEP \
> > -	inb	$97, %al; 	\
> > -	outb	%al, $0x80; 	\
> > -	movb	$3, %al; 	\
> > -	outb	%al, $97; 	\
> > -	outb	%al, $0x80; 	\
> > -	movb	$-74, %al; 	\
> > -	outb	%al, $67; 	\
> > -	outb	%al, $0x80; 	\
> > -	movb	$-119, %al; 	\
> > -	outb	%al, $66; 	\
> > -	outb	%al, $0x80; 	\
> > -	movb	$15, %al; 	\
> > -	outb	%al, $66;
> > -
> >  ALIGN
> >  	.align	4096
> >  ENTRY(wakeup_start)
> 
> This hunk rejected for me (against 2.6.23-rc1), but i'm testing x86_64, so
> it did not matter ;-)

I think it's gone in favor of the more sophisticated beeping support.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [rft] Kill junk from s2ram resume paths
  2007-07-31 14:43         ` Stefan Seyfried
  2007-07-31 15:03           ` Rafael J. Wysocki
@ 2007-08-01 21:10           ` Stefan Seyfried
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Seyfried @ 2007-08-01 21:10 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Rafael J. Wysocki, suspend-devel, kernel list

On Tue, Jul 31, 2007 at 04:43:34PM +0200, Stefan Seyfried wrote:
> On Tue, Jul 31, 2007 at 04:01:40PM +0200, Pavel Machek wrote:
> > Hi!
> > 
> > > > > >  # Running in *copy* of this code, somewhere in low 1MB.
> > > > > >  
> > > > > > -	movb	$0xa1, %al	;  outb %al, $0x80
> > > > > 
> > > > > Well, what was this for?
> > > > 
> > > > Debugging leds on port 80. I still have that card somewhere
> > > > :-). Interesting parties can reinsert it.
> > > 
> > > Ah, I see.
> > > 
> > > Hmm, can you please write about that in the chanelog more explicitly?
> > > Or just comment it out with a "uncomment this to get ..." text?
> > 
> > I still need someone with x86-64 to test it for me before I submit it
> > properly ;-). Updated patch follows.
> 
> Compiling right now.

Worked well on my x86_64 testmachine (a 64bit Thinkpad), worked before and
after the patch with 2.6.23-rc1.
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-01 21:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 12:12 [rft] Kill junk from s2ram resume paths Pavel Machek
2007-07-31 13:20 ` Rafael J. Wysocki
2007-07-31 13:18   ` Pavel Machek
2007-07-31 13:49     ` Rafael J. Wysocki
2007-07-31 14:01       ` Pavel Machek
2007-07-31 14:43         ` Stefan Seyfried
2007-07-31 15:03           ` Rafael J. Wysocki
2007-07-31 14:58             ` Pavel Machek
2007-08-01 21:10           ` Stefan Seyfried

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox