Thread (47 messages) 47 messages, 4 authors, 2022-06-10

Re: [PATCH 05/18] KVM: arm64: Add helpers to manipulate vcpu flags among a set

From: Reiji Watanabe <hidden>
Date: 2022-06-09 02:26:55
Also in: kvm, kvmarm

Hi Marc,
quoted
quoted
+#define vcpu_get_flag(v, ...)  __vcpu_get_flag(v, __VA_ARGS__)
+#define vcpu_set_flag(v, ...)  __vcpu_set_flag(v, __VA_ARGS__)
+#define vcpu_clear_flag(v, ...)        __vcpu_clear_flag(v, __VA_ARGS__)
+
+#define __vcpu_single_flag(_set, _f)   _set, (_f), (_f)
+
+#define __flag_unpack(_set, _f, _m)    _f
Nit: Probably it might be worth adding a comment that explains the
above two macros ? (e.g. what is each element of the triplets ?)
How about this?

/*
 * Each 'flag' is composed of a comma-separated triplet:
 *
 * - the flag-set it belongs to in the vcpu->arch structure
 * - the value for that flag
 * - the mask for that flag
 *
 *  __vcpu_single_flag() builds such a triplet for a single-bit flag.
 * unpack_vcpu_flag() extract the flag value from the triplet for
 * direct use outside of the flag accessors.
 */
Looks good to me, thank you!
Reiji

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help