lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Apr 2012 11:36:45 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC:	linux-kernel@...r.kernel.org, lenb@...nel.org,
	linux-acpi@...r.kernel.org, ming.m.lin@...el.com, rjw@...k.pl,
	x86@...nel.org
Subject: Re: [PATCH 2/2] x86/acpi: Call acpi_enter_sleep_state via an asmlinkage
 C function from assembler.

On 04/17/2012 11:29 AM, Konrad Rzeszutek Wilk wrote:
> diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
> index 13ab720..d3a18a4 100644
> --- a/arch/x86/kernel/acpi/wakeup_32.S
> +++ b/arch/x86/kernel/acpi/wakeup_32.S
> @@ -74,8 +74,7 @@ restore_registers:
>  ENTRY(do_suspend_lowlevel)
>  	call	save_processor_state
>  	call	save_registers
> -	pushl	$3
> -	call	acpi_enter_sleep_state
> +	call	acpi_enter_s3
>  	addl	$4, %esp
>  

You need to drop the %esp adjustment here.

>  #	In case of S3 failure, we'll emerge here.  Jump
> diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
> index 8ea5164..fea733d 100644
> --- a/arch/x86/kernel/acpi/wakeup_64.S
> +++ b/arch/x86/kernel/acpi/wakeup_64.S
> @@ -71,9 +71,8 @@ ENTRY(do_suspend_lowlevel)
>  	movq	%rsi, saved_rsi
>  
>  	addq	$8, %rsp
> -	movl	$3, %edi
>  	xorl	%eax, %eax
> -	call	acpi_enter_sleep_state
> +	call	acpi_enter_s3
>  	/* in case something went wrong, restore the machine status and go on */

You can presumably remove the xorl here ... setting %eax to zero
immediately before calling a non-varadic C function is meaningless.

	-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists