Skip to contentSkip to conversation

s390x: Add time functions to lib

PATCH Janosch Frank 1 participant 1 message Jan 4, 2019 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20190104084225.GB4396@osiris

#1 lore raw

This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --CvHCjPKqO84wTpHSmn6dZD0DsWLYVDyhr
Content-Type: multipart/mixed; boundary="tAwSXV5ey3Vpx42w43MDohYugoZsk2QMg";
protected-headers="v1"
From: Janosch Frank <[email protected]>
To: Heiko Carstens <[email protected]>, Thomas Huth <[email protected]>
Cc: [email protected], [email protected], [email protected]
Message-ID: <[email protected]>
Subject: Re: [kvm-unit-tests PATCH v4 12/13] s390x: Add time functions to lib
References: <[email protected]>
<[email protected]> <[email protected]> <20190104084225.GB4396@osiris>
In-Reply-To: <20190104084225.GB4396@osiris>

--tAwSXV5ey3Vpx42w43MDohYugoZsk2QMg
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Quoted 5 lines · Heiko Carstens
Quoted 4 lines · Thomas Huth
Quoted 3 lines · Janosch Frank

+/*
+ * STCKE returns 16 bytes, which include the epoch, tod value and a
+ * programmable field. The value has to be trimmed to be able to wor=

k

Quoted 1 line
Quoted 1 line
Quoted 1 line

+ * with it. As there's still some time to 2042, this code is not rea=

dy

Quoted 11 lines
Quoted 11 lines

Review

Quoted 9 lines

+ * for multi epoch values.
+ */

(quoted diff) +7 -0
+static inline void stcke(char *tod)
+{
+	asm volatile(
+		"	stcke	%[tod]\n"
+		: [tod] "=3DQ" (tod)
+		: : "cc");
+}

I'm not an inline-assembly wizzard, but the "=3DQ" constraint looks wr=

ong

Quoted 4 lines
Quoted 1 line

to me here. Are you sure that this is working as expected?

=20
Yes, this is wrong. That's the reason why the kernel variant has the typedef + cast (see get_tod_clock_ext() in arch/s390/include/asm/timex.=

h).

Quoted 2 lines

=20
The variant above tells the compiler that only a single byte is written=

to.

Quoted 1 line

=20

Yep, was removed yesterday already.
If tests for multi epoch enablement come up they'll have to introduce it again.

For now I'll keep #12 and #13 on hold until they are needed upstream, I think there will not be huge conflicts in that area if the need to upstream it arises later.

--tAwSXV5ey3Vpx42w43MDohYugoZsk2QMg--

--CvHCjPKqO84wTpHSmn6dZD0DsWLYVDyhr
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJcLzAyAAoJEONU5rjiOLn4gsAQAIMxPd7xhDhxPdgtKOt8gSpz zlcmhsTSO1GEbmvqGdnPrp9Nuq1RuoIKTzIttFeFIJlUp7VF5b28Rirm2+U3rV2N yGCfLoYzZ6ZbnlOYQSetrPMN6w4/hXy1ZD38GzKYdbZ4jjYRccD4BUlvFVX2Q68R oOGXoRzSj+tlThKsSsfiUUZruG+xBmVcZoIi7GtWZVcALhXkJ7y/wjcpnc0Z4a1a FrQNfYZiLiXil4DHXQ1wrfub6P8y5udE+khzc2YtiqMPAv6euKWXmJNdWrt5FIVP nHD99Vna3SZu/HwQorf3WKpGHwslYbHyAxQdX7HvXNop2x7sd4b3/mELGpZLJi+7 yS6FweKsaxxLYeiMkC+rHRb0B9b67lZ43oukkqg9y52FdPHbQ6CSClsxhbgD4fOp 7IezBm7eFhGAAe6qiJNkcwH/80s3sCEIvtYOqnUWVyYIFACiebIL6kf5+Geh9oLp 2FU0owtjDQucScuBbA5FHFehafMtRwycJnAodKGaN4g8xui7W+b+Y30QhOACVc7G LgvhdHQMqHjRdqe/ivPbvLmEyBIObBKzsWWZPP48I/FyB7gRG1oBruvOxPaooMZC J0z8IaNKi8nUzTqz0V/exTKk9OfyYZ0DC4iiVzUcMCwxHtUT2RuMyiYMqx3UNl1H SXd/dzHucdGyb6h+lKxW
=Rc48
-----END PGP SIGNATURE-----

--CvHCjPKqO84wTpHSmn6dZD0DsWLYVDyhr--