]> git.proxmox.com Git - qemu.git/commitdiff
target-i386: Fix mask of pte index in memory mapping
authorQiao Nuohan <qiaonuohan@cn.fujitsu.com>
Thu, 30 May 2013 15:07:54 +0000 (17:07 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 31 May 2013 13:02:31 +0000 (09:02 -0400)
Function walk_pte() needs pte index to calculate virtual address.
However, pte index of PAE paging or IA-32e paging is 9 bit, so the mask
should be 0x1ff.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Reviewed-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
target-i386/arch_memory_mapping.c

index 24884bd482ddcbf1ba243fb031e82f6c0e45ae21..5096fbdf443681d17d6d0a799bb4eab80145c900 100644 (file)
@@ -38,7 +38,7 @@ static void walk_pte(MemoryMappingList *list, hwaddr pte_start_addr,
             continue;
         }
 
-        start_vaddr = start_line_addr | ((i & 0x1fff) << 12);
+        start_vaddr = start_line_addr | ((i & 0x1ff) << 12);
         memory_mapping_list_add_merge_sorted(list, start_paddr,
                                              start_vaddr, 1 << 12);
     }