Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG
--------------------------------
It works well if these include headers are cleaned up.
Signed-off-by: Gu Zitao guzitao@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/chip/chip3/chip.c | 6 +---- arch/sw_64/chip/chip3/cpufreq_debugfs.c | 7 +---- arch/sw_64/chip/chip3/i2c-lib.c | 4 --- arch/sw_64/chip/chip3/irq_chip.c | 13 +--------- arch/sw_64/chip/chip3/msi.c | 7 +---- arch/sw_64/chip/chip3/pci-quirks.c | 3 +-- arch/sw_64/chip/chip3/vt_msi.c | 6 ----- arch/sw_64/kernel/acpi.c | 19 +------------- arch/sw_64/kernel/asm-offsets.c | 7 +++-- arch/sw_64/kernel/audit.c | 2 +- arch/sw_64/kernel/cacheinfo.c | 3 +-- arch/sw_64/kernel/core.c | 18 ------------- arch/sw_64/kernel/crash_dump.c | 2 -- arch/sw_64/kernel/dup_print.c | 5 +--- arch/sw_64/kernel/early_printk.c | 4 +-- arch/sw_64/kernel/ftrace.c | 5 ---- arch/sw_64/kernel/insn.c | 13 ---------- arch/sw_64/kernel/irq.c | 15 ----------- arch/sw_64/kernel/irq_sw64.c | 9 +------ arch/sw_64/kernel/jump_label.c | 3 +-- arch/sw_64/kernel/kgdb.c | 3 --- arch/sw_64/kernel/kprobes/decode-insn.c | 6 +---- arch/sw_64/kernel/kprobes/kprobes.c | 4 --- arch/sw_64/kernel/kvm_cma.c | 4 --- arch/sw_64/kernel/machine_kexec.c | 7 +---- arch/sw_64/kernel/module.c | 5 ---- arch/sw_64/kernel/msi.c | 7 ----- arch/sw_64/kernel/pci-noop.c | 8 ------ arch/sw_64/kernel/pci-sysfs.c | 3 --- arch/sw_64/kernel/pci.c | 13 +--------- arch/sw_64/kernel/pci_common.c | 11 -------- arch/sw_64/kernel/perf_event.c | 12 --------- arch/sw_64/kernel/perf_regs.c | 4 --- arch/sw_64/kernel/process.c | 26 ------------------- arch/sw_64/kernel/ptrace.c | 15 +---------- arch/sw_64/kernel/relocate.c | 13 ++-------- arch/sw_64/kernel/segvdbg.c | 4 +-- arch/sw_64/kernel/setup.c | 34 +------------------------ arch/sw_64/kernel/signal.c | 14 ---------- arch/sw_64/kernel/smp.c | 25 +----------------- arch/sw_64/kernel/stacktrace.c | 1 - arch/sw_64/kernel/suspend.c | 12 +-------- arch/sw_64/kernel/tc.c | 3 --- arch/sw_64/kernel/time.c | 27 ++------------------ arch/sw_64/kernel/timer.c | 13 +--------- arch/sw_64/kernel/topology.c | 13 ---------- arch/sw_64/kernel/traps.c | 13 ---------- arch/sw_64/kernel/unaligned.c | 3 --- arch/sw_64/kernel/uprobes.c | 5 ---- arch/sw_64/kernel/vdso.c | 9 ------- arch/sw_64/kernel/vdso/vdso.S | 2 -- arch/sw_64/kernel/vdso/vgettimeofday.c | 3 +-- arch/sw_64/kvm/kvm-sw64.c | 13 ---------- arch/sw_64/lib/fls.c | 1 - arch/sw_64/lib/iomap.c | 4 +-- arch/sw_64/lib/udelay.c | 5 ---- arch/sw_64/math-emu/math.c | 10 +++----- arch/sw_64/mm/fault.c | 21 ++------------- arch/sw_64/mm/hugetlbpage.c | 7 +---- arch/sw_64/mm/init.c | 23 ----------------- arch/sw_64/mm/numa.c | 16 ------------ arch/sw_64/mm/physaddr.c | 1 - arch/sw_64/mm/thp.c | 9 ------- 63 files changed, 36 insertions(+), 547 deletions(-)
diff --git a/arch/sw_64/chip/chip3/chip.c b/arch/sw_64/chip/chip3/chip.c index 6c84f4d62e4e..bd20e262e609 100644 --- a/arch/sw_64/chip/chip3/chip.c +++ b/arch/sw_64/chip/chip3/chip.c @@ -1,16 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/pci.h> -#include <linux/seq_file.h> #include <linux/clocksource.h> -#include <linux/msi.h> -#include <linux/delay.h> + #include <asm/sw64_init.h> #include <asm/sw64io.h> #include <asm/pci.h> -#include <asm/core.h> #include <asm/irq_impl.h> #include <asm/wrperfmon.h> -#include <asm/hw_init.h> #include "../../../../drivers/pci/pci.h"
static u64 read_longtime(struct clocksource *cs) diff --git a/arch/sw_64/chip/chip3/cpufreq_debugfs.c b/arch/sw_64/chip/chip3/cpufreq_debugfs.c index 3b152f84454f..13696360ef02 100644 --- a/arch/sw_64/chip/chip3/cpufreq_debugfs.c +++ b/arch/sw_64/chip/chip3/cpufreq_debugfs.c @@ -1,15 +1,10 @@ // SPDX-License-Identifier: GPL-2.0
#include <linux/debugfs.h> -#include <linux/list.h> -#include <linux/kernel.h> -#include <linux/slab.h> -#include <linux/mm_types.h> #include <linux/delay.h> #include <linux/uaccess.h> -#include <linux/mm.h> + #include <asm/sw64io.h> -#include <asm/hw_init.h> #include <asm/debug.h>
#define CLK_PRT 0x1UL diff --git a/arch/sw_64/chip/chip3/i2c-lib.c b/arch/sw_64/chip/chip3/i2c-lib.c index 581f2b3d81a1..ddf0a187ab5a 100644 --- a/arch/sw_64/chip/chip3/i2c-lib.c +++ b/arch/sw_64/chip/chip3/i2c-lib.c @@ -14,14 +14,10 @@ * of the interrupt mode. */
-#include <linux/module.h> -#include <linux/kernel.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/fb.h> -#include <linux/init.h> -#include <linux/device.h>
#define CPLD_BUSNR 2
diff --git a/arch/sw_64/chip/chip3/irq_chip.c b/arch/sw_64/chip/chip3/irq_chip.c index ee43e87c554b..24dfa1e1a898 100644 --- a/arch/sw_64/chip/chip3/irq_chip.c +++ b/arch/sw_64/chip/chip3/irq_chip.c @@ -1,18 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/platform_device.h> -#include <linux/string.h> -#include <linux/types.h> -#include <linux/string.h> -#include <linux/i2c.h> -#include <linux/interrupt.h> -#include <linux/module.h> -#include <linux/of.h> #include <linux/irqdomain.h> #include <linux/irqchip.h> -#include <asm/irq.h> -#include <asm/sw64io.h> + #include <asm/irq_impl.h>
static void fake_irq_mask(struct irq_data *data) diff --git a/arch/sw_64/chip/chip3/msi.c b/arch/sw_64/chip/chip3/msi.c index 0c6d415e082e..43688c96ccab 100644 --- a/arch/sw_64/chip/chip3/msi.c +++ b/arch/sw_64/chip/chip3/msi.c @@ -1,15 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/pci.h> -#include <linux/irq.h> -#include <linux/kernel.h> -#include <linux/cpumask.h> #include <linux/module.h> #include <linux/msi.h> #include <linux/irqdomain.h> + #include <asm/irq_impl.h> -#include <asm/msi.h> -#include <asm/pci.h> -#include <asm/sw64io.h>
static struct irq_domain *msi_default_domain; static DEFINE_RAW_SPINLOCK(vector_lock); diff --git a/arch/sw_64/chip/chip3/pci-quirks.c b/arch/sw_64/chip/chip3/pci-quirks.c index e70c211df68f..9043e56f9092 100644 --- a/arch/sw_64/chip/chip3/pci-quirks.c +++ b/arch/sw_64/chip/chip3/pci-quirks.c @@ -1,9 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/pci.h> #include <linux/delay.h> -#include <asm/pci.h> + #include <asm/sw64io.h> -#include <asm/hw_init.h>
static int handshake(void __iomem *ptr, u32 mask, u32 done, int wait_usec, int delay_usec) diff --git a/arch/sw_64/chip/chip3/vt_msi.c b/arch/sw_64/chip/chip3/vt_msi.c index 31f49d3c3511..428757642342 100644 --- a/arch/sw_64/chip/chip3/vt_msi.c +++ b/arch/sw_64/chip/chip3/vt_msi.c @@ -1,14 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/pci.h> #include <linux/irq.h> -#include <linux/kernel.h> -#include <linux/cpumask.h> #include <linux/module.h> #include <linux/msi.h> -#include <asm/irq_impl.h> -#include <asm/msi.h> -#include <asm/pci.h> -#include <asm/sw64io.h>
#define QEMU_MSIX_MSG_ADDR (0x8000fee00000UL)
diff --git a/arch/sw_64/kernel/acpi.c b/arch/sw_64/kernel/acpi.c index 1c1afe8e812e..a0b5c4a57a07 100644 --- a/arch/sw_64/kernel/acpi.c +++ b/arch/sw_64/kernel/acpi.c @@ -2,25 +2,8 @@
#include <linux/init.h> #include <linux/acpi.h> -#include <linux/acpi_pmtmr.h> -#include <linux/efi.h> -#include <linux/stddef.h> -#include <linux/cpumask.h> -#include <linux/module.h> -#include <linux/dmi.h> -#include <linux/irq.h> #include <linux/irqdomain.h> -#include <linux/slab.h> -#include <linux/ioport.h> -#include <linux/pci.h> -#include <linux/memblock.h> -#include <acpi/actbl.h> -#include <acpi/actbl2.h> - -#include <asm/pgtable.h> -#include <asm/io.h> -#include <asm/smp.h> -#include <asm/numa.h> + #include <asm/early_ioremap.h>
int acpi_disabled = 1; diff --git a/arch/sw_64/kernel/asm-offsets.c b/arch/sw_64/kernel/asm-offsets.c index 44e7fa77265e..bea12d2d96fe 100644 --- a/arch/sw_64/kernel/asm-offsets.c +++ b/arch/sw_64/kernel/asm-offsets.c @@ -5,17 +5,16 @@ * and format the required data. */
-#include <linux/types.h> #include <linux/stddef.h> #include <linux/sched.h> -#include <linux/ptrace.h> #include <linux/kbuild.h> #include <linux/suspend.h> -#include <asm/io.h> + #include <asm/suspend.h> +#include <asm/kvm.h> + #include "traps.c"
-#include <asm/kvm.h> void foo(void) { DEFINE(TI_TASK, offsetof(struct thread_info, task)); diff --git a/arch/sw_64/kernel/audit.c b/arch/sw_64/kernel/audit.c index adc4622211d2..dcf58deee3e2 100644 --- a/arch/sw_64/kernel/audit.c +++ b/arch/sw_64/kernel/audit.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/init.h> -#include <linux/types.h> #include <linux/audit.h> + #include <asm/unistd.h>
static unsigned int dir_class[] = { diff --git a/arch/sw_64/kernel/cacheinfo.c b/arch/sw_64/kernel/cacheinfo.c index 5193d7544b59..87d3f4bcd10f 100644 --- a/arch/sw_64/kernel/cacheinfo.c +++ b/arch/sw_64/kernel/cacheinfo.c @@ -14,9 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -#include <linux/arch_topology.h> #include <linux/cacheinfo.h> -#include <asm/hw_init.h> + #include <asm/topology.h>
/* Populates leaf and increments to next leaf */ diff --git a/arch/sw_64/kernel/core.c b/arch/sw_64/kernel/core.c index 4d440de68aae..e26b3a5faab2 100644 --- a/arch/sw_64/kernel/core.c +++ b/arch/sw_64/kernel/core.c @@ -1,24 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/types.h> -#include <linux/pci.h> -#include <linux/sched.h> -#include <linux/init.h> -#include <linux/irq.h> #include <linux/memblock.h> -#include <linux/pfn.h> -#include <linux/export.h> -#include <asm/core.h> -#include <asm/tlbflush.h> -#include <asm/smp.h> -#include <asm/compiler.h> -#include <asm/mmu_context.h> -#include <asm/bitops.h> -#include <asm/sw64_init.h> -#include <asm/hw_init.h> -#ifdef CONFIG_NUMA -#include <asm/memory.h> -#endif -#include "pci_impl.h"
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_NUMA diff --git a/arch/sw_64/kernel/crash_dump.c b/arch/sw_64/kernel/crash_dump.c index f3836afe3e25..4484673823b8 100644 --- a/arch/sw_64/kernel/crash_dump.c +++ b/arch/sw_64/kernel/crash_dump.c @@ -14,8 +14,6 @@ * published by the Free Software Foundation. */
-#include <linux/errno.h> -#include <linux/crash_dump.h> #include <linux/uaccess.h> #include <linux/io.h>
diff --git a/arch/sw_64/kernel/dup_print.c b/arch/sw_64/kernel/dup_print.c index e1c05cfa864b..1aa7710b5092 100644 --- a/arch/sw_64/kernel/dup_print.c +++ b/arch/sw_64/kernel/dup_print.c @@ -1,11 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 -#include <linux/kernel.h> #include <linux/mm.h> -#include <linux/init.h> #include <linux/smp.h> -#include <linux/delay.h> #include <linux/spinlock.h> -#include <linux/uaccess.h> + #include <asm/chip3_io.h>
#ifdef CONFIG_SW64_RRK diff --git a/arch/sw_64/kernel/early_printk.c b/arch/sw_64/kernel/early_printk.c index f4d5f2d5c876..62902175217a 100644 --- a/arch/sw_64/kernel/early_printk.c +++ b/arch/sw_64/kernel/early_printk.c @@ -1,9 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/console.h> #include <linux/kernel.h> -#include <linux/init.h> -#include <linux/string.h> -#include <linux/errno.h> + #include <asm/io.h>
static unsigned long early_serial_base; /* ttyS0 */ diff --git a/arch/sw_64/kernel/ftrace.c b/arch/sw_64/kernel/ftrace.c index 413562b5d9be..42efca28d386 100644 --- a/arch/sw_64/kernel/ftrace.c +++ b/arch/sw_64/kernel/ftrace.c @@ -10,13 +10,8 @@ */
#include <linux/ftrace.h> -#include <linux/module.h> -#include <linux/swab.h> -#include <linux/uaccess.h>
-#include <asm/cacheflush.h> #include <asm/ftrace.h> -#include <asm/insn.h>
#ifdef CONFIG_FUNCTION_TRACER EXPORT_SYMBOL(_mcount); diff --git a/arch/sw_64/kernel/insn.c b/arch/sw_64/kernel/insn.c index 71d3832d1fe3..e8dd41b6b7c4 100644 --- a/arch/sw_64/kernel/insn.c +++ b/arch/sw_64/kernel/insn.c @@ -14,22 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -#include <linux/bitops.h> -#include <linux/bug.h> -#include <linux/compiler.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/smp.h> #include <linux/spinlock.h> -#include <linux/stop_machine.h> -#include <linux/types.h> -#include <linux/uaccess.h> #include <linux/kprobes.h>
-#include <asm/cacheflush.h> -#include <asm/insn.h> - - //static DEFINE_RAW_SPINLOCK(patch_lock);
int __kprobes sw64_insn_read(void *addr, u32 *insnp) diff --git a/arch/sw_64/kernel/irq.c b/arch/sw_64/kernel/irq.c index 6cd26af15b23..126fe2f70495 100644 --- a/arch/sw_64/kernel/irq.c +++ b/arch/sw_64/kernel/irq.c @@ -12,24 +12,9 @@ */
#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/errno.h> -#include <linux/kernel_stat.h> -#include <linux/signal.h> -#include <linux/sched.h> -#include <linux/ptrace.h> #include <linux/interrupt.h> -#include <linux/random.h> #include <linux/irq.h> -#include <linux/proc_fs.h> #include <linux/seq_file.h> -#include <linux/profile.h> -#include <linux/bitops.h> -#include <linux/uaccess.h> - -#include <asm/hw_init.h> -#include <asm/hardirq.h> -#include <asm/io.h>
volatile unsigned long irq_err_count; DEFINE_PER_CPU(unsigned long, irq_pmi_count); diff --git a/arch/sw_64/kernel/irq_sw64.c b/arch/sw_64/kernel/irq_sw64.c index 376e8397ba35..8ab845d153eb 100644 --- a/arch/sw_64/kernel/irq_sw64.c +++ b/arch/sw_64/kernel/irq_sw64.c @@ -3,18 +3,11 @@ * SW64 specific irq code. */
-#include <linux/sched.h> #include <linux/irq.h> -#include <linux/kernel_stat.h> -#include <linux/module.h> #include <linux/irqchip.h> -#include <linux/irqdesc.h> -#include <linux/irqdomain.h> + #include <asm/dma.h> #include <asm/irq_impl.h> -#include <asm/core.h> -#include <asm/perf_event.h> -#include <asm/hmcall.h>
asmlinkage void do_entInt(unsigned long type, unsigned long vector, diff --git a/arch/sw_64/kernel/jump_label.c b/arch/sw_64/kernel/jump_label.c index a67d16eb3076..f3bc40370e4d 100644 --- a/arch/sw_64/kernel/jump_label.c +++ b/arch/sw_64/kernel/jump_label.c @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0
-#include <linux/kernel.h> #include <linux/jump_label.h> -#include <asm/insn.h> + #include <asm/bug.h> #include <asm/cacheflush.h>
diff --git a/arch/sw_64/kernel/kgdb.c b/arch/sw_64/kernel/kgdb.c index c1100ef8fcdd..09e9ca7a0303 100644 --- a/arch/sw_64/kernel/kgdb.c +++ b/arch/sw_64/kernel/kgdb.c @@ -20,11 +20,8 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */
-#include <linux/irq.h> #include <linux/kdebug.h> #include <linux/kgdb.h> -#include <linux/uaccess.h> -#include <asm/cacheflush.h>
struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = { { "r0", 8, offsetof(struct pt_regs, r0)}, diff --git a/arch/sw_64/kernel/kprobes/decode-insn.c b/arch/sw_64/kernel/kprobes/decode-insn.c index e3ab856d6084..d376a7e2bee4 100644 --- a/arch/sw_64/kernel/kprobes/decode-insn.c +++ b/arch/sw_64/kernel/kprobes/decode-insn.c @@ -12,12 +12,8 @@ * General Public License for more details. */
-#include <linux/kernel.h> #include <linux/kprobes.h> -#include <linux/module.h> -#include <linux/kallsyms.h> -#include <asm/insn.h> -#include <asm/sections.h> + #include "common.h"
static bool __kprobes sw64_insn_is_steppable(u32 insn) diff --git a/arch/sw_64/kernel/kprobes/kprobes.c b/arch/sw_64/kernel/kprobes/kprobes.c index 85400f96f991..59f040eaa3e1 100644 --- a/arch/sw_64/kernel/kprobes/kprobes.c +++ b/arch/sw_64/kernel/kprobes/kprobes.c @@ -5,13 +5,9 @@ */
#include <linux/kprobes.h> -#include <linux/preempt.h> -#include <linux/uaccess.h> #include <linux/kdebug.h> #include <linux/slab.h>
-#include <asm/ptrace.h> -#include <asm/insn.h> #include "common.h"
static u32 breakpoint_insn = BREAK_KPROBE; diff --git a/arch/sw_64/kernel/kvm_cma.c b/arch/sw_64/kernel/kvm_cma.c index dc61e2e369e8..054dec95b996 100644 --- a/arch/sw_64/kernel/kvm_cma.c +++ b/arch/sw_64/kernel/kvm_cma.c @@ -10,12 +10,8 @@
#include <linux/memblock.h> #include <linux/err.h> -#include <linux/mm.h> #include <linux/sizes.h> #include <linux/slab.h> -#include <linux/log2.h> -#include <linux/highmem.h> -#include <linux/io.h> #include <linux/cma.h> #include <linux/page-isolation.h>
diff --git a/arch/sw_64/kernel/machine_kexec.c b/arch/sw_64/kernel/machine_kexec.c index c778bc1374af..c9ca7a728bd4 100644 --- a/arch/sw_64/kernel/machine_kexec.c +++ b/arch/sw_64/kernel/machine_kexec.c @@ -5,18 +5,13 @@ * This source code is licensed under the GNU General Public License, * Version 2. See the file COPYING for more details. */ -#include <linux/compiler.h> #include <linux/kexec.h> #include <linux/mm.h> -#include <linux/device.h> #include <linux/delay.h> #include <linux/irq.h> #include <linux/reboot.h> + #include <asm/cacheflush.h> -#include <asm/page.h> -#include <asm/io.h> -#include <linux/cpu.h> -#include <linux/smp.h>
extern void *kexec_control_page; extern const unsigned char relocate_new_kernel[]; diff --git a/arch/sw_64/kernel/module.c b/arch/sw_64/kernel/module.c index d2041afba7bb..2904bb750eb5 100644 --- a/arch/sw_64/kernel/module.c +++ b/arch/sw_64/kernel/module.c @@ -1,10 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/moduleloader.h> -#include <linux/elf.h> -#include <linux/vmalloc.h> -#include <linux/fs.h> -#include <linux/string.h> -#include <linux/kernel.h> #include <linux/slab.h>
#define DEBUGP(fmt...) diff --git a/arch/sw_64/kernel/msi.c b/arch/sw_64/kernel/msi.c index d942a688a324..ee1bda3c6447 100644 --- a/arch/sw_64/kernel/msi.c +++ b/arch/sw_64/kernel/msi.c @@ -1,14 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/module.h> #include <linux/irq.h> -#include <linux/kernel.h> #include <linux/msi.h> -#include <linux/pci.h> -#include <linux/cpumask.h> -#include <asm/sw64io.h> -#include <asm/msi.h> -#include <asm/pci.h> -
int msi_compose_msg(unsigned int irq, struct msi_msg *msg) { diff --git a/arch/sw_64/kernel/pci-noop.c b/arch/sw_64/kernel/pci-noop.c index 4ef694e629e8..a0aa2e5bb675 100644 --- a/arch/sw_64/kernel/pci-noop.c +++ b/arch/sw_64/kernel/pci-noop.c @@ -6,16 +6,8 @@ */
#include <linux/pci.h> -#include <linux/init.h> #include <linux/memblock.h> -#include <linux/gfp.h> -#include <linux/capability.h> -#include <linux/mm.h> -#include <linux/errno.h> -#include <linux/sched.h> #include <linux/dma-mapping.h> -#include <linux/scatterlist.h> -#include <linux/module.h>
/* * The PCI controller list. diff --git a/arch/sw_64/kernel/pci-sysfs.c b/arch/sw_64/kernel/pci-sysfs.c index 584243922df9..504fd4a00754 100644 --- a/arch/sw_64/kernel/pci-sysfs.c +++ b/arch/sw_64/kernel/pci-sysfs.c @@ -10,9 +10,6 @@ * drivers/pci/pci-sysfs.c */
-#include <linux/sched.h> -#include <linux/stat.h> -#include <linux/slab.h> #include <linux/pci.h>
static int hose_mmap_page_range(struct pci_controller *hose, diff --git a/arch/sw_64/kernel/pci.c b/arch/sw_64/kernel/pci.c index d42f0d0aec92..fb7b071c10f6 100644 --- a/arch/sw_64/kernel/pci.c +++ b/arch/sw_64/kernel/pci.c @@ -1,22 +1,11 @@ // SPDX-License-Identifier: GPL-2.0 -#include <linux/string.h> #include <linux/pci.h> #include <linux/acpi.h> #include <linux/init.h> -#include <linux/ioport.h> -#include <linux/kernel.h> #include <linux/memblock.h> -#include <linux/module.h> -#include <linux/cache.h> -#include <linux/slab.h> -#include <linux/msi.h> -#include <linux/irq.h> -#include <asm/msi.h> -#include <linux/delay.h> #include <linux/syscore_ops.h> -#include <linux/platform_device.h> + #include <asm/sw64_init.h> -#include <asm/pci.h>
#include "pci_impl.h"
diff --git a/arch/sw_64/kernel/pci_common.c b/arch/sw_64/kernel/pci_common.c index f6316ca507a2..f996baca9d93 100644 --- a/arch/sw_64/kernel/pci_common.c +++ b/arch/sw_64/kernel/pci_common.c @@ -3,22 +3,11 @@ * linux/arch/sw_64/kernel/pci_iommu.c */
-#include <linux/kernel.h> -#include <linux/mm.h> #include <linux/pci.h> -#include <linux/gfp.h> -#include <linux/memblock.h> #include <linux/export.h> -#include <linux/scatterlist.h> -#include <linux/log2.h> #include <linux/dma-mapping.h> -#include <linux/iommu-helper.h> -#include <linux/slab.h> #include <linux/dma-direct.h> #include <linux/swiotlb.h> -#include <linux/cache.h> -#include <linux/module.h> -#include <asm/dma.h>
static dma_addr_t sw64_direct_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, diff --git a/arch/sw_64/kernel/perf_event.c b/arch/sw_64/kernel/perf_event.c index dac979d4b09a..d2975e17f666 100644 --- a/arch/sw_64/kernel/perf_event.c +++ b/arch/sw_64/kernel/perf_event.c @@ -6,18 +6,6 @@ */
#include <linux/perf_event.h> -#include <linux/kprobes.h> -#include <linux/kernel.h> -#include <linux/kdebug.h> -#include <linux/mutex.h> -#include <linux/init.h> -#include <linux/uaccess.h> - -#include <linux/atomic.h> -#include <asm/irq.h> -#include <asm/irq_regs.h> -#include <asm/hmcall.h> -#include <asm/hw_irq.h>
/* For tracking PMCs and the hw events they monitor on each CPU. */ struct cpu_hw_events { diff --git a/arch/sw_64/kernel/perf_regs.c b/arch/sw_64/kernel/perf_regs.c index 8eec2179eb86..4c12a2cdf912 100644 --- a/arch/sw_64/kernel/perf_regs.c +++ b/arch/sw_64/kernel/perf_regs.c @@ -1,11 +1,7 @@ // SPDX-License-Identifier: GPL-2.0
#include <linux/errno.h> -#include <linux/kernel.h> #include <linux/perf_event.h> -#include <linux/bug.h> -#include <linux/perf_regs.h> -#include <asm/ptrace.h>
u64 perf_reg_value(struct pt_regs *regs, int idx) { diff --git a/arch/sw_64/kernel/process.c b/arch/sw_64/kernel/process.c index 8fd493776bec..4192d50f5b0e 100644 --- a/arch/sw_64/kernel/process.c +++ b/arch/sw_64/kernel/process.c @@ -3,42 +3,16 @@ * This file handles the architecture-dependent parts of process handling. */
-#include <linux/errno.h> -#include <linux/module.h> -#include <linux/sched.h> #include <linux/sched/debug.h> -#include <linux/sched/task.h> -#include <linux/sched/task_stack.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/smp.h> -#include <linux/stddef.h> -#include <linux/unistd.h> #include <linux/ptrace.h> -#include <linux/user.h> -#include <linux/time.h> -#include <linux/major.h> -#include <linux/stat.h> -#include <linux/vt.h> -#include <linux/mman.h> #include <linux/elfcore.h> #include <linux/reboot.h> -#include <linux/tty.h> -#include <linux/console.h> #include <linux/slab.h> -#include <linux/rcupdate.h> -#include <linux/tick.h> #include <linux/random.h> -#include <linux/uaccess.h>
-#include <asm/reg.h> -#include <asm/io.h> -#include <asm/pgtable.h> #include <asm/fpu.h> -#include <asm/hcall.h>
#include "proto.h" -#include "pci_impl.h"
/* * Power off function, if any diff --git a/arch/sw_64/kernel/ptrace.c b/arch/sw_64/kernel/ptrace.c index ede3c1053d81..649572bbe613 100644 --- a/arch/sw_64/kernel/ptrace.c +++ b/arch/sw_64/kernel/ptrace.c @@ -5,24 +5,11 @@ /* mangled further by Bob Manson (manson@santafe.edu) */ /* more mutilation by David Mosberger (davidm@azstarnet.com) */
-#include <linux/kernel.h> -#include <linux/sched.h> -#include <linux/mm.h> -#include <linux/smp.h> -#include <linux/errno.h> -#include <linux/ptrace.h> -#include <linux/user.h> -#include <linux/security.h> -#include <linux/signal.h> #include <linux/tracehook.h> -#include <linux/seccomp.h> #include <linux/audit.h> -#include <linux/uaccess.h>
-#include <asm/pgtable.h> -#include <asm/fpu.h> -#include <asm/core.h> #include <asm/reg.h> + #include "proto.h"
#define CREATE_TRACE_POINTS diff --git a/arch/sw_64/kernel/relocate.c b/arch/sw_64/kernel/relocate.c index 36b16d84d5ab..fe403f9c70c7 100644 --- a/arch/sw_64/kernel/relocate.c +++ b/arch/sw_64/kernel/relocate.c @@ -9,21 +9,12 @@ * Copyright (C) 2019 He Sheng * Authors: He Sheng (hesheng05@gmail.com) */ -#include <asm/hmcall.h> -#include <asm/setup.h> -#include <asm/sections.h> -#include <linux/mm_types.h> #include <linux/elf.h> -#include <linux/kernel.h> -#include <linux/libfdt.h> -#include <linux/of_fdt.h> -#include <linux/sched.h> -#include <linux/start_kernel.h> -#include <linux/string.h> -#include <linux/printk.h> #include <linux/notifier.h> #include <linux/mm.h>
+#include <asm/sections.h> + #define INITRD_ADDR 0x3000000UL #define KTEXT_MAX 0xffffffffa0000000UL #define RELOCATED(x) ((void *)((unsigned long)x + offset)) diff --git a/arch/sw_64/kernel/segvdbg.c b/arch/sw_64/kernel/segvdbg.c index aee4b3863072..5b8a638bf8b9 100644 --- a/arch/sw_64/kernel/segvdbg.c +++ b/arch/sw_64/kernel/segvdbg.c @@ -9,9 +9,7 @@ */
#include <linux/kernel.h> -#include <linux/debugfs.h> -#include <linux/seq_file.h> -#include <linux/uaccess.h> + #include <asm/debug.h>
extern bool segv_debug_enabled; diff --git a/arch/sw_64/kernel/setup.c b/arch/sw_64/kernel/setup.c index 61b498e65e4b..2de954a3c086 100644 --- a/arch/sw_64/kernel/setup.c +++ b/arch/sw_64/kernel/setup.c @@ -9,31 +9,13 @@ * Bootup setup stuff. */
-#include <linux/sched.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <linux/stddef.h> -#include <linux/unistd.h> -#include <linux/ptrace.h> -#include <linux/slab.h> -#include <linux/user.h> #include <linux/screen_info.h> #include <linux/delay.h> #include <linux/kexec.h> #include <linux/console.h> -#include <linux/cpu.h> -#include <linux/errno.h> -#include <linux/init.h> -#include <linux/string.h> -#include <linux/ioport.h> -#include <linux/platform_device.h> #include <linux/memblock.h> -#include <linux/pci.h> -#include <linux/seq_file.h> #include <linux/root_dev.h> #include <linux/initrd.h> -#include <linux/eisa.h> -#include <linux/pfn.h> #ifdef CONFIG_MAGIC_SYSRQ #include <linux/sysrq.h> #include <linux/reboot.h> @@ -41,26 +23,12 @@ #ifdef CONFIG_DEBUG_FS #include <linux/debugfs.h> #endif -#include <linux/notifier.h> -#include <linux/log2.h> -#include <linux/export.h> #include <linux/of_fdt.h> #include <linux/of_platform.h> -#include <linux/uaccess.h> -#include <linux/cma.h> #include <linux/genalloc.h> #include <linux/acpi.h> -#include <asm/setup.h> -#include <asm/smp.h> + #include <asm/sw64_init.h> -#include <asm/pgtable.h> -#include <asm/dma.h> -#include <asm/mmu_context.h> -#include <asm/console.h> -#include <asm/core.h> -#include <asm/hw_init.h> -#include <asm/mmzone.h> -#include <asm/memory.h> #include <asm/efi.h> #include <asm/kvm_cma.h>
diff --git a/arch/sw_64/kernel/signal.c b/arch/sw_64/kernel/signal.c index 74e98063c874..f7b8d391251a 100644 --- a/arch/sw_64/kernel/signal.c +++ b/arch/sw_64/kernel/signal.c @@ -7,24 +7,10 @@ * 1997-11-02 Modified for POSIX.1b signals by Richard Henderson */
-#include <linux/sched.h> -#include <linux/kernel.h> #include <linux/signal.h> #include <linux/errno.h> -#include <linux/wait.h> -#include <linux/ptrace.h> -#include <linux/unistd.h> -#include <linux/mm.h> -#include <linux/smp.h> -#include <linux/stddef.h> -#include <linux/tty.h> -#include <linux/binfmts.h> -#include <linux/bitops.h> -#include <linux/syscalls.h> #include <linux/tracehook.h> -#include <linux/uaccess.h>
-#include <asm/sigcontext.h> #include <asm/ucontext.h> #include <asm/vdso.h>
diff --git a/arch/sw_64/kernel/smp.c b/arch/sw_64/kernel/smp.c index 7d9c5c90f1ac..fb915d166069 100644 --- a/arch/sw_64/kernel/smp.c +++ b/arch/sw_64/kernel/smp.c @@ -4,41 +4,18 @@ */
#include <linux/errno.h> -#include <linux/kernel.h> -#include <linux/kernel_stat.h> -#include <linux/module.h> #include <linux/sched/mm.h> #include <linux/sched/hotplug.h> -#include <linux/mm.h> -#include <linux/err.h> -#include <linux/threads.h> #include <linux/smp.h> -#include <linux/interrupt.h> -#include <linux/init.h> #include <linux/delay.h> -#include <linux/spinlock.h> #include <linux/irq.h> -#include <linux/cache.h> -#include <linux/profile.h> -#include <linux/bitops.h> #include <linux/cpu.h>
-#include <asm/ptrace.h> -#include <linux/atomic.h> - -#include <asm/core.h> -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/pgtable.h> -#include <asm/pgalloc.h> #include <asm/mmu_context.h> #include <asm/tlbflush.h> -#include <asm/suspend.h> -#include <asm/hcall.h> -#include <asm/sw64io.h> #include <asm/sw64_init.h> #include <asm/topology.h> -#include <asm/tc.h> + #include "proto.h"
struct smp_rcb_struct *smp_rcb; diff --git a/arch/sw_64/kernel/stacktrace.c b/arch/sw_64/kernel/stacktrace.c index bb501c14565b..41cdff5b4941 100644 --- a/arch/sw_64/kernel/stacktrace.c +++ b/arch/sw_64/kernel/stacktrace.c @@ -6,7 +6,6 @@ */ #include <linux/sched.h> #include <linux/stacktrace.h> -#include <linux/export.h> #include <linux/sched/task_stack.h> #include <linux/sched/debug.h>
diff --git a/arch/sw_64/kernel/suspend.c b/arch/sw_64/kernel/suspend.c index b2b07ac3042b..c5de4df9d084 100644 --- a/arch/sw_64/kernel/suspend.c +++ b/arch/sw_64/kernel/suspend.c @@ -1,17 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/suspend.h> -#include <linux/interrupt.h> -#include <linux/pm.h> -#include <linux/irq.h> -#include <linux/types.h> -#include <linux/pci.h> -#include <asm/ptrace.h> + #include <asm/suspend.h> -#include <asm/smp.h> -#include <asm/io.h> -#include <asm/hmcall.h> -#include <asm/delay.h> -#include <asm/sw64io.h> #include <asm/sw64_init.h>
struct processor_state suspend_state; diff --git a/arch/sw_64/kernel/tc.c b/arch/sw_64/kernel/tc.c index c047d457e55a..f2de5ac3d9dc 100644 --- a/arch/sw_64/kernel/tc.c +++ b/arch/sw_64/kernel/tc.c @@ -5,9 +5,6 @@
#include <linux/topology.h> -#include <linux/spinlock.h> -#include <linux/kernel.h> -#include <linux/smp.h> #include <asm/tc.h>
/* diff --git a/arch/sw_64/kernel/time.c b/arch/sw_64/kernel/time.c index 185db832dfb8..15035a01e48a 100644 --- a/arch/sw_64/kernel/time.c +++ b/arch/sw_64/kernel/time.c @@ -1,34 +1,11 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/errno.h> #include <linux/module.h> -#include <linux/sched.h> -#include <linux/kernel.h> -#include <linux/param.h> -#include <linux/string.h> -#include <linux/mm.h> #include <linux/delay.h> -#include <linux/ioport.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/init.h> -#include <linux/bcd.h> -#include <linux/profile.h> -#include <linux/irq_work.h> -#include <linux/uaccess.h> - -#include <asm/io.h> -#include <asm/sw64io.h> -#include <asm/sw64_init.h> -#include <asm/hw_init.h> -#include <asm/irq_impl.h> -#include <asm/debug.h> - #include <linux/time.h> -#include <linux/timex.h> -#include <linux/clocksource.h> #include <linux/clk-provider.h> -#include <linux/sched/clock.h> -#include <linux/sched_clock.h> + +#include <asm/debug.h>
#include "proto.h"
diff --git a/arch/sw_64/kernel/timer.c b/arch/sw_64/kernel/timer.c index c29e7d1b664b..60c75096d8c4 100644 --- a/arch/sw_64/kernel/timer.c +++ b/arch/sw_64/kernel/timer.c @@ -4,20 +4,9 @@ * Description: percpu local timer, based on arch/x86/kernel/apic/apic.c */
-#include <linux/init.h> -#include <linux/mm.h> -#include <linux/delay.h> -#include <linux/memblock.h> #include <linux/interrupt.h> -#include <linux/kernel_stat.h> -#include <linux/ioport.h> -#include <linux/cpu.h> #include <linux/clockchips.h> -#include <linux/acpi_pmtmr.h> -#include <linux/module.h> -#include <linux/dmi.h> -#include <linux/dmar.h> -#include <asm/hcall.h> + #include <asm/hw_init.h> #include <asm/hardirq.h>
diff --git a/arch/sw_64/kernel/topology.c b/arch/sw_64/kernel/topology.c index 2e2878ba8656..964d6a83d901 100644 --- a/arch/sw_64/kernel/topology.c +++ b/arch/sw_64/kernel/topology.c @@ -1,20 +1,7 @@ // SPDX-License-Identifier: GPL-2.0
#include <linux/acpi.h> -#include <linux/arch_topology.h> -#include <linux/cacheinfo.h> -#include <linux/cpu.h> -#include <linux/cpumask.h> -#include <linux/init.h> -#include <linux/percpu.h> -#include <linux/node.h> -#include <linux/nodemask.h> #include <linux/of.h> -#include <linux/sched.h> -#include <linux/sched/topology.h> -#include <linux/slab.h> -#include <linux/smp.h> -#include <linux/string.h>
#include <asm/topology.h>
diff --git a/arch/sw_64/kernel/traps.c b/arch/sw_64/kernel/traps.c index d4354d72d6aa..2090eda082cf 100644 --- a/arch/sw_64/kernel/traps.c +++ b/arch/sw_64/kernel/traps.c @@ -9,29 +9,16 @@ * This file initializes the trap entry points */
-#include <linux/jiffies.h> -#include <linux/mm.h> -#include <linux/sched/signal.h> -#include <linux/sched/debug.h> -#include <linux/tty.h> -#include <linux/delay.h> #include <linux/extable.h> -#include <linux/kallsyms.h> -#include <linux/ratelimit.h> -#include <linux/uaccess.h> #include <linux/perf_event.h> #include <linux/kdebug.h> #include <linux/kexec.h>
#include <asm/gentrap.h> -#include <asm/unaligned.h> -#include <asm/sysinfo.h> #include <asm/mmu_context.h> -#include <asm/special_insns.h> #include <asm/fpu.h> #include <asm/kprobes.h> #include <asm/uprobes.h> -#include <asm/core.h>
#include "proto.h"
diff --git a/arch/sw_64/kernel/unaligned.c b/arch/sw_64/kernel/unaligned.c index 4ec1187d6cd0..a1bbdab4a266 100644 --- a/arch/sw_64/kernel/unaligned.c +++ b/arch/sw_64/kernel/unaligned.c @@ -12,9 +12,6 @@ * for more details. */
-#include <linux/kernel.h> -#include <linux/debugfs.h> -#include <linux/seq_file.h> #include <asm/unaligned.h> #include <asm/debug.h>
diff --git a/arch/sw_64/kernel/uprobes.c b/arch/sw_64/kernel/uprobes.c index d10464d0dcdd..786f2e38a59f 100644 --- a/arch/sw_64/kernel/uprobes.c +++ b/arch/sw_64/kernel/uprobes.c @@ -1,14 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/highmem.h> #include <linux/kdebug.h> -#include <linux/types.h> -#include <linux/notifier.h> -#include <linux/sched.h> #include <linux/uprobes.h> #include <linux/ptrace.h>
-#include <asm/ptrace.h> - #define UPROBE_TRAP_NR ULONG_MAX
/** diff --git a/arch/sw_64/kernel/vdso.c b/arch/sw_64/kernel/vdso.c index 32ed952748f0..b4126cbaa4bd 100644 --- a/arch/sw_64/kernel/vdso.c +++ b/arch/sw_64/kernel/vdso.c @@ -14,20 +14,11 @@ * */
-#include <linux/kernel.h> -#include <linux/clocksource.h> #include <linux/elf.h> -#include <linux/err.h> -#include <linux/errno.h> -#include <linux/gfp.h> #include <linux/mm.h> -#include <linux/sched.h> -#include <linux/signal.h> #include <linux/slab.h> #include <linux/timekeeper_internal.h> -#include <linux/vmalloc.h>
-#include <asm/cacheflush.h> #include <asm/vdso.h>
extern char vdso_start, vdso_end; diff --git a/arch/sw_64/kernel/vdso/vdso.S b/arch/sw_64/kernel/vdso/vdso.S index ce5448d00cf7..edd9be27db9d 100644 --- a/arch/sw_64/kernel/vdso/vdso.S +++ b/arch/sw_64/kernel/vdso/vdso.S @@ -15,9 +15,7 @@ * */
-#include <linux/init.h> #include <linux/linkage.h> -#include <linux/const.h> #include <asm/page.h>
__PAGE_ALIGNED_DATA diff --git a/arch/sw_64/kernel/vdso/vgettimeofday.c b/arch/sw_64/kernel/vdso/vgettimeofday.c index 3579e0eddfe2..b9c9a137f9d3 100644 --- a/arch/sw_64/kernel/vdso/vgettimeofday.c +++ b/arch/sw_64/kernel/vdso/vgettimeofday.c @@ -13,10 +13,9 @@ */
#include <linux/time.h> -#include <asm/timex.h> + #include <asm/unistd.h> #include <asm/vdso.h> -#include <asm/io.h>
static __always_inline int syscall_fallback(clockid_t clkid, struct timespec64 *ts) { diff --git a/arch/sw_64/kvm/kvm-sw64.c b/arch/sw_64/kvm/kvm-sw64.c index cc9817037b58..bc24a4711311 100644 --- a/arch/sw_64/kvm/kvm-sw64.c +++ b/arch/sw_64/kvm/kvm-sw64.c @@ -5,31 +5,18 @@ * linhn linhn@example.com */
-#include <linux/cpu.h> #include <linux/errno.h> -#include <linux/err.h> #include <linux/kvm_host.h> #include <linux/module.h> -#include <linux/vmalloc.h> -#include <linux/fs.h> #include <linux/mman.h> #include <linux/sched/signal.h> -#include <linux/freezer.h> -#include <linux/smp.h> #include <linux/kvm.h> #include <linux/uaccess.h> -#include <linux/genalloc.h> -#include <asm/kvm_emulate.h> -#include <asm/kvm_asm.h> -#include <asm/sw64io.h>
#include <asm/kvm_timer.h> -#include <asm/kvm_host.h> #include <asm/kvm_emulate.h>
-#include <asm/page.h> #include "../kernel/pci_impl.h" - #include "vmem.c"
bool set_msi_flag; diff --git a/arch/sw_64/lib/fls.c b/arch/sw_64/lib/fls.c index e960b1c06782..aa4231f7e472 100644 --- a/arch/sw_64/lib/fls.c +++ b/arch/sw_64/lib/fls.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/module.h> -#include <linux/bitops.h>
/* This is fls(x)-1, except zero is held to zero. This allows most * efficient input into extbl, plus it allows easy handling of fls(0)=0. diff --git a/arch/sw_64/lib/iomap.c b/arch/sw_64/lib/iomap.c index 30d24923624d..39e3d5498ae6 100644 --- a/arch/sw_64/lib/iomap.c +++ b/arch/sw_64/lib/iomap.c @@ -3,10 +3,8 @@ * Sw_64 IO and memory functions. */
-#include <linux/kernel.h> -#include <linux/types.h> -#include <linux/string.h> #include <linux/module.h> + #include <asm/io.h>
/* diff --git a/arch/sw_64/lib/udelay.c b/arch/sw_64/lib/udelay.c index 595887caa7b3..48356ab8872f 100644 --- a/arch/sw_64/lib/udelay.c +++ b/arch/sw_64/lib/udelay.c @@ -6,11 +6,6 @@ */
#include <linux/module.h> -#include <linux/sched.h> /* for udelay's use of smp_processor_id */ -#include <asm/param.h> -#include <asm/smp.h> -#include <asm/hw_init.h> -#include <linux/delay.h>
/* * Use only for very small delays (< 1 msec). diff --git a/arch/sw_64/math-emu/math.c b/arch/sw_64/math-emu/math.c index 3903b421b8f4..9f281d82ad83 100644 --- a/arch/sw_64/math-emu/math.c +++ b/arch/sw_64/math-emu/math.c @@ -8,16 +8,12 @@ * fire3 2008-12-27 Add SIMD floating emulation code for SW64 */
-#include <linux/module.h> -#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/sched.h> -#include <asm/ptrace.h> - - #include <linux/uaccess.h>
+#include <asm/ptrace.h> + #include "sfp-util.h" + #include <math-emu/soft-fp.h> #include <math-emu/single.h> #include <math-emu/double.h> diff --git a/arch/sw_64/mm/fault.c b/arch/sw_64/mm/fault.c index c68be4a40d23..b580450893ba 100644 --- a/arch/sw_64/mm/fault.c +++ b/arch/sw_64/mm/fault.c @@ -3,28 +3,11 @@ * Copyright (C) 1995 Linus Torvalds */
-#include <linux/sched.h> -#include <linux/kernel.h> -#include <linux/mm.h> -#include <asm/io.h> - -#include <asm/mmu_context.h> -#include <asm/tlbflush.h> -#include <asm/core.h> - -#include <linux/signal.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/types.h> -#include <linux/ptrace.h> -#include <linux/mman.h> -#include <linux/fs.h> -#include <linux/smp.h> -#include <linux/interrupt.h> #include <linux/extable.h> #include <linux/perf_event.h> #include <linux/kprobes.h> -#include <linux/uaccess.h> + +#include <asm/mmu_context.h>
__read_mostly bool segv_debug_enabled;
diff --git a/arch/sw_64/mm/hugetlbpage.c b/arch/sw_64/mm/hugetlbpage.c index 3c03709d441c..2a40225af4d8 100644 --- a/arch/sw_64/mm/hugetlbpage.c +++ b/arch/sw_64/mm/hugetlbpage.c @@ -3,18 +3,13 @@ * SW64 Huge TLB Page Support for Kernel. */
-#include <linux/init.h> -#include <linux/fs.h> #include <linux/mm.h> #include <linux/sched/mm.h> #include <linux/hugetlb.h> -#include <linux/pagemap.h> #include <linux/err.h> -#include <linux/sysctl.h> + #include <asm/mman.h> #include <asm/tlb.h> -#include <asm/tlbflush.h> -#include <asm/pgalloc.h>
/* * pmd_huge() returns 1 if @pmd is hugetlb related entry, that is normal diff --git a/arch/sw_64/mm/init.c b/arch/sw_64/mm/init.c index e3c2a20e54a2..4dda5ecb4f2e 100644 --- a/arch/sw_64/mm/init.c +++ b/arch/sw_64/mm/init.c @@ -5,36 +5,13 @@
/* 2.3.x zone allocator, 1999 Andrea Arcangeli andrea@suse.de */
-#include <linux/pagemap.h> -#include <linux/signal.h> -#include <linux/sched.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/types.h> -#include <linux/ptrace.h> -#include <linux/mman.h> #include <linux/mm.h> #include <linux/swap.h> -#include <linux/init.h> -#include <linux/vmalloc.h> -#include <linux/gfp.h> -#include <linux/uaccess.h> #include <linux/memblock.h> -#include <linux/dma-mapping.h> #include <linux/swiotlb.h> #include <linux/acpi.h>
-#include <asm/pgtable.h> -#include <asm/pgalloc.h> -#include <asm/dma.h> #include <asm/mmu_context.h> -#include <asm/console.h> -#include <asm/tlb.h> -#include <asm/setup.h> -#include <asm/sections.h> -#include <asm/memory.h> -#include <asm/hw_init.h>
extern void die_if_kernel(char *, struct pt_regs *, long);
diff --git a/arch/sw_64/mm/numa.c b/arch/sw_64/mm/numa.c index 940c12fcbb8d..7cb13587e465 100644 --- a/arch/sw_64/mm/numa.c +++ b/arch/sw_64/mm/numa.c @@ -3,27 +3,11 @@ * DISCONTIGMEM NUMA sw64 support. */
-#include <linux/types.h> -#include <linux/kernel.h> -#include <linux/mm.h> #include <linux/memblock.h> -#include <linux/swap.h> -#include <linux/initrd.h> -#include <linux/pfn.h> -#include <linux/module.h> #include <linux/cpuset.h> -#include <linux/init.h> -#ifdef CONFIG_PCI -#include <linux/pci.h> -#endif #include <linux/acpi.h> #include <linux/of.h>
-#include <asm/pgalloc.h> -#include <asm/sections.h> -#include <asm/sw64_init.h> -#include <asm/hw_init.h> -#include <asm/memory.h> #include <asm/core.h>
int cpu_to_node_map[NR_CPUS]; diff --git a/arch/sw_64/mm/physaddr.c b/arch/sw_64/mm/physaddr.c index d5cf83e671ae..fbb489ae4db5 100644 --- a/arch/sw_64/mm/physaddr.c +++ b/arch/sw_64/mm/physaddr.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/mmdebug.h> #include <linux/module.h> -#include <linux/mm.h> #include <asm/page.h>
unsigned long __phys_addr(unsigned long x) diff --git a/arch/sw_64/mm/thp.c b/arch/sw_64/mm/thp.c index 68260dd0e837..833bb59f79d0 100644 --- a/arch/sw_64/mm/thp.c +++ b/arch/sw_64/mm/thp.c @@ -1,13 +1,4 @@ // SPDX-License-Identifier: GPL-2.0 -#include <linux/init.h> -#include <linux/fs.h> -#include <linux/mm.h> -#include <linux/hugetlb.h> -#include <linux/pagemap.h> -#include <linux/err.h> -#include <linux/sysctl.h> -#include <asm/mman.h> -#include <asm/tlb.h> #include <asm/tlbflush.h> #include <asm/pgalloc.h>
From: He Sheng hesheng@wxiat.com
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56U83
--------------------------------
This patch fixes undefined reference to __constant_c_memset if CONFIG_DEEP_MEMSET=y and CONFIG_VGA_CONSOLE=y.
Signed-off-by: He Sheng hesheng@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/lib/deep-memset.S | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/sw_64/lib/deep-memset.S b/arch/sw_64/lib/deep-memset.S index 4efba2062e11..ffadc9a52707 100644 --- a/arch/sw_64/lib/deep-memset.S +++ b/arch/sw_64/lib/deep-memset.S @@ -35,6 +35,7 @@ .globl __memset .globl ___memset .globl __memsetw + .globl __constant_c_memset .ent ___memset ___memset: .frame $30, 0, $26, 0
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56QAM
--------------------------------
This patch fixes compile errors for CONFIG_KGDB=y, CONFIG_KEXEC=y and CONFIG_MEMORY_HOTPLUG=y.
These compile errors are caused by kernel version upgrade. The related codes have changed. Now fix them according to upstream.
Signed-off-by: Gu Zitao guzitao@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kernel/kgdb.c | 6 +++--- arch/sw_64/kernel/setup.c | 3 ++- arch/sw_64/mm/init.c | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/sw_64/kernel/kgdb.c b/arch/sw_64/kernel/kgdb.c index 09e9ca7a0303..491f287eede9 100644 --- a/arch/sw_64/kernel/kgdb.c +++ b/arch/sw_64/kernel/kgdb.c @@ -139,12 +139,12 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) pr_info("AFTER SET PC IS %lx\n", instruction_pointer(regs)); }
-static void kgdb_call_nmi_hook(void *ignored) +void kgdb_call_nmi_hook(void *ignored) { kgdb_nmicallback(raw_smp_processor_id(), NULL); }
-void kgdb_roundup_cpus(unsigned long flags) +void kgdb_roundup_cpus(void) { local_irq_enable(); smp_call_function(kgdb_call_nmi_hook, NULL, 0); @@ -228,6 +228,6 @@ void kgdb_arch_exit(void) * sw64 instructions are always in LE. * Break instruction is encoded in LE format */ -struct kgdb_arch arch_kgdb_ops = { +const struct kgdb_arch arch_kgdb_ops = { .gdb_bpt_instr = {0x80, 00, 00, 00} }; diff --git a/arch/sw_64/kernel/setup.c b/arch/sw_64/kernel/setup.c index 2de954a3c086..67d01f8cfe22 100644 --- a/arch/sw_64/kernel/setup.c +++ b/arch/sw_64/kernel/setup.c @@ -147,7 +147,8 @@ static void __init kexec_control_page_init(void) { phys_addr_t addr;
- addr = memblock_alloc_base(KEXEC_CONTROL_PAGE_SIZE, PAGE_SIZE, KTEXT_MAX); + addr = memblock_phys_alloc_range(KEXEC_CONTROL_PAGE_SIZE, PAGE_SIZE, + 0, KTEXT_MAX); kexec_control_page = (void *)(__START_KERNEL_map + addr); }
diff --git a/arch/sw_64/mm/init.c b/arch/sw_64/mm/init.c index 4dda5ecb4f2e..7fcd3d834ba5 100644 --- a/arch/sw_64/mm/init.c +++ b/arch/sw_64/mm/init.c @@ -312,14 +312,13 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) #endif
#ifdef CONFIG_MEMORY_HOTPLUG -int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap, - bool want_memblock) +int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params) { unsigned long start_pfn = start >> PAGE_SHIFT; unsigned long nr_pages = size >> PAGE_SHIFT; int ret;
- ret = __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock); + ret = __add_pages(nid, start_pfn, nr_pages, params); if (ret) printk("%s: Problem encountered in __add_pages() as ret=%d\n", __func__, ret);
From: Lu Feifei lufeifei@wxiat.com
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56WV8
--------------------------------
In guest os, ldl_u and stl_u may access mmio in some cases, so we have to decode and handle this issue when exit mmio.
Signed-off-by: Lu Feifei lufeifei@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kvm/emulate.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/sw_64/kvm/emulate.c b/arch/sw_64/kvm/emulate.c index 1552119e6346..bcc06c0dd618 100644 --- a/arch/sw_64/kvm/emulate.c +++ b/arch/sw_64/kvm/emulate.c @@ -32,6 +32,7 @@ void sw64_decode(struct kvm_vcpu *vcpu, unsigned int insn, struct kvm_run *run) vcpu->arch.mmio_decode.rt = ra; break; case 0x23: /* LDL */ + case 0x24: /* LDL_U */ run->mmio.is_write = 0; run->mmio.len = 8; vcpu->arch.mmio_decode.rt = ra; @@ -52,6 +53,7 @@ void sw64_decode(struct kvm_vcpu *vcpu, unsigned int insn, struct kvm_run *run) run->mmio.len = 4; break; case 0x2b: /* STL */ + case 0x2c: /* STL_U */ run->mmio.is_write = 1; *(unsigned long *)run->mmio.data = vcpu_get_reg(vcpu, ra); run->mmio.len = 8;
From: He Sheng hesheng@wxiat.com
Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG
--------------------------------
The retcode is unused, since we take __vdso_rt_sigreturn as default restorer, and redundant err check in setup_rt_frame() can be removed.
Signed-off-by: He Sheng hesheng@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kernel/signal.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/arch/sw_64/kernel/signal.c b/arch/sw_64/kernel/signal.c index f7b8d391251a..17cc9850daaa 100644 --- a/arch/sw_64/kernel/signal.c +++ b/arch/sw_64/kernel/signal.c @@ -34,7 +34,6 @@ asmlinkage void ret_from_sys_call(void); struct rt_sigframe { struct siginfo info; struct ucontext uc; - unsigned int retcode[3]; };
/* @@ -45,10 +44,6 @@ struct rt_sigframe { extern char compile_time_assert [offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
-#define INSN_MOV_R30_R16 0x47fe0410 -#define INSN_LDI_R0 0x201f0000 -#define INSN_CALLSYS 0x00000083 - static long restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs) { @@ -263,9 +258,6 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) */ r26 = VDSO_SYMBOL(current->mm->context.vdso, rt_sigreturn);
- if (err) - return -EFAULT; - /* "Return" to the handler */ regs->r26 = r26; regs->r27 = regs->pc = (unsigned long) ksig->ka.sa.sa_handler;
From: He Sheng hesheng@wxiat.com
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56YJ1
--------------------------------
Original implementation has deprecated sigframe and always use rt_sigframe for signal handler. But glibc remain unchanged, where handler takes $a2 as sigcontext pointer when SA_SIGINFO is not set and compatibility is break. As on sw64, SA_SIGINFO is not only a flag to specify sa_sigaction but also a flag to specify rt_sigframe and rt_sigreturn. It used to setup old sigframe and specify sigreturn for handler if SA_SIGINFO is not set.
To maintain compatibility, this patch set $a1 with exception code and and set $a2 with sigcontext pointer in that case, which seems a mix of modern rt_sigframe and traditional sigframe.
Actually, it is unnecessary to setup rt_sigframe for non SA_SIGINFO handler, because a rt_sigframe is larger than sigframe. Maybe the old sigframe will be reverted some day.
Signed-off-by: He Sheng hesheng@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kernel/signal.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/sw_64/kernel/signal.c b/arch/sw_64/kernel/signal.c index 17cc9850daaa..8b966e1c38aa 100644 --- a/arch/sw_64/kernel/signal.c +++ b/arch/sw_64/kernel/signal.c @@ -240,7 +240,8 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) if (!access_ok(frame, sizeof(*frame))) return -EFAULT;
- err |= copy_siginfo_to_user(&frame->info, &ksig->info); + if (ksig->ka.sa.sa_flags & SA_SIGINFO) + err |= copy_siginfo_to_user(&frame->info, &ksig->info);
/* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); @@ -262,8 +263,15 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) regs->r26 = r26; regs->r27 = regs->pc = (unsigned long) ksig->ka.sa.sa_handler; regs->r16 = ksig->sig; /* a0: signal number */ - regs->r17 = (unsigned long) &frame->info; /* a1: siginfo pointer */ - regs->r18 = (unsigned long) &frame->uc; /* a2: ucontext pointer */ + if (ksig->ka.sa.sa_flags & SA_SIGINFO) { + /* a1: siginfo pointer, a2: ucontext pointer */ + regs->r17 = (unsigned long) &frame->info; + regs->r18 = (unsigned long) &frame->uc; + } else { + /* a1: exception code, a2: sigcontext pointer */ + regs->r17 = 0; + regs->r18 = (unsigned long) &frame->uc.uc_mcontext; + } wrusp((unsigned long) frame);
#if DEBUG_SIG
From: Min Fanlei minfanlei@wxiat.com
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56WV8
--------------------------------
The page flag of the first page after kvm memory pool is incorrectly set to "reserved", which will result in page dumped if user try to apply for it.
Now we exclude the page to fix it.
Signed-off-by: Min Fanlei minfanlei@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sw_64/kernel/setup.c b/arch/sw_64/kernel/setup.c index 67d01f8cfe22..ca19445ac883 100644 --- a/arch/sw_64/kernel/setup.c +++ b/arch/sw_64/kernel/setup.c @@ -1017,7 +1017,7 @@ static int __init sw64_kvm_pool_init(void) gen_pool_set_algo(sw64_kvm_pool, gen_pool_best_fit, NULL);
base_page = pfn_to_page(kvm_mem_base >> PAGE_SHIFT); - end_page = pfn_to_page((kvm_mem_base + kvm_mem_size) >> PAGE_SHIFT); + end_page = pfn_to_page((kvm_mem_base + kvm_mem_size - 1) >> PAGE_SHIFT);
p = base_page; while (page_ref_count(p) == 0 &&
From: He Chuyue hechuyue@wxiat.com
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG
--------------------------------
The `reg` and `r` are always the same, so save one of them and remove the other.
Signed-off-by: He Chuyue hechuyue@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/kernel/ptrace.c | 63 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 31 deletions(-)
diff --git a/arch/sw_64/kernel/ptrace.c b/arch/sw_64/kernel/ptrace.c index 649572bbe613..b06c98e9944b 100644 --- a/arch/sw_64/kernel/ptrace.c +++ b/arch/sw_64/kernel/ptrace.c @@ -608,8 +608,8 @@ struct pt_regs_offset { int offset; };
-#define REG_OFFSET_NAME(reg, r) { \ - .name = #reg, \ +#define REG_OFFSET_NAME(r) { \ + .name = #r, \ .offset = offsetof(struct pt_regs, r) \ }
@@ -619,37 +619,38 @@ struct pt_regs_offset { }
static const struct pt_regs_offset regoffset_table[] = { - REG_OFFSET_NAME(r0, r0), - REG_OFFSET_NAME(r1, r1), - REG_OFFSET_NAME(r2, r2), - REG_OFFSET_NAME(r3, r3), - REG_OFFSET_NAME(r4, r4), - REG_OFFSET_NAME(r5, r5), - REG_OFFSET_NAME(r6, r6), - REG_OFFSET_NAME(r7, r7), - REG_OFFSET_NAME(r8, r8), - REG_OFFSET_NAME(r19, r19), - REG_OFFSET_NAME(r20, r20), - REG_OFFSET_NAME(r21, r21), - REG_OFFSET_NAME(r22, r22), - REG_OFFSET_NAME(r23, r23), - REG_OFFSET_NAME(r24, r24), - REG_OFFSET_NAME(r25, r25), - REG_OFFSET_NAME(r26, r26), - REG_OFFSET_NAME(r27, r27), - REG_OFFSET_NAME(r28, r28), - REG_OFFSET_NAME(hae, hae), - REG_OFFSET_NAME(trap_a0, trap_a0), - REG_OFFSET_NAME(trap_a1, trap_a1), - REG_OFFSET_NAME(trap_a2, trap_a2), - REG_OFFSET_NAME(ps, ps), - REG_OFFSET_NAME(pc, pc), - REG_OFFSET_NAME(gp, gp), - REG_OFFSET_NAME(r16, r16), - REG_OFFSET_NAME(r17, r17), - REG_OFFSET_NAME(r18, r18), + REG_OFFSET_NAME(r0), + REG_OFFSET_NAME(r1), + REG_OFFSET_NAME(r2), + REG_OFFSET_NAME(r3), + REG_OFFSET_NAME(r4), + REG_OFFSET_NAME(r5), + REG_OFFSET_NAME(r6), + REG_OFFSET_NAME(r7), + REG_OFFSET_NAME(r8), + REG_OFFSET_NAME(r19), + REG_OFFSET_NAME(r20), + REG_OFFSET_NAME(r21), + REG_OFFSET_NAME(r22), + REG_OFFSET_NAME(r23), + REG_OFFSET_NAME(r24), + REG_OFFSET_NAME(r25), + REG_OFFSET_NAME(r26), + REG_OFFSET_NAME(r27), + REG_OFFSET_NAME(r28), + REG_OFFSET_NAME(hae), + REG_OFFSET_NAME(trap_a0), + REG_OFFSET_NAME(trap_a1), + REG_OFFSET_NAME(trap_a2), + REG_OFFSET_NAME(ps), + REG_OFFSET_NAME(pc), + REG_OFFSET_NAME(gp), + REG_OFFSET_NAME(r16), + REG_OFFSET_NAME(r17), + REG_OFFSET_NAME(r18), REG_OFFSET_END, }; + /** * regs_query_register_offset() - query register offset from its name * @name: the name of a register
From: Cui Mingrui cuimingrui@wxiat.com
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I56W9F
--------------------------------
When dest address is not aligned, the checksum result is incorrect. This is caused by wrong usage of insll and inshl.
Signed-off-by: Cui Mingrui cuimingrui@wxiat.com
Signed-off-by: Gu Zitao guzitao@wxiat.com --- arch/sw_64/lib/checksum.c | 8 ++++---- arch/sw_64/lib/csum_partial_copy.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/sw_64/lib/checksum.c b/arch/sw_64/lib/checksum.c index 1531b09cad11..d1314caa15bf 100644 --- a/arch/sw_64/lib/checksum.c +++ b/arch/sw_64/lib/checksum.c @@ -76,23 +76,23 @@ static inline unsigned long do_csum(const unsigned char *buff, int len) } else { dst = (unsigned long *)((unsigned long)dst & (~7UL)); word = *dst; - inshl(word, doff, partial_dest); + inshl(word, 8 - doff, partial_dest); dst++;
while (len >= 0) { word = *dst; - insll(word, doff, second_dest); + insll(word, 8 - doff, second_dest); patch = partial_dest | second_dest; checksum += patch; checksum += (checksum < patch); - inshl(word, doff, partial_dest); + inshl(word, 8 - doff, partial_dest); dst++; len -= 8; }
len += 8; word = *dst; - insll(word, doff, second_dest); + insll(word, 8 - doff, second_dest); patch = partial_dest | second_dest; maskll(patch, len, patch); checksum += patch; diff --git a/arch/sw_64/lib/csum_partial_copy.c b/arch/sw_64/lib/csum_partial_copy.c index f45d64631281..441ae5575de5 100644 --- a/arch/sw_64/lib/csum_partial_copy.c +++ b/arch/sw_64/lib/csum_partial_copy.c @@ -93,23 +93,23 @@ csum_partial_cfu_dest_unaligned(const unsigned long __user *src,
dst = (unsigned long *)((unsigned long)dst & (~7UL)); word = *dst; - inshl(word, doff, partial_dest); + inshl(word, 8 - doff, partial_dest); dst++;
while (len >= 0) { word = *dst; - insll(word, doff, second_dest); + insll(word, 8 - doff, second_dest); patch = partial_dest | second_dest; checksum += patch; checksum += (checksum < patch); - inshl(word, doff, partial_dest); + inshl(word, 8 - doff, partial_dest); dst++; len -= 8; }
len += 8; word = *dst; - insll(word, doff, second_dest); + insll(word, 8 - doff, second_dest); patch = partial_dest | second_dest; maskll(patch, len, patch); checksum += patch;