Skip to contentSkip to conversation

Add --vm-write/--vm-read to replace the --vram-* commands to be less confusing

PATCH In review Tom St Denis 2 participants 2 messages Sep 13, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add --vm-write/--vm-read to replace the --vram-* commands to be less confusing

---
 doc/umr.1      |  4 ++--
 src/app/main.c | 26 ++++++++++++++++++++++----
 2 files changed, 24 insertions(+), 6 deletions(-)
doc/umr.1 +2 -2
index b990ff2c412f..e865e131fa51 100644
@@ -94,13 +94,13 @@ The VMID can be specified in hexadecimal (with leading '0x') or in decimal.
 Implies '-O verbose' for the duration of the command so does not require it
 to be manually specified.
 
-.IP "--vram-read, -vr [vmid@]<address> <size>"
+.IP "--vm-read, -vr [vmid@]<address> <size>"
 Read 'size' bytes (in hex) from the address specified (in hexadecimal) from VRAM
 to stdout.  Optionally specify the VMID (in decimal or in hex with a 0x prefix)
 treating the address as a virtual address instead.  Can use 'use_pci' to
 directly access VRAM.
 
-.IP "--vram-write, -vw [vmid@]<address> <size>"
+.IP "--vm-write, -vw [vmid@]<address> <size>"
 Write 'size' bytes (in hex) to the address specified (in hexadecimal) to VRAM
 from stdin.
 
src/app/main.c +22 -4
index 8fdad3580686..92bad4da8e8b 100644
@@ -383,7 +383,16 @@ int main(int argc, char **argv)
 				return EXIT_FAILURE;
 			}
 		} else if (!strcmp(argv[i], "--vram") || !strcmp(argv[i], "-v") ||
-			   !strcmp(argv[i], "--vram-read") || !strcmp(argv[i], "-vr")) {
+			   !strcmp(argv[i], "--vram-read") || !strcmp(argv[i], "-vr") ||
+			   !strcmp(argv[i], "--vm-read")) {
+
+// eventually remove this
+if (strcmp(argv[i], "--vm-read") && strcmp(argv[i], "-vr")) {
+	fprintf(stderr, "[WARNING]: Please use --vm-read or -vr to read VM memory\n");
+}
+//
+
+
 			if (i + 2 < argc) {
 				unsigned char buf[256];
 				uint64_t address;
@@ -417,7 +426,15 @@ int main(int argc, char **argv)
 				printf("--vram-read requires two parameters\n");
 				return EXIT_FAILURE;
 			}
-		} else if (!strcmp(argv[i], "--vram-write") || !strcmp(argv[i], "-vw")) {
+		} else if (!strcmp(argv[i], "--vram-write") || !strcmp(argv[i], "-vw") ||
+			   !strcmp(argv[i], "--vm-write")) {
+
+// eventually remove this
+if (strcmp(argv[i], "--vm-write") && strcmp(argv[i], "-vw")) {
+	fprintf(stderr, "[WARNING]: Please use --vm-write or -vw to write VM memory\n");
+}
+//
+
 			if (i + 2 < argc) {
 				unsigned char buf[256];
 				uint64_t address;
@@ -514,12 +531,12 @@ int main(int argc, char **argv)
 	"\n\t\tThe VMID can be specified in hexadecimal (with leading '0x') or in decimal."
 	"\n\t\tImplies '-O verbose' for the duration of the command so does not require it"
 	"\n\t\tto be manually specified.\n"
-"\n\t--vram-read, -vr [<vmid>@]<address> <size>"
+"\n\t--vm-read, -vr [<vmid>@]<address> <size>"
 	"\n\t\tRead 'size' bytes (in hex) from a given address (in hex) to stdout. Optionally"
 	"\n\t\tspecify the VMID (in decimal or in hex with a '0x' prefix) treating the address"
 	"\n\t\tas a virtual address instead.  Can use 'verbose' option to print out PDE/PTE"
 	"\n\t\tdecodings.\n"
-"\n\t--vram-write, -vw [<vmid>@]<address> <size>"
+"\n\t--vm-write, -vw [<vmid>@]<address> <size>"
 	"\n\t\tWrite 'size' bytes (in hex) to a given address (in hex) from stdin.\n"
 "\n\t--option -O <string>[,<string>,...]\n\t\tEnable various flags: bits, bitsfull, empty_log, follow, named, many,"
 	"\n\t\tuse_pci, use_colour, read_smc, quiet, no_kernel, verbose, halt_waves.\n"
@@ -541,3 +558,4 @@ int main(int argc, char **argv)
 
 	umr_close_asic(asic);
 }
+-
Signature · 6 lines
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by Shaoyun.liu
#2 lore raw

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Wednesday, September 13, 2017 2:27 PM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH umr] Add --vm-write/--vm-read to replace the --vram-* commands to be less confusing

