WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] why xen use x86_emulat ion() in page_fault

To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] why xen use x86_emulat ion() in page_fault
From: cc Luit <universalbillow@xxxxxxxxx>
Date: Tue, 11 Oct 2011 18:12:09 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 11 Oct 2011 03:14:06 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gIwp7fRBIHB/mAijoEDXr0BVcDeYXCPlcTeQcDhcvYM=; b=JxrsW0KGHk3TjzsQv7J/wLQCv9ptjhkz/6EjYMP/VpMgXDMbhWYGaAuw12qRFIUgI7 d1ByxUy4ePfy7HTAYWiDndhYv4mI0IgX8xl/1/hO1VOFjDh1TMLLuBtxYfgz9fVoZijG 2e85s+9x4Hq2oYaLMyVCsgnlazg2+kXlbVKVQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAFLBxZbLcqpcJfFRSnT_C=5krhen44EzMD5pKcDNGhvLYmck=g@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CAFLBxZbLcqpcJfFRSnT_C=5krhen44EzMD5pKcDNGhvLYmck=g@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Sorry about that:-)
Yeah, I've seen this comments, I understand what it says in the before part, but not the last sentence, what does it mean by "non-user write"? and what's more, in the code following is: 
    if ( is_hvm_domain(d)
         && unlikely(!hvm_wp_enabled(v))
         && regs->error_code == (PFEC_write_access|PFEC_page_present)
         && mfn_valid(gmfn) )
    {
        perfc_incr(shadow_fault_emulate_wp);
        goto emulate;
    }

there is not opinion show that the guest is to write through read-only PTEs, but just a hvm_wp_enabled but mfn_valid address, does it because only the PTE is hvm_wp_enabled?
 
another question is that if for some reasons I want to design that the Guest PTE is not read-only, which means in the page_fault situation I don't want xen to emulate, is there any functionability or feasibility problems?
 
thanks for your answer:)

On Tue, Oct 11, 2011 at 5:27 PM, George Dunlap <George.Dunlap@xxxxxxxxxxxxx> wrote:
The comments in xen/arch/mm/shadow/multi.c:sh_page_fault() about emulation say:
   /* Need to emulate accesses to page tables */
and
   /* In HVM guests, we force CR0.WP always to be set, so that the
    * pagetables are always write-protected.  If the guest thinks
    * CR0.WP is clear, we must emulate faulting supervisor writes to
    * allow the guest to write through read-only PTEs.  Emulate if the
    * fault was a non-user write to a present page.  */

Do you have some question about these?

Regarding NPT/EPT, as far as I know, the only reason to do emulation
is when the guest is doing MMIO.  The whole point of MMIO is to
emulate access to devices.

 -George

On Tue, Oct 11, 2011 at 2:58 AM, cc Luit <universalbillow@xxxxxxxxx> wrote:
> Hi, everyone, I have a question,
> in the shadow_page_fault or ept mechanism, xen will use the x86_emulation
> for some instructions, I'm wondering why it must use it, if after we fix the
> SPT or EPT table, just VMEntry to HVM to re-excute this instruction  but not
> emulate in xen, is there some problems?
>
> can sb. tell me why?
> thanks:)
> --
> - Luit @ Parallel Processing Institute, Fudan University
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>



--
- Luit @ Parallel Processing Institute, Fudan University 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel