Commit 3775d481 authored by Dan Carpenter's avatar Dan Carpenter Committed by Joerg Roedel

iommu/amd: fix type bug in flush code

write_file_bool() modifies 32 bits of data, so "amd_iommu_unmap_flush"
needs to be 32 bits as well or we'll corrupt memory.  Fortunately it
looks like the data is aligned with a gap after the declaration so this
is harmless in production.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 68ee6d22
...@@ -404,7 +404,7 @@ static void amd_iommu_stats_init(void) ...@@ -404,7 +404,7 @@ static void amd_iommu_stats_init(void)
return; return;
de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
(u32 *)&amd_iommu_unmap_flush); &amd_iommu_unmap_flush);
amd_iommu_stats_add(&compl_wait); amd_iommu_stats_add(&compl_wait);
amd_iommu_stats_add(&cnt_map_single); amd_iommu_stats_add(&cnt_map_single);
......
...@@ -129,7 +129,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have ...@@ -129,7 +129,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
to handle */ to handle */
LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
we find in ACPI */ we find in ACPI */
bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ u32 amd_iommu_unmap_flush; /* if true, flush on every unmap */
LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
system */ system */
......
...@@ -652,7 +652,7 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap; ...@@ -652,7 +652,7 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap;
* If true, the addresses will be flushed on unmap time, not when * If true, the addresses will be flushed on unmap time, not when
* they are reused * they are reused
*/ */
extern bool amd_iommu_unmap_flush; extern u32 amd_iommu_unmap_flush;
/* Smallest number of PASIDs supported by any IOMMU in the system */ /* Smallest number of PASIDs supported by any IOMMU in the system */
extern u32 amd_iommu_max_pasids; extern u32 amd_iommu_max_pasids;
......
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