Bug 11254

Summary: KVM: fix userspace ABI breakage
Product: Virtualization Reporter: Adrian Bunk (bunk)
Component: kvmAssignee: virtualization_kvm
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.26-git Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 11167    

Description Adrian Bunk 2008-08-05 15:37:11 UTC
Subject         : KVM: fix userspace ABI breakage
Submitter       : Adrian Bunk <bunk@kernel.org>
Date            : 21 Jul 2008 17:58:26
References      : http://lkml.org/lkml/2008/7/21/197
Handled-By      : Adrian Bunk <bunk@kernel.org>
Patch           : http://lkml.org/lkml/2008/7/21/197
Comment 1 Rafael J. Wysocki 2008-08-10 05:51:19 UTC
On Sunday, 10 of August 2008, Adrian Bunk wrote:
> On Sun, Aug 10, 2008 at 12:43:51AM +0200, Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a report
> > of recent regressions.
> > 
> > The following bug entry is on the current list of known regressions
> > from 2.6.26.  Please verify if it still should be listed and let me know
> > (either way).
> 
> yes
> 
> > Bug-Entry   : http://bugzilla.kernel.org/show_bug.cgi?id=11254
> > Subject             : KVM: fix userspace ABI breakage
> > Submitter   : Adrian Bunk <bunk@kernel.org>
> > Date                : 21 Jul 2008 17:58:26 (0 days old)
> > References  : http://lkml.org/lkml/2008/7/21/197
> > Handled-By  : Adrian Bunk <bunk@kernel.org>
> > Patch               : http://lkml.org/lkml/2008/7/21/197
Comment 2 Rafael J. Wysocki 2008-08-17 12:13:01 UTC
On Sunday, 17 of August 2008, Adrian Bunk wrote:
> On Sat, Aug 16, 2008 at 09:02:49PM +0200, Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a report
> > of recent regressions.
> > 
> > The following bug entry is on the current list of known regressions
> > from 2.6.26.  Please verify if it still should be listed and let me know
> > (either way).
> 
> yes
> 
> > Bug-Entry   : http://bugzilla.kernel.org/show_bug.cgi?id=11254
> > Subject             : KVM: fix userspace ABI breakage
> > Submitter   : Adrian Bunk <bunk@kernel.org>
> > Date                : 21 Jul 2008 17:58:26 (0 days old)
> > References  : http://lkml.org/lkml/2008/7/21/197
> > Handled-By  : Adrian Bunk <bunk@kernel.org>
> > Patch               : http://lkml.org/lkml/2008/7/21/197
Comment 3 Avi Kivity 2008-08-18 03:26:26 UTC
Tracing is not part of the stable ABI (it is developer only at the 
moment; we expect to use LTT once that is merged).

The fix is correct, but I prefer to have variables aligned correctly.  
I'll come up with an alternative patch.
Comment 4 Adrian Bunk 2008-08-19 07:05:09 UTC
(In reply to comment #3)
> Tracing is not part of the stable ABI (it is developer only at the 
> moment; we expect to use LTT once that is merged).
>...

This struct is part of a userspace header.

That makes it part of the userspace ABI, which is stable.
Comment 5 Avi Kivity 2008-08-19 07:08:59 UTC
bugme-daemon@bugzilla.kernel.org wrote:
> This struct is part of a userspace header.
>
> That makes it part of the userspace ABI, which is stable.
>   

We can define a part of the ABI as experimental.  For example, the 
entire KVM ABI was experimental in 2.6.20 and 2.6.21 until it was 
finalized in 2.6.22.
Comment 6 Adrian Bunk 2008-08-19 07:23:56 UTC
(In reply to comment #5)
> bugme-daemon@bugzilla.kernel.org wrote:
> > This struct is part of a userspace header.
> >
> > That makes it part of the userspace ABI, which is stable.
> 
> We can define a part of the ABI as experimental.  For example, the 
> entire KVM ABI was experimental in 2.6.20 and 2.6.21 until it was 
> finalized in 2.6.22.

That's not how userspace ABIs of the kernel work, and if KVM did this in the past then that is not a good example to follow.

I'm currently using kernel 2.6.27-rc3, and my distribution shipped /usr/include/linux/kvm.h from kernel 2.6.26. The change of this struct would create a runtime breakage if I had a program using it.
Comment 7 Avi Kivity 2008-08-19 07:25:56 UTC
bugme-daemon@bugzilla.kernel.org wrote:
> I'm currently using kernel 2.6.27-rc3, and my distribution shipped
> /usr/include/linux/kvm.h from kernel 2.6.26. The change of this struct would
> create a runtime breakage if I had a program using it

You don't have a program using it.  And if you write one, you should 
expect it to break.

This is like parsing dmesg or relying on timing.
Comment 8 Adrian Bunk 2008-08-19 07:35:24 UTC
(In reply to comment #7)
> bugme-daemon@bugzilla.kernel.org wrote:
> > I'm currently using kernel 2.6.27-rc3, and my distribution shipped
> > /usr/include/linux/kvm.h from kernel 2.6.26. The change of this struct
> would
> > create a runtime breakage if I had a program using it
> 
> You don't have a program using it.  And if you write one, you should 
> expect it to break.
> 
> This is like parsing dmesg or relying on timing.

Our userspace headers are more stable than this.

Please ask Linus if he agrees that you can change the userspace ABI this way. If he agrees with you I'll concede.
Comment 9 Adrian Bunk 2008-08-26 05:06:30 UTC
fixed by commit 1327138e294ffda120a50c8f31d792addb196c79