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

Re: [Xen-devel] [PATCH v5 04/10] xen/arm: Store p2m type in each page of the guest



On Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote:
> Use the field 'avail' to store the type of the page. Rename it to 'type' for
> convenience.
> The information stored in this field will be retrieved in a future patch to
> change the behaviour when the page is removed.
> 
> Also introduce guest_physmap_add_entry to map and set a specific p2m type for
> a page.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
> 
> ---
>     Changes in v5:
>         - Foreign mapping doesn't need to have execution right

Neither does MMIO for that matter...

>  
> +    switch (t)
> +    {
> +    case p2m_map_foreign:
> +    case p2m_grant_map_rw:
> +        e.p2m.xn = 1;
> +        /* Fallthrough */
> +    case p2m_ram_rw:
> +    case p2m_mmio_direct:

... so move this up.

> +        e.p2m.write = 1;
> +        break;
> +
> +    case p2m_grant_map_ro:
> +        e.p2m.xn = 1;
> +        /* Fallthrough */
> +    case p2m_invalid:
> +    case p2m_ram_ro:
> +    default:

You were going to remove the default case IIRC to let the compiler catch
new type additions.

> +        e.p2m.write = 0;
> +    }
> +

>diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
> index 0625464..670d4e7 100644
> --- a/xen/include/asm-arm/page.h
> +++ b/xen/include/asm-arm/page.h
> @@ -153,7 +153,7 @@ typedef struct {
>      unsigned long contig:1;     /* In a block of 16 contiguous entries */
>      unsigned long sbz2:1;
>      unsigned long xn:1;         /* eXecute-Never */
> -    unsigned long avail:4;      /* Ignored by hardware */
> +    unsigned long type:4;       /* Ignore by hardware. Used to store p2m 
> types */

"Ignored" was correct.

>  
>      unsigned long sbz1:5;
>  } __attribute__((__packed__)) lpae_p2m_t;



_______________________________________________
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®.