Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early call to printk on 6xx not 601 leads to illegal instruction exception #218

Closed
chleroy opened this issue Jan 12, 2019 · 3 comments
Closed
Labels
bug It's a bug
Milestone

Comments

@chleroy
Copy link

chleroy commented Jan 12, 2019

printk() calls sched_clock():

notrace unsigned long long sched_clock(void)
{
	if (__USE_RTC())
		return get_rtc();
	return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
}

/* Accessor functions for the timebase (RTC on 601) registers. */
/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
#ifdef CONFIG_6xx
#define __USE_RTC()	(cpu_has_feature(CPU_FTR_USE_RTC))
#else
#define __USE_RTC()	0
#endif

When called early, __USE_RTC() returns true on any 6xx leading to calling get_rtc() which is invalid except on 601.

@mpe mpe added the bug It's a bug label Jan 31, 2019
@mpe
Copy link
Member

mpe commented Jan 31, 2019

@paulusmack is going to see if his 601 even boots still.

@chleroy
Copy link
Author

chleroy commented Aug 26, 2019

Using feature fixup instead of cpu feature would fix it as feature fixups are applied earlier.

Patch at https://patchwork.ozlabs.org/patch/1152995/

@chleroy chleroy added this to the v5.10 milestone Oct 23, 2020
@chleroy
Copy link
Author

chleroy commented Oct 23, 2020

Support for powerpc 601 is gone in v5.10, see linuxppc/linux@f0ed73f

@chleroy chleroy closed this as completed Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
Status: Done
Development

No branches or pull requests

2 participants