From: kernel test robot <lkp@intel.com>
To: Vineet Gupta <vgupta@synopsys.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-snps-arc@lists.infradead.org
Subject: arch/arc/kernel/signal.c:77:31: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Tue, 5 Dec 2023 00:27:01 +0800 [thread overview]
Message-ID: <202312050038.JnRYRU9j-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 33cc938e65a98f1d29d0a18403dbbee050dcad9a
commit: 96f1b00138cb8f04c742c82d0a7c460b2202e887 ARCv2: save ABI registers across signal handling
date: 2 years, 6 months ago
config: arc-randconfig-r111-20231107 (https://download.01.org/0day-ci/archive/20231205/202312050038.JnRYRU9j-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231205/202312050038.JnRYRU9j-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312050038.JnRYRU9j-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/arc/kernel/signal.c:77:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __user *to @@ got struct user_regs_arcv2 * @@
arch/arc/kernel/signal.c:77:31: sparse: expected void [noderef] __user *to
arch/arc/kernel/signal.c:77:31: sparse: got struct user_regs_arcv2 *
>> arch/arc/kernel/signal.c:88:41: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got struct user_regs_arcv2 * @@
arch/arc/kernel/signal.c:88:41: sparse: expected void const [noderef] __user *from
arch/arc/kernel/signal.c:88:41: sparse: got struct user_regs_arcv2 *
>> arch/arc/kernel/signal.c:134:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sigcontext *mctx @@ got struct sigcontext [noderef] __user * @@
arch/arc/kernel/signal.c:134:42: sparse: expected struct sigcontext *mctx
arch/arc/kernel/signal.c:134:42: sparse: got struct sigcontext [noderef] __user *
arch/arc/kernel/signal.c:153:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sigcontext *mctx @@ got struct sigcontext [noderef] __user * @@
arch/arc/kernel/signal.c:153:45: sparse: expected struct sigcontext *mctx
arch/arc/kernel/signal.c:153:45: sparse: got struct sigcontext [noderef] __user *
vim +77 arch/arc/kernel/signal.c
63
64 static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
65 {
66 int err = 0;
67 #ifndef CONFIG_ISA_ARCOMPACT
68 struct user_regs_arcv2 v2abi;
69
70 v2abi.r30 = regs->r30;
71 #ifdef CONFIG_ARC_HAS_ACCL_REGS
72 v2abi.r58 = regs->r58;
73 v2abi.r59 = regs->r59;
74 #else
75 v2abi.r58 = v2abi.r59 = 0;
76 #endif
> 77 err = __copy_to_user(&mctx->v2abi, &v2abi, sizeof(v2abi));
78 #endif
79 return err;
80 }
81
82 static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)
83 {
84 int err = 0;
85 #ifndef CONFIG_ISA_ARCOMPACT
86 struct user_regs_arcv2 v2abi;
87
> 88 err = __copy_from_user(&v2abi, &mctx->v2abi, sizeof(v2abi));
89
90 regs->r30 = v2abi.r30;
91 #ifdef CONFIG_ARC_HAS_ACCL_REGS
92 regs->r58 = v2abi.r58;
93 regs->r59 = v2abi.r59;
94 #endif
95 #endif
96 return err;
97 }
98
99 static int
100 stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
101 sigset_t *set)
102 {
103 int err;
104 struct user_regs_struct uregs;
105
106 uregs.scratch.bta = regs->bta;
107 uregs.scratch.lp_start = regs->lp_start;
108 uregs.scratch.lp_end = regs->lp_end;
109 uregs.scratch.lp_count = regs->lp_count;
110 uregs.scratch.status32 = regs->status32;
111 uregs.scratch.ret = regs->ret;
112 uregs.scratch.blink = regs->blink;
113 uregs.scratch.fp = regs->fp;
114 uregs.scratch.gp = regs->r26;
115 uregs.scratch.r12 = regs->r12;
116 uregs.scratch.r11 = regs->r11;
117 uregs.scratch.r10 = regs->r10;
118 uregs.scratch.r9 = regs->r9;
119 uregs.scratch.r8 = regs->r8;
120 uregs.scratch.r7 = regs->r7;
121 uregs.scratch.r6 = regs->r6;
122 uregs.scratch.r5 = regs->r5;
123 uregs.scratch.r4 = regs->r4;
124 uregs.scratch.r3 = regs->r3;
125 uregs.scratch.r2 = regs->r2;
126 uregs.scratch.r1 = regs->r1;
127 uregs.scratch.r0 = regs->r0;
128 uregs.scratch.sp = regs->sp;
129
130 err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), &uregs.scratch,
131 sizeof(sf->uc.uc_mcontext.regs.scratch));
132
133 if (is_isa_arcv2())
> 134 err |= save_arcv2_regs(&(sf->uc.uc_mcontext), regs);
135
136 err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
137
138 return err ? -EFAULT : 0;
139 }
140
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
next reply other threads:[~2023-12-04 16:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 16:27 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-12-12 3:59 arch/arc/kernel/signal.c:77:31: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2023-12-08 15:40 kernel test robot
2023-12-07 21:38 kernel test robot
2023-12-02 1:52 kernel test robot
2022-02-25 23:29 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202312050038.JnRYRU9j-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=vgupta@synopsys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).