linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] xen: add xen sysfs node
@ 2017-05-22  8:56 Juergen Gross
  2017-05-22  8:56 ` [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen Juergen Gross
  2017-05-22  8:57 ` [PATCH 2/2] xen: add sysfs node for guest type Juergen Gross
  0 siblings, 2 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22  8:56 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, Juergen Gross

In order to be able to determine the Xen guest type from within the
guest as a user there is currently no stable interface available.

Add a sysfs node for that purpose as the guest type information is
available for the kernel.

While doing this document all the other Xen related sysfs nodes.

Juergen Gross (2):
  doc,xen: document hypervisor sysfs nodes for xen
  xen: add sysfs node for guest type

 Documentation/ABI/testing/sysfs-hypervisor     | 144 +++++++++++++++++++++++++
 Documentation/ABI/testing/sysfs-hypervisor-pmu |  23 ----
 MAINTAINERS                                    |   1 +
 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 +
 9 files changed, 175 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-hypervisor
 delete mode 100644 Documentation/ABI/testing/sysfs-hypervisor-pmu

-- 
2.12.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen
  2017-05-22  8:56 [PATCH 0/2] xen: add xen sysfs node Juergen Gross
@ 2017-05-22  8:56 ` Juergen Gross
  2017-05-22 13:30   ` Boris Ostrovsky
  2017-05-22  8:57 ` [PATCH 2/2] xen: add sysfs node for guest type Juergen Gross
  1 sibling, 1 reply; 18+ messages in thread
From: Juergen Gross @ 2017-05-22  8:56 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, Juergen Gross

Today only a few sysfs nodes under /sys/hypervisor/ are documented
for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu. Rename
this file to Documentation/ABI/testing/sysfs-hypervisor and add
descriptions of the other nodes.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Documentation/ABI/testing/sysfs-hypervisor     | 131 +++++++++++++++++++++++++
 Documentation/ABI/testing/sysfs-hypervisor-pmu |  23 -----
 MAINTAINERS                                    |   1 +
 3 files changed, 132 insertions(+), 23 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-hypervisor
 delete mode 100644 Documentation/ABI/testing/sysfs-hypervisor-pmu

diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor
new file mode 100644
index 000000000000..443196f0aa1c
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-hypervisor
@@ -0,0 +1,131 @@
+What:		/sys/hypervisor/compilation/compile_date
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Contains the build time stamp of the Xen hypervisor
+
+What:		/sys/hypervisor/compilation/compiled_by
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Contains information who built the Xen hypervisor
+
+What:		/sys/hypervisor/compilation/compiler
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Compiler which was used to build the Xen hypervisor
+
+What:		/sys/hypervisor/pmu/pmu_mode
+Date:		August 2015
+KernelVersion:	4.3
+Contact:	Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Description:
+		Describes mode that Xen's performance-monitoring unit (PMU)
+		uses. Accepted values are
+			"off"  -- PMU is disabled
+			"self" -- The guest can profile itself
+			"hv"   -- The guest can profile itself and, if it is
+				  privileged (e.g. dom0), the hypervisor
+			"all" --  The guest can profile itself, the hypervisor
+				  and all other guests. Only available to
+				  privileged guests.
+
+What:           /sys/hypervisor/pmu/pmu_features
+Date:           August 2015
+KernelVersion:  4.3
+Contact:        Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Description:
+		Describes Xen PMU features (as an integer). A set bit indicates
+		that the corresponding feature is enabled. See
+		include/xen/interface/xenpmu.h for available features
+
+What:		/sys/hypervisor/properties/capabilities
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Space separated list of supported guest system types. Each type
+		is in the format: <class>-<major>.<minor>-<arch>
+		With:
+			<class>: "xen" -- x86: paravirtualized, arm: standard
+				 "hvm" -- x86 only: full virtualized
+			<major>: major guest interface version
+			<minor>: minor guest interface version
+			<arch>:  architecture, e.g.:
+				 "x86_32": 32 bit x86 guest without PAE
+				 "x86_32p": 32 bit x86 guest with PAE
+				 "x86_64": 64 bit x86 guest
+				 "armv7l": 32 bit arm guest
+				 "aarch64": 64 bit arm guest
+
+What:		/sys/hypervisor/properties/changeset
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Changeset of the hypervisor (git commit)
+
+What:		/sys/hypervisor/properties/features
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Features the Xen hypervisor supports for the guest as defined
+		in include/xen/interface/features.h printed as a hex value.
+
+What:		/sys/hypervisor/properties/pagesize
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Default page size of the hypervisor printed as a hex value.
+
+What:		/sys/hypervisor/properties/virtual_start
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Virtual address of the hypervisor as a hex value.
+
+What:		/sys/hypervisor/type
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		Type of hypervisor:
+		"xen": Xen hypervisor
+
+What:		/sys/hypervisor/uuid
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		UUID of the guest as known to the Xen hypervisor.
+
+What:		/sys/hypervisor/version/extra
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		The Xen version is in the format <major>.<minor><extra>
+		This is the <extra> part of it.
+
+What:		/sys/hypervisor/version/major
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		The Xen version is in the format <major>.<minor><extra>
+		This is the <major> part of it.
+
+What:		/sys/hypervisor/version/minor
+Date:		March 2009
+KernelVersion:	2.6.30
+Contact:	xen-devel@lists.xenproject.org
+Description:
+		The Xen version is in the format <major>.<minor><extra>
+		This is the <minor> part of it.
diff --git a/Documentation/ABI/testing/sysfs-hypervisor-pmu b/Documentation/ABI/testing/sysfs-hypervisor-pmu
deleted file mode 100644
index 224faa105e18..000000000000
--- a/Documentation/ABI/testing/sysfs-hypervisor-pmu
+++ /dev/null
@@ -1,23 +0,0 @@
-What:		/sys/hypervisor/pmu/pmu_mode
-Date:		August 2015
-KernelVersion:	4.3
-Contact:	Boris Ostrovsky <boris.ostrovsky@oracle.com>
-Description:
-		Describes mode that Xen's performance-monitoring unit (PMU)
-		uses. Accepted values are
-			"off"  -- PMU is disabled
-			"self" -- The guest can profile itself
-			"hv"   -- The guest can profile itself and, if it is
-				  privileged (e.g. dom0), the hypervisor
-			"all" --  The guest can profile itself, the hypervisor
-				  and all other guests. Only available to
-				  privileged guests.
-
-What:           /sys/hypervisor/pmu/pmu_features
-Date:           August 2015
-KernelVersion:  4.3
-Contact:        Boris Ostrovsky <boris.ostrovsky@oracle.com>
-Description:
-		Describes Xen PMU features (as an integer). A set bit indicates
-		that the corresponding feature is enabled. See
-		include/xen/interface/xenpmu.h for available features
diff --git a/MAINTAINERS b/MAINTAINERS
index 503bcf4e3e8f..a5d2af148798 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13976,6 +13976,7 @@ F:	drivers/xen/
 F:	arch/x86/include/asm/xen/
 F:	include/xen/
 F:	include/uapi/xen/
+F:	Documentation/ABI/testing/sysfs-hypervisor
 
 XEN HYPERVISOR ARM
 M:	Stefano Stabellini <sstabellini@kernel.org>
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/2] xen: add sysfs node for guest type
  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  8:57 ` Juergen Gross
  2017-05-22 13:17   ` Boris Ostrovsky
                     ` (4 more replies)
  1 sibling, 5 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22  8:57 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, Juergen Gross

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)
+
 What:		/sys/hypervisor/pmu/pmu_mode
 Date:		August 2015
 KernelVersion:	4.3
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index ba7f4c8f5c3e..d2100f79e458 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -43,6 +43,9 @@ EXPORT_SYMBOL(xen_start_info);
 enum xen_domain_type xen_domain_type = XEN_NATIVE;
 EXPORT_SYMBOL(xen_domain_type);
 
