[cryptodev:master 7/24] drivers/char/hw_random/cctrng.c:334:49: error: 'fips_enabled' undeclared; did you mean 'vdso_enabled'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   0a8f5989e03476cfb2a7756e33fa4d0163cb4375
commit: a583ed310bb6b514e717c11a30b5a7bc3a65d1b1 [7/24] hwrng: cctrng - introduce Arm CryptoCell driver
config: s390-defconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout a583ed310bb6b514e717c11a30b5a7bc3a65d1b1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/char/hw_random/cctrng.c: In function 'cc_trng_compwork_handler':
>> drivers/char/hw_random/cctrng.c:334:49: error: 'fips_enabled' undeclared (first use in this function); did you mean 'vdso_enabled'?
     334 |  if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
         |                                                 ^~~~~~~~~~~~
         |                                                 vdso_enabled
   drivers/char/hw_random/cctrng.c:334:49: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/char/hw_random/cctrng.c:335:3: error: implicit declaration of function 'fips_fail_notify' [-Werror=implicit-function-declaration]
     335 |   fips_fail_notify();
         |   ^~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +334 drivers/char/hw_random/cctrng.c

   314	
   315	void cc_trng_compwork_handler(struct work_struct *w)
   316	{
   317		u32 isr = 0;
   318		u32 ehr_valid = 0;
   319		struct cctrng_drvdata *drvdata =
   320				container_of(w, struct cctrng_drvdata, compwork);
   321		struct device *dev = &(drvdata->pdev->dev);
   322		int i;
   323	
   324		/* stop DMA and the RNG source */
   325		cc_iowrite(drvdata, CC_RNG_DMA_ENABLE_REG_OFFSET, 0);
   326		cc_iowrite(drvdata, CC_RND_SOURCE_ENABLE_REG_OFFSET, 0);
   327	
   328		/* read RNG_ISR and check for errors */
   329		isr = cc_ioread(drvdata, CC_RNG_ISR_REG_OFFSET);
   330		ehr_valid = CC_REG_FLD_GET(RNG_ISR, EHR_VALID, isr);
   331		dev_dbg(dev, "Got RNG_ISR=0x%08X (EHR_VALID=%u)\n", isr, ehr_valid);
   332	
   333	#ifdef CONFIG_CRYPTO_FIPS
 > 334		if (CC_REG_FLD_GET(RNG_ISR, CRNGT_ERR, isr) && fips_enabled) {
 > 335			fips_fail_notify();
   336			/* FIPS error is fatal */
   337			panic("Got HW CRNGT error while fips is enabled!\n");
   338		}
   339	#endif
   340	
   341		/* Clear all pending RNG interrupts */
   342		cc_iowrite(drvdata, CC_RNG_ICR_REG_OFFSET, isr);
   343	
   344	
   345		if (!ehr_valid) {
   346			/* in case of AUTOCORR/TIMEOUT error, try the next ROSC */
   347			if (CC_REG_FLD_GET(RNG_ISR, AUTOCORR_ERR, isr) ||
   348					CC_REG_FLD_GET(RNG_ISR, WATCHDOG, isr)) {
   349				dev_dbg(dev, "cctrng autocorr/timeout error.\n");
   350				goto next_rosc;
   351			}
   352	
   353			/* in case of VN error, ignore it */
   354		}
   355	
   356		/* read EHR data from registers */
   357		for (i = 0; i < CC_TRNG_EHR_IN_WORDS; i++) {
   358			/* calc word ptr in data_buf */
   359			u32 *buf = (u32 *)drvdata->circ.buf;
   360	
   361			buf[drvdata->circ.head] = cc_ioread(drvdata,
   362					CC_EHR_DATA_0_REG_OFFSET + (i*sizeof(u32)));
   363	
   364			/* EHR_DATA registers are cleared on read. In case 0 value was
   365			 * returned, restart the entropy collection.
   366			 */
   367			if (buf[drvdata->circ.head] == 0) {
   368				dev_dbg(dev, "Got 0 value in EHR. active_rosc %u\n",
   369					drvdata->active_rosc);
   370				goto next_rosc;
   371			}
   372	
   373			circ_idx_inc(&drvdata->circ.head, 1<<2);
   374		}
   375	
   376		atomic_set(&drvdata->pending_hw, 0);
   377	
   378		/* continue to fill data buffer if needed */
   379		if (circ_buf_space(drvdata) >= CC_TRNG_EHR_IN_WORDS) {
   380			if (atomic_cmpxchg(&drvdata->pending_hw, 0, 1) == 0) {
   381				/* Re-enable rnd source */
   382				cc_trng_enable_rnd_source(drvdata);
   383				return;
   384			}
   385		}
   386	
   387		cc_trng_pm_put_suspend(dev);
   388	
   389		dev_dbg(dev, "compwork handler done\n");
   390		return;
   391	
   392	next_rosc:
   393		if ((circ_buf_space(drvdata) >= CC_TRNG_EHR_IN_WORDS) &&
   394				(cc_trng_change_rosc(drvdata) == 0)) {
   395			/* trigger trng hw with next rosc */
   396			cc_trng_hw_trigger(drvdata);
   397		} else {
   398			atomic_set(&drvdata->pending_hw, 0);
   399			cc_trng_pm_put_suspend(dev);
   400		}
   401	}
   402	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux