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

Commit d90d2c38 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [PATCH] powerpc: Fix cell blade detection
  [PATCH] powerpc: Fix call to ibm,client-architecture-support
  powerpc: Fix machine check problem on 32-bit kernels
parents 128e6ced 133dda1e
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -822,6 +822,7 @@ static void __init prom_send_capabilities(void)
		/* try calling the ibm,client-architecture-support method */
		/* try calling the ibm,client-architecture-support method */
		if (call_prom_ret("call-method", 3, 2, &ret,
		if (call_prom_ret("call-method", 3, 2, &ret,
				  ADDR("ibm,client-architecture-support"),
				  ADDR("ibm,client-architecture-support"),
				  root,
				  ADDR(ibm_architecture_vec)) == 0) {
				  ADDR(ibm_architecture_vec)) == 0) {
			/* the call exists... */
			/* the call exists... */
			if (ret)
			if (ret)
@@ -1622,6 +1623,15 @@ static int __init prom_find_machine_type(void)
			if (strstr(p, RELOC("Power Macintosh")) ||
			if (strstr(p, RELOC("Power Macintosh")) ||
			    strstr(p, RELOC("MacRISC")))
			    strstr(p, RELOC("MacRISC")))
				return PLATFORM_POWERMAC;
				return PLATFORM_POWERMAC;
#ifdef CONFIG_PPC64
			/* We must make sure we don't detect the IBM Cell
			 * blades as pSeries due to some firmware issues,
			 * so we do it here.
			 */
			if (strstr(p, RELOC("IBM,CBEA")) ||
			    strstr(p, RELOC("IBM,CPBW-1.0")))
				return PLATFORM_GENERIC;
#endif /* CONFIG_PPC64 */
			i += sl + 1;
			i += sl + 1;
		}
		}
	}
	}
+10 −1
Original line number Original line Diff line number Diff line
@@ -803,10 +803,13 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int
		if (__get_user(cmcp, &ucp->uc_regs))
		if (__get_user(cmcp, &ucp->uc_regs))
			return -EFAULT;
			return -EFAULT;
		mcp = (struct mcontext __user *)(u64)cmcp;
		mcp = (struct mcontext __user *)(u64)cmcp;
		/* no need to check access_ok(mcp), since mcp < 4GB */
	}
	}
#else
#else
	if (__get_user(mcp, &ucp->uc_regs))
	if (__get_user(mcp, &ucp->uc_regs))
		return -EFAULT;
		return -EFAULT;
	if (!access_ok(VERIFY_READ, mcp, sizeof(*mcp)))
		return -EFAULT;
#endif
#endif
	restore_sigmask(&set);
	restore_sigmask(&set);
	if (restore_user_regs(regs, mcp, sig))
	if (restore_user_regs(regs, mcp, sig))
@@ -908,13 +911,14 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
{
{
	struct sig_dbg_op op;
	struct sig_dbg_op op;
	int i;
	int i;
	unsigned char tmp;
	unsigned long new_msr = regs->msr;
	unsigned long new_msr = regs->msr;
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
	unsigned long new_dbcr0 = current->thread.dbcr0;
	unsigned long new_dbcr0 = current->thread.dbcr0;
#endif
#endif


	for (i=0; i<ndbg; i++) {
	for (i=0; i<ndbg; i++) {
		if (__copy_from_user(&op, dbg, sizeof(op)))
		if (copy_from_user(&op, dbg + i, sizeof(op)))
			return -EFAULT;
			return -EFAULT;
		switch (op.dbg_type) {
		switch (op.dbg_type) {
		case SIG_DBG_SINGLE_STEPPING:
		case SIG_DBG_SINGLE_STEPPING:
@@ -959,6 +963,11 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
	current->thread.dbcr0 = new_dbcr0;
	current->thread.dbcr0 = new_dbcr0;
#endif
#endif


	if (!access_ok(VERIFY_READ, ctx, sizeof(*ctx))
	    || __get_user(tmp, (u8 __user *) ctx)
	    || __get_user(tmp, (u8 __user *) (ctx + 1) - 1))
		return -EFAULT;

	/*
	/*
	 * If we get a fault copying the context into the kernel's
	 * If we get a fault copying the context into the kernel's
	 * image of the user's registers, we can't just return -EFAULT
	 * image of the user's registers, we can't just return -EFAULT
+2 −0
Original line number Original line Diff line number Diff line
@@ -182,6 +182,8 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
	err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
	err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
	if (err)
	if (err)
		return err;
		return err;
	if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
		return -EFAULT;
	/* Copy 33 vec registers (vr0..31 and vscr) from the stack */
	/* Copy 33 vec registers (vr0..31 and vscr) from the stack */
	if (v_regs != 0 && (msr & MSR_VEC) != 0)
	if (v_regs != 0 && (msr & MSR_VEC) != 0)
		err |= __copy_from_user(current->thread.vr, v_regs,
		err |= __copy_from_user(current->thread.vr, v_regs,
+5 −6
Original line number Original line Diff line number Diff line
@@ -125,14 +125,13 @@ static void __init cell_init_early(void)


static int __init cell_probe(void)
static int __init cell_probe(void)
{
{
	/* XXX This is temporary, the Cell maintainer will come up with
	 * more appropriate detection logic
	 */
	unsigned long root = of_get_flat_dt_root();
	unsigned long root = of_get_flat_dt_root();
	if (!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
		return 0;


	if (of_flat_dt_is_compatible(root, "IBM,CBEA") ||
	    of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
		return 1;
		return 1;

	return 0;
}
}


/*
/*
+8 −0
Original line number Original line Diff line number Diff line
@@ -389,6 +389,7 @@ static int __init pSeries_probe_hypertas(unsigned long node,


static int __init pSeries_probe(void)
static int __init pSeries_probe(void)
{
{
	unsigned long root = of_get_flat_dt_root();
 	char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
 	char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
 					  "device_type", NULL);
 					  "device_type", NULL);
 	if (dtype == NULL)
 	if (dtype == NULL)
@@ -396,6 +397,13 @@ static int __init pSeries_probe(void)
 	if (strcmp(dtype, "chrp"))
 	if (strcmp(dtype, "chrp"))
		return 0;
		return 0;


	/* Cell blades firmware claims to be chrp while it's not. Until this
	 * is fixed, we need to avoid those here.
	 */
	if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0") ||
	    of_flat_dt_is_compatible(root, "IBM,CBEA"))
		return 0;

	DBG("pSeries detected, looking for LPAR capability...\n");
	DBG("pSeries detected, looking for LPAR capability...\n");


	/* Now try to figure out if we are running on LPAR */
	/* Now try to figure out if we are running on LPAR */