drivers/gpu/drm/kmb/kmb_dsi.c:812:2: warning: unused function 'set_test_mode_src_osc_freq_target_low_bits'
by kernel test robot
Hi Geert,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: ade896460e4a62f5e4a892a98d254937f6f5b64c drm: DRM_KMB_DISPLAY should depend on ARCH_KEEMBAY
date: 4 months ago
config: mips-randconfig-r004-20210228 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 83bc7815c4235786111aa2abf7193292e4a602f5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ade896460e4a62f5e4a892a98d254937f6f5b64c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/kmb/kmb_dsi.c:812:2: warning: unused function 'set_test_mode_src_osc_freq_target_low_bits'
set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi
^
>> drivers/gpu/drm/kmb/kmb_dsi.c:824:2: warning: unused function 'set_test_mode_src_osc_freq_target_hi_bits'
set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi
^
fatal error: error in backend: Nested variants found in inline asm string: '.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/barrier.h", .line = 16, $); 0x00 ) != -1)) : $))) ) && ( (1 << 0) ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif'
clang-13: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 13.0.0 (git://gitmirror/llvm_project 83bc7815c4235786111aa2abf7193292e4a602f5)
Target: mipsel-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/cross/clang-83bc7815c4/bin
clang-13: note: diagnostic msg:
Makefile arch drivers fs include kernel mm scripts security source usr
vim +/set_test_mode_src_osc_freq_target_low_bits +812 drivers/gpu/drm/kmb/kmb_dsi.c
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 810
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 811 static inline void
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 @812 set_test_mode_src_osc_freq_target_low_bits(struct kmb_dsi *kmb_dsi,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 813 u32 dphy_no,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 814 u32 freq)
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 815 {
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 816 /* Typical rise/fall time=166, refer Table 1207 databook,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 817 * sr_osc_freq_target[7:0]
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 818 */
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 819 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 820 (freq & 0x7f));
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 821 }
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 822
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 823 static inline void
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 @824 set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 825 u32 dphy_no,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 826 u32 freq)
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 827 {
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 828 u32 data;
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 829
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 830 /* Flag this as high nibble */
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 831 data = ((freq >> 6) & 0x1f) | (1 << 7);
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 832
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 833 /* Typical rise/fall time=166, refer Table 1207 databook,
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 834 * sr_osc_freq_target[11:7]
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 835 */
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 836 test_mode_send(kmb_dsi, dphy_no, TEST_CODE_SLEW_RATE_DDL_CYCLES, data);
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 837 }
98521f4d4b4cb2 Anitha Chrisanthus 2020-11-04 838
:::::: The code at line 812 was first introduced by commit
:::::: 98521f4d4b4cb265374a4b1e13b41287a1960243 drm/kmb: Mipi DSI part of the display driver
:::::: TO: Anitha Chrisanthus <anitha.chrisanthus(a)intel.com>
:::::: CC: Sam Ravnborg <sam(a)ravnborg.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[xiang-linux:erofs/compr_cfgs 6/6] fs/erofs/internal.h:457:18: error: no member named 'lz4_max_distance' in 'struct erofs_super_block'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git erofs/compr_cfgs
head: 5a5727580c28124069723d6166dc6551acc1adf2
commit: 5a5727580c28124069723d6166dc6551acc1adf2 [6/6] erofs: introduce on-disk compression options
config: s390-randconfig-r015-20210228 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 83bc7815c4235786111aa2abf7193292e4a602f5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git/commit/?i...
git remote add xiang-linux https://git.kernel.org/pub/scm/linux/kernel/git/xiang/linux.git
git fetch --no-tags xiang-linux erofs/compr_cfgs
git checkout 5a5727580c28124069723d6166dc6551acc1adf2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from fs/erofs/super.c:15:
In file included from fs/erofs/xattr.h:10:
>> fs/erofs/internal.h:457:18: error: no member named 'lz4_max_distance' in 'struct erofs_super_block'
if (lz4 || dsb->lz4_max_distance) {
~~~ ^
1 error generated.
vim +457 fs/erofs/internal.h
fa61a33f53760a drivers/staging/erofs/internal.h Gao Xiang 2019-06-24 425
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 426 #ifdef CONFIG_EROFS_FS_ZIP
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 427 int erofs_workgroup_put(struct erofs_workgroup *grp);
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 428 struct erofs_workgroup *erofs_find_workgroup(struct super_block *sb,
997626d8383871 fs/erofs/internal.h Vladimir Zapolskiy 2020-01-02 429 pgoff_t index);
64094a04414f0b fs/erofs/internal.h Gao Xiang 2020-02-20 430 struct erofs_workgroup *erofs_insert_workgroup(struct super_block *sb,
e5e9a432036a40 fs/erofs/internal.h Vladimir Zapolskiy 2020-01-02 431 struct erofs_workgroup *grp);
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 432 void erofs_workgroup_free_rcu(struct erofs_workgroup *grp);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 433 void erofs_shrinker_register(struct super_block *sb);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 434 void erofs_shrinker_unregister(struct super_block *sb);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 435 int __init erofs_init_shrinker(void);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 436 void erofs_exit_shrinker(void);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 437 int __init z_erofs_init_zip_subsystem(void);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 438 void z_erofs_exit_zip_subsystem(void);
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 439 int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 440 struct erofs_workgroup *egrp);
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 441 int erofs_try_to_free_cached_page(struct address_space *mapping,
14f362b4f40580 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 442 struct page *page);
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 443 int z_erofs_load_lz4_config(struct super_block *sb,
878ee83a3ed54d fs/erofs/internal.h Gao Xiang 2021-02-27 444 struct erofs_super_block *dsb,
878ee83a3ed54d fs/erofs/internal.h Gao Xiang 2021-02-27 445 struct z_erofs_lz4_cfgs *lz4, int len);
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 446 #else
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 447 static inline void erofs_shrinker_register(struct super_block *sb) {}
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 448 static inline void erofs_shrinker_unregister(struct super_block *sb) {}
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 449 static inline int erofs_init_shrinker(void) { return 0; }
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 450 static inline void erofs_exit_shrinker(void) {}
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 451 static inline int z_erofs_init_zip_subsystem(void) { return 0; }
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 452 static inline void z_erofs_exit_zip_subsystem(void) {}
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 453 static inline int z_erofs_load_lz4_config(struct super_block *sb,
878ee83a3ed54d fs/erofs/internal.h Gao Xiang 2021-02-27 454 struct erofs_super_block *dsb,
878ee83a3ed54d fs/erofs/internal.h Gao Xiang 2021-02-27 455 struct z_erofs_lz4_cfgs *lz4, int len)
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 456 {
878ee83a3ed54d fs/erofs/internal.h Gao Xiang 2021-02-27 @457 if (lz4 || dsb->lz4_max_distance) {
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 458 erofs_err(sb, "lz4 algorithm isn't enabled");
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 459 return -EINVAL;
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 460 }
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 461 return 0;
4ebe1216a83f49 fs/erofs/internal.h Huang Jianan 2021-02-23 462 }
22fe04a77d1049 drivers/staging/erofs/internal.h Gao Xiang 2019-07-31 463 #endif /* !CONFIG_EROFS_FS_ZIP */
2e1d66379ece5b drivers/staging/erofs/internal.h Gao Xiang 2019-01-16 464
:::::: The code at line 457 was first introduced by commit
:::::: 878ee83a3ed54d55a288ea3a414ce83eb31a8650 erofs: record lz4 configurations on disk
:::::: TO: Gao Xiang <hsiangkao(a)redhat.com>
:::::: CC: Gao Xiang <hsiangkao(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
arch/x86/kvm/mmu/tdp_mmu.c:388:49: sparse: sparse: incorrect type in argument 2 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: 7cca2d0b7e7d9f3cd740d41afdc00051c9b508a0 KVM: x86/mmu: Protect TDP MMU page table memory with RCU
date: 3 weeks ago
config: x86_64-randconfig-s022-20210228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-241-geaceeafa-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7cca2d0b7e7d9f3cd740d41afdc00051c9b508a0
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> arch/x86/kvm/mmu/tdp_mmu.c:388:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:388:49: sparse: expected unsigned long long [usertype] *pt
arch/x86/kvm/mmu/tdp_mmu.c:388:49: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *root_pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: expected unsigned long long [usertype] *root_pt
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *root_pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: expected unsigned long long [usertype] *root_pt
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *root_pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: expected unsigned long long [usertype] *root_pt
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *root_pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: expected unsigned long long [usertype] *root_pt
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long long [usertype] *root_pt @@ got unsigned long long [noderef] [usertype] __rcu * @@
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: expected unsigned long long [usertype] *root_pt
arch/x86/kvm/mmu/tdp_mmu.c:506:51: sparse: got unsigned long long [noderef] [usertype] __rcu *
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
>> arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected unsigned long long [usertype] *sptep @@ got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt @@
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: expected unsigned long long [usertype] *sptep
arch/x86/kvm/mmu/tdp_mmu.c:421:49: sparse: got unsigned long long [noderef] [usertype] __rcu *[usertype] root_pt
vim +388 arch/x86/kvm/mmu/tdp_mmu.c
a066e61f13cf4b Ben Gardon 2021-02-02 302
2f2fad0897cbfd Ben Gardon 2020-10-14 303 /**
2f2fad0897cbfd Ben Gardon 2020-10-14 304 * handle_changed_spte - handle bookkeeping associated with an SPTE change
2f2fad0897cbfd Ben Gardon 2020-10-14 305 * @kvm: kvm instance
2f2fad0897cbfd Ben Gardon 2020-10-14 306 * @as_id: the address space of the paging structure the SPTE was a part of
2f2fad0897cbfd Ben Gardon 2020-10-14 307 * @gfn: the base GFN that was mapped by the SPTE
2f2fad0897cbfd Ben Gardon 2020-10-14 308 * @old_spte: The value of the SPTE before the change
2f2fad0897cbfd Ben Gardon 2020-10-14 309 * @new_spte: The value of the SPTE after the change
2f2fad0897cbfd Ben Gardon 2020-10-14 310 * @level: the level of the PT the SPTE is part of in the paging structure
2f2fad0897cbfd Ben Gardon 2020-10-14 311 *
2f2fad0897cbfd Ben Gardon 2020-10-14 312 * Handle bookkeeping that might result from the modification of a SPTE.
2f2fad0897cbfd Ben Gardon 2020-10-14 313 * This function must be called for all TDP SPTE modifications.
2f2fad0897cbfd Ben Gardon 2020-10-14 314 */
2f2fad0897cbfd Ben Gardon 2020-10-14 315 static void __handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
2f2fad0897cbfd Ben Gardon 2020-10-14 316 u64 old_spte, u64 new_spte, int level)
2f2fad0897cbfd Ben Gardon 2020-10-14 317 {
2f2fad0897cbfd Ben Gardon 2020-10-14 318 bool was_present = is_shadow_present_pte(old_spte);
2f2fad0897cbfd Ben Gardon 2020-10-14 319 bool is_present = is_shadow_present_pte(new_spte);
2f2fad0897cbfd Ben Gardon 2020-10-14 320 bool was_leaf = was_present && is_last_spte(old_spte, level);
2f2fad0897cbfd Ben Gardon 2020-10-14 321 bool is_leaf = is_present && is_last_spte(new_spte, level);
2f2fad0897cbfd Ben Gardon 2020-10-14 322 bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte);
2f2fad0897cbfd Ben Gardon 2020-10-14 323
2f2fad0897cbfd Ben Gardon 2020-10-14 324 WARN_ON(level > PT64_ROOT_MAX_LEVEL);
2f2fad0897cbfd Ben Gardon 2020-10-14 325 WARN_ON(level < PG_LEVEL_4K);
764388ce598f0c Sean Christopherson 2020-10-23 326 WARN_ON(gfn & (KVM_PAGES_PER_HPAGE(level) - 1));
2f2fad0897cbfd Ben Gardon 2020-10-14 327
2f2fad0897cbfd Ben Gardon 2020-10-14 328 /*
2f2fad0897cbfd Ben Gardon 2020-10-14 329 * If this warning were to trigger it would indicate that there was a
2f2fad0897cbfd Ben Gardon 2020-10-14 330 * missing MMU notifier or a race with some notifier handler.
2f2fad0897cbfd Ben Gardon 2020-10-14 331 * A present, leaf SPTE should never be directly replaced with another
2f2fad0897cbfd Ben Gardon 2020-10-14 332 * present leaf SPTE pointing to a differnt PFN. A notifier handler
2f2fad0897cbfd Ben Gardon 2020-10-14 333 * should be zapping the SPTE before the main MM's page table is
2f2fad0897cbfd Ben Gardon 2020-10-14 334 * changed, or the SPTE should be zeroed, and the TLBs flushed by the
2f2fad0897cbfd Ben Gardon 2020-10-14 335 * thread before replacement.
2f2fad0897cbfd Ben Gardon 2020-10-14 336 */
2f2fad0897cbfd Ben Gardon 2020-10-14 337 if (was_leaf && is_leaf && pfn_changed) {
2f2fad0897cbfd Ben Gardon 2020-10-14 338 pr_err("Invalid SPTE change: cannot replace a present leaf\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 339 "SPTE with another present leaf SPTE mapping a\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 340 "different PFN!\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 341 "as_id: %d gfn: %llx old_spte: %llx new_spte: %llx level: %d",
2f2fad0897cbfd Ben Gardon 2020-10-14 342 as_id, gfn, old_spte, new_spte, level);
2f2fad0897cbfd Ben Gardon 2020-10-14 343
2f2fad0897cbfd Ben Gardon 2020-10-14 344 /*
2f2fad0897cbfd Ben Gardon 2020-10-14 345 * Crash the host to prevent error propagation and guest data
2f2fad0897cbfd Ben Gardon 2020-10-14 346 * courruption.
2f2fad0897cbfd Ben Gardon 2020-10-14 347 */
2f2fad0897cbfd Ben Gardon 2020-10-14 348 BUG();
2f2fad0897cbfd Ben Gardon 2020-10-14 349 }
2f2fad0897cbfd Ben Gardon 2020-10-14 350
2f2fad0897cbfd Ben Gardon 2020-10-14 351 if (old_spte == new_spte)
2f2fad0897cbfd Ben Gardon 2020-10-14 352 return;
2f2fad0897cbfd Ben Gardon 2020-10-14 353
b9a98c3437e353 Ben Gardon 2020-10-27 354 trace_kvm_tdp_mmu_spte_changed(as_id, gfn, level, old_spte, new_spte);
b9a98c3437e353 Ben Gardon 2020-10-27 355
2f2fad0897cbfd Ben Gardon 2020-10-14 356 /*
2f2fad0897cbfd Ben Gardon 2020-10-14 357 * The only times a SPTE should be changed from a non-present to
2f2fad0897cbfd Ben Gardon 2020-10-14 358 * non-present state is when an MMIO entry is installed/modified/
2f2fad0897cbfd Ben Gardon 2020-10-14 359 * removed. In that case, there is nothing to do here.
2f2fad0897cbfd Ben Gardon 2020-10-14 360 */
2f2fad0897cbfd Ben Gardon 2020-10-14 361 if (!was_present && !is_present) {
2f2fad0897cbfd Ben Gardon 2020-10-14 362 /*
2f2fad0897cbfd Ben Gardon 2020-10-14 363 * If this change does not involve a MMIO SPTE, it is
2f2fad0897cbfd Ben Gardon 2020-10-14 364 * unexpected. Log the change, though it should not impact the
2f2fad0897cbfd Ben Gardon 2020-10-14 365 * guest since both the former and current SPTEs are nonpresent.
2f2fad0897cbfd Ben Gardon 2020-10-14 366 */
2f2fad0897cbfd Ben Gardon 2020-10-14 367 if (WARN_ON(!is_mmio_spte(old_spte) && !is_mmio_spte(new_spte)))
2f2fad0897cbfd Ben Gardon 2020-10-14 368 pr_err("Unexpected SPTE change! Nonpresent SPTEs\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 369 "should not be replaced with another,\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 370 "different nonpresent SPTE, unless one or both\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 371 "are MMIO SPTEs.\n"
2f2fad0897cbfd Ben Gardon 2020-10-14 372 "as_id: %d gfn: %llx old_spte: %llx new_spte: %llx level: %d",
2f2fad0897cbfd Ben Gardon 2020-10-14 373 as_id, gfn, old_spte, new_spte, level);
2f2fad0897cbfd Ben Gardon 2020-10-14 374 return;
2f2fad0897cbfd Ben Gardon 2020-10-14 375 }
2f2fad0897cbfd Ben Gardon 2020-10-14 376
2f2fad0897cbfd Ben Gardon 2020-10-14 377
2f2fad0897cbfd Ben Gardon 2020-10-14 378 if (was_leaf && is_dirty_spte(old_spte) &&
2f2fad0897cbfd Ben Gardon 2020-10-14 379 (!is_dirty_spte(new_spte) || pfn_changed))
2f2fad0897cbfd Ben Gardon 2020-10-14 380 kvm_set_pfn_dirty(spte_to_pfn(old_spte));
2f2fad0897cbfd Ben Gardon 2020-10-14 381
2f2fad0897cbfd Ben Gardon 2020-10-14 382 /*
2f2fad0897cbfd Ben Gardon 2020-10-14 383 * Recursively handle child PTs if the change removed a subtree from
2f2fad0897cbfd Ben Gardon 2020-10-14 384 * the paging structure.
2f2fad0897cbfd Ben Gardon 2020-10-14 385 */
a066e61f13cf4b Ben Gardon 2021-02-02 386 if (was_present && !was_leaf && (pfn_changed || !is_present))
a066e61f13cf4b Ben Gardon 2021-02-02 387 handle_removed_tdp_mmu_page(kvm,
a066e61f13cf4b Ben Gardon 2021-02-02 @388 spte_to_child_pt(old_spte, level));
2f2fad0897cbfd Ben Gardon 2020-10-14 389 }
2f2fad0897cbfd Ben Gardon 2020-10-14 390
2f2fad0897cbfd Ben Gardon 2020-10-14 391 static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
2f2fad0897cbfd Ben Gardon 2020-10-14 392 u64 old_spte, u64 new_spte, int level)
2f2fad0897cbfd Ben Gardon 2020-10-14 393 {
2f2fad0897cbfd Ben Gardon 2020-10-14 394 __handle_changed_spte(kvm, as_id, gfn, old_spte, new_spte, level);
f8e144971c6834 Ben Gardon 2020-10-14 395 handle_changed_spte_acc_track(old_spte, new_spte, level);
a6a0b05da9f37f Ben Gardon 2020-10-14 396 handle_changed_spte_dirty_log(kvm, as_id, gfn, old_spte,
a6a0b05da9f37f Ben Gardon 2020-10-14 397 new_spte, level);
2f2fad0897cbfd Ben Gardon 2020-10-14 398 }
faaf05b00aecdb Ben Gardon 2020-10-14 399
fe43fa2f407b9d Ben Gardon 2021-02-02 400 /*
fe43fa2f407b9d Ben Gardon 2021-02-02 401 * __tdp_mmu_set_spte - Set a TDP MMU SPTE and handle the associated bookkeeping
fe43fa2f407b9d Ben Gardon 2021-02-02 402 * @kvm: kvm instance
fe43fa2f407b9d Ben Gardon 2021-02-02 403 * @iter: a tdp_iter instance currently on the SPTE that should be set
fe43fa2f407b9d Ben Gardon 2021-02-02 404 * @new_spte: The value the SPTE should be set to
fe43fa2f407b9d Ben Gardon 2021-02-02 405 * @record_acc_track: Notify the MM subsystem of changes to the accessed state
fe43fa2f407b9d Ben Gardon 2021-02-02 406 * of the page. Should be set unless handling an MMU
fe43fa2f407b9d Ben Gardon 2021-02-02 407 * notifier for access tracking. Leaving record_acc_track
fe43fa2f407b9d Ben Gardon 2021-02-02 408 * unset in that case prevents page accesses from being
fe43fa2f407b9d Ben Gardon 2021-02-02 409 * double counted.
fe43fa2f407b9d Ben Gardon 2021-02-02 410 * @record_dirty_log: Record the page as dirty in the dirty bitmap if
fe43fa2f407b9d Ben Gardon 2021-02-02 411 * appropriate for the change being made. Should be set
fe43fa2f407b9d Ben Gardon 2021-02-02 412 * unless performing certain dirty logging operations.
fe43fa2f407b9d Ben Gardon 2021-02-02 413 * Leaving record_dirty_log unset in that case prevents page
fe43fa2f407b9d Ben Gardon 2021-02-02 414 * writes from being double counted.
fe43fa2f407b9d Ben Gardon 2021-02-02 415 */
f8e144971c6834 Ben Gardon 2020-10-14 416 static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter,
a6a0b05da9f37f Ben Gardon 2020-10-14 417 u64 new_spte, bool record_acc_track,
a6a0b05da9f37f Ben Gardon 2020-10-14 418 bool record_dirty_log)
faaf05b00aecdb Ben Gardon 2020-10-14 419 {
7cca2d0b7e7d9f Ben Gardon 2021-02-02 420 tdp_ptep_t root_pt = tdp_iter_root_pt(iter);
faaf05b00aecdb Ben Gardon 2020-10-14 @421 struct kvm_mmu_page *root = sptep_to_sp(root_pt);
faaf05b00aecdb Ben Gardon 2020-10-14 422 int as_id = kvm_mmu_page_as_id(root);
faaf05b00aecdb Ben Gardon 2020-10-14 423
3a9a4aa5657471 Ben Gardon 2021-02-02 424 lockdep_assert_held(&kvm->mmu_lock);
3a9a4aa5657471 Ben Gardon 2021-02-02 425
7cca2d0b7e7d9f Ben Gardon 2021-02-02 426 WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte);
faaf05b00aecdb Ben Gardon 2020-10-14 427
f8e144971c6834 Ben Gardon 2020-10-14 428 __handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte,
faaf05b00aecdb Ben Gardon 2020-10-14 429 iter->level);
f8e144971c6834 Ben Gardon 2020-10-14 430 if (record_acc_track)
f8e144971c6834 Ben Gardon 2020-10-14 431 handle_changed_spte_acc_track(iter->old_spte, new_spte,
f8e144971c6834 Ben Gardon 2020-10-14 432 iter->level);
a6a0b05da9f37f Ben Gardon 2020-10-14 433 if (record_dirty_log)
a6a0b05da9f37f Ben Gardon 2020-10-14 434 handle_changed_spte_dirty_log(kvm, as_id, iter->gfn,
a6a0b05da9f37f Ben Gardon 2020-10-14 435 iter->old_spte, new_spte,
a6a0b05da9f37f Ben Gardon 2020-10-14 436 iter->level);
f8e144971c6834 Ben Gardon 2020-10-14 437 }
f8e144971c6834 Ben Gardon 2020-10-14 438
f8e144971c6834 Ben Gardon 2020-10-14 439 static inline void tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter,
f8e144971c6834 Ben Gardon 2020-10-14 440 u64 new_spte)
f8e144971c6834 Ben Gardon 2020-10-14 441 {
a6a0b05da9f37f Ben Gardon 2020-10-14 442 __tdp_mmu_set_spte(kvm, iter, new_spte, true, true);
f8e144971c6834 Ben Gardon 2020-10-14 443 }
f8e144971c6834 Ben Gardon 2020-10-14 444
f8e144971c6834 Ben Gardon 2020-10-14 445 static inline void tdp_mmu_set_spte_no_acc_track(struct kvm *kvm,
f8e144971c6834 Ben Gardon 2020-10-14 446 struct tdp_iter *iter,
f8e144971c6834 Ben Gardon 2020-10-14 447 u64 new_spte)
f8e144971c6834 Ben Gardon 2020-10-14 448 {
a6a0b05da9f37f Ben Gardon 2020-10-14 449 __tdp_mmu_set_spte(kvm, iter, new_spte, false, true);
a6a0b05da9f37f Ben Gardon 2020-10-14 450 }
a6a0b05da9f37f Ben Gardon 2020-10-14 451
a6a0b05da9f37f Ben Gardon 2020-10-14 452 static inline void tdp_mmu_set_spte_no_dirty_log(struct kvm *kvm,
a6a0b05da9f37f Ben Gardon 2020-10-14 453 struct tdp_iter *iter,
a6a0b05da9f37f Ben Gardon 2020-10-14 454 u64 new_spte)
a6a0b05da9f37f Ben Gardon 2020-10-14 455 {
a6a0b05da9f37f Ben Gardon 2020-10-14 456 __tdp_mmu_set_spte(kvm, iter, new_spte, true, false);
faaf05b00aecdb Ben Gardon 2020-10-14 457 }
faaf05b00aecdb Ben Gardon 2020-10-14 458
faaf05b00aecdb Ben Gardon 2020-10-14 459 #define tdp_root_for_each_pte(_iter, _root, _start, _end) \
faaf05b00aecdb Ben Gardon 2020-10-14 460 for_each_tdp_pte(_iter, _root->spt, _root->role.level, _start, _end)
faaf05b00aecdb Ben Gardon 2020-10-14 461
f8e144971c6834 Ben Gardon 2020-10-14 462 #define tdp_root_for_each_leaf_pte(_iter, _root, _start, _end) \
f8e144971c6834 Ben Gardon 2020-10-14 463 tdp_root_for_each_pte(_iter, _root, _start, _end) \
f8e144971c6834 Ben Gardon 2020-10-14 464 if (!is_shadow_present_pte(_iter.old_spte) || \
f8e144971c6834 Ben Gardon 2020-10-14 465 !is_last_spte(_iter.old_spte, _iter.level)) \
f8e144971c6834 Ben Gardon 2020-10-14 466 continue; \
f8e144971c6834 Ben Gardon 2020-10-14 467 else
f8e144971c6834 Ben Gardon 2020-10-14 468
bb18842e21111a Ben Gardon 2020-10-14 469 #define tdp_mmu_for_each_pte(_iter, _mmu, _start, _end) \
bb18842e21111a Ben Gardon 2020-10-14 470 for_each_tdp_pte(_iter, __va(_mmu->root_hpa), \
bb18842e21111a Ben Gardon 2020-10-14 471 _mmu->shadow_root_level, _start, _end)
bb18842e21111a Ben Gardon 2020-10-14 472
e28a436ca4f653 Ben Gardon 2021-02-02 473 /*
e28a436ca4f653 Ben Gardon 2021-02-02 474 * Yield if the MMU lock is contended or this thread needs to return control
e28a436ca4f653 Ben Gardon 2021-02-02 475 * to the scheduler.
e28a436ca4f653 Ben Gardon 2021-02-02 476 *
e139a34ef9d562 Ben Gardon 2021-02-02 477 * If this function should yield and flush is set, it will perform a remote
e139a34ef9d562 Ben Gardon 2021-02-02 478 * TLB flush before yielding.
e139a34ef9d562 Ben Gardon 2021-02-02 479 *
e28a436ca4f653 Ben Gardon 2021-02-02 480 * If this function yields, it will also reset the tdp_iter's walk over the
ed5e484b79e8a9 Ben Gardon 2021-02-02 481 * paging structure and the calling function should skip to the next
ed5e484b79e8a9 Ben Gardon 2021-02-02 482 * iteration to allow the iterator to continue its traversal from the
ed5e484b79e8a9 Ben Gardon 2021-02-02 483 * paging structure root.
e28a436ca4f653 Ben Gardon 2021-02-02 484 *
e28a436ca4f653 Ben Gardon 2021-02-02 485 * Return true if this function yielded and the iterator's traversal was reset.
e28a436ca4f653 Ben Gardon 2021-02-02 486 * Return false if a yield was not needed.
e28a436ca4f653 Ben Gardon 2021-02-02 487 */
e139a34ef9d562 Ben Gardon 2021-02-02 488 static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm,
e139a34ef9d562 Ben Gardon 2021-02-02 489 struct tdp_iter *iter, bool flush)
a6a0b05da9f37f Ben Gardon 2020-10-14 490 {
ed5e484b79e8a9 Ben Gardon 2021-02-02 491 /* Ensure forward progress has been made before yielding. */
ed5e484b79e8a9 Ben Gardon 2021-02-02 492 if (iter->next_last_level_gfn == iter->yielded_gfn)
ed5e484b79e8a9 Ben Gardon 2021-02-02 493 return false;
ed5e484b79e8a9 Ben Gardon 2021-02-02 494
a6a0b05da9f37f Ben Gardon 2020-10-14 495 if (need_resched() || spin_needbreak(&kvm->mmu_lock)) {
7cca2d0b7e7d9f Ben Gardon 2021-02-02 496 rcu_read_unlock();
7cca2d0b7e7d9f Ben Gardon 2021-02-02 497
e139a34ef9d562 Ben Gardon 2021-02-02 498 if (flush)
e139a34ef9d562 Ben Gardon 2021-02-02 499 kvm_flush_remote_tlbs(kvm);
e139a34ef9d562 Ben Gardon 2021-02-02 500
a6a0b05da9f37f Ben Gardon 2020-10-14 501 cond_resched_lock(&kvm->mmu_lock);
7cca2d0b7e7d9f Ben Gardon 2021-02-02 502 rcu_read_lock();
ed5e484b79e8a9 Ben Gardon 2021-02-02 503
ed5e484b79e8a9 Ben Gardon 2021-02-02 504 WARN_ON(iter->gfn > iter->next_last_level_gfn);
ed5e484b79e8a9 Ben Gardon 2021-02-02 505
ed5e484b79e8a9 Ben Gardon 2021-02-02 @506 tdp_iter_start(iter, iter->pt_path[iter->root_level - 1],
ed5e484b79e8a9 Ben Gardon 2021-02-02 507 iter->root_level, iter->min_level,
ed5e484b79e8a9 Ben Gardon 2021-02-02 508 iter->next_last_level_gfn);
ed5e484b79e8a9 Ben Gardon 2021-02-02 509
e28a436ca4f653 Ben Gardon 2021-02-02 510 return true;
a6a0b05da9f37f Ben Gardon 2020-10-14 511 }
e28a436ca4f653 Ben Gardon 2021-02-02 512
e28a436ca4f653 Ben Gardon 2021-02-02 513 return false;
a6a0b05da9f37f Ben Gardon 2020-10-14 514 }
a6a0b05da9f37f Ben Gardon 2020-10-14 515
:::::: The code at line 388 was first introduced by commit
:::::: a066e61f13cf4b17d043ad8bea0cdde2b1e5ee49 KVM: x86/mmu: Factor out handling of removed page tables
:::::: TO: Ben Gardon <bgardon(a)google.com>
:::::: CC: Paolo Bonzini <pbonzini(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[kas:kvm-unmapped-memfd-secret 5/12] arch/x86/kernel/kvm.c:761:22: error: 'KVM_HC_ENABLE_MEM_PROTECTED' undeclared; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git kvm-unmapped-memfd-secret
head: 35cd9bac55b24aa06d68edf986f14cd67932470f
commit: 6472b2fc1d3a9d542d75ae3fb8f1f8bfd2b8ba29 [5/12] x86/kvm: Make DMA pages shared
config: x86_64-randconfig-a006-20210226 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=...
git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git
git fetch --no-tags kas kvm-unmapped-memfd-secret
git checkout 6472b2fc1d3a9d542d75ae3fb8f1f8bfd2b8ba29
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the kas/kvm-unmapped-memfd-secret HEAD 35cd9bac55b24aa06d68edf986f14cd67932470f builds fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
arch/x86/kernel/kvm.c: In function 'kvm_init_platform':
>> arch/x86/kernel/kvm.c:761:22: error: 'KVM_HC_ENABLE_MEM_PROTECTED' undeclared (first use in this function); did you mean 'KVM_FEATURE_MEM_PROTECTED'?
761 | if (kvm_hypercall0(KVM_HC_ENABLE_MEM_PROTECTED)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| KVM_FEATURE_MEM_PROTECTED
arch/x86/kernel/kvm.c:761:22: note: each undeclared identifier is reported only once for each function it appears in
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for NETFS_SUPPORT
Depends on NETWORK_FILESYSTEMS
Selected by
- FSCACHE
vim +761 arch/x86/kernel/kvm.c
2e008ffe426f92 David Woodhouse 2020-10-24 754
d63bae079b6426 Wanpeng Li 2018-07-23 755 static void __init kvm_init_platform(void)
d63bae079b6426 Wanpeng Li 2018-07-23 756 {
e61cf2e3a5b452 Linus Torvalds 2018-08-19 757 kvmclock_init();
d63bae079b6426 Wanpeng Li 2018-07-23 758 x86_platform.apic_post_init = kvm_apic_init;
0e485b924683ff Kirill A. Shutemov 2020-04-20 759
0e485b924683ff Kirill A. Shutemov 2020-04-20 760 if (kvm_para_has_feature(KVM_FEATURE_MEM_PROTECTED)) {
0e485b924683ff Kirill A. Shutemov 2020-04-20 @761 if (kvm_hypercall0(KVM_HC_ENABLE_MEM_PROTECTED)) {
0e485b924683ff Kirill A. Shutemov 2020-04-20 762 pr_err("Failed to enable KVM memory protection\n");
0e485b924683ff Kirill A. Shutemov 2020-04-20 763 return;
0e485b924683ff Kirill A. Shutemov 2020-04-20 764 }
0e485b924683ff Kirill A. Shutemov 2020-04-20 765
0e485b924683ff Kirill A. Shutemov 2020-04-20 766 pr_info("KVM memory protection enabled\n");
0e485b924683ff Kirill A. Shutemov 2020-04-20 767 mem_protected = true;
0e485b924683ff Kirill A. Shutemov 2020-04-20 768 setup_force_cpu_cap(X86_FEATURE_KVM_MEM_PROTECTED);
0e485b924683ff Kirill A. Shutemov 2020-04-20 769 }
d63bae079b6426 Wanpeng Li 2018-07-23 770 }
d63bae079b6426 Wanpeng Li 2018-07-23 771
:::::: The code at line 761 was first introduced by commit
:::::: 0e485b924683ff50b4bc003074f68c6a635e891c x86/kvm: Introduce KVM memory protection feature
:::::: TO: Kirill A. Shutemov <kirill.shutemov(a)linux.intel.com>
:::::: CC: Kirill A. Shutemov <kirill.shutemov(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
drivers/cpufreq/pmac32-cpufreq.c:262:2: error: implicit declaration of function 'enable_kernel_fp'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: 7d68c89169508064c460a1208f38ed0589d226fa powerpc/32s: Allow deselecting CONFIG_PPC_FPU on mpc832x
date: 3 months ago
config: powerpc-randconfig-r021-20210228 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 83bc7815c4235786111aa2abf7193292e4a602f5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7d68c89169508064c460a1208f38ed0589d226fa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/cpufreq/pmac32-cpufreq.c:262:2: error: implicit declaration of function 'enable_kernel_fp' [-Werror,-Wimplicit-function-declaration]
enable_kernel_fp();
^
1 error generated.
vim +/enable_kernel_fp +262 drivers/cpufreq/pmac32-cpufreq.c
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 229
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 230 /* Switch CPU speed under PMU control
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 231 */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 232 static int pmu_set_cpu_speed(int low_speed)
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 233 {
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 234 struct adb_request req;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 235 unsigned long save_l2cr;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 236 unsigned long save_l3cr;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 237 unsigned int pic_prio;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 238 unsigned long flags;
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 239
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 240 preempt_disable();
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 241
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 242 #ifdef DEBUG_FREQ
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 243 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 244 #endif
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 245 pmu_suspend();
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 246
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 247 /* Disable all interrupt sources on openpic */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 248 pic_prio = mpic_cpu_get_priority();
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 249 mpic_cpu_set_priority(0xf);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 250
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 251 /* Make sure the decrementer won't interrupt us */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 252 asm volatile("mtdec %0" : : "r" (0x7fffffff));
80f7228b59e4bb arch/powerpc/platforms/powermac/cpufreq_32.c Adrian Bunk 2006-06-30 253 /* Make sure any pending DEC interrupt occurring while we did
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 254 * the above didn't re-enable the DEC */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 255 mb();
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 256 asm volatile("mtdec %0" : : "r" (0x7fffffff));
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 257
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 258 /* We can now disable MSR_EE */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 259 local_irq_save(flags);
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 260
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 261 /* Giveup the FPU & vec */
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 @262 enable_kernel_fp();
14cf11af6cf608 arch/powerpc/platforms/powermac/pmac_cpufreq.c Paul Mackerras 2005-09-26 263
:::::: The code at line 262 was first introduced by commit
:::::: 14cf11af6cf608eb8c23e989ddb17a715ddce109 powerpc: Merge enough to start building in arch/powerpc.
:::::: TO: Paul Mackerras <paulus(a)samba.org>
:::::: CC: Paul Mackerras <paulus(a)samba.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[djwong-xfs:vectorized-scrub 357/358] fs/xfs/xfs_ioctl.c:1846:10: error: implicit declaration of function 'xfs_scrubv_metadata'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: 67fc6f05cf14727e35335b53a5e67d82cd448b04
commit: c89e2aa4bb2588323075089b067368939a216fad [357/358] xfs: introduce vectored scrub mode
config: arm-randconfig-r014-20210228 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout c89e2aa4bb2588323075089b067368939a216fad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/xfs/xfs_ioctl.c: In function 'xfs_ioc_scrubv_metadata':
>> fs/xfs/xfs_ioctl.c:1846:10: error: implicit declaration of function 'xfs_scrubv_metadata'; did you mean 'xfs_scrub_metadata'? [-Werror=implicit-function-declaration]
1846 | error = xfs_scrubv_metadata(ip, vhead);
| ^~~~~~~~~~~~~~~~~~~
| xfs_scrub_metadata
cc1: some warnings being treated as errors
vim +1846 fs/xfs/xfs_ioctl.c
1814
1815 STATIC int
1816 xfs_ioc_scrubv_metadata(
1817 struct xfs_inode *ip,
1818 void __user *arg)
1819 {
1820 struct xfs_scrub_vec_head __user *uhead = arg;
1821 struct xfs_scrub_vec_head head;
1822 struct xfs_scrub_vec_head *vhead;
1823 size_t bytes;
1824 int error;
1825
1826 if (!capable(CAP_SYS_ADMIN))
1827 return -EPERM;
1828
1829 if (copy_from_user(&head, uhead, sizeof(head)))
1830 return -EFAULT;
1831
1832 bytes = sizeof_xfs_scrub_vec(head.svh_nr);
1833 if (bytes > PAGE_SIZE)
1834 return -ENOMEM;
1835 vhead = kmem_alloc(bytes, KM_MAYFAIL);
1836 if (!vhead)
1837 return -ENOMEM;
1838 memcpy(vhead, &head, sizeof(struct xfs_scrub_vec_head));
1839
1840 if (copy_from_user(&vhead->svh_vecs, &uhead->svh_vecs,
1841 head.svh_nr * sizeof(struct xfs_scrub_vec))) {
1842 error = -EFAULT;
1843 goto err_free;
1844 }
1845
> 1846 error = xfs_scrubv_metadata(ip, vhead);
1847 if (error)
1848 goto err_free;
1849
1850 if (copy_to_user(uhead, vhead, bytes)) {
1851 error = -EFAULT;
1852 goto err_free;
1853 }
1854
1855 err_free:
1856 kmem_free(vhead);
1857 return error;
1858 }
1859
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
[djwong-xfs:vectorized-scrub 357/358] fs/xfs/xfs_ioctl.c:1846:10: error: implicit declaration of function 'xfs_scrubv_metadata'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: 67fc6f05cf14727e35335b53a5e67d82cd448b04
commit: c89e2aa4bb2588323075089b067368939a216fad [357/358] xfs: introduce vectored scrub mode
config: riscv-randconfig-r015-20210228 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 83bc7815c4235786111aa2abf7193292e4a602f5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout c89e2aa4bb2588323075089b067368939a216fad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from fs/xfs/xfs_linux.h:31:
In file included from include/linux/blkdev.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from fs/xfs/xfs_ioctl.c:6:
In file included from fs/xfs/xfs.h:22:
In file included from fs/xfs/xfs_linux.h:31:
In file included from include/linux/blkdev.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from fs/xfs/xfs_ioctl.c:6:
In file included from fs/xfs/xfs.h:22:
In file included from fs/xfs/xfs_linux.h:31:
In file included from include/linux/blkdev.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from fs/xfs/xfs_ioctl.c:6:
In file included from fs/xfs/xfs.h:22:
In file included from fs/xfs/xfs_linux.h:31:
In file included from include/linux/blkdev.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from fs/xfs/xfs_ioctl.c:6:
In file included from fs/xfs/xfs.h:22:
In file included from fs/xfs/xfs_linux.h:31:
In file included from include/linux/blkdev.h:14:
In file included from include/linux/pagemap.h:11:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> fs/xfs/xfs_ioctl.c:1846:10: error: implicit declaration of function 'xfs_scrubv_metadata' [-Werror,-Wimplicit-function-declaration]
error = xfs_scrubv_metadata(ip, vhead);
^
fs/xfs/xfs_ioctl.c:1846:10: note: did you mean 'xfs_ioc_scrubv_metadata'?
fs/xfs/xfs_ioctl.c:1816:1: note: 'xfs_ioc_scrubv_metadata' declared here
xfs_ioc_scrubv_metadata(
^
7 warnings and 1 error generated.
vim +/xfs_scrubv_metadata +1846 fs/xfs/xfs_ioctl.c
1814
1815 STATIC int
1816 xfs_ioc_scrubv_metadata(
1817 struct xfs_inode *ip,
1818 void __user *arg)
1819 {
1820 struct xfs_scrub_vec_head __user *uhead = arg;
1821 struct xfs_scrub_vec_head head;
1822 struct xfs_scrub_vec_head *vhead;
1823 size_t bytes;
1824 int error;
1825
1826 if (!capable(CAP_SYS_ADMIN))
1827 return -EPERM;
1828
1829 if (copy_from_user(&head, uhead, sizeof(head)))
1830 return -EFAULT;
1831
1832 bytes = sizeof_xfs_scrub_vec(head.svh_nr);
1833 if (bytes > PAGE_SIZE)
1834 return -ENOMEM;
1835 vhead = kmem_alloc(bytes, KM_MAYFAIL);
1836 if (!vhead)
1837 return -ENOMEM;
1838 memcpy(vhead, &head, sizeof(struct xfs_scrub_vec_head));
1839
1840 if (copy_from_user(&vhead->svh_vecs, &uhead->svh_vecs,
1841 head.svh_nr * sizeof(struct xfs_scrub_vec))) {
1842 error = -EFAULT;
1843 goto err_free;
1844 }
1845
> 1846 error = xfs_scrubv_metadata(ip, vhead);
1847 if (error)
1848 goto err_free;
1849
1850 if (copy_to_user(uhead, vhead, bytes)) {
1851 error = -EFAULT;
1852 goto err_free;
1853 }
1854
1855 err_free:
1856 kmem_free(vhead);
1857 return error;
1858 }
1859
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months
arch/x86/kvm/x86.c:10408:32: sparse: sparse: Using plain integer as NULL pointer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: ff5a983cbb3746d371de2cc95ea7dcfd982b4084 KVM: X86: Don't track dirty for KVM_SET_[TSS_ADDR|IDENTITY_MAP_ADDR]
date: 3 months ago
config: x86_64-randconfig-s022-20210228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-241-geaceeafa-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ff5a983cbb3746d371de2cc95ea7dcfd982b4084
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
arch/x86/kvm/x86.c:2859:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user * @@ got unsigned char [usertype] * @@
arch/x86/kvm/x86.c:2859:38: sparse: expected void const [noderef] __user *
arch/x86/kvm/x86.c:2859:38: sparse: got unsigned char [usertype] *
arch/x86/kvm/x86.c:8058:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:8058:15: sparse: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm/x86.c:8058:15: sparse: struct kvm_apic_map *
>> arch/x86/kvm/x86.c:10408:32: sparse: sparse: Using plain integer as NULL pointer
arch/x86/kvm/x86.c:10464:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:10464:16: sparse: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm/x86.c:10464:16: sparse: struct kvm_apic_map *
arch/x86/kvm/x86.c:10465:15: sparse: sparse: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:10465:15: sparse: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm/x86.c:10465:15: sparse: struct kvm_pmu_event_filter *
arch/x86/kvm/x86.c: note: in included file (through include/linux/notifier.h, include/linux/memory_hotplug.h, include/linux/mmzone.h, ...):
include/linux/srcu.h:179:9: sparse: sparse: context imbalance in 'vcpu_enter_guest' - unexpected unlock
vim +10408 arch/x86/kvm/x86.c
ff5a983cbb3746 Peter Xu 2020-09-30 10358
ff5a983cbb3746 Peter Xu 2020-09-30 10359 /**
ff5a983cbb3746 Peter Xu 2020-09-30 10360 * __x86_set_memory_region: Setup KVM internal memory slot
ff5a983cbb3746 Peter Xu 2020-09-30 10361 *
ff5a983cbb3746 Peter Xu 2020-09-30 10362 * @kvm: the kvm pointer to the VM.
ff5a983cbb3746 Peter Xu 2020-09-30 10363 * @id: the slot ID to setup.
ff5a983cbb3746 Peter Xu 2020-09-30 10364 * @gpa: the GPA to install the slot (unused when @size == 0).
ff5a983cbb3746 Peter Xu 2020-09-30 10365 * @size: the size of the slot. Set to zero to uninstall a slot.
ff5a983cbb3746 Peter Xu 2020-09-30 10366 *
ff5a983cbb3746 Peter Xu 2020-09-30 10367 * This function helps to setup a KVM internal memory slot. Specify
ff5a983cbb3746 Peter Xu 2020-09-30 10368 * @size > 0 to install a new slot, while @size == 0 to uninstall a
ff5a983cbb3746 Peter Xu 2020-09-30 10369 * slot. The return code can be one of the following:
ff5a983cbb3746 Peter Xu 2020-09-30 10370 *
ff5a983cbb3746 Peter Xu 2020-09-30 10371 * HVA: on success (uninstall will return a bogus HVA)
ff5a983cbb3746 Peter Xu 2020-09-30 10372 * -errno: on error
ff5a983cbb3746 Peter Xu 2020-09-30 10373 *
ff5a983cbb3746 Peter Xu 2020-09-30 10374 * The caller should always use IS_ERR() to check the return value
ff5a983cbb3746 Peter Xu 2020-09-30 10375 * before use. Note, the KVM internal memory slots are guaranteed to
ff5a983cbb3746 Peter Xu 2020-09-30 10376 * remain valid and unchanged until the VM is destroyed, i.e., the
ff5a983cbb3746 Peter Xu 2020-09-30 10377 * GPA->HVA translation will not change. However, the HVA is a user
ff5a983cbb3746 Peter Xu 2020-09-30 10378 * address, i.e. its accessibility is not guaranteed, and must be
ff5a983cbb3746 Peter Xu 2020-09-30 10379 * accessed via __copy_{to,from}_user().
ff5a983cbb3746 Peter Xu 2020-09-30 10380 */
ff5a983cbb3746 Peter Xu 2020-09-30 10381 void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa,
ff5a983cbb3746 Peter Xu 2020-09-30 10382 u32 size)
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10383 {
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10384 int i, r;
3f649ab728cda8 Kees Cook 2020-06-03 10385 unsigned long hva, old_npages;
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10386 struct kvm_memslots *slots = kvm_memslots(kvm);
0577d1abe704c3 Sean Christopherson 2020-02-18 10387 struct kvm_memory_slot *slot;
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10388
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10389 /* Called with kvm->slots_lock held. */
1d8007bdee074f Paolo Bonzini 2015-10-12 10390 if (WARN_ON(id >= KVM_MEM_SLOTS_NUM))
ff5a983cbb3746 Peter Xu 2020-09-30 10391 return ERR_PTR_USR(-EINVAL);
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10392
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10393 slot = id_to_memslot(slots, id);
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10394 if (size) {
0577d1abe704c3 Sean Christopherson 2020-02-18 10395 if (slot && slot->npages)
ff5a983cbb3746 Peter Xu 2020-09-30 10396 return ERR_PTR_USR(-EEXIST);
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10397
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10398 /*
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10399 * MAP_SHARED to prevent internal slot pages from being moved
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10400 * by fork()/COW.
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10401 */
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10402 hva = vm_mmap(NULL, 0, size, PROT_READ | PROT_WRITE,
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10403 MAP_SHARED | MAP_ANONYMOUS, 0);
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10404 if (IS_ERR((void *)hva))
ff5a983cbb3746 Peter Xu 2020-09-30 10405 return (void __user *)hva;
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10406 } else {
0577d1abe704c3 Sean Christopherson 2020-02-18 10407 if (!slot || !slot->npages)
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 @10408 return 0;
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10409
0577d1abe704c3 Sean Christopherson 2020-02-18 10410 old_npages = slot->npages;
e0135a104c52cc Paolo Bonzini 2020-06-11 10411 hva = 0;
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10412 }
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10413
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10414 for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) {
1d8007bdee074f Paolo Bonzini 2015-10-12 10415 struct kvm_userspace_memory_region m;
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10416
1d8007bdee074f Paolo Bonzini 2015-10-12 10417 m.slot = id | (i << 16);
1d8007bdee074f Paolo Bonzini 2015-10-12 10418 m.flags = 0;
1d8007bdee074f Paolo Bonzini 2015-10-12 10419 m.guest_phys_addr = gpa;
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10420 m.userspace_addr = hva;
1d8007bdee074f Paolo Bonzini 2015-10-12 10421 m.memory_size = size;
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10422 r = __kvm_set_memory_region(kvm, &m);
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10423 if (r < 0)
ff5a983cbb3746 Peter Xu 2020-09-30 10424 return ERR_PTR_USR(r);
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10425 }
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10426
103c763c72dd2d Eric Biggers 2018-01-31 10427 if (!size)
0577d1abe704c3 Sean Christopherson 2020-02-18 10428 vm_munmap(hva, old_npages * PAGE_SIZE);
f0d648bdf0a5bb Paolo Bonzini 2015-10-12 10429
ff5a983cbb3746 Peter Xu 2020-09-30 10430 return (void __user *)hva;
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10431 }
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10432 EXPORT_SYMBOL_GPL(__x86_set_memory_region);
9da0e4d5ac9699 Paolo Bonzini 2015-05-18 10433
:::::: The code at line 10408 was first introduced by commit
:::::: f0d648bdf0a5bbc91da6099d5282f77996558ea4 KVM: x86: map/unmap private slots in __x86_set_memory_region
:::::: TO: Paolo Bonzini <pbonzini(a)redhat.com>
:::::: CC: Paolo Bonzini <pbonzini(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 4 months