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.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux