Commit 69be8852 authored by Joerg Roedel's avatar Joerg Roedel

iommu/amd: Ignore page-mode 7 in free_sub_pt()

The page-mode 7 is a special one as it marks a final PTE to
a page with an intermediary size.
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 409afa44
......@@ -1372,6 +1372,7 @@ static struct page *free_sub_pt(unsigned long root, int mode,
{
switch (mode) {
case PAGE_MODE_NONE:
case PAGE_MODE_7_LEVEL:
break;
case PAGE_MODE_1_LEVEL:
freelist = free_pt_page(root, freelist);
......@@ -1403,6 +1404,9 @@ static void free_pagetable(struct protection_domain *domain)
unsigned long root = (unsigned long)domain->pt_root;
struct page *freelist = NULL;
BUG_ON(domain->mode < PAGE_MODE_NONE ||
domain->mode > PAGE_MODE_6_LEVEL);
free_sub_pt(root, domain->mode, freelist);
free_page_list(freelist);
......
......@@ -269,6 +269,7 @@
#define PAGE_MODE_4_LEVEL 0x04
#define PAGE_MODE_5_LEVEL 0x05
#define PAGE_MODE_6_LEVEL 0x06
#define PAGE_MODE_7_LEVEL 0x07
#define PM_LEVEL_SHIFT(x) (12 + ((x) * 9))
#define PM_LEVEL_SIZE(x) (((x) < 6) ? \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment