mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] KVM: fix userspace ABI breakage
@ 2008-08-05 22:36 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2008-08-05 22:36 UTC (permalink / raw)
  To: Tan Li, Jerone Young, Hollis Blanchard, Avi Kivity
  Cc: kvm, linux-kernel, Andrew Morton

The following part of commit 9ef621d3be56e1188300476a8102ff54f7b6793f 
(KVM: Support mixed endian machines) changed on the size of a struct 
that is exported to userspace:

include/linux/kvm.h:

@@ -318,14 +318,14 @@ struct kvm_trace_rec {
 	__u32 vcpu_id;
 	union {
 		struct {
-			__u32 cycle_lo, cycle_hi;
+			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-};
+} __attribute__((packed));
 

Packing a struct was the correct idea, but it packed the wrong struct.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

This patch has been sent on:
- 21 Jul 2008

857d4ddbb62bc61e44b8870cda8ea1c38c6e1905 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 0ea064c..ad11cfe 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -320,12 +320,12 @@ struct kvm_trace_rec {
 		struct {
 			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
-		} cycle;
+		} __attribute__((packed)) cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-} __attribute__((packed));
+};
 
 #define KVMIO 0xAE
 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [2.6 patch] KVM: fix userspace ABI breakage
@ 2008-07-21 14:58 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2008-07-21 14:58 UTC (permalink / raw)
  To: Tan Li, Jerone Young, Hollis Blanchard, Avi Kivity; +Cc: kvm, linux-kernel

The following part of commit 9ef621d3be56e1188300476a8102ff54f7b6793f 
(KVM: Support mixed endian machines) changed on the size of a struct 
that is exported to userspace:

include/linux/kvm.h:

@@ -318,14 +318,14 @@ struct kvm_trace_rec {
 	__u32 vcpu_id;
 	union {
 		struct {
-			__u32 cycle_lo, cycle_hi;
+			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-};
+} __attribute__((packed));
 

Packing a struct was the correct idea, but it packed the wrong struct.

Signed-off-by: Adrian Bunk <adrian.bunk@movial.fi>

---
857d4ddbb62bc61e44b8870cda8ea1c38c6e1905 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 0ea064c..ad11cfe 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -320,12 +320,12 @@ struct kvm_trace_rec {
 		struct {
 			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
-		} cycle;
+		} __attribute__((packed)) cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-} __attribute__((packed));
+};
 
 #define KVMIO 0xAE
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-05 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-05 22:36 [2.6 patch] KVM: fix userspace ABI breakage Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2008-07-21 14:58 Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®