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

Re: [Xen-devel] [Minios-devel] [PATCH RFC 07/16] Save/Restore Support: Add unmap_shared_info



Bruno Alvisio, on mar. 19 déc. 2017 15:42:02 -0800, wrote:
> This function is necessary as part of the pre-suspend operation.
> 
> Signed-off-by: Bruno Alvisio <bruno.alvisio@xxxxxxxxx>
> ---

> +void unmap_shared_info(void)
> +{
> +    int rc;
> +
> +    if ( (rc = HYPERVISOR_update_va_mapping((unsigned 
> long)HYPERVISOR_shared_info,

For coherency, I'd say use shared_info there too.
Apart from that,

Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> +            __pte((virt_to_mfn(shared_info)<<L1_PAGETABLE_SHIFT)| L1_PROT), 
> UVMF_INVLPG)) )
> +    {
> +        printk("Failed to unmap shared_info page!! rc=%d\n", rc);
> +        do_exit();
> +    }
> +}
> +
>  static void get_cmdline(void *p)
>  {
>      start_info_t *si = p;
> diff --git a/hypervisor.c b/hypervisor.c
> index 1647121..d3857e7 100644
> --- a/hypervisor.c
> +++ b/hypervisor.c
> @@ -78,6 +78,18 @@ shared_info_t *map_shared_info(void *p)
>  
>      return &shared_info;
>  }
> +
> +void unmap_shared_info(void)
> +{
> +    struct xen_remove_from_physmap xrtp;
> +
> +    xrtp.domid = DOMID_SELF;
> +    xrtp.gpfn = virt_to_pfn(&shared_info);
> +    if ( HYPERVISOR_memory_op(XENMEM_remove_from_physmap, &xrtp) != 0 )
> +        BUG();
> +
> +    return;
> +}
>  #endif
>  
>  void do_hypervisor_callback(struct pt_regs *regs)
> diff --git a/include/hypervisor.h b/include/hypervisor.h
> index f3b1f3c..1d09271 100644
> --- a/include/hypervisor.h
> +++ b/include/hypervisor.h
> @@ -43,6 +43,7 @@ int hvm_get_parameter(int idx, uint64_t *value);
>  int hvm_set_parameter(int idx, uint64_t value);
>  #endif
>  shared_info_t *map_shared_info(void *p);
> +void unmap_shared_info(void);
>  void force_evtchn_callback(void);
>  void do_hypervisor_callback(struct pt_regs *regs);
>  void mask_evtchn(uint32_t port);
> -- 
> 2.3.2 (Apple Git-55)
> 
> 
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/minios-devel

-- 
Samuel
<y> la vraie vie, c'est quand le prompt passe de $ à #

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