mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jacky Li <jackyli@google.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	John Allen <john.allen@amd.com>
Cc: kbuild-all@lists.01.org, Herbert Xu <herbert@gondor.apana.org.au>,
	Marc Orr <marcorr@google.com>, Alper Gun <alpergun@google.com>,
	Peter Gonda <pgonda@google.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jacky Li <jackyli@google.com>
Subject: Re: [PATCH 2/2] crypto: ccp - Fail the PSP initialization when writing psp data file failed
Date: Wed, 3 Aug 2022 10:19:21 +0800	[thread overview]
Message-ID: <202208031012.z1rYKkYA-lkp@intel.com> (raw)
In-Reply-To: <20220802185534.735338-3-jackyli@google.com>

Hi Jacky,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on herbert-crypto-2.6/master kvm/queue linus/master v5.19 next-20220802]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jacky-Li/Improve-error-handling-during-INIT_EX-file-initialization/20220803-025617
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220803/202208031012.z1rYKkYA-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/3c3fe5b1821e961cbfe1f3724a5256e6e04bbe92
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Jacky-Li/Improve-error-handling-during-INIT_EX-file-initialization/20220803-025617
        git checkout 3c3fe5b1821e961cbfe1f3724a5256e6e04bbe92
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/crypto/ccp/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from drivers/crypto/ccp/psp-dev.h:13,
                    from drivers/crypto/ccp/sev-dev.c:30:
   drivers/crypto/ccp/sev-dev.c: In function 'sev_write_init_ex_file':
>> drivers/crypto/ccp/sev-dev.c:252:25: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
     252 |                         "SEV: could not open file for write, error %ld\n",
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ^~~
   include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
     144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                        ^~~~~~~
   drivers/crypto/ccp/sev-dev.c:251:17: note: in expansion of macro 'dev_err'
     251 |                 dev_err(sev->dev,
         |                 ^~~~~~~
   drivers/crypto/ccp/sev-dev.c:252:70: note: format string is defined here
     252 |                         "SEV: could not open file for write, error %ld\n",
         |                                                                    ~~^
         |                                                                      |
         |                                                                      long int
         |                                                                    %d


vim +252 drivers/crypto/ccp/sev-dev.c

3d725965f836a7a David Rientjes 2021-12-07  235  
3c3fe5b1821e961 Jacky Li       2022-08-02  236  static int sev_write_init_ex_file(void)
3d725965f836a7a David Rientjes 2021-12-07  237  {
3d725965f836a7a David Rientjes 2021-12-07  238  	struct sev_device *sev = psp_master->sev_data;
3d725965f836a7a David Rientjes 2021-12-07  239  	struct file *fp;
3d725965f836a7a David Rientjes 2021-12-07  240  	loff_t offset = 0;
3d725965f836a7a David Rientjes 2021-12-07  241  	ssize_t nwrite;
3d725965f836a7a David Rientjes 2021-12-07  242  
3d725965f836a7a David Rientjes 2021-12-07  243  	lockdep_assert_held(&sev_cmd_mutex);
3d725965f836a7a David Rientjes 2021-12-07  244  
3d725965f836a7a David Rientjes 2021-12-07  245  	if (!sev_init_ex_buffer)
3c3fe5b1821e961 Jacky Li       2022-08-02  246  		return 0;
3d725965f836a7a David Rientjes 2021-12-07  247  
05def5cacfa0bd5 Jacky Li       2022-04-14  248  	fp = open_file_as_root(init_ex_path, O_CREAT | O_WRONLY, 0600);
3d725965f836a7a David Rientjes 2021-12-07  249  	if (IS_ERR(fp)) {
3c3fe5b1821e961 Jacky Li       2022-08-02  250  		int ret = PTR_ERR(fp);
3d725965f836a7a David Rientjes 2021-12-07  251  		dev_err(sev->dev,
3d725965f836a7a David Rientjes 2021-12-07 @252  			"SEV: could not open file for write, error %ld\n",
3c3fe5b1821e961 Jacky Li       2022-08-02  253  			ret);
3c3fe5b1821e961 Jacky Li       2022-08-02  254  		return ret;
3d725965f836a7a David Rientjes 2021-12-07  255  	}
3d725965f836a7a David Rientjes 2021-12-07  256  
3d725965f836a7a David Rientjes 2021-12-07  257  	nwrite = kernel_write(fp, sev_init_ex_buffer, NV_LENGTH, &offset);
3d725965f836a7a David Rientjes 2021-12-07  258  	vfs_fsync(fp, 0);
3d725965f836a7a David Rientjes 2021-12-07  259  	filp_close(fp, NULL);
3d725965f836a7a David Rientjes 2021-12-07  260  
3d725965f836a7a David Rientjes 2021-12-07  261  	if (nwrite != NV_LENGTH) {
3d725965f836a7a David Rientjes 2021-12-07  262  		dev_err(sev->dev,
3d725965f836a7a David Rientjes 2021-12-07  263  			"SEV: failed to write %u bytes to non volatile memory area, ret %ld\n",
3d725965f836a7a David Rientjes 2021-12-07  264  			NV_LENGTH, nwrite);
3c3fe5b1821e961 Jacky Li       2022-08-02  265  		return -EIO;
3d725965f836a7a David Rientjes 2021-12-07  266  	}
3d725965f836a7a David Rientjes 2021-12-07  267  
3d725965f836a7a David Rientjes 2021-12-07  268  	dev_dbg(sev->dev, "SEV: write successful to NV file\n");
3c3fe5b1821e961 Jacky Li       2022-08-02  269  
3c3fe5b1821e961 Jacky Li       2022-08-02  270  	return 0;
3d725965f836a7a David Rientjes 2021-12-07  271  }
3d725965f836a7a David Rientjes 2021-12-07  272  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-08-03  2:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 18:55 [PATCH 0/2] Improve error handling during INIT_EX file initialization Jacky Li
2022-08-02 18:55 ` [PATCH 1/2] crypto: ccp - Initialize PSP when reading psp data file failed Jacky Li
2022-08-10 20:28   ` Tom Lendacky
2022-08-16 19:31     ` Jacky Li
2022-08-02 18:55 ` [PATCH 2/2] crypto: ccp - Fail the PSP initialization when writing " Jacky Li
2022-08-03  2:19   ` kernel test robot [this message]
2022-08-10 20:37   ` Tom Lendacky
2022-08-16 19:30     ` Jacky Li

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=202208031012.z1rYKkYA-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alpergun@google.com \
    --cc=brijesh.singh@amd.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jackyli@google.com \
    --cc=john.allen@amd.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcorr@google.com \
    --cc=pgonda@google.com \
    --cc=thomas.lendacky@amd.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

all inboxes | Powered by JetHome®