Before memory can be exported into userspace, the reserved bit must be set. 
Call mem_map_reserve()  prior to remap_page_range().
good luck.
> 	return 0;
> }
>
> static struct file_operations simple_fops={
>     mmap:	driver_mmap,
> };
>
> int
> init_module(void){
> 	...
> 	kmalloc_area=kmalloc(LEN,GFP_USER);
> 	strncpy(kmalloc_area,init_msg,sizeof(init_msg));
> 	...
> }
>
> ---user-app---
>
> int main(void)
> {
> 	int fd;
> 	char msg[]="some message - should appear in kernel space";
> 	unsigned int *addr;
>
> 	if((fd=open("/dev/simple-device", O_RDWR))<0)
> 	addr = mmap(0, LEN, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
> 	memset(addr,0,LEN);
> 	strncpy(addr,msg,sizeof(msg));
> 	return 0;
> }
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/