---
 doc/umr.1      |  4 ++--
 src/app/main.c | 26 ++++++++++++++++++++++----
 2 files changed, 24 insertions(+), 6 deletions(-)
doc/umr.1 +2 -2
index b990ff2c412f..e865e131fa51 100644
@@ -94,13 +94,13 @@ The VMID can be specified in hexadecimal (with leading '0x') or in decimal.
 Implies '-O verbose' for the duration of the command so does not require it  to be manually specified.
 
-.IP "--vram-read, -vr [vmid@]<address> <size>"
+.IP "--vm-read, -vr [vmid@]<address> <size>"
 Read 'size' bytes (in hex) from the address specified (in hexadecimal) from VRAM  to stdout.  Optionally specify the VMID (in decimal or in hex with a 0x prefix)  treating the address as a virtual address instead.  Can use 'use_pci' to  directly access VRAM.
 
-.IP "--vram-write, -vw [vmid@]<address> <size>"
+.IP "--vm-write, -vw [vmid@]<address> <size>"
 Write 'size' bytes (in hex) to the address specified (in hexadecimal) to VRAM  from stdin.
 
src/app/main.c +20 -4
@@ -383,7 +383,16 @@ int main(int argc, char **argv)
 				return EXIT_FAILURE;
 			}
 		} else if (!strcmp(argv[i], "--vram") || !strcmp(argv[i], "-v") ||
-			   !strcmp(argv[i], "--vram-read") || !strcmp(argv[i], "-vr")) {
+			   !strcmp(argv[i], "--vram-read") || !strcmp(argv[i], "-vr") ||
+			   !strcmp(argv[i], "--vm-read")) {
+
+// eventually remove this
+if (strcmp(argv[i], "--vm-read") && strcmp(argv[i], "-vr")) {
+	fprintf(stderr, "[WARNING]: Please use --vm-read or -vr to read VM 
+memory\n"); } //
+
+
 			if (i + 2 < argc) {
 				unsigned char buf[256];
 				uint64_t address;
@@ -417,7 +426,15 @@ int main(int argc, char **argv)
 				printf("--vram-read requires two parameters\n");
 				return EXIT_FAILURE;
 			}
-		} else if (!strcmp(argv[i], "--vram-write") || !strcmp(argv[i], "-vw")) {
+		} else if (!strcmp(argv[i], "--vram-write") || !strcmp(argv[i], "-vw") ||
+			   !strcmp(argv[i], "--vm-write")) {
+
+// eventually remove this
+if (strcmp(argv[i], "--vm-write") && strcmp(argv[i], "-vw")) {
+	fprintf(stderr, "[WARNING]: Please use --vm-write or -vw to write VM 
+memory\n"); } //
+
 			if (i + 2 < argc) {
 				unsigned char buf[256];
 				uint64_t address;
@@ -514,12 +531,12 @@ int main(int argc, char **argv)
 	"\n\t\tThe VMID can be specified in hexadecimal (with leading '0x') or in decimal."
 	"\n\t\tImplies '-O verbose' for the duration of the command so does not require it"
 	"\n\t\tto be manually specified.\n"
-"\n\t--vram-read, -vr [<vmid>@]<address> <size>"
+"\n\t--vm-read, -vr [<vmid>@]<address> <size>"
 	"\n\t\tRead 'size' bytes (in hex) from a given address (in hex) to stdout. Optionally"
 	"\n\t\tspecify the VMID (in decimal or in hex with a '0x' prefix) treating the address"
 	"\n\t\tas a virtual address instead.  Can use 'verbose' option to print out PDE/PTE"
 	"\n\t\tdecodings.\n"
-"\n\t--vram-write, -vw [<vmid>@]<address> <size>"
+"\n\t--vm-write, -vw [<vmid>@]<address> <size>"
 	"\n\t\tWrite 'size' bytes (in hex) to a given address (in hex) from stdin.\n"
 "\n\t--option -O <string>[,<string>,...]\n\t\tEnable various flags: bits, bitsfull, empty_log, follow, named, many,"
 	"\n\t\tuse_pci, use_colour, read_smc, quiet, no_kernel, verbose, halt_waves.\n"
@@ -541,3 +558,4 @@ int main(int argc, char **argv)
 
 	umr_close_asic(asic);
 }
+-

--
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx