From 342049dccae6590ee3346a9db2785540a4ea3788 Mon Sep 17 00:00:00 2001 From: Ding Tianhong Date: Mon, 31 Aug 2020 20:41:34 +0800 Subject: [PATCH] arm64/ascend: use ascend_enable_full to enable ascend platform 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 Reviewed-by: Zefan Li Signed-off-by: Yang Yingliang --- 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 e43764db4c3a..08cc25afd985 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -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 271400633dae..1029a22441bb 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 e6ffd426e267..c5cc3c9e393c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1125,4 +1125,6 @@ void iommu_debugfs_setup(void); static inline void iommu_debugfs_setup(void) {} #endif +extern int enable_iopf_hipri __read_mostly; + #endif /* __LINUX_IOMMU_H */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 2749c4232d49..3e6acf829f5d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2856,5 +2856,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 41a1be919f84..0d0961a65d3e 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 e1a4d3fa713e..e8898a241a79 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 -- GitLab