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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190907131024.GA4430@amd>
Date:   Sat, 7 Sep 2019 15:10:24 +0200
From:   Pavel Machek <pavel@....cz>
To:     Jiri Slaby <jslaby@...e.cz>
Cc:     bp@...en8.de, tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>, linux-pm@...r.kernel.org
Subject: Re: [PATCH 1/2] x86/asm/suspend: Get rid of bogus_64_magic

On Fri 2019-09-06 09:55:49, Jiri Slaby wrote:
> bogus_64_magic is only a dead-end loop. There is no need for an
> out-of-order function (and unannotated local label), so just handle it
> in-place and also store 0xbad-m-a-g-i-c to rcx beforehand.
> 
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
> Cc: Pavel Machek <pavel@....cz>
> Cc: Len Brown <lenb@...nel.org>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: "H. Peter Anvin" <hpa@...or.com>
> Cc: x86@...nel.org
> Cc: linux-pm@...r.kernel.org
> ---
>  arch/x86/kernel/acpi/wakeup_64.S | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
> index b0715c3ac18d..7f9ade13bbcf 100644
> --- a/arch/x86/kernel/acpi/wakeup_64.S
> +++ b/arch/x86/kernel/acpi/wakeup_64.S
> @@ -18,8 +18,13 @@ ENTRY(wakeup_long64)
>  	movq	saved_magic, %rax
>  	movq	$0x123456789abcdef0, %rdx
>  	cmpq	%rdx, %rax
> -	jne	bogus_64_magic
> +	je	2f
>  
> +	/* stop here on a saved_magic mismatch */
> +	movq $0xbad6d61676963, %rcx
> +1:
> +	jmp 1b
> +2:

btw I suspect you can simply do here

1b:  jne 1b

... if someone is looking with gdb, he'll understand what is going
on. no need to bother with special %rcx, %rdx is already rather magic.

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

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