[PATCH] Restore cr3 after tests on PCID

2012-09-01 Thread Mao, Junjie
The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register, which leads to a failure when INVPCID test tries to enable PCIDE. This patch restores cr3 after PCID enabling test is done so that PCIDE can

[PATCH] KVM: x86: Check INVPCID feature bit in EBX of leaf 7

2012-09-01 Thread Mao, Junjie
Checks and operations on the INVPCID feature bit should use EBX of CPUID leaf 7 instead of ECX. Signed-off-by: Junjie Mao --- arch/x86/kvm/vmx.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c00f03d..002b4a5 100644 --- a

FW: [PATCH kvm-unit-tests RESEND] Restore cr3 after tests on PCID

2012-09-01 Thread Mao, Junjie
The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register, which leads to a failure when INVPCID test tries to enable PCIDE. This patch restores cr3 after PCID enabling test is done so that PCIDE can

Re: [RFC 1/5] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code.

2012-09-01 Thread Avi Kivity
On 08/28/2012 04:45 PM, Rusty Russell wrote: > Avi has indicated that this is the future. For now, make it dependent on > KVM_HAVE_ONE_REG (and define that for PPC and S/390). I want GET_MULTI, really. But maybe iterating over ONE_REG isn't so bad since we do it so rarely.: Would all register I

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Avi Kivity
On 08/29/2012 08:29 AM, Christoffer Dall wrote: > On Tue, Aug 28, 2012 at 4:48 PM, Rusty Russell > wrote: > > No structures at all any more. > > > > I fail to see the great benefit of all this. The code is certainly > not easier to read and it's certainly not more clear what is going on. > > Is

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Avi Kivity
On 08/29/2012 11:21 AM, Rusty Russell wrote: > >> + /* Coprocessor 0 means we want a core register. */ > >> + if ((u32)reg->id >> KVM_REG_ARM_COPROC_START == 0) > >> + return set_core_reg(vcpu, reg); > > > > ...but if we do go this path, you can't use coprocessor 0 > > to

Re: [Qemu-devel] [PATCH 4/4] kvm: i386: Add classic PCI device assignment

2012-09-01 Thread Blue Swirl
On Tue, Aug 28, 2012 at 9:51 PM, Anthony Liguori wrote: > Blue Swirl writes: > >> On Tue, Aug 28, 2012 at 7:31 PM, Anthony Liguori >> wrote: >>> Blue Swirl writes: >>> On Tue, Aug 28, 2012 at 5:28 PM, Michael S. Tsirkin wrote: > On Tue, Aug 28, 2012 at 05:01:55PM +, Blue Sw

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-01 Thread Avi Kivity
On 08/29/2012 11:39 AM, Rusty Russell wrote: > > > -4.76 KVM_VCPU_GET_MSR_INDEX_LIST > +4.76 KVM_VCPU_GET_REG_LIST > > -Capability: basic > +Capability: KVM_CAP_REG_LIST > Architectures: arm all > Type: vcpu ioctl > -Parameters: struct kvm_msr_list (in/out) > +Parameters: struct kvm_re

Re: [RFC 1/5] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code.

2012-09-01 Thread Peter Maydell
On 1 September 2012 10:11, Avi Kivity wrote: > Other x86 state: > Control registers: ok. Should userspace be careful to set registers > in legal ways only? i.e. cannot set cr3[0:11] if cr4.pae=0, or vice > versa, so need three writes? The principle I'm hoping we can hold to for ARM is that the

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Peter Maydell
On 1 September 2012 10:16, Avi Kivity wrote: > On 08/29/2012 11:21 AM, Rusty Russell wrote: >> >> + /* Coprocessor 0 means we want a core register. */ >> >> + if ((u32)reg->id >> KVM_REG_ARM_COPROC_START == 0) >> >> + return set_core_reg(vcpu, reg); >> > >> > ...but if we

Re: [RFC 1/5] KVM: Move KVM_SET_ONE_REG/KVM_GET_ONE_REG to generic code.

2012-09-01 Thread Avi Kivity
On 09/01/2012 03:18 AM, Peter Maydell wrote: > On 1 September 2012 10:11, Avi Kivity wrote: > > Other x86 state: > > Control registers: ok. Should userspace be careful to set registers > > in legal ways only? i.e. cannot set cr3[0:11] if cr4.pae=0, or vice > > versa, so need three writes? > > T

Re: [Bright Cluster Manager Support #2699] NFSoRDMA not working with KVM when cache disabled

2012-09-01 Thread Andrew Holway
Hi, That is FULL install (I think) I create a new virtual machine each time I test it. Ta, Andrew On Aug 31, 2012, at 11:20 PM, Martijn de Vries wrote: > Hi Andrew, > > That's pretty strange. I am not a KVM expert, so I don't know what happens > under the hood when you disable cache. Have y

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-01 Thread Rusty Russell
Rusty Russell writes: > Hi all, > > This compiles, completely untested, but it's my attempt to give > Avi (and Alexander) what he asked for in a generic register accessor. And here's the tested version: see my new "onereg-abi" branch. My next step is to demux CSELR, but that won't be unt

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-01 Thread Rusty Russell
Avi Kivity writes: >> -Capability: basic >> +Capability: KVM_CAP_REG_LIST >> Architectures: arm > > all OK, I guess that's to be true in future. Fixed. >> Type: vcpu ioctl >> -Parameters: struct kvm_msr_list (in/out) >> +Parameters: struct kvm_reg_list (in/out) >> Returns: 0 on success; -1 o

Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

2012-09-01 Thread Rusty Russell
Rusty Russell writes: > Rusty Russell writes: > >> Hi all, >> >> This compiles, completely untested, but it's my attempt to give >> Avi (and Alexander) what he asked for in a generic register accessor. > > And here's the tested version: see my new "onereg-abi" branch. > My next step is to

Re: [RFC 5/5] KVM: ARM: Access all registers via KVM_GET_ONE_REG/KVM_SET_ONE_REG.

2012-09-01 Thread Christoffer Dall
On Sep 1, 2012, at 6:25 AM, Peter Maydell wrote: > On 1 September 2012 10:16, Avi Kivity wrote: >> On 08/29/2012 11:21 AM, Rusty Russell wrote: > + /* Coprocessor 0 means we want a core register. */ > + if ((u32)reg->id >> KVM_REG_ARM_COPROC_START == 0) > +