lkml.org 
[lkml]   [2021]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] KVM: VMX: Macrofy the MSR bitmap getters and setters
Date
On 16/03/21 19:44, Sean Christopherson wrote:
> + return (ret)true; \

I'm not sure if (void)true is amazing or disgusting, but anyway...

> +BUILD_VMX_MSR_BITMAP_HELPER(bool, test, read)
> +BUILD_VMX_MSR_BITMAP_HELPER(bool, test, write)
> +BUILD_VMX_MSR_BITMAP_HELPER(void, clear, read, __)
> +BUILD_VMX_MSR_BITMAP_HELPER(void, clear, write, __)
> +BUILD_VMX_MSR_BITMAP_HELPER(void, set, read, __)
> +BUILD_VMX_MSR_BITMAP_HELPER(void, set, write, __)

... I guess we have an armed truce where you let me do my bit
manipulation magic and I let you do your macro magic.

Still, I think gluing the variadic arguments with ## is a bit too much.
This would be slightly less mysterious:

+BUILD_VMX_MSR_BITMAP_HELPER(bool, vmx_test_msr_bitmap_, read, test_bit)
+BUILD_VMX_MSR_BITMAP_HELPER(bool, vmx_test_msr_bitmap_, write, test_bit)
+BUILD_VMX_MSR_BITMAP_HELPER(void, vmx_clear_msr_bitmap_, read, __clear_bit)
+BUILD_VMX_MSR_BITMAP_HELPER(void, vmx_clear_msr_bitmap_, write,
__clear_bit)
+BUILD_VMX_MSR_BITMAP_HELPER(void, vmx_set_msr_bitmap_, read, __set_bit)
+BUILD_VMX_MSR_BITMAP_HELPER(void, vmx_set_msr_bitmap_, write, __set_bit)

And I also wonder if we really need to expand all six functions one at a
time. You could remove the third argument and VMX_MSR_BITMAP_BASE_*, at
the cost of expanding the inline functions' body twice in
BUILD_VMX_MSR_BITMAP_HELPER.

Thanks,

Paolo

\
 
 \ /
  Last update: 2021-03-17 14:16    [W:0.079 / U:0.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site