Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682426

Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime() fallback

From "Maciej W. Rozycki" <macro@imgtec.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime() fallback
Date 2017-07-06 15:20 +0200
Message-ID <u0eRk-4MZ-25@gated-at.bofh.it> (permalink)
References <tXnxL-hR-5@gated-at.bofh.it> <tXnxO-hR-63@gated-at.bofh.it> <u02wO-52u-25@gated-at.bofh.it> <u0aXo-2hr-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 6 Jul 2017, James Hogan wrote:

> > > +	asm volatile(
> > > +	"       syscall\n"
> > > +	: "=r" (ret), "=r" (error)
> > > +	: "r" (clkid), "r" (ts), "r" (nr)
> > > +	: "memory");
> > > +
> > > +	return error ? -ret : ret;
> > > +}
> > 
> >  Hmm, are you sure it is safe nowadays WRT the syscall restart convention 
> > to leave out the instruction explicitly loading the syscall number that 
> > would normally immediately precede SYSCALL
> 
> It should be fine. syscall restart only rewinds one (32-bit)
> instruction, and it preserves the syscall number in pt_regs::regs[0]
> (see handle_signal() / do_signal() and this code in e.g. scall32-o32.S:)
> 
> sw      t1, PT_R0(sp)           # save it for syscall restarting

 Fair enough, I just wanted to be sure.

 [This user code is bundled with the kernel, so it can assume whatever the 
kernel does, however general user code does have to conform to the legacy 
restart convention, unless it also requires a kernel version that is new 
enough and has a safety check in place.]

> > (and would have to forcibly use the 32-bit encoding in the microMIPS
> > case)?
> 
> I don't believe there is a 16-bit SYSCALL encoding in microMIPS, at
> least I can't see one in the 5.04 manual.

 I referred to the preceding instruction, presumably LI, that does have a 
16-bit variant in the microMIPS instruction set.

  Maciej

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime()  fallback "Maciej W. Rozycki" <macro@imgtec.com> - 2017-07-06 02:10 +0200
  Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime()  fallback James Hogan <james.hogan@imgtec.com> - 2017-07-06 11:10 +0200
    Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime()  fallback "Maciej W. Rozycki" <macro@imgtec.com> - 2017-07-06 15:20 +0200
      Re: [PATCH v2 2/4] MIPS: VDSO: Add implementation of clock_gettime()  fallback James Hogan <james.hogan@imgtec.com> - 2017-07-06 16:10 +0200

csiph-web