qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH repost 2/4] oslib: allocate PROT_NONE pages on t


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH repost 2/4] oslib: allocate PROT_NONE pages on top of RAM
Date: Mon, 28 Sep 2015 12:59:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0


On 27/09/2015 12:14, Michael S. Tsirkin wrote:
> -    if (total > size) {
> -        munmap(ptr + size, total - size);
> +    if (total > size + getpagesize()) {
> +        munmap(ptr + size + getpagesize(), total - size - getpagesize());
>      }
>  

Please add a comment here, also noting that "total" always allocates at
least an extra page, even if size is already aligned.

>      if (ptr) {
> -        munmap(ptr, size);
> +        munmap(ptr, size + getpagesize());
>      }

And another comment here.

Paolo



reply via email to

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