lkml.org 
[lkml]   [2015]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86_32: Initialize the cr4 shadow on cpu init
On Fri, Feb 27, 2015 at 12:19 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Fri, 27 Feb 2015 11:53:39 -0800
> Andy Lutomirski <luto@amacapital.net> wrote:
>
>> This is embarrassing. I must have gotten lucky testing it.
>>
>
> The thing is, it booted fine on all my tests. It wasn't until I did
> hotplug where it crashed.
>
> I'm not sure what's in CR4 when the CPU comes up, but perhaps zero is
> fine to start out and the writes to CR4 update makes the shadow and reg
> the same. It's when we hotplug that the two become out of sync.
>

I bet that having the shadow set to zero is fine because the first
attempt to set a bit in cr4 will clear all the other bits without
harmful side effects. But if the shadow starts out at 0xffffffff or
something like that, then the early attempts to set bits will have no
effect and we'll fail.

--Andy

> Just my theory.
>
> -- Steve



--
Andy Lutomirski
AMA Capital Management, LLC


\
 
 \ /
  Last update: 2015-02-27 21:41    [W:0.034 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site