public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Nikunj A Dadhania <nikunj@amd.com>,
	linux-kernel@vger.kernel.org, thomas.lendacky@amd.com,
	x86@kernel.org, kvm@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	bp@alien8.de, mingo@redhat.com, tglx@linutronix.de,
	dave.hansen@linux.intel.com, dionnaglaze@google.com,
	pgonda@google.com, seanjc@google.com, pbonzini@redhat.com,
	nikunj@amd.com
Subject: Re: [PATCH v6 07/16] x86/sev: Move and reorganize sev guest request api
Date: Wed, 29 Nov 2023 10:40:31 +0800	[thread overview]
Message-ID: <202311290851.yrAyZYIl-lkp@intel.com> (raw)
In-Reply-To: <20231128125959.1810039-8-nikunj@amd.com>

Hi Nikunj,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/x86/mm]
[also build test WARNING on linus/master v6.7-rc3 next-20231128]
[cannot apply to tip/x86/core kvm/queue kvm/linux-next]
[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/Nikunj-A-Dadhania/virt-sev-guest-Move-mutex-to-SNP-guest-device-structure/20231128-220026
base:   tip/x86/mm
patch link:    https://lore.kernel.org/r/20231128125959.1810039-8-nikunj%40amd.com
patch subject: [PATCH v6 07/16] x86/sev: Move and reorganize sev guest request api
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20231129/202311290851.yrAyZYIl-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231129/202311290851.yrAyZYIl-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/202311290851.yrAyZYIl-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/sev.c:2404:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!pdata->layout) {
               ^~~~~~~~~~~~~~
   arch/x86/kernel/sev.c:2446:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   arch/x86/kernel/sev.c:2404:2: note: remove the 'if' if its condition is always false
           if (!pdata->layout) {
           ^~~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/sev.c:2380:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.


vim +2404 arch/x86/kernel/sev.c

  2376	
  2377	int snp_setup_psp_messaging(struct snp_guest_dev *snp_dev)
  2378	{
  2379		struct sev_guest_platform_data *pdata;
  2380		int ret;
  2381	
  2382		if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) {
  2383			pr_err("SNP not supported\n");
  2384			return 0;
  2385		}
  2386	
  2387		if (platform_data) {
  2388			pr_debug("SNP platform data already initialized.\n");
  2389			goto create_ctx;
  2390		}
  2391	
  2392		if (!secrets_pa) {
  2393			pr_err("SNP secrets page not found\n");
  2394			return -ENODEV;
  2395		}
  2396	
  2397		pdata = kzalloc(sizeof(struct sev_guest_platform_data), GFP_KERNEL);
  2398		if (!pdata) {
  2399			pr_err("Allocation of SNP guest platform data failed\n");
  2400			return -ENOMEM;
  2401		}
  2402	
  2403		pdata->layout = (__force void *)ioremap_encrypted(secrets_pa, PAGE_SIZE);
> 2404		if (!pdata->layout) {
  2405			pr_err("Failed to map SNP secrets page.\n");
  2406			goto e_free_pdata;
  2407		}
  2408	
  2409		ret = -ENOMEM;
  2410		/* Allocate the shared page used for the request and response message. */
  2411		pdata->request = alloc_shared_pages(sizeof(struct snp_guest_msg));
  2412		if (!pdata->request)
  2413			goto e_unmap;
  2414	
  2415		pdata->response = alloc_shared_pages(sizeof(struct snp_guest_msg));
  2416		if (!pdata->response)
  2417			goto e_free_request;
  2418	
  2419		/* initial the input address for guest request */
  2420		pdata->input.req_gpa = __pa(pdata->request);
  2421		pdata->input.resp_gpa = __pa(pdata->response);
  2422		platform_data = pdata;
  2423	
  2424	create_ctx:
  2425		ret = -EIO;
  2426		snp_dev->ctx = snp_init_crypto(snp_dev->vmpck_id);
  2427		if (!snp_dev->ctx) {
  2428			pr_err("SNP crypto context initialization failed\n");
  2429			platform_data = NULL;
  2430			goto e_free_response;
  2431		}
  2432	
  2433		snp_dev->pdata = platform_data;
  2434	
  2435		return 0;
  2436	
  2437	e_free_response:
  2438		free_shared_pages(pdata->response, sizeof(struct snp_guest_msg));
  2439	e_free_request:
  2440		free_shared_pages(pdata->request, sizeof(struct snp_guest_msg));
  2441	e_unmap:
  2442		iounmap(pdata->layout);
  2443	e_free_pdata:
  2444		kfree(pdata);
  2445	
  2446		return ret;
  2447	}
  2448	EXPORT_SYMBOL_GPL(snp_setup_psp_messaging);
  2449	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-11-29  2:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 12:59 [PATCH v6 00/16] Add Secure TSC support for SNP guests Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 01/16] virt: sev-guest: Use AES GCM crypto library Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 02/16] virt: sev-guest: Move mutex to SNP guest device structure Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 03/16] virt: sev-guest: Replace dev_dbg with pr_debug Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 04/16] virt: sev-guest: Add SNP guest request structure Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 05/16] virt: sev-guest: Add vmpck_id to snp_guest_dev struct Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 06/16] x86/sev: Cache the secrets page address Nikunj A Dadhania
2023-12-06 22:21   ` Dionna Amalie Glaze
2023-12-07  6:06     ` Nikunj A. Dadhania
2023-11-28 12:59 ` [PATCH v6 07/16] x86/sev: Move and reorganize sev guest request api Nikunj A Dadhania
2023-11-28 22:50   ` kernel test robot
2023-11-29  2:40   ` kernel test robot [this message]
2023-12-05 17:13   ` Dionna Amalie Glaze
2023-12-06  4:24     ` Nikunj A. Dadhania
2023-11-28 12:59 ` [PATCH v6 08/16] x86/mm: Add generic guest initialization hook Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 09/16] x86/cpufeatures: Add synthetic Secure TSC bit Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 10/16] x86/sev: Add Secure TSC support for SNP guests Nikunj A Dadhania
2023-11-29  4:08   ` kernel test robot
2023-11-28 12:59 ` [PATCH v6 11/16] x86/sev: Change TSC MSR behavior for Secure TSC enabled guests Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 12/16] x86/sev: Prevent RDTSC/RDTSCP interception " Nikunj A Dadhania
2023-12-05 17:16   ` Dionna Amalie Glaze
2023-12-06  4:37     ` Nikunj A. Dadhania
2023-12-06 18:45       ` Dionna Amalie Glaze
2023-12-07  6:12         ` Nikunj A. Dadhania
2023-11-28 12:59 ` [PATCH v6 13/16] x86/kvmclock: Skip kvmclock when Secure TSC is available Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 14/16] x86/sev: Mark Secure TSC as reliable Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 15/16] x86/cpu/amd: Do not print FW_BUG for Secure TSC Nikunj A Dadhania
2023-11-28 12:59 ` [PATCH v6 16/16] x86/sev: Enable Secure TSC for SNP guests Nikunj A Dadhania
2023-12-06 17:46 ` [PATCH v6 00/16] Add Secure TSC support " Peter Gonda

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=202311290851.yrAyZYIl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dionnaglaze@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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