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] Get the pid of a process from hypervisor

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Get the pid of a process from hypervisor
From: Carlo Maiero <zesster@xxxxxxxxx>
Date: Thu, 11 Nov 2010 18:51:02 +0100
Delivery-date: Thu, 11 Nov 2010 09:52:01 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=n3HgrGbtfXTkdg4dD3ae62Ulou0KWEneTe3hShPvljg=; b=qRoCLftifP3wflxZBcvC6b71xXLRVUzuQVFpujiMcnWymnKgIAy519JV0TJP9XczWD wnxoTaRAvQT/hqvSZ7VaiFfEf/U2CCfYKBNkOW/nYVD9eKZ4hys9A9fwtQzFVhfSekSz HZgplQtqoypklYt6W4kUP1RxoJmPbcIMfDMKA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=iYnOFuHAoKObPQD6jtmpqF9cVft2l9wUNM0LnT+DolJeB2Whlwr186H/I0mzyIDU5H 0Rp9X6QqzZQkfMDNs2FH6X6eURHYgRc5jpKD9FHD1EHUrGsNEsJkSaTS043GejBWaNJA mm/qfIXoROcfn//GKfRWbsUCjIyxHa9R4Ak7s=
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,
how can i get the pid of a systemcall from do_guest_trap in traps.c?
I tried with this code put in do_guest_trap:

�� uint32_t pid;
�� uint32_t thread_info_address;
�� uint32_t task_struct_addr;
�� int pid_offset=268; // i got this number using the module in xenaccess
��unsigned_long *tmp;
//I start getting the address of the thread:

�� thread_info_address= v->arch.guest_context.kernel_sp & 0xFFFFE000;

//then i get the struct of the task

�� tmp=(unsigned long*)(thread_info_addr);
�� get_user(task_struct_addr,tmp);

//finally i get pid:

��tmp =(unsigned long*)(task_struct_addr + pid_offset);
��get_user(pid,tmp);

��printk("pid %d",pid);



What is wrong in the code?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Get the pid of a process from hypervisor, Carlo Maiero <=