lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 4 Oct 2016 22:10:53 -0400
From:   Keno Fischer <keno@...iacomputing.com>
To:     linux-kernel@...r.kernel.org, anton@...ba.org, mpe@...erman.id.au
Subject: Use of r10 in powerpc syscall entry

Hi Anton,

I was reading the powerpc syscall entry code and git points me at your commit
05b05f28 (powerpc: Relocatable system call no longer uses the LR) for one
part that confused me, so I hope you don't mind a quick question. In particular,
that commit removed the use of r10 to restore lr, but didn't touch the earlier
`mflr r10` to actually save the lr to r10. Is r10 still required there
for some reason
or is that just left over? Part of the reason I'm asking is because it seems
one could use r10, instead of r13 later, i.e.

  #define SYSCALL_PSERIES_2_DIRECT \
-  mflr r10 ; \
  ld r12,PACAKBASE(r13) ; \
  LOAD_HANDLER(r12, system_call_entry) ; \
  mtctr r12 ; \
  mfspr r12,SPRN_SRR1 ; \
- /* Re-use of r13... No spare regs to do this */ \
- li r13,MSR_RI ; \
- mtmsrd r13,1 ; \
+ li r10, MSR_RI ; \
+ mtmsrd r10,1 ; \
- GET_PACA(r13) ; /* get r13 back */ \
  bctr ;

Also only semi-relatedly, I was curious (if you, or anybody reading
happen to know) why
SRR0 and SRR1 are being moved to registers so early in the interrupt handler.
I had speculated that this was because of potential page faults on memory access
that would clobber those registers, but then I noticed the `ld
r12,PACAKBASE(r13)` before `mfspr r12,SPRN_SRR1`, which seemed like it
could touch memory, so I was confused again.

Hope the questions make sense, and sorry if I missed something obvious - I have
very little experience with ppc.

Thanks,
Keno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