WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Problem with modify CR0 of xen kernel

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Problem with modify CR0 of xen kernel
From: errik <waitingfor2009marry@xxxxxxxxx>
Date: Sun, 13 Dec 2009 16:44:21 +0800
Delivery-date: Sun, 13 Dec 2009 00:44:41 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8d7JEQlu5KEqJ/Wn7xjE0BBaFkmmsVPLhZRv3zeMcU4=; b=xIJgD4GesxDNYp7joD8mGKyNZs3spqs6KRf8RwwLG1sGvujB+4qrFrJ0q5QodsqK7x /b5PCR2N6E0YtkV9ZMgWsG5N8+Apn8QluvCMSSfILaMDDsQ2Gc8broF0k9wgV3i0S0M0 OqbL8nuezxnNPGMNkazjbYi7/HPP4DPApfYV0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Hcs3Ibpa6F6/DVV0MCjz4iI7IvNC/xnknwDOwRCMZd7PIlsDlLRGv1gP5jGms8frJ7 NDL3Mp68m9+MPwlCrwLrXRo40rIwioSube96LB2mB3ac+Z7m13zstVIhdGad6/vM8HV3 r0JO5wNoaOoACOFPXICBuEoktkOMrc0q0m9VI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi All,
    
   This is a function of a kernel module, but when I calls this function, a segment fault error happens, I don't know why because the code works well on other types of kernel such as PAE and default.
 unsigned long clear_and_return_cr0(void)
{
    unsigned long cr0 = 0;
    unsigned long ret;
#ifdef X86_64
    __asm__ __volatile("movq %%cr0, %%rax" : "=a"(cr0));
    ret = cr0;
    cr0 &= 0xfffffffffffeffff;
    __asm__ __volatile__("movq %%rax, %%cr0" : : "a"(cr0));
#else
    __asm__ __volatile("mov %%cr0, %%eax" : "=a"(cr0));
    ret = cr0;
    cr0 &= 0xfffeffff;
    __asm__ __volatile__("mov %%eax, %%cr0" : : "a"(cr0));
   
#endif
    return ret;
}
 
May anyone give me some suggestions?
 
Thanks a lot!
Eric
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>