Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5178830imm; Tue, 9 Oct 2018 10:51:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV60bCWdUfp5f/CLzC6FF404HbycS9SMbE3txpIhpO9gSAjq2p4iQdBJHpK4DDv9fY4jJKHbC X-Received: by 2002:a62:75c7:: with SMTP id q190-v6mr31423963pfc.137.1539107504838; Tue, 09 Oct 2018 10:51:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539107504; cv=none; d=google.com; s=arc-20160816; b=g+J4KDXObmB7cribaHKozcuJdZYofTgM1zbKNIg9Mmax5jiRd1itbpVftEqOgrv74j 6a8Zje1nc4PzZ/IeBZ9xfi8vUnzUye0OtRLG5ev+ONGF9ygtW8/8sgwUkS9eBkeKTLzW JXvWkL+WuzZn3squbmzzuz/rKPZbcCgZLt/Lrwe5B3hNEGGTvmA/wtrDN2yyfJakEQKX DXajAbjPVnyPpoWflWR+iBA9f9xC5KIR1jodehn4RDOJUEFjhEzBnAHLWC5YsREdczPS S6JnQ73ocrBTczFK3JKv6HLDopwKc7ukn8g52BTjtAqIltI1xx6lsu7eN2UPjMyTff/5 MKCw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=kb7JBOm7MwV2mejOdDPZrwO4BJuyh2UwyMWv3yFrdNc=; b=f6giCvnQIPVsdkTNSv16iHSFgWV7F5myTIyEYZ4vZ+iZlIGyCBQEEGEiIJDbGZKtBg uzkPiMCsFj991UAkEoW209SdqmPaigF70GlwJvkXh4lO/GGvccQ//tBn7unQz03QrQgR cxeR8sJd50JS7sEiMQEjGaReIA6k0CTQGm8YyYrgmXIFwHGrhHF+zN8z9D0KaULbBp3H 7pZR7dWJDX1JZUWyqQKh0+/kBsYe0ceI+uH3+D6xMTDzsyDr0j9WEI5fvXKcFhk4jgw+ WWMzBOobkJrt1qsPzV/yrvyejjN8imQuJlbf9z0QEtRnrC9U+MDwgb8ViGyuOykvePJf Guhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17-v6si18245515pgv.54.2018.10.09.10.51.30; Tue, 09 Oct 2018 10:51:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbeJJBJK (ORCPT + 99 others); Tue, 9 Oct 2018 21:09:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeJJBJK (ORCPT ); Tue, 9 Oct 2018 21:09:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 324DA30DF6F9; Tue, 9 Oct 2018 17:51:03 +0000 (UTC) Received: from gondolin (ovpn-116-109.ams2.redhat.com [10.36.116.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id D86C378576; Tue, 9 Oct 2018 17:51:00 +0000 (UTC) Date: Tue, 9 Oct 2018 19:50:57 +0200 From: Cornelia Huck To: Boris Ostrovsky Cc: Christian Borntraeger , Filippo Sironi , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, xen-devel , vasu.srinivasan@oracle.com, Konrad Rzeszutek Wilk Subject: Re: [PATCH] KVM: Start populating /sys/hypervisor with KVM entries Message-ID: <20181009195057.2dc8fd7b.cohuck@redhat.com> In-Reply-To: <61740f41-c7e3-edaf-68ac-2e4c4a99523b@oracle.com> References: <1539078879-4372-1-git-send-email-sironi@amazon.de> <61740f41-c7e3-edaf-68ac-2e4c4a99523b@oracle.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 09 Oct 2018 17:51:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Oct 2018 12:21:46 -0400 Boris Ostrovsky wrote: > On 10/9/18 6:41 AM, Christian Borntraeger wrote: > > > > > > On 10/09/2018 11:54 AM, Filippo Sironi wrote: > >> Start populating /sys/hypervisor with KVM entries when we're running on > >> KVM. This is to replicate functionality that's available when we're > >> running on Xen. > >> > >> Let's start with /sys/hypervisor/uuid, which users prefer over > >> /sys/devices/virtual/dmi/id/product_uuid as a way to recognize a virtual > >> machine, since it's also available when running on Xen HVM and on Xen PV > >> and, on top of that doesn't require root privileges by default. > > > > Can you make this an arch hook? On s390 it is possible to get the uuid with > > the stsi instruction. > > See > > https://git.kernel.org/pub/scm/virt/kvm/kvm.git/tree/arch/s390/kernel/sysinfo.c#n248 > > > > > > We do use uuid_t, but we can certainly return a char*. > > > I would suggest having a top-level sys-hypervisor.c that will create > common files that all hypervisors should have (uuid, type, version, etc) > and then have hypervisor- and/or arch-specific hooks. I think we really need *both* hypervisor- and arch-specific hooks.