[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.