[frank-w-bpi-r2-4.14:5.16-pcie3 4/4] drivers/pci/controller/dwc/pcie-designware.c:677:4: warning: ISO C90 forbids mixed declarations and code
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.16-pcie3
head: a9c22164bad882113d75519c93d19668e95c3c33
commit: a9c22164bad882113d75519c93d19668e95c3c33 [4/4] some debug for pcie hang
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220122/202201221451.f1r8KpW6-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/frank-w/BPI-R2-4.14/commit/a9c22164bad882113d75519c93d...
git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.16-pcie3
git checkout a9c22164bad882113d75519c93d19668e95c3c33
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/pci/
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/pci/controller/dwc/pcie-designware.c: In function 'dw_pcie_iatu_detect':
>> drivers/pci/controller/dwc/pcie-designware.c:677:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
677 | struct resource *res =
| ^~~~~~
vim +677 drivers/pci/controller/dwc/pcie-designware.c
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 665
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 666 void dw_pcie_iatu_detect(struct dw_pcie *pci)
340cba6092c2c1 drivers/pci/host/pcie-designware.c Jingoo Han 2013-06-21 667 {
5f334db665173f drivers/pci/dwc/pcie-designware.c Kishon Vijay Abraham I 2017-02-15 668 struct device *dev = pci->dev;
13ab639ed48c1e drivers/pci/controller/dwc/pcie-designware.c Kunihiko Hayashi 2020-09-30 669 struct platform_device *pdev = to_platform_device(dev);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 670 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 671 if (pci->version >= 0x480A || (!pci->version &&
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 672 dw_pcie_iatu_unroll_enabled(pci))) {
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 673 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 674 pci->iatu_unroll_enabled = true;
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 675 if (!pci->atu_base) {
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 676 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 @677 struct resource *res =
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 678 platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu");
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 679 if (res) {
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 680 pci->atu_size = resource_size(res);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 681 pci->atu_base = devm_ioremap_resource(dev, res);
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 682 }
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 683 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 684 if (!pci->atu_base || IS_ERR(pci->atu_base))
a9f4c2d2f99ec8 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 685 pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 686 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 687 }
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 688 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 689 if (!pci->atu_size)
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 690 /* Pick a minimal default, enough for 8 in and 8 out windows */
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 691 pci->atu_size = SZ_4K;
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 692 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 693 dw_pcie_iatu_detect_regions_unroll(pci);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 694 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 695 } else{
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 696 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 697 dw_pcie_iatu_detect_regions(pci);}
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 698 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 699 dev_info(pci->dev, "iATU unroll: %s\n", pci->iatu_unroll_enabled ?
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 700 "enabled" : "disabled");
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 701 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 702 dev_info(pci->dev, "Detected iATU regions: %u outbound, %u inbound",
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 703 pci->num_ob_windows, pci->num_ib_windows);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 704 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 705 }
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 706
:::::: The code at line 677 was first introduced by commit
:::::: 281f1f99cf3a761b45f611943721dfb1895c68a3 PCI: dwc: Detect number of iATU windows
:::::: TO: Rob Herring <robh(a)kernel.org>
:::::: CC: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[frank-w-bpi-r2-4.14:5.16-pcie3 4/4] drivers/pci/controller/dwc/pcie-designware.c:677:21: warning: mixing declarations and code is a C99 extension
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.16-pcie3
head: a9c22164bad882113d75519c93d19668e95c3c33
commit: a9c22164bad882113d75519c93d19668e95c3c33 [4/4] some debug for pcie hang
config: riscv-randconfig-r021-20220120 (https://download.01.org/0day-ci/archive/20220122/202201221411.nNdgyuxp-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 7b3d30728816403d1fd73cc5082e9fb761262bce)
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://github.com/frank-w/BPI-R2-4.14/commit/a9c22164bad882113d75519c93d...
git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.16-pcie3
git checkout a9c22164bad882113d75519c93d19668e95c3c33
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/pci/controller/dwc/
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/pci/controller/dwc/pcie-designware.c:677:21: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
struct resource *res =
^
1 warning generated.
vim +677 drivers/pci/controller/dwc/pcie-designware.c
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 665
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 666 void dw_pcie_iatu_detect(struct dw_pcie *pci)
340cba6092c2c1 drivers/pci/host/pcie-designware.c Jingoo Han 2013-06-21 667 {
5f334db665173f drivers/pci/dwc/pcie-designware.c Kishon Vijay Abraham I 2017-02-15 668 struct device *dev = pci->dev;
13ab639ed48c1e drivers/pci/controller/dwc/pcie-designware.c Kunihiko Hayashi 2020-09-30 669 struct platform_device *pdev = to_platform_device(dev);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 670 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 671 if (pci->version >= 0x480A || (!pci->version &&
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 672 dw_pcie_iatu_unroll_enabled(pci))) {
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 673 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 674 pci->iatu_unroll_enabled = true;
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 675 if (!pci->atu_base) {
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 676 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 @677 struct resource *res =
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 678 platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu");
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 679 if (res) {
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 680 pci->atu_size = resource_size(res);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 681 pci->atu_base = devm_ioremap_resource(dev, res);
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 682 }
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 683 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
6e5ebc96ec651b drivers/pci/controller/dwc/pcie-designware.c Tim Harvey 2021-11-01 684 if (!pci->atu_base || IS_ERR(pci->atu_base))
a9f4c2d2f99ec8 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 685 pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 686 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 687 }
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 688 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 689 if (!pci->atu_size)
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 690 /* Pick a minimal default, enough for 8 in and 8 out windows */
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 691 pci->atu_size = SZ_4K;
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 692 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 693 dw_pcie_iatu_detect_regions_unroll(pci);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 694 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 695 } else{
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 696 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 697 dw_pcie_iatu_detect_regions(pci);}
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 698 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 699 dev_info(pci->dev, "iATU unroll: %s\n", pci->iatu_unroll_enabled ?
2aadcb0cd39198 drivers/pci/controller/dwc/pcie-designware.c Kishon Vijay Abraham I 2019-03-25 700 "enabled" : "disabled");
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 701 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 702 dev_info(pci->dev, "Detected iATU regions: %u outbound, %u inbound",
281f1f99cf3a76 drivers/pci/controller/dwc/pcie-designware.c Rob Herring 2020-11-05 703 pci->num_ob_windows, pci->num_ib_windows);
a9c22164bad882 drivers/pci/controller/dwc/pcie-designware.c Frank Wunderlich 2022-01-21 704 printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 705 }
8bcca26585585a drivers/pci/controller/dwc/pcie-designware.c Hou Zhiqiang 2021-04-13 706
:::::: The code at line 677 was first introduced by commit
:::::: 281f1f99cf3a761b45f611943721dfb1895c68a3 PCI: dwc: Detect number of iATU windows
:::::: TO: Rob Herring <robh(a)kernel.org>
:::::: CC: Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[cel:topic-rpc-with-tls 9991/9999] net/tls/ecdh.c:144:1: warning: no previous prototype for 'ttls_ecdh_read_params'
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux topic-rpc-with-tls
head: a72d5318846d67a7f3f5f2bcb4c0c09c4f8907d1
commit: a0a99a10f4f0e3e1e35e566687137669da78abcd [9991/9999] Port of Tempesta TLS handshakes to the Linux 5.10.68
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20220122/202201221357.AwLCo8LM-lk...)
compiler: m68k-linux-gcc (GCC) 11.2.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/cel/linux.git/commit/?id=...
git remote add cel git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
git fetch --no-tags cel topic-rpc-with-tls
git checkout a0a99a10f4f0e3e1e35e566687137669da78abcd
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash net/
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 >>):
>> net/tls/ecdh.c:144:1: warning: no previous prototype for 'ttls_ecdh_read_params' [-Wmissing-prototypes]
144 | ttls_ecdh_read_params(TlsECDHCtx *ctx, const unsigned char **buf,
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from include/asm-generic/bug.h:5,
from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/random.h:10,
from net/tls/bignum.h:28,
from net/tls/error.c:25:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:50: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:9: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:17: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
net/tls/error.c: At top level:
>> net/tls/error.c:40:6: warning: no previous prototype for 'ttls_strerror' [-Wmissing-prototypes]
40 | void ttls_strerror(int ret, char *buf, size_t buflen)
| ^~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for CRYPTO_SHA1_SSSE3
Depends on CRYPTO && X86 && 64BIT
Selected by
- TLS_HANDSHAKE && NET && TLS
WARNING: unmet direct dependencies detected for NEED_MULTIPLE_NODES
Depends on DISCONTIGMEM || NUMA
Selected by
- SINGLE_MEMORY_CHUNK && MMU
vim +/ttls_ecdh_read_params +144 net/tls/ecdh.c
135
136 /**
137 * Read the ServerKeyExhange parameters (RFC 8422 5.4)
138 * struct {
139 * ECParameters curve_params;
140 * ECPoint public;
141 * } ServerECDHParams;
142 */
143 int
> 144 ttls_ecdh_read_params(TlsECDHCtx *ctx, const unsigned char **buf,
145 const unsigned char *end)
146 {
147 int r;
148
149 if (!(ctx->grp = ttls_ecp_tls_read_group(buf, end - *buf)))
150 return -EINVAL;
151
152 /*
153 * Import a point from a TLS ECPoint record (RFC 8443 5.4)
154 * struct {
155 * opaque point <1..2^8-1>;
156 * } ECPoint;
157 */
158 if (!(r = ttls_ecdh_read_public(ctx, *buf, end - *buf)))
159 *buf += end - *buf;
160
161 return r;
162 }
163
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
fs/ext4/super.c:2295:1: warning: unused function 'ctx_test_flags'
by kernel test robot
Hi Lukas,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b57f458985742bd1c585f4c7f36d04634ce1143
commit: 6e47a3cc68fc525428297a00524833361ebbb0e9 ext4: get rid of super block and sbi from handle_mount_ops()
date: 6 weeks ago
config: mips-randconfig-c004-20220118 (https://download.01.org/0day-ci/archive/20220122/202201221207.g5vwf1MI-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
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 6e47a3cc68fc525428297a00524833361ebbb0e9
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash
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 >>):
>> fs/ext4/super.c:2295:1: warning: unused function 'ctx_test_flags'
EXT4_SET_CTX(flags);
^
fs/ext4/super.c:2290:20: note: expanded from macro 'EXT4_SET_CTX'
static inline bool ctx_test_##name(struct ext4_fs_context int flag) ^
<scratch space>:85:1: note: expanded from here
ctx_test_flags
^
>> fs/ext4/super.c:2298:1: warning: unused function 'ctx_clear_mount_flags'
EXT4_SET_CTX(mount_flags);
^
fs/ext4/super.c:2285:20: note: expanded from macro 'EXT4_SET_CTX'
static inline void ctx_clear_##name(struct ext4_fs_context int flag) ^
<scratch space>:106:1: note: expanded from here
ctx_clear_mount_flags
^
>> fs/ext4/super.c:2298:1: warning: unused function 'ctx_test_mount_flags'
fs/ext4/super.c:2290:20: note: expanded from macro 'EXT4_SET_CTX'
static inline bool ctx_test_##name(struct ext4_fs_context int flag) ^
<scratch space>:109:1: note: expanded from here
ctx_test_mount_flags
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.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/bitops.h", .line = 105, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $0, $1
or $0, $2
sc $0, $1
beqz $0, 1b
.set pop
'
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -Wp,-MMD,fs/ext4/.super.o.d -nostdinc -Iarch/mips/include -I./arch/mips/include/generated -Iinclude -I./include -Iarch/mips/include/uapi -I./arch/mips/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff80100000 -DLINKER_LOAD_ADDRESS=0x80100000 -DDATAOFFSET=0 -Qunused-arguments -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=mips-linux -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -EB -fno-stack-check -march=mips32 -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -Iarch/mips/include/asm/mach-generic -Iarch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough -Wno-gnu -mno-global-merge -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -I fs/ext4 -I ./fs/ext4 -DKBUILD_MODFILE="fs/ext4/ext4" -DKBUILD_BASENAME="super" -DKBUILD_MODNAME="ext4" -D__KBUILD_MODNAME=kmod_ext4 -c -o fs/ext4/super.o fs/ext4/super.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'fs/ext4/super.c'.
4. Running pass 'Mips Assembly Printer' on function '@ext4_read_bh_nowait'
#0 0x000056120809e14f Signals.cpp:0:0
#1 0x000056120809c02c llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/clang-7b3d307288/bin/clang-14+0x342202c)
#2 0x0000561207fdb747 llvm::CrashRecoveryContext::HandleExit(int) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3361747)
#3 0x00005612080946de llvm::sys::Process::Exit(int, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x341a6de)
#4 0x0000561205d04bcb (/opt/cross/clang-7b3d307288/bin/clang-14+0x108abcb)
#5 0x0000561207fe21fc llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x33681fc)
#6 0x0000561208cc6487 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr const (/opt/cross/clang-7b3d307288/bin/clang-14+0x404c487)
#7 0x0000561208cc23e4 llvm::AsmPrinter::emitFunctionBody() (/opt/cross/clang-7b3d307288/bin/clang-14+0x40483e4)
#8 0x00005612067617e7 llvm::MipsAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x1ae77e7)
#9 0x0000561207405ced llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.53) MachineFunctionPass.cpp:0:0
#10 0x000056120783e8a7 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc48a7)
#11 0x000056120783ea21 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc4a21)
#12 0x000056120783fcff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc5cff)
#13 0x00005612083adb7a clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3733b7a)
#14 0x0000561208fdde53 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x4363e53)
#15 0x0000561209ae8769 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x4e6e769)
#16 0x0000561208fdcc9f clang::CodeGenAction::ExecuteAction() (/opt/cross/clang-7b3d307288/bin/clang-14+0x4362c9f)
#17 0x00005612089dcca1 clang::FrontendAction::Execute() (/opt/cross/clang-7b3d307288/bin/clang-14+0x3d62ca1)
#18 0x000056120897432a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3cfa32a)
#19 0x0000561208aa0e0b (/opt/cross/clang-7b3d307288/bin/clang-14+0x3e26e0b)
#20 0x0000561205d05914 cc1_main(llvm::ArrayRef<char char (/opt/cross/clang-7b3d307288/bin/clang-14+0x108b914)
#21 0x0000561205d02e5b ExecuteCC1Tool(llvm::SmallVectorImpl<char driver.cpp:0:0
#22 0x000056120880f8a5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const::'lambda'()>(long) Job.cpp:0:0
#23 0x0000561207fdb603 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3361603)
#24 0x000056120881019e clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const (.part.216) Job.cpp:0:0
#25 0x00005612087e6877 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b6c877)
#26 0x00005612087e7257 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) const (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b6d257)
#27 0x00005612087f0bc9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b76bc9)
#28 0x0000561205c2d25f main (/opt/cross/clang-7b3d307288/bin/clang-14+0xfb325f)
#29 0x00007faabc246d0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#30 0x0000561205d0297a _start (/opt/cross/clang-7b3d307288/bin/clang-14+0x108897a)
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 14.0.0 (git://gitmirror/llvm_project 7b3d30728816403d1fd73cc5082e9fb761262bce)
Target: mips-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-7b3d307288/bin
clang-14: note: diagnostic msg:
Makefile arch block certs crypto drivers fs include init ipc kernel lib mm net scripts security sound source usr virt
vim +/ctx_test_flags +2295 fs/ext4/super.c
2294
> 2295 EXT4_SET_CTX(flags);
2296 EXT4_SET_CTX(mount_opt);
2297 EXT4_SET_CTX(mount_opt2);
> 2298 EXT4_SET_CTX(mount_flags);
2299
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[intel-lts:5.4/yocto 17196/20394] drivers/tty/serial/8250/8250_dma.c:258 serial8250_request_dma() warn: inconsistent indenting
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 36f93ff941f127f4137ab369aecbdd995fb58c66
commit: bb65ef7d36911280609696a0f96a557defaee3ce [17196/20394] serial: 8250: PSE DMA quirk fix
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220122/202201221116.ducxk05N-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
drivers/tty/serial/8250/8250_dma.c:258 serial8250_request_dma() warn: inconsistent indenting
vim +258 drivers/tty/serial/8250/8250_dma.c
169
170 int serial8250_request_dma(struct uart_8250_port *p)
171 {
172 struct uart_8250_dma *dma = p->dma;
173 phys_addr_t rx_dma_addr = dma->rx_dma_addr ?
174 dma->rx_dma_addr : p->port.mapbase;
175 phys_addr_t tx_dma_addr = dma->tx_dma_addr ?
176 dma->tx_dma_addr : p->port.mapbase;
177 dma_cap_mask_t mask;
178 struct dma_slave_caps caps;
179 int ret;
180
181 /* Default slave configuration parameters */
182 dma->rxconf.direction = DMA_DEV_TO_MEM;
183 dma->rxconf.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
184 dma->rxconf.src_addr = rx_dma_addr + UART_RX;
185
186 dma->txconf.direction = DMA_MEM_TO_DEV;
187 dma->txconf.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
188 dma->txconf.dst_addr = tx_dma_addr + UART_TX;
189
190 dma_cap_zero(mask);
191 dma_cap_set(DMA_SLAVE, mask);
192
193 /* Get a channel for RX */
194 dma->rxchan = dma_request_slave_channel_compat(mask,
195 dma->fn, dma->rx_param,
196 p->port.dev, "rx");
197 if (!dma->rxchan)
198 return -ENODEV;
199
200 /* 8250 rx dma requires dmaengine driver to support pause/terminate */
201 ret = dma_get_slave_caps(dma->rxchan, &caps);
202 if (ret)
203 goto release_rx;
204 if (!caps.cmd_pause || !caps.cmd_terminate ||
205 caps.residue_granularity == DMA_RESIDUE_GRANULARITY_DESCRIPTOR) {
206 ret = -EINVAL;
207 goto release_rx;
208 }
209
210 dmaengine_slave_config(dma->rxchan, &dma->rxconf);
211
212 /* Get a channel for TX */
213 dma->txchan = dma_request_slave_channel_compat(mask,
214 dma->fn, dma->tx_param,
215 p->port.dev, "tx");
216 if (!dma->txchan) {
217 ret = -ENODEV;
218 goto release_rx;
219 }
220
221 /* 8250 tx dma requires dmaengine driver to support terminate */
222 ret = dma_get_slave_caps(dma->txchan, &caps);
223 if (ret)
224 goto err;
225 if (!caps.cmd_terminate) {
226 ret = -EINVAL;
227 goto err;
228 }
229
230 dmaengine_slave_config(dma->txchan, &dma->txconf);
231
232 /* RX buffer */
233 if (!dma->rx_size)
234 dma->rx_size = PAGE_SIZE;
235
236 if (pse_dma_quirk) {
237 dma->rx_buf = dma_alloc_coherent(p->port.dev, dma->rx_size,
238 &dma->rx_addr, GFP_KERNEL);
239 } else {
240 dma->rx_buf = dma_alloc_coherent(dma->rxchan->device->dev,
241 dma->rx_size, &dma->rx_addr, GFP_KERNEL);
242 }
243
244 if (!dma->rx_buf) {
245 ret = -ENOMEM;
246 goto err;
247 }
248
249 /* TX buffer */
250 if (pse_dma_quirk) {
251 dma->tx_addr = dma_map_single(p->port.dev,
252 p->port.state->xmit.buf,
253 UART_XMIT_SIZE,
254 DMA_TO_DEVICE);
255 if (dma_mapping_error(p->port.dev, dma->tx_addr)) {
256 dma_free_coherent(p->port.dev, dma->rx_size,
257 dma->rx_buf, dma->rx_addr);
> 258 ret = -ENOMEM;
259 goto err;
260 }
261 } else {
262 dma->tx_addr = dma_map_single(dma->txchan->device->dev,
263 p->port.state->xmit.buf,
264 UART_XMIT_SIZE,
265 DMA_TO_DEVICE);
266
267 if (dma_mapping_error(dma->txchan->device->dev, dma->tx_addr)) {
268 dma_free_coherent(dma->rxchan->device->dev,
269 dma->rx_size, dma->rx_buf,
270 dma->rx_addr);
271 ret = -ENOMEM;
272 goto err;
273 }
274 }
275
276 dev_dbg_ratelimited(p->port.dev, "got both dma channels\n");
277
278 return 0;
279 err:
280 dma_release_channel(dma->txchan);
281 release_rx:
282 dma_release_channel(dma->rxchan);
283 return ret;
284 }
285 EXPORT_SYMBOL_GPL(serial8250_request_dma);
286
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[ammarfaizi2-block:google/android/kernel/common/android-4.19-stable 350/9999] drivers/cpuidle/cpuidle.c:598:27: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.19-stable
head: 90a691fca4c2525068d9908ac203e9f09e4e33c0
commit: 02f88aaaac53929e0cf4fe50f807cdea4b9e224d [350/9999] ANDROID: GKI: Export symbols arm_cpuidle_suspend, cpuidle_dev and cpuidle_register_governor
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220122/202201221155.oQX7vOxx-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/ammarfaizi2/linux-block/commit/02f88aaaac53929e0cf4fe5...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-4.19-stable
git checkout 02f88aaaac53929e0cf4fe50f807cdea4b9e224d
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/cpuidle/
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 >>)
>> drivers/cpuidle/cpuidle.c:598:27: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct cpuidle_device * @@
drivers/cpuidle/cpuidle.c:598:27: sparse: expected void const [noderef] <asn:3> *__vpp_verify
drivers/cpuidle/cpuidle.c:598:27: sparse: got struct cpuidle_device *
drivers/cpuidle/cpuidle.c:630:27: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] <asn:3> *__vpp_verify @@ got struct cpuidle_device * @@
drivers/cpuidle/cpuidle.c:630:27: sparse: expected void const [noderef] <asn:3> *__vpp_verify
drivers/cpuidle/cpuidle.c:630:27: sparse: got struct cpuidle_device *
vim +598 drivers/cpuidle/cpuidle.c
4f86d3a8e29720 Len Brown 2007-10-03 584
1c192d047a0ddc Daniel Lezcano 2013-04-23 585 /**
4c637b2175a0dc Daniel Lezcano 2013-04-23 586 * cpuidle_unregister: unregister a driver and the devices. This function
4c637b2175a0dc Daniel Lezcano 2013-04-23 587 * can be used only if the driver has been previously registered through
4c637b2175a0dc Daniel Lezcano 2013-04-23 588 * the cpuidle_register function.
4c637b2175a0dc Daniel Lezcano 2013-04-23 589 *
4c637b2175a0dc Daniel Lezcano 2013-04-23 590 * @drv: a valid pointer to a struct cpuidle_driver
4c637b2175a0dc Daniel Lezcano 2013-04-23 591 */
4c637b2175a0dc Daniel Lezcano 2013-04-23 592 void cpuidle_unregister(struct cpuidle_driver *drv)
4c637b2175a0dc Daniel Lezcano 2013-04-23 593 {
4c637b2175a0dc Daniel Lezcano 2013-04-23 594 int cpu;
4c637b2175a0dc Daniel Lezcano 2013-04-23 595 struct cpuidle_device *device;
4c637b2175a0dc Daniel Lezcano 2013-04-23 596
82467a5a885ddd Daniel Lezcano 2013-06-07 597 for_each_cpu(cpu, drv->cpumask) {
4c637b2175a0dc Daniel Lezcano 2013-04-23 @598 device = &per_cpu(cpuidle_dev, cpu);
4c637b2175a0dc Daniel Lezcano 2013-04-23 599 cpuidle_unregister_device(device);
4c637b2175a0dc Daniel Lezcano 2013-04-23 600 }
4c637b2175a0dc Daniel Lezcano 2013-04-23 601
4c637b2175a0dc Daniel Lezcano 2013-04-23 602 cpuidle_unregister_driver(drv);
4c637b2175a0dc Daniel Lezcano 2013-04-23 603 }
4c637b2175a0dc Daniel Lezcano 2013-04-23 604 EXPORT_SYMBOL_GPL(cpuidle_unregister);
4c637b2175a0dc Daniel Lezcano 2013-04-23 605
:::::: The code at line 598 was first introduced by commit
:::::: 4c637b2175a0dc65d533494225525c6c82d73293 cpuidle: make a single register function for all
:::::: TO: Daniel Lezcano <daniel.lezcano(a)linaro.org>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[jgunthorpe:for-yishai 9/18] include/uapi/linux/vfio.h:608:37: error: expected identifier before '(' token
by kernel test robot
tree: https://github.com/jgunthorpe/linux for-yishai
head: 578832b9b1266b9c2fa0205513bd7570867bf3e5
commit: 755823a03dd267576194ffe22f6640eca356dfdf [9/18] vfio: Define device migration protocol v2
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20220122/202201221146.IDixXFOw-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.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://github.com/jgunthorpe/linux/commit/755823a03dd267576194ffe22f6640...
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe for-yishai
git checkout 755823a03dd267576194ffe22f6640eca356dfdf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/vfio/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the jgunthorpe/for-yishai HEAD 578832b9b1266b9c2fa0205513bd7570867bf3e5 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
In file included from include/linux/vfio.h:16,
from drivers/vfio/vfio.c:32:
>> include/uapi/linux/vfio.h:608:37: error: expected identifier before '(' token
608 | #define VFIO_DEVICE_STATE_STOP (0)
| ^
include/uapi/linux/vfio.h:1098:9: note: in expansion of macro 'VFIO_DEVICE_STATE_STOP'
1098 | VFIO_DEVICE_STATE_STOP = 1,
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c: In function 'vfio_mig_get_next_state':
>> drivers/vfio/vfio.c:1600:26: error: 'VFIO_DEVICE_STATE_STOP_COPY' undeclared (first use in this function); did you mean 'VFIO_DEVICE_STATE_STOP'?
1600 | [VFIO_DEVICE_STATE_STOP_COPY] = VFIO_DEVICE_STATE_STOP_COPY,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| VFIO_DEVICE_STATE_STOP
drivers/vfio/vfio.c:1600:26: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/vfio/vfio.c:1600:26: error: array index in initializer not of integer type
drivers/vfio/vfio.c:1600:26: note: (near initialization for 'vfio_from_fsm_table[0]')
drivers/vfio/vfio.c:1602:53: warning: initialized field overwritten [-Woverride-init]
1602 | [VFIO_DEVICE_STATE_ERROR] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1602:53: note: (near initialization for 'vfio_from_fsm_table[0][0]')
drivers/vfio/vfio.c:1607:26: error: array index in initializer not of integer type
1607 | [VFIO_DEVICE_STATE_STOP_COPY] = VFIO_DEVICE_STATE_STOP,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1607:26: note: (near initialization for 'vfio_from_fsm_table[1]')
drivers/vfio/vfio.c:1609:53: warning: initialized field overwritten [-Woverride-init]
1609 | [VFIO_DEVICE_STATE_ERROR] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1609:53: note: (near initialization for 'vfio_from_fsm_table[1][0]')
drivers/vfio/vfio.c:1611:18: error: array index in initializer not of integer type
1611 | [VFIO_DEVICE_STATE_STOP_COPY] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1611:18: note: (near initialization for 'vfio_from_fsm_table')
drivers/vfio/vfio.c:1614:26: error: array index in initializer not of integer type
1614 | [VFIO_DEVICE_STATE_STOP_COPY] = VFIO_DEVICE_STATE_STOP_COPY,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1614:26: note: (near initialization for 'vfio_from_fsm_table[2]')
drivers/vfio/vfio.c:1616:53: warning: initialized field overwritten [-Woverride-init]
1616 | [VFIO_DEVICE_STATE_ERROR] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1616:53: note: (near initialization for 'vfio_from_fsm_table[2][0]')
drivers/vfio/vfio.c:1621:26: error: array index in initializer not of integer type
1621 | [VFIO_DEVICE_STATE_STOP_COPY] = VFIO_DEVICE_STATE_STOP,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1621:26: note: (near initialization for 'vfio_from_fsm_table[4]')
drivers/vfio/vfio.c:1623:53: warning: initialized field overwritten [-Woverride-init]
1623 | [VFIO_DEVICE_STATE_ERROR] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1623:53: note: (near initialization for 'vfio_from_fsm_table[4][0]')
drivers/vfio/vfio.c:1628:26: error: array index in initializer not of integer type
1628 | [VFIO_DEVICE_STATE_STOP_COPY] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1628:26: note: (near initialization for 'vfio_from_fsm_table[0]')
drivers/vfio/vfio.c:1630:53: warning: initialized field overwritten [-Woverride-init]
1630 | [VFIO_DEVICE_STATE_ERROR] = VFIO_DEVICE_STATE_ERROR,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio.c:1630:53: note: (near initialization for 'vfio_from_fsm_table[0][0]')
--
In file included from include/linux/vfio.h:16,
from drivers/vfio/virqfd.c:10:
>> include/uapi/linux/vfio.h:608:37: error: expected identifier before '(' token
608 | #define VFIO_DEVICE_STATE_STOP (0)
| ^
include/uapi/linux/vfio.h:1098:9: note: in expansion of macro 'VFIO_DEVICE_STATE_STOP'
1098 | VFIO_DEVICE_STATE_STOP = 1,
| ^~~~~~~~~~~~~~~~~~~~~~
vim +608 include/uapi/linux/vfio.h
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 409
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 410 /*
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 411 * The structure vfio_device_migration_info is placed at the 0th offset of
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 412 * the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 413 * migration information. Field accesses from this structure are only supported
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 414 * at their native width and alignment. Otherwise, the result is undefined and
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 415 * vendor drivers should return an error.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 416 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 417 * device_state: (read/write)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 418 * - The user application writes to this field to inform the vendor driver
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 419 * about the device state to be transitioned to.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 420 * - The vendor driver should take the necessary actions to change the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 421 * device state. After successful transition to a given state, the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 422 * vendor driver should return success on write(device_state, state)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 423 * system call. If the device state transition fails, the vendor driver
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 424 * should return an appropriate -errno for the fault condition.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 425 * - On the user application side, if the device state transition fails,
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 426 * that is, if write(device_state, state) returns an error, read
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 427 * device_state again to determine the current state of the device from
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 428 * the vendor driver.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 429 * - The vendor driver should return previous state of the device unless
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 430 * the vendor driver has encountered an internal error, in which case
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 431 * the vendor driver may report the device_state VFIO_DEVICE_STATE_ERROR.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 432 * - The user application must use the device reset ioctl to recover the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 433 * device from VFIO_DEVICE_STATE_ERROR state. If the device is
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 434 * indicated to be in a valid device state by reading device_state, the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 435 * user application may attempt to transition the device to any valid
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 436 * state reachable from the current state or terminate itself.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 437 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 438 * device_state consists of 3 bits:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 439 * - If bit 0 is set, it indicates the _RUNNING state. If bit 0 is clear,
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 440 * it indicates the _STOP state. When the device state is changed to
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 441 * _STOP, driver should stop the device before write() returns.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 442 * - If bit 1 is set, it indicates the _SAVING state, which means that the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 443 * driver should start gathering device state information that will be
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 444 * provided to the VFIO user application to save the device's state.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 445 * - If bit 2 is set, it indicates the _RESUMING state, which means that
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 446 * the driver should prepare to resume the device. Data provided through
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 447 * the migration region should be used to resume the device.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 448 * Bits 3 - 31 are reserved for future use. To preserve them, the user
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 449 * application should perform a read-modify-write operation on this
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 450 * field when modifying the specified bits.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 451 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 452 * +------- _RESUMING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 453 * |+------ _SAVING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 454 * ||+----- _RUNNING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 455 * |||
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 456 * 000b => Device Stopped, not saving or resuming
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 457 * 001b => Device running, which is the default state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 458 * 010b => Stop the device & save the device state, stop-and-copy state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 459 * 011b => Device running and save the device state, pre-copy state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 460 * 100b => Device stopped and the device state is resuming
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 461 * 101b => Invalid state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 462 * 110b => Error state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 463 * 111b => Invalid state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 464 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 465 * State transitions:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 466 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 467 * _RESUMING _RUNNING Pre-copy Stop-and-copy _STOP
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 468 * (100b) (001b) (011b) (010b) (000b)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 469 * 0. Running or default state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 470 * |
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 471 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 472 * 1. Normal Shutdown (optional)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 473 * |------------------------------------->|
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 474 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 475 * 2. Save the state or suspend
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 476 * |------------------------->|---------->|
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 477 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 478 * 3. Save the state during live migration
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 479 * |----------->|------------>|---------->|
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 480 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 481 * 4. Resuming
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 482 * |<---------|
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 483 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 484 * 5. Resumed
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 485 * |--------->|
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 486 *
c12fa88c6d16ed Zenghui Yu 2020-09-10 487 * 0. Default state of VFIO device is _RUNNING when the user application starts.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 488 * 1. During normal shutdown of the user application, the user application may
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 489 * optionally change the VFIO device state from _RUNNING to _STOP. This
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 490 * transition is optional. The vendor driver must support this transition but
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 491 * must not require it.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 492 * 2. When the user application saves state or suspends the application, the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 493 * device state transitions from _RUNNING to stop-and-copy and then to _STOP.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 494 * On state transition from _RUNNING to stop-and-copy, driver must stop the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 495 * device, save the device state and send it to the application through the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 496 * migration region. The sequence to be followed for such transition is given
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 497 * below.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 498 * 3. In live migration of user application, the state transitions from _RUNNING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 499 * to pre-copy, to stop-and-copy, and to _STOP.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 500 * On state transition from _RUNNING to pre-copy, the driver should start
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 501 * gathering the device state while the application is still running and send
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 502 * the device state data to application through the migration region.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 503 * On state transition from pre-copy to stop-and-copy, the driver must stop
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 504 * the device, save the device state and send it to the user application
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 505 * through the migration region.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 506 * Vendor drivers must support the pre-copy state even for implementations
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 507 * where no data is provided to the user before the stop-and-copy state. The
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 508 * user must not be required to consume all migration data before the device
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 509 * transitions to a new state, including the stop-and-copy state.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 510 * The sequence to be followed for above two transitions is given below.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 511 * 4. To start the resuming phase, the device state should be transitioned from
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 512 * the _RUNNING to the _RESUMING state.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 513 * In the _RESUMING state, the driver should use the device state data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 514 * received through the migration region to resume the device.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 515 * 5. After providing saved device data to the driver, the application should
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 516 * change the state from _RESUMING to _RUNNING.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 517 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 518 * reserved:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 519 * Reads on this field return zero and writes are ignored.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 520 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 521 * pending_bytes: (read only)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 522 * The number of pending bytes still to be migrated from the vendor driver.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 523 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 524 * data_offset: (read only)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 525 * The user application should read data_offset field from the migration
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 526 * region. The user application should read the device data from this
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 527 * offset within the migration region during the _SAVING state or write
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 528 * the device data during the _RESUMING state. See below for details of
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 529 * sequence to be followed.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 530 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 531 * data_size: (read/write)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 532 * The user application should read data_size to get the size in bytes of
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 533 * the data copied in the migration region during the _SAVING state and
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 534 * write the size in bytes of the data copied in the migration region
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 535 * during the _RESUMING state.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 536 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 537 * The format of the migration region is as follows:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 538 * ------------------------------------------------------------------
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 539 * |vfio_device_migration_info| data section |
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 540 * | | /////////////////////////////// |
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 541 * ------------------------------------------------------------------
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 542 * ^ ^
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 543 * offset 0-trapped part data_offset
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 544 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 545 * The structure vfio_device_migration_info is always followed by the data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 546 * section in the region, so data_offset will always be nonzero. The offset
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 547 * from where the data is copied is decided by the kernel driver. The data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 548 * section can be trapped, mmapped, or partitioned, depending on how the kernel
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 549 * driver defines the data section. The data section partition can be defined
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 550 * as mapped by the sparse mmap capability. If mmapped, data_offset must be
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 551 * page aligned, whereas initial section which contains the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 552 * vfio_device_migration_info structure, might not end at the offset, which is
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 553 * page aligned. The user is not required to access through mmap regardless
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 554 * of the capabilities of the region mmap.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 555 * The vendor driver should determine whether and how to partition the data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 556 * section. The vendor driver should return data_offset accordingly.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 557 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 558 * The sequence to be followed while in pre-copy state and stop-and-copy state
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 559 * is as follows:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 560 * a. Read pending_bytes, indicating the start of a new iteration to get device
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 561 * data. Repeated read on pending_bytes at this stage should have no side
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 562 * effects.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 563 * If pending_bytes == 0, the user application should not iterate to get data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 564 * for that device.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 565 * If pending_bytes > 0, perform the following steps.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 566 * b. Read data_offset, indicating that the vendor driver should make data
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 567 * available through the data section. The vendor driver should return this
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 568 * read operation only after data is available from (region + data_offset)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 569 * to (region + data_offset + data_size).
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 570 * c. Read data_size, which is the amount of data in bytes available through
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 571 * the migration region.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 572 * Read on data_offset and data_size should return the offset and size of
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 573 * the current buffer if the user application reads data_offset and
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 574 * data_size more than once here.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 575 * d. Read data_size bytes of data from (region + data_offset) from the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 576 * migration region.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 577 * e. Process the data.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 578 * f. Read pending_bytes, which indicates that the data from the previous
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 579 * iteration has been read. If pending_bytes > 0, go to step b.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 580 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 581 * The user application can transition from the _SAVING|_RUNNING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 582 * (pre-copy state) to the _SAVING (stop-and-copy) state regardless of the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 583 * number of pending bytes. The user application should iterate in _SAVING
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 584 * (stop-and-copy) until pending_bytes is 0.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 585 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 586 * The sequence to be followed while _RESUMING device state is as follows:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 587 * While data for this device is available, repeat the following steps:
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 588 * a. Read data_offset from where the user application should write data.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 589 * b. Write migration data starting at the migration region + data_offset for
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 590 * the length determined by data_size from the migration source.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 591 * c. Write data_size, which indicates to the vendor driver that data is
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 592 * written in the migration region. Vendor driver must return this write
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 593 * operations on consuming data. Vendor driver should apply the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 594 * user-provided migration region data to the device resume state.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 595 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 596 * If an error occurs during the above sequences, the vendor driver can return
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 597 * an error code for next read() or write() operation, which will terminate the
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 598 * loop. The user application should then take the next necessary action, for
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 599 * example, failing migration or terminating the user application.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 600 *
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 601 * For the user application, data is opaque. The user application should write
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 602 * data in the same order as the data is received and the data should be of
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 603 * same transaction size at the source.
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 604 */
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 605
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 606 struct vfio_device_migration_info {
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 607 __u32 device_state; /* VFIO device state */
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 @608 #define VFIO_DEVICE_STATE_STOP (0)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 609 #define VFIO_DEVICE_STATE_RUNNING (1 << 0)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 610 #define VFIO_DEVICE_STATE_SAVING (1 << 1)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 611 #define VFIO_DEVICE_STATE_RESUMING (1 << 2)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 612 #define VFIO_DEVICE_STATE_MASK (VFIO_DEVICE_STATE_RUNNING | \
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 613 VFIO_DEVICE_STATE_SAVING | \
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 614 VFIO_DEVICE_STATE_RESUMING)
a8a24f3f6e3810 Kirti Wankhede 2020-05-29 615
:::::: The code at line 608 was first introduced by commit
:::::: a8a24f3f6e38103b77cf399c38eb54e1219d00d6 vfio: UAPI for migration interface for device state
:::::: TO: Kirti Wankhede <kwankhede(a)nvidia.com>
:::::: CC: Alex Williamson <alex.williamson(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
[cel:topic-rpc-with-tls 9993/9999] net/tls/crypto.c:252:42: warning: suggest braces around empty body in an 'if' statement
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux topic-rpc-with-tls
head: a72d5318846d67a7f3f5f2bcb4c0c09c4f8907d1
commit: e0ae63faa3340c31e8457c7a2b9e8210955dd42c [9993/9999] Move headers, required for other modules, to include/net/tls/
config: um-allyesconfig (https://download.01.org/0day-ci/archive/20220122/202201221103.a0Ov4OZp-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/commit/?id=...
git remote add cel git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
git fetch --no-tags cel topic-rpc-with-tls
git checkout e0ae63faa3340c31e8457c7a2b9e8210955dd42c
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=um SHELL=/bin/bash net/tls/
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 >>):
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/crypto.c: In function 'ttls_md_starts':
>> net/tls/crypto.c:252:42: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
252 | T_DBG("cannot start hash ctx, %d\n", r);
| ^
net/tls/crypto.c: In function 'ttls_md_update':
net/tls/crypto.c:266:43: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
266 | T_DBG("cannot update hash ctx, %d\n", r);
| ^
net/tls/crypto.c: In function 'ttls_md_finish':
net/tls/crypto.c:280:47: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
280 | T_DBG("cannot finish hash context, %d\n", r);
| ^
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>> net/tls/ec_25519.c:137:1: warning: no previous prototype for 'ecp_mod_p255' [-Wmissing-prototypes]
137 | ecp_mod_p255(TlsMpi *N)
| ^~~~~~~~~~~~
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>> net/tls/ec_p256.c:1412:1: warning: no previous prototype for 'ecp256_gen_keypair' [-Wmissing-prototypes]
1412 | ecp256_gen_keypair(TlsMpi *d, TlsEcpPoint *Q)
| ^~~~~~~~~~~~~~~~~~
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/mpool.c: In function 'ttls_mpi_pool_free':
>> net/tls/mpool.c:185:29: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
185 | mp->order, mp->curr);
| ^
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/pkparse.c: In function 'pk_parse_key_sec1_der':
>> net/tls/pkparse.c:419:18: warning: variable 'pubkey_done' set but not used [-Wunused-but-set-variable]
419 | int r, version, pubkey_done;
| ^~~~~~~~~~~
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>> net/tls/rsa.c:255:1: warning: no previous prototype for 'ttls_rsa_deduce_primes' [-Wmissing-prototypes]
255 | ttls_rsa_deduce_primes(TlsMpi const *N, TlsMpi const *E, TlsMpi const *D,
| ^~~~~~~~~~~~~~~~~~~~~~
>> net/tls/rsa.c:371:1: warning: no previous prototype for 'ttls_rsa_deduce_private_exponent' [-Wmissing-prototypes]
371 | ttls_rsa_deduce_private_exponent(TlsMpi const *P, TlsMpi const *Q,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/tls/rsa.c:414:1: warning: no previous prototype for 'ttls_rsa_deduce_crt' [-Wmissing-prototypes]
414 | ttls_rsa_deduce_crt(const TlsMpi *P, const TlsMpi *Q, const TlsMpi *D,
| ^~~~~~~~~~~~~~~~~~~
>> net/tls/rsa.c:1376:1: warning: no previous prototype for 'ttls_rsa_rsassa_pss_verify' [-Wmissing-prototypes]
1376 | ttls_rsa_rsassa_pss_verify(TlsRSACtx *ctx, ttls_md_type_t md_alg,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/tls_srv.c: In function 'ttls_process_session_ticket':
>> net/tls/tls_srv.c:323:54: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
323 | T_DBG("ClientHello: cannot parse ticket, %d\n", r);
| ^
net/tls/tls_srv.c: In function 'ttls_write_certificate_request':
>> net/tls/tls_srv.c:1503:6: warning: variable 'authmode' set but not used [-Wunused-but-set-variable]
1503 | int authmode;
| ^~~~~~~~
net/tls/tls_srv.c: In function 'ttls_parse_client_key_exchange':
>> net/tls/tls_srv.c:1786:52: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1786 | T_DBG("KeyExchange: cannot derive keys, %d\n", r);
| ^
net/tls/tls_srv.c: In function 'ttls_parse_certificate_verify':
net/tls/tls_srv.c:1880:37: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1880 | T_DBG("cannot verify pk, %d\n", r);
| ^
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/tls_ticket.c: In function 'ttls_tickets_init':
>> net/tls/tls_ticket.c:385:1: warning: old-style function definition [-Wold-style-definition]
385 | ttls_tickets_init()
| ^~~~~~~~~~~~~~~~~
net/tls/tls_ticket.c: In function 'ttls_tickets_exit':
net/tls/tls_ticket.c:406:6: warning: old-style function definition [-Wold-style-definition]
406 | void ttls_tickets_exit()
| ^~~~~~~~~~~~~~~~~
--
cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
net/tls/ttls.c: In function '__ttls_send_record':
>> net/tls/ttls.c:1036:43: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1036 | T_DBG("TLS send callback error %d\n", r);
| ^
net/tls/ttls.c: At top level:
>> net/tls/ttls.c:1295:1: warning: no previous prototype for 'ttls_handle_alert' [-Wmissing-prototypes]
1295 | ttls_handle_alert(TlsCtx *tls)
| ^~~~~~~~~~~~~~~~~
net/tls/ttls.c: In function 'ttls_parse_certificate':
net/tls/ttls.c:1587:53: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
1587 | T_DBG("client cert verification status: %d\n", r);
| ^
net/tls/ttls.c: At top level:
>> net/tls/ttls.c:2461:1: warning: no previous prototype for 'ttls_sig_hash_set_has' [-Wmissing-prototypes]
2461 | ttls_sig_hash_set_has(TlsSigHashSet *set, ttls_pk_type_t sig_alg,
| ^~~~~~~~~~~~~~~~~~~~~
>> net/tls/ttls.c:2475:1: warning: no previous prototype for 'ttls_sig_hash_set_const' [-Wmissing-prototypes]
2475 | ttls_sig_hash_set_const(TlsSigHashSet *set, ttls_pk_type_t sig_alg,
| ^~~~~~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for MFD_CORE
Depends on HAS_IOMEM
Selected by
- MFD_HI6421_SPMI && STAGING && OF && SPMI
WARNING: unmet direct dependencies detected for CRYPTO_SHA1_SSSE3
Depends on CRYPTO && X86 && 64BIT
Selected by
- TLS_HANDSHAKE && NET && TLS
vim +/if +252 net/tls/crypto.c
a0a99a10f4f0e3 Alexander K 2021-09-27 242
a0a99a10f4f0e3 Alexander K 2021-09-27 243 int
a0a99a10f4f0e3 Alexander K 2021-09-27 244 ttls_md_starts(TlsMdCtx *ctx)
a0a99a10f4f0e3 Alexander K 2021-09-27 245 {
a0a99a10f4f0e3 Alexander K 2021-09-27 246 int r;
a0a99a10f4f0e3 Alexander K 2021-09-27 247
a0a99a10f4f0e3 Alexander K 2021-09-27 248 BUG_ON(!ctx || !ctx->md_info);
a0a99a10f4f0e3 Alexander K 2021-09-27 249
a0a99a10f4f0e3 Alexander K 2021-09-27 250 r = crypto_shash_init(&ctx->md_ctx);
a0a99a10f4f0e3 Alexander K 2021-09-27 251 if (r)
a0a99a10f4f0e3 Alexander K 2021-09-27 @252 T_DBG("cannot start hash ctx, %d\n", r);
a0a99a10f4f0e3 Alexander K 2021-09-27 253
a0a99a10f4f0e3 Alexander K 2021-09-27 254 return r;
a0a99a10f4f0e3 Alexander K 2021-09-27 255 }
a0a99a10f4f0e3 Alexander K 2021-09-27 256
:::::: The code at line 252 was first introduced by commit
:::::: a0a99a10f4f0e3e1e35e566687137669da78abcd Port of Tempesta TLS handshakes to the Linux 5.10.68
:::::: TO: Alexander K <ak(a)tempesta-tech.com>
:::::: CC: Chuck Lever <chuck.lever(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months