-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding, core: Add findwatchpoint() and encoding
Add the implementation of find_watchpoint(). Since the 64-bit architecture, the virtual address only uses the least 57 bit. So we can let the watchpoint store the information, like operation type and object size, on the 64 to 57 bit. Signed-off-by: Chih-En Lin <shiyn.lin@gmail.com>
- Loading branch information
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef __UCSAN_ENCODING_H__ | ||
#define __UCSAN_ENCODING_H__ | ||
|
||
/* For 64-bit architecture, the sizeof(long) is 8 bytes */ | ||
#define BITS_PER_LONG 64 | ||
|
||
/* | ||
* currently for 64-bit architecture, the max of address will be 57 bits from 5 | ||
* level page table of virtual address. | ||
* So we can use the higher than 56 bit of address to specific the following: | ||
* | ||
* - tasn read/write operation : 1 bit | ||
* - object size : 5 bits for 1,2,4,8,16 size | ||
* - consumed : 1 bit | ||
*/ | ||
#define WATCHPOINT_ADDR_MASK ((1UL << 56) - 1) | ||
#define WATCHPOINT_CONSUMED_MASK (1UL << 56) | ||
#define WATCHPOINT_SIZE_1 (1UL << 57) | ||
#define WATCHPOINT_SIZE_2 (1UL << 58) | ||
#define WATCHPOINT_SIZE_4 (1UL << 59) | ||
#define WATCHPOINT_SIZE_8 (1UL << 60) | ||
#define WATCHPOINT_SIZE_16 (1UL << 61) | ||
#define WATCHPOINT_WRITE_MASK (1UL << 62) | ||
|
||
#endif /* __UCSAN_ENCODING_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters