mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mark Langsdorf <mark.langsdorf@amd.com>
Cc: linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH][retry 1] 2.6.27-rc2: invalidate caches before going into suspend
Date: Wed, 13 Aug 2008 19:31:15 +0200	[thread overview]
Message-ID: <20080813173115.GA28891@elte.hu> (raw)
In-Reply-To: <200808131228.50415.mark.langsdorf@amd.com>


(please keep Cc:s intact)

* Mark Langsdorf <mark.langsdorf@amd.com> wrote:

> @@ -104,6 +103,7 @@ static inline void play_dead(void)
>  	 * With physical CPU hotplug, we should halt the cpu
>  	 */
>  	local_irq_disable();
> +	wbinvd();
>  	while (1)
>  		halt();

hm, why not do what i suggested in my first mail:

        if (cpu >= i486)
                asm("cli; wbinvd; cli; 1: hlt; jmp 1b")
        else
		halt();

perhaps turn it into a wbivd_halt() primitive, to make it clean and even 
more obvious.

This sequence does matter to reliable suspend/resume, and in theory gcc 
could insert something before a halt() as well.

[ i only have a pretty far-fetched example that in all likelyhood wont
  happen in practice: for example halt could be decided to be uninlined
  by a braindead compiler, ftrace could hook in there, and dirty some
  state. But still - the point is that we had a difficult bug in this 
  code for a long time and in such situations we should just over-do 
  robustness by default. ]

	Ingo

      reply	other threads:[~2008-08-13 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13 17:28 Mark Langsdorf
2008-08-13 17:31 ` Ingo Molnar [this message]

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=20080813173115.GA28891@elte.hu \
    --to=mingo@elte.hu \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@amd.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®