[PATCH] D45996: [HWASan] Update HWASan assembly snippet in the docs

2018-04-24 Thread Aleksey Shlyapnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC330745: [HWASan] Update HWASan assembly snippet in the docs 
(authored by alekseyshl, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45996?vs=143671=143782#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45996

Files:
  docs/HardwareAssistedAddressSanitizerDesign.rst


Index: docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- docs/HardwareAssistedAddressSanitizerDesign.rst
+++ docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:  08 dc 44 d3 ubfxx8, x0, #4, #52  // shadow address
-   4:  08 01 40 39 ldrbw8, [x8] // load shadow
-   8:  09 fc 78 d3 lsr x9, x0, #56  // address tag
-   c:  3f 01 08 6b cmp w9, w8   // compare tags
-  10:  61 00 00 54 b.ne#12  // jump on mismatch
-  14:  00 00 40 b9 ldr w0, [x0] // original load
-  18:  c0 03 5f d6 ret
-  1c:  40 20 21 d4 brk #0x902   // trap
-
+   0:  08 00 00 90 adrpx8, 0 <__hwasan_shadow>
+   4:  08 01 40 f9 ldr x8, [x8] // shadow base (to be 
resolved by the loader)
+   8:  09 dc 44 d3 ubfxx9, x0, #4, #52  // shadow offset
+   c:  28 69 68 38 ldrbw8, [x9, x8] // load shadow tag
+  10:  09 fc 78 d3 lsr x9, x0, #56  // extract address tag
+  14:  3f 01 08 6b cmp w9, w8   // compare tags
+  18:  61 00 00 54 b.ne24   // jump on mismatch
+  1c:  00 00 40 b9 ldr w0, [x0] // original load
+  20:  c0 03 5f d6 ret
+  24:  40 20 21 d4 brk #0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 


Index: docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- docs/HardwareAssistedAddressSanitizerDesign.rst
+++ docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:	08 dc 44 d3 	ubfx	x8, x0, #4, #52  // shadow address
-   4:	08 01 40 39 	ldrb	w8, [x8] // load shadow
-   8:	09 fc 78 d3 	lsr	x9, x0, #56  // address tag
-   c:	3f 01 08 6b 	cmp	w9, w8   // compare tags
-  10:	61 00 00 54 	b.ne	#12  // jump on mismatch
-  14:	00 00 40 b9 	ldr	w0, [x0] // original load
-  18:	c0 03 5f d6 	ret
-  1c:	40 20 21 d4 	brk	#0x902   // trap
-
+   0:	08 00 00 90 	adrp	x8, 0 <__hwasan_shadow>
+   4:	08 01 40 f9 	ldr	x8, [x8] // shadow base (to be resolved by the loader)
+   8:	09 dc 44 d3 	ubfx	x9, x0, #4, #52  // shadow offset
+   c:	28 69 68 38 	ldrb	w8, [x9, x8] // load shadow tag
+  10:	09 fc 78 d3 	lsr	x9, x0, #56  // extract address tag
+  14:	3f 01 08 6b 	cmp	w9, w8   // compare tags
+  18:	61 00 00 54 	b.ne	24   // jump on mismatch
+  1c:	00 00 40 b9 	ldr	w0, [x0] // original load
+  20:	c0 03 5f d6 	ret
+  24:	40 20 21 d4 	brk	#0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45996: [HWASan] Update HWASan assembly snippet in the docs

2018-04-24 Thread Aleksey Shlyapnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL330745: [HWASan] Update HWASan assembly snippet in the docs 
(authored by alekseyshl, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D45996

Files:
  cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst


Index: cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
+++ cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:  08 dc 44 d3 ubfxx8, x0, #4, #52  // shadow address
-   4:  08 01 40 39 ldrbw8, [x8] // load shadow
-   8:  09 fc 78 d3 lsr x9, x0, #56  // address tag
-   c:  3f 01 08 6b cmp w9, w8   // compare tags
-  10:  61 00 00 54 b.ne#12  // jump on mismatch
-  14:  00 00 40 b9 ldr w0, [x0] // original load
-  18:  c0 03 5f d6 ret
-  1c:  40 20 21 d4 brk #0x902   // trap
-
+   0:  08 00 00 90 adrpx8, 0 <__hwasan_shadow>
+   4:  08 01 40 f9 ldr x8, [x8] // shadow base (to be 
resolved by the loader)
+   8:  09 dc 44 d3 ubfxx9, x0, #4, #52  // shadow offset
+   c:  28 69 68 38 ldrbw8, [x9, x8] // load shadow tag
+  10:  09 fc 78 d3 lsr x9, x0, #56  // extract address tag
+  14:  3f 01 08 6b cmp w9, w8   // compare tags
+  18:  61 00 00 54 b.ne24   // jump on mismatch
+  1c:  00 00 40 b9 ldr w0, [x0] // original load
+  20:  c0 03 5f d6 ret
+  24:  40 20 21 d4 brk #0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 


