Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place

2020-04-14 Thread Emanuele Giuseppe Esposito
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 expand

Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place

2020-04-14 Thread Paolo Bonzini
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... May

Re: [PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place

2020-04-13 Thread Philippe Mathieu-Daudé
Hi Emanuele, On 4/13/20 4:03 PM, Emanuele Giuseppe Esposito wrote: > The macros VM_STAT and VCPU_STAT are redundantly implemented in multiple > files, each used by a different architecure to initialize the debugfs > entries for statistics. Since they all have the same purpose, they can be > unifie

[PATCH] kvm_host: unify VM_STAT and VCPU_STAT definitions in a single place

2020-04-13 Thread Emanuele Giuseppe Esposito
The macros VM_STAT and VCPU_STAT are redundantly implemented in multiple files, each used by a different architecure to initialize the debugfs entries for statistics. Since they all have the same purpose, they can be unified in a single common definition in include/linux/kvm_host.h Signed-off-by: