[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-17 Thread Chris J Arges
** Changed in: qemu (Ubuntu) Status: In Progress => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153 Title: qemu should not enable KSM on nested guests To manage notificati

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-10 Thread Chris J Arges
** Patch added: "lp1414153-vivid-v2.debdiff" https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1414153/+attachment/4316716/+files/lp1414153-vivid-v2.debdiff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.n

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-10 Thread Ubuntu Foundations Team Bug Bot
** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153 Title: qemu should not enable KSM on nested guests To manage notifications about this bug go to: https://bugs.launchpad.ne

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-09 Thread Chris J Arges
Attached is a method to do this on x86 only. This abuses the postinst to check if we are on a guest and then edit /etc/default/qemu-kvm to enable or disable KSM. ** Patch added: "lp1414153-vivid.debdiff" https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1414153/+attachment/4315925/+files/lp1

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-09 Thread Chris J Arges
** Changed in: qemu (Ubuntu) Status: Triaged => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153 Title: qemu should not enable KSM on nested guests To manage notifications a

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-02-04 Thread Chris J Arges
After testing in a power8 KVM VM, I added the following to systemd to allow it to detect if its in a VM: https://github.com/systemd/systemd/commit/d831deb512ab1d11aab156f69620db506c554170 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-29 Thread Chris J Arges
Ok so that particular tool is packaged with the 'systemd' package. For example: ubuntu@vivid:~$ systemd-detect-virt -v kvm And it will return 0 if we're on a virt platform. This would be nice to use on vivid, but we don't really have a systemd script yet. So a few options: 1) Dep on systemd packa

Re: [Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-29 Thread Ryan Harper
Shame that virt.c isn't a standalone tool that could be reused. On Thu, Jan 29, 2015 at 9:54 AM, Chris J Arges <1414...@bugs.launchpad.net> wrote: > FWIW, here is the systemd-virt-detect code used to detect if we are > running on a virt platform. > https://github.com/systemd/systemd/blob/master/s

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-29 Thread Chris J Arges
FWIW, here is the systemd-virt-detect code used to detect if we are running on a virt platform. https://github.com/systemd/systemd/blob/master/src/shared/virt.c This would be the proper way to detect when using systemd, but we still need a bashy way of doing this with upstart. I'll look at mergin

Re: [Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-26 Thread Ryan Harper
There's nothing preventing nested guests architectually IIUC. I don't know that anyone has implemented it yet but seems reasonable to thing ahead and avoid x86isms where possible. On Sat, Jan 24, 2015 at 3:27 PM, Chris J Arges <1414...@bugs.launchpad.net> wrote: > Ryan, > I don't think Power8/k

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-26 Thread Chris J Arges
I'll look for a more agnostic solution. We most likely don't want to run KSM in L1 by default in any guest not just one that will host nested VMs. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-24 Thread Chris J Arges
Ryan, I don't think Power8/kvm nor ARM/kvm allow for nested guests, so do we need to worry about in those cases? --chris -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153 Title: qemu should no

Re: [Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-24 Thread Ryan Harper
On Fri, Jan 23, 2015 at 10:16 PM, Chris J Arges <1414...@bugs.launchpad.net> wrote: > #!/bin/bash > # 2015 Chris J Arges > # Detect if we are running inside KVM > NESTED_VM=0 > VM_STRINGS="KVM QEMU VMware VirtualBox Xen" > VM_DETECT=$(dmesg | egrep -e '(Hypervisor detected|Booting paravirtualized

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-24 Thread Chris J Arges
I could amend my script in #3 to include Openstack SeaBIOS as well. And obviously testing this in VMs across virtualization platforms and arches would help as well. I've only tested on x86/KVM, x86/EC2. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscr

Re: [Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-23 Thread Ryan Harper
One method that's pretty solid for QEMU (save folks who pass in custom DMI table values to qemu) is the BIOS data available via dmidecode (or /sysfs/dmi); would need to look at Power and arm for equivalent (likely some device tree bits in /sysfs). Openstack exports a BIOS manufacture of Openstack

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-23 Thread Chris J Arges
#!/bin/bash # 2015 Chris J Arges # Detect if we are running inside KVM NESTED_VM=0 VM_STRINGS="KVM QEMU VMware VirtualBox Xen" VM_DETECT=$(dmesg | egrep -e '(Hypervisor detected|Booting paravirtualized kernel)') VM_DMIDECODE=$(sudo dmidecode | egrep -i 'manufacturer|product|vendor') for vm_string

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-23 Thread Chris J Arges
Working on it. I'll post a 'detect' script for review first. ** Changed in: qemu (Ubuntu) Assignee: (unassigned) => Chris J Arges (arges) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1414153 Ti

[Bug 1414153] Re: qemu should not enable KSM on nested guests

2015-01-23 Thread Serge Hallyn
So did we come up with a good way to detect not being on bare metal? In fact ksm gets enabled by /etc/init/qemu-kvm which is only installed on a subset of architectures so using virt-what may be a possibliity, however I'd still prefer not to add virt-what as a dependency if we can come up with a b