Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-29 Thread Kautuk Consul
On 2023-03-30 10:59:19, Michael Ellerman wrote: > Kautuk Consul writes: > > On 2023-03-28 23:02:09, Michael Ellerman wrote: > >> Kautuk Consul writes: > >> > On 2023-03-28 15:44:02, Kautuk Consul wrote: > >> >> On 2023-03-28 20:44:48, Michael Ellerman wrote: > >> >> > Kautuk Consul writes: > >>

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-29 Thread Michael Ellerman
Kautuk Consul writes: > On 2023-03-28 23:02:09, Michael Ellerman wrote: >> Kautuk Consul writes: >> > On 2023-03-28 15:44:02, Kautuk Consul wrote: >> >> On 2023-03-28 20:44:48, Michael Ellerman wrote: >> >> > Kautuk Consul writes: >> >> > > kvmppc_vcore_create() might not be able to allocate

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-28 Thread Kautuk Consul
On 2023-03-28 23:02:09, Michael Ellerman wrote: > Kautuk Consul writes: > > On 2023-03-28 15:44:02, Kautuk Consul wrote: > >> On 2023-03-28 20:44:48, Michael Ellerman wrote: > >> > Kautuk Consul writes: > >> > > kvmppc_vcore_create() might not be able to allocate memory through > >> > > kzalloc.

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-28 Thread Michael Ellerman
Kautuk Consul writes: > On 2023-03-28 15:44:02, Kautuk Consul wrote: >> On 2023-03-28 20:44:48, Michael Ellerman wrote: >> > Kautuk Consul writes: >> > > kvmppc_vcore_create() might not be able to allocate memory through >> > > kzalloc. In that case the kvm->arch.online_vcores shouldn't be >> >

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-28 Thread Kautuk Consul
On 2023-03-28 15:44:02, Kautuk Consul wrote: > On 2023-03-28 20:44:48, Michael Ellerman wrote: > > Kautuk Consul writes: > > > kvmppc_vcore_create() might not be able to allocate memory through > > > kzalloc. In that case the kvm->arch.online_vcores shouldn't be > > > incremented. > > > > I

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-28 Thread Kautuk Consul
On 2023-03-28 20:44:48, Michael Ellerman wrote: > Kautuk Consul writes: > > kvmppc_vcore_create() might not be able to allocate memory through > > kzalloc. In that case the kvm->arch.online_vcores shouldn't be > > incremented. > > I agree that looks wrong. > > Have you tried to test what goes

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-28 Thread Michael Ellerman
Kautuk Consul writes: > kvmppc_vcore_create() might not be able to allocate memory through > kzalloc. In that case the kvm->arch.online_vcores shouldn't be > incremented. I agree that looks wrong. Have you tried to test what goes wrong if it fails? It looks like it will break the LPCR update,

Re: [PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-27 Thread Kautuk Consul
Hi, On 2023-03-23 03:47:18, Kautuk Consul wrote: > kvmppc_vcore_create() might not be able to allocate memory through > kzalloc. In that case the kvm->arch.online_vcores shouldn't be > incremented. > Add a check for kzalloc failure and return with -ENOMEM from > kvmppc_core_vcpu_create_hv().

[PATCH] arch/powerpc/kvm: kvmppc_core_vcpu_create_hv: check for kzalloc failure

2023-03-23 Thread Kautuk Consul
kvmppc_vcore_create() might not be able to allocate memory through kzalloc. In that case the kvm->arch.online_vcores shouldn't be incremented. Add a check for kzalloc failure and return with -ENOMEM from kvmppc_core_vcpu_create_hv(). Signed-off-by: Kautuk Consul --- arch/powerpc/kvm/book3s_hv.c