From: Pavel Machek <pavel@ucw.cz>
To: Jiri Slaby <jslaby@suse.cz>
Cc: bp@alien8.de, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/asm/suspend: Get rid of bogus_64_magic
Date: Fri, 6 Sep 2019 12:57:36 +0200 [thread overview]
Message-ID: <20190906105736.GA25668@amd> (raw)
In-Reply-To: <20190906075550.23435-1-jslaby@suse.cz>
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
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.
Slower, longer, does not really fix anything. Why is it good idea?
NAK.
Pavel
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Len Brown <lenb@kernel.org>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: linux-pm@vger.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:
> movw $__KERNEL_DS, %ax
> movw %ax, %ss
> movw %ax, %ds
> @@ -37,9 +42,6 @@ ENTRY(wakeup_long64)
> jmp *%rax
> ENDPROC(wakeup_long64)
>
> -bogus_64_magic:
> - jmp bogus_64_magic
> -
> ENTRY(do_suspend_lowlevel)
> FRAME_BEGIN
> subq $8, %rsp
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2019-09-06 10:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 7:55 [PATCH 1/2] x86/asm/suspend: Get rid of bogus_64_magic Jiri Slaby
2019-09-06 7:55 ` [PATCH 2/2] x86/asm: Make some functions local labels Jiri Slaby
2019-09-06 9:52 ` [tip: x86/asm] " tip-bot2 for Jiri Slaby
2019-09-06 9:52 ` [tip: x86/asm] x86/asm/suspend: Get rid of bogus_64_magic tip-bot2 for Jiri Slaby
2019-09-06 10:57 ` Pavel Machek [this message]
2019-09-07 13:10 ` [PATCH 1/2] " Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190906105736.GA25668@amd \
--to=pavel@ucw.cz \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jslaby@suse.cz \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.