How to use the kernel directly modify the data in a memory block address
I want to modify(read and write) the data in a user process virtual address space in kernel space, now i have convert the process virtual address converted to physical address, but how can i modify the data in kernel space.
linux-3.14 arm64
in the old version(x86_64) i have used mmap to map / dev / mem, but it's doesn't work in arm64
#ifdef MMAP_INVALID_ARGUMENT /* invalid argument when mmap */
mapStart = (void volatile *)mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED, memfd, 0xF000);
#else
mapStart = (void volatile *)mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED, memfd, pa_base);
#endif
I find that if the pa_bae is large than 1M, i get invalid argument