Index: cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
+++ cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:	08 dc 44 d3 	ubfx	x8, x0, #4, #52  // shadow address
-   4:	08 01 40 39 	ldrb	w8, [x8] // load shadow
-   8:	09 fc 78 d3 	lsr	x9, x0, #56  // address tag
-   c:	3f 01 08 6b 	cmp	w9, w8   // compare tags
-  10:	61 00 00 54 	b.ne	#12  // jump on mismatch
-  14:	00 00 40 b9 	ldr	w0, [x0] // original load
-  18:	c0 03 5f d6 	ret
-  1c:	40 20 21 d4 	brk	#0x902   // trap
-
+   0:	08 00 00 90 	adrp	x8, 0 <__hwasan_shadow>
+   4:	08 01 40 f9 	ldr	x8, [x8] // shadow base (to be resolved by the loader)
+   8:	09 dc 44 d3 	ubfx	x9, x0, #4, #52  // shadow offset
+   c:	28 69 68 38 	ldrb	w8, [x9, x8] // load shadow tag
+  10:	09 fc 78 d3 	lsr	x9, x0, #56  // extract address tag
+  14:	3f 01 08 6b 	cmp	w9, w8   // compare tags
+  18:	61 00 00 54 	b.ne	24   // jump on mismatch
+  1c:	00 00 40 b9 	ldr	w0, [x0] // original load
+  20:	c0 03 5f d6 	ret
+  24:	40 20 21 d4 	brk	#0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45996: [HWASan] Update HWASan assembly snippet in the docs

2018-04-23 Thread Kostya Serebryany via Phabricator via cfe-commits
kcc accepted this revision.
kcc added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rC Clang

https://reviews.llvm.org/D45996



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45996: [HWASan] Update HWASan assembly snippet in the docs

2018-04-23 Thread Aleksey Shlyapnikov via Phabricator via cfe-commits
alekseyshl created this revision.
alekseyshl added a reviewer: eugenis.

To complement https://reviews.llvm.org/D45840


Repository:
  rC Clang

https://reviews.llvm.org/D45996

Files:
  docs/HardwareAssistedAddressSanitizerDesign.rst


Index: docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- docs/HardwareAssistedAddressSanitizerDesign.rst
+++ docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:  08 dc 44 d3 ubfxx8, x0, #4, #52  // shadow address
-   4:  08 01 40 39 ldrbw8, [x8] // load shadow
-   8:  09 fc 78 d3 lsr x9, x0, #56  // address tag
-   c:  3f 01 08 6b cmp w9, w8   // compare tags
-  10:  61 00 00 54 b.ne#12  // jump on mismatch
-  14:  00 00 40 b9 ldr w0, [x0] // original load
-  18:  c0 03 5f d6 ret
-  1c:  40 20 21 d4 brk #0x902   // trap
-
+   0:  08 00 00 90 adrpx8, 0 <__hwasan_shadow>
+   4:  08 01 40 f9 ldr x8, [x8] // shadow base (to be 
resolved by the loader)
+   8:  09 dc 44 d3 ubfxx9, x0, #4, #52  // shadow offset
+   c:  28 69 68 38 ldrbw8, [x9, x8] // load shadow tag
+  10:  09 fc 78 d3 lsr x9, x0, #56  // extract address tag
+  14:  3f 01 08 6b cmp w9, w8   // compare tags
+  18:  61 00 00 54 b.ne24   // jump on mismatch
+  1c:  00 00 40 b9 ldr w0, [x0] // original load
+  20:  c0 03 5f d6 ret
+  24:  40 20 21 d4 brk #0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 


Index: docs/HardwareAssistedAddressSanitizerDesign.rst
===
--- docs/HardwareAssistedAddressSanitizerDesign.rst
+++ docs/HardwareAssistedAddressSanitizerDesign.rst
@@ -52,15 +52,16 @@
   // int foo(int *a) { return *a; }
   // clang -O2 --target=aarch64-linux -fsanitize=hwaddress -c load.c
   foo:
-   0:	08 dc 44 d3 	ubfx	x8, x0, #4, #52  // shadow address
-   4:	08 01 40 39 	ldrb	w8, [x8] // load shadow
-   8:	09 fc 78 d3 	lsr	x9, x0, #56  // address tag
-   c:	3f 01 08 6b 	cmp	w9, w8   // compare tags
-  10:	61 00 00 54 	b.ne	#12  // jump on mismatch
-  14:	00 00 40 b9 	ldr	w0, [x0] // original load
-  18:	c0 03 5f d6 	ret
-  1c:	40 20 21 d4 	brk	#0x902   // trap
-
+   0:	08 00 00 90 	adrp	x8, 0 <__hwasan_shadow>
+   4:	08 01 40 f9 	ldr	x8, [x8] // shadow base (to be resolved by the loader)
+   8:	09 dc 44 d3 	ubfx	x9, x0, #4, #52  // shadow offset
+   c:	28 69 68 38 	ldrb	w8, [x9, x8] // load shadow tag
+  10:	09 fc 78 d3 	lsr	x9, x0, #56  // extract address tag
+  14:	3f 01 08 6b 	cmp	w9, w8   // compare tags
+  18:	61 00 00 54 	b.ne	24   // jump on mismatch
+  1c:	00 00 40 b9 	ldr	w0, [x0] // original load
+  20:	c0 03 5f d6 	ret
+  24:	40 20 21 d4 	brk	#0x902   // trap
 
 Alternatively, memory accesses are prefixed with a function call.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits