From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: KVM MMU: why write-protect for the pages containing PML4/PDPT/PDT (page directory) of the guest? Date: Thu, 13 Jun 2013 09:15:34 -0400 Message-ID: <51B9C5F6.4030906@redhat.com> References: <51b93c47.+9Bka02lV7rGywcp%yongcheng.wu@i-soft.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: yongcheng.wu@i-soft.com.cn Return-path: Received: from mail-qc0-f179.google.com ([209.85.216.179]:65142 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134Ab3FMNPk (ORCPT ); Thu, 13 Jun 2013 09:15:40 -0400 Received: by mail-qc0-f179.google.com with SMTP id e11so1592073qcx.10 for ; Thu, 13 Jun 2013 06:15:37 -0700 (PDT) In-Reply-To: <51b93c47.+9Bka02lV7rGywcp%yongcheng.wu@i-soft.com.cn> Sender: kvm-owner@vger.kernel.org List-ID: Il 12/06/2013 23:28, yongcheng.wu@i-soft.com.cn ha scritto: > I have a problem for shadow page table. why is write-protect for the > pages containing PML4/PDPT/PDT (page directory) of the guest? In > other words, need to synchronize the change of the page directory of > the guest? Shadow page tables are the combination of both the host and guest page tables into a single translation. So they need to be updated every time the host or the guest change the page tables. Updates for the host page tables are tracked with MMU notifiers; updates for the guest page tables are tracked with write protection. Paolo