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

Re: [Xen-devel] [PATCH 08/11] x86/altp2m: add remaining support routines.



Hi,

At 13:26 -0800 on 09 Jan (1420806398), Ed White wrote:
> +int
> +altp2mhvm_hap_nested_page_fault(struct vcpu *v, paddr_t gpa,
> +                                unsigned long gla, struct npfec npfec)
> +{
> +    struct domain *d = v->domain;
> +    struct p2m_domain *hp2m = p2m_get_hostp2m(d);
> +    struct p2m_domain *ap2m;
> +    p2m_type_t p2mt;
> +    p2m_access_t p2ma;
> +    unsigned int page_order;
> +    unsigned long gfn, mask;
> +    mfn_t mfn;
> +    int rv;
> +
> +    ap2m = p2m_get_altp2m(v);
> +
> +    mfn = get_gfn_type_access(ap2m, gpa >> PAGE_SHIFT, &p2mt, &p2ma,
> +                              0, &page_order);
> +    __put_gfn(ap2m, gpa >> PAGE_SHIFT);
> +
> +    if ( mfn_valid(mfn) )
> +    {
> +        /* Should #VE be emulated for this fault? */
> +        if ( p2mt == p2m_ram_rw_ve && !cpu_has_vmx_virt_exceptions &&
> +             ahvm_vcpu_emulate_ve(v) )
> +            return ALTP2MHVM_PAGEFAULT_DONE;
> +
> +        /* Could not handle fault here */
> +        gdprintk(XENLOG_INFO, "Altp2m memory access permissions failure, "
> +                              "no mem_event listener VCPU %d, dom %d\n",
> +                              v->vcpu_id, d->domain_id);
> +        domain_crash(v->domain);
> +        return ALTP2MHVM_PAGEFAULT_CONTINUE;
> +    }
> +
> +    mfn = get_gfn_type_access(hp2m, gpa >> PAGE_SHIFT, &p2mt, &p2ma,
> +                              0, &page_order);
> +    put_gfn(hp2m->domain, gpa >> PAGE_SHIFT);
> +
> +    if ( p2mt != p2m_ram_rw || p2ma != p2m_access_rwx )
> +        return ALTP2MHVM_PAGEFAULT_CONTINUE;

I don't follow -- surely the altp2m ought to contain everything that's
in the host p2m except for deliberate extra changes.  But it looks
like here you just bail on anything other than rwx RAM.  That's going
to livelock on anything that the main fault handler thinks is OK to retry.

Cheers,

Tim.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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