sysenter cause a segmentation fault.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ying Chu
Date: Sunday, March 18, 2007 - 1:08 am

A simple code running on PIII 800,kernel 2.6.20 with SEP enabled
causes  a  segmentation fault.
The slice is as following.

#include <stdio.h>
#include <sys/syacall.h>

int main()
{
    unsigned long ret=0;
    __asm__ __volatile__ ("movl %1,%%eax\n\tpushl %%ecx\n\t"
     "pushl %%edx\n\tpush %%ebp\n\t"
     "movl %%esp,%%ebp\n\t"     "sysenter\n\t"
     "movl %%eax,%0"
     :"=m"(ret)
     :"b"(SYS_getuid));
   printf("%d\n",ret);
   return 0;
}

More, when i enabled Kdb and set "bp sysenter_entry",it went with a
catastrophic error errupted.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
sysenter cause a segmentation fault., Ying Chu, (Sun Mar 18, 1:08 am)
Re: sysenter cause a segmentation fault., Andi Kleen, (Sun Mar 18, 8:51 am)