[kvm-unit-tests PATCH 1/3] lib: s390x: hw: Provide early detect host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux