From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Wed, 15 Feb 2017 03:45:25 +0000 Subject: Re: [bug report] KVM: PPC: Book3S HV: Outline of KVM-HV HPT resizing implementation Message-Id: <20170215034525.GG12369@umbus.fritz.box> MIME-Version: 1 Content-Type: multipart/mixed; boundary="oOB74oR0WcNeq9Zb" List-Id: References: <20170211051425.GA16625@mwanda> In-Reply-To: <20170211051425.GA16625@mwanda> To: kvm-ppc@vger.kernel.org --oOB74oR0WcNeq9Zb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2017 at 08:14:25AM +0300, Dan Carpenter wrote: > Hello David Gibson, >=20 > 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: >=20 > 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) Nice catch, thanks. I've sent a patch for this. >=20 > arch/powerpc/kvm/book3s_64_mmu_hv.c > 1514 mutex_lock(&kvm->lock); > 1515 =20 > 1516 resize =3D kvm->arch.resize_hpt; > 1517 =20 > 1518 /* This shouldn't be possible */ > 1519 ret =3D -EIO; > 1520 if (WARN_ON(!kvm->arch.hpte_setup_done)) > 1521 goto out_no_hpt; > 1522 =20 > 1523 /* Stop VCPUs from running while we mess with the HPT */ > 1524 kvm->arch.hpte_setup_done =3D 0; > 1525 smp_mb(); > 1526 =20 > 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 =20 > 1531 ret =3D -ENXIO; > 1532 if (!resize || (resize->order !=3D shift)) > ^^^^^^ > Check. >=20 > 1533 goto out; > 1534 =20 > 1535 ret =3D -EBUSY; > 1536 if (!resize->prepare_done) > 1537 goto out; > 1538 =20 > 1539 ret =3D resize->error; > 1540 if (ret !=3D 0) > 1541 goto out; > 1542 =20 > 1543 ret =3D resize_hpt_rehash(resize); > 1544 if (ret !=3D 0) > 1545 goto out; > 1546 =20 > 1547 resize_hpt_pivot(resize); > 1548 =20 > 1549 out: > 1550 /* Let VCPUs run again */ > 1551 kvm->arch.hpte_setup_done =3D 1; > 1552 smp_mb(); > 1553 out_no_hpt: > 1554 resize_hpt_release(kvm, resize); > ^^^^^^ > Oops. >=20 > 1555 mutex_unlock(&kvm->lock); > 1556 return ret; > 1557 } >=20 > regards, > dan carpenter >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --oOB74oR0WcNeq9Zb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYo87TAAoJEGw4ysog2bOSuH8QAK9O9jhKcwU7XwFMQFOxuoNI n9Pju14dUFCQrKABDz4MHJmSOt9PevVpXm0/CDXcFaxSTnhGJSuQVSYRMLtgE1JT TMeQqk8PSrqMuez7jqQ+43u4rrIBI/dSm9Pu8ZCubHSgZDtyisQKsn6p9evmCJTs 6kk3CodiQkJtnPXCNEJDpzulEZ2TZWQd04N0CiUWtomRh05jxOcsLDseFfKN18I8 THgaDOWRdFOfDVvd0Z8DqDhMoiiDRjiUQw5uTH79S4zKEOF8d+YFBPflYc2BXfmn 0yWwM79Wq80Sbtduq04gTD6VGV3KAlHQx2V8+vvj36giXRJCH8GyMZ99mwA9AFbo JVUWFP4dtA/t1ldfwdudz/bRyH0DltF0zEXEmV1fZnmRhD6Ba6m4fAle0EmFfbqT k4GhLQX/vRhEOf5J0LyDJ2YPJdXufhzufbiM+Qi8TaVqEVbyxJ4Twzk19NfgW/Hw C767dV5dqZhesOLYw1hVlBSgSCCXhfUIdJVyEIJSOAv+UFXLueo2AqV5md0uMNW7 FK9ITQ9uuA+9DWjknyHDpugWPTS4Dk9iHqE0WePGcW//CRkHL1PzdS2274FpU3Tn xV4OzOGiSWwPYeXfVvHu4RL16fx72muYEJVikZeeVjUIjaOXW2uf20hjhCq55PpX tSspzBemL5rCZfKJhW8h =CxFx -----END PGP SIGNATURE----- --oOB74oR0WcNeq9Zb--