diff options
Diffstat (limited to 'hw/i386/amd_iommu.c')
-rw-r--r-- | hw/i386/amd_iommu.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 9dd9b0e..ea8eaeb 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -913,7 +913,7 @@ static void amdvi_page_walk(AMDVIAddressSpace *as, uint64_t *dte, } /* we are at the leaf page table or page table encodes a huge page */ - while (level > 0) { + do { pte_perms = amdvi_get_perms(pte); present = pte & 1; if (!present || perms != (perms & pte_perms)) { @@ -932,10 +932,7 @@ static void amdvi_page_walk(AMDVIAddressSpace *as, uint64_t *dte, } oldlevel = level; level = get_pte_translation_mode(pte); - if (level == 0x7) { - break; - } - } + } while (level > 0 && level < 7); if (level == 0x7) { page_mask = pte_override_page_mask(pte); |