lkml.org 
[lkml]   [2012]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how to implement platform specific per process parameter?
> There are 4 options:

> 1. [not a kernel interface] use ptrace to execute the register changing
> command inside the specified pid. The next context switch saves the new
> value in the thread_struct. Dirty hack.
>
> 2. Add a new syscall which would receive pid + register value and do the
> job. A bit too much.
>
> 3. Add some hook in /proc filesystem but so far there were no platform
> specific bits, right?
>
> 4. Implement a static node "/sys/devices/system/cpu/dscr_control".
> write() would parse the input stream, call scanf("%d %x", &pid, &dscr)
> and do the job.
>


/sys/ interface would be appropriate I believe. But in this way we can take a new
(pid, dscr) and update thread_struct. But there should be a way to enlist all
(pid, dscr) values which are explicitly set by the user and different than that
of /sys/devices/system/cpu/dscr_default. So that we can know which process is holding
to what value of DSCR at any point of time.



> What is the correct approach? Thanks.
>
>


Regards
Anshuman



\
 
 \ /
  Last update: 2012-08-06 10:43    [W:0.044 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site