+char *xen_guest_type = "native";
+EXPORT_SYMBOL_GPL(xen_guest_type);
+
 struct shared_info xen_dummy_shared_info;
 struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
 
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a5ffcbb20cc0..53bd23dfecac 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -47,6 +47,9 @@ EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
 enum xen_domain_type xen_domain_type = XEN_NATIVE;
 EXPORT_SYMBOL_GPL(xen_domain_type);
 
+char *xen_guest_type = "HVM";
+EXPORT_SYMBOL_GPL(xen_guest_type);
+
 unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START;
 EXPORT_SYMBOL(machine_to_phys_mapping);
 unsigned long  machine_to_phys_nr;
diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c
index a6d014f47e52..ba6dbff8675d 100644
--- a/arch/x86/xen/enlighten_hvm.c
+++ b/arch/x86/xen/enlighten_hvm.c
@@ -68,13 +68,15 @@ static void __init init_hvm_pv_info(void)
 	xen_domain_type = XEN_HVM_DOMAIN;
 
 	/* PVH set up hypercall page in xen_prepare_pvh(). */
-	if (xen_pvh_domain())
+	if (xen_pvh_domain()) {
 		pv_info.name = "Xen PVH";
-	else {
+		xen_guest_type = "PVH";
+	} else {
 		u64 pfn;
 		uint32_t msr;
 
 		pv_info.name = "Xen HVM";
+		xen_guest_type = "PVHVM";
 		msr = cpuid_ebx(base + 2);
 		pfn = __pa(hypercall_page);
 		wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index f33eef4ebd12..7ac5e93d96f3 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1255,6 +1255,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
 		return;
 
 	xen_domain_type = XEN_PV_DOMAIN;
+	xen_guest_type = "PV";
 
 	xen_setup_features();
 
diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index 84106f9c456c..d641e9970d5d 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void)
 	return sysfs_create_file(hypervisor_kobj, &type_attr.attr);
 }
 
+static ssize_t guest_type_show(struct hyp_sysfs_attr *attr, char *buffer)
+{
+	return sprintf(buffer, "%s\n", xen_guest_type);
+}
+
+HYPERVISOR_ATTR_RO(guest_type);
+
+static int __init xen_sysfs_guest_type_init(void)
+{
+	return sysfs_create_file(hypervisor_kobj, &guest_type_attr.attr);
+}
+
 /* xen version attributes */
 static ssize_t major_show(struct hyp_sysfs_attr *attr, char *buffer)
 {
@@ -471,6 +483,9 @@ static int __init hyper_sysfs_init(void)
 	ret = xen_sysfs_type_init();
 	if (ret)
 		goto out;
+	ret = xen_sysfs_guest_type_init();
+	if (ret)
+		goto guest_type_out;
 	ret = xen_sysfs_version_init();
 	if (ret)
 		goto version_out;
@@ -502,6 +517,8 @@ static int __init hyper_sysfs_init(void)
 comp_out:
 	sysfs_remove_group(hypervisor_kobj, &version_group);
 version_out:
+	sysfs_remove_file(hypervisor_kobj, &guest_type_attr.attr);
+guest_type_out:
 	sysfs_remove_file(hypervisor_kobj, &type_attr.attr);
 out:
 	return ret;
diff --git a/include/xen/xen.h b/include/xen/xen.h
index 6e8b7fc79801..3defb2e03c8b 100644
--- a/include/xen/xen.h
+++ b/include/xen/xen.h
@@ -9,8 +9,10 @@ enum xen_domain_type {
 
 #ifdef CONFIG_XEN
 extern enum xen_domain_type xen_domain_type;
+extern char *xen_guest_type;
 #else
 #define xen_domain_type		XEN_NATIVE
+#define xen_guest_type		"native"
 #endif
 
 #define xen_domain()		(xen_domain_type != XEN_NATIVE)
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] xen: add sysfs node for guest type
  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
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Boris Ostrovsky @ 2017-05-22 13:17 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel


> 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)

Can we ever get this? Xen sysfs node won't load unless we are
!XEN_NATIVE and then we are either PVH or PVHVM.

-boris

> +		"PV": paravirtualized guest (x86)
> +		"PVH": fully virtualized guest without legacy emulation (x86)
> +		"PVHVM": fully virtualized guest using paravirtualized
> +			interfaces (e.g. interrupts, timers) (x86)
> +
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen
  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
  0 siblings, 1 reply; 18+ messages in thread
From: Boris Ostrovsky @ 2017-05-22 13:30 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel

On 05/22/2017 04:56 AM, Juergen Gross wrote:
> Today only a few sysfs nodes under /sys/hypervisor/ are documented
> for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu. Rename
> this file to Documentation/ABI/testing/sysfs-hypervisor and add
> descriptions of the other nodes.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  Documentation/ABI/testing/sysfs-hypervisor     | 131 +++++++++++++++++++++++++
>  Documentation/ABI/testing/sysfs-hypervisor-pmu |  23 -----
>  MAINTAINERS                                    |   1 +
>  3 files changed, 132 insertions(+), 23 deletions(-)
>  create mode 100644 Documentation/ABI/testing/sysfs-hypervisor
>  delete mode 100644 Documentation/ABI/testing/sysfs-hypervisor-pmu
>
> diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor

I wonder whether at least some of the non-pmu entries should by now be
considered stable.

-boris

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  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 13:33   ` Andrew Cooper
  2017-05-22 14:16     ` Juergen Gross
  2017-05-22 14:35     ` Boris Ostrovsky
  2017-05-22 13:45   ` Jan Beulich
                     ` (2 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: Andrew Cooper @ 2017-05-22 13:33 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel; +Cc: boris.ostrovsky

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.

~Andrew

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  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 13:33   ` [Xen-devel] " Andrew Cooper
@ 2017-05-22 13:45   ` Jan Beulich
       [not found]   ` <59230794020000780015BC13@suse.com>
  2017-05-22 15:23   ` Konrad Rzeszutek Wilk
  4 siblings, 0 replies; 18+ messages in thread
From: Jan Beulich @ 2017-05-22 13:45 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, boris.ostrovsky, linux-kernel

>>> On 22.05.17 at 10:57, <jgross@suse.com> wrote:
> --- a/include/xen/xen.h
> +++ b/include/xen/xen.h
> @@ -9,8 +9,10 @@ enum xen_domain_type {
>  
>  #ifdef CONFIG_XEN
>  extern enum xen_domain_type xen_domain_type;
> +extern char *xen_guest_type;

const char * ?

Jan

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  2017-05-22 13:33   ` [Xen-devel] " Andrew Cooper
@ 2017-05-22 14:16     ` Juergen Gross
  2017-05-22 14:35     ` Boris Ostrovsky
  1 sibling, 0 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 14:16 UTC (permalink / raw)
  To: Andrew Cooper, linux-kernel, xen-devel; +Cc: boris.ostrovsky

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 <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.

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen
  2017-05-22 13:30   ` Boris Ostrovsky
@ 2017-05-22 14:20     ` Juergen Gross
  2017-05-22 14:47       ` Boris Ostrovsky
  0 siblings, 1 reply; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 14:20 UTC (permalink / raw)
  To: Boris Ostrovsky, linux-kernel, xen-devel

On 22/05/17 15:30, Boris Ostrovsky wrote:
> On 05/22/2017 04:56 AM, Juergen Gross wrote:
>> Today only a few sysfs nodes under /sys/hypervisor/ are documented
>> for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu. Rename
>> this file to Documentation/ABI/testing/sysfs-hypervisor and add
>> descriptions of the other nodes.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>  Documentation/ABI/testing/sysfs-hypervisor     | 131 +++++++++++++++++++++++++
>>  Documentation/ABI/testing/sysfs-hypervisor-pmu |  23 -----
>>  MAINTAINERS                                    |   1 +
>>  3 files changed, 132 insertions(+), 23 deletions(-)
>>  create mode 100644 Documentation/ABI/testing/sysfs-hypervisor
>>  delete mode 100644 Documentation/ABI/testing/sysfs-hypervisor-pmu
>>
>> diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor
> 
> I wonder whether at least some of the non-pmu entries should by now be
> considered stable.

Hmm, do you think the pmu entries are not?

I could:

a) move sysfs-hypervisor as posted here to stable
b) leave the pmu entries in testing and just add another doc for
   the non-pmu entries in stable
c) do some split of the non-pmu entries (which to put where?)
d) or let it all in testing

Next question then: where to put the new guest_type of patch 2?


Juergen

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
       [not found]   ` <59230794020000780015BC13@suse.com>
@ 2017-05-22 14:20     ` Juergen Gross
  0 siblings, 0 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 14:20 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, boris.ostrovsky, linux-kernel

On 22/05/17 15:45, Jan Beulich wrote:
>>>> On 22.05.17 at 10:57, <jgross@suse.com> wrote:
>> --- a/include/xen/xen.h
>> +++ b/include/xen/xen.h
>> @@ -9,8 +9,10 @@ enum xen_domain_type {
>>  
>>  #ifdef CONFIG_XEN
>>  extern enum xen_domain_type xen_domain_type;
>> +extern char *xen_guest_type;
> 
> const char * ?

Yes.


Juergen

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] xen: add sysfs node for guest type
  2017-05-22 13:17   ` Boris Ostrovsky
@ 2017-05-22 14:21     ` Juergen Gross
  0 siblings, 0 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 14:21 UTC (permalink / raw)
  To: Boris Ostrovsky, linux-kernel, xen-devel

On 22/05/17 15:17, Boris Ostrovsky wrote:
> 
>> 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)
> 
> Can we ever get this? Xen sysfs node won't load unless we are
> !XEN_NATIVE and then we are either PVH or PVHVM.

When we remove PVHVM as suggested by Andrew, HVM will be kept. :-)


Juergen

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  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
  1 sibling, 1 reply; 18+ messages in thread
From: Boris Ostrovsky @ 2017-05-22 14:35 UTC (permalink / raw)
  To: Andrew Cooper, Juergen Gross, linux-kernel, xen-devel

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?

-boris

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  2017-05-22 14:35     ` Boris Ostrovsky
@ 2017-05-22 14:38       ` Andrew Cooper
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Cooper @ 2017-05-22 14:38 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross, linux-kernel, xen-devel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] doc,xen: document hypervisor sysfs nodes for xen
  2017-05-22 14:20     ` Juergen Gross
@ 2017-05-22 14:47       ` Boris Ostrovsky
  0 siblings, 0 replies; 18+ messages in thread
From: Boris Ostrovsky @ 2017-05-22 14:47 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel

On 05/22/2017 10:20 AM, Juergen Gross wrote:
> On 22/05/17 15:30, Boris Ostrovsky wrote:
>> On 05/22/2017 04:56 AM, Juergen Gross wrote:
>>> Today only a few sysfs nodes under /sys/hypervisor/ are documented
>>> for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu. Rename
>>> this file to Documentation/ABI/testing/sysfs-hypervisor and add
>>> descriptions of the other nodes.
>>>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>>  Documentation/ABI/testing/sysfs-hypervisor     | 131 +++++++++++++++++++++++++
>>>  Documentation/ABI/testing/sysfs-hypervisor-pmu |  23 -----
>>>  MAINTAINERS                                    |   1 +
>>>  3 files changed, 132 insertions(+), 23 deletions(-)
>>>  create mode 100644 Documentation/ABI/testing/sysfs-hypervisor
>>>  delete mode 100644 Documentation/ABI/testing/sysfs-hypervisor-pmu
>>>
>>> diff --git a/Documentation/ABI/testing/sysfs-hypervisor b/Documentation/ABI/testing/sysfs-hypervisor
>> I wonder whether at least some of the non-pmu entries should by now be
>> considered stable.
> Hmm, do you think the pmu entries are not?

Given XSA-163 I don't think we can declare PMU stable.

>
> I could:
>
> a) move sysfs-hypervisor as posted here to stable
> b) leave the pmu entries in testing and just add another doc for
>    the non-pmu entries in stable
> c) do some split of the non-pmu entries (which to put where?)
> d) or let it all in testing

I'd say (b).

>
> Next question then: where to put the new guest_type of patch 2?

Since this is just being added testing/sysfs-hypervisor seems to be the
proper place. Especially with documentation suggesting that 2-year
back-compatibility is needed for an interface to be declared stable.

-boris

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  2017-05-22  8:57 ` [PATCH 2/2] xen: add sysfs node for guest type Juergen Gross
                     ` (3 preceding siblings ...)
       [not found]   ` <59230794020000780015BC13@suse.com>
