Content-Type: multipart/mixed; boundary="===============2083370667582904878==" MIME-Version: 1.0 From: Baoquan He To: kbuild-all@lists.01.org Subject: Re: [PATCH v2 1/2] s390/kexec: check the return value of ipl_report_finish Date: Fri, 26 Nov 2021 17:36:20 +0800 Message-ID: <20211126093620.GK21646@MiWiFi-R3L-srv> In-Reply-To: <202111261649.WZQbFG5g-lkp@intel.com> List-Id: --===============2083370667582904878== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, On 11/26/21 at 04:21pm, kernel test robot wrote: > Hi Baoquan, > = > I love your patch! Perhaps something to improve: > = > [auto build test WARNING on s390/features] > [also build test WARNING on kvms390/next] > [cannot apply to linux/master linus/master v5.16-rc2 next-20211126] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > = > url: https://github.com/0day-ci/linux/commits/Baoquan-He/s390-kexec-ch= eck-the-return-value-of-ipl_report_finish/20211116-112827 > base: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git fe= atures > config: s390-allyesconfig (https://download.01.org/0day-ci/archive/202111= 26/202111261649.WZQbFG5g-lkp(a)intel.com/config) > compiler: s390-linux-gcc (GCC) 11.2.0 > reproduce (this is a W=3D1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbi= n/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/0day-ci/linux/commit/27ed543b2d76a1d948c64d4= 404c180ba31ca8cff > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Baoquan-He/s390-kexec-check-the-= return-value-of-ipl_report_finish/20211116-112827 > git checkout 27ed543b2d76a1d948c64d4404c180ba31ca8cff > # save the config file to linux build tree > COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cro= ss ARCH=3Ds390 = > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > All warnings (new ones prefixed by >>): > = > arch/s390/kernel/ipl.c: In function 'ipl_report_finish': > >> arch/s390/kernel/ipl.c:2159:24: warning: returning 'void *' from a fun= ction with return type 'int' makes integer from pointer without a cast [-Wi= nt-conversion] > 2159 | return ERR_PTR(-ENOMEM); > | ^~~~~~~~~~~~~~~~ S390 maintainer has taken another way to fix the issue, so this patch 1/1 is dropped, then this issue identified by lkp doesn't exist any more. = > = > = > vim +2159 arch/s390/kernel/ipl.c > = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2146 = > 27ed543b2d76a1 Baoquan He 2021-11-16 2147 int ipl_report_finish= (struct ipl_report *report, void **ipl_buf) > 937347ac56bfca Martin Schwidefsky 2019-02-25 2148 { > 937347ac56bfca Martin Schwidefsky 2019-02-25 2149 struct ipl_report_ce= rtificate *cert; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2150 struct ipl_report_co= mponent *comp; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2151 struct ipl_rb_certif= icates *certs; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2152 struct ipl_parameter= _block *ipib; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2153 struct ipl_rb_compon= ents *comps; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2154 struct ipl_rl_hdr *r= l_hdr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2155 void *buf, *ptr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2156 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2157 buf =3D vzalloc(repo= rt->size); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2158 if (!buf) > 937347ac56bfca Martin Schwidefsky 2019-02-25 @2159 return ERR_PTR(-ENO= MEM); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2160 ptr =3D buf; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2161 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2162 memcpy(ptr, report->= ipib, report->ipib->hdr.len); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2163 ipib =3D ptr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2164 if (ipl_secure_flag) > 937347ac56bfca Martin Schwidefsky 2019-02-25 2165 ipib->hdr.flags |= =3D IPL_PL_FLAG_SIPL; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2166 ipib->hdr.flags |=3D= IPL_PL_FLAG_IPLSR; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2167 ptr +=3D report->ipi= b->hdr.len; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2168 ptr =3D PTR_ALIGN(pt= r, 8); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2169 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2170 rl_hdr =3D ptr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2171 ptr +=3D sizeof(*rl_= hdr); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2172 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2173 comps =3D ptr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2174 comps->rbt =3D IPL_R= BT_COMPONENTS; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2175 ptr +=3D sizeof(*com= ps); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2176 list_for_each_entry(= comp, &report->components, list) { > 937347ac56bfca Martin Schwidefsky 2019-02-25 2177 memcpy(ptr, &comp->= entry, sizeof(comp->entry)); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2178 ptr +=3D sizeof(com= p->entry); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2179 } > 937347ac56bfca Martin Schwidefsky 2019-02-25 2180 comps->len =3D ptr -= (void *)comps; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2181 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2182 certs =3D ptr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2183 certs->rbt =3D IPL_R= BT_CERTIFICATES; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2184 ptr +=3D sizeof(*cer= ts); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2185 list_for_each_entry(= cert, &report->certificates, list) { > 937347ac56bfca Martin Schwidefsky 2019-02-25 2186 memcpy(ptr, &cert->= entry, sizeof(cert->entry)); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2187 ptr +=3D sizeof(cer= t->entry); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2188 } > 937347ac56bfca Martin Schwidefsky 2019-02-25 2189 certs->len =3D ptr -= (void *)certs; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2190 rl_hdr->len =3D ptr = - (void *)rl_hdr; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2191 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2192 list_for_each_entry(= cert, &report->certificates, list) { > 937347ac56bfca Martin Schwidefsky 2019-02-25 2193 memcpy(ptr, cert->k= ey, cert->entry.len); > 937347ac56bfca Martin Schwidefsky 2019-02-25 2194 ptr +=3D cert->entr= y.len; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2195 } > 937347ac56bfca Martin Schwidefsky 2019-02-25 2196 = > 937347ac56bfca Martin Schwidefsky 2019-02-25 2197 BUG_ON(ptr > buf + r= eport->size); > 27ed543b2d76a1 Baoquan He 2021-11-16 2198 *ipl_buf =3D buf; > 27ed543b2d76a1 Baoquan He 2021-11-16 2199 = > 27ed543b2d76a1 Baoquan He 2021-11-16 2200 return 0; > 937347ac56bfca Martin Schwidefsky 2019-02-25 2201 } > 937347ac56bfca Martin Schwidefsky 2019-02-25 2202 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org >=20 --===============2083370667582904878==--