Commit 14e51473 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: clean up some cpu feature checks

parent 4561c1da
......@@ -237,7 +237,7 @@ fix_alignment(struct pt_regs *regs)
dsisr = regs->dsisr;
/* Power4 doesn't set DSISR for an alignment interrupt */
if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)) {
if (!cpu_alignexc_sets_dsisr()) {
unsigned int real_instr;
if (__get_user(real_instr, (unsigned int *)regs->nip))
return 0;
......
......@@ -469,12 +469,10 @@ insert_bpts()
}
}
if (!__is_processor(PV_POWER4) && !__is_processor(PV_POWER4p)) {
if (dabr.enabled)
set_dabr(dabr.address);
if (iabr.enabled)
set_iabr(iabr.address);
}
if (cpu_has_dabr() && dabr.enabled)
set_dabr(dabr.address);
if (cpu_has_iabr() && iabr.enabled)
set_iabr(iabr.address);
}
static void
......@@ -486,10 +484,11 @@ remove_bpts()
if (naca->platform != PLATFORM_PSERIES)
return;
if (!__is_processor(PV_POWER4) && !__is_processor(PV_POWER4p)) {
if (cpu_has_dabr())
set_dabr(0);
if (cpu_has_iabr())
set_iabr(0);
}
bp = bpts;
for (i = 0; i < NBPTS; ++i, ++bp) {
......@@ -778,8 +777,8 @@ bpt_cmds(void)
cmd = inchar();
switch (cmd) {
case 'd': /* bd - hardware data breakpoint */
if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)) {
printf("Not implemented on POWER4\n");
if (cpu_has_dabr()) {
printf("Not implemented on this cpu\n");
break;
}
mode = 7;
......@@ -798,7 +797,7 @@ bpt_cmds(void)
dabr.address = (dabr.address & ~7) | mode;
break;
case 'i': /* bi - hardware instr breakpoint */
if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)) {
if (cpu_has_iabr()) {
printf("Not implemented on POWER4\n");
break;
}
......
......@@ -742,6 +742,15 @@ static inline void prefetchw(const void *x)
#define cpu_has_noexecute() (processor_type() == PV_POWER4 || \
processor_type() == PV_POWER4p)
/* XXX we have to call HV to set when in LPAR */
#define cpu_has_dabr() (1)
#define cpu_has_iabr() (processor_type() != PV_POWER4 && \
processor_type() != PV_POWER4p)
#define cpu_alignexc_sets_dsisr() (processor_type() != PV_POWER4 && \
processor_type() != PV_POWER4p)
#endif /* ASSEMBLY */
#endif /* __ASM_PPC64_PROCESSOR_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment