On Tue, 10 Oct 2023 07:38:53 +0000 Janosch Frank <frankja@xxxxxxxxxxxxx> 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@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); 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) > {