From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v3 29/32] libxc/xen: introduce HVM_PARAM_FIRST_FREE_PFN Date: Fri, 10 Jul 2015 15:05:05 -0400 Message-ID: <20150710190504.GE30788@l.oracle.com> References: <1435923310-9019-1-git-send-email-roger.pau@citrix.com> <1435923310-9019-30-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZDdbo-00051N-Hq for xen-devel@lists.xenproject.org; Fri, 10 Jul 2015 19:05:16 +0000 Content-Disposition: inline In-Reply-To: <1435923310-9019-30-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org 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 compatibil= ity 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=E9 > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Ian Campbell > Cc: Wei Liu > Cc: Jan Beulich > Cc: Andrew Cooper > --- > 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/par= ams.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@lists.xen.org > http://lists.xen.org/xen-devel