@ 2017-05-22 15:23   ` Konrad Rzeszutek Wilk
  2017-05-22 15:28     ` Juergen Gross
  4 siblings, 1 reply; 18+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-05-22 15:23 UTC (permalink / raw)
  To: Juergen Gross; +Cc: linux-kernel, xen-devel, boris.ostrovsky

On Mon, May 22, 2017 at 10:57:00AM +0200, 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 +++++++++++++

You forgot to CC Greg KH who is the maintainer of that file.
>  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)

What about KVM? Shouldn't that also be here?

And what should be there if say you boot without Xen, what is the correct value
on x86 (above 'native' says arm)?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  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>
  0 siblings, 2 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 15:28 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: linux-kernel, xen-devel, boris.ostrovsky

On 22/05/17 17:23, Konrad Rzeszutek Wilk wrote:
> On Mon, May 22, 2017 at 10:57:00AM +0200, 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 +++++++++++++
> 
> You forgot to CC Greg KH who is the maintainer of that file.

Hmm, right.

>>  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)
> 
> What about KVM? Shouldn't that also be here?

/sys/hypervisor is Xen-only (at least up to now).

> And what should be there if say you boot without Xen, what is the correct value
> on x86 (above 'native' says arm)?

The node isn't existing.


Juergen

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
  2017-05-22 15:28     ` Juergen Gross
@ 2017-05-22 15:37       ` Jan Beulich
       [not found]       ` <592321E4020000780015BD0E@suse.com>
  1 sibling, 0 replies; 18+ messages in thread
From: Jan Beulich @ 2017-05-22 15:37 UTC (permalink / raw)
  To: Juergen Gross
  Cc: xen-devel, boris.ostrovsky, Konrad Rzeszutek Wilk, linux-kernel

>>> On 22.05.17 at 17:28, <jgross@suse.com> wrote:
> On 22/05/17 17:23, Konrad Rzeszutek Wilk wrote:
>> On Mon, May 22, 2017 at 10:57:00AM +0200, Juergen Gross wrote:
>>> --- 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)
>> 
>> What about KVM? Shouldn't that also be here?
> 
> /sys/hypervisor is Xen-only (at least up to now).

How that? It's being created by drivers/base/hypervisor.c,
and iirc had been introduced for s390 originally.

Jan

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xen-devel] [PATCH 2/2] xen: add sysfs node for guest type
       [not found]       ` <592321E4020000780015BD0E@suse.com>
@ 2017-05-22 15:52         ` Juergen Gross
  0 siblings, 0 replies; 18+ messages in thread
From: Juergen Gross @ 2017-05-22 15:52 UTC (permalink / raw)
  To: Jan Beulich
  Cc: xen-devel, boris.ostrovsky, Konrad Rzeszutek Wilk, linux-kernel

On 22/05/17 17:37, Jan Beulich wrote:
>>>> On 22.05.17 at 17:28, <jgross@suse.com> wrote:
>> On 22/05/17 17:23, Konrad Rzeszutek Wilk wrote:
>>> On Mon, May 22, 2017 at 10:57:00AM +0200, Juergen Gross wrote:
>>>> --- 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)
>>>
>>> What about KVM? Shouldn't that also be here?
>>
>> /sys/hypervisor is Xen-only (at least up to now).
> 
> How that? It's being created by drivers/base/hypervisor.c,
> and iirc had been introduced for s390 originally.

Hmm, cscope fooled me. Maybe it should build the data base for all
architectures...

Thanks for the note!


Juergen

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-05-22 15:52 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).