All of lore.kernel.org
 help / color / mirror / Atom feed
* [v1 0/2] Early boot timestamp fixes
@ 2017-06-15 14:40 Pavel Tatashin
  2017-06-15 15:20 ` Guenter Roeck
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Pavel Tatashin @ 2017-06-15 14:40 UTC (permalink / raw)
  To: sparclinux

Guenter Roeck reported a problem that was introduced by early boot
timestamp changes. Where: tick_get_frequency() returns 0.

Guenter Roeck: could you please test if these patches fix the issue?

Pavel Tatashin (2):
  sparc64: use prom interface to get %stick frequency
  sparc64: broken %tick frequency on spitfire cpus

 arch/sparc/kernel/time_64.c |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
@ 2017-06-15 15:20 ` Guenter Roeck
  2017-06-15 15:21 ` David Miller
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2017-06-15 15:20 UTC (permalink / raw)
  To: sparclinux

On Thu, Jun 15, 2017 at 10:40:57AM -0400, Pavel Tatashin wrote:
> Guenter Roeck reported a problem that was introduced by early boot
> timestamp changes. Where: tick_get_frequency() returns 0.
> 
> Guenter Roeck: could you please test if these patches fix the issue?
> 
My tests pass with those patches applied, so

Tested-by: Guenter Roeck <linux@roeck-us.net>

My current sparc64 tests are

sparc64_defconfig sun4u "TI UltraSparc IIi"
sparc64_defconfig sun4v "Fujitsu Sparc64 IV"

with both SMP and non-SMP configuration variants.

Do you happen know which CPU variants supported by qemu would test
all affected code branches ? Or, in other words, what would be
an optimal combination of CPU / machine type to test ?

Thanks,
Guenter

> Pavel Tatashin (2):
>   sparc64: use prom interface to get %stick frequency
>   sparc64: broken %tick frequency on spitfire cpus
> 
>  arch/sparc/kernel/time_64.c |   34 ++++++++++++++++++++++++++++------
>  1 files changed, 28 insertions(+), 6 deletions(-)
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
  2017-06-15 15:20 ` Guenter Roeck
@ 2017-06-15 15:21 ` David Miller
  2017-06-15 15:23 ` David Miller
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2017-06-15 15:21 UTC (permalink / raw)
  To: sparclinux

From: Pavel Tatashin <pasha.tatashin@oracle.com>
Date: Thu, 15 Jun 2017 10:40:57 -0400

> Guenter Roeck reported a problem that was introduced by early boot
> timestamp changes. Where: tick_get_frequency() returns 0.
> 
> Guenter Roeck: could you please test if these patches fix the issue?

I'll push this to sparc-next as soon as Guenter tests it.

Thanks.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
  2017-06-15 15:20 ` Guenter Roeck
  2017-06-15 15:21 ` David Miller
@ 2017-06-15 15:23 ` David Miller
  2017-06-15 15:34 ` Pasha Tatashin
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2017-06-15 15:23 UTC (permalink / raw)
  To: sparclinux

From: Guenter Roeck <linux@roeck-us.net>
Date: Thu, 15 Jun 2017 08:20:01 -0700

> On Thu, Jun 15, 2017 at 10:40:57AM -0400, Pavel Tatashin wrote:
>> Guenter Roeck reported a problem that was introduced by early boot
>> timestamp changes. Where: tick_get_frequency() returns 0.
>> 
>> Guenter Roeck: could you please test if these patches fix the issue?
>> 
> My tests pass with those patches applied, so
> 
> Tested-by: Guenter Roeck <linux@roeck-us.net>

Pushed to sparc-next, thanks for testing!

Pavel, maybe you can add qemu-sparc64 to your test matrix?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (2 preceding siblings ...)
  2017-06-15 15:23 ` David Miller
@ 2017-06-15 15:34 ` Pasha Tatashin
  2017-06-15 15:43 ` Pasha Tatashin
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Pasha Tatashin @ 2017-06-15 15:34 UTC (permalink / raw)
  To: sparclinux



On 06/15/2017 11:23 AM, David Miller wrote:
> From: Guenter Roeck <linux@roeck-us.net>
> Date: Thu, 15 Jun 2017 08:20:01 -0700
> 
>> On Thu, Jun 15, 2017 at 10:40:57AM -0400, Pavel Tatashin wrote:
>>> Guenter Roeck reported a problem that was introduced by early boot
>>> timestamp changes. Where: tick_get_frequency() returns 0.
>>>
>>> Guenter Roeck: could you please test if these patches fix the issue?
>>>
>> My tests pass with those patches applied, so
>>
>> Tested-by: Guenter Roeck <linux@roeck-us.net>
> 
> Pushed to sparc-next, thanks for testing!
> 
> Pavel, maybe you can add qemu-sparc64 to your test matrix?

Guenter thank you very much for testing it so promptly.

I will setup qemu for sparc64 to test my future changes. This should be 
extremely useful.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (3 preceding siblings ...)
  2017-06-15 15:34 ` Pasha Tatashin
@ 2017-06-15 15:43 ` Pasha Tatashin
  2017-06-15 17:57 ` Mark Cave-Ayland
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Pasha Tatashin @ 2017-06-15 15:43 UTC (permalink / raw)
  To: sparclinux



On 06/15/2017 11:20 AM, Guenter Roeck wrote:
> On Thu, Jun 15, 2017 at 10:40:57AM -0400, Pavel Tatashin wrote:
>> Guenter Roeck reported a problem that was introduced by early boot
>> timestamp changes. Where: tick_get_frequency() returns 0.
>>
>> Guenter Roeck: could you please test if these patches fix the issue?
>>
> My tests pass with those patches applied, so
> 
> Tested-by: Guenter Roeck <linux@roeck-us.net>
> 
> My current sparc64 tests are
> 
> sparc64_defconfig sun4u "TI UltraSparc IIi"
> sparc64_defconfig sun4v "Fujitsu Sparc64 IV"
> 
> with both SMP and non-SMP configuration variants.
> 
> Do you happen know which CPU variants supported by qemu would test
> all affected code branches ? Or, in other words, what would be
> an optimal combination of CPU / machine type to test ?

Hi Guenter,

I have not used qemu for SPARC, so I am not fully aware of its 
capability. The changes in this work touched three types of CPUs:

1. UltraSPARC IIe (Hummingbird)
	- %stick is in I/O space, need at least to loads to get upper
	  and lower part of stick value.
2. Spitfire
	- Use %tick and cpu frequency to determine that clock. This is
	 what you tested with TI UltraSparc IIi
3. All other
	- use %stick register and stick-frequency values. This is what
	you tested with Fujitsu Sparc64 IV (which by the way is still
	sun4u, I do not think qemu supports sun4v emulation)

Thank you,
Pasha

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (4 preceding siblings ...)
  2017-06-15 15:43 ` Pasha Tatashin
@ 2017-06-15 17:57 ` Mark Cave-Ayland
  2017-06-15 18:06 ` David Miller
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Mark Cave-Ayland @ 2017-06-15 17:57 UTC (permalink / raw)
  To: sparclinux

On 15/06/17 16:43, Pasha Tatashin wrote:

> I have not used qemu for SPARC, so I am not fully aware of its
> capability. The changes in this work touched three types of CPUs:

The default CPU in QEMU for sun4u is the TI UltraSparc IIi, and the
device tree is roughly similar to that of an Ultra 5, or it least it
will be soon when I've finished working on my latest round of patches.

Currently I'm booting one of John Paul Adrian Glaubitz's Debian 9 images
and the timestamps stay at 0 until the clock is initialised so I'd hope
that these patches would fix that. Do they require any PROM support at all?

> 1. UltraSPARC IIe (Hummingbird)
>     - %stick is in I/O space, need at least to loads to get upper
>       and lower part of stick value.
> 2. Spitfire
>     - Use %tick and cpu frequency to determine that clock. This is
>      what you tested with TI UltraSparc IIi

So this is the path I'd expect to be exercised under QEMU.

> 3. All other
>     - use %stick register and stick-frequency values. This is what
>     you tested with Fujitsu Sparc64 IV (which by the way is still
>     sun4u, I do not think qemu supports sun4v emulation)

Sure it does. As of the latest 2.9 release, QEMU includes niagara
support out of the box - see http://wiki.qemu.org/SPARC for the latest
updates and
http://tyom.blogspot.co.uk/2016/10/qemu-sun4vniagara-target-went-public.html
for more sun4v detail.

Disclaimer: I'm one of the QEMU SPARC maintainers.


ATB,

Mark.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (5 preceding siblings ...)
  2017-06-15 17:57 ` Mark Cave-Ayland
@ 2017-06-15 18:06 ` David Miller
  2017-06-15 19:36 ` Guenter Roeck
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2017-06-15 18:06 UTC (permalink / raw)
  To: sparclinux

From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Date: Thu, 15 Jun 2017 18:57:30 +0100

> Currently I'm booting one of John Paul Adrian Glaubitz's Debian 9 images
> and the timestamps stay at 0 until the clock is initialised so I'd hope
> that these patches would fix that. Do they require any PROM support at all?

