Commit 0683413f authored by Mao HongBo's avatar Mao HongBo Committed by Zheng Zengkai
Browse files

irqchip/irq-gic-phytium-2500: Add support for kdump

phytium inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I41AUQ


CVE: NA

--------------------------------

Add support for kdump vmcore generation for phytium S2500
platform.

Signed-off-by: default avatarMao HongBo <maohongbo@phytium.com.cn>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarHanjun Guo <guohanjun@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 5720ab84
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -1679,6 +1679,23 @@ static int its_cpumask_select(struct its_device *its_dev,
	cpus = cpu;
    }

    if (is_kdump_kernel()) {
	skt = (cpu_logical_map(cpu) >> 16) & 0xff;
	if (skt_id == skt) {
		return cpu;
	}
	for (i = 0; i < nr_cpu_ids; i++) {
		skt = (cpu_logical_map(i) >> 16) & 0xff;
		if ((skt >= 0) && (skt < MAX_MARS3_SKT_COUNT)) {
			if (skt_id == skt) {
				return i;
			}
		} else if (0xff != skt) {
			pr_err("socket address: %d is out of range.", skt);
		}
	}
    }

	return cpus;
}

@@ -3012,6 +3029,9 @@ static bool enabled_lpis_allowed(void)
	phys_addr_t addr;
	u64 val;

	if (is_kdump_kernel())
		return true;

	/* Check whether the property table is in a reserved region */
	val = gicr_read_propbaser(gic_data_rdist_rd_base() + GICR_PROPBASER);
	addr = val & GENMASK_ULL(51, 12);
@@ -3655,6 +3675,23 @@ static int its_cpumask_first(struct its_device *its_dev,
	cpus = cpu;
    }

    if (is_kdump_kernel()) {
	skt = (cpu_logical_map(cpu) >> 16) & 0xff;
	if (skt_id == skt) {
		return cpu;
	}
	for (i = 0; i < nr_cpu_ids; i++) {
		skt = (cpu_logical_map(i) >> 16) & 0xff;
		if ((skt >= 0) && (skt < MAX_MARS3_SKT_COUNT)) {
			if (skt_id == skt) {
				return i;
			}
		} else if (0xff != skt) {
			pr_err("socket address: %d is out of range.", skt);
		}
	}
    }

    return cpus;
}

+21 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/acpi.h>
#include <linux/cpu.h>
#include <linux/cpu_pm.h>
#include <linux/crash_dump.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/irqdomain.h>
@@ -1348,6 +1349,23 @@ static int gic_cpumask_select(struct irq_data *d, const struct cpumask *mask_val
	cpus = cpu;
    }

    if (is_kdump_kernel()) {
	skt = (cpu_logical_map(cpu) >> 16) & 0xff;
	if (irq_skt == skt) {
		return cpu;
	}
	for (i = 0; i < nr_cpu_ids; i++) {
		skt = (cpu_logical_map(i) >> 16) & 0xff;
		if ((skt >= 0) && (skt < MAX_MARS3_SOC_COUNT)) {
			if (irq_skt == skt) {
				return i;
			}
		} else if (0xff != skt) {
			pr_err("socket address: %d is out of range.", skt);
		}
	}
    }

    return cpus;
}

@@ -2440,6 +2458,9 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)

#ifdef CONFIG_ACPI
	mars3_sockets_bitmap = gic_mars3_sockets_bitmap();
	if (is_kdump_kernel()) {
		mars3_sockets_bitmap = 0x3;
	}
	if (mars3_sockets_bitmap == 0) {
		mars3_sockets_bitmap = 0x1;
		pr_err("No socket, please check cpus MPIDR_AFFINITY_LEVEL!!!");