[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200205224154.GG387680@xz-x1>
Date: Wed, 5 Feb 2020 17:41:54 -0500
From: Peter Xu <peterx@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Paul Mackerras <paulus@...abs.org>,
Christian Borntraeger <borntraeger@...ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Cornelia Huck <cohuck@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, Marc Zyngier <maz@...nel.org>,
James Morse <james.morse@....com>,
Julien Thierry <julien.thierry.kdev@...il.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
linux-mips@...r.kernel.org, kvm@...r.kernel.org,
kvm-ppc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.cs.columbia.edu, linux-kernel@...r.kernel.org,
Christoffer Dall <christoffer.dall@....com>,
Philippe Mathieu-Daudé <f4bug@...at.org>
Subject: Re: [PATCH v5 04/19] KVM: PPC: Move memslot memory allocation into
prepare_memory_region()
On Tue, Jan 21, 2020 at 02:31:42PM -0800, Sean Christopherson wrote:
> static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
> - struct kvm_memory_slot *memslot,
> - const struct kvm_userspace_memory_region *mem)
> + struct kvm_memory_slot *slot,
> + const struct kvm_userspace_memory_region *mem,
> + enum kvm_mr_change change)
> {
> + unsigned long npages = mem->memory_size >> PAGE_SHIFT;
Only in case if this patch still needs a respin: IIUC we can directly
use slot->npages below. No matter what:
Reviewed-by: Peter Xu <peterx@...hat.com>
> +
> + if (change == KVM_MR_CREATE) {
> + slot->arch.rmap = vzalloc(array_size(npages,
> + sizeof(*slot->arch.rmap)));
> + if (!slot->arch.rmap)
> + return -ENOMEM;
> + }
> +
> return 0;
> }
--
Peter Xu
Powered by blists - more mailing lists