From: Christoph Hellwig Date: Thu, 29 Aug 2019 08:39:27 +0000 Subject: Re: [PATCH v7 4/7] kvmppc: Handle memory plug/unplug to secure VM Message-Id: <20190829083927.GB13039@lst.de> List-Id: References: <20190822102620.21897-1-bharata@linux.ibm.com> <20190822102620.21897-5-bharata@linux.ibm.com> In-Reply-To: <20190822102620.21897-5-bharata@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bharata B Rao Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, linux-mm@kvack.org, paulus@au1.ibm.com, aneesh.kumar@linux.vnet.ibm.com, jglisse@redhat.com, linuxram@us.ibm.com, sukadev@linux.vnet.ibm.com, cclaudio@linux.ibm.com, hch@lst.de, Paul Mackerras On Thu, Aug 22, 2019 at 03:56:17PM +0530, Bharata B Rao wrote: > + /* > + * TODO: Handle KVM_MR_MOVE > + */ > + if (change = KVM_MR_CREATE) { > + uv_register_mem_slot(kvm->arch.lpid, > + new->base_gfn << PAGE_SHIFT, > + new->npages * PAGE_SIZE, > + 0, new->id); > + } else if (change = KVM_MR_DELETE) > + uv_unregister_mem_slot(kvm->arch.lpid, old->id); > } In preparation for the KVM_MR_MOVE addition just using a switch statement here from the very beginning might make the code a little nicer to read.