Re: [PATCH v2 3/3] riscv: Add cache information in AUX vector
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <f9199795d6e9bae73f49583c494505e0a4983c61.1598515355.git.zong.li(a)sifive.com>
References: <f9199795d6e9bae73f49583c494505e0a4983c61.1598515355.git.zong.li(a)sifive.com>
TO: Zong Li <zong.li(a)sifive.com>
TO: palmer(a)dabbelt.com
TO: paul.walmsley(a)sifive.com
TO: david.abdurachmanov(a)sifive.com
TO: linux-riscv(a)lists.infradead.org
TO: linux-kernel(a)vger.kernel.org
CC: Zong Li <zong.li(a)sifive.com>
CC: Palmer Dabbelt <palmerdabbelt(a)google.com>
Hi Zong,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc2 next-20200827]
[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]
url: https://github.com/0day-ci/linux/commits/Zong-Li/Get-cache-information-fr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 15bc20c6af4ceee97a1f90b43c0e386643c071b4
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
config: riscv-randconfig-m031-20200828 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
arch/riscv/kernel/cacheinfo.c:55 get_cache_geometry() warn: variable dereferenced before check 'this_leaf' (see line 52)
# https://github.com/0day-ci/linux/commit/a51c248ba0626069792c3f84c8879f685...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zong-Li/Get-cache-information-from-userland/20200827-162439
git checkout a51c248ba0626069792c3f84c8879f685f4a1ff6
vim +/this_leaf +55 arch/riscv/kernel/cacheinfo.c
a51c248ba06260 Zong Li 2020-08-27 48
a51c248ba06260 Zong Li 2020-08-27 49 uintptr_t get_cache_geometry(u32 level, enum cache_type type)
a51c248ba06260 Zong Li 2020-08-27 50 {
a51c248ba06260 Zong Li 2020-08-27 51 struct cacheinfo *this_leaf = get_cacheinfo(level, type);
a51c248ba06260 Zong Li 2020-08-27 @52 uintptr_t ret = (this_leaf->ways_of_associativity << 16 |
a51c248ba06260 Zong Li 2020-08-27 53 this_leaf->coherency_line_size);
a51c248ba06260 Zong Li 2020-08-27 54
a51c248ba06260 Zong Li 2020-08-27 @55 return this_leaf ? ret : 0;
a51c248ba06260 Zong Li 2020-08-27 56 }
a51c248ba06260 Zong Li 2020-08-27 57
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/gpu/drm/amd/amdgpu/navi10_ih.c:319 navi10_ih_get_wptr() error: uninitialized symbol 'reg'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Alex Sierra <alex.sierra(a)amd.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
CC: Felix Kuehling <Felix.Kuehling(a)amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 15bc20c6af4ceee97a1f90b43c0e386643c071b4
commit: ab518012062d9a7adbdea189ecffb53133c2bb42 drm/amdgpu: enable IH ring 1 and ring 2 for navi
date: 5 months ago
:::::: branch date: 26 hours ago
:::::: commit date: 5 months ago
config: ia64-randconfig-m031-20200827 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/gpu/drm/amd/amdgpu/navi10_ih.c:319 navi10_ih_get_wptr() error: uninitialized symbol 'reg'.
# 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 ab518012062d9a7adbdea189ecffb53133c2bb42
vim +/reg +319 drivers/gpu/drm/amd/amdgpu/navi10_ih.c
edc611475a8adbd Hawking Zhang 2019-03-03 289
edc611475a8adbd Hawking Zhang 2019-03-03 290 /**
edc611475a8adbd Hawking Zhang 2019-03-03 291 * navi10_ih_get_wptr - get the IH ring buffer wptr
edc611475a8adbd Hawking Zhang 2019-03-03 292 *
edc611475a8adbd Hawking Zhang 2019-03-03 293 * @adev: amdgpu_device pointer
edc611475a8adbd Hawking Zhang 2019-03-03 294 *
edc611475a8adbd Hawking Zhang 2019-03-03 295 * Get the IH ring buffer wptr from either the register
edc611475a8adbd Hawking Zhang 2019-03-03 296 * or the writeback memory buffer (NAVI10). Also check for
edc611475a8adbd Hawking Zhang 2019-03-03 297 * ring buffer overflow and deal with it.
edc611475a8adbd Hawking Zhang 2019-03-03 298 * Returns the value of the wptr.
edc611475a8adbd Hawking Zhang 2019-03-03 299 */
edc611475a8adbd Hawking Zhang 2019-03-03 300 static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
edc611475a8adbd Hawking Zhang 2019-03-03 301 struct amdgpu_ih_ring *ih)
edc611475a8adbd Hawking Zhang 2019-03-03 302 {
edc611475a8adbd Hawking Zhang 2019-03-03 303 u32 wptr, reg, tmp;
edc611475a8adbd Hawking Zhang 2019-03-03 304
edc611475a8adbd Hawking Zhang 2019-03-03 305 wptr = le32_to_cpu(*ih->wptr_cpu);
edc611475a8adbd Hawking Zhang 2019-03-03 306
edc611475a8adbd Hawking Zhang 2019-03-03 307 if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
edc611475a8adbd Hawking Zhang 2019-03-03 308 goto out;
edc611475a8adbd Hawking Zhang 2019-03-03 309
ab518012062d9a7 Alex Sierra 2020-03-23 310 if (ih == &adev->irq.ih)
edc611475a8adbd Hawking Zhang 2019-03-03 311 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR);
ab518012062d9a7 Alex Sierra 2020-03-23 312 else if (ih == &adev->irq.ih1)
ab518012062d9a7 Alex Sierra 2020-03-23 313 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING1);
ab518012062d9a7 Alex Sierra 2020-03-23 314 else if (ih == &adev->irq.ih2)
ab518012062d9a7 Alex Sierra 2020-03-23 315 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_WPTR_RING2);
ab518012062d9a7 Alex Sierra 2020-03-23 316 else
ab518012062d9a7 Alex Sierra 2020-03-23 317 BUG();
ab518012062d9a7 Alex Sierra 2020-03-23 318
edc611475a8adbd Hawking Zhang 2019-03-03 @319 wptr = RREG32_NO_KIQ(reg);
edc611475a8adbd Hawking Zhang 2019-03-03 320 if (!REG_GET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW))
edc611475a8adbd Hawking Zhang 2019-03-03 321 goto out;
edc611475a8adbd Hawking Zhang 2019-03-03 322 wptr = REG_SET_FIELD(wptr, IH_RB_WPTR, RB_OVERFLOW, 0);
edc611475a8adbd Hawking Zhang 2019-03-03 323
edc611475a8adbd Hawking Zhang 2019-03-03 324 /* When a ring buffer overflow happen start parsing interrupt
edc611475a8adbd Hawking Zhang 2019-03-03 325 * from the last not overwritten vector (wptr + 32). Hopefully
edc611475a8adbd Hawking Zhang 2019-03-03 326 * this should allow us to catch up.
edc611475a8adbd Hawking Zhang 2019-03-03 327 */
edc611475a8adbd Hawking Zhang 2019-03-03 328 tmp = (wptr + 32) & ih->ptr_mask;
edc611475a8adbd Hawking Zhang 2019-03-03 329 dev_warn(adev->dev, "IH ring buffer overflow "
edc611475a8adbd Hawking Zhang 2019-03-03 330 "(0x%08X, 0x%08X, 0x%08X)\n",
edc611475a8adbd Hawking Zhang 2019-03-03 331 wptr, ih->rptr, tmp);
edc611475a8adbd Hawking Zhang 2019-03-03 332 ih->rptr = tmp;
edc611475a8adbd Hawking Zhang 2019-03-03 333
ab518012062d9a7 Alex Sierra 2020-03-23 334 if (ih == &adev->irq.ih)
edc611475a8adbd Hawking Zhang 2019-03-03 335 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL);
ab518012062d9a7 Alex Sierra 2020-03-23 336 else if (ih == &adev->irq.ih1)
ab518012062d9a7 Alex Sierra 2020-03-23 337 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING1);
ab518012062d9a7 Alex Sierra 2020-03-23 338 else if (ih == &adev->irq.ih2)
ab518012062d9a7 Alex Sierra 2020-03-23 339 reg = SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_CNTL_RING2);
ab518012062d9a7 Alex Sierra 2020-03-23 340 else
ab518012062d9a7 Alex Sierra 2020-03-23 341 BUG();
ab518012062d9a7 Alex Sierra 2020-03-23 342
edc611475a8adbd Hawking Zhang 2019-03-03 343 tmp = RREG32_NO_KIQ(reg);
edc611475a8adbd Hawking Zhang 2019-03-03 344 tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
edc611475a8adbd Hawking Zhang 2019-03-03 345 WREG32_NO_KIQ(reg, tmp);
edc611475a8adbd Hawking Zhang 2019-03-03 346 out:
edc611475a8adbd Hawking Zhang 2019-03-03 347 return (wptr & ih->ptr_mask);
edc611475a8adbd Hawking Zhang 2019-03-03 348 }
edc611475a8adbd Hawking Zhang 2019-03-03 349
:::::: The code at line 319 was first introduced by commit
:::::: edc611475a8adbdea8ce358216c5b1a9d710049c drm/amdgpu: add navi10 ih ip block (v3)
:::::: TO: Hawking Zhang <Hawking.Zhang(a)amd.com>
:::::: CC: Alex Deucher <alexander.deucher(a)amd.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH v3 1/2] iommu/vt-d:Add support for detecting ACPI device in RMRR
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200827100217.21324-2-FelixCui-oc(a)zhaoxin.com>
References: <20200827100217.21324-2-FelixCui-oc(a)zhaoxin.com>
TO: FelixCuioc <FelixCui-oc(a)zhaoxin.com>
TO: Joerg Roedel <joro(a)8bytes.org>
TO: iommu(a)lists.linux-foundation.org
TO: linux-kernel(a)vger.kernel.org
TO: David Woodhouse <dwmw2(a)infradead.org>
TO: Lu Baolu <baolu.lu(a)linux.intel.com>
TO: Dan Carpenter <error27(a)gmail.com>
TO: kbuild(a)lists.01.org
CC: CobeChen-oc(a)zhaoxin.com
CC: RaymondPang-oc(a)zhaoxin.com
CC: TonyWWang-oc(a)zhaoxin.com
Hi FelixCuioc,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on iommu/next]
[also build test WARNING on linux/master linus/master v5.9-rc2 next-20200827]
[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]
url: https://github.com/0day-ci/linux/commits/FelixCuioc/Add-support-for-ACPI-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: x86_64-randconfig-m001-20200827 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/iommu/intel/dmar.c:748 dmar_acpi_bus_add_dev() error: uninitialized symbol 'ret'.
Old smatch warnings:
drivers/iommu/intel/dmar.c:1535 dmar_disable_qi() warn: this loop depends on readl() succeeding
drivers/iommu/intel/dmar.c:1535 dmar_disable_qi() warn: this loop depends on readl() succeeding
drivers/iommu/intel/dmar.c:1901 dmar_fault() warn: this loop depends on readl() succeeding
drivers/iommu/intel/dmar.c:2052 dmar_detect_dsm() warn: should '1 << func' be a 64 bit type?
# https://github.com/0day-ci/linux/commit/555ce9fc47afc28756822855a8d45211b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review FelixCuioc/Add-support-for-ACPI-device-in-RMRR/20200827-180343
git checkout 555ce9fc47afc28756822855a8d45211bb6a39bb
vim +/ret +748 drivers/iommu/intel/dmar.c
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 731
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 732 static int dmar_acpi_bus_add_dev(u8 device_number, struct acpi_device *adev)
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 733 {
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 734 struct dmar_drhd_unit *dmaru;
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 735 struct acpi_dmar_hardware_unit *drhd;
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 736 int ret;
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 737
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 738 for_each_drhd_unit(dmaru) {
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 739 drhd = container_of(dmaru->hdr,
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 740 struct acpi_dmar_hardware_unit,
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 741 header);
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 742 ret = dmar_acpi_insert_dev_scope(device_number, adev, (void *)(drhd+1),
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 743 ((void *)drhd)+drhd->header.length,
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 744 dmaru->devices, dmaru->devices_cnt);
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 745 if (ret)
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 746 break;
ed40356b5fcf1c drivers/iommu/dmar.c David Woodhouse 2014-03-07 747 }
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 @748 if (ret > 0)
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 749 ret = dmar_rmrr_add_acpi_dev(device_number, adev);
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 750
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 751 return ret;
555ce9fc47afc2 drivers/iommu/intel/dmar.c FelixCuioc 2020-08-27 752
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
arch/x86/kvm/../../../virt/kvm/eventfd.c:251 irqfd_update() warn: statement has no effect 31
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Ahmed S. Darwish" <a.darwish(a)linutronix.de>
CC: Peter Zijlstra <peterz(a)infradead.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 15bc20c6af4ceee97a1f90b43c0e386643c071b4
commit: 55f3560df975f557c48aa6afc636808f31ecb87a seqlock: Extend seqcount API with associated locks
date: 4 weeks ago
:::::: branch date: 23 hours ago
:::::: commit date: 4 weeks ago
config: x86_64-randconfig-m001-20200827 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
arch/x86/kvm/../../../virt/kvm/eventfd.c:251 irqfd_update() warn: statement has no effect 31
arch/x86/kvm/../../../virt/kvm/eventfd.c:546 kvm_irqfd_deassign() warn: statement has no effect 31
arch/x86/kvm/x86.c:1703 update_pvclock_gtod() warn: statement has no effect 31
# 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 55f3560df975f557c48aa6afc636808f31ecb87a
vim +251 arch/x86/kvm/../../../virt/kvm/eventfd.c
721eecbf4fe995 Gregory Haskins 2009-05-20 241
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 242 /* Must be called under irqfds.lock */
166c9775f1f8b8 Eric Auger 2015-09-18 243 static void irqfd_update(struct kvm *kvm, struct kvm_kernel_irqfd *irqfd)
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 244 {
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 245 struct kvm_kernel_irq_routing_entry *e;
8ba918d488cade Paul Mackerras 2014-06-30 246 struct kvm_kernel_irq_routing_entry entries[KVM_NR_IRQCHIPS];
351dc6477cd351 Andrey Smetanin 2015-10-16 247 int n_entries;
8ba918d488cade Paul Mackerras 2014-06-30 248
9957c86d659a4d Paul Mackerras 2014-06-30 249 n_entries = kvm_irq_map_gsi(kvm, entries, irqfd->gsi);
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 250
56f89f3629ffd1 Paul Mackerras 2014-06-30 @251 write_seqcount_begin(&irqfd->irq_entry_sc);
56f89f3629ffd1 Paul Mackerras 2014-06-30 252
8ba918d488cade Paul Mackerras 2014-06-30 253 e = entries;
351dc6477cd351 Andrey Smetanin 2015-10-16 254 if (n_entries == 1)
56f89f3629ffd1 Paul Mackerras 2014-06-30 255 irqfd->irq_entry = *e;
351dc6477cd351 Andrey Smetanin 2015-10-16 256 else
351dc6477cd351 Andrey Smetanin 2015-10-16 257 irqfd->irq_entry.type = 0;
56f89f3629ffd1 Paul Mackerras 2014-06-30 258
56f89f3629ffd1 Paul Mackerras 2014-06-30 259 write_seqcount_end(&irqfd->irq_entry_sc);
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 260 }
bd2b53b20fcd0d Michael S. Tsirkin 2010-11-18 261
:::::: The code at line 251 was first introduced by commit
:::::: 56f89f3629ffd1a21d38c3d0bea23deac0e284ce KVM: Don't keep reference to irq routing table in irqfd struct
:::::: TO: Paul Mackerras <paulus(a)samba.org>
:::::: 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, 8 months
Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: add support for 88E6393X from Amethyst family
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200819153816.30834-4-marek.behun(a)nic.cz>
References: <20200819153816.30834-4-marek.behun(a)nic.cz>
TO: "Marek Behún" <marek.behun(a)nic.cz>
TO: netdev(a)vger.kernel.org
CC: Russell King <rmk+kernel(a)armlinux.org.uk>
CC: Andrew Lunn <andrew(a)lunn.ch>
CC: Florian Fainelli <f.fainelli(a)gmail.com>
CC: Vivien Didelot <vivien.didelot(a)gmail.com>
CC: "Marek Behún" <marek.behun(a)nic.cz>
Hi "Marek,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/net-dsa-mv88e6xxx-Ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e3ec1e8ca02b7e6c935bba3f9b6da86c2e57d2eb
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: openrisc-randconfig-m031-20200827 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/dsa/mv88e6xxx/serdes.c:547 mv88e6393x_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
Old smatch warnings:
drivers/net/dsa/mv88e6xxx/serdes.c:428 mv88e6341_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:451 mv88e6390_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:526 mv88e6390x_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
# https://github.com/0day-ci/linux/commit/ec03405fdc7e66a29e2fdec65eadc261b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
git checkout ec03405fdc7e66a29e2fdec65eadc261b10d441d
vim +547 drivers/net/dsa/mv88e6xxx/serdes.c
a8c01c0d941d2f Andrew Lunn 2018-08-09 528
ec03405fdc7e66 Marek Behún 2020-08-19 529 int mv88e6393x_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
ec03405fdc7e66 Marek Behún 2020-08-19 530 {
ec03405fdc7e66 Marek Behún 2020-08-19 531 u8 cmode = chip->ports[port].cmode;
ec03405fdc7e66 Marek Behún 2020-08-19 532
ec03405fdc7e66 Marek Behún 2020-08-19 533 *lane = -1;
ec03405fdc7e66 Marek Behún 2020-08-19 534 switch (port) {
ec03405fdc7e66 Marek Behún 2020-08-19 535 case 0:
ec03405fdc7e66 Marek Behún 2020-08-19 536 case 9:
ec03405fdc7e66 Marek Behún 2020-08-19 537 case 10:
ec03405fdc7e66 Marek Behún 2020-08-19 538 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
ec03405fdc7e66 Marek Behún 2020-08-19 539 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
ec03405fdc7e66 Marek Behún 2020-08-19 540 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
ec03405fdc7e66 Marek Behún 2020-08-19 541 cmode == MV88E6393_PORT_STS_CMODE_5GBASER ||
ec03405fdc7e66 Marek Behún 2020-08-19 542 cmode == MV88E6393_PORT_STS_CMODE_10GBASER ||
ec03405fdc7e66 Marek Behún 2020-08-19 543 cmode == MV88E6393_PORT_STS_CMODE_USXGMII)
ec03405fdc7e66 Marek Behún 2020-08-19 544 *lane = port;
ec03405fdc7e66 Marek Behún 2020-08-19 545 }
ec03405fdc7e66 Marek Behún 2020-08-19 546
ec03405fdc7e66 Marek Behún 2020-08-19 @547 return *lane == -1 ? -ENODEV : 0;
ec03405fdc7e66 Marek Behún 2020-08-19 548 }
ec03405fdc7e66 Marek Behún 2020-08-19 549
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/thermal/qcom/tsens.c:827 init_common() error: uninitialized symbol 'ver_minor'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Amit Kucheria <amit.kucheria(a)linaro.org>
CC: Daniel Lezcano <daniel.lezcano(a)linaro.org>
CC: Bjorn Andersson <bjorn.andersson(a)linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 15bc20c6af4ceee97a1f90b43c0e386643c071b4
commit: a7ff82976122eb6d1fd286dc34f09b6ecd756b60 drivers: thermal: tsens: Merge tsens-common.c into tsens.c
date: 3 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-m001-20200827 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/thermal/qcom/tsens.c:827 init_common() error: uninitialized symbol 'ver_minor'.
# 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 a7ff82976122eb6d1fd286dc34f09b6ecd756b60
vim +/ver_minor +827 drivers/thermal/qcom/tsens.c
a7ff82976122eb Amit Kucheria 2020-04-29 706
a7ff82976122eb Amit Kucheria 2020-04-29 707 int __init init_common(struct tsens_priv *priv)
a7ff82976122eb Amit Kucheria 2020-04-29 708 {
a7ff82976122eb Amit Kucheria 2020-04-29 709 void __iomem *tm_base, *srot_base;
a7ff82976122eb Amit Kucheria 2020-04-29 710 struct device *dev = priv->dev;
a7ff82976122eb Amit Kucheria 2020-04-29 711 u32 ver_minor;
a7ff82976122eb Amit Kucheria 2020-04-29 712 struct resource *res;
a7ff82976122eb Amit Kucheria 2020-04-29 713 u32 enabled;
a7ff82976122eb Amit Kucheria 2020-04-29 714 int ret, i, j;
a7ff82976122eb Amit Kucheria 2020-04-29 715 struct platform_device *op = of_find_device_by_node(priv->dev->of_node);
a7ff82976122eb Amit Kucheria 2020-04-29 716
a7ff82976122eb Amit Kucheria 2020-04-29 717 if (!op)
a7ff82976122eb Amit Kucheria 2020-04-29 718 return -EINVAL;
a7ff82976122eb Amit Kucheria 2020-04-29 719
a7ff82976122eb Amit Kucheria 2020-04-29 720 if (op->num_resources > 1) {
a7ff82976122eb Amit Kucheria 2020-04-29 721 /* DT with separate SROT and TM address space */
a7ff82976122eb Amit Kucheria 2020-04-29 722 priv->tm_offset = 0;
a7ff82976122eb Amit Kucheria 2020-04-29 723 res = platform_get_resource(op, IORESOURCE_MEM, 1);
a7ff82976122eb Amit Kucheria 2020-04-29 724 srot_base = devm_ioremap_resource(dev, res);
a7ff82976122eb Amit Kucheria 2020-04-29 725 if (IS_ERR(srot_base)) {
a7ff82976122eb Amit Kucheria 2020-04-29 726 ret = PTR_ERR(srot_base);
a7ff82976122eb Amit Kucheria 2020-04-29 727 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 728 }
a7ff82976122eb Amit Kucheria 2020-04-29 729
a7ff82976122eb Amit Kucheria 2020-04-29 730 priv->srot_map = devm_regmap_init_mmio(dev, srot_base,
a7ff82976122eb Amit Kucheria 2020-04-29 731 &tsens_srot_config);
a7ff82976122eb Amit Kucheria 2020-04-29 732 if (IS_ERR(priv->srot_map)) {
a7ff82976122eb Amit Kucheria 2020-04-29 733 ret = PTR_ERR(priv->srot_map);
a7ff82976122eb Amit Kucheria 2020-04-29 734 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 735 }
a7ff82976122eb Amit Kucheria 2020-04-29 736 } else {
a7ff82976122eb Amit Kucheria 2020-04-29 737 /* old DTs where SROT and TM were in a contiguous 2K block */
a7ff82976122eb Amit Kucheria 2020-04-29 738 priv->tm_offset = 0x1000;
a7ff82976122eb Amit Kucheria 2020-04-29 739 }
a7ff82976122eb Amit Kucheria 2020-04-29 740
a7ff82976122eb Amit Kucheria 2020-04-29 741 res = platform_get_resource(op, IORESOURCE_MEM, 0);
a7ff82976122eb Amit Kucheria 2020-04-29 742 tm_base = devm_ioremap_resource(dev, res);
a7ff82976122eb Amit Kucheria 2020-04-29 743 if (IS_ERR(tm_base)) {
a7ff82976122eb Amit Kucheria 2020-04-29 744 ret = PTR_ERR(tm_base);
a7ff82976122eb Amit Kucheria 2020-04-29 745 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 746 }
a7ff82976122eb Amit Kucheria 2020-04-29 747
a7ff82976122eb Amit Kucheria 2020-04-29 748 priv->tm_map = devm_regmap_init_mmio(dev, tm_base, &tsens_config);
a7ff82976122eb Amit Kucheria 2020-04-29 749 if (IS_ERR(priv->tm_map)) {
a7ff82976122eb Amit Kucheria 2020-04-29 750 ret = PTR_ERR(priv->tm_map);
a7ff82976122eb Amit Kucheria 2020-04-29 751 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 752 }
a7ff82976122eb Amit Kucheria 2020-04-29 753
a7ff82976122eb Amit Kucheria 2020-04-29 754 if (tsens_version(priv) > VER_0_1) {
a7ff82976122eb Amit Kucheria 2020-04-29 755 for (i = VER_MAJOR; i <= VER_STEP; i++) {
a7ff82976122eb Amit Kucheria 2020-04-29 756 priv->rf[i] = devm_regmap_field_alloc(dev, priv->srot_map,
a7ff82976122eb Amit Kucheria 2020-04-29 757 priv->fields[i]);
a7ff82976122eb Amit Kucheria 2020-04-29 758 if (IS_ERR(priv->rf[i]))
a7ff82976122eb Amit Kucheria 2020-04-29 759 return PTR_ERR(priv->rf[i]);
a7ff82976122eb Amit Kucheria 2020-04-29 760 }
a7ff82976122eb Amit Kucheria 2020-04-29 761 ret = regmap_field_read(priv->rf[VER_MINOR], &ver_minor);
a7ff82976122eb Amit Kucheria 2020-04-29 762 if (ret)
a7ff82976122eb Amit Kucheria 2020-04-29 763 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 764 }
a7ff82976122eb Amit Kucheria 2020-04-29 765
a7ff82976122eb Amit Kucheria 2020-04-29 766 priv->rf[TSENS_EN] = devm_regmap_field_alloc(dev, priv->srot_map,
a7ff82976122eb Amit Kucheria 2020-04-29 767 priv->fields[TSENS_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 768 if (IS_ERR(priv->rf[TSENS_EN])) {
a7ff82976122eb Amit Kucheria 2020-04-29 769 ret = PTR_ERR(priv->rf[TSENS_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 770 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 771 }
a7ff82976122eb Amit Kucheria 2020-04-29 772 ret = regmap_field_read(priv->rf[TSENS_EN], &enabled);
a7ff82976122eb Amit Kucheria 2020-04-29 773 if (ret)
a7ff82976122eb Amit Kucheria 2020-04-29 774 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 775 if (!enabled) {
a7ff82976122eb Amit Kucheria 2020-04-29 776 dev_err(dev, "%s: device not enabled\n", __func__);
a7ff82976122eb Amit Kucheria 2020-04-29 777 ret = -ENODEV;
a7ff82976122eb Amit Kucheria 2020-04-29 778 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 779 }
a7ff82976122eb Amit Kucheria 2020-04-29 780
a7ff82976122eb Amit Kucheria 2020-04-29 781 priv->rf[SENSOR_EN] = devm_regmap_field_alloc(dev, priv->srot_map,
a7ff82976122eb Amit Kucheria 2020-04-29 782 priv->fields[SENSOR_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 783 if (IS_ERR(priv->rf[SENSOR_EN])) {
a7ff82976122eb Amit Kucheria 2020-04-29 784 ret = PTR_ERR(priv->rf[SENSOR_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 785 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 786 }
a7ff82976122eb Amit Kucheria 2020-04-29 787 priv->rf[INT_EN] = devm_regmap_field_alloc(dev, priv->tm_map,
a7ff82976122eb Amit Kucheria 2020-04-29 788 priv->fields[INT_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 789 if (IS_ERR(priv->rf[INT_EN])) {
a7ff82976122eb Amit Kucheria 2020-04-29 790 ret = PTR_ERR(priv->rf[INT_EN]);
a7ff82976122eb Amit Kucheria 2020-04-29 791 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 792 }
a7ff82976122eb Amit Kucheria 2020-04-29 793
a7ff82976122eb Amit Kucheria 2020-04-29 794 /* This loop might need changes if enum regfield_ids is reordered */
a7ff82976122eb Amit Kucheria 2020-04-29 795 for (j = LAST_TEMP_0; j <= UP_THRESH_15; j += 16) {
a7ff82976122eb Amit Kucheria 2020-04-29 796 for (i = 0; i < priv->feat->max_sensors; i++) {
a7ff82976122eb Amit Kucheria 2020-04-29 797 int idx = j + i;
a7ff82976122eb Amit Kucheria 2020-04-29 798
a7ff82976122eb Amit Kucheria 2020-04-29 799 priv->rf[idx] = devm_regmap_field_alloc(dev,
a7ff82976122eb Amit Kucheria 2020-04-29 800 priv->tm_map,
a7ff82976122eb Amit Kucheria 2020-04-29 801 priv->fields[idx]);
a7ff82976122eb Amit Kucheria 2020-04-29 802 if (IS_ERR(priv->rf[idx])) {
a7ff82976122eb Amit Kucheria 2020-04-29 803 ret = PTR_ERR(priv->rf[idx]);
a7ff82976122eb Amit Kucheria 2020-04-29 804 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 805 }
a7ff82976122eb Amit Kucheria 2020-04-29 806 }
a7ff82976122eb Amit Kucheria 2020-04-29 807 }
a7ff82976122eb Amit Kucheria 2020-04-29 808
a7ff82976122eb Amit Kucheria 2020-04-29 809 if (priv->feat->crit_int) {
a7ff82976122eb Amit Kucheria 2020-04-29 810 /* Loop might need changes if enum regfield_ids is reordered */
a7ff82976122eb Amit Kucheria 2020-04-29 811 for (j = CRITICAL_STATUS_0; j <= CRIT_THRESH_15; j += 16) {
a7ff82976122eb Amit Kucheria 2020-04-29 812 for (i = 0; i < priv->feat->max_sensors; i++) {
a7ff82976122eb Amit Kucheria 2020-04-29 813 int idx = j + i;
a7ff82976122eb Amit Kucheria 2020-04-29 814
a7ff82976122eb Amit Kucheria 2020-04-29 815 priv->rf[idx] =
a7ff82976122eb Amit Kucheria 2020-04-29 816 devm_regmap_field_alloc(dev,
a7ff82976122eb Amit Kucheria 2020-04-29 817 priv->tm_map,
a7ff82976122eb Amit Kucheria 2020-04-29 818 priv->fields[idx]);
a7ff82976122eb Amit Kucheria 2020-04-29 819 if (IS_ERR(priv->rf[idx])) {
a7ff82976122eb Amit Kucheria 2020-04-29 820 ret = PTR_ERR(priv->rf[idx]);
a7ff82976122eb Amit Kucheria 2020-04-29 821 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 822 }
a7ff82976122eb Amit Kucheria 2020-04-29 823 }
a7ff82976122eb Amit Kucheria 2020-04-29 824 }
a7ff82976122eb Amit Kucheria 2020-04-29 825 }
a7ff82976122eb Amit Kucheria 2020-04-29 826
a7ff82976122eb Amit Kucheria 2020-04-29 @827 if (tsens_version(priv) > VER_1_X && ver_minor > 2) {
a7ff82976122eb Amit Kucheria 2020-04-29 828 /* Watchdog is present only on v2.3+ */
a7ff82976122eb Amit Kucheria 2020-04-29 829 priv->feat->has_watchdog = 1;
a7ff82976122eb Amit Kucheria 2020-04-29 830 for (i = WDOG_BARK_STATUS; i <= CC_MON_MASK; i++) {
a7ff82976122eb Amit Kucheria 2020-04-29 831 priv->rf[i] = devm_regmap_field_alloc(dev, priv->tm_map,
a7ff82976122eb Amit Kucheria 2020-04-29 832 priv->fields[i]);
a7ff82976122eb Amit Kucheria 2020-04-29 833 if (IS_ERR(priv->rf[i])) {
a7ff82976122eb Amit Kucheria 2020-04-29 834 ret = PTR_ERR(priv->rf[i]);
a7ff82976122eb Amit Kucheria 2020-04-29 835 goto err_put_device;
a7ff82976122eb Amit Kucheria 2020-04-29 836 }
a7ff82976122eb Amit Kucheria 2020-04-29 837 }
a7ff82976122eb Amit Kucheria 2020-04-29 838 /*
a7ff82976122eb Amit Kucheria 2020-04-29 839 * Watchdog is already enabled, unmask the bark.
a7ff82976122eb Amit Kucheria 2020-04-29 840 * Disable cycle completion monitoring
a7ff82976122eb Amit Kucheria 2020-04-29 841 */
a7ff82976122eb Amit Kucheria 2020-04-29 842 regmap_field_write(priv->rf[WDOG_BARK_MASK], 0);
a7ff82976122eb Amit Kucheria 2020-04-29 843 regmap_field_write(priv->rf[CC_MON_MASK], 1);
a7ff82976122eb Amit Kucheria 2020-04-29 844 }
a7ff82976122eb Amit Kucheria 2020-04-29 845
a7ff82976122eb Amit Kucheria 2020-04-29 846 spin_lock_init(&priv->ul_lock);
a7ff82976122eb Amit Kucheria 2020-04-29 847 tsens_enable_irq(priv);
a7ff82976122eb Amit Kucheria 2020-04-29 848 tsens_debug_init(op);
a7ff82976122eb Amit Kucheria 2020-04-29 849
a7ff82976122eb Amit Kucheria 2020-04-29 850 err_put_device:
a7ff82976122eb Amit Kucheria 2020-04-29 851 put_device(&op->dev);
a7ff82976122eb Amit Kucheria 2020-04-29 852 return ret;
a7ff82976122eb Amit Kucheria 2020-04-29 853 }
a7ff82976122eb Amit Kucheria 2020-04-29 854
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH net-next 2/3] net: dsa: mv88e6xxx: return error instead of lane in .serdes_get_lane
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200819153816.30834-3-marek.behun(a)nic.cz>
References: <20200819153816.30834-3-marek.behun(a)nic.cz>
TO: "Marek Behún" <marek.behun(a)nic.cz>
TO: netdev(a)vger.kernel.org
CC: Russell King <rmk+kernel(a)armlinux.org.uk>
CC: Andrew Lunn <andrew(a)lunn.ch>
CC: Florian Fainelli <f.fainelli(a)gmail.com>
CC: Vivien Didelot <vivien.didelot(a)gmail.com>
CC: "Marek Behún" <marek.behun(a)nic.cz>
Hi "Marek,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/net-dsa-mv88e6xxx-Ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git e3ec1e8ca02b7e6c935bba3f9b6da86c2e57d2eb
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: openrisc-randconfig-m031-20200827 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/net/dsa/mv88e6xxx/serdes.c:428 mv88e6341_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:451 mv88e6390_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
drivers/net/dsa/mv88e6xxx/serdes.c:526 mv88e6390x_serdes_get_lane() warn: impossible condition '(*lane == -1) => (0-255 == (-1))'
# https://github.com/0day-ci/linux/commit/a63db5e9b7db608109e7a315dfde9e57d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marek-Beh-n/net-dsa-mv88e6xxx-Add-Amethyst-88E6393X/20200819-234008
git checkout a63db5e9b7db608109e7a315dfde9e57df682a20
vim +428 drivers/net/dsa/mv88e6xxx/serdes.c
d3f88a24b28dbe Andrew Lunn 2020-02-16 413
a63db5e9b7db60 Marek Behún 2020-08-19 414 int mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
d3cf7d8f20b493 Marek Behún 2019-08-26 415 {
d3cf7d8f20b493 Marek Behún 2019-08-26 416 u8 cmode = chip->ports[port].cmode;
d3cf7d8f20b493 Marek Behún 2019-08-26 417
a63db5e9b7db60 Marek Behún 2020-08-19 418 *lane = -1;
5122d4ec9e8053 Vivien Didelot 2019-08-31 419 switch (port) {
5122d4ec9e8053 Vivien Didelot 2019-08-31 420 case 5:
3bbb8867f87d91 Marek Behún 2019-08-26 421 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
d3cf7d8f20b493 Marek Behún 2019-08-26 422 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 423 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 424 *lane = MV88E6341_PORT5_LANE;
5122d4ec9e8053 Vivien Didelot 2019-08-31 425 break;
d3cf7d8f20b493 Marek Behún 2019-08-26 426 }
d3cf7d8f20b493 Marek Behún 2019-08-26 427
a63db5e9b7db60 Marek Behún 2020-08-19 @428 return *lane == -1 ? -ENODEV : 0;
d3cf7d8f20b493 Marek Behún 2019-08-26 429 }
d3cf7d8f20b493 Marek Behún 2019-08-26 430
a63db5e9b7db60 Marek Behún 2020-08-19 431 int mv88e6390_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
07ffbd74d1786d Andrew Lunn 2018-08-09 432 {
2d2e1dd29962ce Andrew Lunn 2018-08-09 433 u8 cmode = chip->ports[port].cmode;
07ffbd74d1786d Andrew Lunn 2018-08-09 434
a63db5e9b7db60 Marek Behún 2020-08-19 435 *lane = -1;
07ffbd74d1786d Andrew Lunn 2018-08-09 436 switch (port) {
07ffbd74d1786d Andrew Lunn 2018-08-09 437 case 9:
3bbb8867f87d91 Marek Behún 2019-08-26 438 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
07ffbd74d1786d Andrew Lunn 2018-08-09 439 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 440 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 441 *lane = MV88E6390_PORT9_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 442 break;
07ffbd74d1786d Andrew Lunn 2018-08-09 443 case 10:
3bbb8867f87d91 Marek Behún 2019-08-26 444 if (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
07ffbd74d1786d Andrew Lunn 2018-08-09 445 cmode == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 446 cmode == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 447 *lane = MV88E6390_PORT10_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 448 break;
07ffbd74d1786d Andrew Lunn 2018-08-09 449 }
17deaf5cb37a36 Marek Behún 2019-08-26 450
a63db5e9b7db60 Marek Behún 2020-08-19 @451 return *lane == -1 ? -ENODEV : 0;
07ffbd74d1786d Andrew Lunn 2018-08-09 452 }
07ffbd74d1786d Andrew Lunn 2018-08-09 453
a63db5e9b7db60 Marek Behún 2020-08-19 454 int mv88e6390x_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, u8 *lane)
a8c01c0d941d2f Andrew Lunn 2018-08-09 455 {
5122d4ec9e8053 Vivien Didelot 2019-08-31 456 u8 cmode_port = chip->ports[port].cmode;
5122d4ec9e8053 Vivien Didelot 2019-08-31 457 u8 cmode_port10 = chip->ports[10].cmode;
5122d4ec9e8053 Vivien Didelot 2019-08-31 458 u8 cmode_port9 = chip->ports[9].cmode;
a8c01c0d941d2f Andrew Lunn 2018-08-09 459
a63db5e9b7db60 Marek Behún 2020-08-19 460 *lane = -1;
a8c01c0d941d2f Andrew Lunn 2018-08-09 461 switch (port) {
a8c01c0d941d2f Andrew Lunn 2018-08-09 462 case 2:
3bbb8867f87d91 Marek Behún 2019-08-26 463 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 464 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 465 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
5122d4ec9e8053 Vivien Didelot 2019-08-31 466 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 467 *lane = MV88E6390_PORT9_LANE1;
17deaf5cb37a36 Marek Behún 2019-08-26 468 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 469 case 3:
3bbb8867f87d91 Marek Behún 2019-08-26 470 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 471 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 472 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 473 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 474 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 475 *lane = MV88E6390_PORT9_LANE2;
17deaf5cb37a36 Marek Behún 2019-08-26 476 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 477 case 4:
3bbb8867f87d91 Marek Behún 2019-08-26 478 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 479 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 480 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 481 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 482 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 483 *lane = MV88E6390_PORT9_LANE3;
17deaf5cb37a36 Marek Behún 2019-08-26 484 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 485 case 5:
3bbb8867f87d91 Marek Behún 2019-08-26 486 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 487 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 488 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX)
5122d4ec9e8053 Vivien Didelot 2019-08-31 489 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 490 *lane = MV88E6390_PORT10_LANE1;
17deaf5cb37a36 Marek Behún 2019-08-26 491 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 492 case 6:
3bbb8867f87d91 Marek Behún 2019-08-26 493 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 494 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 495 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 496 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 497 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 498 *lane = MV88E6390_PORT10_LANE2;
17deaf5cb37a36 Marek Behún 2019-08-26 499 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 500 case 7:
3bbb8867f87d91 Marek Behún 2019-08-26 501 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 502 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 503 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 504 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
5122d4ec9e8053 Vivien Didelot 2019-08-31 505 if (cmode_port == MV88E6XXX_PORT_STS_CMODE_1000BASEX)
a63db5e9b7db60 Marek Behún 2020-08-19 506 *lane = MV88E6390_PORT10_LANE3;
17deaf5cb37a36 Marek Behún 2019-08-26 507 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 508 case 9:
3bbb8867f87d91 Marek Behún 2019-08-26 509 if (cmode_port9 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 510 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 511 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 512 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_XAUI ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 513 cmode_port9 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
a63db5e9b7db60 Marek Behún 2020-08-19 514 *lane = MV88E6390_PORT9_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 515 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 516 case 10:
3bbb8867f87d91 Marek Behún 2019-08-26 517 if (cmode_port10 == MV88E6XXX_PORT_STS_CMODE_1000BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 518 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_SGMII ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 519 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_2500BASEX ||
a8c01c0d941d2f Andrew Lunn 2018-08-09 520 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_XAUI ||
5122d4ec9e8053 Vivien Didelot 2019-08-31 521 cmode_port10 == MV88E6XXX_PORT_STS_CMODE_RXAUI)
a63db5e9b7db60 Marek Behún 2020-08-19 522 *lane = MV88E6390_PORT10_LANE0;
17deaf5cb37a36 Marek Behún 2019-08-26 523 break;
a8c01c0d941d2f Andrew Lunn 2018-08-09 524 }
17deaf5cb37a36 Marek Behún 2019-08-26 525
a63db5e9b7db60 Marek Behún 2020-08-19 @526 return *lane == -1 ? -ENODEV : 0;
a8c01c0d941d2f Andrew Lunn 2018-08-09 527 }
a8c01c0d941d2f Andrew Lunn 2018-08-09 528
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH v3 02/12] KVM: x86: Introduce allow list for MSR emulation
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200818211533.849501-3-aaronlewis(a)google.com>
References: <20200818211533.849501-3-aaronlewis(a)google.com>
TO: Aaron Lewis <aaronlewis(a)google.com>
TO: jmattson(a)google.com
TO: graf(a)amazon.com
CC: pshier(a)google.com
CC: oupton(a)google.com
CC: kvm(a)vger.kernel.org
CC: Aaron Lewis <aaronlewis(a)google.com>
CC: KarimAllah Ahmed <karahmed(a)amazon.de>
Hi Aaron,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on kvm/linux-next]
[also build test WARNING on v5.9-rc2 next-20200827]
[cannot apply to kvms390/next vhost/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]
url: https://github.com/0day-ci/linux/commits/Aaron-Lewis/Allow-userspace-to-m...
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-m001-20200827 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
arch/x86/kvm/x86.c:5248 kvm_vm_ioctl_add_msr_allowlist() error: 'bitmap' dereferencing possible ERR_PTR()
# https://github.com/0day-ci/linux/commit/107c87325cf461b7b1bd07bb6ddbaf808...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Aaron-Lewis/Allow-userspace-to-manage-MSRs/20200819-051903
git checkout 107c87325cf461b7b1bd07bb6ddbaf808a8d8a2a
vim +/bitmap +5248 arch/x86/kvm/x86.c
107c87325cf461 Aaron Lewis 2020-08-18 5180
107c87325cf461 Aaron Lewis 2020-08-18 5181 static int kvm_vm_ioctl_add_msr_allowlist(struct kvm *kvm, void __user *argp)
107c87325cf461 Aaron Lewis 2020-08-18 5182 {
107c87325cf461 Aaron Lewis 2020-08-18 5183 struct msr_bitmap_range *ranges = kvm->arch.msr_allowlist_ranges;
107c87325cf461 Aaron Lewis 2020-08-18 5184 struct kvm_msr_allowlist __user *user_msr_allowlist = argp;
107c87325cf461 Aaron Lewis 2020-08-18 5185 struct msr_bitmap_range range;
107c87325cf461 Aaron Lewis 2020-08-18 5186 struct kvm_msr_allowlist kernel_msr_allowlist;
107c87325cf461 Aaron Lewis 2020-08-18 5187 unsigned long *bitmap = NULL;
107c87325cf461 Aaron Lewis 2020-08-18 5188 size_t bitmap_size;
107c87325cf461 Aaron Lewis 2020-08-18 5189 int r = 0;
107c87325cf461 Aaron Lewis 2020-08-18 5190
107c87325cf461 Aaron Lewis 2020-08-18 5191 if (copy_from_user(&kernel_msr_allowlist, user_msr_allowlist,
107c87325cf461 Aaron Lewis 2020-08-18 5192 sizeof(kernel_msr_allowlist))) {
107c87325cf461 Aaron Lewis 2020-08-18 5193 r = -EFAULT;
107c87325cf461 Aaron Lewis 2020-08-18 5194 goto out;
107c87325cf461 Aaron Lewis 2020-08-18 5195 }
107c87325cf461 Aaron Lewis 2020-08-18 5196
107c87325cf461 Aaron Lewis 2020-08-18 5197 bitmap_size = BITS_TO_LONGS(kernel_msr_allowlist.nmsrs) * sizeof(long);
107c87325cf461 Aaron Lewis 2020-08-18 5198 if (bitmap_size > KVM_MSR_ALLOWLIST_MAX_LEN) {
107c87325cf461 Aaron Lewis 2020-08-18 5199 r = -EINVAL;
107c87325cf461 Aaron Lewis 2020-08-18 5200 goto out;
107c87325cf461 Aaron Lewis 2020-08-18 5201 }
107c87325cf461 Aaron Lewis 2020-08-18 5202
107c87325cf461 Aaron Lewis 2020-08-18 5203 bitmap = memdup_user(user_msr_allowlist->bitmap, bitmap_size);
107c87325cf461 Aaron Lewis 2020-08-18 5204 if (IS_ERR(bitmap)) {
107c87325cf461 Aaron Lewis 2020-08-18 5205 r = PTR_ERR(bitmap);
107c87325cf461 Aaron Lewis 2020-08-18 5206 goto out;
107c87325cf461 Aaron Lewis 2020-08-18 5207 }
107c87325cf461 Aaron Lewis 2020-08-18 5208
107c87325cf461 Aaron Lewis 2020-08-18 5209 range = (struct msr_bitmap_range) {
107c87325cf461 Aaron Lewis 2020-08-18 5210 .flags = kernel_msr_allowlist.flags,
107c87325cf461 Aaron Lewis 2020-08-18 5211 .base = kernel_msr_allowlist.base,
107c87325cf461 Aaron Lewis 2020-08-18 5212 .nmsrs = kernel_msr_allowlist.nmsrs,
107c87325cf461 Aaron Lewis 2020-08-18 5213 .bitmap = bitmap,
107c87325cf461 Aaron Lewis 2020-08-18 5214 };
107c87325cf461 Aaron Lewis 2020-08-18 5215
107c87325cf461 Aaron Lewis 2020-08-18 5216 if (range.flags & ~(KVM_MSR_ALLOW_READ | KVM_MSR_ALLOW_WRITE)) {
107c87325cf461 Aaron Lewis 2020-08-18 5217 r = -EINVAL;
107c87325cf461 Aaron Lewis 2020-08-18 5218 goto out;
107c87325cf461 Aaron Lewis 2020-08-18 5219 }
107c87325cf461 Aaron Lewis 2020-08-18 5220
107c87325cf461 Aaron Lewis 2020-08-18 5221 /*
107c87325cf461 Aaron Lewis 2020-08-18 5222 * Protect from concurrent calls to this function that could trigger
107c87325cf461 Aaron Lewis 2020-08-18 5223 * a TOCTOU violation on kvm->arch.msr_allowlist_ranges_count.
107c87325cf461 Aaron Lewis 2020-08-18 5224 */
107c87325cf461 Aaron Lewis 2020-08-18 5225 mutex_lock(&kvm->lock);
107c87325cf461 Aaron Lewis 2020-08-18 5226
107c87325cf461 Aaron Lewis 2020-08-18 5227 if (kvm->arch.msr_allowlist_ranges_count >=
107c87325cf461 Aaron Lewis 2020-08-18 5228 ARRAY_SIZE(kvm->arch.msr_allowlist_ranges)) {
107c87325cf461 Aaron Lewis 2020-08-18 5229 r = -E2BIG;
107c87325cf461 Aaron Lewis 2020-08-18 5230 goto out_locked;
107c87325cf461 Aaron Lewis 2020-08-18 5231 }
107c87325cf461 Aaron Lewis 2020-08-18 5232
107c87325cf461 Aaron Lewis 2020-08-18 5233 if (msr_range_overlaps(kvm, &range)) {
107c87325cf461 Aaron Lewis 2020-08-18 5234 r = -EINVAL;
107c87325cf461 Aaron Lewis 2020-08-18 5235 goto out_locked;
107c87325cf461 Aaron Lewis 2020-08-18 5236 }
107c87325cf461 Aaron Lewis 2020-08-18 5237
107c87325cf461 Aaron Lewis 2020-08-18 5238 /* Everything ok, add this range identifier to our global pool */
107c87325cf461 Aaron Lewis 2020-08-18 5239 ranges[kvm->arch.msr_allowlist_ranges_count] = range;
107c87325cf461 Aaron Lewis 2020-08-18 5240 /* Make sure we filled the array before we tell anyone to walk it */
107c87325cf461 Aaron Lewis 2020-08-18 5241 smp_wmb();
107c87325cf461 Aaron Lewis 2020-08-18 5242 kvm->arch.msr_allowlist_ranges_count++;
107c87325cf461 Aaron Lewis 2020-08-18 5243
107c87325cf461 Aaron Lewis 2020-08-18 5244 out_locked:
107c87325cf461 Aaron Lewis 2020-08-18 5245 mutex_unlock(&kvm->lock);
107c87325cf461 Aaron Lewis 2020-08-18 5246 out:
107c87325cf461 Aaron Lewis 2020-08-18 5247 if (r)
107c87325cf461 Aaron Lewis 2020-08-18 @5248 kfree(bitmap);
107c87325cf461 Aaron Lewis 2020-08-18 5249
107c87325cf461 Aaron Lewis 2020-08-18 5250 return r;
107c87325cf461 Aaron Lewis 2020-08-18 5251 }
107c87325cf461 Aaron Lewis 2020-08-18 5252
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[tip:locking/core 30/35] kernel/locking/lockdep.c:3284:6: warning: Local variable hlock_id shadows outer function
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
CC: x86(a)kernel.org
TO: Boqun Feng <boqun.feng(a)gmail.com>
CC: Peter Zijlstra <peterz(a)infradead.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head: 96a16f45aed89cf024606a11679b0609d09552c7
commit: f611e8cf98ec908b9c2c0da6064a660fc6022487 [30/35] lockdep: Take read/write status in consideration when generate chainkey
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
compiler: sparc64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
kernel/locking/lockdep.c:4887:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = NULL;
^
kernel/locking/lockdep.c:4883:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = hlock;
^
kernel/locking/lockdep.c:4887:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = NULL;
^
>> kernel/locking/lockdep.c:3284:6: warning: Local variable hlock_id shadows outer function [shadowFunction]
u16 hlock_id;
^
kernel/locking/lockdep.c:377:19: note: Shadowed declaration
static inline u16 hlock_id(struct held_lock *hlock)
^
kernel/locking/lockdep.c:3284:6: note: Shadow variable
u16 hlock_id;
^
# https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=f6...
git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
git fetch --no-tags tip locking/core
git checkout f611e8cf98ec908b9c2c0da6064a660fc6022487
vim +3284 kernel/locking/lockdep.c
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3279
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3280 static void print_chain_keys_chain(struct lock_chain *chain)
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3281 {
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3282 int i;
f6ec8829ac9d59 Yuyang Du 2019-05-06 3283 u64 chain_key = INITIAL_CHAIN_KEY;
f611e8cf98ec90 Boqun Feng 2020-08-07 @3284 u16 hlock_id;
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3285
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3286 printk("depth: %u\n", chain->depth);
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3287 for (i = 0; i < chain->depth; i++) {
f611e8cf98ec90 Boqun Feng 2020-08-07 3288 hlock_id = chain_hlocks[chain->base + i];
f611e8cf98ec90 Boqun Feng 2020-08-07 3289 chain_key = print_chain_key_iteration(hlock_id, chain_key);
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3290
f611e8cf98ec90 Boqun Feng 2020-08-07 3291 print_lock_name(lock_classes + chain_hlock_class_idx(hlock_id) - 1);
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3292 printk("\n");
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3293 }
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3294 }
39e2e173fb1f90 Alfredo Alvarez Fernandez 2016-03-30 3295
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->addr > (~0)) => (0-u64max > u64max)'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Joerg Roedel <jroedel(a)suse.de>
CC: Paolo Bonzini <pbonzini(a)redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 15bc20c6af4ceee97a1f90b43c0e386643c071b4
commit: eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5 KVM: SVM: Move SEV code to separate file
date: 5 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20200827 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->addr > (~0)) => (0-u64max > u64max)'
arch/x86/kvm/svm/sev.c:982 svm_register_enc_region() warn: impossible condition '(range->size > (~0)) => (0-u64max > u64max)'
# 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 eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5
vim +982 arch/x86/kvm/svm/sev.c
eaf78265a4ab33 Joerg Roedel 2020-03-24 971
eaf78265a4ab33 Joerg Roedel 2020-03-24 972 int svm_register_enc_region(struct kvm *kvm,
eaf78265a4ab33 Joerg Roedel 2020-03-24 973 struct kvm_enc_region *range)
eaf78265a4ab33 Joerg Roedel 2020-03-24 974 {
eaf78265a4ab33 Joerg Roedel 2020-03-24 975 struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
eaf78265a4ab33 Joerg Roedel 2020-03-24 976 struct enc_region *region;
eaf78265a4ab33 Joerg Roedel 2020-03-24 977 int ret = 0;
eaf78265a4ab33 Joerg Roedel 2020-03-24 978
eaf78265a4ab33 Joerg Roedel 2020-03-24 979 if (!sev_guest(kvm))
eaf78265a4ab33 Joerg Roedel 2020-03-24 980 return -ENOTTY;
eaf78265a4ab33 Joerg Roedel 2020-03-24 981
eaf78265a4ab33 Joerg Roedel 2020-03-24 @982 if (range->addr > ULONG_MAX || range->size > ULONG_MAX)
eaf78265a4ab33 Joerg Roedel 2020-03-24 983 return -EINVAL;
eaf78265a4ab33 Joerg Roedel 2020-03-24 984
eaf78265a4ab33 Joerg Roedel 2020-03-24 985 region = kzalloc(sizeof(*region), GFP_KERNEL_ACCOUNT);
eaf78265a4ab33 Joerg Roedel 2020-03-24 986 if (!region)
eaf78265a4ab33 Joerg Roedel 2020-03-24 987 return -ENOMEM;
eaf78265a4ab33 Joerg Roedel 2020-03-24 988
eaf78265a4ab33 Joerg Roedel 2020-03-24 989 region->pages = sev_pin_memory(kvm, range->addr, range->size, ®ion->npages, 1);
eaf78265a4ab33 Joerg Roedel 2020-03-24 990 if (!region->pages) {
eaf78265a4ab33 Joerg Roedel 2020-03-24 991 ret = -ENOMEM;
eaf78265a4ab33 Joerg Roedel 2020-03-24 992 goto e_free;
eaf78265a4ab33 Joerg Roedel 2020-03-24 993 }
eaf78265a4ab33 Joerg Roedel 2020-03-24 994
eaf78265a4ab33 Joerg Roedel 2020-03-24 995 /*
eaf78265a4ab33 Joerg Roedel 2020-03-24 996 * The guest may change the memory encryption attribute from C=0 -> C=1
eaf78265a4ab33 Joerg Roedel 2020-03-24 997 * or vice versa for this memory range. Lets make sure caches are
eaf78265a4ab33 Joerg Roedel 2020-03-24 998 * flushed to ensure that guest data gets written into memory with
eaf78265a4ab33 Joerg Roedel 2020-03-24 999 * correct C-bit.
eaf78265a4ab33 Joerg Roedel 2020-03-24 1000 */
eaf78265a4ab33 Joerg Roedel 2020-03-24 1001 sev_clflush_pages(region->pages, region->npages);
eaf78265a4ab33 Joerg Roedel 2020-03-24 1002
eaf78265a4ab33 Joerg Roedel 2020-03-24 1003 region->uaddr = range->addr;
eaf78265a4ab33 Joerg Roedel 2020-03-24 1004 region->size = range->size;
eaf78265a4ab33 Joerg Roedel 2020-03-24 1005
eaf78265a4ab33 Joerg Roedel 2020-03-24 1006 mutex_lock(&kvm->lock);
eaf78265a4ab33 Joerg Roedel 2020-03-24 1007 list_add_tail(®ion->list, &sev->regions_list);
eaf78265a4ab33 Joerg Roedel 2020-03-24 1008 mutex_unlock(&kvm->lock);
eaf78265a4ab33 Joerg Roedel 2020-03-24 1009
eaf78265a4ab33 Joerg Roedel 2020-03-24 1010 return ret;
eaf78265a4ab33 Joerg Roedel 2020-03-24 1011
eaf78265a4ab33 Joerg Roedel 2020-03-24 1012 e_free:
eaf78265a4ab33 Joerg Roedel 2020-03-24 1013 kfree(region);
eaf78265a4ab33 Joerg Roedel 2020-03-24 1014 return ret;
eaf78265a4ab33 Joerg Roedel 2020-03-24 1015 }
eaf78265a4ab33 Joerg Roedel 2020-03-24 1016
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months