Hi Sasha,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc6 next-20200519]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/Sasha-Levin/DirectX-on-Linux/202...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
642b151f45dd54809ea00ecd3976a56c1ec9b53d
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
> drivers/gpu/dxgkrnl/hmgr.c:91:6: warning: no previous prototype
for function 'get_instance' [-Wmissing-prototypes]
uint
get_instance(d3dkmt_handle h)
^
drivers/gpu/dxgkrnl/hmgr.c:91:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
uint get_instance(d3dkmt_handle h)
^
static
> drivers/gpu/dxgkrnl/hmgr.c:178:6: warning: no previous prototype
for function 'print_status' [-Wmissing-prototypes]
void print_status(struct
hmgrtable *table)
^
drivers/gpu/dxgkrnl/hmgr.c:178:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
void print_status(struct hmgrtable *table)
^
static
> drivers/gpu/dxgkrnl/hmgr.c:549:21: warning: no previous prototype
for function 'hmgrtable_get_entry_type' [-Wmissing-prototypes]
enum
hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
drivers/gpu/dxgkrnl/hmgr.c:549:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
enum hmgrentry_type hmgrtable_get_entry_type(struct hmgrtable *table,
^
static
drivers/gpu/dxgkrnl/hmgr.c:173:20: warning: unused function 'is_empty'
[-Wunused-function]
static inline bool is_empty(struct hmgrtable *table)
^
4 warnings generated.
--
> drivers/gpu/dxgkrnl/dxgadapter.c:281:6: warning: no previous
prototype for function 'dxgdevice_mark_destroyed' [-Wmissing-prototypes]
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
drivers/gpu/dxgkrnl/dxgadapter.c:281:1: note: declare 'static' if the function is
not intended to be used outside of this translation unit
void dxgdevice_mark_destroyed(struct dxgdevice *device)
^
static
> drivers/gpu/dxgkrnl/dxgadapter.c:664:2: warning: ignoring return
value of function declared with 'warn_unused_result' attribute [-Wunused-result]
refcount_inc_not_zero(&resource->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
drivers/gpu/dxgkrnl/dxgadapter.c:1326:2: warning: ignoring return value of function
declared with 'warn_unused_result' attribute [-Wunused-result]
refcount_inc_not_zero(&syncobj->refcount);
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
3 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/ioctl.c:21:
drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type
'enum dxgkvmb_commandtype' to different enumeration type 'enum
dxgkvmb_commandtype_global' [-Wenum-conversion]
command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/dxgkrnl/ioctl.c:1568:5: warning: no previous
prototype for function 'validate_alloc' [-Wmissing-prototypes]
int
validate_alloc(struct dxgallocation *alloc0,
^
drivers/gpu/dxgkrnl/ioctl.c:1568:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
int validate_alloc(struct dxgallocation *alloc0,
^
static
> drivers/gpu/dxgkrnl/ioctl.c:4734:5: warning: no previous
prototype for function 'assign_resource_handles' [-Wmissing-prototypes]
int
assign_resource_handles(struct dxgprocess *process,
^
drivers/gpu/dxgkrnl/ioctl.c:4734:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
int assign_resource_handles(struct dxgprocess *process,
^
static
> drivers/gpu/dxgkrnl/ioctl.c:4793:5: warning: no previous
prototype for function 'open_resource' [-Wmissing-prototypes]
int
open_resource(struct dxgprocess *process,
^
drivers/gpu/dxgkrnl/ioctl.c:4793:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
int open_resource(struct dxgprocess *process,
^
static
4 warnings generated.
--
In file included from drivers/gpu/dxgkrnl/dxgvmbus.c:22:
drivers/gpu/dxgkrnl/dxgvmbus.h:826:26: warning: implicit conversion from enumeration type
'enum dxgkvmb_commandtype' to different enumeration type 'enum
dxgkvmb_commandtype_global' [-Wenum-conversion]
command->command_type = DXGK_VMBCOMMAND_INVALID;
~ ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/dxgkrnl/dxgvmbus.c:108:6: warning: no previous
prototype for function 'signal_guest_event' [-Wmissing-prototypes]
void
signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:108:1: note: declare 'static' if the function is
not intended to be used outside of this translation unit
void signal_guest_event(struct dxgkvmb_command_host_to_vm *packet,
^
static
> drivers/gpu/dxgkrnl/dxgvmbus.c:126:6: warning: no previous
prototype for function 'process_inband_packet' [-Wmissing-prototypes]
void
process_inband_packet(struct dxgvmbuschannel *channel,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:126:1: note: declare 'static' if the function is
not intended to be used outside of this translation unit
void process_inband_packet(struct dxgvmbuschannel *channel,
^
static
> drivers/gpu/dxgkrnl/dxgvmbus.c:158:6: warning: no previous
prototype for function 'process_completion_packet' [-Wmissing-prototypes]
void process_completion_packet(struct dxgvmbuschannel *channel,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:158:1: note: declare 'static' if the function is
not intended to be used outside of this translation unit
void process_completion_packet(struct dxgvmbuschannel *channel,
^
static
> drivers/gpu/dxgkrnl/dxgvmbus.c:785:5: warning: no previous
prototype for function 'create_existing_sysmem' [-Wmissing-prototypes]
int
create_existing_sysmem(struct dxgdevice *device,
^
drivers/gpu/dxgkrnl/dxgvmbus.c:785:1: note: declare 'static' if the function is
not intended to be used outside of this translation unit
int create_existing_sysmem(struct dxgdevice *device,
^
static
drivers/gpu/dxgkrnl/dxgvmbus.c:88:20: warning: unused function
'command_vm_to_host_init0' [-Wunused-function]
static inline void command_vm_to_host_init0(struct dxgkvmb_command_vm_to_host
^
6 warnings generated.
vim +/get_instance +91 drivers/gpu/dxgkrnl/hmgr.c
9cc562c3695b5b Sasha Levin 2020-05-19 90
9cc562c3695b5b Sasha Levin 2020-05-19 @91 uint get_instance(d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 92 {
9cc562c3695b5b Sasha Levin 2020-05-19 93 return (h & HMGRHANDLE_INSTANCE_MASK)
>> HMGRHANDLE_INSTANCE_SHIFT;
9cc562c3695b5b Sasha Levin 2020-05-19 94 }
9cc562c3695b5b Sasha Levin 2020-05-19 95
9cc562c3695b5b Sasha Levin 2020-05-19 96 static bool is_handle_valid(struct hmgrtable
*table, d3dkmt_handle h,
9cc562c3695b5b Sasha Levin 2020-05-19 97 bool ignore_destroyed, enum
hmgrentry_type t)
9cc562c3695b5b Sasha Levin 2020-05-19 98 {
9cc562c3695b5b Sasha Levin 2020-05-19 99 uint index = get_index(h);
9cc562c3695b5b Sasha Levin 2020-05-19 100 uint unique = get_unique(h);
9cc562c3695b5b Sasha Levin 2020-05-19 101 struct hmgrentry *entry;
9cc562c3695b5b Sasha Levin 2020-05-19 102
9cc562c3695b5b Sasha Levin 2020-05-19 103 if (index >= table->table_size) {
9cc562c3695b5b Sasha Levin 2020-05-19 104 pr_err("%s Invalid index %x %d\n",
__func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 105 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 106 }
9cc562c3695b5b Sasha Levin 2020-05-19 107
9cc562c3695b5b Sasha Levin 2020-05-19 108 entry = &table->entry_table[index];
9cc562c3695b5b Sasha Levin 2020-05-19 109 if (unique != entry->unique) {
9cc562c3695b5b Sasha Levin 2020-05-19 110 pr_err("%s Invalid unique %x %d %d %d
%p",
9cc562c3695b5b Sasha Levin 2020-05-19 111 __func__, h, unique, entry->unique,
9cc562c3695b5b Sasha Levin 2020-05-19 112 index, entry->object);
9cc562c3695b5b Sasha Levin 2020-05-19 113 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 114 }
9cc562c3695b5b Sasha Levin 2020-05-19 115
9cc562c3695b5b Sasha Levin 2020-05-19 116 if (entry->destroyed &&
!ignore_destroyed) {
9cc562c3695b5b Sasha Levin 2020-05-19 117 pr_err("%s Invalid destroyed",
__func__);
9cc562c3695b5b Sasha Levin 2020-05-19 118 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 119 }
9cc562c3695b5b Sasha Levin 2020-05-19 120
9cc562c3695b5b Sasha Levin 2020-05-19 121 if (entry->type == HMGRENTRY_TYPE_FREE) {
9cc562c3695b5b Sasha Levin 2020-05-19 122 pr_err("%s Entry is freed %x %d",
__func__, h, index);
9cc562c3695b5b Sasha Levin 2020-05-19 123 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 124 }
9cc562c3695b5b Sasha Levin 2020-05-19 125
9cc562c3695b5b Sasha Levin 2020-05-19 126 if (t != HMGRENTRY_TYPE_FREE && t !=
entry->type) {
9cc562c3695b5b Sasha Levin 2020-05-19 127 pr_err("%s type mismatch %x %d
%d", __func__, h,
9cc562c3695b5b Sasha Levin 2020-05-19 128 t, entry->type);
9cc562c3695b5b Sasha Levin 2020-05-19 129 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 130 }
9cc562c3695b5b Sasha Levin 2020-05-19 131
9cc562c3695b5b Sasha Levin 2020-05-19 132 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 133 }
9cc562c3695b5b Sasha Levin 2020-05-19 134
9cc562c3695b5b Sasha Levin 2020-05-19 135 static d3dkmt_handle build_handle(uint index,
uint unique, uint instance)
9cc562c3695b5b Sasha Levin 2020-05-19 136 {
9cc562c3695b5b Sasha Levin 2020-05-19 137 uint handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 138
9cc562c3695b5b Sasha Levin 2020-05-19 139 handle_bits = (index <<
HMGRHANDLE_INDEX_SHIFT) & HMGRHANDLE_INDEX_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 140 handle_bits |= (unique <<
HMGRHANDLE_UNIQUE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 141 HMGRHANDLE_UNIQUE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 142 handle_bits |= (instance <<
HMGRHANDLE_INSTANCE_SHIFT) &
9cc562c3695b5b Sasha Levin 2020-05-19 143 HMGRHANDLE_INSTANCE_MASK;
9cc562c3695b5b Sasha Levin 2020-05-19 144
9cc562c3695b5b Sasha Levin 2020-05-19 145 return (d3dkmt_handle) handle_bits;
9cc562c3695b5b Sasha Levin 2020-05-19 146 }
9cc562c3695b5b Sasha Levin 2020-05-19 147
9cc562c3695b5b Sasha Levin 2020-05-19 148 inline uint
hmgrtable_get_used_entry_count(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 149 {
9cc562c3695b5b Sasha Levin 2020-05-19 150 DXGKRNL_ASSERT(table->table_size >=
table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 151 return (table->table_size -
table->free_count);
9cc562c3695b5b Sasha Levin 2020-05-19 152 }
9cc562c3695b5b Sasha Levin 2020-05-19 153
9cc562c3695b5b Sasha Levin 2020-05-19 154 bool hmgrtable_mark_destroyed(struct hmgrtable
*table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 155 {
9cc562c3695b5b Sasha Levin 2020-05-19 156 if (!is_handle_valid(table, h, false,
HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 157 return false;
9cc562c3695b5b Sasha Levin 2020-05-19 158
9cc562c3695b5b Sasha Levin 2020-05-19 159 table->entry_table[get_index(h)].destroyed
= true;
9cc562c3695b5b Sasha Levin 2020-05-19 160 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 161 }
9cc562c3695b5b Sasha Levin 2020-05-19 162
9cc562c3695b5b Sasha Levin 2020-05-19 163 bool hmgrtable_unmark_destroyed(struct
hmgrtable *table, d3dkmt_handle h)
9cc562c3695b5b Sasha Levin 2020-05-19 164 {
9cc562c3695b5b Sasha Levin 2020-05-19 165 if (!is_handle_valid(table, h, true,
HMGRENTRY_TYPE_FREE))
9cc562c3695b5b Sasha Levin 2020-05-19 166 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 167
9cc562c3695b5b Sasha Levin 2020-05-19 168
DXGKRNL_ASSERT(table->entry_table[get_index(h)].destroyed);
9cc562c3695b5b Sasha Levin 2020-05-19 169 table->entry_table[get_index(h)].destroyed
= 0;
9cc562c3695b5b Sasha Levin 2020-05-19 170 return true;
9cc562c3695b5b Sasha Levin 2020-05-19 171 }
9cc562c3695b5b Sasha Levin 2020-05-19 172
9cc562c3695b5b Sasha Levin 2020-05-19 173 static inline bool is_empty(struct hmgrtable
*table)
9cc562c3695b5b Sasha Levin 2020-05-19 174 {
9cc562c3695b5b Sasha Levin 2020-05-19 175 return (table->free_count ==
table->table_size);
9cc562c3695b5b Sasha Levin 2020-05-19 176 }
9cc562c3695b5b Sasha Levin 2020-05-19 177
9cc562c3695b5b Sasha Levin 2020-05-19 @178 void print_status(struct hmgrtable *table)
9cc562c3695b5b Sasha Levin 2020-05-19 179 {
9cc562c3695b5b Sasha Levin 2020-05-19 180 int i;
9cc562c3695b5b Sasha Levin 2020-05-19 181
9cc562c3695b5b Sasha Levin 2020-05-19 182 TRACE_DEBUG(1, "hmgrtable head, tail %p
%d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 183 table, table->free_handle_list_head,
9cc562c3695b5b Sasha Levin 2020-05-19 184 table->free_handle_list_tail);
9cc562c3695b5b Sasha Levin 2020-05-19 185 if (table->entry_table == NULL)
9cc562c3695b5b Sasha Levin 2020-05-19 186 return;
9cc562c3695b5b Sasha Levin 2020-05-19 187 for (i = 0; i < 3; i++) {
9cc562c3695b5b Sasha Levin 2020-05-19 188 if (table->entry_table[i].type !=
HMGRENTRY_TYPE_FREE)
9cc562c3695b5b Sasha Levin 2020-05-19 189 TRACE_DEBUG(1, "hmgrtable entry %p %d
%p\n",
9cc562c3695b5b Sasha Levin 2020-05-19 190 table, i,
table->entry_table[i].object);
9cc562c3695b5b Sasha Levin 2020-05-19 191 else
9cc562c3695b5b Sasha Levin 2020-05-19 192 TRACE_DEBUG(1, "hmgrtable entry %p %d
%d %d\n",
9cc562c3695b5b Sasha Levin 2020-05-19 193 table, i,
9cc562c3695b5b Sasha Levin 2020-05-19 194
table->entry_table[i].next_free_index,
9cc562c3695b5b Sasha Levin 2020-05-19 195
table->entry_table[i].prev_free_index);
9cc562c3695b5b Sasha Levin 2020-05-19 196 }
9cc562c3695b5b Sasha Levin 2020-05-19 197 }
9cc562c3695b5b Sasha Levin 2020-05-19 198
:::::: The code at line 91 was first introduced by commit
:::::: 9cc562c3695b5b44c0c931c76bdc24e8c4f33587 gpu: dxgkrnl: core code
:::::: TO: Sasha Levin <sashal(a)kernel.org>
:::::: CC: 0day robot <lkp(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org