They don't require anything special.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (6 preceding siblings ...)
  2017-06-15 18:06 ` David Miller
@ 2017-06-15 19:36 ` Guenter Roeck
  2017-06-15 20:01 ` Pasha Tatashin
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2017-06-15 19:36 UTC (permalink / raw)
  To: sparclinux

On Thu, Jun 15, 2017 at 11:43:15AM -0400, Pasha Tatashin wrote:
> 
> 
> On 06/15/2017 11:20 AM, Guenter Roeck wrote:
> >On Thu, Jun 15, 2017 at 10:40:57AM -0400, Pavel Tatashin wrote:
> >>Guenter Roeck reported a problem that was introduced by early boot
> >>timestamp changes. Where: tick_get_frequency() returns 0.
> >>
> >>Guenter Roeck: could you please test if these patches fix the issue?
> >>
> >My tests pass with those patches applied, so
> >
> >Tested-by: Guenter Roeck <linux@roeck-us.net>
> >
> >My current sparc64 tests are
> >
> >sparc64_defconfig sun4u "TI UltraSparc IIi"
> >sparc64_defconfig sun4v "Fujitsu Sparc64 IV"
> >
> >with both SMP and non-SMP configuration variants.
> >
> >Do you happen know which CPU variants supported by qemu would test
> >all affected code branches ? Or, in other words, what would be
> >an optimal combination of CPU / machine type to test ?
> 
> Hi Guenter,
> 
> I have not used qemu for SPARC, so I am not fully aware of its capability.
> The changes in this work touched three types of CPUs:
> 
> 1. UltraSPARC IIe (Hummingbird)
> 	- %stick is in I/O space, need at least to loads to get upper
> 	  and lower part of stick value.
> 2. Spitfire
> 	- Use %tick and cpu frequency to determine that clock. This is
> 	 what you tested with TI UltraSparc IIi
> 3. All other
> 	- use %stick register and stick-frequency values. This is what
> 	you tested with Fujitsu Sparc64 IV (which by the way is still
> 	sun4u, I do not think qemu supports sun4v emulation)
> 

Oopsie :-)

Building sparc64:sun4u:TI UltraSparc IIi:smp:sparc64_defconfig ... running .....  passed
Building sparc64:sun4v:TI UltraSparc IIe:smp:sparc64_defconfig ... running ............................ failed (timeout)
------------
qemu log:
OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 64
kernel addr 404000 size 101dd2c
kernel cmdline root=/dev/vda init=/sbin/init.sh console=ttyS0 doreboot
CPUs: 1 x SUNW,UltraSPARC-IIe
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Nov 24 2016 21:23
  Type 'help' for detailed information
[sparc64] Kernel already loaded

Unhandled Exception 0x0000000000000028
PC = 0x0000000000462234 NPC = 0x0000000000462238
Stopping execution
qemu-system-sparc64: terminating on signal 15 from pid 14226 (/bin/bash)
------------
Building sparc64:sun4v:Fujitsu Sparc64 IV:smp:sparc64_defconfig ... running ..... passed

Trying with v4.12-rc4 gives me a different crash for UltraSparc IIe:

[    0.000000] NR_IRQS:2048 nr_irqs:2048 1
[    0.000000]               \|/ ____ \|/
[    0.000000]               "@'/ .. \`@"
[    0.000000]               /_| \__/ |_\
[    0.000000]                  \__U_/
[    0.000000] swapper/0(0): TL0: Kernel divide by zero. [#1]
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc4+ #1
[    0.000000] task: 0000000000ae3e80 task.stack: 0000000000ad4000
[    0.000000] TSTATE: 0000008880e01607 TPC: 0000000000b5d8a4 TNPC: 0000000000b5d8a8 Y: 00000000    Not tainted
[    0.000000] TPC: <time_init+0xf4/0x1b8>
[    0.000000] g0: 0000000000b4cf50 g1: 0000000000000000 g2: 000000ee6b280000 g3: 0000000000000000
[    0.000000] g4: 0000000000ae3e80 g5: fffff8001ec5c000 g6: 0000000000ad4000 g7: 00000000ffffffff
[    0.000000] o0: 0000000000000000 o1: 0000000000a3c1f0 o2: 0000000000000000 o3: 0000000000000000
[    0.000000] o4: 0000000200000000 o5: 0000000000000001 sp: 0000000000ad75c1 ret_pc: 0000000000b5d824
[    0.000000] RPC: <time_init+0x74/0x1b8>
[    0.000000] l0: 0000000077359400 l1: 0000000000bb8c00 l2: 0000000000baf940 l3: 0000000000bb2100
[    0.000000] l4: 0000000000bb8c00 l5: 0000000000adec00 l6: 0000000000bb2100 l7: 0000000000983898
[    0.000000] i0: 0000000000adb400 i1: 0000000000adec00 i2: 0000000000ae5c00 i3: ffffffffffffffff
[    0.000000] i4: 0000000000000000 i5: 0000000000a3c2b0 i6: 0000000000ad7671 i7: 0000000000b5a8a4
[    0.000000] I7: <start_kernel+0x2b0/0x430>
[    0.000000] Call Trace:
[    0.000000]  [0000000000b5a8a4] start_kernel+0x2b0/0x430
[    0.000000]  [00000000009777b4] tlb_fixup_done+0x4c/0x58
[    0.000000]  [00000000ffd0e444] 0xffd0e444
[    0.000000] Disabling lock debugging due to kernel taint
[    0.000000] Caller[0000000000b5a8a4]: start_kernel+0x2b0/0x430
[    0.000000] Caller[00000000009777b4]: tlb_fixup_done+0x4c/0x58

Still in the timer code, though. Adding some debugging:

[    0.000000] ############# spitfire
[    0.000000] ############# Hummingbird
[    0.000000] ############# stick-frequency=0
[    0.000000] ############## time_init(): freq=0

This suggests that the stick-frequency devicetree property isn't there.
Checking the openbios source confirms it. Overall the code does not look
correct, though, since

	freq = of_getintprop_default(dp, "stick-frequency", 0);

suggests that a frequency of 0 would be acceptable but isn't.

Anyway, adding "stick-frequency" to the properties provided by openbios
fixes this crash both upstream and in your code, only to result in a hang
a bit later.

[    0.000000] clocksource: hbtick: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000000] clocksource: mult[a000000] shift[24]
[    0.000000] clockevent: mult[1999999a] shift[32]
[    0.000000] Console: colour dummy device 80x25

[ hangs here until terminated ]

Guess that means that qemu doesn't really support this CPU,
and your code is fine.

Guenter

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (7 preceding siblings ...)
  2017-06-15 19:36 ` Guenter Roeck
