提交 0054ee8c 编写于 作者: A Anthony Liguori

Merge remote-tracking branch 'qmp/queue/qmp' into staging

* qmp/queue/qmp:
  monitor: assert monitor_puts()'s loop invariant
  target-i386: fix bits 39:32 of the final physical address when using 4M page
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
...@@ -270,6 +270,7 @@ static void monitor_puts(Monitor *mon, const char *str) ...@@ -270,6 +270,7 @@ static void monitor_puts(Monitor *mon, const char *str)
char c; char c;
for(;;) { for(;;) {
assert(mon->outbuf_index < sizeof(mon->outbuf) - 1);
c = *str++; c = *str++;
if (c == '\0') if (c == '\0')
break; break;
......
...@@ -115,7 +115,7 @@ static void walk_pde2(MemoryMappingList *list, ...@@ -115,7 +115,7 @@ static void walk_pde2(MemoryMappingList *list,
hwaddr pde_start_addr, int32_t a20_mask, hwaddr pde_start_addr, int32_t a20_mask,
bool pse) bool pse)
{ {
hwaddr pde_addr, pte_start_addr, start_paddr; hwaddr pde_addr, pte_start_addr, start_paddr, high_paddr;
uint32_t pde; uint32_t pde;
target_ulong line_addr, start_vaddr; target_ulong line_addr, start_vaddr;
int i; int i;
...@@ -130,8 +130,13 @@ static void walk_pde2(MemoryMappingList *list, ...@@ -130,8 +130,13 @@ static void walk_pde2(MemoryMappingList *list,
line_addr = (((unsigned int)i & 0x3ff) << 22); line_addr = (((unsigned int)i & 0x3ff) << 22);
if ((pde & PG_PSE_MASK) && pse) { if ((pde & PG_PSE_MASK) && pse) {
/* 4 MB page */ /*
start_paddr = (pde & ~0x3fffff) | ((pde & 0x1fe000) << 19); * 4 MB page:
* bits 39:32 are bits 20:13 of the PDE
* bit3 31:22 are bits 31:22 of the PDE
*/
high_paddr = ((hwaddr)(pde & 0x1fe000) << 19);
start_paddr = (pde & ~0x3fffff) | high_paddr;
if (cpu_physical_memory_is_io(start_paddr)) { if (cpu_physical_memory_is_io(start_paddr)) {
/* I/O region */ /* I/O region */
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册