[lkml]   [2003]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] restore sysenter MSRs at resume
Linus Torvalds writes:
> On Wed, 7 May 2003 wrote:
> >
> > The patch below hooks sysenter into the driver model and implements
> > a resume() method which restores the sysenter MSRs.
> This is wrong.
> For one thing, you screw up SMP seriously, by not enabling sysenter on all
> CPU's, only the boot one.

We don't do apm suspend/resume on SMP, so this is no different from the
current situation. I don't know if acpi does it or not.

> For another, we shouldn't have "device drivers" for the CPU. I certainly
> agree about restoring the sysenter MSR's, but they should be restored by
> the CPU-specific code long _before_ we start initializing devices.
> So I think we should just make it part of the CPU initialization (which
> should be in two parts: the low-level asm part for the "core" CPU
> registers, and then the high-level C part for things like the MSR's,
> user-space segment stuff etc).
> So why not just add an explicit call to "cpu_resume()" in one of the
> "do_magic_resume()" things, instead of playing games with device trees..

Where would cpu_resume() [and cpu_suspend()] live?
arch/i386/kernel/suspend* belong to SOFTWARE_SUSPEND, but I don't
think that approach is desirable when apm mostly works for UP.

I could probably get away with simply having apm.c invoke the C code
in suspend.c, which does restore the SYSENTER MSRs. suspend.c itself
doesn't seem to depend on the SOFTWARE_SUSPEND machinery, but
suspend_asm.S does.

Does that sound reasonable?

> > The patch has a debug printk() for problematic systems that require
> > the fix. If it says your machine didn't preserve the MSRs, please
> > post a note about this to LKML with your machine model, so we can
> > estimate the scope of the problem.
> I really think that it should be done unconditionally - there's no point
> in even _expecting_ the BIOS to restore various random MSR's. I can't
> imagine that many do.

It does the restore unconditionally, the check is just informational.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:35    [W:0.082 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site