From: Paolo Bonzini Date: Tue, 15 Jun 2021 07:06:43 +0000 Subject: Re: [PATCH v9 0/5] KVM statistics data fd-based binary interface Message-Id: <15875c41-e1e7-3bf2-a85c-21384684d279@redhat.com> List-Id: References: <20210614212155.1670777-1-jingzhangos@google.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Leon Romanovsky , Jing Zhang Cc: KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba On 15/06/21 07:25, Leon Romanovsky wrote: > Sorry for my naive questions, but how does telemetry get statistics > for hypervisors? Why is KVM different from hypervisors or NIC's statistics > or any other high speed devices (RDMA) that generate tons of data? Right now, the only way is debugfs but it's slow, and it's disabled when using lockdown mode; this series is a way to fix this. I sense that there is another question in there; are you wondering if another mechanism should be used, for example netlink? The main issue there is how to identify a VM, since KVM file descriptors don't have a name. Using a pid works (sort of) for debugfs, but pids are not appropriate for a stable API. Using a file descriptor as in this series requires collaboration from the userspace program; howver, once the file descriptor has been transmitted via SCM_RIGHTS, telemetry can read it forever without further IPC, and there is proper privilege separation. Paolo