From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) by kanga.kvack.org (Postfix) with ESMTP id D98056B0037 for ; Fri, 20 Dec 2013 03:25:25 -0500 (EST) Received: by mail-qc0-f174.google.com with SMTP id n7so1947532qcx.33 for ; Fri, 20 Dec 2013 00:25:25 -0800 (PST) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [2607:f8b0:400c:c02::233]) by mx.google.com with ESMTPS id nh12si5193560qeb.80.2013.12.20.00.25.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Dec 2013 00:25:24 -0800 (PST) Received: by mail-vb0-f51.google.com with SMTP id 11so1205934vbe.24 for ; Fri, 20 Dec 2013 00:25:24 -0800 (PST) MIME-Version: 1.0 Reply-To: matvejchikov@gmail.com In-Reply-To: <20131220024126.GA1852@hp530> References: <20131220024126.GA1852@hp530> From: Matvejchikov Ilya Date: Fri, 20 Dec 2013 12:25:04 +0400 Message-ID: Subject: Re: A question aboout virtual mapping of kernel and module pages Content-Type: multipart/alternative; boundary=047d7b3435c00d495c04edf3056b Sender: owner-linux-mm@kvack.org List-ID: To: Vladimir Murzin Cc: linux-mm@kvack.org --047d7b3435c00d495c04edf3056b Content-Type: text/plain; charset=ISO-8859-1 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 > 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 --047d7b3435c00d495c04edf3056b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Vladimir,

Tha= nks for the suggestion, but the problem was not in mapping itself. I've= been mistaken
about
it
as
the problem I've had was r= elated 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@gmail.com>

> Hi Ilya!
>
> On Fri, Dec 20, 2013 at 12:25:13AM +0400,= Matvejchikov Ilya wrote:
> > I'm using VMAP function to creat= e memory writable mapping as it suggested
> > in ksplice project. = Here is the implementation of map_writable function:
> > ...
> >
> > This function works well when I use= d it to map kernel's text addresses. All
> > fine and I can re= write 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
> modificat= ions were done?
>
> Vladimir
>
> > Can anyone ex= plain me what's happend and why I can use it for mapping
> > kernel and can't for modules?
> >
> > http://stackoverflow.com/questions/206= 58357/virtual-mapping-of-kernel-and-module-pages
--047d7b3435c00d495c04edf3056b-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org