* arch/x86/hyperv/irqdomain.c:124:30: sparse: sparse: invalid access past the end of 'dev_id' (4 8)
@ 2021-02-26 4:54 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-26 4:54 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 8113 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Wei Liu <wei.liu@kernel.org>
CC: Sunil Muthuswamy <sunilmut@microsoft.com>
CC: Michael Kelley <mikelley@microsoft.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2c87f7a38f930ef6f6a7bdd04aeb82ce3971b54b
commit: e39397d1fd6851bef4dfb63a631b8e15d1f43329 x86/hyperv: implement an MSI domain for root partition
date: 2 weeks ago
:::::: branch date: 9 hours ago
:::::: commit date: 2 weeks ago
config: i386-randconfig-s001-20210226 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-229-g60c1f270-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e39397d1fd6851bef4dfb63a631b8e15d1f43329
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e39397d1fd6851bef4dfb63a631b8e15d1f43329
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
arch/x86/hyperv/irqdomain.c:27:18: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
arch/x86/hyperv/irqdomain.c:27:18: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/hyperv/irqdomain.c:27:18: sparse: got void [noderef] __percpu **
arch/x86/hyperv/irqdomain.c:27:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct hv_input_map_device_interrupt *input @@ got void [noderef] __percpu * @@
arch/x86/hyperv/irqdomain.c:27:15: sparse: expected struct hv_input_map_device_interrupt *input
arch/x86/hyperv/irqdomain.c:27:15: sparse: got void [noderef] __percpu *
arch/x86/hyperv/irqdomain.c:28:19: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
arch/x86/hyperv/irqdomain.c:28:19: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/hyperv/irqdomain.c:28:19: sparse: got void [noderef] __percpu **
arch/x86/hyperv/irqdomain.c:28:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct hv_output_map_device_interrupt *output @@ got void [noderef] __percpu * @@
arch/x86/hyperv/irqdomain.c:28:16: sparse: expected struct hv_output_map_device_interrupt *output
arch/x86/hyperv/irqdomain.c:28:16: sparse: got void [noderef] __percpu *
arch/x86/hyperv/irqdomain.c:80:18: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
arch/x86/hyperv/irqdomain.c:80:18: sparse: expected void const [noderef] __percpu *__vpp_verify
arch/x86/hyperv/irqdomain.c:80:18: sparse: got void [noderef] __percpu **
arch/x86/hyperv/irqdomain.c:80:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct hv_input_unmap_device_interrupt *input @@ got void [noderef] __percpu * @@
arch/x86/hyperv/irqdomain.c:80:15: sparse: expected struct hv_input_unmap_device_interrupt *input
arch/x86/hyperv/irqdomain.c:80:15: sparse: got void [noderef] __percpu *
>> arch/x86/hyperv/irqdomain.c:124:30: sparse: sparse: invalid access past the end of 'dev_id' (4 8)
vim +/dev_id +124 arch/x86/hyperv/irqdomain.c
e39397d1fd6851 Wei Liu 2021-02-03 112
e39397d1fd6851 Wei Liu 2021-02-03 113 static union hv_device_id hv_build_pci_dev_id(struct pci_dev *dev)
e39397d1fd6851 Wei Liu 2021-02-03 114 {
e39397d1fd6851 Wei Liu 2021-02-03 115 union hv_device_id dev_id;
e39397d1fd6851 Wei Liu 2021-02-03 116 struct rid_data data = {
e39397d1fd6851 Wei Liu 2021-02-03 117 .bridge = NULL,
e39397d1fd6851 Wei Liu 2021-02-03 118 .rid = PCI_DEVID(dev->bus->number, dev->devfn)
e39397d1fd6851 Wei Liu 2021-02-03 119 };
e39397d1fd6851 Wei Liu 2021-02-03 120
e39397d1fd6851 Wei Liu 2021-02-03 121 pci_for_each_dma_alias(dev, get_rid_cb, &data);
e39397d1fd6851 Wei Liu 2021-02-03 122
e39397d1fd6851 Wei Liu 2021-02-03 123 dev_id.as_uint64 = 0;
e39397d1fd6851 Wei Liu 2021-02-03 @124 dev_id.device_type = HV_DEVICE_TYPE_PCI;
e39397d1fd6851 Wei Liu 2021-02-03 125 dev_id.pci.segment = pci_domain_nr(dev->bus);
e39397d1fd6851 Wei Liu 2021-02-03 126
e39397d1fd6851 Wei Liu 2021-02-03 127 dev_id.pci.bdf.bus = PCI_BUS_NUM(data.rid);
e39397d1fd6851 Wei Liu 2021-02-03 128 dev_id.pci.bdf.device = PCI_SLOT(data.rid);
e39397d1fd6851 Wei Liu 2021-02-03 129 dev_id.pci.bdf.function = PCI_FUNC(data.rid);
e39397d1fd6851 Wei Liu 2021-02-03 130 dev_id.pci.source_shadow = HV_SOURCE_SHADOW_NONE;
e39397d1fd6851 Wei Liu 2021-02-03 131
e39397d1fd6851 Wei Liu 2021-02-03 132 if (data.bridge) {
e39397d1fd6851 Wei Liu 2021-02-03 133 int pos;
e39397d1fd6851 Wei Liu 2021-02-03 134
e39397d1fd6851 Wei Liu 2021-02-03 135 /*
e39397d1fd6851 Wei Liu 2021-02-03 136 * Microsoft Hypervisor requires a bus range when the bridge is
e39397d1fd6851 Wei Liu 2021-02-03 137 * running in PCI-X mode.
e39397d1fd6851 Wei Liu 2021-02-03 138 *
e39397d1fd6851 Wei Liu 2021-02-03 139 * To distinguish conventional vs PCI-X bridge, we can check
e39397d1fd6851 Wei Liu 2021-02-03 140 * the bridge's PCI-X Secondary Status Register, Secondary Bus
e39397d1fd6851 Wei Liu 2021-02-03 141 * Mode and Frequency bits. See PCI Express to PCI/PCI-X Bridge
e39397d1fd6851 Wei Liu 2021-02-03 142 * Specification Revision 1.0 5.2.2.1.3.
e39397d1fd6851 Wei Liu 2021-02-03 143 *
e39397d1fd6851 Wei Liu 2021-02-03 144 * Value zero means it is in conventional mode, otherwise it is
e39397d1fd6851 Wei Liu 2021-02-03 145 * in PCI-X mode.
e39397d1fd6851 Wei Liu 2021-02-03 146 */
e39397d1fd6851 Wei Liu 2021-02-03 147
e39397d1fd6851 Wei Liu 2021-02-03 148 pos = pci_find_capability(data.bridge, PCI_CAP_ID_PCIX);
e39397d1fd6851 Wei Liu 2021-02-03 149 if (pos) {
e39397d1fd6851 Wei Liu 2021-02-03 150 u16 status;
e39397d1fd6851 Wei Liu 2021-02-03 151
e39397d1fd6851 Wei Liu 2021-02-03 152 pci_read_config_word(data.bridge, pos +
e39397d1fd6851 Wei Liu 2021-02-03 153 PCI_X_BRIDGE_SSTATUS, &status);
e39397d1fd6851 Wei Liu 2021-02-03 154
e39397d1fd6851 Wei Liu 2021-02-03 155 if (status & PCI_X_SSTATUS_FREQ) {
e39397d1fd6851 Wei Liu 2021-02-03 156 /* Non-zero, PCI-X mode */
e39397d1fd6851 Wei Liu 2021-02-03 157 u8 sec_bus, sub_bus;
e39397d1fd6851 Wei Liu 2021-02-03 158
e39397d1fd6851 Wei Liu 2021-02-03 159 dev_id.pci.source_shadow = HV_SOURCE_SHADOW_BRIDGE_BUS_RANGE;
e39397d1fd6851 Wei Liu 2021-02-03 160
e39397d1fd6851 Wei Liu 2021-02-03 161 pci_read_config_byte(data.bridge, PCI_SECONDARY_BUS, &sec_bus);
e39397d1fd6851 Wei Liu 2021-02-03 162 dev_id.pci.shadow_bus_range.secondary_bus = sec_bus;
e39397d1fd6851 Wei Liu 2021-02-03 163 pci_read_config_byte(data.bridge, PCI_SUBORDINATE_BUS, &sub_bus);
e39397d1fd6851 Wei Liu 2021-02-03 164 dev_id.pci.shadow_bus_range.subordinate_bus = sub_bus;
e39397d1fd6851 Wei Liu 2021-02-03 165 }
e39397d1fd6851 Wei Liu 2021-02-03 166 }
e39397d1fd6851 Wei Liu 2021-02-03 167 }
e39397d1fd6851 Wei Liu 2021-02-03 168
e39397d1fd6851 Wei Liu 2021-02-03 169 return dev_id;
e39397d1fd6851 Wei Liu 2021-02-03 170 }
e39397d1fd6851 Wei Liu 2021-02-03 171
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39672 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-26 4:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 4:54 arch/x86/hyperv/irqdomain.c:124:30: sparse: sparse: invalid access past the end of 'dev_id' (4 8) kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.