tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: virtual to physical memory address translation



Hello,

On Mon, 15 Jan 2018 08:54:43 -0700
Warner Losh <imp%bsdimp.com@localhost> wrote:

> On Mon, Jan 15, 2018 at 8:09 AM, John Nemeth <jnemeth%cue.bc.ca@localhost> wrote:
> 
> > On Jan 15,  2:04pm, Michael van Elst wrote:
> > } manu%netbsd.org@localhost (Emmanuel Dreyfus) writes:
> > }
> > } >Sorry if that has been covered ad nauseum, but I canot find relevant
> > } >information about that: on NetBSD, how can I get the physical memory
> > } >address given a virtual memory address? This is to port the Linux
> > } >Meltdown PoC so that we have something to test our systems against.
> > }
> > } pmap_extract() returns the physical address of a virtual address.
> > } pmap_kernel() gives you the kernel map.
> >
> >      I suspect that he wants to do this from userland.
> >  
> 
> You have to walk the page tables, or trick some driver into leaking this
> information somehow. There's no standard interface to get it.
> 
> In FreeSBD there's no standard interface, but that hasn't stopped people
> from getting metldown and spectre working, though I don't think they have
> shared that PoC code.

Stupid question - if you just want to show that meltdown or spectre
work ( or don't work ) in principle, why not just write a driver that
hands userland a chunk of memory along with its physical address? That
way you don't have to find ( or worse, show ) a way to do that without
help.

have fun
Michael


Home | Main Index | Thread Index | Old Index