From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: When is the page table built for migration destination ? Date: Mon, 09 Sep 2013 11:58:01 +0200 Message-ID: <522D9BA9.90303@redhat.com> References: <522D834A.2050309@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: Sunil Return-path: Received: from mail-ea0-f179.google.com ([209.85.215.179]:61902 "EHLO mail-ea0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275Ab3IIJ56 (ORCPT ); Mon, 9 Sep 2013 05:57:58 -0400 Received: by mail-ea0-f179.google.com with SMTP id b10so2992455eae.38 for ; Mon, 09 Sep 2013 02:57:57 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 09/09/2013 11:38, Sunil ha scritto: > Thanks Paolo. > > I am using KVM with EPT support, so I understand this will require > gfn->pfn translation. Going through the code, looks like function > tdp_page_fault() is responsible for setting up this mapping. > > Though the page table is constructed lazily, I understand the page > contents are already transferred during migration. Can you please > explain or point to function names which finds the correct page > contents for given gfn ? (looks like pte is created in > __direct_map()) GFNs are looked up through the memory slots array. Look at gfn_to_memslot, gfn_to_hva, and related functions in virt/kvm/kvm_main.c; also the __gfn_to_memslot and __gfn_to_hva_memslot inlines in include/linux/kvm_host.h. Paolo