From: Ding Tianhong dingtianhong@huawei.com
ascend inclusion category: feature bugzilla: NA CVE: NA
-------------------------------------------------
There are too many ascend features enable flag, all of them is used for all ascend soc till now, so use a new enable flag to enable all of them for ascend platform by default, it would clean and simplify the bootargs.
Also clean some code warning.
v2: modify the wrong config name.
v3: modify the wrong include head file.
Signed-off-by: Ding Tianhong dingtianhong@huawei.com Reviewed-by: Zefan Li lizefan@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm64/mm/init.c | 20 ++++++++++++++++++++ drivers/iommu/io-pgfault.c | 2 +- include/linux/iommu.h | 2 ++ include/linux/mm.h | 2 ++ mm/hugetlb.c | 2 +- mm/mmap.c | 2 +- 6 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index e43764db4c3a5..08cc25afd9857 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -40,6 +40,7 @@ #include <linux/mm.h> #include <linux/kexec.h> #include <linux/crash_dump.h> +#include <linux/iommu.h>
#include <asm/boot.h> #include <asm/fixmap.h> @@ -766,6 +767,25 @@ static int __init keepinitrd_setup(char *__unused) __setup("keepinitrd", keepinitrd_setup); #endif
+#ifdef CONFIG_ASCEND_FEATURES +static int __init ascend_enable_setup(char *__unused) +{ + if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP)) + enable_map_dvpp = 1; + + if (IS_ENABLED(CONFIG_ASCEND_IOPF_HIPRI)) + enable_iopf_hipri = 1; + + if (IS_ENABLED(CONFIG_ASCEND_CHARGE_MIGRATE_HUGEPAGES)) + enable_charge_mighp = 1; + + return 1; +} + +__setup("ascend_enable_all", ascend_enable_setup); +#endif + + /* * Dump out memory limit information on panic. */ diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c index 271400633dae8..1029a22441bb0 100644 --- a/drivers/iommu/io-pgfault.c +++ b/drivers/iommu/io-pgfault.c @@ -48,7 +48,7 @@ struct iopf_group { struct work_struct work; };
-static int enable_iopf_hipri __read_mostly; +int enable_iopf_hipri __read_mostly;
static int iopf_complete(struct device *dev, struct iommu_fault_event *evt, enum page_response_code status) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 0af49bd0a6b13..72ff6611b72e3 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1235,4 +1235,6 @@ static inline void __iommu_process_unbind_dev_all(struct iommu_domain *domain,
#endif /* CONFIG_IOMMU_PROCESS */
+extern int enable_iopf_hipri __read_mostly; + #endif /* __LINUX_IOMMU_H */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 794d21255bfc5..369dc740963a4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2868,5 +2868,7 @@ void __init setup_nr_node_ids(void); static inline void setup_nr_node_ids(void) {} #endif
+extern int enable_charge_mighp __read_mostly; + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3460ab634941a..009313824b8c0 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -54,7 +54,7 @@ static struct hstate * __initdata parsed_hstate; static unsigned long __initdata default_hstate_max_huge_pages; static unsigned long __initdata default_hstate_size; static bool __initdata parsed_valid_hugepagesz = true; -static int enable_charge_mighp __read_mostly; +int enable_charge_mighp __read_mostly;
/* * Protects updates to hugepage_freelists, hugepage_activelist, nr_huge_pages, diff --git a/mm/mmap.c b/mm/mmap.c index e1a4d3fa713ec..e8898a241a798 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3747,7 +3747,7 @@ subsys_initcall(init_reserve_notifier); /* * Enable the MAP_32BIT (mmaps and hugetlb). */ -int enable_map_dvpp __read_mostly = 0; +int enable_map_dvpp __read_mostly;
#ifdef CONFIG_ASCEND_DVPP_MMAP