Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 52
b: refs/heads/master
c: 187335a
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed Apr 16, 2005
1 parent ee5177d commit 461dff6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 547ee84cea37696d25c93306e909378a87db2f66
refs/heads/master: 187335a4ec72c9bc7f3f168d6858a41fcfb63302
2 changes: 2 additions & 0 deletions trunk/arch/ppc64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,9 @@ fp_unavailable_common:
altivec_unavailable_common:
EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
#ifdef CONFIG_ALTIVEC
BEGIN_FTR_SECTION
bne .load_up_altivec /* if from user, just load it up */
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
#endif
bl .save_nvgprs
addi r3,r1,STACK_FRAME_OVERHEAD
Expand Down
19 changes: 18 additions & 1 deletion trunk/arch/ppc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
const char *full_path, void *data)
{
char *type = get_flat_dt_prop(node, "device_type", NULL);
u32 *prop;

/* We are scanning "cpu" nodes only */
if (type == NULL || strcmp(type, "cpu") != 0)
Expand Down Expand Up @@ -916,6 +917,20 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
}
}

/* Check if we have a VMX and eventually update CPU features */
prop = (u32 *)get_flat_dt_prop(node, "ibm,vmx", NULL);
if (prop && (*prop) > 0) {
cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
}

/* Same goes for Apple's "altivec" property */
prop = (u32 *)get_flat_dt_prop(node, "altivec", NULL);
if (prop) {
cur_cpu_spec->cpu_features |= CPU_FTR_ALTIVEC;
cur_cpu_spec->cpu_user_features |= PPC_FEATURE_HAS_ALTIVEC;
}

return 0;
}

Expand Down Expand Up @@ -1104,7 +1119,9 @@ void __init early_init_devtree(void *params)

DBG("Scanning CPUs ...\n");

/* Retreive hash table size from flattened tree */
/* Retreive hash table size from flattened tree plus other
* CPU related informations (altivec support, boot CPU ID, ...)
*/
scan_flat_dt(early_init_dt_scan_cpus, NULL);

/* If hash size wasn't obtained above, we calculate it now based on
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/ppc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,12 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)

void altivec_unavailable_exception(struct pt_regs *regs)
{
#ifndef CONFIG_ALTIVEC
if (user_mode(regs)) {
/* A user program has executed an altivec instruction,
but this kernel doesn't support altivec. */
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
return;
}
#endif
printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
"%lx at %lx\n", regs->trap, regs->nip);
die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
Expand Down

0 comments on commit 461dff6

Please sign in to comment.