linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Haren Myneni <haren@linux.ibm.com>,
	mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
	npiggin@gmail.com, nathanl@linux.ibm.com
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH v5 3/9] powerpc/vas: Add paste address mmap fault handler
Date: Tue, 1 Mar 2022 01:35:06 +0800	[thread overview]
Message-ID: <202202281913.4N2Af10e-lkp@intel.com> (raw)
In-Reply-To: <0325487209c8ad936b3b3165375c6ba1c8d3370c.camel@linux.ibm.com>

Hi Haren,

I love your patch! Perhaps something to improve:

[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.17-rc6 next-20220225]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Haren-Myneni/powerpc-pseries-vas-NXGZIP-support-with-DLPAR/20220228-154814
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-s031-20220227 (https://download.01.org/0day-ci/archive/20220228/202202281913.4N2Af10e-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/336150efb288e945786ca6d54b0eb7d9c956aad8
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Haren-Myneni/powerpc-pseries-vas-NXGZIP-support-with-DLPAR/20220228-154814
        git checkout 336150efb288e945786ca6d54b0eb7d9c956aad8
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/platforms/book3s/ arch/powerpc/platforms/pseries/

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/powerpc/platforms/book3s/vas-api.c:403:29: sparse: sparse: incorrect type in assignment (different base types) @@     expected int ret @@     got restricted vm_fault_t @@
   arch/powerpc/platforms/book3s/vas-api.c:403:29: sparse:     expected int ret
   arch/powerpc/platforms/book3s/vas-api.c:403:29: sparse:     got restricted vm_fault_t
>> arch/powerpc/platforms/book3s/vas-api.c:406:32: sparse: sparse: incorrect type in return expression (different base types) @@     expected restricted vm_fault_t @@     got int ret @@
   arch/powerpc/platforms/book3s/vas-api.c:406:32: sparse:     expected restricted vm_fault_t
   arch/powerpc/platforms/book3s/vas-api.c:406:32: sparse:     got int ret

vim +403 arch/powerpc/platforms/book3s/vas-api.c

   353	
   354	/*
   355	 * This fault handler is invoked when the core generates page fault on
   356	 * the paste address. Happens if the kernel closes window in hypervisor
   357	 * (on pseries) due to lost credit or the paste address is not mapped.
   358	 */
   359	static vm_fault_t vas_mmap_fault(struct vm_fault *vmf)
   360	{
   361		struct vm_area_struct *vma = vmf->vma;
   362		struct file *fp = vma->vm_file;
   363		struct coproc_instance *cp_inst = fp->private_data;
   364		struct vas_window *txwin;
   365		u64 paste_addr;
   366		int ret;
   367	
   368		/*
   369		 * window is not opened. Shouldn't expect this error.
   370		 */
   371		if (!cp_inst || !cp_inst->txwin) {
   372			pr_err("%s(): Unexpected fault on paste address with TX window closed\n",
   373					__func__);
   374			return VM_FAULT_SIGBUS;
   375		}
   376	
   377		txwin = cp_inst->txwin;
   378		/*
   379		 * When the LPAR lost credits due to core removal or during
   380		 * migration, invalidate the existing mapping for the current
   381		 * paste addresses and set windows in-active (zap_page_range in
   382		 * reconfig_close_windows()).
   383		 * New mapping will be done later after migration or new credits
   384		 * available. So continue to receive faults if the user space
   385		 * issue NX request.
   386		 */
   387		if (txwin->task_ref.vma != vmf->vma) {
   388			pr_err("%s(): No previous mapping with paste address\n",
   389				__func__);
   390			return VM_FAULT_SIGBUS;
   391		}
   392	
   393		mutex_lock(&txwin->task_ref.mmap_mutex);
   394		/*
   395		 * The window may be inactive due to lost credit (Ex: core
   396		 * removal with DLPAR). If the window is active again when
   397		 * the credit is available, map the new paste address at the
   398		 * the window virtual address.
   399		 */
   400		if (txwin->status == VAS_WIN_ACTIVE) {
   401			paste_addr = cp_inst->coproc->vops->paste_addr(txwin);
   402			if (paste_addr) {
 > 403				ret = vmf_insert_pfn(vma, vma->vm_start,
   404						(paste_addr >> PAGE_SHIFT));
   405				mutex_unlock(&txwin->task_ref.mmap_mutex);
 > 406				return ret;
   407			}
   408		}
   409		mutex_unlock(&txwin->task_ref.mmap_mutex);
   410	
   411		return VM_FAULT_SIGBUS;
   412	

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

  reply	other threads:[~2022-02-28 17:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28  7:32 [PATCH v5 0/9] powerpc/pseries/vas: NXGZIP support with DLPAR Haren Myneni
2022-02-28  7:34 ` [PATCH v5 1/9] powerpc/pseries/vas: Use common names in VAS capability structure Haren Myneni
2022-02-28  7:35 ` [PATCH v5 2/9] powerpc/pseries/vas: Save PID in pseries_vas_window struct Haren Myneni
2022-02-28  7:35 ` [PATCH v5 3/9] powerpc/vas: Add paste address mmap fault handler Haren Myneni
2022-02-28 17:35   ` kernel test robot [this message]
2022-02-28  7:36 ` [PATCH v5 4/9] powerpc/vas: Return paste instruction failure if no active window Haren Myneni
2022-02-28  7:41 ` Haren Myneni
2022-02-28  7:42 ` [PATCH v5 5/9] powerpc/vas: Map paste address only if window is active Haren Myneni
2022-02-28  7:42 ` [PATCH v5 6/9] powerpc/pseries/vas: Close windows with DLPAR core removal Haren Myneni
2022-02-28  7:43 ` [PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add Haren Myneni
2022-02-28  7:44 ` [PATCH v5 8/9] powerpc/pseries/vas: sysfs interface to export capabilities Haren Myneni
2022-02-28  7:44 ` [PATCH v5 9/9] powerpc/pseries/vas: Add 'update_total_credits' entry for QoS capabilities Haren Myneni
2022-02-28  7:47 ` [PATCH v5 7/9] powerpc/pseries/vas: Reopen windows with DLPAR core add Haren Myneni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202281913.4N2Af10e-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=haren@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).