From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukanto Ghosh Subject: Doubts regarding Shadow Page Table Management in KVM Date: Tue, 10 Jun 2008 20:10:39 +0530 Message-ID: <484E9267.9030800@cse.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from smtp1.iitb.ac.in ([203.78.217.177]:43372 "HELO smtp1.iitb.ac.in" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753228AbYFJOoB (ORCPT ); Tue, 10 Jun 2008 10:44:01 -0400 Received: from [10.105.41.67] (unknown [10.105.41.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.iitb.ac.in (Postfix) with ESMTP id D1690138E5 for ; Tue, 10 Jun 2008 20:07:17 +0530 (IST) Sender: kvm-owner@vger.kernel.org List-ID: Hi all, I was reading the "The shadowy depths of the KVM MMU" presentation by Avi Kivity. From my understanding of shadow page-table, Guest Page Table : maps GV -> GP Shadow Page Table : maps GV -> HP What is meant by shadowed guest page ? (Does it refer to : the guest PT pages that have a corresponding shadow PT page) I has been mentioned that: "The same page may already be mapped by the guest in multiple locations. So, we track writable mappings of every guest page ". I can't understand why do we have to keep track of these reverse mappings ? And what are these reverse mappings ? (from HP -> GP or HP -> GV or GP -> GV) Let's consider the following scenario: GVA1 -> GPA1 -> HPA1 GVA2 -> GPA1 -> HPA1 Also, let GPA1 be part of a guest PT page. i) The guest modifies a PTE in GPA1 by doing "mov GVA2" ii) The host traps this as the page HPA1 is write-protected, and does the corresponding modification to the guest PT page and its corresponding shadow PT page. (where do we need to use a reverse mapping) I would be glad if you can point out where I am making the mistake. -- Thanks & Regards, Sukanto Ghosh NB: GVA = guest virtual address GPA = guest physical address HPA = host physical address