xen: add xen sysfs nodes
Subsystems (5)
Juergen Gross
maintainerv3 cover xen: add xen sysfs nodes
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.
Add another node to show the Xen hypervisor buildid in order to make hypervisor live patching easier.
Juergen Gross (4):
doc,xen: document hypervisor sysfs nodes for xen
xen: add sysfs node for guest type
xen: sync include/xen/interface/version.h
xen: add sysfs node for hypervisor build id
Documentation/ABI/stable/sysfs-hypervisor-xen | 119 +++++++++++++++++++++
.../{sysfs-hypervisor-pmu => sysfs-hypervisor-xen} | 24 ++++-
MAINTAINERS | 2 +
arch/arm/xen/enlighten.c | 3 +
arch/x86/xen/enlighten.c | 3 +
arch/x86/xen/enlighten_hvm.c | 5 +-
arch/x86/xen/enlighten_pv.c | 1 +
drivers/xen/sys-hypervisor.c | 46 ++++++++
include/xen/interface/version.h | 15 +++
include/xen/xen.h | 2 +
10 files changed, 216 insertions(+), 4 deletions(-)
create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xen
rename Documentation/ABI/testing/{sysfs-hypervisor-pmu => sysfs-hypervisor-xen} (54%)Signature · 1 line
2.12.3
Juergen Gross
maintainerPATCH v3 1/4 doc, xen: document hypervisor sysfs nodes for xen
Today only a few sysfs nodes under /sys/hypervisor/ are documented for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu.
Add the remaining Xen sysfs nodes under /sys/hypervisor/ in a new file Documentation/ABI/stable/sysfs-hypervisor-xen and add the Xen specific sysfs docs to the MAINTAINERS file.
---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)
V2:
- rename file to Documentation/ABI/stable/sysfs-hypervisor-xen in order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)
--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xen
Documentation/ABI/stable/sysfs-hypervisor-xen new file +119 -0
@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.
MAINTAINERS +2 -0
@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
Signature · 7 lines
2.12.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerPATCH v3 1/4 doc,xen: document hypervisor sysfs nodes for xen
In reply to Juergen GrossToday only a few sysfs nodes under /sys/hypervisor/ are documented for Xen in Documentation/ABI/testing/sysfs-hypervisor-pmu.
Add the remaining Xen sysfs nodes under /sys/hypervisor/ in a new file Documentation/ABI/stable/sysfs-hypervisor-xen and add the Xen specific sysfs docs to the MAINTAINERS file.
---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)
V2:
- rename file to Documentation/ABI/stable/sysfs-hypervisor-xen in order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)
--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xen
Documentation/ABI/stable/sysfs-hypervisor-xen new file +119 -0
@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.
MAINTAINERS +2 -0
@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
Signature · 1 line
2.12.3
Re: [PATCH v3 1/4] doc, xen: document hypervisor sysfs nodes for xen
+ Stefano for ARM.
Quoted 55 lines · Juergen Gross
Today only a few sysfs nodes under
/sys/hypervisor/are documented for Xen inDocumentation/ABI/testing/sysfs-hypervisor-pmu.Add the remaining Xen sysfs nodes under
/sys/hypervisor/in a new fileDocumentation/ABI/stable/sysfs-hypervisor-xenand add the Xen specific sysfs docs to theMAINTAINERSfile.Signed-off-by Juergen Gross <[email protected]>---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)V2:
- rename file toDocumentation/ABI/stable/sysfs-hypervisor-xenin order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xenDocumentation/ABI/stable/sysfs-hypervisor-xen new file +27
-0@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. +
Documentation/ABI/stable/sysfs-hypervisor-xen line 37
Quoted 10 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +10
-0+What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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
s/full/fully/
Other than that
-boris
Quoted 87 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +82
-0+ <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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.MAINTAINERS +0
-0
MAINTAINERS F: drivers/xen/ · line 13989
Quoted 8 lines
MAINTAINERS +2
-0@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v3 1/4] doc,xen: document hypervisor sysfs nodes for xen
In reply to Juergen Gross+ Stefano for ARM.
Quoted 55 lines · Juergen Gross
Today only a few sysfs nodes under
/sys/hypervisor/are documented for Xen inDocumentation/ABI/testing/sysfs-hypervisor-pmu.Add the remaining Xen sysfs nodes under
/sys/hypervisor/in a new fileDocumentation/ABI/stable/sysfs-hypervisor-xenand add the Xen specific sysfs docs to theMAINTAINERSfile.Signed-off-by Juergen Gross <[email protected]>---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)V2:
- rename file toDocumentation/ABI/stable/sysfs-hypervisor-xenin order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xenDocumentation/ABI/stable/sysfs-hypervisor-xen new file +27
-0@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. +
Documentation/ABI/stable/sysfs-hypervisor-xen line 37
Quoted 10 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +10
-0+What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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
s/full/fully/
Other than that
-boris
Quoted 95 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +82
-0+ <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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.MAINTAINERS +2
-0@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
Re: [PATCH v3 1/4] doc,xen: document hypervisor sysfs nodes for xen
Quoted 71 lines · Boris Ostrovsky
+ Stefano for ARM.
Quoted 55 lines · Juergen Gross
Today only a few sysfs nodes under
/sys/hypervisor/are documented for Xen inDocumentation/ABI/testing/sysfs-hypervisor-pmu.Add the remaining Xen sysfs nodes under
/sys/hypervisor/in a new fileDocumentation/ABI/stable/sysfs-hypervisor-xenand add the Xen specific sysfs docs to theMAINTAINERSfile.Signed-off-by Juergen Gross <[email protected]>---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)V2:
- rename file toDocumentation/ABI/stable/sysfs-hypervisor-xenin order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xenDocumentation/ABI/stable/sysfs-hypervisor-xen new file +27
-0@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. +Documentation/ABI/stable/sysfs-hypervisor-xen line 37
Quoted 10 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +10
-0+What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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 virtualizeds/full/fully/
Quoted 3 lines
Other than that
Reviewed-by Boris Ostrovsky <[email protected]>
Quoted 96 lines
Quoted 95 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +82
-0+ <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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.MAINTAINERS +2
-0@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
Re: [PATCH v3 1/4] doc, xen: document hypervisor sysfs nodes for xen
In reply to Boris OstrovskyQuoted 71 lines · Boris Ostrovsky
+ Stefano for ARM.
Quoted 55 lines · Juergen Gross
Today only a few sysfs nodes under
/sys/hypervisor/are documented for Xen inDocumentation/ABI/testing/sysfs-hypervisor-pmu.Add the remaining Xen sysfs nodes under
/sys/hypervisor/in a new fileDocumentation/ABI/stable/sysfs-hypervisor-xenand add the Xen specific sysfs docs to theMAINTAINERSfile.Signed-off-by Juergen Gross <[email protected]>---
V3:
- added hint for hidden values where appropriate (Andrew Cooper)V2:
- rename file toDocumentation/ABI/stable/sysfs-hypervisor-xenin order to reflect Xen dependency
- leave pmu entries in old file under testing (Boris Ostrovsky)--- Documentation/ABI/stable/sysfs-hypervisor-xen | 119 ++++++++++++++++++++++++++ MAINTAINERS | 2 + 2 files changed, 121 insertions(+) create mode 100644 Documentation/ABI/stable/sysfs-hypervisor-xenDocumentation/ABI/stable/sysfs-hypervisor-xen new file +27
-0@@ -0,0 +1,119 @@ +What: /sys/hypervisor/compilation/compile_date +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains the build time stamp of the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiled_by +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Contains information who built the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/compilation/compiler +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Compiler which was used to build the Xen hypervisor + Might return "<denied>" in case of special security settings + in the hypervisor. +Documentation/ABI/stable/sysfs-hypervisor-xen line 37
Quoted 10 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +10
-0+What: /sys/hypervisor/properties/capabilities +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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 virtualizeds/full/fully/
Quoted 3 lines
Other than that
Reviewed-by Boris Ostrovsky <[email protected]>
Quoted 93 lines
Quoted 93 lines
Documentation/ABI/stable/sysfs-hypervisor-xen new file +82
-0+ <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: [email protected] +Description: If running under Xen: + Changeset of the hypervisor (git commit) + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/features +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + Default page size of the hypervisor printed as a hex value. + Might return "0" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/properties/virtual_start +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Virtual address of the hypervisor as a hex value. + +What: /sys/hypervisor/type +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + Type of hypervisor: + "xen": Xen hypervisor + +What: /sys/hypervisor/uuid +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + UUID of the guest as known to the Xen hypervisor. + +What: /sys/hypervisor/version/extra +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <extra> part of it. + Might return "<denied>" in case of special security settings + in the hypervisor. + +What: /sys/hypervisor/version/major +Date: March 2009 +KernelVersion: 2.6.30 +Contact: [email protected] +Description: If running under Xen: + 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: [email protected] +Description: If running under Xen: + The Xen version is in the format <major>.<minor><extra> + This is the <minor> part of it.MAINTAINERS +2
-0@@ -13982,6 +13982,8 @@ F: drivers/xen/ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ +F: Documentation/ABI/stable/sysfs-hypervisor-xen +F: Documentation/ABI/testing/sysfs-hypervisor-pmu
Quoted 3 lines
MAINTAINERS F: drivers/xen/ · line 13989
Quoted 2 lines
MAINTAINERS +0
-0XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerPATCH v3 2/4 xen: add sysfs node for guest type
In reply to Juergen GrossCurrently 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.
---
V2:
- remove PVHVM guest type (Andrew Cooper)
- move description to Documentation/ABI/testing/sysfs-hypervisor-xen (Boris Ostrovsky)
- make xen_guest_type const char * (Jan Beulich)
- modify standard ARM guest type to "Xen"
---
.../{sysfs-hypervisor-pmu => sysfs-hypervisor-xen} | 15 +++++++++++++--
MAINTAINERS | 2 +-
arch/arm/xen/enlighten.c | 3 +++
arch/x86/xen/enlighten.c | 3 +++
arch/x86/xen/enlighten_hvm.c | 5 +++--
arch/x86/xen/enlighten_pv.c | 1 +
drivers/xen/sys-hypervisor.c | 17 +++++++++++++++++
include/xen/xen.h | 2 ++
8 files changed, 43 insertions(+), 5 deletions(-)
rename Documentation/ABI/testing/{sysfs-hypervisor-pmu => sysfs-hypervisor-xen} (67%)Documentation/ABI/testing/sysfs-hypervisor-xen renamed from Documentation/ABI/testing/sysfs-hypervisor-pmu +13 -2
@@ -1,8 +1,19 @@ +What: /sys/hypervisor/guest_type +Date: May 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Type of guest: + "Xen": standard guest type on arm + "HVM": fully virtualized guest (x86) + "PV": paravirtualized guest (x86) + "PVH": fully virtualized guest without legacy emulation (x86) + What: /sys/hypervisor/pmu/pmu_mode Date: August 2015 KernelVersion: 4.3 Contact: Boris Ostrovsky <[email protected]> -Description: +Description: If running under Xen: Describes mode that Xen's performance-monitoring unit (PMU) uses. Accepted values are "off" -- PMU is disabled
@@ -17,7 +28,7 @@ What: /sys/hypervisor/pmu/pmu_features Date: August 2015 KernelVersion: 4.3 Contact: Boris Ostrovsky <[email protected]> -Description: +Description: If running under Xen: 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
MAINTAINERS +1 -1
@@ -13983,7 +13983,7 @@ F: arch/x86/include/asm/xen/ F: include/xen/ F: include/uapi/xen/ F: Documentation/ABI/stable/sysfs-hypervisor-xen -F: Documentation/ABI/testing/sysfs-hypervisor-pmu +F: Documentation/ABI/testing/sysfs-hypervisor-xen XEN HYPERVISOR ARM M: Stefano Stabellini <[email protected]>
arch/arm/xen/enlighten.c +3 -0
@@ -43,6 +43,9 @@ EXPORT_SYMBOL(xen_start_info);enum xen_domain_type xen_domain_type =XEN_NATIVE ;EXPORT_SYMBOL (xen_domain_type); +const char *xen_guest_type ="Xen" ; +EXPORT_SYMBOL_GPL (xen_guest_type); +struct shared_info xen_dummy_shared_info;struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
arch/x86/xen/enlighten.c +3 -0
@@ -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); +const 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;
arch/x86/xen/enlighten_hvm.c +3 -2
@@ -68,9 +68,10 @@ 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;
arch/x86/xen/enlighten_pv.c +1 -0
@@ -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 ();
drivers/xen/sys-hypervisor.c +17 -0
@@ -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;
include/xen/xen.h +2 -0
@@ -9,8 +9,10 @@ enum xen_domain_type {#ifdef CONFIG_XEN extern enum xen_domain_type xen_domain_type; +extern const 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)
Signature · 7 lines
2.12.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 13 lines
drivers/xen/sys-hypervisor.c +4
-0@@ -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); +}
So I know I gave my R-b for this patch but can't we just key off xen_domain_type and not have xen_guest_type at all?
-boris
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
In reply to Juergen Grossdrivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 13 lines
drivers/xen/sys-hypervisor.c +4
-0@@ -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); +}
So I know I gave my R-b for this patch but can't we just key off xen_domain_type and not have xen_guest_type at all?
-boris
Juergen Gross
maintainerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
Quoted 9 lines · Boris Ostrovsky
Quoted 9 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void)return sysfs_create_file (hypervisor_kobj, &type_attr.attr); }
Quoted 8 lines
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 4 lines
drivers/xen/sys-hypervisor.c +4
-0+static ssize_t guest_type_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +return sprintf (buffer,"%s\n" , xen_guest_type); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?
So we'd need to introduce XEN_PVH_DOMAIN and adjust xen_hvm_domain().
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
In reply to Boris OstrovskyQuoted 9 lines · Boris Ostrovsky
Quoted 9 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void)return sysfs_create_file (hypervisor_kobj, &type_attr.attr); }
Quoted 8 lines
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 4 lines
drivers/xen/sys-hypervisor.c +4
-0+static ssize_t guest_type_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +return sprintf (buffer,"%s\n" , xen_guest_type); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?
So we'd need to introduce XEN_PVH_DOMAIN and adjust xen_hvm_domain().
Juergen
Boris Ostrovsky
reviewerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
Quoted 9 lines · Juergen Gross
Quoted 8 lines · Boris Ostrovsky
Quoted 8 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void)return sysfs_create_file (hypervisor_kobj, &type_attr.attr); }
Quoted 8 lines
Quoted 7 lines
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 4 lines
drivers/xen/sys-hypervisor.c +4
-0+static ssize_t guest_type_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +return sprintf (buffer,"%s\n" , xen_guest_type); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?So we'd need to introduce
XEN_PVH_DOMAINand adjustxen_hvm_domain().
Can't we use xen_pvh_domain()?
-boris
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
In reply to Juergen GrossQuoted 9 lines · Juergen Gross
Quoted 8 lines · Boris Ostrovsky
Quoted 8 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -50,6 +50,18 @@ static int __init xen_sysfs_type_init(void)return sysfs_create_file (hypervisor_kobj, &type_attr.attr); }
Quoted 8 lines
Quoted 7 lines
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 4 lines
drivers/xen/sys-hypervisor.c +4
-0+static ssize_t guest_type_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +return sprintf (buffer,"%s\n" , xen_guest_type); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?So we'd need to introduce
XEN_PVH_DOMAINand adjustxen_hvm_domain().
Can't we use xen_pvh_domain()?
-boris
Juergen Gross
maintainerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
Quoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Boris Ostrovsky
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 12 lines
drivers/xen/sys-hypervisor.c +4
-0@@ -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); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?
Quoted 3 lines
Quoted 1 line
So we'd need to introduce
XEN_PVH_DOMAINand adjustxen_hvm_domain().Can't we use
xen_pvh_domain()?
Sure. I thought you meant to have the needed information all in xen_domain_type.
I'll adjust the patch.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v3 2/4] xen: add sysfs node for guest type
In reply to Boris OstrovskyQuoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
Quoted 15 lines · Boris Ostrovsky
drivers/xen/sys-hypervisor.c static int __init xen_sysfs_type_init(void) · line 56
Quoted 12 lines
drivers/xen/sys-hypervisor.c +4
-0@@ -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); +}So I know I gave my R-b for this patch but can't we just key off
xen_domain_typeand not havexen_guest_typeat all?
Quoted 3 lines
Quoted 1 line
So we'd need to introduce
XEN_PVH_DOMAINand adjustxen_hvm_domain().Can't we use
xen_pvh_domain()?
Sure. I thought you meant to have the needed information all in xen_domain_type.
I'll adjust the patch.
Juergen
Juergen Gross
maintainerPATCH v3 3/4 xen: sync include/xen/interface/version.h
In reply to Juergen GrossSync include/xen/interface/version.h with the Xen source.
--- include/xen/interface/version.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/xen/interface/version.h +15 -0
@@ -63,4 +63,19 @@ struct xen_feature_info {/* arg == xen_domain_handle_t. */ #define XENVER_guest_handle 8 +#define XENVER_commandline 9 +struct xen_commandline { +char buf[1024 ]; +}; + +/* +* Return value is the number of bytes written, or XEN_Exx on error. +* Calling with empty parameter returns the size of build_id. +*/ +#define XENVER_build_id 10 +struct xen_build_id { +uint32_t len;/* IN: size of buf[]. */ +unsigned char buf[]; +}; +#endif /* __XEN_PUBLIC_VERSION_H__ */
Signature · 7 lines
2.12.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerPATCH v3 3/4 xen: sync include/xen/interface/version.h
In reply to Juergen GrossSync include/xen/interface/version.h with the Xen source.
--- include/xen/interface/version.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
include/xen/interface/version.h +15 -0
@@ -63,4 +63,19 @@ struct xen_feature_info {/* arg == xen_domain_handle_t. */ #define XENVER_guest_handle 8 +#define XENVER_commandline 9 +struct xen_commandline { +char buf[1024 ]; +}; + +/* +* Return value is the number of bytes written, or XEN_Exx on error. +* Calling with empty parameter returns the size of build_id. +*/ +#define XENVER_build_id 10 +struct xen_build_id { +uint32_t len;/* IN: size of buf[]. */ +unsigned char buf[]; +}; +#endif /* __XEN_PUBLIC_VERSION_H__ */
Signature · 1 line
2.12.3
Re: [PATCH v3 3/4] xen: sync include/xen/interface/version.h
Quoted 3 lines · Juergen Gross
Sync
include/xen/interface/version.hwith the Xen source.Signed-off-by Juergen Gross <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH v3 3/4] xen: sync include/xen/interface/version.h
In reply to Juergen GrossQuoted 3 lines · Juergen Gross
Sync
include/xen/interface/version.hwith the Xen source.Signed-off-by Juergen Gross <[email protected]>
Juergen Gross
maintainerPATCH v3 4/4 xen: add sysfs node for hypervisor build id
In reply to Juergen GrossFor support of Xen hypervisor live patching the hypervisor build id is needed. Add a node /sys/hypervisor/properties/buildid containing the information.
--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-hypervisor-xen +10 -1
@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:
@@ -32,3 +32,12 @@ Description: If running under Xen: 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/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.
drivers/xen/sys-hypervisor.c +29 -0
@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)HYPERVISOR_ATTR_RO (features); +static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy); +if (ret <0 ) { +if (ret == -EPERM ) + ret =sprintf (buffer,"<denied>" ); +return ret; + } + + buildid =kmalloc (sizeof (*buildid) + dummy.len,GFP_KERNEL ); +if (!buildid) +return -ENOMEM ; + + ret =HYPERVISOR_xen_version (XENVER_get_features, buildid); +if (ret >0 ) + ret =sprintf (buffer,"%s" , buildid->buf); +kfree (buildid); + +return ret; +} + +HYPERVISOR_ATTR_RO (buildid); +static struct attribute *xen_properties_attrs[] = { &capabilities_attr.attr, &changeset_attr.attr, &virtual_start_attr.attr, &pagesize_attr.attr, &features_attr.attr, + &buildid_attr.attr,NULL };
Signature · 7 lines
2.12.3 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Juergen Gross
maintainerPATCH v3 4/4 xen: add sysfs node for hypervisor build id
In reply to Juergen GrossFor support of Xen hypervisor live patching the hypervisor build id is needed. Add a node /sys/hypervisor/properties/buildid containing the information.
--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-hypervisor-xen +10 -1
@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:
@@ -32,3 +32,12 @@ Description: If running under Xen: 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/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.
drivers/xen/sys-hypervisor.c +29 -0
@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)HYPERVISOR_ATTR_RO (features); +static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy); +if (ret <0 ) { +if (ret == -EPERM ) + ret =sprintf (buffer,"<denied>" ); +return ret; + } + + buildid =kmalloc (sizeof (*buildid) + dummy.len,GFP_KERNEL ); +if (!buildid) +return -ENOMEM ; + + ret =HYPERVISOR_xen_version (XENVER_get_features, buildid); +if (ret >0 ) + ret =sprintf (buffer,"%s" , buildid->buf); +kfree (buildid); + +return ret; +} + +HYPERVISOR_ATTR_RO (buildid); +static struct attribute *xen_properties_attrs[] = { &capabilities_attr.attr, &changeset_attr.attr, &virtual_start_attr.attr, &pagesize_attr.attr, &features_attr.attr, + &buildid_attr.attr,NULL };
Signature · 1 line
2.12.3
Boris Ostrovsky
reviewerRe: [PATCH v3 4/4] xen: add sysfs node for hypervisor build id
Quoted 24 lines · Juergen Gross
For support of Xen hypervisor live patching the hypervisor build id is needed. Add a node
/sys/hypervisor/properties/buildidcontaining the information.Signed-off-by Juergen Gross <[email protected]>--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)Documentation/ABI/testing/sysfs-hypervisor-xen +1
-1@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:@@ -32,3 +32,12 @@ Description: If running under Xen: Describes Xen PMU features (as an integer). A set bit indicates that the corresponding feature is enabled. See
Documentation/ABI/testing/sysfs-hypervisor-xen Description: If running under Xen: · line 43
Quoted 10 lines
Documentation/ABI/testing/sysfs-hypervisor-xen +9
-0include/xen/interface/xenpmu.h for available features + +What: /sys/hypervisor/properties/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.
It might? I don't see xen_deny() calls in XENVER_build_id (as I said below, assuming that's the command you are using).
Quoted 6 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 349
Quoted 10 lines
drivers/xen/sys-hypervisor.c +8
-0HYPERVISOR_ATTR_RO (features); +static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy);
Why XENVER_get_features and not XENVER_build_id?
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 354
Quoted 5 lines
drivers/xen/sys-hypervisor.c +5
-0+if (ret <0 ) { +if (ret == -EPERM ) + ret =sprintf (buffer,"<denied>" ); +return ret; + }
Assuming you meant XENVER_build_id, how is this supposed to work? Hypervisor code specifically has
if ( build_id.len == 0 )
return -EINVAL;-boris
Quoted 15 lines
drivers/xen/sys-hypervisor.c +15
-0+ + buildid =kmalloc (sizeof (*buildid) + dummy.len,GFP_KERNEL ); +if (!buildid) +return -ENOMEM ; + + ret =HYPERVISOR_xen_version (XENVER_get_features, buildid); +if (ret >0 ) + ret =sprintf (buffer,"%s" , buildid->buf); +kfree (buildid); + +return ret; +} + +HYPERVISOR_ATTR_RO (buildid); +
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 379
Quoted 10 lines
drivers/xen/sys-hypervisor.c +1
-0static struct attribute *xen_properties_attrs[] = { &capabilities_attr.attr, &changeset_attr.attr, &virtual_start_attr.attr, &pagesize_attr.attr, &features_attr.attr, + &buildid_attr.attr,NULL };
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerRe: [PATCH v3 4/4] xen: add sysfs node for hypervisor build id
In reply to Juergen GrossQuoted 24 lines · Juergen Gross
For support of Xen hypervisor live patching the hypervisor build id is needed. Add a node
/sys/hypervisor/properties/buildidcontaining the information.Signed-off-by Juergen Gross <[email protected]>--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)Documentation/ABI/testing/sysfs-hypervisor-xen +1
-1@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:@@ -32,3 +32,12 @@ Description: If running under Xen: Describes Xen PMU features (as an integer). A set bit indicates that the corresponding feature is enabled. See
Documentation/ABI/testing/sysfs-hypervisor-xen Description: If running under Xen: · line 43
Quoted 10 lines
Documentation/ABI/testing/sysfs-hypervisor-xen +9
-0include/xen/interface/xenpmu.h for available features + +What: /sys/hypervisor/properties/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.
It might? I don't see xen_deny() calls in XENVER_build_id (as I said below, assuming that's the command you are using).
Quoted 6 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 349
Quoted 10 lines
drivers/xen/sys-hypervisor.c +8
-0HYPERVISOR_ATTR_RO (features); +static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy);
Why XENVER_get_features and not XENVER_build_id?
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 354
Quoted 5 lines
drivers/xen/sys-hypervisor.c +5
-0+if (ret <0 ) { +if (ret == -EPERM ) + ret =sprintf (buffer,"<denied>" ); +return ret; + }
Assuming you meant XENVER_build_id, how is this supposed to work? Hypervisor code specifically has
if ( build_id.len == 0 )
return -EINVAL;-boris
Quoted 25 lines
drivers/xen/sys-hypervisor.c +16
-0+ + buildid =kmalloc (sizeof (*buildid) + dummy.len,GFP_KERNEL ); +if (!buildid) +return -ENOMEM ; + + ret =HYPERVISOR_xen_version (XENVER_get_features, buildid); +if (ret >0 ) + ret =sprintf (buffer,"%s" , buildid->buf); +kfree (buildid); + +return ret; +} + +HYPERVISOR_ATTR_RO (buildid); +static struct attribute *xen_properties_attrs[] = { &capabilities_attr.attr, &changeset_attr.attr, &virtual_start_attr.attr, &pagesize_attr.attr, &features_attr.attr, + &buildid_attr.attr,NULL };
Juergen Gross
maintainerRe: [PATCH v3 4/4] xen: add sysfs node for hypervisor build id
Quoted 47 lines · Boris Ostrovsky
Quoted 24 lines · Juergen Gross
For support of Xen hypervisor live patching the hypervisor build id is needed. Add a node
/sys/hypervisor/properties/buildidcontaining the information.Signed-off-by Juergen Gross <[email protected]>--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)Documentation/ABI/testing/sysfs-hypervisor-xen +1
-1@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:@@ -32,3 +32,12 @@ Description: If running under Xen: Describes Xen PMU features (as an integer). A set bit indicates that the corresponding feature is enabled. SeeDocumentation/ABI/testing/sysfs-hypervisor-xen Description: If running under Xen: · line 43
Quoted 10 lines
Documentation/ABI/testing/sysfs-hypervisor-xen +9
-0include/xen/interface/xenpmu.h for available features + +What: /sys/hypervisor/properties/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.It might? I don't see
xen_deny()calls inXENVER_build_id(as I said below, assuming that's the command you are using).Quoted 8 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)HYPERVISOR_ATTR_RO (features);
Quoted 10 lines
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 349
Quoted 8 lines
drivers/xen/sys-hypervisor.c +8
-0+static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy);Why
XENVER_get_featuresand notXENVER_build_id?
The patch is looking different in my local tree. I might have missed to do a commit before creating the patch via git format-patch. Will resend.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [PATCH v3 4/4] xen: add sysfs node for hypervisor build id
In reply to Boris OstrovskyQuoted 47 lines · Boris Ostrovsky
Quoted 24 lines · Juergen Gross
For support of Xen hypervisor live patching the hypervisor build id is needed. Add a node
/sys/hypervisor/properties/buildidcontaining the information.Signed-off-by Juergen Gross <[email protected]>--- Documentation/ABI/testing/sysfs-hypervisor-xen | 11 +++++++++- drivers/xen/sys-hypervisor.c | 29 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)Documentation/ABI/testing/sysfs-hypervisor-xen +1
-1@@ -1,5 +1,5 @@ What: /sys/hypervisor/guest_type -Date: May 2017 +Date: June 2017 KernelVersion: 4.13 Contact: [email protected] Description: If running under Xen:@@ -32,3 +32,12 @@ Description: If running under Xen: Describes Xen PMU features (as an integer). A set bit indicates that the corresponding feature is enabled. SeeDocumentation/ABI/testing/sysfs-hypervisor-xen Description: If running under Xen: · line 43
Quoted 10 lines
Documentation/ABI/testing/sysfs-hypervisor-xen +9
-0include/xen/interface/xenpmu.h for available features + +What: /sys/hypervisor/properties/buildid +Date: June 2017 +KernelVersion: 4.13 +Contact: [email protected] +Description: If running under Xen: + Build id of the hypervisor, needed for hypervisor live patching. + Might return "<denied>" in case of special security settings + in the hypervisor.It might? I don't see
xen_deny()calls inXENVER_build_id(as I said below, assuming that's the command you are using).Quoted 8 lines
drivers/xen/sys-hypervisor.c +0
-0@@ -339,12 +339,41 @@ static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)HYPERVISOR_ATTR_RO (features);
Quoted 10 lines
drivers/xen/sys-hypervisor.c static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer) · line 349
Quoted 8 lines
drivers/xen/sys-hypervisor.c +8
-0+static ssize_t buildid_show (struct hyp_sysfs_attr *attr,char *buffer) +{ +ssize_t ret; +struct xen_build_id dummy; +struct xen_build_id *buildid; + + dummy.len =0 ; + ret =HYPERVISOR_xen_version (XENVER_get_features, &dummy);Why
XENVER_get_featuresand notXENVER_build_id?
The patch is looking different in my local tree. I might have missed to do a commit before creating the patch via git format-patch. Will resend.
Juergen