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

Re: Need guidance to support reading GICR_TYPER (64 bit register) on Aarch32_v8r



On Thu, 13 Oct 2022, Ayan Kumar Halder wrote:
> Hi Arm mantainers/Folks,
> 
> Please refer to the discussion
> https://github.com/zephyrproject-rtos/zephyr/pull/51163 .
> 
> We intend to run Zephyr as a domU guest on Xen on Aarch32_v8R fixed virtual
> platform.
> 
> Zephyr is trying to read GICR_TYPER which is a 64 bit register using ldrd
> instruction.
> 
> As GICR is emulated by Xen, so this instruction gets trapped with HSR =
> 0x9200000c.
> 
> As ISV is 0, so Xen cannot emulate this instruction.
> 
> The proposed solution is to use two sys_read32() on GICR_TYPER to return the
> lower and upper 32 bits.
> 
> With this, HSR = 0x9383 000c, ISV=1 so ISS is valid.

Hi all,

I wanted to take a step back on this issue before we jump into the
details.


Differently from other instructions we discussed in the past, strd and ldrd
are not deprecated and are not "unusual corner cases". There is no
statements such as "please don't use this" on the ARM ARM. If I were to
write an register read/write function in assembly for an RTOS, it would
be reasonable to use them.

So, I struggle to see how we'll be able to deal with all the possible
RTOSes out there that might have them in the code. We can fix Zephyr,
but what about FreeRTOS, ThreadX and the proprietary ones (VxWorks,
etc.)?

Unless we can get ARM to issue a clear guidance that strd and ldrd are
deprecated, I think it would be better to attempt to decode them rather
than just fail. I don't like to have this kind of code in Xen, but I
don't see a way to support R52s without it.

That said, of course if Zephyr was to use two 32-bit reads instead of
one 64-bit read, it would be better for Xen. And we have more important
things to deal with right now in terms of R52 support (it is not even
upstream yet). So it is totally fine to change Zephyr and move forward
for now.

But medium term it doesn't seem to me that we can get away without a
solution in Xen for this (or a change in the ARM ARM).



 


Rackspace

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