Message ID | 1535734279-10204-1-git-send-email-walling@linux.ibm.com (mailing list archive) |
---|---|
Headers | show |
Series | Use DIAG318 to set Control Program Name & Version Codes | expand |
On 08/31/2018 12:51 PM, Collin Walling wrote: > A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control > Program Code" (CPC) that is composed of: > > 1-byte Control Program Name Code (CPNC) > 7-byte Control Program Version Code (CPVC) composed of: > 3-bytes for Linux Kernel version (determined at build-time) > 3-bytes for Distribution Identifier (referred to as distro_id; set by Kconfig option) > 1-byte trailing NULL > > Note about distro_id: > [ > The initial idea for the 3-byte distro_id is for each distribution to set > three characters that correspond to their distribution name (for a theoretical > distributor "ACME," they could set "ACM" as the distro_id). A registry file > could be included in the s390 kernel documentation to avoid name collisions. > ] Another (likely better) idea is to use 1-byte for the distribution, followed by 2-bytes for major.minor release.
On Fri, Aug 31, 2018 at 03:31:09PM -0400, Collin Walling wrote: > On 08/31/2018 12:51 PM, Collin Walling wrote: > > A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control > > Program Code" (CPC) that is composed of: > > > > 1-byte Control Program Name Code (CPNC) > > 7-byte Control Program Version Code (CPVC) composed of: > > 3-bytes for Linux Kernel version (determined at build-time) > > 3-bytes for Distribution Identifier (referred to as distro_id; set by Kconfig option) > > 1-byte trailing NULL > > > > Note about distro_id: > > [ > > The initial idea for the 3-byte distro_id is for each distribution to set > > three characters that correspond to their distribution name (for a theoretical > > distributor "ACME," they could set "ACM" as the distro_id). A registry file > > could be included in the s390 kernel documentation to avoid name collisions. > > ] > > Another (likely better) idea is to use 1-byte for the distribution, followed > by 2-bytes for major.minor release. That's sounds indeed better. Thanks and regards, Hendrik
On Fri, 31 Aug 2018 12:51:16 -0400 Collin Walling <walling@linux.ibm.com> wrote: > A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control > Program Code" (CPC) that is composed of: > > 1-byte Control Program Name Code (CPNC) > 7-byte Control Program Version Code (CPVC) composed of: > 3-bytes for Linux Kernel version (determined at build-time) > 3-bytes for Distribution Identifier (referred to as distro_id; set by Kconfig option) > 1-byte trailing NULL Is this a new diagnose code, or is just the implementation in Linux new? > > Note about distro_id: > [ > The initial idea for the 3-byte distro_id is for each distribution to set > three characters that correspond to their distribution name (for a theoretical > distributor "ACME," they could set "ACM" as the distro_id). A registry file > could be included in the s390 kernel documentation to avoid name collisions. > ] Yes, I think we do want some kind of registry for this. > > This instruction call is executed once-and-only-once during Kernel setup. > The availability of this instruction depends on Read SCP Info byte 134, bit 0. > Diagnose318's functionality is also emulated by KVM, which means we can > enable this feature for a guest even if the host cannot support it. > > Also introduced with this patchset is a Host Program Identifier (HPID), which > denotes the underlying host environment. > > The CPC and HPID are used for problem diagnosis and allows IBM to identify > control program information by answering the following questions: > > "What environment is this guest running in?" (CPNC) > "What distribution is this guest running?" (CPVC) > "What underlying host environment is this guest running on?" (HPID) Is there also a way for people-who-are-not-IBM to find out what these values have been set to? :) (IOW, is that write-only from a Linux perspective?) I see that for the emulated instruction the values are logged into the debug feature, which seems useful.
On 09/19/2018 05:30 AM, Cornelia Huck wrote: > On Fri, 31 Aug 2018 12:51:16 -0400 > Collin Walling <walling@linux.ibm.com> wrote: > >> A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control >> Program Code" (CPC) that is composed of: >> >> 1-byte Control Program Name Code (CPNC) >> 7-byte Control Program Version Code (CPVC) composed of: >> 3-bytes for Linux Kernel version (determined at build-time) >> 3-bytes for Distribution Identifier (referred to as distro_id; set by Kconfig option) >> 1-byte trailing NULL > > Is this a new diagnose code, or is just the implementation in Linux new? > It is a new diagnose code. >> >> Note about distro_id: >> [ >> The initial idea for the 3-byte distro_id is for each distribution to set >> three characters that correspond to their distribution name (for a theoretical >> distributor "ACME," they could set "ACM" as the distro_id). A registry file >> could be included in the s390 kernel documentation to avoid name collisions. >> ] > > Yes, I think we do want some kind of registry for this. I'll include it in the next round of patches so we can work on a decent format. > >> >> This instruction call is executed once-and-only-once during Kernel setup. >> The availability of this instruction depends on Read SCP Info byte 134, bit 0. >> Diagnose318's functionality is also emulated by KVM, which means we can >> enable this feature for a guest even if the host cannot support it. >> >> Also introduced with this patchset is a Host Program Identifier (HPID), which >> denotes the underlying host environment. >> >> The CPC and HPID are used for problem diagnosis and allows IBM to identify >> control program information by answering the following questions: >> >> "What environment is this guest running in?" (CPNC) >> "What distribution is this guest running?" (CPVC) >> "What underlying host environment is this guest running on?" (HPID) > > Is there also a way for people-who-are-not-IBM to find out what these > values have been set to? :) (IOW, is that write-only from a Linux > perspective?) > > I see that for the emulated instruction the values are logged into the > debug feature, which seems useful. > Maybe it would help to include a toString-esque macro for these values. Then when the HPID and CPNC get logged we will have something us humans can read? :) The distro_id will have to be deciphered via the registry file. Thoughts?
On 09/19/2018 11:30 AM, Cornelia Huck wrote: >> The CPC and HPID are used for problem diagnosis and allows IBM to identify >> control program information by answering the following questions: >> >> "What environment is this guest running in?" (CPNC) >> "What distribution is this guest running?" (CPVC) >> "What underlying host environment is this guest running on?" (HPID) > > Is there also a way for people-who-are-not-IBM to find out what these > values have been set to? :) (IOW, is that write-only from a Linux > perspective?) The name code is pre-defined (4==LINUX). The 7 byte version code is actually free to be defined by the operating system, and Collin has made a proposal. No idea if there are better ways to use the 7 byte.
On Wed, 19 Sep 2018 13:09:34 -0400 Collin Walling <walling@linux.ibm.com> wrote: > On 09/19/2018 05:30 AM, Cornelia Huck wrote: > > On Fri, 31 Aug 2018 12:51:16 -0400 > > Collin Walling <walling@linux.ibm.com> wrote: > >> The CPC and HPID are used for problem diagnosis and allows IBM to identify > >> control program information by answering the following questions: > >> > >> "What environment is this guest running in?" (CPNC) > >> "What distribution is this guest running?" (CPVC) > >> "What underlying host environment is this guest running on?" (HPID) > > > > Is there also a way for people-who-are-not-IBM to find out what these > > values have been set to? :) (IOW, is that write-only from a Linux > > perspective?) > > > > I see that for the emulated instruction the values are logged into the > > debug feature, which seems useful. > > > > Maybe it would help to include a toString-esque macro for these values. Then > when the HPID and CPNC get logged we will have something us humans can read? :) > > The distro_id will have to be deciphered via the registry file. Thoughts? It's probably fine if this has to be decoded outside of the kernel. One thing that came to my mind: Would it be useful to be able to introspect a live guest from the hypervisor? For example, being able to get the CPNC/CPVC from a QEMU monitor command? (The debug feature may wrap around so that the info can get lost, I guess?)