Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-23 Thread Wanpeng Li
2016-04-22 21:07 GMT+08:00 Radim Krčmář : > 2016-04-22 09:40+0800, Wanpeng Li: >> 2016-04-21 23:29 GMT+08:00 Radim Krčmář : >>> x86 vcpu_id encodes APIC ID and APIC ID encodes CPU topology by >>> reserving blocks of bits for socket/core/thread, so if core or

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-23 Thread Wanpeng Li
2016-04-22 21:07 GMT+08:00 Radim Krčmář : > 2016-04-22 09:40+0800, Wanpeng Li: >> 2016-04-21 23:29 GMT+08:00 Radim Krčmář : >>> x86 vcpu_id encodes APIC ID and APIC ID encodes CPU topology by >>> reserving blocks of bits for socket/core/thread, so if core or thread >>> count isn't a power of two,

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-22 Thread Radim Krčmář
2016-04-22 09:40+0800, Wanpeng Li: > 2016-04-21 23:29 GMT+08:00 Radim Krčmář : >> x86 vcpu_id encodes APIC ID and APIC ID encodes CPU topology by >> reserving blocks of bits for socket/core/thread, so if core or thread >> count isn't a power of two, then the set of valid APIC

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-22 Thread Radim Krčmář
2016-04-22 09:40+0800, Wanpeng Li: > 2016-04-21 23:29 GMT+08:00 Radim Krčmář : >> x86 vcpu_id encodes APIC ID and APIC ID encodes CPU topology by >> reserving blocks of bits for socket/core/thread, so if core or thread >> count isn't a power of two, then the set of valid APIC IDs is sparse, > >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Wanpeng Li
2016-04-21 23:29 GMT+08:00 Radim Krčmář : > 2016-04-21 13:29+0200, Greg Kurz: >> On Wed, 20 Apr 2016 20:29:09 +0200 >> Radim Krčmář wrote: >>> 2016-04-20 17:44+0200, Greg Kurz: >>> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)")

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Wanpeng Li
2016-04-21 23:29 GMT+08:00 Radim Krčmář : > 2016-04-21 13:29+0200, Greg Kurz: >> On Wed, 20 Apr 2016 20:29:09 +0200 >> Radim Krčmář wrote: >>> 2016-04-20 17:44+0200, Greg Kurz: >>> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") >>> > introduced a check to prevent

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 19:39:31 +0200 Radim Krčmář wrote: > 2016-04-21 19:18+0200, Greg Kurz: > > On Thu, 21 Apr 2016 18:08:41 +0200 > > Radim Krčmář wrote: > >> 2016-04-21 17:49+0200, Greg Kurz: > >> > So we're good ? > >> > >> I support the

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 19:39:31 +0200 Radim Krčmář wrote: > 2016-04-21 19:18+0200, Greg Kurz: > > On Thu, 21 Apr 2016 18:08:41 +0200 > > Radim Krčmář wrote: > >> 2016-04-21 17:49+0200, Greg Kurz: > >> > So we're good ? > >> > >> I support the change, just had a nit about API design for

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 19:18+0200, Greg Kurz: > On Thu, 21 Apr 2016 18:08:41 +0200 > Radim Krčmář wrote: >> 2016-04-21 17:49+0200, Greg Kurz: >> > So we're good ? >> >> I support the change, just had a nit about API design for v2. >> > > As I said in my other mail, I'm not sure we

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 19:18+0200, Greg Kurz: > On Thu, 21 Apr 2016 18:08:41 +0200 > Radim Krčmář wrote: >> 2016-04-21 17:49+0200, Greg Kurz: >> > So we're good ? >> >> I support the change, just had a nit about API design for v2. >> > > As I said in my other mail, I'm not sure we should do more... if >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 18:08:41 +0200 Radim Krčmář wrote: > 2016-04-21 17:49+0200, Greg Kurz: > > So we're good ? > > I support the change, just had a nit about API design for v2. > As I said in my other mail, I'm not sure we should do more... if that's okay for you and you

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 18:08:41 +0200 Radim Krčmář wrote: > 2016-04-21 17:49+0200, Greg Kurz: > > So we're good ? > > I support the change, just had a nit about API design for v2. > As I said in my other mail, I'm not sure we should do more... if that's okay for you and you still support the

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 17:49+0200, Greg Kurz: > So we're good ? I support the change, just had a nit about API design for v2. > Whose tree can carry these patches ? (PowerPC is the only immediately affected arch, so I'd it there.) What do you think is best? My experience in this regard is

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 17:49+0200, Greg Kurz: > So we're good ? I support the change, just had a nit about API design for v2. > Whose tree can carry these patches ? (PowerPC is the only immediately affected arch, so I'd it there.) What do you think is best? My experience in this regard is

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 17:29:16 +0200 Radim Krčmář wrote: > 2016-04-21 13:29+0200, Greg Kurz: > > On Wed, 20 Apr 2016 20:29:09 +0200 > > Radim Krčmář wrote: > >> 2016-04-20 17:44+0200, Greg Kurz: > >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 17:29:16 +0200 Radim Krčmář wrote: > 2016-04-21 13:29+0200, Greg Kurz: > > On Wed, 20 Apr 2016 20:29:09 +0200 > > Radim Krčmář wrote: > >> 2016-04-20 17:44+0200, Greg Kurz: > >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter > >> > (CVE-2013-4587)") > >> >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 13:29+0200, Greg Kurz: > On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: >> 2016-04-20 17:44+0200, Greg Kurz: >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") >> > introduced a check to prevent potential kernel memory

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Radim Krčmář
2016-04-21 13:29+0200, Greg Kurz: > On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: >> 2016-04-20 17:44+0200, Greg Kurz: >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") >> > introduced a check to prevent potential kernel memory corruption in case >> > the

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread David Hildenbrand
> On Wed, 20 Apr 2016 17:44:54 +0200 > Greg Kurz wrote: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > > Unfortunately

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread David Hildenbrand
> On Wed, 20 Apr 2016 17:44:54 +0200 > Greg Kurz wrote: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > > Unfortunately this check assumes vcpu ids

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread David Hildenbrand
> On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: > > > 2016-04-20 17:44+0200, Greg Kurz: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > > introduced a check to prevent potential kernel memory corruption in case > > > the vcpu

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread David Hildenbrand
> On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: > > > 2016-04-20 17:44+0200, Greg Kurz: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > > introduced a check to prevent potential kernel memory corruption in case > > > the vcpu id is too great. > >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 14:26:19 +0200 Cornelia Huck wrote: > On Thu, 21 Apr 2016 13:29:58 +0200 > Greg Kurz wrote: > > > On Wed, 20 Apr 2016 20:29:09 +0200 > > Radim Krčmář wrote: > > > > > 2016-04-20 17:44+0200, Greg

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 14:26:19 +0200 Cornelia Huck wrote: > On Thu, 21 Apr 2016 13:29:58 +0200 > Greg Kurz wrote: > > > On Wed, 20 Apr 2016 20:29:09 +0200 > > Radim Krčmář wrote: > > > > > 2016-04-20 17:44+0200, Greg Kurz: > > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Cornelia Huck
On Thu, 21 Apr 2016 13:29:58 +0200 Greg Kurz wrote: > On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: > > > 2016-04-20 17:44+0200, Greg Kurz: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > > introduced

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Cornelia Huck
On Thu, 21 Apr 2016 13:29:58 +0200 Greg Kurz wrote: > On Wed, 20 Apr 2016 20:29:09 +0200 > Radim Krčmář wrote: > > > 2016-04-20 17:44+0200, Greg Kurz: > > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > > introduced a check to prevent potential kernel memory

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Wed, 20 Apr 2016 20:29:09 +0200 Radim Krčmář wrote: > 2016-04-20 17:44+0200, Greg Kurz: > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great.

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-21 Thread Greg Kurz
On Wed, 20 Apr 2016 20:29:09 +0200 Radim Krčmář wrote: > 2016-04-20 17:44+0200, Greg Kurz: > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 19:53+0200, Greg Kurz: > On Wed, 20 Apr 2016 19:27:06 +0200 > Radim Krčmář wrote: >> 2016-04-20 18:09+0100, James Hogan: >> > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: >> >> 2016-04-20 17:44+0200, Greg Kurz: >> >> > diff --git

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 19:53+0200, Greg Kurz: > On Wed, 20 Apr 2016 19:27:06 +0200 > Radim Krčmář wrote: >> 2016-04-20 18:09+0100, James Hogan: >> > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: >> >> 2016-04-20 17:44+0200, Greg Kurz: >> >> > diff --git a/arch/mips/kvm/mips.c

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 17:44+0200, Greg Kurz: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence with a common >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 17:44+0200, Greg Kurz: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence with a common >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Greg Kurz
On Wed, 20 Apr 2016 19:27:06 +0200 Radim Krčmář wrote: > 2016-04-20 18:09+0100, James Hogan: > > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: > >> 2016-04-20 17:44+0200, Greg Kurz: > >> > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > >> >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Greg Kurz
On Wed, 20 Apr 2016 19:27:06 +0200 Radim Krčmář wrote: > 2016-04-20 18:09+0100, James Hogan: > > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: > >> 2016-04-20 17:44+0200, Greg Kurz: > >> > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c > >> > index

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 18:09+0100, James Hogan: > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: >> 2016-04-20 17:44+0200, Greg Kurz: >> > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c >> > index 70ef1a43c114..0278ea146db5 100644 >> > --- a/arch/mips/kvm/mips.c >> > +++

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 18:09+0100, James Hogan: > On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: >> 2016-04-20 17:44+0200, Greg Kurz: >> > diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c >> > index 70ef1a43c114..0278ea146db5 100644 >> > --- a/arch/mips/kvm/mips.c >> > +++

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread James Hogan
On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: > 2016-04-20 17:44+0200, Greg Kurz: > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread James Hogan
On Wed, Apr 20, 2016 at 07:02:10PM +0200, Radim Krčmář wrote: > 2016-04-20 17:44+0200, Greg Kurz: > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 17:44+0200, Greg Kurz: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence with a common >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Radim Krčmář
2016-04-20 17:44+0200, Greg Kurz: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence with a common >

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Cornelia Huck
On Wed, 20 Apr 2016 17:44:54 +0200 Greg Kurz wrote: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Cornelia Huck
On Wed, 20 Apr 2016 17:44:54 +0200 Greg Kurz wrote: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread James Hogan
On Wed, Apr 20, 2016 at 05:44:54PM +0200, Greg Kurz wrote: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in

Re: [PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread James Hogan
On Wed, Apr 20, 2016 at 05:44:54PM +0200, Greg Kurz wrote: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in

[PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Greg Kurz
Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") introduced a check to prevent potential kernel memory corruption in case the vcpu id is too great. Unfortunately this check assumes vcpu ids grow in sequence with a common difference of 1, which is wrong: archs are free to

[PATCH v3] KVM: remove buggy vcpu id check on vcpu creation

2016-04-20 Thread Greg Kurz
Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") introduced a check to prevent potential kernel memory corruption in case the vcpu id is too great. Unfortunately this check assumes vcpu ids grow in sequence with a common difference of 1, which is wrong: archs are free to