@ 2017-06-15 20:01 ` Pasha Tatashin
  2017-06-15 20:33 ` Guenter Roeck
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Pasha Tatashin @ 2017-06-15 20:01 UTC (permalink / raw)
  To: sparclinux

> 
> Guess that means that qemu doesn't really support this CPU,
> and your code is fine.
> 

Thank you very much for testing!

Do you cross compile linux for sparc or do you compile kernel inside 
qemu or do you have SPARC machine? Just want to figure out what is the 
best way to use qemu for SPARC.

Thank you,
Pasha

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (8 preceding siblings ...)
  2017-06-15 20:01 ` Pasha Tatashin
@ 2017-06-15 20:33 ` Guenter Roeck
  2017-06-15 21:36 ` Guenter Roeck
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2017-06-15 20:33 UTC (permalink / raw)
  To: sparclinux

On Thu, Jun 15, 2017 at 04:01:42PM -0400, Pasha Tatashin wrote:
> >
> >Guess that means that qemu doesn't really support this CPU,
> >and your code is fine.
> >
> 
> Thank you very much for testing!
> 
> Do you cross compile linux for sparc or do you compile kernel inside qemu or
> do you have SPARC machine? Just want to figure out what is the best way to
> use qemu for SPARC.
> 

I cross compile Linux for everything :-). See http://kerneltests.org/builders,
and the environment is published at https://github.com/groeck/linux-build-test.

Cheers,
Guenter

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (9 preceding siblings ...)
  2017-06-15 20:33 ` Guenter Roeck
@ 2017-06-15 21:36 ` Guenter Roeck
  2017-06-16 12:17 ` Mark Cave-Ayland
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Guenter Roeck @ 2017-06-15 21:36 UTC (permalink / raw)
  To: sparclinux

On Thu, Jun 15, 2017 at 06:57:30PM +0100, Mark Cave-Ayland wrote:
> On 15/06/17 16:43, Pasha Tatashin wrote:
> 
> > I have not used qemu for SPARC, so I am not fully aware of its
> > capability. The changes in this work touched three types of CPUs:
> 
> The default CPU in QEMU for sun4u is the TI UltraSparc IIi, and the
> device tree is roughly similar to that of an Ultra 5, or it least it
> will be soon when I've finished working on my latest round of patches.
> 
> Currently I'm booting one of John Paul Adrian Glaubitz's Debian 9 images
> and the timestamps stay at 0 until the clock is initialised so I'd hope
> that these patches would fix that. Do they require any PROM support at all?
> 
> > 1. UltraSPARC IIe (Hummingbird)
> >     - %stick is in I/O space, need at least to loads to get upper
> >       and lower part of stick value.
> > 2. Spitfire
> >     - Use %tick and cpu frequency to determine that clock. This is
> >      what you tested with TI UltraSparc IIi
> 
> So this is the path I'd expect to be exercised under QEMU.
> 
> > 3. All other
> >     - use %stick register and stick-frequency values. This is what
> >     you tested with Fujitsu Sparc64 IV (which by the way is still
> >     sun4u, I do not think qemu supports sun4v emulation)
> 
> Sure it does. As of the latest 2.9 release, QEMU includes niagara
> support out of the box - see http://wiki.qemu.org/SPARC for the latest

