Re: [CFT PATCH v2 0/2] KVM: support XSAVES usage in the host

2014-11-26 Thread Nadav Amit
Wanpeng Li wrote: > Hi all, > On Tue, Nov 25, 2014 at 04:50:06PM +0200, Nadav Amit wrote: >>> On Nov 25, 2014, at 16:17, Paolo Bonzini wrote: >>> >>> >>> >>> On 25/11/2014 15:05, Nadav Amit wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 373b0ab9a32e..ca26681455c

Re: [CFT PATCH v2 0/2] KVM: support XSAVES usage in the host

2014-11-26 Thread Wanpeng Li
Hi Nadav, On Wed, Nov 26, 2014 at 11:00:34AM +0200, Nadav Amit wrote: >Wanpeng Li wrote: > >> Hi all, >> On Tue, Nov 25, 2014 at 04:50:06PM +0200, Nadav Amit wrote: On Nov 25, 2014, at 16:17, Paolo Bonzini wrote: On 25/11/2014 15:05, Nadav Amit wrote: >> diff --git

Re: [PATCH] target-i386: add feature flags for CPUID[EAX=0xd,ECX=1]

2014-11-26 Thread Paolo Bonzini
On 25/11/2014 21:02, Paolo Bonzini wrote: > > > +static const char *cpuid_xsave_feature_name[] = { > > > +"xsaveopt", "xsavec", "xgetbv1", "xsaves", > > > > None of the above features introduce any new state that might need to be > > migrated, or will require other changes in QEMU to work, r

Re: [PATCH RFC 1/2] KVM: don't check for PF_VCPU when yielding

2014-11-26 Thread David Hildenbrand
> This change is a trade-off. > PRO: This patch would improve the case of preemption on s390. This is > probably a corner case as most distros have preemption off anyway. > CON: The downside is that kvm_vcpu_yield_to is called also from > kvm_vcpu_on_spin. Here we want to avoid the scheduler over

Re: [PATCH RFC 1/2] KVM: don't check for PF_VCPU when yielding

2014-11-26 Thread Christian Borntraeger
Am 26.11.2014 um 10:23 schrieb David Hildenbrand: >> This change is a trade-off. >> PRO: This patch would improve the case of preemption on s390. This is >> probably a corner case as most distros have preemption off anyway. >> CON: The downside is that kvm_vcpu_yield_to is called also from >> kvm

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-26 Thread Christoffer Dall
On Tue, Nov 25, 2014 at 02:12:31PM +0100, Eric Auger wrote: > On 11/25/2014 11:19 AM, Christoffer Dall wrote: > > [Re-adding cc list] > > > > On Mon, Nov 24, 2014 at 05:42:30PM +0100, Eric Auger wrote: > >> On 11/24/2014 04:47 PM, Christoffer Dall wrote: > >>> On Mon, Nov 24, 2014 at 12:02 PM, Eri

Re: [PATCH] target-i386: add feature flags for CPUID[EAX=0xd,ECX=1]

2014-11-26 Thread Eduardo Habkost
On Wed, Nov 26, 2014 at 10:20:12AM +0100, Paolo Bonzini wrote: > > > On 25/11/2014 21:02, Paolo Bonzini wrote: > > > > +static const char *cpuid_xsave_feature_name[] = { > > > > +"xsaveopt", "xsavec", "xgetbv1", "xsaves", > > > > > > None of the above features introduce any new state that mi

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Radim Krčmář
2014-11-24 17:43+0100, Paolo Bonzini: > Userspace is expecting non-compacted format for KVM_GET_XSAVE, but > struct xsave_struct might be using the compacted format. Convert > in order to preserve userspace ABI. > > Likewise, userspace is passing non-compacted format for KVM_SET_XSAVE > but the k

Re: Exposing host debug capabilities to userspace

2014-11-26 Thread Alex Bennée
Paolo Bonzini writes: > On 25/11/2014 17:35, Alexander Graf wrote: >> Unfortunately on ARM you also have a few other constraints - the debug >> register space is partitioned into magic super debug registers at the >> top (with an implementation specific amount) and normal debug registers >> in t

Re: Exposing host debug capabilities to userspace

2014-11-26 Thread Peter Maydell
On 25 November 2014 at 16:50, Paolo Bonzini wrote: > > > On 25/11/2014 17:35, Alexander Graf wrote: >> Unfortunately on ARM you also have a few other constraints - the debug >> register space is partitioned into magic super debug registers at the >> top (with an implementation specific amount) and

Re: Another Obsolete Fix me in trace.h?

2014-11-26 Thread Radim Krčmář
2014-11-24 22:49+0100, Radim Krčmář: > 2014-11-24 16:19-0500, Steven Rostedt: > > That wouldn't be too hard to implement. > > I'll look at the patch tommorrow. The kernel part is trivial. Most of the code is going to be in tools/lib/traceevent/event-parse.c. I wasn't sure whether to 1) define ne

Re: [PATCH] target-i386: add feature flags for CPUID[EAX=0xd,ECX=1]

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 12:40, Eduardo Habkost wrote: > On Wed, Nov 26, 2014 at 10:20:12AM +0100, Paolo Bonzini wrote: >> >> >> On 25/11/2014 21:02, Paolo Bonzini wrote: > +static const char *cpuid_xsave_feature_name[] = { > +"xsaveopt", "xsavec", "xgetbv1", "xsaves", None of the abov

Re: [CFT PATCH v2 0/2] KVM: support XSAVES usage in the host

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 02:24, Wanpeng Li wrote: > Hi all, > On Tue, Nov 25, 2014 at 04:50:06PM +0200, Nadav Amit wrote: >> >>> On Nov 25, 2014, at 16:17, Paolo Bonzini wrote: >>> >>> >>> >>> On 25/11/2014 15:05, Nadav Amit wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 373b

Re: [PATCH v4 2/3] KVM: arm: add irqfd support

2014-11-26 Thread Eric Auger
On 11/26/2014 12:31 PM, Christoffer Dall wrote: > On Tue, Nov 25, 2014 at 02:12:31PM +0100, Eric Auger wrote: >> On 11/25/2014 11:19 AM, Christoffer Dall wrote: >>> [Re-adding cc list] >>> >>> On Mon, Nov 24, 2014 at 05:42:30PM +0100, Eric Auger wrote: On 11/24/2014 04:47 PM, Christoffer Dall

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
Paolo Bonzini writes: > On 25/11/2014 18:13, Peter Maydell wrote: >> On 25 November 2014 at 17:05, Paolo Bonzini wrote: >>> > So there is no register that says "this breakpoint has triggered" or >>> > "this watchpoint has triggered"? >> Nope. You take a debug exception; the syndrome register te

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 13:07, Radim Krčmář wrote: > 2014-11-24 17:43+0100, Paolo Bonzini: >> Userspace is expecting non-compacted format for KVM_GET_XSAVE, but >> struct xsave_struct might be using the compacted format. Convert >> in order to preserve userspace ABI. >> >> Likewise, userspace is passing n

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 14:13, Alex Bennée wrote: > > Paolo Bonzini writes: > >> On 25/11/2014 18:13, Peter Maydell wrote: >>> On 25 November 2014 at 17:05, Paolo Bonzini wrote: > So there is no register that says "this breakpoint has triggered" or > "this watchpoint has triggered"? >>> Nope. Y

[PATCH] KVM: x86: Generate #UD when memory operand is required

2014-11-26 Thread Nadav Amit
Certain x86 instructions that use modrm operands only allow memory operand (i.e., mod012), and cause a #UD exception otherwise. KVM ignores this fact. Currently, the instructions that are such and are emulated by KVM are MOVBE, MOVNTPS, MOVNTPD and MOVNTI. MOVBE is the most blunt example, since it

[PATCH kvm-unit-tests] x86: Test illegal movbe

2014-11-26 Thread Nadav Amit
Previously KVM ignored the mod field of MOVBE instruction, so MOVBE from register to register succeeds, although it should fail (cause a #UD exception). This test check that a #UD is indeed delivered upon such MOVBE. The test would not work if MOVBE is unsupported. Signed-off-by: Nadav Amit ---

Re: [PATCH] KVM: x86: Generate #UD when memory operand is required

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 14:47, Nadav Amit wrote: > Certain x86 instructions that use modrm operands only allow memory operand > (i.e., mod012), and cause a #UD exception otherwise. KVM ignores this fact. > Currently, the instructions that are such and are emulated by KVM are MOVBE, > MOVNTPS, MOVNTPD and M

[GIT PULL] KVM changes for 3.18-rc7 (or final)

2014-11-26 Thread Paolo Bonzini
Linus, The following changes since commit b914c5b2130239fd378d1a719ab3c53f0c782be9: Merge branch 'for-3.18' of git://linux-nfs.org/~bfields/linux (2014-11-25 19:05:41 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you to fe

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Radim Krčmář
2014-11-26 14:13+0100, Paolo Bonzini: > On 26/11/2014 13:07, Radim Krčmář wrote: > > 2014-11-24 17:43+0100, Paolo Bonzini: > >> Userspace is expecting non-compacted format for KVM_GET_XSAVE, but > >> struct xsave_struct might be using the compacted format. Convert > >> in order to preserve userspa

Re: [PATCH v4 25/42] vhost: add memory access wrappers

2014-11-26 Thread Cornelia Huck
On Tue, 25 Nov 2014 18:43:10 +0200 "Michael S. Tsirkin" wrote: "These wrappers are needed to handle virtio endianness conversions." ? > Signed-off-by: Michael S. Tsirkin > --- > drivers/vhost/vhost.h | 33 - > 1 file changed, 32 insertions(+), 1 deletion(-) >

Re: [PATCH kvm-unit-tests] x86: Test illegal movbe

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 14:48, Nadav Amit wrote: > Previously KVM ignored the mod field of MOVBE instruction, so MOVBE from > register to register succeeds, although it should fail (cause a #UD > exception). > This test check that a #UD is indeed delivered upon such MOVBE. > > The test would not work if

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 14:53, Radim Krčmář wrote: >>> > > get_xsave = native_xrstor(guest_xsave); xsave(aligned_userspace_buffer) >>> > > set_xsave = xrstor(aligned_userspace_buffer); native_xsave(guest_xsave) >>> > > >>> > > Could that work? >> > >> > It could, though it is more like >> > >> >ge

With '-cpu host' in L1 nested guest fails: "KVM: entry failed, hardware error 0x7"

2014-11-26 Thread Kashyap Chamarthy
Hi, This error occurs when using using '-cpu host'. And, is consistently reproducible with Fedora 21's Kernels. One way to reproduce the issue -- a) Enable nested virt on host, I use this procedure[1] b) Boot a a guest (ensure /dev/kvm character device shows up)

Re: [PATCH v4 25/42] vhost: add memory access wrappers

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 02:54:38PM +0100, Cornelia Huck wrote: > On Tue, 25 Nov 2014 18:43:10 +0200 > "Michael S. Tsirkin" wrote: > > "These wrappers are needed to handle virtio endianness conversions." > > ? yes, it's same as virtio ones. I'll add this text, thanks. > > Signed-off-by: Michael

Re: Another Obsolete Fix me in trace.h?

2014-11-26 Thread Steven Rostedt
On Wed, 26 Nov 2014 13:40:26 +0100 Radim Krčmář wrote: > 2014-11-24 22:49+0100, Radim Krčmář: > > 2014-11-24 16:19-0500, Steven Rostedt: > > > That wouldn't be too hard to implement. > > > > I'll look at the patch tommorrow. > > The kernel part is trivial. > Most of the code is going to be in t

Re: [PATCH v4 25/42] vhost: add memory access wrappers

2014-11-26 Thread Cornelia Huck
On Wed, 26 Nov 2014 16:05:39 +0200 "Michael S. Tsirkin" wrote: > On Wed, Nov 26, 2014 at 02:54:38PM +0100, Cornelia Huck wrote: > > On Tue, 25 Nov 2014 18:43:10 +0200 > > "Michael S. Tsirkin" wrote: > > > @@ -174,6 +174,37 @@ enum { > > > > > > static inline int vhost_has_feature(struct vhost

Re: [PATCH 1/7] KVM: add commentary for kvm_debug_exit_arch struct

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:09:59PM +, Alex Bennée wrote: > Bring into line with the commentary for the other structures and their > KVM_EXIT_* cases. > > Signed-off-by: Alex Bennée > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h > index 6076882..523f476 100644 > --- a/in

Re: [PATCH v4 25/42] vhost: add memory access wrappers

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 03:17:50PM +0100, Cornelia Huck wrote: > On Wed, 26 Nov 2014 16:05:39 +0200 > "Michael S. Tsirkin" wrote: > > > On Wed, Nov 26, 2014 at 02:54:38PM +0100, Cornelia Huck wrote: > > > On Tue, 25 Nov 2014 18:43:10 +0200 > > > "Michael S. Tsirkin" wrote: > > > > > @@ -174,6 +

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:00PM +, Alex Bennée wrote: > This commit defines the API headers for guest debugging. There are two > architecture specific debug structures: > > - kvm_guest_debug_arch, allows us to pass in HW debug registers > - kvm_debug_exit_arch, signals the exact debug e

Re: [PATCH v4 26/42] vhost/net: force len for TX to host endian

2014-11-26 Thread Cornelia Huck
On Tue, 25 Nov 2014 18:43:14 +0200 "Michael S. Tsirkin" wrote: > We use native endian-ness internally but never > expose it to guest. > > Signed-off-by: Michael S. Tsirkin > --- > drivers/vhost/net.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/v

Re: [PATCH 3/7] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:01PM +, Alex Bennée wrote: > This commit adds a stub function to support the KVM_SET_GUEST_DEBUG > ioctl. Currently any operation flag will return EINVAL. Actual > functionality will be added with further patches. Technically the stub is already there, and you're

Re: [PATCH v4 26/42] vhost/net: force len for TX to host endian

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 03:31:02PM +0100, Cornelia Huck wrote: > On Tue, 25 Nov 2014 18:43:14 +0200 > "Michael S. Tsirkin" wrote: > > > We use native endian-ness internally but never > > expose it to guest. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > drivers/vhost/net.c | 10 +---

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Radim Krčmář
2014-11-26 14:57+0100, Paolo Bonzini: > > > On 26/11/2014 14:53, Radim Krčmář wrote: > >>> > > get_xsave = native_xrstor(guest_xsave); > >>> > > xsave(aligned_userspace_buffer) > >>> > > set_xsave = xrstor(aligned_userspace_buffer); > >>> > > native_xsave(guest_xsave) > >>> > > > >>> > > Cou

Re: Another Obsolete Fix me in trace.h?

2014-11-26 Thread Radim Krčmář
2014-11-26 09:15-0500, Steven Rostedt: > On Wed, 26 Nov 2014 13:40:26 +0100 > Radim Krčmář wrote: > > The kernel part is trivial. > > Most of the code is going to be in tools/lib/traceevent/event-parse.c. > > > > I wasn't sure whether to > > 1) define new 'enum print_arg_type' for our function an

Re: [PATCH v4 26/42] vhost/net: force len for TX to host endian

2014-11-26 Thread Cornelia Huck
On Wed, 26 Nov 2014 16:44:00 +0200 "Michael S. Tsirkin" wrote: > On Wed, Nov 26, 2014 at 03:31:02PM +0100, Cornelia Huck wrote: > > On Tue, 25 Nov 2014 18:43:14 +0200 > > "Michael S. Tsirkin" wrote: > > > > > We use native endian-ness internally but never > > > expose it to guest. > > > > > >

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
Andrew Jones writes: > On Tue, Nov 25, 2014 at 04:10:00PM +, Alex Bennée wrote: >> This commit defines the API headers for guest debugging. There are two >> architecture specific debug structures: >> +/* Architecture related debug defines - upper 16 bits of >> + * kvm_guest_debug->control >

Re: [PATCH v4 26/42] vhost/net: force len for TX to host endian

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 03:54:40PM +0100, Cornelia Huck wrote: > On Wed, 26 Nov 2014 16:44:00 +0200 > "Michael S. Tsirkin" wrote: > > > On Wed, Nov 26, 2014 at 03:31:02PM +0100, Cornelia Huck wrote: > > > On Tue, 25 Nov 2014 18:43:14 +0200 > > > "Michael S. Tsirkin" wrote: > > > > > > > We use

Re: [PATCH 3/7] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2014-11-26 Thread Alex Bennée
Andrew Jones writes: > On Tue, Nov 25, 2014 at 04:10:01PM +, Alex Bennée wrote: >> This commit adds a stub function to support the KVM_SET_GUEST_DEBUG >> ioctl. Currently any operation flag will return EINVAL. Actual >> functionality will be added with further patches. > > Technically the st

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
Peter Maydell writes: > On 25 November 2014 at 16:10, Alex Bennée wrote: >> +/* Exit types which define why we did a debug exit */ >> +#define KVM_DEBUG_EXIT_ERROR 0x0 >> +#define KVM_DEBUG_EXIT_SINGLE_STEP 0x1 >> +#define KVM_DEBUG_EXIT_SW_BKPT 0x2 >> +#define KVM_DEBUG_E

[PATCH] KVM: x86: Fix reserved x2apic registers

2014-11-26 Thread Nadav Amit
x2APIC has no registers for DFR and ICR (see Intel SDM 10.12.1.2 "x2APIC Register Address Space"). KVM needs to cause #GP on such accesses. Fix it. Signed-off-by: Nadav Amit --- arch/x86/kvm/lapic.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/la

Re: Another Obsolete Fix me in trace.h?

2014-11-26 Thread Steven Rostedt
On Wed, 26 Nov 2014 15:49:34 +0100 Radim Krčmář wrote: > (It just seemed weird that we have an infrastructure that could allow a > "generic plugin" to cover this functionality.) Maybe in the future we may do something like that. But for now, think of these as "optimized" ;-) -- Steve -- To u

Re: [PATCH] KVM: x86: Fix reserved x2apic registers

2014-11-26 Thread Nadav Amit
The commit message has a typo - it should be “DFR and ICR2”. I didn’t post a new version in order not to confuse. Nadav Nadav Amit wrote: > x2APIC has no registers for DFR and ICR (see Intel SDM 10.12.1.2 "x2APIC > Register Address Space"). KVM needs to cause #GP on such accesses. > > Fix it.

Re: [PATCH] KVM: x86: Fix reserved x2apic registers

2014-11-26 Thread Radim Krčmář
2014-11-26 17:11+0200, Nadav Amit: > x2APIC has no registers for DFR and ICR (see Intel SDM 10.12.1.2 "x2APIC > Register Address Space"). KVM needs to cause #GP on such accesses. We should to take care of write to ICR2 as well. > Fix it. > > Signed-off-by: Nadav Amit > --- > arch/x86/kvm/lapic

[PATCH v2] KVM: x86: Fix reserved x2apic registers

2014-11-26 Thread Nadav Amit
x2APIC has no registers for DFR and ICR2 (see Intel SDM 10.12.1.2 "x2APIC Register Address Space"). KVM needs to cause #GP on such accesses. Fix it (DFR and ICR2 on read, ICR2 on write, DFR already handled on writes). Signed-off-by: Nadav Amit --- v1->v2: Cause #GP on ICR2 write access (as Radi

Re: [PATCH v2] KVM: x86: Fix reserved x2apic registers

2014-11-26 Thread Radim Krčmář
2014-11-26 17:56+0200, Nadav Amit: > x2APIC has no registers for DFR and ICR2 (see Intel SDM 10.12.1.2 "x2APIC > Register Address Space"). KVM needs to cause #GP on such accesses. > > Fix it (DFR and ICR2 on read, ICR2 on write, DFR already handled on writes). > > Signed-off-by: Nadav Amit > >

[PATCH] KVM: x86: use MSR_ICR instead of a number

2014-11-26 Thread Radim Krčmář
0x830 MSR is 0x300 xAPIC MMIO, which is MSR_ICR. Signed-off-by: Radim Krčmář --- This applies on top of Amit's [PATCH v2] KVM: x86: Fix reserved x2apic registers in which I noticed this minor deficit. arch/x86/kvm/lapic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

Re: [PATCH 4/7] KVM: arm64: guest debug, add SW break point support

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:02PM +, Alex Bennée wrote: > This adds support for SW breakpoints inserted by userspace. > > First we need to trap all BKPT exceptions in the hypervisor (ELS). This > in controlled through the MDCR_EL2 register. I've added a new field to > the vcpu structure to ho

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 15:42, Radim Krčmář wrote: > 2014-11-26 14:57+0100, Paolo Bonzini: >> >> >> On 26/11/2014 14:53, Radim Krčmář wrote: >>> get_xsave = native_xrstor(guest_xsave); xsave(aligned_userspace_buffer) >>> set_xsave = xrstor(aligned_userspace_buffer); native_xsave(guest_xsave)

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:03PM +, Alex Bennée wrote: > This adds support for single-stepping the guest. As userspace can and > will manipulate guest registers before restarting any tweaking of the > registers has to occur just before control is passed back to the guest. > Furthermore while

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 15:58, Alex Bennée wrote: > > Andrew Jones writes: > >> On Tue, Nov 25, 2014 at 04:10:00PM +, Alex Bennée wrote: >>> This commit defines the API headers for guest debugging. There are two >>> architecture specific debug structures: > >>> +/* Architecture related debug define

Re: [PATCH 6/7] KVM: arm64: re-factor hyp.S debug register code

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:04PM +, Alex Bennée wrote: > This is a pre-cursor to sharing the code with the guest debug support. > This replaces the big macro that fishes data out of a fixed location > with a more general helper macro to restore a set of debug registers. It > uses macro substi

Re: [RFC PATCH 4/5] ARM: enable linking against eventfd and irqchip

2014-11-26 Thread Eric Auger
On 11/24/2014 10:27 PM, Nikolay Nikolaev wrote: > This enables compilation of the eventfd feature on ARM. Hi Nikolay, why irqchip in the title? Best Regards Eric > > Signed-off-by: Nikolay Nikolaev > --- > arch/arm/kvm/Kconfig |1 + > arch/arm/kvm/Makefile |2 +- > 2 files changed, 2

Re: [PATCH 14/21] KVM: x86: Software disabled APIC should still deliver NMIs

2014-11-26 Thread Nadav Amit
Paolo Bonzini wrote: > > > On 06/11/2014 17:45, Radim Krčmář wrote: >> 2014-11-06 10:34+0100, Paolo Bonzini: >>> On 05/11/2014 21:45, Nadav Amit wrote: If I understand the SDM correctly, in such scenario (all APICs are software disabled) the mode is left as the default - flat mode (se

Re: [RFC PATCH 1/5] KVM: redesing kvm_io_bus_ API to pass VCPU structure to the callbacks.

2014-11-26 Thread Eric Auger
Hi Nikolay, typo in the title, On 11/24/2014 10:26 PM, Nikolay Nikolaev wrote: > This is needed in e.g. ARM vGIC emulation, where the MMIO handling > depends on the VCPU that does the access. > > Signed-off-by: Nikolay Nikolaev > --- > arch/ia64/kvm/kvm-ia64.c |4 ++-- > arch/powerpc/kvm

Re: [PATCH 4/7] KVM: arm64: guest debug, add SW break point support

2014-11-26 Thread Peter Maydell
On 26 November 2014 at 16:07, Andrew Jones wrote: > There appears to be a typo in the ARM ARM. Subsection "Software > Breakpoint Instruction exception" of D1.10.4 says BRK (ESR_EL2_EC_BRK64) > is 0x39, but the table above that has it correctly as 0x3c. Thanks for pointing out this typo -- I've re

[PATCH RFC v3 12/12] s390x/virtio-ccw: enable virtio 1.0

2014-11-26 Thread Cornelia Huck
virtio-ccw should now have everything in place to operate virtio 1.0 devices, so let's enable revision 1. Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 03d5955..08e

[PATCH RFC v3 11/12] virtio-net/virtio-blk: enable virtio 1.0

2014-11-26 Thread Cornelia Huck
virtio-net (non-vhost) and virtio-blk have everything in place to support virtio 1.0: let's enable the feature bit for them. Note that VIRTIO_F_VERSION_1 is technically a transport feature; once every device is ready for virtio 1.0, we can move this setting this feature bit out of the individual d

[PATCH RFC v3 10/12] s390x/virtio-ccw: support virtio-1 set_vq format

2014-11-26 Thread Cornelia Huck
Support the new CCW_CMD_SET_VQ format for virtio-1 devices. While we're at it, refactor the code a bit and enforce big endian fields (which had always been required, even for legacy). Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 114 +++

[PATCH RFC v3 07/12] dataplane: allow virtio-1 devices

2014-11-26 Thread Cornelia Huck
Handle endianness conversion for virtio-1 virtqueues correctly. Note that dataplane now needs to be built per-target. Signed-off-by: Cornelia Huck --- hw/block/dataplane/virtio-blk.c |4 +- hw/scsi/virtio-scsi-dataplane.c |2 +- hw/virtio/Makefile.objs

[PATCH RFC v3 06/12] virtio: allow virtio-1 queue layout

2014-11-26 Thread Cornelia Huck
For virtio-1 devices, we allow a more complex queue layout that doesn't require descriptor table and rings on a physically-contigous memory area: add virtio_queue_set_rings() to allow transports to set this up. Signed-off-by: Cornelia Huck --- hw/virtio/virtio.c | 16

[PATCH RFC v3 09/12] s390x/virtio-ccw: add virtio set-revision call

2014-11-26 Thread Cornelia Huck
From: Thomas Huth Handle the virtio-ccw revision according to what the guest sets. When revision 1 is selected, we have a virtio-1 standard device with byteswapping for the virtio rings. When a channel gets disabled, we have to revert to the legacy behavior in case the next user of the device do

[PATCH RFC v3 02/12] virtio: cull virtio_bus_set_vdev_features

2014-11-26 Thread Cornelia Huck
The only user of this function was virtio-ccw, and it should use virtio_set_features() like everybody else: We need to make sure that bad features are masked out properly, which this function did not do. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c |

[PATCH RFC v3 08/12] s390x/css: Add a callback for when subchannel gets disabled

2014-11-26 Thread Cornelia Huck
From: Thomas Huth We need a possibility to run code when a subchannel gets disabled. This patch adds the necessary infrastructure. Signed-off-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 12 hw/s390x/css.h |1 + 2 files changed, 13 insertions(+) diff -

[PATCH RFC v3 05/12] virtio: introduce legacy virtio devices

2014-11-26 Thread Cornelia Huck
Introduce a helper function to indicate whether a virtio device is operating in legacy or virtio standard mode. It may be used to make decisions about the endianess of virtio accesses and other virtio-1 specific changes, enabling us to support transitional devices. Reviewed-by: Thomas Huth Sign

[PATCH RFC v3 04/12] s390x/virtio-ccw: fix check for WRITE_FEAT

2014-11-26 Thread Cornelia Huck
We need to check guest feature size, not host feature size to find out whether we should call virtio_set_features(). This check is possible now that vdev->guest_features is an array. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c |2 +- 1 file changed, 1 ins

[PATCH RFC v3 00/12] qemu: towards virtio-1 host support

2014-11-26 Thread Cornelia Huck
Next version of virtio-1 patches for qemu. Only change from v2 is splitting out the vring accessors into a separate header file - should hopefully fix the build issues. Cornelia Huck (9): virtio: cull virtio_bus_set_vdev_features virtio: support more feature bits s390x/virtio-ccw: fix check

[PATCH RFC v3 01/12] linux-headers/virtio_config: Update with VIRTIO_F_VERSION_1

2014-11-26 Thread Cornelia Huck
From: Thomas Huth Add the new VIRTIO_F_VERSION_1 definition to the virtio_config.h linux header. Signed-off-by: Thomas Huth Signed-off-by: Cornelia Huck --- linux-headers/linux/virtio_config.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/virtio_config.h b/lin

[PATCH RFC v3 03/12] virtio: support more feature bits

2014-11-26 Thread Cornelia Huck
With virtio-1, we support more than 32 feature bits. Let's make vdev->guest_features depend on the number of supported feature bits, allowing us to grow the feature bits automatically. We also need to enhance the internal functions dealing with getting and setting features with an additional index

Re: [CFT PATCH v2 2/2] KVM: x86: support XSAVES usage in the host

2014-11-26 Thread Radim Krčmář
2014-11-26 17:26+0100, Paolo Bonzini: > On 26/11/2014 15:42, Radim Krčmář wrote: > >> I'm not sure what is more future proof. :) I wonder if native_xrstor > >> could be a problem the day XRSTORS actually sets/restores MSRs as the > >> processor documentation promises. > > > > XRSTORS won't affect

Re: [PATCH 7/7] KVM: arm64: guest debug, HW assisted debug support

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:05PM +, Alex Bennée wrote: > This adds support for userspace to control the HW debug registers for > guest debug. We'll only copy the $ARCH defined number across as that's > all that hyp.S will use anyway. I've moved some helper functions into > the hw_breakpoint.h

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Andrew Jones
On Wed, Nov 26, 2014 at 05:46:05PM +0100, Paolo Bonzini wrote: > > > On 26/11/2014 15:58, Alex Bennée wrote: > > > > Andrew Jones writes: > > > >> On Tue, Nov 25, 2014 at 04:10:00PM +, Alex Bennée wrote: > >>> This commit defines the API headers for guest debugging. There are two > >>> arc

Re: [PATCH 14/21] KVM: x86: Software disabled APIC should still deliver NMIs

2014-11-26 Thread Paolo Bonzini
On 26/11/2014 18:01, Nadav Amit wrote: > Paolo Bonzini wrote: > >> >> >> On 06/11/2014 17:45, Radim Krčmář wrote: >>> 2014-11-06 10:34+0100, Paolo Bonzini: On 05/11/2014 21:45, Nadav Amit wrote: > If I understand the SDM correctly, in such scenario (all APICs are > software disable

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-11-26 Thread Alex Bennée
Andrew Jones writes: > On Tue, Nov 25, 2014 at 04:10:03PM +, Alex Bennée wrote: >> This adds support for single-stepping the guest. As userspace can and >> will manipulate guest registers before restarting any tweaking of the >> registers has to occur just before control is passed back to th

Re: [PATCH RFC v3 07/12] dataplane: allow virtio-1 devices

2014-11-26 Thread Greg Kurz
On Wed, 26 Nov 2014 18:28:38 +0100 Cornelia Huck wrote: > Handle endianness conversion for virtio-1 virtqueues correctly. > > Note that dataplane now needs to be built per-target. > > Signed-off-by: Cornelia Huck Build is ok now. Acked-by: Greg Kurz > --- > hw/block/dataplane/virtio-blk.c

Re: [Qemu-devel] [PATCH RFC v3 05/12] virtio: introduce legacy virtio devices

2014-11-26 Thread Greg Kurz
On Wed, 26 Nov 2014 18:28:36 +0100 Cornelia Huck wrote: > Introduce a helper function to indicate whether a virtio device is > operating in legacy or virtio standard mode. > > It may be used to make decisions about the endianess of virtio accesses > and other virtio-1 specific changes, enabling

Re: [PATCH RFC v3 11/12] virtio-net/virtio-blk: enable virtio 1.0

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 06:28:42PM +0100, Cornelia Huck wrote: > virtio-net (non-vhost) and virtio-blk have everything in place to support > virtio 1.0: let's enable the feature bit for them. Hmm I doubt that. At least not without more patches. For block, scsi, wce and config-wce must be off, and

Re: [Qemu-devel] [PATCH RFC v3 05/12] virtio: introduce legacy virtio devices

2014-11-26 Thread Michael S. Tsirkin
On Wed, Nov 26, 2014 at 07:46:38PM +0100, Greg Kurz wrote: > On Wed, 26 Nov 2014 18:28:36 +0100 > Cornelia Huck wrote: > > > Introduce a helper function to indicate whether a virtio device is > > operating in legacy or virtio standard mode. > > > > It may be used to make decisions about the end

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-11-26 Thread Peter Maydell
On 25 November 2014 at 16:10, Alex Bennée wrote: > This adds support for single-stepping the guest. As userspace can and > will manipulate guest registers before restarting any tweaking of the > registers has to occur just before control is passed back to the guest. > Furthermore while guest debug

[PATCH kvm-unit-tests v2] x86: Test illegal movbe

2014-11-26 Thread Nadav Amit
Previously KVM ignored the mod field of MOVBE instruction, so MOVBE from register to register succeeds, although it should fail (cause a #UD exception). This test check that a #UD is indeed delivered upon such MOVBE. The test would not work if MOVBE is unsupported. Signed-off-by: Nadav Amit ---

[PATCH] xen: privcmd: schedule() after private hypercall when non CONFIG_PREEMPT

2014-11-26 Thread Luis R. Rodriguez
From: "Luis R. Rodriguez" Some folks had reported that some xen hypercalls take a long time to complete when issued from the userspace private ioctl mechanism, this can happen for instance with some hypercalls that have many sub-operations, this can happen for instance on hypercalls that use mult

Re: [PATCH 3/3] KVM: PPC: BOOK3S: HV: Rename variable for better readability

2014-11-26 Thread Paul Mackerras
On Mon, Oct 20, 2014 at 07:59:00PM +0530, Aneesh Kumar K.V wrote: > Minor cleanup > > Signed-off-by: Aneesh Kumar K.V > --- > arch/powerpc/kvm/book3s_hv_rm_mmu.c | 25 + > 1 file changed, 13 insertions(+), 12 deletions(-) > > diff --git a/arch/powerpc/kvm/book3s_hv_rm_mm

[question] what is virtio-1 device?

2014-11-26 Thread Zhang Haoyu
Hi, what is virtio-1 device? Thanks, Zhang Haoyu -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [question] what is virtio-1 device?

2014-11-26 Thread Chen, Tiejun
On 2014/11/27 9:26, Zhang Haoyu wrote: Hi, what is virtio-1 device? Are you mean subsystem device id is '1'? That should be a network card. Tiejun -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at ht

Re: [question] what is virtio-1 device?

2014-11-26 Thread Zhang Haoyu
>> Hi, >> what is virtio-1 device? >> > >Are you mean subsystem device id is '1'? That should be a network card. > In the mail "qemu: towards virtio-1 host support", "virtio: allow virtio-1 queue layout", "dataplane: allow virtio-1 devices", etc., "virtio-1 devices" was mentioned, I don't know whi

Re: [question] what is virtio-1 device?

2014-11-26 Thread Chen, Tiejun
On 2014/11/27 9:46, Zhang Haoyu wrote: Hi, what is virtio-1 device? Are you mean subsystem device id is '1'? That should be a network card. In the mail "qemu: towards virtio-1 host support", "virtio: allow virtio-1 queue layout", "dataplane: allow virtio-1 devices", etc., "virtio-1 devices"

Re: [question] what is virtio-1 device?

2014-11-26 Thread Zhang Haoyu
Hi, what is virtio-1 device? >>> >>> Are you mean subsystem device id is '1'? That should be a network card. >>> >> In the mail "qemu: towards virtio-1 host support", "virtio: allow virtio-1 >> queue layout", >> "dataplane: allow virtio-1 devices", etc., "virtio-1 devices" was menti

Re: [PATCH] xen: privcmd: schedule() after private hypercall when non CONFIG_PREEMPT

2014-11-26 Thread Juergen Gross
On 11/26/2014 11:26 PM, Luis R. Rodriguez wrote: From: "Luis R. Rodriguez" Some folks had reported that some xen hypercalls take a long time to complete when issued from the userspace private ioctl mechanism, this can happen for instance with some hypercalls that have many sub-operations, this

[PATCH net-next] vhost: remove unnecessary forward declarations in vhost.h

2014-11-26 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/vhost.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 3eda654..7d039ef 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -12,8 +12,6 @@ #include #include -struct vhost_de

RE: [question] lots of interrupts injected to vm when pressing some key w/o releasing

2014-11-26 Thread Zhang Haoyu
>> I tested win-server-2008 with "-cpu >> core2duo,hv_spinlocks=0x,hv_relaxed,hv_time", >> this problem still happened, about 200,000 vmexits per-second, >> bringing very bad experience, just like being stuck. > > Please upload a full trace somewhere, or at least the