From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Giuseppe Esposito Date: Tue, 14 Apr 2020 15:57:02 +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: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Paolo Bonzini , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , 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 4/14/20 10:18 AM, Paolo Bonzini wrote: > 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_= VCPU, ## __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: >> >> #define VM_STAT(n, x, ...) { n, offsetof(struct kvm, stat.x), >> KVM_STAT_VM, ## __VA_ARGS__ } >> >> Ditto for VCPU_STAT(). >> Hi Philippe and Paolo, >=20 > Yes, that's a good idea. Emanuele, can you switch it to this format? Sure, I just submitted the v2 version. Thanks, Emanuele