public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>, kvm@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	borntraeger@de.ibm.com, frankja@linux.ibm.com, nrb@linux.ibm.com,
	seiden@linux.ibm.com, gra@linux.ibm.com,
	schlameuss@linux.ibm.com, hca@linux.ibm.com, david@kernel.org
Subject: Re: [PATCH v3 8/9] KVM: s390: vsie: Fix guest page tables protection
Date: Wed, 25 Mar 2026 20:30:58 +0800	[thread overview]
Message-ID: <202603252045.f3Juk9sU-lkp@intel.com> (raw)
In-Reply-To: <20260324174301.232921-9-imbrenda@linux.ibm.com>

Hi Claudio,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvm/queue]
[also build test WARNING on kvm/next linus/master v7.0-rc5 next-20260324]
[cannot apply to kvms390/next kvm/linux-next]
[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/Claudio-Imbrenda/KVM-s390-vsie-Fix-dat_split_ste/20260325-092851
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20260324174301.232921-9-imbrenda%40linux.ibm.com
patch subject: [PATCH v3 8/9] KVM: s390: vsie: Fix guest page tables protection
config: s390-defconfig (https://download.01.org/0day-ci/archive/20260325/202603252045.f3Juk9sU-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 054e11d1a17e5ba88bb1a8ef32fad3346e80b186)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260325/202603252045.f3Juk9sU-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603252045.f3Juk9sU-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/s390/kvm/gaccess.c:1522:6: warning: variable 'gl' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    1522 |         if (w->level <= LEVEL_MEM) {
         |             ^~~~~~~~~~~~~~~~~~~~~
   arch/s390/kvm/gaccess.c:1555:10: note: uninitialized use occurs here
    1555 |         if (l < gl) {
         |                 ^~
   arch/s390/kvm/gaccess.c:1522:2: note: remove the 'if' if its condition is always false
    1522 |         if (w->level <= LEVEL_MEM) {
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1523 |                 l = TABLE_TYPE_PAGE_TABLE;
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
    1524 |                 hl = TABLE_TYPE_REGION1;
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~
    1525 |                 goto real_address_space;
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~
    1526 |         }
         |         ~
   arch/s390/kvm/gaccess.c:1500:22: note: initialize the variable 'gl' to silence this warning
    1500 |         int flags, i, hl, gl, l, rc;
         |                             ^
         |                              = 0
   1 warning generated.


vim +1522 arch/s390/kvm/gaccess.c

  1495	
  1496	static int _gaccess_do_shadow(struct kvm_s390_mmu_cache *mc, struct gmap *sg,
  1497				      unsigned long saddr, struct pgtwalk *w)
  1498	{
  1499		struct guest_fault *entries;
  1500		int flags, i, hl, gl, l, rc;
  1501		union crste *table, *host;
  1502		union pte *ptep, *ptep_h;
  1503	
  1504		lockdep_assert_held(&sg->kvm->mmu_lock);
  1505		lockdep_assert_held(&sg->parent->children_lock);
  1506	
  1507		entries = get_entries(w);
  1508		ptep_h = NULL;
  1509		ptep = NULL;
  1510	
  1511		rc = dat_entry_walk(NULL, gpa_to_gfn(saddr), sg->asce, DAT_WALK_ANY, TABLE_TYPE_PAGE_TABLE,
  1512				    &table, &ptep);
  1513		if (rc)
  1514			return rc;
  1515	
  1516		/* A race occurred. The shadow mapping is already valid, nothing to do */
  1517		if ((ptep && !ptep->h.i && ptep->h.p == w->p) ||
  1518		    (!ptep && crste_leaf(*table) && !table->h.i && table->h.p == w->p))
  1519			return 0;
  1520	
  1521		/* In case of a real address space */
> 1522		if (w->level <= LEVEL_MEM) {
  1523			l = TABLE_TYPE_PAGE_TABLE;
  1524			hl = TABLE_TYPE_REGION1;
  1525			goto real_address_space;
  1526		}
  1527	
  1528		gl = get_level(table, ptep);
  1529	
  1530		/*
  1531		 * Skip levels that are already protected. For each level, protect
  1532		 * only the page containing the entry, not the whole table.
  1533		 */
  1534		for (i = gl ; i >= w->level; i--) {
  1535			rc = gmap_protect_rmap(mc, sg, entries[i].gfn, gpa_to_gfn(saddr),
  1536					       entries[i].pfn, i + 1, entries[i].writable);
  1537			if (rc)
  1538				return rc;
  1539			if (!sg->parent)
  1540				return -EAGAIN;
  1541		}
  1542	
  1543		rc = dat_entry_walk(NULL, entries[LEVEL_MEM].gfn, sg->parent->asce, DAT_WALK_LEAF,
  1544				    TABLE_TYPE_PAGE_TABLE, &host, &ptep_h);
  1545		if (rc)
  1546			return rc;
  1547	
  1548		hl = get_level(host, ptep_h);
  1549		/* Get the smallest granularity */
  1550		l = min3(gl, hl, w->level);
  1551	
  1552	real_address_space:
  1553		flags = DAT_WALK_SPLIT_ALLOC | (uses_skeys(sg->parent) ? DAT_WALK_USES_SKEYS : 0);
  1554		/* If necessary, create the shadow mapping */
  1555		if (l < gl) {
  1556			rc = dat_entry_walk(mc, gpa_to_gfn(saddr), sg->asce, flags, l, &table, &ptep);
  1557			if (rc)
  1558				return rc;
  1559		}
  1560		if (l < hl) {
  1561			rc = dat_entry_walk(mc, entries[LEVEL_MEM].gfn, sg->parent->asce,
  1562					    flags, l, &host, &ptep_h);
  1563			if (rc)
  1564				return rc;
  1565		}
  1566	
  1567		if (KVM_BUG_ON(l > TABLE_TYPE_REGION3, sg->kvm))
  1568			return -EFAULT;
  1569		if (l == TABLE_TYPE_PAGE_TABLE)
  1570			return _do_shadow_pte(sg, saddr, ptep_h, ptep, entries + LEVEL_MEM, w->p);
  1571		return _do_shadow_crste(sg, saddr, host, table, entries + LEVEL_MEM, w->p);
  1572	}
  1573	

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

           reply	other threads:[~2026-03-25 12:31 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260324174301.232921-9-imbrenda@linux.ibm.com>]

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=202603252045.f3Juk9sU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=gra@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nrb@linux.ibm.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=schlameuss@linux.ibm.com \
    --cc=seiden@linux.ibm.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