Re: [PATCH][retry 1] 2.6.27-rc2: invalidate caches before going into suspend

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mark Langsdorf <mark.langsdorf@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>
Date: Wednesday, August 13, 2008 - 1:31 pm

(please keep Cc:s intact)

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


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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH][retry 1] 2.6.27-rc2: invalidate caches before go..., Ingo Molnar, (Wed Aug 13, 1:31 pm)