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

[Xen-devel] Re: [PATCH] Unmmap guest's EPT mapping for poison memory

To: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Unmmap guest's EPT mapping for poison memory
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Wed, 14 Jul 2010 10:28:08 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 14 Jul 2010 02:29:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <789F9655DD1B8F43B48D77C5D30659731F571361@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <789F9655DD1B8F43B48D77C5D30659731F571361@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
Hi, 

At 08:41 +0100 on 14 Jul (1279096872), Jiang, Yunhong wrote:
> diff -r bf51b671f269 xen/arch/x86/cpu/mcheck/vmce.c
> --- a/xen/arch/x86/cpu/mcheck/vmce.c  Mon Jul 12 13:59:39 2010 +0800
> +++ b/xen/arch/x86/cpu/mcheck/vmce.c  Mon Jul 12 14:30:21 2010 +0800
> @@ -558,3 +558,28 @@ int is_vmce_ready(struct mcinfo_bank *ba
>  
>      return 0;
>  }
> +
> +/* Now we only have support for HAP guest */
> +int unmmap_broken_page(struct domain *d, unsigned long mfn, unsigned long 
> gfn)
> +{
> +    /* Always trust dom0 */
> +    if ( d == dom0 )
> +        return 0;
> +
> +    if (is_hvm_domain(d) && (paging_mode_hap(d)) )
> +    {
> +        p2m_type_t pt;
> +
> +        gfn_to_mfn_query(d, gfn, &pt);
> +        /* What will happen if is paging-in? */
> +        if ( pt == p2m_ram_rw )

Or any of the other types?  This should be called for ram_ro, and
ram_logdirty certainly, and probably mmio_direct too.

I'm not sure that it's safe to nobble other types - e.g. changing from
grant_map_*, paging_* or ram_shared might break state-machines/refcounts
elsewhere.

Actually wouldn't it be be better to encode brokenness in the frametable
instead of the P2M and then forbid new mappings of broken MFNs?  It's
not really a property of the PFN (wasn't there a patch series a while
ago that swapped broken MFNs under a VM's feet?).

Cheers,

Tim.

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

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