public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: bifferos <bifferos@yahoo.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kexec failure on RDC (and possibly other early x86) platforms
Date: Sun, 06 Dec 2009 18:52:06 +0200	[thread overview]
Message-ID: <4B1BE136.4090005@redhat.com> (raw)
In-Reply-To: <371220.64690.qm@web27006.mail.ukl.yahoo.com>

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


  reply	other threads:[~2009-12-06 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06 11:33 Kexec failure on RDC (and possibly other early x86) platforms bifferos
2009-12-06 16:52 ` Avi Kivity [this message]
2009-12-07  0:22   ` H. Peter Anvin

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=4B1BE136.4090005@redhat.com \
    --to=avi@redhat.com \
    --cc=bifferos@yahoo.co.uk \
    --cc=linux-kernel@vger.kernel.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