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] Building Xen with structures thread_info/task_struct

To: xen-devel@xxxxxxxxxxxxxxxxxxx <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Building Xen with structures thread_info/task_struct
From: Frederic Beck <frederic.beck@xxxxxxxx>
Date: Thu, 29 Jan 2009 14:45:20 +0100
Delivery-date: Thu, 29 Jan 2009 05:45:50 -0800
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>
Organization: INRIA-LORIA
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hello

I disabled fast system calls, and i'm willing to log the systems calls
performed on a VM. In order to understand better what did cause each
syscall, i'm trying to link them with the PID of the process that is
responsible of the call.

To do so i get the ESP register, apply the mask 0xFFFFF000 and so i get
the base address for the thread_info structure that defines the calling
process. The first member of this structure is a task_struct structure
which contains the PID of this process.

These two structure are not redefined in x86 implementation of Xen, but
they are in ia64 (and of course i'm in x86). I tried to redefine them,
but as they are quite big, it's not straightforward and i always end up
with structure for which gcc cannot determine their size (many complex
types embedded).

I tried to use the kernel headers of Dom0 in which they are defined but
i get some troubles. When i include asm/thread_info.h, i get the
following error

In file included from traps.c:70:
/usr/src/linux/include/asm/thread_info.h:10: warning: ‘struct
thread_info’ declared inside parameter
list /usr/src/linux/include/asm/thread_info.h:10: warning: its scope is
only this definition or declaration, which is probably not what you
want /usr/src/linux/include/asm/thread_info.h:11: warning: ‘struct
task_struct’ declared inside parameter list traps.c: In function
‘do_guest_trap’: traps.c:429: error: storage size of ‘thread_info’
isn’t known traps.c:430: error: storage size of ‘task’ isn’t known
traps.c:475: error: invalid application of ‘sizeof’ to incomplete type
‘struct thread_info’ traps.c:476: error: invalid application of
‘sizeof’ to incomplete type ‘struct task_struct’ 


When i directly include the 32 bits version, asm/thread_info_32.h i
don't have this scope problem anymore but gcc still is not able to
determine the size of the structures

traps.c: In function ‘do_guest_trap’:
traps.c:431: error: storage size of ‘thread_info’ isn’t known
traps.c:432: error: storage size of ‘task’ isn’t known
traps.c:477: error: invalid application of ‘sizeof’ to incomplete type
‘struct thread_info’ traps.c:478: error: invalid application of
‘sizeof’ to incomplete type ‘struct task_struct’ 

I've never had such problems before, and getting out of ideas.

Anyone has an idea/solution ?

Thanks

Regards
Fred

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>