Discussion:
[edk2] [Xen-devel] The size of memory is wrong inside of virtual machine(VM) when using OVMF
Wei Liu
2015-06-07 12:29:31 UTC
Permalink
I encountered a troublesome problem about OVMF.
I used OVMF.fd as a BIOS of virtual machine(VM).
xen_version : 4.6-unstable
./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.
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
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.
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
total used free shared buffers cached
Mem: 64918224 1083912 63834312 0 22188 175344
-/+ buffers/cache: 886380 64031844
Swap: 4046840 0 4046840
It is OK.
Name ID Mem VCPUs State Time(s)
Domain-0 0 3055 16 r----- 821.2
redhat 3 64512 2 -b---- 48.5
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.

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
http://lists.xen.org/xen-devel
------------------------------------------------------------------------------
Laszlo Ersek
2015-06-08 20:57:30 UTC
Permalink
Post by Wei Liu
I encountered a troublesome problem about OVMF.
I used OVMF.fd as a BIOS of virtual machine(VM).
xen_version : 4.6-unstable
./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.
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
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.
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
total used free shared buffers cached
Mem: 64918224 1083912 63834312 0 22188 175344
-/+ buffers/cache: 886380 64031844
Swap: 4046840 0 4046840
It is OK.
Name ID Mem VCPUs State Time(s)
Domain-0 0 3055 16 r----- 821.2
redhat 3 64512 2 -b---- 48.5
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
Post by Wei Liu
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
http://lists.xen.org/xen-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Wei Liu
2015-06-09 17:20:47 UTC
Permalink
On Mon, Jun 08, 2015 at 10:57:30PM +0200, Laszlo Ersek wrote:
[...]
Post by Laszlo Ersek
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.)
That is really neat trick. :-)

Only that Xen requires real ram to start a guest so I can't use it. :-/


Wei.

------------------------------------------------------------------------------
Loading...