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

Re: [Xen-devel] [PATCH v3 29/32] libxc/xen: introduce HVM_PARAM_FIRST_FREE_PFN



On Fri, Jul 03, 2015 at 01:35:07PM +0200, Roger Pau Monne wrote:
> This HVM parameter returns the first free pfn after all the special pages.

Could you describe how the layout of PFNs is now for the HVM guests?

Is there some document that outlines it? I know that for PV we do 
have it as part of the start_info structure but not sure about HVM?

> It can be used by guests to figure out the first free memory address after
> the kernel, ramdisk and special pages. This is interesting for compatibility

So you mention it here, perhaps there should be an document
mentioning this. Or the header for the PFNs?

> reasons in case more special pages are later added, older guests can still
> use this parameter to figure out the first free address, ignoring newly
> added special pages.

And presumarily figure out the 'special PFN's and mark them
as reserved? Are those PFNs in the E820 as RESERVED?

We should also put some restrictions in the code then to make sure
that there will never be any HVM_PARAM_*PFN _after_ this PFN.

And document that somewhere.

> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
>  tools/libxc/xc_dom_x86.c        | 2 ++
>  xen/arch/x86/hvm/hvm.c          | 1 +
>  xen/include/public/hvm/params.h | 5 ++++-
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
> index 41ff7a4..74c3819 100644
> --- a/tools/libxc/xc_dom_x86.c
> +++ b/tools/libxc/xc_dom_x86.c
> @@ -573,6 +573,8 @@ static int alloc_magic_pages_hvm(struct xc_dom_image *dom)
>                       special_pfn(SPECIALPAGE_ACCESS, dom));
>      xc_hvm_param_set(xch, domid, HVM_PARAM_SHARING_RING_PFN,
>                       special_pfn(SPECIALPAGE_SHARING, dom));
> +    xc_hvm_param_set(xch, domid, HVM_PARAM_FIRST_FREE_PFN,
> +                     special_pfn(NR_SPECIAL_PAGES, dom));
>  
>      if ( dom->cmdline )
>      {
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index efe7232..2b190e9 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -5918,6 +5918,7 @@ static int hvm_allow_get_param(struct domain *d,
>      case HVM_PARAM_CONSOLE_PFN:
>      case HVM_PARAM_CONSOLE_EVTCHN:
>      case HVM_PARAM_CMDLINE_PFN:
> +    case HVM_PARAM_FIRST_FREE_PFN:
>          break;
>      /*
>       * The following parameters must not be read by the guest
> diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
> index b7f8839..47e38a8 100644
> --- a/xen/include/public/hvm/params.h
> +++ b/xen/include/public/hvm/params.h
> @@ -190,6 +190,9 @@
>  /* PFN of the command line. */
>  #define HVM_PARAM_CMDLINE_PFN 35
>  
> -#define HVM_NR_PARAMS          36
> +/* First free PFN after the special pages. */
> +#define HVM_PARAM_FIRST_FREE_PFN 36
> +
> +#define HVM_NR_PARAMS          37
>  
>  #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
> -- 
> 1.9.5 (Apple Git-50.3)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

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