Re: [PATCH 2/3] KVM: Add KVM_REG_SIZE() helper.

2012-09-19 Thread Alexander Graf

On 05.09.2012, at 09:58, Rusty Russell wrote:

 Useful helper for getting length of register given id.
 
 Signed-off-by: Rusty Russell rusty.russ...@linaro.org

Acked-by: Alexander Graf ag...@suse.de


Alex

 ---
 include/linux/kvm.h |2 ++
 1 file changed, 2 insertions(+)
 
 diff --git a/include/linux/kvm.h b/include/linux/kvm.h
 index d808694..8c3760e 100644
 --- a/include/linux/kvm.h
 +++ b/include/linux/kvm.h
 @@ -744,6 +744,8 @@ struct kvm_dirty_tlb {
 #define KVM_REG_SIZE_U256 0x0050ULL
 #define KVM_REG_SIZE_U512 0x0060ULL
 #define KVM_REG_SIZE_U10240x0070ULL
 +#define KVM_REG_SIZE(id) \
 + (1U  (((id)  KVM_REG_SIZE_MASK)  KVM_REG_SIZE_SHIFT))
 
 struct kvm_one_reg {
   __u64 id;
 -- 
 1.7.9.5
 

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] KVM: Add KVM_REG_SIZE() helper.

2012-09-05 Thread Rusty Russell
Useful helper for getting length of register given id.

Signed-off-by: Rusty Russell rusty.russ...@linaro.org
---
 include/linux/kvm.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index d808694..8c3760e 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -744,6 +744,8 @@ struct kvm_dirty_tlb {
 #define KVM_REG_SIZE_U256  0x0050ULL
 #define KVM_REG_SIZE_U512  0x0060ULL
 #define KVM_REG_SIZE_U1024 0x0070ULL
+#define KVM_REG_SIZE(id)   \
+   (1U  (((id)  KVM_REG_SIZE_MASK)  KVM_REG_SIZE_SHIFT))
 
 struct kvm_one_reg {
__u64 id;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html