mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stevie-O <oliver@klozoff.com>
To: linux-kernel@vger.kernel.org
Cc: Petr Vandrovec <VANDROVE@vc.cvut.cz>
Subject: Re: Aliasing physical memory using virtual memory (from a d
Date: Wed, 17 Sep 2003 21:10:22 -0400	[thread overview]
Message-ID: <3F6905FE.5030106@klozoff.com> (raw)
In-Reply-To: <3F68FEEC.5020809@klozoff.com>

Stevie-O wrote:

> 
> I grepped my 2.4 kernel source for 'vmap' and the only results that 
> seemed meaningful were vmap_pte_range or vmap_pmd_range in 
> mips/mm/umap.c and mips64/mm/umap.c. Is this documented somewhere? I 
> suffer from the 'i'm new at this, but this looks possible' syndrome. I 
> don't actually know how anything is accomplished.
> 
> Btw, am I right about kmalloc(35000) effectively grabbing 64K?

I did a freetext search of the LXR for 'remap' and came up with this function:

820 /*
821  * maps a range of physical memory into the requested pages. the old
822  * mappings are removed. any references to nonexistent pages results
823  * in null mappings (currently treated as "copy-on-access")
824  */
825 static inline void remap_pte_range(pte_t * pte, unsigned long address, 
unsigned long size,
826         unsigned long phys_addr, pgprot_t prot)

This looks promising, although it's a bit ambiguous to me.  Treating the 
physical pages as distinct from virtual pages:

[1] maps a range of physical memory onto the requested pages
I assume 'the requested pages' here refer to 'the specified virtual pages', 
since the statement makes no sense if it's referring to 'the specified physical 
pages'.

[2] the old mappings are removed.
Looking at the source, it seems that this means 'if these virtual pages were 
pointed to any physical pages before, they won't be anymore'

[3] any references to nonexistent pages results in null mappings ('copy-on-access')
I have no idea what this means, and I can't figure it out reading the code.
Obviously it refers to something not really being there (thus 'nonexistent'). So 
copy-on-access? How do you copy something that doesn't exist?

-- 
- Stevie-O

Real Programmers use COPY CON PROGRAM.EXE


  reply	other threads:[~2003-09-18  1:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18  0:19 Petr Vandrovec
2003-09-18  0:40 ` Stevie-O
2003-09-18  1:10   ` Stevie-O [this message]
2003-09-18 10:32     ` Petr Vandrovec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F6905FE.5030106@klozoff.com \
    --to=oliver@klozoff.com \
    --cc=VANDROVE@vc.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®