Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ce21cdf authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt
Browse files

powerpc/xics: Harden xics hypervisor backend



During kdump stress testing I sometimes see the kdump kernel panic
with:

  Interrupt 0x306 (real) is invalid, disabling it.
  Kernel panic - not syncing: bad return code EOI - rc = -4, value=ff000306

Instead of panicing print the error message, dump the stack the first
time it happens and continue on. Add some more information to the
debug messages as well.

Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 3bfd0c9c
Loading
Loading
Loading
Loading
+27 −11
Original line number Original line Diff line number Diff line
@@ -27,33 +27,49 @@ static inline unsigned int icp_hv_get_xirr(unsigned char cppr)
{
{
	unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
	unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
	long rc;
	long rc;
	unsigned int ret = XICS_IRQ_SPURIOUS;


	rc = plpar_hcall(H_XIRR, retbuf, cppr);
	rc = plpar_hcall(H_XIRR, retbuf, cppr);
	if (rc != H_SUCCESS)
	if (rc == H_SUCCESS) {
		panic(" bad return code xirr - rc = %lx\n", rc);
		ret = (unsigned int)retbuf[0];
	return (unsigned int)retbuf[0];
	} else {
		pr_err("%s: bad return code xirr cppr=0x%x returned %ld\n",
			__func__, cppr, rc);
		WARN_ON_ONCE(1);
	}

	return ret;
}
}


static inline void icp_hv_set_xirr(unsigned int value)
static inline void icp_hv_set_xirr(unsigned int value)
{
{
	long rc = plpar_hcall_norets(H_EOI, value);
	long rc = plpar_hcall_norets(H_EOI, value);
	if (rc != H_SUCCESS)
	if (rc != H_SUCCESS) {
		panic("bad return code EOI - rc = %ld, value=%x\n", rc, value);
		pr_err("%s: bad return code eoi xirr=0x%x returned %ld\n",
			__func__, value, rc);
		WARN_ON_ONCE(1);
	}
}
}


static inline void icp_hv_set_cppr(u8 value)
static inline void icp_hv_set_cppr(u8 value)
{
{
	long rc = plpar_hcall_norets(H_CPPR, value);
	long rc = plpar_hcall_norets(H_CPPR, value);
	if (rc != H_SUCCESS)
	if (rc != H_SUCCESS) {
		panic("bad return code cppr - rc = %lx\n", rc);
		pr_err("%s: bad return code cppr cppr=0x%x returned %ld\n",
			__func__, value, rc);
		WARN_ON_ONCE(1);
	}
}
}


static inline void icp_hv_set_qirr(int n_cpu , u8 value)
static inline void icp_hv_set_qirr(int n_cpu , u8 value)
{
{
	long rc = plpar_hcall_norets(H_IPI, get_hard_smp_processor_id(n_cpu),
	int hw_cpu = get_hard_smp_processor_id(n_cpu);
				     value);
	long rc = plpar_hcall_norets(H_IPI, hw_cpu, value);
	if (rc != H_SUCCESS)
	if (rc != H_SUCCESS) {
		panic("bad return code qirr - rc = %lx\n", rc);
		pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x "
			"returned %ld\n", __func__, n_cpu, hw_cpu, value, rc);
		WARN_ON_ONCE(1);
	}
}
}


static void icp_hv_eoi(struct irq_data *d)
static void icp_hv_eoi(struct irq_data *d)