[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4934b3e-4d5f-a242-e14f-ad5841079349@redhat.com>
Date: Wed, 17 Mar 2021 14:15:07 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Alexander Graf <graf@...zon.com>,
Yuan Yao <yaoyuan0329os@...il.com>
Subject: Re: [PATCH 3/4] KVM: VMX: Macrofy the MSR bitmap getters and setters
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
Powered by blists - more mailing lists