Skip to contentSkip to conversation

iommu: Elaborate the usage of RMRR specification on the command line

PATCH In review Venu Busireddy 4 participants 4 messages Feb 23, 2017 – Feb 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iommu: Elaborate the usage of RMRR specification on the command line

As some users have suggested, elaborate the usage of RMRR specification on the command line, and provide a usage example.

Also, always treat the specified page numbers as hexadecimal values.

---

Changes in v2:
- Provide a better usage example.
- Treat input page numbers as hexadecimal values.

 docs/misc/xen-command-line.markdown | 10 ++++++++++
 xen/drivers/passthrough/vtd/dmar.c  |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)
docs/misc/xen-command-line.markdown +10 -0
index 3acbb33..a035c3f 100644
@@ -1406,6 +1406,16 @@ If segment of the first device is not specified, segment zero will be used.
 If other segments are not specified, first device segment will be used.
 If a segment is specified for other than the first device and it does not match
 the one specified for the first one, an error will be reported.
+
+'start' and 'end' values are page numbers (not full physical addresses),
+in hexadecimal format (can optionally be preceded by "0x").
+
+Usage example: If device 0:0:1d.0 requires one page (0xd5d45) to be
+reserved, and device 0:0:1a.0 requires three pages (0xd5d46 thru 0xd5d48)
+to be reserved, one usage would be:
+
+rmrr=d5d45=0:0:1d.0;0xd5d46-0xd5d48=0:0:1a.0
+
 Note: grub2 requires to escape or use quotations if special characters are used,
 namely ';', refer to the grub2 documentation if multiple ranges are specified.
 
xen/drivers/passthrough/vtd/dmar.c +2 -2
index 9484f3b..436a533 100644
@@ -1097,13 +1097,13 @@ static void __init parse_rmrr_param(const char *str)
     unsigned long start, end;
 
     do {
-        start = simple_strtoul(cur = s, &s, 0);
+        start = simple_strtoul(cur = s, &s, 16);
         if ( cur == s )
             break;
 
         if ( *s == '-' )
         {
-            end = simple_strtoul(cur = s + 1, &s, 0);
+            end = simple_strtoul(cur = s + 1, &s, 16);
             if ( cur == s )
                 break;
         }

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by on v2 1/1
#1 lore raw
Quoted 6 lines · Venu Busireddy

As some users have suggested, elaborate the usage of RMRR specification on the command line, and provide a usage example.

Also, always treat the specified page numbers as hexadecimal values.

Thanks! Just a minor comment, apart from that:

Quoted 17 lines

---

Changes in v2:
- Provide a better usage example.
- Treat input page numbers as hexadecimal values.

 docs/misc/xen-command-line.markdown | 10 ++++++++++
 xen/drivers/passthrough/vtd/dmar.c  |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)
docs/misc/xen-command-line.markdown +0 -0
index 3acbb33..a035c3f 100644
@@ -1406,6 +1406,16 @@ If segment of the first device is not specified, segment zero will be used.
 If other segments are not specified, first device segment will be used.
 If a segment is specified for other than the first device and it does not match

docs/misc/xen-command-line.markdown If segment of the first device is not specified, segment zero will be used. · line 1417

Quoted 10 lines
docs/misc/xen-command-line.markdown +9 -0
 the one specified for the first one, an error will be reported.
+
+'start' and 'end' values are page numbers (not full physical addresses),
+in hexadecimal format (can optionally be preceded by "0x").
+
+Usage example: If device 0:0:1d.0 requires one page (0xd5d45) to be
+reserved, and device 0:0:1a.0 requires three pages (0xd5d46 thru 0xd5d48)
+to be reserved, one usage would be:
+
+rmrr=d5d45=0:0:1d.0;0xd5d46-0xd5d48=0:0:1a.0

An example with multiple devices would also be nice, maybe something like:

rmrr=d5d45=0:0:1d.0,0:0:1f.0;0xd5d46-0xd5d48=0:0:1a.0

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#2 lore raw
In reply to Venu Busireddy
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 23.02.17 at 18:03, <[email protected]> wrote:

As some users have suggested, elaborate the usage of RMRR specification on the command line, and provide a usage example.

Also, always treat the specified page numbers as hexadecimal values.

Quoted 5 lines

---

Changes in v2:
- Provide a better usage example.
- Treat input page numbers as hexadecimal values.

For this second aspect you should have Cc-ed the VT-d maintainer (now added to Cc).

Jan

Quoted 41 lines
 docs/misc/xen-command-line.markdown | 10 ++++++++++
 xen/drivers/passthrough/vtd/dmar.c  |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)
docs/misc/xen-command-line.markdown +0 -0
index 3acbb33..a035c3f 100644
@@ -1406,6 +1406,16 @@ If segment of the first device is not specified, 

segment zero will be used.
If other segments are not specified, first device segment will be used. If a segment is specified for other than the first device and it does not
match
the one specified for the first one, an error will be reported.

docs/misc/xen-command-line.markdown +10 -0
+
+'start' and 'end' values are page numbers (not full physical addresses),
+in hexadecimal format (can optionally be preceded by "0x").
+
+Usage example: If device 0:0:1d.0 requires one page (0xd5d45) to be
+reserved, and device 0:0:1a.0 requires three pages (0xd5d46 thru 0xd5d48)
+to be reserved, one usage would be:
+
+rmrr=d5d45=0:0:1d.0;0xd5d46-0xd5d48=0:0:1a.0
+
 Note: grub2 requires to escape or use quotations if special characters are 

used,
namely ';', refer to the grub2 documentation if multiple ranges are
specified.

xen/drivers/passthrough/vtd/dmar.c +1 -1
index 9484f3b..436a533 100644
@@ -1097,13 +1097,13 @@ static void __init parse_rmrr_param(const char *str)
     unsigned long start, end;
 
     do {
-        start = simple_strtoul(cur = s, &s, 0);
+        start = simple_strtoul(cur = s, &s, 16);

xen/drivers/passthrough/vtd/dmar.c static void __init parse_rmrr_param(const char *str) · line 1109

Quoted 10 lines
xen/drivers/passthrough/vtd/dmar.c +1 -1
         if ( cur == s )
             break;
 
         if ( *s == '-' )
         {
-            end = simple_strtoul(cur = s + 1, &s, 0);
+            end = simple_strtoul(cur = s + 1, &s, 16);
             if ( cur == s )
                 break;
         }

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by
#3 lore raw
Quoted 4 lines

From: Jan Beulich [mailto:[email protected]]
Sent: Friday, February 24, 2017 4:56 PM

Quoted 1 line
Quoted 1 line
Quoted 1 line · On 23.02.17 at 18:03, <[email protected]> wrote:
Quoted 9 lines
Quoted 6 lines

As some users have suggested, elaborate the usage of RMRR specification on the command line, and provide a usage example.

Also, always treat the specified page numbers as hexadecimal values.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel