* Kexec failure on RDC (and possibly other early x86) platforms
@ 2009-12-06 11:33 bifferos
2009-12-06 16:52 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: bifferos @ 2009-12-06 11:33 UTC (permalink / raw)
To: linux-kernel
I've updated the patch to allow Kexec to work on RDC platforms
here:
http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/kernel/2.6.32/0003-kexec-fix.patch
I'm curious as to how one can detect the presence of the CR4
register in assembler, as I'm sure it's possible, but I've just
#ifndefed out the offending instruction in this patch and it
seems to work with this change.
regards,
Biff.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Kexec failure on RDC (and possibly other early x86) platforms
2009-12-06 11:33 Kexec failure on RDC (and possibly other early x86) platforms bifferos
@ 2009-12-06 16:52 ` Avi Kivity
2009-12-07 0:22 ` H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2009-12-06 16:52 UTC (permalink / raw)
To: bifferos; +Cc: linux-kernel
On 12/06/2009 01:33 PM, bifferos wrote:
> I've updated the patch to allow Kexec to work on RDC platforms
> here:
> http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/kernel/2.6.32/0003-kexec-fix.patch
>
> I'm curious as to how one can detect the presence of the CR4
> register in assembler, as I'm sure it's possible, but I've just
> #ifndefed out the offending instruction in this patch and it
> seems to work with this change.
>
One way is to execute the instruction and trap the #UD exception if it
is not supported. Not sure whether you have an IDT set up or whether
your cpu traps on mov cr4.
If your cpu supports cpuid you can test for features that indicate bits
in cr4 are available, for example VME, DE, PSE, PVI, and PAE. If none
are available you likely don't have cr4 (and even if you do, it's
pointless to reset it).
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Kexec failure on RDC (and possibly other early x86) platforms
2009-12-06 16:52 ` Avi Kivity
@ 2009-12-07 0:22 ` H. Peter Anvin
0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2009-12-07 0:22 UTC (permalink / raw)
To: Avi Kivity; +Cc: bifferos, linux-kernel
On 12/06/2009 08:52 AM, Avi Kivity wrote:
> On 12/06/2009 01:33 PM, bifferos wrote:
>> I've updated the patch to allow Kexec to work on RDC platforms
>> here:
>> http://bifferboard.svn.sourceforge.net/viewvc/bifferboard/slack/kernel/2.6.32/0003-kexec-fix.patch
>>
>>
>> I'm curious as to how one can detect the presence of the CR4
>> register in assembler, as I'm sure it's possible, but I've just
>> #ifndefed out the offending instruction in this patch and it
>> seems to work with this change.
>>
>
> One way is to execute the instruction and trap the #UD exception if it
> is not supported. Not sure whether you have an IDT set up or whether
> your cpu traps on mov cr4.
>
> If your cpu supports cpuid you can test for features that indicate bits
> in cr4 are available, for example VME, DE, PSE, PVI, and PAE. If none
> are available you likely don't have cr4 (and even if you do, it's
> pointless to reset it).
>
In general, I believe, existence of CPUID == existence of CR4.
(There were some late 486's which had CPUID, I believe they also had
CR4.) The first-principles test of catching the trap is more direct,
though. Inside the kernel we have read_cr4_safe() for that.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-07 0:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-06 11:33 Kexec failure on RDC (and possibly other early x86) platforms bifferos
2009-12-06 16:52 ` Avi Kivity
2009-12-07 0:22 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox