From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934559AbdEVOQk (ORCPT ); Mon, 22 May 2017 10:16:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:37937 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934348AbdEVOQj (ORCPT ); Mon, 22 May 2017 10:16:39 -0400 Subject: Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type To: Andrew Cooper , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com References: <20170522085700.488-1-jgross@suse.com> <20170522085700.488-3-jgross@suse.com> <88d8c261-ec9d-f912-437c-6ae4b9410443@citrix.com> From: Juergen Gross Message-ID: <8c8270fd-cfce-6e98-a420-92fd43f001fc@suse.com> Date: Mon, 22 May 2017 16:16:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <88d8c261-ec9d-f912-437c-6ae4b9410443@citrix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/05/17 15:33, Andrew Cooper wrote: > On 22/05/17 09:57, Juergen Gross wrote: >> Currently there is no reliable user interface inside a Xen guest to >> determine its type (e.g. HVM, PV or PVH). Instead of letting user mode >> try to determine this by various rather hacky mechanisms (parsing of >> boot messages before they are gone, trying to make use of known subtle >> differences in behavior of some instructions), add a sysfs node >> /sys/hypervisor/guest_type to explicitly deliver this information as >> it is known to the kernel. >> >> Signed-off-by: Juergen Gross >> --- >> Documentation/ABI/testing/sysfs-hypervisor | 13 +++++++++++++ >> arch/arm/xen/enlighten.c | 3 +++ >> arch/x86/xen/enlighten.c | 3 +++ >> arch/x86/xen/enlighten_hvm.c | 6 ++++-- >> arch/x86/xen/enlighten_pv.c | 1 + >> drivers/xen/sys-hypervisor.c | 17 +++++++++++++++++ >> include/xen/xen.h | 2 ++ >> 7 files changed, 43 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor >> index 443196f0aa1c..06850f74ebd4 100644 >> --- a/Documentation/ABI/testing/sysfs-hypervisor >> +++ b/Documentation/ABI/testing/sysfs-hypervisor >> @@ -19,6 +19,19 @@ Contact: xen-devel@lists.xenproject.org >> Description: >> Compiler which was used to build the Xen hypervisor >> >> +What: /sys/hypervisor/guest_type >> +Date: May 2017 >> +KernelVersion: 4.12 >> +Contact: xen-devel@lists.xenproject.org >> +Description: >> + Type of guest: >> + "native": standard guest type on arm >> + "HVM": fully virtualized guest (x86) >> + "PV": paravirtualized guest (x86) >> + "PVH": fully virtualized guest without legacy emulation (x86) >> + "PVHVM": fully virtualized guest using paravirtualized >> + interfaces (e.g. interrupts, timers) (x86) > > I'm not sure this is wise split. PVHVM is a spectrum which changes > dynamically, especially in the presence of hardware APIC support. > > I'd suggest guest type being straight PV or HVM (being the container > type), and a list of items (interrupts, timers, legacy emulation) which > are either using paravirt or native interfaces, or are not used at all. Dropping PVHVM from this list is okay, but I'd like to keep PVH. Even if technically it _is_ HVM without legacy emulation, for the user it is more some kind of a guest type than just an attribute. Juergen