[Crash-utility] [PATCH v3 1/6] defs.h: Fix the PHYSICAL_PAGE_MASK macro

Dou Liyang douly.fnst at cn.fujitsu.com
Mon Jan 29 10:51:38 UTC 2018


Original crash defines the PHYSICAL_PAGE_MASK as

  (~(PAGE_SIZE-1) & (__PHYSICAL_MASK << PAGE_SHIFT))

It moves left PAGE_SHIFT bits for safety, But, as crash expands the physical
bits to 52, this will cause the conversion of phythcal address to virtual
address failed. Remove the PAGE_SHIFT to fix this problem.

Signed-off-by: Dou Liyang <douly.fnst at cn.fujitsu.com>
---
 defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/defs.h b/defs.h
index 92341d2..e0b77ce 100644
--- a/defs.h
+++ b/defs.h
@@ -3405,7 +3405,7 @@ struct arm64_stackframe {
 #define __VIRTUAL_MASK         ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
 #define PAGE_SHIFT             12
 #define PAGE_SIZE              (1UL << PAGE_SHIFT)
-#define PHYSICAL_PAGE_MASK    (~(PAGE_SIZE-1) & (__PHYSICAL_MASK << PAGE_SHIFT))
+#define PHYSICAL_PAGE_MASK    (~(PAGE_SIZE-1) & __PHYSICAL_MASK )
 
 #define _PAGE_BIT_NX    63
 #define _PAGE_PRESENT   0x001
-- 
2.14.3






More information about the Crash-utility mailing list