All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kvm-ppc@vger.kernel.org
Subject: [bug report] KVM: PPC: Book3S HV: Outline of KVM-HV HPT resizing implementation
Date: Sat, 11 Feb 2017 05:14:25 +0000	[thread overview]
Message-ID: <20170211051425.GA16625@mwanda> (raw)

Hello David Gibson,

The patch 5e9859699aba: "KVM: PPC: Book3S HV: Outline of KVM-HV HPT
resizing implementation" from Dec 20, 2016, leads to the following
static checker warning:

	arch/powerpc/kvm/book3s_64_mmu_hv.c:1554 kvm_vm_ioctl_resize_hpt_commit()
	error: we previously assumed 'resize' could be null (see line 1532)

arch/powerpc/kvm/book3s_64_mmu_hv.c
  1514          mutex_lock(&kvm->lock);
  1515  
  1516          resize = kvm->arch.resize_hpt;
  1517  
  1518          /* This shouldn't be possible */
  1519          ret = -EIO;
  1520          if (WARN_ON(!kvm->arch.hpte_setup_done))
  1521                  goto out_no_hpt;
  1522  
  1523          /* Stop VCPUs from running while we mess with the HPT */
  1524          kvm->arch.hpte_setup_done = 0;
  1525          smp_mb();
  1526  
  1527          /* Boot all CPUs out of the guest so they re-read
  1528           * hpte_setup_done */
  1529          on_each_cpu(resize_hpt_boot_vcpu, NULL, 1);
  1530  
  1531          ret = -ENXIO;
  1532          if (!resize || (resize->order != shift))
                     ^^^^^^
Check.

  1533                  goto out;
  1534  
  1535          ret = -EBUSY;
  1536          if (!resize->prepare_done)
  1537                  goto out;
  1538  
  1539          ret = resize->error;
  1540          if (ret != 0)
  1541                  goto out;
  1542  
  1543          ret = resize_hpt_rehash(resize);
  1544          if (ret != 0)
  1545                  goto out;
  1546  
  1547          resize_hpt_pivot(resize);
  1548  
  1549  out:
  1550          /* Let VCPUs run again */
  1551          kvm->arch.hpte_setup_done = 1;
  1552          smp_mb();
  1553  out_no_hpt:
  1554          resize_hpt_release(kvm, resize);
                                        ^^^^^^
Oops.

  1555          mutex_unlock(&kvm->lock);
  1556          return ret;
  1557  }

regards,
dan carpenter

             reply	other threads:[~2017-02-11  5:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11  5:14 Dan Carpenter [this message]
2017-02-15  3:45 ` [bug report] KVM: PPC: Book3S HV: Outline of KVM-HV HPT resizing implementation David Gibson

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=20170211051425.GA16625@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kvm-ppc@vger.kernel.org \
    /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.