qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 10/10] linux-user: init_guest_space: Try to make


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 10/10] linux-user: init_guest_space: Try to make ARM space+commpage continuous
Date: Tue, 20 Mar 2018 15:53:34 +0000

On 20 March 2018 at 15:23, Laurent Vivier <address@hidden> wrote:
> Le 02/03/2018 à 15:13, Peter Maydell a écrit :
>> On 28 December 2017 at 18:08, Luke Shumaker <address@hidden> wrote:
>>> +#if defined(TARGET_ARM) && !defined(TARGET_AARCH64)
>>> +    /* On 32-bit ARM, we need to map not just the usable memory, but
>>> +     * also the commpage.  Try to find a suitable place by allocating
>>> +     * a big chunk for all of it.  If host_start, then the naive
>>> +     * strategy probably does good enough.
>>> +     */
>>> +    if (!host_start) {
>>> +        unsigned long guest_full_size, host_full_size, real_start;
>>> +
>>> +        guest_full_size =
>>> +            (0xffff0f00 & qemu_host_page_mask) + qemu_host_page_size;
>>
>> I think this is probably more clearly written as 0x100000000ULL,
>> since rounding down to the host-page-size then adding the host-page-size
>> gets us the full 32-bit size of the guest address space.
>
> Perhaps, I've missed something, but it seems not true.
>
> On x86_64, we have:
>
> qemu_host_page_mask = 0xfffffffffffff000
> qemu_host_page_size = 0x0000000000001000
>
> but
>
> 0xffff0f00 & 0xfffffffffffff000 = 0xffff0000
> then
> 0xffff0000 + 0x0000000000001000 = 0xffff1000

Yes, you're right -- I'd thought that the kernel commpage was
right at the top of memory, but it isn't.

thanks
-- PMM



reply via email to

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