Hi Vladimir,
Thanks for the suggestion, but the problem was not in mapping itself. I've been mistaken
about it
as the problem I've had was related to bug in my code. Thanks for the idea to
check if I-D cache aliasing happens. It turns me to the right
direction :)
2013/12/20 Vladimir Murzin <murzin.v@xxxxxxxxx>
> Hi Ilya!
>
> On Fri, Dec 20, 2013 at 12:25:13AM +0400, Matvejchikov Ilya wrote:
> > I'm using VMAP function to create memory writable mapping as it suggested
> > in ksplice project. Here is the implementation of map_writable function:
> > ...
> >
> > This function works well when I used it to map kernel's text addresses. All
> > fine and I can rewrite read-only data well via the mapping.
> >
> > Now, I need to modify kernel module's text. Given the symbol address inside
> > the module, I use the same method. The mapping I've got seems to be valid.
> > But all my changes visible only in that mapping and not in the module!
> >
> > I suppose that in case of module mapping I get something like copy-on-write
> > but I can't prove it.
> >
>
> Looks like I-D cache aliasing... Have you flushed cashes after your
> modifications were done?
>
> Vladimir
>
> > Can anyone explain me what's happend and why I can use it for mapping
> > kernel and can't for modules?
> >
> > http://stackoverflow.com/questions/20658357/virtual-mapping-of-kernel-and-module-pages
Thanks for the suggestion, but the problem was not in mapping itself. I've been mistaken
2013/12/20 Vladimir Murzin <murzin.v@xxxxxxxxx>
> Hi Ilya!
>
> On Fri, Dec 20, 2013 at 12:25:13AM +0400, Matvejchikov Ilya wrote:
> > I'm using VMAP function to create memory writable mapping as it suggested
> > in ksplice project. Here is the implementation of map_writable function:
> > ...
> >
> > This function works well when I used it to map kernel's text addresses. All
> > fine and I can rewrite read-only data well via the mapping.
> >
> > Now, I need to modify kernel module's text. Given the symbol address inside
> > the module, I use the same method. The mapping I've got seems to be valid.
> > But all my changes visible only in that mapping and not in the module!
> >
> > I suppose that in case of module mapping I get something like copy-on-write
> > but I can't prove it.
> >
>
> Looks like I-D cache aliasing... Have you flushed cashes after your
> modifications were done?
>
> Vladimir
>
> > Can anyone explain me what's happend and why I can use it for mapping
> > kernel and can't for modules?
> >
> > http://stackoverflow.com/questions/20658357/virtual-mapping-of-kernel-and-module-pages