From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com,
nsg@linux.ibm.com, nrb@linux.ibm.com
Subject: [kvm-unit-tests PATCH 1/3] lib: s390x: hw: Provide early detect host
Date: Tue, 10 Oct 2023 07:38:53 +0000 [thread overview]
Message-ID: <20231010073855.26319-2-frankja@linux.ibm.com> (raw)
In-Reply-To: <20231010073855.26319-1-frankja@linux.ibm.com>
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);
static inline uint16_t get_machine_id(void)
{
--
2.34.1
next prev parent reply other threads:[~2023-10-10 7:39 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 ` Janosch Frank [this message]
2023-10-10 10:40 ` [kvm-unit-tests PATCH 1/3] lib: s390x: hw: Provide early detect host Claudio Imbrenda
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=20231010073855.26319-2-frankja@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=david@redhat.com \
--cc=imbrenda@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