diff options
author | Joerg Roedel <jroedel@suse.de> | 2018-11-09 14:07:08 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2018-11-15 18:40:53 +0300 |
commit | 69be88520f9dc56d3ec29d7b7d988f55fd248008 (patch) | |
tree | 5f449f7772fbd2a295adcc004ec751ccdb124dd8 /drivers/iommu/amd_iommu.c | |
parent | 409afa44f9ba1443ef165a9e6d6a9cb5ad6ad176 (diff) | |
download | linux-69be88520f9dc56d3ec29d7b7d988f55fd248008.tar.xz |
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: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 1186571f77e1..49b5d3115e56 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -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); |