arch/arm64/kvm/vgic/vgic-mmio.c:881:22: sparse: sparse: incorrect type in assignment (different base types)
From: kernel test robot
Date: Sat May 08 2021 - 15:10:42 EST
Hi Marc,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 07db05638aa25ed66e6fc89b45f6773ef3e69396
commit: 9ed24f4b712b855dcf7be3025b75b051cb73a2b7 KVM: arm64: Move virt/kvm/arm to arch/arm64
date: 12 months ago
config: arm64-randconfig-s032-20210508 (attached as .config)
compiler: aarch64-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
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9ed24f4b712b855dcf7be3025b75b051cb73a2b7
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 9ed24f4b712b855dcf7be3025b75b051cb73a2b7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
arch/arm64/kvm/vgic/vgic-mmio.c:854:24: sparse: sparse: cast to restricted __le16
arch/arm64/kvm/vgic/vgic-mmio.c:856:24: sparse: sparse: cast to restricted __le32
arch/arm64/kvm/vgic/vgic-mmio.c:858:24: sparse: sparse: cast to restricted __le64
arch/arm64/kvm/vgic/vgic-mmio.c:878:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long data @@ got restricted __le16 [usertype] @@
arch/arm64/kvm/vgic/vgic-mmio.c:878:22: sparse: expected unsigned long data
arch/arm64/kvm/vgic/vgic-mmio.c:878:22: sparse: got restricted __le16 [usertype]
>> arch/arm64/kvm/vgic/vgic-mmio.c:881:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long data @@ got restricted __le32 [usertype] @@
arch/arm64/kvm/vgic/vgic-mmio.c:881:22: sparse: expected unsigned long data
arch/arm64/kvm/vgic/vgic-mmio.c:881:22: sparse: got restricted __le32 [usertype]
arch/arm64/kvm/vgic/vgic-mmio.c:884:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long data @@ got restricted __le64 [usertype] @@
arch/arm64/kvm/vgic/vgic-mmio.c:884:22: sparse: expected unsigned long data
arch/arm64/kvm/vgic/vgic-mmio.c:884:22: sparse: got restricted __le64 [usertype]
arch/arm64/kvm/vgic/vgic-mmio.c:88:17: sparse: sparse: context imbalance in 'vgic_mmio_write_group' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-mmio.c:124:9: sparse: sparse: context imbalance in 'vgic_mmio_write_senable' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-mmio.c:195:9: sparse: sparse: context imbalance in 'vgic_uaccess_write_senable' - different lock contexts for basic block
>> arch/arm64/kvm/vgic/vgic-mmio.c:278:9: sparse: sparse: context imbalance in 'vgic_mmio_write_spending' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-mmio.c:320:9: sparse: sparse: context imbalance in 'vgic_uaccess_write_spending' - different lock contexts for basic block
>> arch/arm64/kvm/vgic/vgic-mmio.c:565:9: sparse: sparse: context imbalance in 'vgic_mmio_change_active' - wrong count at exit
arch/arm64/kvm/vgic/vgic-mmio.c:773:30: sparse: sparse: context imbalance in 'vgic_write_irq_line_level_info' - different lock contexts for basic block
--
>> arch/arm64/kvm/vgic/vgic-mmio-v2.c:134:9: sparse: sparse: context imbalance in 'vgic_mmio_write_sgir' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-mmio-v2.c:244:9: sparse: sparse: context imbalance in 'vgic_mmio_write_sgipends' - different lock contexts for basic block
--
>> arch/arm64/kvm/vgic/vgic-mmio-v3.c:338:9: sparse: sparse: context imbalance in 'vgic_v3_uaccess_write_pending' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-mmio-v3.c:1025:17: sparse: sparse: context imbalance in 'vgic_v3_dispatch_sgi' - different lock contexts for basic block
--
arch/arm64/kvm/vgic/vgic-its.c:825:17: sparse: sparse: cast to restricted __le64
arch/arm64/kvm/vgic/vgic-its.c:956:24: sparse: sparse: cast to restricted __le64
>> arch/arm64/kvm/vgic/vgic-its.c:2134:13: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [assigned] [usertype] val @@ got restricted __le64 [usertype] @@
arch/arm64/kvm/vgic/vgic-its.c:2134:13: sparse: expected unsigned long long [assigned] [usertype] val
arch/arm64/kvm/vgic/vgic-its.c:2134:13: sparse: got restricted __le64 [usertype]
arch/arm64/kvm/vgic/vgic-its.c:2160:15: sparse: sparse: cast to restricted __le64
arch/arm64/kvm/vgic/vgic-its.c:2281:13: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [assigned] [usertype] val @@ got restricted __le64 [usertype] @@
arch/arm64/kvm/vgic/vgic-its.c:2281:13: sparse: expected unsigned long long [assigned] [usertype] val
arch/arm64/kvm/vgic/vgic-its.c:2281:13: sparse: got restricted __le64 [usertype]
arch/arm64/kvm/vgic/vgic-its.c:2307:17: sparse: sparse: cast to restricted __le64
arch/arm64/kvm/vgic/vgic-its.c:2405:17: sparse: sparse: cast to restricted __le64
arch/arm64/kvm/vgic/vgic-its.c:2461:13: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [assigned] [usertype] val @@ got restricted __le64 [usertype] @@
arch/arm64/kvm/vgic/vgic-its.c:2461:13: sparse: expected unsigned long long [assigned] [usertype] val
arch/arm64/kvm/vgic/vgic-its.c:2461:13: sparse: got restricted __le64 [usertype]
arch/arm64/kvm/vgic/vgic-its.c:2477:15: sparse: sparse: cast to restricted __le64
>> arch/arm64/kvm/vgic/vgic-its.c:280:12: sparse: sparse: context imbalance in 'update_lpi_config' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-its.c:443:9: sparse: sparse: context imbalance in 'its_sync_lpi_pending_table' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-its.c:730:12: sparse: sparse: context imbalance in 'vgic_its_trigger_msi' - different lock contexts for basic block
arch/arm64/kvm/vgic/vgic-its.c:752:5: sparse: sparse: context imbalance in 'vgic_its_inject_cached_translation' - wrong count at exit
vim +881 arch/arm64/kvm/vgic/vgic-mmio.c
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 861
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 862 /*
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 863 * kvm_mmio_write_buf() expects a value in a format such that if converted to
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 864 * a byte array it is observed as the guest would see it if it could perform
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 865 * the load directly. Since the GIC is LE, and the guest knows this, the
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 866 * guest expects a value in little endian format.
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 867 *
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 868 * We convert the data value from the CPUs native format to LE so that the
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 869 * value is returned in the proper format.
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 870 */
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 871 void vgic_data_host_to_mmio_bus(void *buf, unsigned int len,
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 872 unsigned long data)
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 873 {
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 874 switch (len) {
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 875 case 1:
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 876 break;
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 877 case 2:
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 878 data = cpu_to_le16(data);
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 879 break;
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 880 case 4:
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 @881 data = cpu_to_le32(data);
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 882 break;
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 883 default:
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 884 data = cpu_to_le64(data);
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 885 }
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 886
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 887 kvm_mmio_write_buf(buf, len, data);
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 888 }
4493b1c4866a03 virt/kvm/arm/vgic/vgic-mmio.c Marc Zyngier 2016-04-26 889
:::::: The code at line 881 was first introduced by commit
:::::: 4493b1c4866a03963a35be7d157c911a617a3694 KVM: arm/arm64: vgic-new: Add MMIO handling framework
:::::: TO: Marc Zyngier <marc.zyngier@xxxxxxx>
:::::: CC: Christoffer Dall <christoffer.dall@xxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip