From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>
Cc: kvm@vger.kernel.org, thuth@redhat.com, david@redhat.com,
nsg@linux.ibm.com, nrb@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH 1/3] lib: s390x: hw: Provide early detect host
Date: Tue, 10 Oct 2023 12:40:29 +0200 [thread overview]
Message-ID: <20231010124029.70abcb0a@p-imbrenda> (raw)
In-Reply-To: <20231010073855.26319-2-frankja@linux.ibm.com>
On Tue, 10 Oct 2023 07:38:53 +0000
Janosch Frank <frankja@linux.ibm.com> wrote:
> For early sclp printing it's necessary to know if we're under LPAR or
> not so we can apply compat SCLP ASCII transformations.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
> lib/s390x/hardware.c | 8 ++++++++
> lib/s390x/hardware.h | 1 +
> 2 files changed, 9 insertions(+)
>
> diff --git a/lib/s390x/hardware.c b/lib/s390x/hardware.c
> index 2bcf9c4c..d5a752c0 100644
> --- a/lib/s390x/hardware.c
> +++ b/lib/s390x/hardware.c
> @@ -52,6 +52,14 @@ static enum s390_host do_detect_host(void *buf)
> return HOST_IS_UNKNOWN;
> }
>
> +enum s390_host detect_host_early(void)
> +{
> + if (stsi_get_fc() == 2)
> + return HOST_IS_LPAR;
> +
> + return HOST_IS_UNKNOWN;
> +}
> +
> enum s390_host detect_host(void)
> {
> static enum s390_host host = HOST_IS_UNKNOWN;
> diff --git a/lib/s390x/hardware.h b/lib/s390x/hardware.h
> index 86fe873c..5e5a9d90 100644
> --- a/lib/s390x/hardware.h
> +++ b/lib/s390x/hardware.h
> @@ -24,6 +24,7 @@ enum s390_host {
> };
>
> enum s390_host detect_host(void);
> +enum s390_host detect_host_early(void);
I wonder if it weren't easier to fix detect_host so it can be used
early....
>
> static inline uint16_t get_machine_id(void)
> {
next prev parent reply other threads:[~2023-10-10 10:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 7:38 [kvm-unit-tests PATCH 0/3] s390x: Improve console handling Janosch Frank
2023-10-10 7:38 ` [kvm-unit-tests PATCH 1/3] lib: s390x: hw: Provide early detect host Janosch Frank
2023-10-10 10:40 ` Claudio Imbrenda [this message]
2023-10-10 11:03 ` Janosch Frank
2023-10-10 11:42 ` Claudio Imbrenda
2023-10-12 11:13 ` Janosch Frank
2023-10-10 7:38 ` [kvm-unit-tests PATCH 2/3] lib: s390x: sclp: Add compat handling for HMC ASCII consoles Janosch Frank
2023-10-10 8:35 ` Nico Boehr
2023-10-10 8:57 ` Janosch Frank
2023-10-10 12:35 ` Nico Boehr
2023-10-10 7:38 ` [kvm-unit-tests PATCH 3/3] lib: s390x: sclp: Add line mode input handling Janosch Frank
2023-10-10 10:33 ` Claudio Imbrenda
2023-10-10 11:05 ` Janosch Frank
2023-10-10 11:44 ` Claudio Imbrenda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231010124029.70abcb0a@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox