get/put_user() problems
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
Quoted 6 lines · Mark Hapke
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