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

Re: [Xen-devel] [edk2] The size of memory is wrong inside of virtual machine(VM) when using OVMF



On 06/07/15 14:29, Wei Liu wrote:
> On Mon, Jun 01, 2015 at 09:13:08AM +0000, Maoming wrote:
>> Hi all:
>>        I encountered a troublesome problem about OVMF.
>>        I used OVMF.fd as a BIOS of virtual machine(VM).
>>
>>        1ãmy environment:
>>        xen_version            : 4.6-unstable
>>        I git clone xen from git://xenbits.xen.org/xen.git. configure it and 
>> parameters as below:
>>        ./configure --prefix=/usr/ --libdir=/usr/lib/  --enable-ovmf then 
>> make && make install, after that I reboot my host OS(suse11sp3).
>>
>>         There is a same problem in KVM too.
>>
>>        2ãproblem:
>>        I started a VM whose memory is 64G in the host.
>>        The size of memory inside of the VM is wrong while it is OK when I 
>> check it in the host using "xl list".
>>        But, when I changed the memory to 63G,it was both OK.
>>        (1)64G memory
>>        inside of VM using "free" to check:
>>                     total       used       free     shared    buffers     
>> cached
>>        Mem:       3715640     495916    3219724          0      22060     
>> 175136
>>        -/+ buffers/cache:     298720    3416920
>>        Swap:      4046840          0    4046840
>>        It is only 3.5G.
>>
>>        in the host using "xl list" to check:
>>        Name                                        ID   Mem VCPUs      State 
>>   Time(s)
>>        Domain-0                                     0  3055    16     r----- 
>>     861.2
>>        redhat                                       4 65536     2     r----- 
>>       5.9
>>
>>        (2)63G memory
>>        inside of VM using "free" to check:
>>                     total       used       free     shared    buffers     
>> cached
>>        Mem:      64918224    1083912   63834312          0      22188     
>> 175344
>>        -/+ buffers/cache:     886380   64031844
>>        Swap:      4046840          0    4046840
>>        It is OK.
>>
>>        in the host using "xl list" to check:
>>        Name                                        ID   Mem VCPUs      State 
>>   Time(s)
>>        Domain-0                                     0  3055    16     r----- 
>>     821.2
>>        redhat                                       3 64512     2     -b---- 
>>      48.5
>>
>>        3ãmy cfg file:
>>        builder = "hvm"
>>        name = "redhat"
>>        memory = 65536
>>        maxmem = 65536
>>        vcpus = 2
>>        bios = "ovmf"
>>        boot = "dc"
>>        sdl=0
>>        disk = [ 'file:/test/image/redhat6_3.img,xvda,w' ]
>>        vnc = 1
>>        vnclisten = '9.61.1.31'
>>        vncdisplay = 0
>>
>>        Any thought on this?
>>        Any help will be appreciated.
>>        If you need some other information, please let me know. :)
>>
> 
> It looks like there is some kind of truncation inside OVMF. But I don't
> have a test box that has so much memory so I cannot try it myself.

The issue is real. I've been working on some patches today for this.
I'll soon send an RFC series.

It's actually easy to *test* this scenario: just create a 128GB or so
file, with "fallocate", on a sufficiently big filesystem. Then format it
with mkswap and add it with swapon. I have strict memory overcommit
settings on my laptop (/proc/sys/vm/overcommit_memory = 2), but with
such a swap file, a >= 64GB guest can easily be started.

(I used my old spindle disk for the swap file. Since the guest is doing
practically nothing, it doesn't cause the disk to thrash.)

Thanks
Laszlo

> Since it manifests on both Xen and KVM I don't really have an idea about
> what's going on.
> 
> The only thing I can say is that the tested OVMF tree for Xen is 
> 
> http://xenbits.xen.org/gitweb/?p=osstest/ovmf.git;a=summary
> xen-tested-master
> 
> The one in xen.git is updated periodically. Make sure you use our
> latest tested branch so you can get fixes from upstream.
> 
> Wei.
> 
>>        Thanks!
>>          -mao
> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxx
>> http://lists.xen.org/xen-devel
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.