Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4479472ybb; Tue, 14 Apr 2020 08:06:59 -0700 (PDT) X-Google-Smtp-Source: APiQypJ5taOHkTvaOY5QtQG/CpXYiFojDLeoODJ5CfYlsgafnASHynTvugP2WexOtdtykN93JFxZ X-Received: by 2002:a17:906:459:: with SMTP id e25mr513964eja.379.1586876818998; Tue, 14 Apr 2020 08:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586876818; cv=none; d=google.com; s=arc-20160816; b=q4qwnQWCu/3GBZHhmVutOtDE749rDrhs6CA8+uleeFVaJvg5AaAWpA0te8rv9v3uOr ydGY1c9wMVxgcVYhFi/o1WpwXqlwagK2z1SpLSc3grnl2ExAtVt9+MTpXJ+bFdT9Vg/4 EU0TbPziUy4nML7QKYZbYxP/1xfWc9Urd0cXBYYBE0zBXJ612vP38YhKbjkNSy1cfkqX gJYEY4ANSMGGjqOQ/l7QUNGbDAeAGFFiCQQhle3Vnqx6DhYme3jhsNRj08wyQSWrkib1 mJwU5QhlGqEiWbjImbS46my+Ldz12KyRhCZj4P9cqhRwbWom8Kpt6bt6UWd+Ip3Ygsxl MPvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=TtBLM3c8JTLmBP2uDmSrWuT9/+Pwll6JJwpjBt6QX00=; b=ygqk1VvEKVpneZ1oAHY+z/q+Hn4PNYf9J37q6tZN5HA1wubWTgbzs6tmt766ZxOsmx CVDDeIOoqTblL2NPvXg9R/bFiJbisPa+unL++yKTOw1nF2gKRGy32RTEkXFgZxLMY73a 1vuJck8gzxVOsxK3MviDAPo1Hhwb3LxSIT0cKsHy0f/CltFkDh5wWv9StS7fZ8IKnTnV 8tejqd8egp3RcWkWUTOEhEe6512mKrIhrLbMYgxAYiPILNB4e7AsLfPT9CVfWutgJ9DJ RwVNTiGYvcWvYaJ0NITJL0SQHMW3lL1T3SxvQxKPziFg7pbutU0FaXL5OGB91Sxrg5H8 gvpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gp1QYLF1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx7si3779340edb.125.2020.04.14.08.06.32; Tue, 14 Apr 2020 08:06:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gp1QYLF1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436670AbgDNIYD (ORCPT + 99 others); Tue, 14 Apr 2020 04:24:03 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:60225 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436523AbgDNIVC (ORCPT ); Tue, 14 Apr 2020 04:21:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586852461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TtBLM3c8JTLmBP2uDmSrWuT9/+Pwll6JJwpjBt6QX00=; b=Gp1QYLF1PrEgX3vAu+dXARdbbNzC1ycYKeG+e0+OpE4vNR7LX6VMIJvieYXs4I87X9JUX/ gzuj5HEc/iaB6nLYR4Z289isVPNRjpA/FaBzKZI6u0tRNFN9Hc5SnZ4PMicCjfqTZnyeXs lgf+SPEheVAIOy5fbj3vM1Ma0KNTWZQ= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-J1iW7KjONDavI80bIPdQkA-1; Tue, 14 Apr 2020 04:19:02 -0400 X-MC-Unique: J1iW7KjONDavI80bIPdQkA-1 Received: by mail-wm1-f71.google.com with SMTP id h184so300020wmf.5 for ; Tue, 14 Apr 2020 01:19:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TtBLM3c8JTLmBP2uDmSrWuT9/+Pwll6JJwpjBt6QX00=; b=Cgr8HCbif3MIqeAvrbaP65wJqr84FJUqsxgXLu8MBWiCQ2vuevr+gQV1oi5aks2jlU KqkAeDePvcGp0XO6mbrBrOMO4a7lal2QVJud/M+eSPonzeCBZKmGetB+s4BsT3FsHLQO /B496O27X7AtR6hHGrAQu7CmyswBlYsIgyn8DC10pfnL7mazCIO2cri35jsu16NmhIni /gubrk2xYnqPKTsR4jK1oEHWNQehJD3iQsr0Q8NTavcsl6MK0vC36iLDoPQFyDHGnrUs 9vI+zhwH8XoQzuI5nDOqfM6Ttvu/E+mrr/F0TvRo/NtylIvwIc6/UuPNWMHmwXqiyIVk eQmw== X-Gm-Message-State: AGi0Pua5o8/XF2SH8cxwjfgzerASJX726memW3T52H+E0FeFi4+P6enJ FwnMwJk+BnUGKhoWIj1vXPUqO7a2a0PuTqHKc079HiICaixpg+4f0ewBwHd5m7zWe9UvoqXPXcw 8hR/l7gWYOnBdVWzowiM2Q/+9 X-Received: by 2002:a05:6000:8b:: with SMTP id m11mr8390693wrx.168.1586852341223; Tue, 14 Apr 2020 01:19:01 -0700 (PDT) X-Received: by 2002:a05:6000:8b:: with SMTP id m11mr8390681wrx.168.1586852340970; Tue, 14 Apr 2020 01:19:00 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:e159:eda1:c472:fcfa? ([2001:b07:6468:f312:e159:eda1:c472:fcfa]) by smtp.gmail.com with ESMTPSA id o28sm3426907wra.84.2020.04.14.01.18.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2020 01:19:00 -0700 (PDT) Subject: Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place 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 References: <20200413140332.22896-1-eesposit@redhat.com> <03a481a8-bcf2-8755-d113-71ef393508bf@amsat.org> From: Paolo Bonzini Message-ID: Date: Tue, 14 Apr 2020 10:18:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <03a481a8-bcf2-8755-d113-71ef393508bf@amsat.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). > Yes, that's a good idea. Emanuele, can you switch it to this format? Thanks, Paolo