Re: [kvm-unit-tests PATCH v4 12/13] s390x: Add time functions to lib

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

 



On Thu, Jan 03, 2019 at 02:52:15PM +0100, Thomas Huth wrote:
> On 2019-01-03 11:08, Janosch Frank wrote:
> > +/*
> > + * STCKE returns 16 bytes, which include the epoch, tod value and a
> > + * programmable field. The value has to be trimmed to be able to work
> > + * with it. As there's still some time to 2042, this code is not ready
> > + * for multi epoch values.
> > + */
> > +static inline void stcke(char *tod)
> > +{
> > +	asm volatile(
> > +		"	stcke	%[tod]\n"
> > +		: [tod] "=Q" (tod)
> > +		: : "cc");
> > +}
> 
> I'm not an inline-assembly wizzard, but the "=Q" constraint looks wrong
> to me here. Are you sure that this is working as expected?

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).

The variant above tells the compiler that only a single byte is written to.




[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