bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH gnumach] Add vm_pages_phys


From: Sergey Bugaev
Subject: Re: [PATCH gnumach] Add vm_pages_phys
Date: Wed, 31 Jan 2024 14:05:18 +0300

On Tue, Jan 30, 2024 at 9:45 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > > +kern_return_t vm_pages_phys(
> > > +       host_t                          host,
> > > +       vm_map_t                        map,
> > > +       vm_address_t                    address,
> > > +       vm_size_t                       size,
> >
> > This is supposed to be a number of pages rather than VM region size,
> > right?
>
> No, I followed the same principle as the vm_allocate etc. calls.
>
> In the function itself, count = atop(size).

Ack, indeed, I was looking at the wrong thing.

> > You're supposed to allocate your own buffer in this case, something like 
> > this:
>
> Ok, done so, thanks!

I see you used kmem_alloc_pageable() over kmem_alloc() that I
suggested. Why is that? My understanding is the point of kmem_alloc()
is to be used in cases like this, when you don't want the routine
itself to fault while holding locks on VM objects/maps.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]