Do you have information on how to boot the Linux kernel for -M niagara 
(assuming that is possible) ? Directions for Solaris and HelenOS don't
help much for the uninitiated :-(.

Thanks,
Guenter

> updates and
> http://tyom.blogspot.co.uk/2016/10/qemu-sun4vniagara-target-went-public.html
> for more sun4v detail.
> 
> Disclaimer: I'm one of the QEMU SPARC maintainers.
> 
> 
> ATB,
> 
> Mark.
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (10 preceding siblings ...)
  2017-06-15 21:36 ` Guenter Roeck
@ 2017-06-16 12:17 ` Mark Cave-Ayland
  2017-06-16 12:23 ` Mark Cave-Ayland
  2017-06-16 16:40 ` David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: Mark Cave-Ayland @ 2017-06-16 12:17 UTC (permalink / raw)
  To: sparclinux

On 15/06/17 20:36, Guenter Roeck wrote:

> Oopsie :-)
> 
> Building sparc64:sun4u:TI UltraSparc IIi:smp:sparc64_defconfig ... running .....  passed
> Building sparc64:sun4v:TI UltraSparc IIe:smp:sparc64_defconfig ... running ............................ failed (timeout)
> ------------
> qemu log:
> OpenBIOS for Sparc64
> Configuration device id QEMU version 1 machine id 64
> kernel addr 404000 size 101dd2c
> kernel cmdline root=/dev/vda init=/sbin/init.sh console=ttyS0 doreboot
> CPUs: 1 x SUNW,UltraSPARC-IIe
> UUID: 00000000-0000-0000-0000-000000000000
> Welcome to OpenBIOS v1.1 built on Nov 24 2016 21:23
>   Type 'help' for detailed information
> [sparc64] Kernel already loaded
> 
> Unhandled Exception 0x0000000000000028
> PC = 0x0000000000462234 NPC = 0x0000000000462238
> Stopping execution
> qemu-system-sparc64: terminating on signal 15 from pid 14226 (/bin/bash)
> ------------
> Building sparc64:sun4v:Fujitsu Sparc64 IV:smp:sparc64_defconfig ... running ..... passed
> 
> Trying with v4.12-rc4 gives me a different crash for UltraSparc IIe:
> 
> [    0.000000] NR_IRQS:2048 nr_irqs:2048 1
> [    0.000000]               \|/ ____ \|/
> [    0.000000]               "@'/ .. \`@"
> [    0.000000]               /_| \__/ |_\
> [    0.000000]                  \__U_/
> [    0.000000] swapper/0(0): TL0: Kernel divide by zero. [#1]
> [    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc4+ #1
> [    0.000000] task: 0000000000ae3e80 task.stack: 0000000000ad4000
> [    0.000000] TSTATE: 0000008880e01607 TPC: 0000000000b5d8a4 TNPC: 0000000000b5d8a8 Y: 00000000    Not tainted
> [    0.000000] TPC: <time_init+0xf4/0x1b8>
> [    0.000000] g0: 0000000000b4cf50 g1: 0000000000000000 g2: 000000ee6b280000 g3: 0000000000000000
> [    0.000000] g4: 0000000000ae3e80 g5: fffff8001ec5c000 g6: 0000000000ad4000 g7: 00000000ffffffff
> [    0.000000] o0: 0000000000000000 o1: 0000000000a3c1f0 o2: 0000000000000000 o3: 0000000000000000
> [    0.000000] o4: 0000000200000000 o5: 0000000000000001 sp: 0000000000ad75c1 ret_pc: 0000000000b5d824
> [    0.000000] RPC: <time_init+0x74/0x1b8>
> [    0.000000] l0: 0000000077359400 l1: 0000000000bb8c00 l2: 0000000000baf940 l3: 0000000000bb2100
> [    0.000000] l4: 0000000000bb8c00 l5: 0000000000adec00 l6: 0000000000bb2100 l7: 0000000000983898
> [    0.000000] i0: 0000000000adb400 i1: 0000000000adec00 i2: 0000000000ae5c00 i3: ffffffffffffffff
> [    0.000000] i4: 0000000000000000 i5: 0000000000a3c2b0 i6: 0000000000ad7671 i7: 0000000000b5a8a4
> [    0.000000] I7: <start_kernel+0x2b0/0x430>
> [    0.000000] Call Trace:
> [    0.000000]  [0000000000b5a8a4] start_kernel+0x2b0/0x430
> [    0.000000]  [00000000009777b4] tlb_fixup_done+0x4c/0x58
> [    0.000000]  [00000000ffd0e444] 0xffd0e444
> [    0.000000] Disabling lock debugging due to kernel taint
> [    0.000000] Caller[0000000000b5a8a4]: start_kernel+0x2b0/0x430
> [    0.000000] Caller[00000000009777b4]: tlb_fixup_done+0x4c/0x58
> 
> Still in the timer code, though. Adding some debugging:
> 
> [    0.000000] ############# spitfire
> [    0.000000] ############# Hummingbird
> [    0.000000] ############# stick-frequency=0
> [    0.000000] ############## time_init(): freq=0
> 
> This suggests that the stick-frequency devicetree property isn't there.
> Checking the openbios source confirms it. Overall the code does not look
> correct, though, since
> 
> 	freq = of_getintprop_default(dp, "stick-frequency", 0);
> 
> suggests that a frequency of 0 would be acceptable but isn't.

Right. I don't see a stick-frequency in a DT from a real Ultra 5, so I
presume that this is specific to IIe?

> Anyway, adding "stick-frequency" to the properties provided by openbios
> fixes this crash both upstream and in your code, only to result in a hang
> a bit later.
> 
> [    0.000000] clocksource: hbtick: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
> [    0.000000] clocksource: mult[a000000] shift[24]
> [    0.000000] clockevent: mult[1999999a] shift[32]
> [    0.000000] Console: colour dummy device 80x25
> 
> [ hangs here until terminated ]
> 
> Guess that means that qemu doesn't really support this CPU,
> and your code is fine.

Yeah that is entirely likely. Currently my focus is on getting the basic
sun4u machine up-and-running to the point where 64-bit Solaris can boot
in -nographic mode, so for the moment the other CPU types tend to be
ignored.


ATB,

Mark.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (11 preceding siblings ...)
  2017-06-16 12:17 ` Mark Cave-Ayland
@ 2017-06-16 12:23 ` Mark Cave-Ayland
  2017-06-16 16:40 ` David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: Mark Cave-Ayland @ 2017-06-16 12:23 UTC (permalink / raw)
  To: sparclinux

On 15/06/17 22:36, Guenter Roeck wrote:

> On Thu, Jun 15, 2017 at 06:57:30PM +0100, Mark Cave-Ayland wrote:
>> On 15/06/17 16:43, Pasha Tatashin wrote:
>>
>>> I have not used qemu for SPARC, so I am not fully aware of its
>>> capability. The changes in this work touched three types of CPUs:
>>
>> The default CPU in QEMU for sun4u is the TI UltraSparc IIi, and the
>> device tree is roughly similar to that of an Ultra 5, or it least it
>> will be soon when I've finished working on my latest round of patches.
>>
>> Currently I'm booting one of John Paul Adrian Glaubitz's Debian 9 images
>> and the timestamps stay at 0 until the clock is initialised so I'd hope
>> that these patches would fix that. Do they require any PROM support at all?
>>
>>> 1. UltraSPARC IIe (Hummingbird)
>>>     - %stick is in I/O space, need at least to loads to get upper
>>>       and lower part of stick value.
>>> 2. Spitfire
>>>     - Use %tick and cpu frequency to determine that clock. This is
>>>      what you tested with TI UltraSparc IIi
>>
>> So this is the path I'd expect to be exercised under QEMU.
>>
>>> 3. All other
>>>     - use %stick register and stick-frequency values. This is what
>>>     you tested with Fujitsu Sparc64 IV (which by the way is still
>>>     sun4u, I do not think qemu supports sun4v emulation)
>>
>> Sure it does. As of the latest 2.9 release, QEMU includes niagara
>> support out of the box - see http://wiki.qemu.org/SPARC for the latest
> 
> Do you have information on how to boot the Linux kernel for -M niagara 
> (assuming that is possible) ? Directions for Solaris and HelenOS don't
> help much for the uninitiated :-(.

I just pinged Artyom (who added sun4v support) about this and his
comment was that the machine files provided in the
OpenSPARCT1_Arch.1.5.tar.bz2 are hardcoded to 256MB which isn't enough
to boot many standard kernels. As I'm currently sun4u only then I'm not
the right person to ask about this - perhaps someone from Oracle can help?

If you are interested in pursuing this further, please head over and
introduce yourself on the qemu-devel list so we can all gather in one place.


ATB,

Mark.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [v1 0/2] Early boot timestamp fixes
  2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
                   ` (12 preceding siblings ...)
  2017-06-16 12:23 ` Mark Cave-Ayland
@ 2017-06-16 16:40 ` David Miller
  13 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2017-06-16 16:40 UTC (permalink / raw)
  To: sparclinux

From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Date: Fri, 16 Jun 2017 13:17:01 +0100

> Right. I don't see a stick-frequency in a DT from a real Ultra 5, so I
> presume that this is specific to IIe?

Right, Ultra-5 is IIi which uses plain %tick.

IIe uses a special system tick based tick register in I/O space and
therefore has to have a stick-frequency.

Looking in the prtconfs GIT repo, we see:

[davem@dhcp-10-15-49-210 net-next]$ egrep IIe ../prtconfs/*
grep: ../prtconfs/mdesc: Is a directory
../prtconfs/netrat1_200:    banner-name: 'Netra T1 200 (UltraSPARC-IIe 500MHz)'
../prtconfs/netrat1_200:        name: 'SUNW,UltraSPARC-IIe'
../prtconfs/netrax1:    banner-name: 'Sun Netra X1 (UltraSPARC-IIe 500MHz)'
../prtconfs/netrax1:        name: 'SUNW,UltraSPARC-IIe'
../prtconfs/sb100:    banner-name: 'Sun Blade 100 (UltraSPARC-IIe)'
../prtconfs/sb100:        name: 'SUNW,UltraSPARC-IIe'
../prtconfs/v100:    banner-name: 'Sun Fire V100 (UltraSPARC-IIe 500MHz)'
../prtconfs/v100:        name: 'SUNW,UltraSPARC-IIe'
../prtconfs/v120:    banner-name: 'Sun Fire V120 (UltraSPARC-IIe 500MHz)'
../prtconfs/v120:        name: 'SUNW,UltraSPARC-IIe'
[davem@dhcp-10-15-49-210 net-next]$

and in 'sb100' we have:

    stick-frequency:  0054c563

in the root node of the system.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-06-16 16:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15 14:40 [v1 0/2] Early boot timestamp fixes Pavel Tatashin
2017-06-15 15:20 ` Guenter Roeck
2017-06-15 15:21 ` David Miller
2017-06-15 15:23 ` David Miller
2017-06-15 15:34 ` Pasha Tatashin
2017-06-15 15:43 ` Pasha Tatashin
2017-06-15 17:57 ` Mark Cave-Ayland
2017-06-15 18:06 ` David Miller
2017-06-15 19:36 ` Guenter Roeck
2017-06-15 20:01 ` Pasha Tatashin
2017-06-15 20:33 ` Guenter Roeck
2017-06-15 21:36 ` Guenter Roeck
2017-06-16 12:17 ` Mark Cave-Ayland
2017-06-16 12:23 ` Mark Cave-Ayland
2017-06-16 16:40 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.