Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4572770ybb; Tue, 14 Apr 2020 09:52:36 -0700 (PDT) X-Google-Smtp-Source: APiQypIT+Azdv2Rqtez1Mb22GSZPK/gh3/IYgvzys4ovBML6lRz+QtogMy7rKMed32s+1QMhN9mn X-Received: by 2002:aa7:d441:: with SMTP id q1mr2276276edr.143.1586883156671; Tue, 14 Apr 2020 09:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586883156; cv=none; d=google.com; s=arc-20160816; b=kz/D670u/rRiepJ+woDesUXGBnKrn8C2HNW4pi3sUrdyhbSzCVFO9KYu2RG5AB+u6o 57ooS2AjWlv6VKIUIavF1Xw417QXTzIl1hmPYydlFeyxejioUoNhPu8GByrUztSYnwhA 6bVaOFvP61mbME3fkRTBof4Os/1vH6c9uuWQzu4Hhm8hoQFBIEIgv7W9IWIqYoUBJn81 n9VoRoIxdb9OAT5w9GN2tQqsmlfvxYJH8c1oluRRlq6B3gOTDmvrEhwtsqmiPLhGg+bd Mdu48BtwBhWyVTvjL4gopzvTV4azFWYJcnQlhOm9THjju8AaKvnVI2oGcvjqD6E0Oqa8 ZGWg== 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=+YYLNoHPS0R9msE++qaePEk7EKWnckmMQYzoCYqpJRk=; b=GUzshkNIGka7jPAajPblg4tnuVKPWCD0MPJE5wMqTp8nHk6KRU42+SoElFwj73lmlT A3RmZcYE1zc2niV4plbiXDiY50Y37vrOmIDtTtBlZip093bjv6LfrHuiP1wJ0J/lsqO5 42kZ4mc8ssgs3pkD1iI9dCURw87HNpB2kF9wlaCd6+EJsqCryckbF7u5+zaM7vAur0tZ ozF7yjHLi/veQn6pOgqh4ftjitQAbtyxHzSj9nzcLgqWMWQG9o/uUObjg3ITmQDcwrej rfhwVFyJlQItF+FrthrAP3y0dCuKMXt2SPTQ2zTK/vNc2YPFG4yGqB9XdS5VUU5hsn43 L54g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L5VaZIUX; 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 cy3si9060814edb.36.2020.04.14.09.52.13; Tue, 14 Apr 2020 09:52:36 -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=L5VaZIUX; 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 S1732423AbgDNP5M (ORCPT + 99 others); Tue, 14 Apr 2020 11:57:12 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46031 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732398AbgDNP5J (ORCPT ); Tue, 14 Apr 2020 11:57:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586879828; 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=+YYLNoHPS0R9msE++qaePEk7EKWnckmMQYzoCYqpJRk=; b=L5VaZIUX94Up2eOkbcGXD9ia6HQsLwWIG5x2EBP15ZVOAg0FYzA7/4JiAQ/Fn0e9zucPzj cijSY8Y2Y28v1AhrGRN49yO+erNIXQ/Z7xWUPdqMb98nGB9Iy07jDACxr9zzYzhaFqH2qr tzp5EynSZH27B3q5RamSSbSuYG38mL8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-YPgEzeE1N0-LMzRI4KUYyg-1; Tue, 14 Apr 2020 11:57:06 -0400 X-MC-Unique: YPgEzeE1N0-LMzRI4KUYyg-1 Received: by mail-wm1-f72.google.com with SMTP id b203so3977792wmd.6 for ; Tue, 14 Apr 2020 08:57:06 -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=+YYLNoHPS0R9msE++qaePEk7EKWnckmMQYzoCYqpJRk=; b=NYaZZqXagNoOug0fnaVJs2/uDCiC88mHI0kltR7OcLsWTMCY9XYJFwmMRvaaIvhqqv hWuY8PfaJxmetFSccbd7mP6SxQ4oX78qMnC5cN0t+BoUQEgCULB/CVg4FX+EHP4mUufM IefherYiDhlkC6e7JUoQJS8yyWIWMC2gwmcc7r33kzmFbk0VAGUdKfYOq6PBnjKU2XBW JsI26uTbcNjYYEQ6rfFxQfxSCJcLO8fFTlRVVSvUE2Wklm97A2NKvTI4Xo3LRYpP+cBX y7qw6oM+ckTTh9eTMCWrqnL/ugs2djWGS6Buvqlg9jxP63LD2oSHCBSHMAmoo5EIEguQ knNg== X-Gm-Message-State: AGi0PuYRbFc7+z5+G9xiLhjWyzAgTAuRrYiTOZGc9l878KNn+jbo9nPF UPi5ZA/41GuPQjKjOuEZow2VGBA4WX7txjb0L5QqZ9nG/crLzl0KKMHsyUoM876KK2mvNb+ZEsk H5twiz5xJMxzPLYIgLo17MCA2 X-Received: by 2002:a1c:5502:: with SMTP id j2mr502954wmb.93.1586879825158; Tue, 14 Apr 2020 08:57:05 -0700 (PDT) X-Received: by 2002:a1c:5502:: with SMTP id j2mr502914wmb.93.1586879824909; Tue, 14 Apr 2020 08:57:04 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.210]) by smtp.gmail.com with ESMTPSA id j10sm16390309wmi.18.2020.04.14.08.57.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2020 08:57:04 -0700 (PDT) Subject: Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place 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 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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