From mboxrd@z Thu Jan 1 00:00:00 1970 From: Genevieve Bastien Subject: Shared value between host and guests Date: Fri, 19 Jan 2018 15:03:25 -0500 Message-ID: <5A624F0D.7010603@versatic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT To: kvm@vger.kernel.org Return-path: Received: from barracuda.ebox.ca ([96.127.255.19]:40200 "EHLO barracuda.ebox.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756388AbeASURH (ORCPT ); Fri, 19 Jan 2018 15:17:07 -0500 Received: from smtp.ebox.ca (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id MIwq3Yhgpotfzsff (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Jan 2018 15:03:25 -0500 (EST) Received: from [192.168.69.101] (cable-192.222.212.242.electronicbox.net [192.222.212.242]) by smtp.ebox.ca (Postfix) with ESMTPS id B6D2B441B21 for ; Fri, 19 Jan 2018 15:03:25 -0500 (EST) Sender: kvm-owner@vger.kernel.org List-ID: Hi, I'm tracing kvm guests and their host and an issue we have is to identify which host process corresponds to which guest trace so we can follow the state of the virtual cpu on the host. For our needs, we fixed this problem by adding a kernel module on host and guest where hosts and guests make an hypercall received by the other and sending a UID between them. By tracing those hypercalls and tracking the uid value, we can know which thread on the host corresponds to which guest machine. But we would like to achieve this without having to add an additional module for tracing purposes. I'm wondering if there's already a value somewhere in the kernel that is uniquely shared between the host process/threads and the corresponding guest. And if not, would it be possible/desirable to add one? For instance, the bootid of the guest could be sent to the host process at the start and stored in some system file. The trace could then retrieve it and the analysis can figure out who's who all the traces. Fyi, this is the kind of virtual machine analyses we can obtain by tracing guest and host: http://archive.eclipse.org/tracecompass.incubator/doc/org.eclipse.tracecompass.incubator.virtual.machine.analysis.doc.user/Virtual-Machine-Analysis-User-Documentation.html We have more, but it is not yet documented unfortunately. Thanks, Geneviève