mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>, <linux-kernel@vger.kernel.org>,
	<xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
Date: Mon, 22 May 2017 15:38:27 +0100	[thread overview]
Message-ID: <fab51758-56ad-1be1-94a3-5416b73e7091@citrix.com> (raw)
In-Reply-To: <5db9579f-00b6-7389-1113-7ddae5fc4f3f@oracle.com>

On 22/05/17 15:35, Boris Ostrovsky wrote:
> On 05/22/2017 09:33 AM, 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 <jgross@suse.com>
>>> ---
>>>  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.
> Can these be exposed via HVM CPUID leaf?

The HVM CPUID leaf provides information about the available options to
the kernel, but only Linux can make its mind up which interface to use.

~Andrew

  reply	other threads:[~2017-05-22 14:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22  8:56 [PATCH 0/2] xen: add xen sysfs node Juergen Gross
2017-05-22  8:56 ` [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen Juergen Gross
2017-05-22 13:30   ` Boris Ostrovsky
2017-05-22 14:20     ` Juergen Gross
2017-05-22 14:47       ` Boris Ostrovsky
2017-05-22  8:57 ` [PATCH 2/2] xen: add sysfs node for guest type Juergen Gross
2017-05-22 13:17   ` Boris Ostrovsky
2017-05-22 14:21     ` Juergen Gross
2017-05-22 13:33   ` [Xen-devel] " Andrew Cooper
2017-05-22 14:16     ` Juergen Gross
2017-05-22 14:35     ` Boris Ostrovsky
2017-05-22 14:38       ` Andrew Cooper [this message]
2017-05-22 13:45   ` Jan Beulich
     [not found]   ` <59230794020000780015BC13@suse.com>
2017-05-22 14:20     ` Juergen Gross
2017-05-22 15:23   ` Konrad Rzeszutek Wilk
2017-05-22 15:28     ` Juergen Gross
2017-05-22 15:37       ` Jan Beulich
     [not found]       ` <592321E4020000780015BD0E@suse.com>
2017-05-22 15:52         ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fab51758-56ad-1be1-94a3-5416b73e7091@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®