@@ -154,7 +154,7 @@ typedef struct PageDesc {
/* Size of the L2 (and L3, etc) page tables. */
#define L2_BITS 10
-#define L2_SIZE (1 << L2_BITS)
+#define L2_SIZE (1ULL << L2_BITS)
/* The bits remaining after N lower levels of page tables. */
#define P_L1_BITS_REM \
@@ -432,7 +432,8 @@ static PhysPageDesc
*phys_page_find_alloc(target_phys_addr_t index, int alloc)
for (i = 0; i < L2_SIZE; i++) {
pd[i].phys_offset = IO_MEM_UNASSIGNED;
- pd[i].region_offset = (index + i) << TARGET_PAGE_BITS;
+ pd[i].region_offset = (index + (target_phys_addr_t)i)
+ << TARGET_PAGE_BITS;
}
}