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] Re: how to enable shadow page table? Do I have to run HV

To: "longwang@xxxxxxxxxxxxxxxxx" <longwang@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: how to enable shadow page table? Do I have to run HVM guest systems for shadow paging mode?
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Tue, 17 Mar 2009 09:34:41 +0000
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 17 Mar 2009 02:35:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <9cf1a529733d7f0238e125e90fa7d3ee.squirrel@xxxxxxxxxxxxxxxxxxxxxxxxx>
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: <20090316161757.EF9173400090@xxxxxxxxxxxxxxxxxx> <49BE7E94.3020401@xxxxxxxx> <20090316174119.GE6322@xxxxxxxxxxxxxxxxxxxxx> <9cf1a529733d7f0238e125e90fa7d3ee.squirrel@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.17 (2007-11-01)
At 18:40 +0000 on 16 Mar (1237228854), longwang@xxxxxxxxxxxxxxxxx wrote:
> 2) When I call paging_mode_log_dirty(pdom) in hypervisor, the hypervisor
> crashes. I thought paging_mode_log_dirty() enables the shadow paging as
> well as dirty logging after I had read live migration code. But I was
> wrong. paging_mode_log_dirty() crashes because shadow paging is not
> enabled yet.
> 
> Now I need to enable shadow paging mode in my testbed (PV). 

You wrote all the code before figuring out how to turn on shadow pagetables?

> I tried the
> auto_translated_physmap in the domU config file. But "xm create" failed
> with :
> Error: (1, 'Internal error', 'xc_dom_boot_domU_map: failed to mmap domU
> pages 0x100+0x2da [mmap, errno=14 (Bad address)]\n')

As Jeremy says, auto_translated_physmap doesn't work on recent Xens or
recent Linuxes.  

> So how can I enable shadow paging? Do I have to run HVM for this to work?

If you want the shadow code to hide a layer of address translations
(i.e. have gfn != mfn) then yes, you need HVM.  

Otherwise, you can just copy what the live-migration tools do to turn on
shadow pagetables for PV guests.  It's just one hypercall.  For example,
in python:

 #!/usr/bin/env python
 import sys
 import xen.lowlevel.xc
 xen.lowlevel.xc.xc().shadow_control(dom=int(sys.argv[1]), op=1)

To turn on log-dirty mode, use op=2.  To turn off shadow mode, op=0.

Cheers,

Tim.

> thanks,
> long
> 
> 
> > At 16:30 +0000 on 16 Mar (1237221012), Jeremy Fitzhardinge wrote:
> >> Long Wang wrote:
> >> > I am working on a research project based on Xen 3.3.1. I want to use
> >> the
> >> > shadow page table for setting guest system memory pages as read-only
> >> and/or
> >> > dirty, and perform a copy-on-write mechanism when these memory pages
> >> are
> >> > updated.
> >
> > Several people are already working on copy-on-write memory in Xen, or
> > variations on that theme (Mike Sun, Patrick Colp, John Byrne, and
> > others) as well as more exotic things like Difference Engine and
> > Transcendent Memory.  It would probably be better to talk to those
> > people and try to help their efforts than start from scratch.
> >
> > Patrick Colp's slides from the most recent Xen Summit give an idea of
> > one method of implementing it:
> > http://www.xen.org/files/xensummit_oracle09/VMSnapshots.pdf
> >
> > Cheers,
> >
> > Tim.
> >
> > --
> > Tim Deegan <Tim.Deegan@xxxxxxxxxx>
> > Principal Software Engineer, Citrix Systems (R&D) Ltd.
> > [Company #02300071, SL9 0DZ, UK.]
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
> >
> 
> 

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel