linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value
@ 2021-08-31 16:19 kernel test robot
  2021-09-01 11:18 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-08-31 16:19 UTC (permalink / raw)
  To: Giovanni Cabiddu
  Cc: llvm, kbuild-all, linux-kernel, Herbert Xu, Fiona Trahe,
	Wojciech Ziemba, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 4693 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b91db6a0b52e019b6bdabea3f1dbe36d85c7e52c
commit: f9c697c4bfc6002d92e8015b65fe2a79acadb416 crypto: qat - split transport CSR access logic
date:   10 months ago
config: i386-randconfig-r012-20210831 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4b1fde8a2b681dad2ce0c082a5d6422caa06b0bc)
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/torvalds/linux.git/commit/?id=f9c697c4bfc6002d92e8015b65fe2a79acadb416
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f9c697c4bfc6002d92e8015b65fe2a79acadb416
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument]
   In file included from drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:3:
   In file included from drivers/crypto/qat/qat_c62xvf/../qat_common/adf_accel_devices.h:5:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:5:
   In file included from include/linux/context_tracking_state.h:5:
   In file included from include/linux/percpu.h:6:
   In file included from include/linux/preempt.h:78:
   In file included from arch/x86/include/asm/preempt.h:7:
   In file included from include/linux/thread_info.h:38:
   arch/x86/include/asm/thread_info.h:183:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
           oldframe = __builtin_frame_address(1);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/thread_info.h:185:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
                   frame = __builtin_frame_address(2);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value [-Waddress-of-packed-member]
           adf_gen2_init_hw_csr_ops(&hw_data->csr_ops);
                                     ^~~~~~~~~~~~~~~~
   3 warnings generated.


vim +102 drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c

    68	
    69	void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data)
    70	{
    71		hw_data->dev_class = &c62xiov_class;
    72		hw_data->num_banks = ADF_C62XIOV_ETR_MAX_BANKS;
    73		hw_data->num_rings_per_bank = ADF_ETR_MAX_RINGS_PER_BANK;
    74		hw_data->num_accel = ADF_C62XIOV_MAX_ACCELERATORS;
    75		hw_data->num_logical_accel = 1;
    76		hw_data->num_engines = ADF_C62XIOV_MAX_ACCELENGINES;
    77		hw_data->tx_rx_gap = ADF_C62XIOV_RX_RINGS_OFFSET;
    78		hw_data->tx_rings_mask = ADF_C62XIOV_TX_RINGS_MASK;
    79		hw_data->alloc_irq = adf_vf_isr_resource_alloc;
    80		hw_data->free_irq = adf_vf_isr_resource_free;
    81		hw_data->enable_error_correction = adf_vf_void_noop;
    82		hw_data->init_admin_comms = adf_vf_int_noop;
    83		hw_data->exit_admin_comms = adf_vf_void_noop;
    84		hw_data->send_admin_init = adf_vf2pf_init;
    85		hw_data->init_arb = adf_vf_int_noop;
    86		hw_data->exit_arb = adf_vf_void_noop;
    87		hw_data->disable_iov = adf_vf2pf_shutdown;
    88		hw_data->get_accel_mask = get_accel_mask;
    89		hw_data->get_ae_mask = get_ae_mask;
    90		hw_data->get_num_accels = get_num_accels;
    91		hw_data->get_num_aes = get_num_aes;
    92		hw_data->get_etr_bar_id = get_etr_bar_id;
    93		hw_data->get_misc_bar_id = get_misc_bar_id;
    94		hw_data->get_pf2vf_offset = get_pf2vf_offset;
    95		hw_data->get_vintmsk_offset = get_vintmsk_offset;
    96		hw_data->get_sku = get_sku;
    97		hw_data->enable_ints = adf_vf_void_noop;
    98		hw_data->enable_vf2pf_comms = adf_enable_vf2pf_comms;
    99		hw_data->min_iov_compat_ver = ADF_PFVF_COMPATIBILITY_VERSION;
   100		hw_data->dev_class->instances++;
   101		adf_devmgr_update_class_index(hw_data);
 > 102		adf_gen2_init_hw_csr_ops(&hw_data->csr_ops);
   103	}
   104	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41395 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value
  2021-08-31 16:19 drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value kernel test robot
@ 2021-09-01 11:18 ` Andy Shevchenko
  2021-09-01 11:36   ` Giovanni Cabiddu
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2021-09-01 11:18 UTC (permalink / raw)
  To: kernel test robot
  Cc: Giovanni Cabiddu, llvm, kbuild-all, linux-kernel, Herbert Xu,
	Fiona Trahe, Wojciech Ziemba

On Wed, Sep 01, 2021 at 12:19:08AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   b91db6a0b52e019b6bdabea3f1dbe36d85c7e52c
> commit: f9c697c4bfc6002d92e8015b65fe2a79acadb416 crypto: qat - split transport CSR access logic
> date:   10 months ago
> config: i386-randconfig-r012-20210831 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4b1fde8a2b681dad2ce0c082a5d6422caa06b0bc)
> 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/torvalds/linux.git/commit/?id=f9c697c4bfc6002d92e8015b65fe2a79acadb416
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout f9c697c4bfc6002d92e8015b65fe2a79acadb416
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    clang-14: warning: optimization flag '-falign-jumps=0' is not supported [-Wignored-optimization-argument]
>    In file included from drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:3:
>    In file included from drivers/crypto/qat/qat_c62xvf/../qat_common/adf_accel_devices.h:5:
>    In file included from include/linux/interrupt.h:11:
>    In file included from include/linux/hardirq.h:5:
>    In file included from include/linux/context_tracking_state.h:5:
>    In file included from include/linux/percpu.h:6:
>    In file included from include/linux/preempt.h:78:
>    In file included from arch/x86/include/asm/preempt.h:7:
>    In file included from include/linux/thread_info.h:38:
>    arch/x86/include/asm/thread_info.h:183:13: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
>            oldframe = __builtin_frame_address(1);
>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
>    arch/x86/include/asm/thread_info.h:185:11: warning: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Wframe-address]
>                    frame = __builtin_frame_address(2);

Funny, but it's not related to the reported issue.

>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
> >> drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value [-Waddress-of-packed-member]
>            adf_gen2_init_hw_csr_ops(&hw_data->csr_ops);
>                                      ^~~~~~~~~~~~~~~~
>    3 warnings generated.


Why on Earth the struct adf_hw_device_data, that contains a lot of pointers,
marked as __packed?! That __packed has to be dropped.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value
  2021-09-01 11:18 ` Andy Shevchenko
@ 2021-09-01 11:36   ` Giovanni Cabiddu
  0 siblings, 0 replies; 3+ messages in thread
From: Giovanni Cabiddu @ 2021-09-01 11:36 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, llvm, kbuild-all, linux-kernel, Herbert Xu,
	Fiona Trahe, Wojciech Ziemba

On Wed, Sep 01, 2021 at 02:18:17PM +0300, Andy Shevchenko wrote:
> On Wed, Sep 01, 2021 at 12:19:08AM +0800, kernel test robot wrote:
> > >> drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value [-Waddress-of-packed-member]
> >            adf_gen2_init_hw_csr_ops(&hw_data->csr_ops);
> >                                      ^~~~~~~~~~~~~~~~
> >    3 warnings generated.
> 
> 
> Why on Earth the struct adf_hw_device_data, that contains a lot of pointers,
> marked as __packed?! That __packed has to be dropped.
That struct doesn't need to be marked as __packed.
I'm going to send a patch that drops that attribute for all the
structures that do not need to be packed in the QAT driver.

-- 
Giovanni

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-01 11:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 16:19 drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c:102:28: warning: taking address of packed member 'csr_ops' of class or structure 'adf_hw_device_data' may result in an unaligned pointer value kernel test robot
2021-09-01 11:18 ` Andy Shevchenko
2021-09-01 11:36   ` Giovanni Cabiddu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).