lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Apr 2013 14:40:58 +0200
From:	Daniel Kiper <daniel.kiper@...cle.com>
To:	Ian Campbell <Ian.Campbell@...rix.com>
Cc:	"carsten@...iers.de" <carsten@...iers.de>,
	"darren.s.shepherd@...il.com" <darren.s.shepherd@...il.com>,
	David Vrabel <david.vrabel@...rix.com>,
	Ian Jackson <Ian.Jackson@...citrix.com>,
	"james-xen@...gwall.me.uk" <james-xen@...gwall.me.uk>,
	"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>
Subject: Re: [PATCH v2 1/2] xen/balloon: Notify a host about a guest memory
 size limit

On Mon, Apr 29, 2013 at 03:35:11PM +0100, Ian Campbell wrote:
> On Mon, 2013-04-29 at 12:37 +0100, Daniel Kiper wrote:
> > Notify a host about a guest memory size limit.
> >
> > Idea of this patch was discussed with Ian Campbell and Ian Jackson.
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@...cle.com>
> > ---
> >  drivers/xen/balloon.c |   25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
> > index a56776d..856661f 100644
> > --- a/drivers/xen/balloon.c
> > +++ b/drivers/xen/balloon.c
> > @@ -65,6 +65,7 @@
> >  #include <xen/balloon.h>
> >  #include <xen/features.h>
> >  #include <xen/page.h>
> > +#include <xen/xenbus.h>
> >
> >  /*
> >   * balloon_process() state:
> > @@ -586,6 +587,9 @@ static void __init balloon_add_region(unsigned long start_pfn,
> >  static int __init balloon_init(void)
> >  {
> >  	int i;
> > +#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
> > +	int rc;
> > +#endif
> >
> >  	if (!xen_domain())
> >  		return -ENODEV;
> > @@ -621,6 +625,27 @@ static int __init balloon_init(void)
> >  			balloon_add_region(PFN_UP(xen_extra_mem[i].start),
> >  					   PFN_DOWN(xen_extra_mem[i].size));
> >
> > +#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
> > +	/*
> > +	 * Notify a host about our memory size limit.
> > +	 *
> > +	 * The guest-max value is in KiB, so MAX_DOMAIN_PAGES should
> > +	 * be converted respectively. PAGE_SHIFT converts pages to bytes,
> > +	 * hence PAGE_SHIFT - 10.
> > +	 */
> > +	rc = xenbus_printf(XBT_NIL, "memory", "guest-max", "%lu",
> > +				MAX_DOMAIN_PAGES << (PAGE_SHIFT - 10));
> > +
> > +	if (rc < 0)
> > +		pr_info("xen/balloon: Memory hotplug may not be supported "
> > +			"in some environments: %i\n", rc);
> > +#else
> > +	xenbus_printf(XBT_NIL, "memory", "guest-max", "%lu",
>
> Would it be OK to not do anything in the non-hotplug case? That's just

As I stated earlier I think that every new polite guest, with or without
memory hotplug, should inform about its maximum supported memory size.

> the historical behaviour right?

Yes, it is.

> Would you expect this value to differ from static-max?

On my test system it is static-max + 8 MiB.

Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