csky updates for 5.15-rc6

Only 5 fixups:
  - Make HAVE_TCM depend on !COMPILE_TEST
  - bitops: Remove duplicate __clear_bit define
  - Select ARCH_WANT_FRAME_POINTERS only if compiler supports it
  - Fixup regs.sr broken in ptrace
  - don't let sigreturn play with priveleged bits of status register
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCgAwFiEE2KAv+isbWR/viAKHAXH1GYaIxXsFAmFqF5sSHGd1b3JlbkBr
 ZXJuZWwub3JnAAoJEAFx9RmGiMV7kr0P/i6S3luEFLpzdFDEM7r4hsxWcM79V6MY
 Dohmkfo/z0XQjXBerdjfb52aAfI26XieBX0FOCQclLqUG9DQK5hFjRRpGtsy8poH
 Q37EtWj+mPU1a8saDfz1NwmssuhmS6CmXxwTyIPkj+XmjzVfFIQNTdC8izfrU2XG
 nkpUPcPzA51wmHl7Ekio4NtpV06f47yrWSZ51d0IkcaHykUluvAKq2Lo11814OFt
 p1e3zO2JhXzwjI+c9JNUJW8Yfdsu5AhHv4e+268DDqy43i1DVMTJyoMwDFxhNN/r
 2ridy2ubkmk2iKVT25MHT9DdskI5x0Jp6c7sQyAZnKaVx9eniR3twhgv2W6nbvpr
 LIIhnmkEfDRw1L0vbIIJE4kk7qiPuX3v6Cmt3QkWie1CRghcHe8q9CV0C1hIgR6X
 k9kMo4eYrAVlOXAowK6mT9bC/MSF/SM5CKqjsqGbNla0ARgXYg7Y+SWd9YJyqKe0
 Bpqz8FgWq0fyT4lNSXQeQRX9robt+bNl90t9eRyYdN/hiVl2du36isRGE/xn0YYC
 5Q4pjTnInacmpLSKkPRTkhU/bXqcgmj0dfkjaIJtqYftJSckQDiLmiaIZ0LWq6js
 eTpbZ2j7aQ3VndXaO+s79alXoeQNIkM9A7q3C7Sl6KXhRFiyrsTl4COiHDZAeKm4
 XIBYuiCQymJS
 =L/sb
 -----END PGP SIGNATURE-----

Merge tag 'csky-for-linus-5.15-rc6' of git://github.com/c-sky/csky-linux

Pull csky fixes from Guo Ren:
 "Only 5 fixups:

   - Make HAVE_TCM depend on !COMPILE_TEST

   - bitops: Remove duplicate __clear_bit define

   - Select ARCH_WANT_FRAME_POINTERS only if compiler supports it

   - Fixup regs.sr broken in ptrace

   - don't let sigreturn play with priveleged bits of status register"

* tag 'csky-for-linus-5.15-rc6' of git://github.com/c-sky/csky-linux:
  csky: Make HAVE_TCM depend on !COMPILE_TEST
  csky: bitops: Remove duplicate __clear_bit define
  csky: Select ARCH_WANT_FRAME_POINTERS only if compiler supports it
  csky: Fixup regs.sr broken in ptrace
  csky: don't let sigreturn play with priveleged bits of status register
This commit is contained in:
Linus Torvalds 2021-10-16 09:12:18 -07:00
commit c13f946bf1
4 changed files with 8 additions and 3 deletions

View File

@ -8,7 +8,7 @@ config CSKY
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_QUEUED_RWLOCKS
select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && $(cc-option,-mbacktrace)
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
select COMMON_CLK
select CLKSRC_MMIO
@ -241,6 +241,7 @@ endchoice
menuconfig HAVE_TCM
bool "Tightly-Coupled/Sram Memory"
depends on !COMPILE_TEST
help
The implementation are not only used by TCM (Tightly-Coupled Meory)
but also used by sram on SOC bus. It follow existed linux tcm

View File

@ -74,7 +74,6 @@ static __always_inline unsigned long __fls(unsigned long x)
* bug fix, why only could use atomic!!!!
*/
#include <asm-generic/bitops/non-atomic.h>
#define __clear_bit(nr, vaddr) clear_bit(nr, vaddr)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic.h>

View File

@ -99,7 +99,8 @@ static int gpr_set(struct task_struct *target,
if (ret)
return ret;
regs.sr = task_pt_regs(target)->sr;
/* BIT(0) of regs.sr is Condition Code/Carry bit */
regs.sr = (regs.sr & BIT(0)) | (task_pt_regs(target)->sr & ~BIT(0));
#ifdef CONFIG_CPU_HAS_HILO
regs.dcsr = task_pt_regs(target)->dcsr;
#endif

View File

@ -52,10 +52,14 @@ static long restore_sigcontext(struct pt_regs *regs,
struct sigcontext __user *sc)
{
int err = 0;
unsigned long sr = regs->sr;
/* sc_pt_regs is structured the same as the start of pt_regs */
err |= __copy_from_user(regs, &sc->sc_pt_regs, sizeof(struct pt_regs));
/* BIT(0) of regs->sr is Condition Code/Carry bit */
regs->sr = (sr & ~1) | (regs->sr & 1);
/* Restore the floating-point state. */
err |= restore_fpu_state(sc);