[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/rpi4: implement watchdog-based reset


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: André Przywara <andre.przywara@xxxxxxx>
  • Date: Thu, 4 Jun 2020 18:12:56 +0100
  • Autocrypt: addr=andre.przywara@xxxxxxx; prefer-encrypt=mutual; keydata= xsFNBFNPCKMBEAC+6GVcuP9ri8r+gg2fHZDedOmFRZPtcrMMF2Cx6KrTUT0YEISsqPoJTKld tPfEG0KnRL9CWvftyHseWTnU2Gi7hKNwhRkC0oBL5Er2hhNpoi8x4VcsxQ6bHG5/dA7ctvL6 kYvKAZw4X2Y3GTbAZIOLf+leNPiF9175S8pvqMPi0qu67RWZD5H/uT/TfLpvmmOlRzNiXMBm kGvewkBpL3R2clHquv7pB6KLoY3uvjFhZfEedqSqTwBVu/JVZZO7tvYCJPfyY5JG9+BjPmr+ REe2gS6w/4DJ4D8oMWKoY3r6ZpHx3YS2hWZFUYiCYovPxfj5+bOr78sg3JleEd0OB0yYtzTT esiNlQpCo0oOevwHR+jUiaZevM4xCyt23L2G+euzdRsUZcK/M6qYf41Dy6Afqa+PxgMEiDto ITEH3Dv+zfzwdeqCuNU0VOGrQZs/vrKOUmU/QDlYL7G8OIg5Ekheq4N+Ay+3EYCROXkstQnf YYxRn5F1oeVeqoh1LgGH7YN9H9LeIajwBD8OgiZDVsmb67DdF6EQtklH0ycBcVodG1zTCfqM AavYMfhldNMBg4vaLh0cJ/3ZXZNIyDlV372GmxSJJiidxDm7E1PkgdfCnHk+pD8YeITmSNyb 7qeU08Hqqh4ui8SSeUp7+yie9zBhJB5vVBJoO5D0MikZAODIDwARAQABzS1BbmRyZSBQcnp5 d2FyYSAoQVJNKSA8YW5kcmUucHJ6eXdhcmFAYXJtLmNvbT7CwXsEEwECACUCGwMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheABQJTWSV8AhkBAAoJEAL1yD+ydue63REP/1tPqTo/f6StS00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xxxxxxx, Julien Grall <julien@xxxxxxx>, roman@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 04 Jun 2020 17:14:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/06/2020 17:46, Stefano Stabellini wrote:
> On Thu, 4 Jun 2020, André Przywara wrote:
>> On 04/06/2020 17:24, Stefano Stabellini wrote:
>>> On Thu, 4 Jun 2020, André Przywara wrote:
>>>> On 04/06/2020 09:48, Julien Grall wrote:
>>>>
>>>> Hi,
>>>>
>>>>> On 03/06/2020 23:31, Stefano Stabellini wrote:
>>>>>> Touching the watchdog is required to be able to reboot the board.
>>>>>
>>>>> In general the preferred method is PSCI. Does it mean RPI 4 doesn't
>>>>> support PSCI at all?
>>>>
>>>> There is mainline Trusted Firmware (TF-A) support for the RPi4 for a few
>>>> months now, which includes proper PSCI support (both for SMP bringup and
>>>> system reset/shutdown). At least that should work, if not, it's a bug.
>>>> An EDK-2 build for RPi4 bundles TF-A automatically, but you can use TF-A
>>>> without it, with or without U-Boot: It works as a drop-in replacement
>>>> for armstub.bin. Instruction for building it (one line!) are here:
>>>> https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/docs/plat/rpi4.rst
>>>>
>>>>>>
>>>>>> The implementation is based on
>>>>>> drivers/watchdog/bcm2835_wdt.c:__bcm2835_restart in Linux.
>>>>>
>>>>> Can you give the baseline? This would allow us to track an issue and
>>>>> port them.
>>>>
>>>> Given the above I don't think it's a good idea to add extra platform
>>>> specific code to Xen.
>>>
>>> The RPi4, at least the one I have, doesn't come with any TF, and it
>>
>> My RPi4 didn't come with anything, actually ;-) It's just a matter of
>> what you put in the uSD card slot.
>>
>>> doesn't come with PSCI in device tree.
>>
>> TF-A patches the PSCI nodes in:
>> https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/plat/rpi/rpi4?id=f67fa69cb6937a7fc559bbec4a7acce5edefa888
>>
>>> As a user, I would rather have
>>> this patch (even downstream) than having to introduce TF in my build and
>>> deployment just to be able to reboot.
>>
>> I get your point, but would rather put more pressure on people using
>> TF-A. After all you run without CPU hotplug, A72 errata workarounds and
>> without Spectre/Meltdown fixes. What was the IP address of your board
>> again? ;-)
> 
> Please send a pull request to remove __bcm2835_restart from the Linux
> kernel, once it is removed from there I'd be happy to take it away from
> Xen too ;-)

The kernel needs to support all RPi models, so we definitely need this.
Also it's already in there, so removing it is more churn.

The reason I am bringing this up is that we should get away from those
platform specific files in Xen at all. The only reason we have it for
the RPi4 is the non-page-aligned MMIO regions and overlaps, which could
actually be determined much better at runtime ...

> I know I am being cheeky but we have enough battles to fight and enough
> problems with Xen -- I don't think we should use the hypervisor as a
> leverage to get people to use or upgrade TF. We just need to get good
> functionalities to our users with the less amount of friction possible.

As I said: it's not my call, just pointing that out. It's just sad that
people everywhere work around the limited firmware instead of doing it
properly.

> Everything you mentioned are good reason to use TF, and this patch does
> not take anything away from it. My suggestion would be to work with
> raspberrypi.org to have TF installed by default by the Raspberry Pi
> Imager.

As far as I know there are (were?) efforts underway. For years ;-)

Cheers,
Andre



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.