[PATCH 1/6] KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated
Greg Kurz
groug at kaod.org
Tue Sep 24 21:49:54 AEST 2019
On Tue, 24 Sep 2019 15:28:55 +1000
Paul Mackerras <paulus at ozlabs.org> wrote:
> On Mon, Sep 23, 2019 at 05:43:37PM +0200, Greg Kurz wrote:
> > From: Cédric Le Goater <clg at kaod.org>
> >
> > Do not assign the device private pointer before making sure the XIVE
> > VPs are allocated in OPAL and test pointer validity when releasing
> > the device.
> >
> > Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method")
> > Signed-off-by: Cédric Le Goater <clg at kaod.org>
> > Signed-off-by: Greg Kurz <groug at kaod.org>
>
> What happens in the case where the OPAL allocation fails? Does the
> host crash, or hang, or leak resources? I presume that users can
> trigger the allocation failure just by starting a suitably large
> number of guests - is that right? Is there an easier way? I'm trying
> to work out whether this is urgently needed in 5.4 and the stable
> trees or not.
>
Wait... I don't quite remember how this patch landed in my tree but when
I look at it again I have the impression it tries to fix something that
cannot happen.
It is indeed easy to trigger the allocation failure, eg. start more than
127 guests on a Witherspoon system. But if this happens, the create
function returns an error and the device isn't created. I don't see how
the release function could hence get called with a "partially initialized"
device.
Please ignore this patch. Unfortunately the rest of the series doesn't
apply cleanly without it... I'll rebase and post a v2.
Sorry for the noise :-\
> Paul.
More information about the Linuxppc-dev
mailing list