From: Paolo Bonzini Date: Tue, 14 Apr 2020 08:18:58 +0000 Subject: Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place Message-Id: List-Id: References: <20200413140332.22896-1-eesposit@redhat.com> <03a481a8-bcf2-8755-d113-71ef393508bf@amsat.org> In-Reply-To: <03a481a8-bcf2-8755-d113-71ef393508bf@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Emanuele Giuseppe Esposito , kvm@vger.kernel.org Cc: Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Paul Mackerras , Michael Ellerman , Benjamin Herrenschmidt , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org On 13/04/20 23:34, Philippe Mathieu-Daud=C3=A9 wrote: >> +#define VM_STAT(x, ...) offsetof(struct kvm, stat.x), KVM_STAT_VM, ## _= _VA_ARGS__ >> +#define VCPU_STAT(x, ...) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_V= CPU, ## __VA_ARGS__ > I find this macro expanding into multiple fields odd... Maybe a matter > of taste. Sugggestion, have the macro define the full structure, as in > the arm64 arch: >=20 > #define VM_STAT(n, x, ...) { n, offsetof(struct kvm, stat.x), > KVM_STAT_VM, ## __VA_ARGS__ } >=20 > Ditto for VCPU_STAT(). >=20 Yes, that's a good idea. Emanuele, can you switch it to this format? Thanks, Paolo