[PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-17 Thread Sasha Levin
If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity Cc: Marcelo Tosatti Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Marcelo Tosatti
On Thu, Nov 17, 2011 at 12:18:44PM +0200, Sasha Levin wrote: > If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still > fail with -E2BIG due to wrong comparisons. > > Cc: Avi Kivity > Cc: Marcelo Tosatti > Signed-off-by: Sasha Levin > --- > arch/x86/kvm/x86.c | 12 ++--

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
On Thu, 2011-11-24 at 08:09 -0200, Marcelo Tosatti wrote: > On Thu, Nov 17, 2011 at 12:18:44PM +0200, Sasha Levin wrote: > > If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still > > fail with -E2BIG due to wrong comparisons. > > > > Cc: Avi Kivity > > Cc: Marcelo Tosatti > >

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 12:31 PM, Sasha Levin wrote: > > > > The protocol goes like "try size x, if it fails with -E2BIG, increase x, > > try again". Its awkward. > > We can set nent to be the amount of entries required like we do in the > opposite case where we passed too many entries. There's no point, s

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
On Thu, 2011-11-24 at 12:33 +0200, Avi Kivity wrote: > On 11/24/2011 12:31 PM, Sasha Levin wrote: > > > > > > The protocol goes like "try size x, if it fails with -E2BIG, increase x, > > > try again". Its awkward. > > > > We can set nent to be the amount of entries required like we do in the > > o

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 12:37 PM, Sasha Levin wrote: > On Thu, 2011-11-24 at 12:33 +0200, Avi Kivity wrote: > > On 11/24/2011 12:31 PM, Sasha Levin wrote: > > > > > > > > The protocol goes like "try size x, if it fails with -E2BIG, increase x, > > > > try again". Its awkward. > > > > > > We can set nent to