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

Re: [Xen-devel] [PATCH] x86/shim: Fixes to replace_linear_mapping()



>>> On 24.01.18 at 12:00, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/pv/shim.c
> +++ b/xen/arch/x86/pv/shim.c
> @@ -119,19 +119,23 @@ uint64_t pv_shim_mem(uint64_t avail)
>                   _PAGE_GUEST_KERNEL)
>  #define COMPAT_L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
>  
> -static void __init replace_va_mapping(struct domain *d, l4_pgentry_t 
> *l4start,
> -                                      unsigned long va, mfn_t mfn)
> +static void __init replace_linear_mapping(
> +    struct domain *d, l4_pgentry_t *l4t, unsigned long linear, mfn_t mfn)
>  {
> -    l4_pgentry_t *pl4e = l4start + l4_table_offset(va);
> -    l3_pgentry_t *pl3e = l4e_to_l3e(*pl4e) + l3_table_offset(va);
> -    l2_pgentry_t *pl2e = l3e_to_l2e(*pl3e) + l2_table_offset(va);
> -    l1_pgentry_t *pl1e = l2e_to_l1e(*pl2e) + l1_table_offset(va);
> -    struct page_info *page = mfn_to_page(l1e_get_mfn(*pl1e));
> +    l4_pgentry_t *l4e = l4t                    + l4_table_offset(linear);
> +    l3_pgentry_t *l3e = map_l3t_from_l4e(*l4e) + l3_table_offset(linear);
> +    l2_pgentry_t *l2e = map_l2t_from_l3e(*l3e) + l2_table_offset(linear);
> +    l1_pgentry_t *l1e = map_l1t_from_l2e(*l2e) + l1_table_offset(linear);

Can we please stick to the previous naming (with an initial p), so
that "lNe" continues to mean an actual entry, and plNe a pointer
thereto?

Also I consider it bad practice to keep multiple domain pages
mapped at the same time when there's no strict need. This being
init code, it's probably not a big problem, but it would set a bad
precedent. IOW can I talk you into using map-read-unmap
sequences, even if this makes the overall source slightly larger?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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