diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2012-08-20 22:58:45 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-08-22 08:08:51 -0400 |
commit | 67b29204c8c9ecb4b2799a06ab646eeb363a0fe6 (patch) | |
tree | 4340306cbdfa28169737010531590735f63b6b4f /include/linux | |
parent | a50d64d6590f470b712758598a077ef4fd0fc40a (diff) |
KVM: hide KVM_MEMSLOT_INVALID from userspace
Quote Avi's comment:
| KVM_MEMSLOT_INVALID is actually an internal symbol, not used by
| userspace. Please move it to kvm_host.h.
Also, we divide the memlsot->flags into two parts, the lower 16 bits
are visible for userspace, the higher 16 bits are internally used in
kvm
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/kvm.h | 7 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 2ce09aa7d3b3..2de335d7f63e 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -101,9 +101,12 @@ struct kvm_userspace_memory_region { | |||
101 | __u64 userspace_addr; /* start of the userspace allocated memory */ | 101 | __u64 userspace_addr; /* start of the userspace allocated memory */ |
102 | }; | 102 | }; |
103 | 103 | ||
104 | /* for kvm_memory_region::flags */ | 104 | /* |
105 | * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, | ||
106 | * other bits are reserved for kvm internal use which are defined in | ||
107 | * include/linux/kvm_host.h. | ||
108 | */ | ||
105 | #define KVM_MEM_LOG_DIRTY_PAGES 1UL | 109 | #define KVM_MEM_LOG_DIRTY_PAGES 1UL |
106 | #define KVM_MEMSLOT_INVALID (1UL << 1) | ||
107 | 110 | ||
108 | /* for KVM_IRQ_LINE */ | 111 | /* for KVM_IRQ_LINE */ |
109 | struct kvm_irq_level { | 112 | struct kvm_irq_level { |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index d2b897ee3ac4..d4bd4d41e355 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -36,6 +36,13 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * The bit 16 ~ bit 31 of kvm_memory_region::flags are internally used | ||
40 | * in kvm, other bits are visible for userspace which are defined in | ||
41 | * include/linux/kvm_h. | ||
42 | */ | ||
43 | #define KVM_MEMSLOT_INVALID (1UL << 16) | ||
44 | |||
45 | /* | ||
39 | * If we support unaligned MMIO, at most one fragment will be split into two: | 46 | * If we support unaligned MMIO, at most one fragment will be split into two: |
40 | */ | 47 | */ |
41 | #ifdef KVM_UNALIGNED_MMIO | 48 | #ifdef KVM_UNALIGNED_MMIO |