* get/put_user() problems
@ 2002-05-30 0:47 Mark Hapke
2002-05-30 2:21 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Mark Hapke @ 2002-05-30 0:47 UTC (permalink / raw)
To: linux-smp
Hello,
i need to copy data from kernel space to user space. An ISR executed on
CPU0 needs to perform get/put_user()-calls to transfer some data into
user space, where the concerned process is executed on CPU1.
It is obvious that i must set up something before, because it doesn't
work the usual way, put_user() returns -14 (-EFAULT) when called.
BTW, it works when both, ISR and process, are executed on the same CPU.
My system is a dual P3 at 933 Mhz and 1G of ram. Kernel version is
2.4.9. It is compatible to Intel MP-Spec. 1.1. The chipset is
ServerWorks CNB20LE (rev 05).
Does anyone have an idea?
Thank you,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: get/put_user() problems
2002-05-30 0:47 get/put_user() problems Mark Hapke
@ 2002-05-30 2:21 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-05-30 2:21 UTC (permalink / raw)
To: Mark Hapke; +Cc: linux-smp
On Thu, 2002-05-30 at 01:47, Mark Hapke wrote:
> i need to copy data from kernel space to user space. An ISR executed on
> CPU0 needs to perform get/put_user()-calls to transfer some data into
> user space, where the concerned process is executed on CPU1.
> It is obvious that i must set up something before, because it doesn't
> work the usual way, put_user() returns -14 (-EFAULT) when called.
> BTW, it works when both, ISR and process, are executed on the same CPU.
It might work by chance if the IRQ happens to occur on the same CPU, and
that process is the current page table set, and its an x86 and it isnt
paged out and the wind is in the right direction.
User space access from interrupts is a complete no-no. If you absolutely
must share memory directly then allocate kernel memory, mmap it into the
user process and write to the kernel address.
Have a look at the mmap code in the sound drivers for an example
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-05-30 2:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-30 0:47 get/put_user() problems Mark Hapke
2002-05-30 2:21 ` Alan Cox
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.