Re: [PATCH 3/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Paolo Bonzini
Il 28/03/2014 06:47, Zhang, Yang Z ha scritto: + smap = smap u !uf + !((kvm_x86_ops-get_cpl(vcpu) 3) + ((kvm_x86_ops-get_rflags(vcpu) +

[Bug 71521] Host call trace when create guest.

2014-03-28 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=71521 Paolo Bonzini bonz...@gnu.org changed: What|Removed |Added Status|NEW |RESOLVED

Re: [Qemu-devel] Massive read only kvm guests when backing file was missing

2014-03-28 Thread Michael Tokarev
27.03.2014 20:14, Alejandro Comisario wrote: Seems like virtio (kvm 1.0) doesnt expose timeout on the guest side (ubuntu 12.04 on host and guest). So, how can i adjust the tinmeout on the guest ? After a bit more talks on IRC yesterday, it turned out that the situation is _much_ more

RE: [PATCH 3/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Wu, Feng
-Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Paolo Bonzini Sent: Friday, March 28, 2014 2:23 PM To: Zhang, Yang Z; Wu, Feng; g...@redhat.com; h...@zytor.com; kvm@vger.kernel.org Subject: Re: [PATCH 3/4] KVM: Add SMAP support

Re: [Qemu-devel] Massive read only kvm guests when backing file was missing

2014-03-28 Thread Stefan Hajnoczi
On Fri, Mar 28, 2014 at 11:01:00AM +0400, Michael Tokarev wrote: 27.03.2014 20:14, Alejandro Comisario wrote: Seems like virtio (kvm 1.0) doesnt expose timeout on the guest side (ubuntu 12.04 on host and guest). So, how can i adjust the tinmeout on the guest ? After a bit more talks on

RE: [PATCH 3/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Wu, Feng
-Original Message- From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo Bonzini Sent: Thursday, March 27, 2014 7:47 PM To: Wu, Feng; g...@redhat.com; h...@zytor.com; kvm@vger.kernel.org Subject: Re: [PATCH 3/4] KVM: Add SMAP support when setting CR4 Il

[PATCH 3/4] KVM: Disable SMAP for guests in EPT realmode and EPT unpaging mode

2014-03-28 Thread Feng Wu
SMAP is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging mode with TDP. To emulate this behavior, SMAP needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Feng Wu feng...@intel.com ---

[PATCH 1/4] KVM: Remove SMAP bit from CR4_RESERVED_BITS.

2014-03-28 Thread Feng Wu
This patch removes SMAP bit from CR4_RESERVED_BITS. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fdf83af..4eeb049 100644 ---

[PATCH 0/4] KVM: enable Intel SMAP for KVM

2014-03-28 Thread Feng Wu
Supervisor Mode Access Prevention (SMAP) is a new security feature disclosed by Intel, please refer to the following document: http://software.intel.com/sites/default/files/319433-014.pdf Every access to a linear address is either a supervisor-mode access or a user-mode access. All accesses

[PATCH 4/4] KVM: expose SMAP feature to guest

2014-03-28 Thread Feng Wu
This patch exposes SMAP feature to guest Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c697625..deb5f9b 100644 --- a/arch/x86/kvm/cpuid.c +++

[PATCH 2/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Feng Wu
This patch adds SMAP handling logic when setting CR4 for guests Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/cpuid.h | 8 arch/x86/kvm/mmu.c | 24 +--- arch/x86/kvm/mmu.h | 26 +++--- arch/x86/kvm/paging_tmpl.h

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check

2014-03-28 Thread Paul Mackerras
On Fri, Mar 28, 2014 at 04:40:36PM +1100, Michael Neuling wrote: Currently using kvmppc_set_one_reg() a transaction could be setup without TEXASR Failure Summary (FS) not set. When this is switched back in by the host, this will result in a TM Bad Thing (ie 0x700 program check) when the

Re: [PATCH 2/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Paolo Bonzini
Il 28/03/2014 18:36, Feng Wu ha scritto: + smap = kvm_read_cr4_bits(vcpu, X86_CR4_SMAP); You are overwriting this variable below, but that is not okay because the value of CR4 must be considered separately in each iteration. This also hides a uninitialized-variable bug for smap correctly in

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check

2014-03-28 Thread Paolo Bonzini
Il 28/03/2014 12:08, Paul Mackerras ha scritto: Currently using kvmppc_set_one_reg() a transaction could be setup without TEXASR Failure Summary (FS) not set. When this is switched back in by the host, this will result in a TM Bad Thing (ie 0x700 program check) when the trechkpt is run.

Re: [RFC PATCH 2/5] KVM: x86: avoid useless set of KVM_REQ_EVENT after emulation

2014-03-28 Thread Paolo Bonzini
Il 27/03/2014 12:30, Paolo Bonzini ha scritto: Despite the provisions to emulate up to 130 consecutive instructions, in practice KVM will emulate just one before exiting handle_invalid_guest_state, because x86_emulate_instructionn always sets KVM_REQ_EVENT. However, we only need to do this

[PATCH] arm: KVM: fix possible misalignment of PGDs and bounce page

2014-03-28 Thread Mark Salter
The kvm/mmu code shared by arm and arm64 uses kalloc() to allocate a bounce page (if hypervisor init code crosses page boundary) and hypervisor PGDs. The problem is that kalloc() does not guarantee the proper alignment. In the case of the bounce page, the page sized buffer allocated may also cross

huge 2nd stage pages and live migration

2014-03-28 Thread Mario Smarduch
Hello I've been working on live migration for ARM-KVM, and noticed problem completing migration with huge 2nd stage tables. Aafter write protecting the VM, for write fault 512 page bits are set in dirty_bitmap[] to take into account future writes to huge page.The pmd is write protected again

Re: [PATCH 3/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Paolo Bonzini
Il 28/03/2014 08:33, Wu, Feng ha scritto: In my understanding it is needed, from Intel SDM: Every access to a linear address is either a supervisor-mode access or a user-mode access. All accesses performed while the current privilege level (CPL) is less than 3 are supervisor-mode accesses. If

RE: [PATCH 2/4] KVM: Add SMAP support when setting CR4

2014-03-28 Thread Wu, Feng
-Original Message- From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo Bonzini Sent: Friday, March 28, 2014 8:03 PM To: Wu, Feng; g...@redhat.com; h...@zytor.com; kvm@vger.kernel.org Subject: Re: [PATCH 2/4] KVM: Add SMAP support when setting CR4 Il

[RFC v2] ARM VM System Specification

2014-03-28 Thread Christoffer Dall
ARM VM System Specification === Goal The goal of this spec is to allow suitably-built OS images to run on all ARM virtualization solutions, such as KVM or Xen. Recommendations in this spec are valid for aarch32 and aarch64 alike, and they aim to be hypervisor

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-03-28 Thread Christoffer Dall
On Thu, Mar 13, 2014 at 04:57:26PM +0100, Antonios Motakis wrote: On an unhandled IO memory abort, use the kvm_io_bus_* API in order to handle the MMIO access through any registered read/write callbacks. This is a dependency for eventfd support (ioeventfd and irqfd). However, accesses to the

Re: huge 2nd stage pages and live migration

2014-03-28 Thread Christoffer Dall
On Fri, Mar 28, 2014 at 10:39:25AM -0700, Mario Smarduch wrote: Hello I've been working on live migration for ARM-KVM, and noticed problem completing migration with huge 2nd stage tables. Aafter write protecting the VM, for write fault 512 page bits are set in dirty_bitmap[] to take

Re: [PATCH] arm: KVM: fix possible misalignment of PGDs and bounce page

2014-03-28 Thread Christoffer Dall
On Fri, Mar 28, 2014 at 10:25:19AM -0400, Mark Salter wrote: The kvm/mmu code shared by arm and arm64 uses kalloc() to allocate a bounce page (if hypervisor init code crosses page boundary) and hypervisor PGDs. The problem is that kalloc() does not guarantee the proper alignment. In the case

Re: [PATCHv2 net] vhost: fix total length when packets are too short

2014-03-28 Thread David Miller
From: Michael S. Tsirkin m...@redhat.com Date: Thu, 27 Mar 2014 12:00:26 +0200 When mergeable buffers are disabled, and the incoming packet is too large for the rx buffer, get_rx_bufs returns success. This was intentional in order for make recvmsg truncate the packet and then handle_rx

Re: [PATCH net] vhost: validate vhost_get_vq_desc return value

2014-03-28 Thread David Miller
From: Michael S. Tsirkin m...@redhat.com Date: Thu, 27 Mar 2014 12:53:37 +0200 vhost fails to validate negative error code from vhost_get_vq_desc causing a crash: we are using -EFAULT which is 0xfff2 as vector size, which exceeds the allocated size. The code in question was introduced

Qemu v1.7.1 CentOS 6.4

2014-03-28 Thread Lane Eckley
Hi Everyone, I am running into performance issues with Windows guest VM's in conjunction with the rather old version of Qemu-KVM that is currently being shipped with rhel 6.4 and as such I am looking to upgrade to the latest stable release of qemu (v1.7.1 if I am not mistaken). As it stands now

Re: Qemu v1.7.1 CentOS 6.4

2014-03-28 Thread Brian Jackson
On 03/28/2014 03:55 PM, Lane Eckley wrote: Hi Everyone, I am running into performance issues with Windows guest VM's in conjunction with the rather old version of Qemu-KVM that is currently being shipped with rhel 6.4 and as such I am looking to upgrade to the latest stable release of qemu

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check

2014-03-28 Thread Paul Mackerras
On Fri, Mar 28, 2014 at 04:40:36PM +1100, Michael Neuling wrote: Currently using kvmppc_set_one_reg() a transaction could be setup without TEXASR Failure Summary (FS) not set. When this is switched back in by the host, this will result in a TM Bad Thing (ie 0x700 program check) when the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Make TM avoid program check

2014-03-28 Thread Paolo Bonzini
Il 28/03/2014 12:08, Paul Mackerras ha scritto: Currently using kvmppc_set_one_reg() a transaction could be setup without TEXASR Failure Summary (FS) not set. When this is switched back in by the host, this will result in a TM Bad Thing (ie 0x700 program check) when the trechkpt is run.