Skip to contentSkip to conversation

qemu-kvm: fix __user export

PATCH Applied Michael S. Tsirkin 3 participants 5 messages Nov 30, 2009 – Dec 2, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-kvm: fix __user export

__user macro does not appear in exported headers
and should not be in headers qemu-kvm includes.

---
 kvm/include/linux/kvm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/include/linux/kvm.h +1 -1
index 92045a9..db10887 100644
@@ -309,7 +309,7 @@ struct kvm_dirty_log {
 	__u32 slot;
 	__u32 padding1;
 	union {
-		void __user *dirty_bitmap; /* one bit per page */
+		void *dirty_bitmap; /* one bit per page */
 		__u64 padding2;
 	};
 };
Signature · 1 line
1.6.5.2.143.g8cc62
Applied
#1 lore raw
Quoted 4 lines · Michael S. Tsirkin

__user macro does not appear in exported headers
and should not be in headers qemu-kvm includes.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function
#2 lore raw
In reply to Michael S. Tsirkin

Am Montag 30 November 2009 13:02:08 schrieb Michael S. Tsirkin:

Quoted 14 lines

__user macro does not appear in exported headers
and should not be in headers qemu-kvm includes.

---
 kvm/include/linux/kvm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kvm/include/linux/kvm.h +0 -0
index 92045a9..db10887 100644

kvm/include/linux/kvm.h struct kvm_dirty_log { · line 315

Quoted 8 lines
kvm/include/linux/kvm.h +1 -1
@@ -309,7 +309,7 @@ struct kvm_dirty_log {
 	__u32 slot;
 	__u32 padding1;
 	union {
-		void __user *dirty_bitmap; /* one bit per page */
+		void *dirty_bitmap; /* one bit per page */
 		__u64 padding2;
 	};
 };

Huh?
Doesnt that create a sparse warning? You already mention that the exported header does not contain __user and that is perfectly ok:
- for the kernel dirty_bitmap is in the user address space, so we need the __user
- userspace does not know and need the __user so it is removed during headers_install.

Christian

#3 lore raw
Quoted 23 lines · Christian Borntraeger

Am Montag 30 November 2009 13:02:08 schrieb Michael S. Tsirkin:

Quoted 21 lines

__user macro does not appear in exported headers
and should not be in headers qemu-kvm includes.

---
  kvm/include/linux/kvm.h |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
kvm/include/linux/kvm.h +1 -1
index 92045a9..db10887 100644
@@ -309,7 +309,7 @@ struct kvm_dirty_log {
  	__u32 slot;
  	__u32 padding1;
  	union {
-		void __user *dirty_bitmap; /* one bit per page */
+		void *dirty_bitmap; /* one bit per page */
  		__u64 padding2;
  	};
  };
Quoted 10 lines
Quoted 2 lines

Huh?
Doesnt that create a sparse warning? You already mention that the exported header does not contain __user and that is perfectly ok:
- for the kernel dirty_bitmap is in the user address space, so we need the __user
- userspace does not know and need the __user so it is removed during headers_install.

This is in the copy of the headers that qemu-kvm.git carries, not the kernel master.

Signature · 1 line
error compiling committee.c: too many arguments to function
#4 lore raw
Quoted 2 lines

This is in the copy of the headers that qemu-kvm.git carries, not the kernel master.

Right, I missed that. Thanks