From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24154 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732396AbgDNP5J (ORCPT ); Tue, 14 Apr 2020 11:57:09 -0400 Received: by mail-wm1-f70.google.com with SMTP id c129so3975831wme.8 for ; Tue, 14 Apr 2020 08:57:06 -0700 (PDT) Subject: Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place References: <20200413140332.22896-1-eesposit@redhat.com> <03a481a8-bcf2-8755-d113-71ef393508bf@amsat.org> From: Emanuele Giuseppe Esposito Message-ID: Date: Tue, 14 Apr 2020 17:57:02 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-s390-owner@vger.kernel.org List-ID: 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é 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, > > Yes, that's a good idea. Emanuele, can you switch it to this format? Sure, I just submitted the v2 version. Thanks, Emanuele