lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[intel-tdx:guest-upstream 21/28] arch/x86/kernel/tdx.c:102:7: warning: this statement may fall through
tree:   https://github.com/intel/tdx.git guest-upstream
head: e6dbebc1d0c8a4a2449cd0800c025fb25078a6ac
commit: 466e3f43adbeeab45d4e4213a078c823edf35fc8 [21/28] x86/tdx: Add helper to convert memory between shared and private
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20211201/202112011845.7xW5IRjl-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/intel/tdx/commit/466e3f43adbeeab45d4e4213a078c823edf35fc8
git remote add intel-tdx https://github.com/intel/tdx.git
git fetch --no-tags intel-tdx guest-upstream
git checkout 466e3f43adbeeab45d4e4213a078c823edf35fc8
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/

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

All warnings (new ones prefixed by >>):

arch/x86/kernel/tdx.c:296:8: error: return type defaults to 'int' [-Werror=return-type]
296 | static tdx_mmio_write(int size, unsigned long addr, unsigned long *val)
| ^~~~~~~~~~~~~~
arch/x86/kernel/tdx.c: In function 'tdx_accept_page':
>> arch/x86/kernel/tdx.c:102:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
102 | gpa |= 1;
| ~~~~^~~~
arch/x86/kernel/tdx.c:103:2: note: here
103 | case PG_LEVEL_1G:
| ^~~~
arch/x86/kernel/tdx.c:104:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
104 | gpa |= 2;
| ~~~~^~~~
arch/x86/kernel/tdx.c:105:2: note: here
105 | default:
| ^~~~~~~
cc1: some warnings being treated as errors


vim +102 arch/x86/kernel/tdx.c

89
90 static bool tdx_accept_page(phys_addr_t gpa, enum pg_level pg_level)
91 {
92 /*
93 * Pass the page physical address to the TDX module to accept the
94 * pending, private page.
95 *
96 * Bits 2:0 if GPA encodes page size: 0 - 4K, 1 - 2M.
97 */
98 switch (pg_level) {
99 case PG_LEVEL_4K:
100 break;
101 case PG_LEVEL_2M:
> 102 gpa |= 1;
103 case PG_LEVEL_1G:
104 gpa |= 2;
105 default:
106 return true;
107 }
108
109 return __tdx_module_call(TDX_ACCEPT_PAGE, gpa, 0, 0, 0, NULL);
110 }
111

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

\
 
 \ /
  Last update: 2021-12-01 11:22    [W:0.034 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site