Skip to contentSkip to conversation

tools/xenstore: set maximum number of grants needed

PATCH In review Juergen Gross 3 participants 6 messages Sep 24, 2020 – Sep 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenstore: set maximum number of grants needed

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
 tools/xenstore/xenstored_domain.c | 2 ++
 1 file changed, 2 insertions(+)
tools/xenstore/xenstored_domain.c +2 -0
index 06359503f0..f740aa02f5 100644
@@ -630,6 +630,8 @@ void domain_init(void)
 	*xgt_handle = xengnttab_open(NULL, 0);
 	if (*xgt_handle == NULL)
 		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);
 
 	talloc_set_destructor(xgt_handle, close_xgt_handle);
 
Signature · 1 line
2.26.2
#1 lore raw
Quoted 17 lines · Juergen Gross

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
 tools/xenstore/xenstored_domain.c | 2 ++
 1 file changed, 2 insertions(+)
tools/xenstore/xenstored_domain.c +0 -0
index 06359503f0..f740aa02f5 100644

tools/xenstore/xenstored_domain.c void domain_init(void) · line 634

Quoted 5 lines
tools/xenstore/xenstored_domain.c +2 -0
@@ -630,6 +630,8 @@ void domain_init(void)
 	*xgt_handle = xengnttab_open(NULL, 0);
 	if (*xgt_handle == NULL)
 		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);

Why DOMID_FIRST_RESERVED as the count argument? Is the expectation here xenstored maps one grant per domain?

Wei.

Quoted 6 lines
tools/xenstore/xenstored_domain.c +0 -0
 	talloc_set_destructor(xgt_handle, close_xgt_handle);
 
Signature · 1 line
2.26.2
#2 lore raw
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
  tools/xenstore/xenstored_domain.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 13 lines

tools/xenstore/xenstored_domain.c void domain_init(void) · line 634

Quoted 10 lines
tools/xenstore/xenstored_domain.c +2 -0
index 06359503f0..f740aa02f5 100644
@@ -630,6 +630,8 @@ void domain_init(void)
  	*xgt_handle = xengnttab_open(NULL, 0);
  	if (*xgt_handle == NULL)
  		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);

Why DOMID_FIRST_RESERVED as the count argument? Is the expectation here xenstored maps one grant per domain?

Yes. This is the theoretical maximum.

Juergen

Acked-by
#3 lore raw
Quoted 28 lines · Jürgen Groß
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
  tools/xenstore/xenstored_domain.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 13 lines

tools/xenstore/xenstored_domain.c void domain_init(void) · line 634

Quoted 10 lines
tools/xenstore/xenstored_domain.c +2 -0
index 06359503f0..f740aa02f5 100644
@@ -630,6 +630,8 @@ void domain_init(void)
  	*xgt_handle = xengnttab_open(NULL, 0);
  	if (*xgt_handle == NULL)
  		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);

Why DOMID_FIRST_RESERVED as the count argument? Is the expectation here xenstored maps one grant per domain?

Quoted 2 lines

Yes. This is the theoretical maximum.

In that case:

I will also add that information to the commit message.

Quoted 2 lines

Juergen

#4 lore raw
Quoted 27 lines · Wei Liu
Quoted 26 lines · Jürgen Groß
Quoted 25 lines · Wei Liu
Quoted 17 lines · Juergen Gross

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
  tools/xenstore/xenstored_domain.c | 2 ++
  1 file changed, 2 insertions(+)
tools/xenstore/xenstored_domain.c +0 -0
index 06359503f0..f740aa02f5 100644

tools/xenstore/xenstored_domain.c void domain_init(void) · line 634

Quoted 5 lines
tools/xenstore/xenstored_domain.c +2 -0
@@ -630,6 +630,8 @@ void domain_init(void)
  	*xgt_handle = xengnttab_open(NULL, 0);
  	if (*xgt_handle == NULL)
  		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);

Why DOMID_FIRST_RESERVED as the count argument? Is the expectation here xenstored maps one grant per domain?

Quoted 7 lines
Quoted 2 lines

Yes. This is the theoretical maximum.

In that case:

I will also add that information to the commit message.

And the comment if possible please.  That's where it will be most useful to the next person doing a doubletake at this code.  :)

~Andrew

#5 lore raw
Quoted 30 lines · Andrew Cooper
Quoted 29 lines · Wei Liu
Quoted 28 lines · Jürgen Groß
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross

When running as a stubdom Xenstore should set the maximum number of grants needed via a call of xengnttab_set_max_grants(), as otherwise the number of domains which can be supported will be 128 only (the default number of grants supported by Mini-OS).

---
This is a backport candidate IMO.

---
  tools/xenstore/xenstored_domain.c | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

tools/xenstore/xenstored_domain.c void domain_init(void) · line 634

Quoted 10 lines
tools/xenstore/xenstored_domain.c +2 -0
index 06359503f0..f740aa02f5 100644
@@ -630,6 +630,8 @@ void domain_init(void)
  	*xgt_handle = xengnttab_open(NULL, 0);
  	if (*xgt_handle == NULL)
  		barf_perror("Failed to open connection to gnttab");
+	/* Allow max number of domains for mappings. */
+	xengnttab_set_max_grants(*xgt_handle, DOMID_FIRST_RESERVED);

Why DOMID_FIRST_RESERVED as the count argument? Is the expectation here xenstored maps one grant per domain?

Yes. This is the theoretical maximum.

Quoted 8 lines
Quoted 5 lines

In that case:

I will also add that information to the commit message.

And the comment if possible please.  That's where it will be most useful to the next person doing a doubletake at this code.  :)

Yes sure.

Wei.

Quoted 2 lines

~Andrew