On 21.06.2018 13:44, Thomas Huth wrote: > On 20.06.2018 12:08, David Hildenbrand wrote: >> Right now, each CPU has its own TOD. Especially, the TOD will differ >> based on creation time of a CPU - e.g. when hotplugging a CPU the times >> will differ quite a lot, resulting in stall warnings in the guest. >> >> Let's use a single TOD by implementing our new TOD device. Prepare it >> for TOD-clock epoch extension. >> >> Most importantly, whenever we set the TOD, we have to update the CKC >> timer. >> >> Introduce "tcg_s390x.h" just like "kvm_s390x.h" for tcg specific >> function declarations that should not go into cpu.h. > [...] >> diff --git a/hw/s390x/tod.c b/hw/s390x/tod.c >> index c1b3438452..7495d8c057 100644 >> --- a/hw/s390x/tod.c >> +++ b/hw/s390x/tod.c >> @@ -30,6 +30,17 @@ void s390_init_tod(void) >> qdev_init_nofail(DEVICE(obj)); >> } >> >> +S390TODState *s390_get_tod(void) >> +{ >> + static S390TODState *ts; >> + >> + if (!ts) { >> + ts = S390_TOD(object_resolve_path_type("", TYPE_S390_TOD, NULL)); >> + } >> + >> + return ts; >> +} > > Could you please call that function s390_get_todstate or something > similar? Otherwise it sounds like it could be used to retrieve the time, > and not the state object.
Yes, makes sense! Thanks! > > Thomas > -- Thanks, David / dhildenb