[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] vhost-user: broken mem regions
From: |
Damjan Marion (damarion) |
Subject: |
Re: [Qemu-devel] vhost-user: broken mem regions |
Date: |
Thu, 26 Jun 2014 08:26:04 +0000 |
On 26 Jun 2014, at 09:56, Michael S. Tsirkin <address@hidden> wrote:
> On Thu, Jun 26, 2014 at 07:44:24AM +0000, Damjan Marion (damarion) wrote:
>>
>> On 26 Jun 2014, at 09:13, Michael S. Tsirkin <address@hidden> wrote:
>>
>>> On Wed, Jun 25, 2014 at 09:52:09PM +0000, Damjan Marion (damarion) wrote:
>>>>
>>>> On 25 Jun 2014, at 18:44, Paolo Bonzini <address@hidden> wrote:
>>>>
>>>>>> nregions: 4
>>>>>> region:
>>>>>> gpa = 0x100000000
>>>>>> size = 3221225472
>>>>>> ua = 0x2aab6ac00000
>>>>>
>>>>> High memory, above 3 gigabytes.
>>>>>
>>>>>> region:
>>>>>> gpa = 0xFFFC0000
>>>>>> size = 262144
>>>>>> ua = 0x7fc13d200000
>>>>>
>>>>> This is the BIOS. There shouldn't be any FD for this one, it
>>>>> is not allocated in hugetlbfs.
>>>>>
>>>>>> region:
>>>>>> gpa = 0x0
>>>>>> size = 655360
>>>>>> ua = 0x2aaaaac00000
>>>>>> region:
>>>>>> gpa = 0xC0000
>>>>>> size = 3220439040
>>>>>> ua = 0x2aaaaacc0000
>>>>>
>>>>> Together, it's the first 3 GB of memory.
>>>>>
>>>>> I understand now what you mean. Yeah, the format should be changed
>>>>> to include the offset (why does vhost-user need the ua at all?
>>>>> perhaps the offset can replace the ua).
>>>>>
>>>>>> BTW Any idea what to do with region 2, it doesn’t look like the one
>>>>>> belonging
>>>>>> to the same place, but qemu_get_ram_fd() returns same FD for it.
>>>>>
>>>>> This must be a bug. I would have expected qemu_get_ram_fd to return -1
>>>>> here, so no descriptor should be passed to vhost-user.
>>>>
>>>> Problem is inside qemu_get_ram_block():
>>>>
>>>>
>>>> if (block && addr - block->offset < block->length) {
>>>> goto found;
>>>> }
>>>>
>>>> this is true if we have > 4G of RAM allocated.
>>>
>>> Hmm I don't get it. Why is it always true for >4G RAM?
>>
>> This check assumes that guest memory is mapped to RAM block
>> without gaps. as BIOS is mapped to guest address space
>> near 4G this check will return true if block size is bigger than
>> BIOS address.
>
>
> But then offset is > addr so addr - offset is a huge value no?
With 6GB allocated to VM, I’see:
block->offset = 0
block->length = 0x180000000
So if addr = 0xFFFC0000 then it will be false positive.
>
>>>
>>>>
>>>> Any advice how to fix this?
>>>>
>>>>
- Re: [Qemu-devel] vhost-user: broken mem regions, (continued)
- Re: [Qemu-devel] vhost-user: broken mem regions, Nikolay Nikolaev, 2014/06/25
- Re: [Qemu-devel] vhost-user: broken mem regions, Paolo Bonzini, 2014/06/25
- Re: [Qemu-devel] vhost-user: broken mem regions, Damjan Marion (damarion), 2014/06/25
- Re: [Qemu-devel] vhost-user: broken mem regions, Michael S. Tsirkin, 2014/06/26
- Re: [Qemu-devel] vhost-user: broken mem regions, Damjan Marion (damarion), 2014/06/26
- Re: [Qemu-devel] vhost-user: broken mem regions, Michael S. Tsirkin, 2014/06/26
- Re: [Qemu-devel] vhost-user: broken mem regions,
Damjan Marion (damarion) <=
Re: [Qemu-devel] vhost-user: broken mem regions, Damjan Marion (damarion), 2014/06/25