[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN
From: |
Wei Yang |
Subject: |
Re: [PATCH 1/2] cpu: use ROUND_UP() to define xxx_PAGE_ALIGN |
Date: |
Mon, 14 Oct 2019 11:19:06 +0800 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Sun, Oct 13, 2019 at 07:38:04PM -0700, Richard Henderson wrote:
>On 10/13/19 6:01 PM, Wei Yang wrote:
>>> No, please.
>>>
>>> (1) The compiler does not know that qemu_*host_page_size is a power of 2,
>>> and
>>> will generate a real division at runtime. The same is true for
>>> TARGET_PAGE_SIZE when TARGET_PAGE_BITS_VARY.
>>>
>>
>> Confused
>>
>> The definition of ROUND_UP is:
>>
>> #define ROUND_UP(n, d) (((n) + (d) - 1) & -(0 ? (n) : (d)))
>
>Ah, my bad, I did confuse this with QEMU_ALIGN_UP.
>
>Hmm.
>
> lea -1(n, size), t
> neg size
> and size, t
>
>vs
>
> mov mask, t
> not t
> add n, t
> and mask, t
>
>which is what I proposed here
>
>>> https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg04526.html
>
>I'm ok with your version.
>
>Reviewed-by: Richard Henderson <address@hidden>
>
Thanks for your clarification.
Have a nice day
>
>r~
>
--
Wei Yang
Help you, Help me
[PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size, Wei Yang, 2019/10/13
Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size, Yuval Shaia, 2019/10/15