All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH v1 2/2] s390/mm: re-enable the shared zeropage for !PV and !skeys KVM guests
Date: Mon, 1 Apr 2024 17:47:02 +0800	[thread overview]
Message-ID: <202404011730.2TEIocud-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240321215954.177730-3-david@redhat.com>
References: <20240321215954.177730-3-david@redhat.com>
TO: David Hildenbrand <david@redhat.com>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvms390/next]
[also build test WARNING on s390/features linus/master v6.9-rc2]
[cannot apply to akpm-mm/mm-everything next-20240328]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Hildenbrand/mm-userfaultfd-don-t-place-zeropages-when-zeropages-are-disallowed/20240322-060251
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git next
patch link:    https://lore.kernel.org/r/20240321215954.177730-3-david%40redhat.com
patch subject: [PATCH v1 2/2] s390/mm: re-enable the shared zeropage for !PV and !skeys KVM guests
:::::: branch date: 11 days ago
:::::: commit date: 11 days ago
config: s390-randconfig-r071-20240325 (https://download.01.org/0day-ci/archive/20240401/202404011730.2TEIocud-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 23de3862dce582ce91c1aa914467d982cb1a73b4)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202404011730.2TEIocud-lkp@intel.com/

smatch warnings:
arch/s390/mm/gmap.c:2656 __s390_unshare_zeropages() error: uninitialized symbol 'rc'.

vim +/rc +2656 arch/s390/mm/gmap.c

9a7a43a7ce9759 David Hildenbrand 2024-03-21  2598  
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2599  /*
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2600   * Unshare all shared zeropages, replacing them by anonymous pages. Note that
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2601   * we cannot simply zap all shared zeropages, because this could later
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2602   * trigger unexpected userfaultfd missing events.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2603   *
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2604   * This must be called after mm->context.allow_cow_sharing was
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2605   * set to 0, to avoid future mappings of shared zeropages.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2606   *
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2607   * mm contracts with s390, that even if mm were to remove a page table,
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2608   * and racing with walk_page_range_vma() calling pte_offset_map_lock()
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2609   * would fail, it will never insert a page table containing empty zero
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2610   * pages once mm_forbids_zeropage(mm) i.e.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2611   * mm->context.allow_cow_sharing is set to 0.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2612   */
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2613  static int __s390_unshare_zeropages(struct mm_struct *mm)
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2614  {
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2615  	struct vm_area_struct *vma;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2616  	VMA_ITERATOR(vmi, mm, 0);
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2617  	unsigned long addr;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2618  	int rc;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2619  
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2620  	for_each_vma(vmi, vma) {
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2621  		/*
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2622  		 * We could only look at COW mappings, but it's more future
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2623  		 * proof to catch unexpected zeropages in other mappings and
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2624  		 * fail.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2625  		 */
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2626  		if ((vma->vm_flags & VM_PFNMAP) || is_vm_hugetlb_page(vma))
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2627  			continue;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2628  		addr = vma->vm_start;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2629  
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2630  retry:
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2631  		rc = walk_page_range_vma(vma, addr, vma->vm_end,
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2632  					 &find_zeropage_ops, &addr);
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2633  		if (rc <= 0)
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2634  			continue;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2635  
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2636  		/* addr was updated by find_zeropage_pte_entry() */
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2637  		rc = handle_mm_fault(vma, addr,
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2638  				     FAULT_FLAG_UNSHARE | FAULT_FLAG_REMOTE,
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2639  				     NULL);
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2640  		if (rc & VM_FAULT_OOM)
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2641  			return -ENOMEM;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2642  		/*
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2643  		 * See break_ksm(): even after handle_mm_fault() returned 0, we
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2644  		 * must start the lookup from the current address, because
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2645  		 * handle_mm_fault() may back out if there's any difficulty.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2646  		 *
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2647  		 * VM_FAULT_SIGBUS and VM_FAULT_SIGSEGV are unexpected but
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2648  		 * maybe they could trigger in the future on concurrent
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2649  		 * truncation. In that case, the shared zeropage would be gone
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2650  		 * and we can simply retry and make progress.
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2651  		 */
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2652  		cond_resched();
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2653  		goto retry;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2654  	}
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2655  
9a7a43a7ce9759 David Hildenbrand 2024-03-21 @2656  	return rc;
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2657  }
9a7a43a7ce9759 David Hildenbrand 2024-03-21  2658  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2024-04-01  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01  9:47 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-21 21:59 [PATCH v1 0/2] s390/mm: shared zeropage + KVM fix and optimization David Hildenbrand
2024-03-21 21:59 ` [PATCH v1 2/2] s390/mm: re-enable the shared zeropage for !PV and !skeys KVM guests David Hildenbrand
2024-03-22 10:22   ` Christian Borntraeger
2024-03-22 17:08     ` David Hildenbrand

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=202404011730.2TEIocud-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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 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.