diff mbox series

[v4,3/3] rtas: Store RTAS address and entry in the device tree

Message ID 20171004054001.42031-4-aik@ozlabs.ru
State Superseded
Headers show
Series fdt: Pass the resulting device tree to QEMU + related fixes | expand

Commit Message

Alexey Kardashevskiy Oct. 4, 2017, 5:40 a.m. UTC
At the moment we count on the guest kernel to update or create device
tree properties pointing to the instantiated RTAS copy which is not
very reliable.

This stores rtas-base and rtas-entry in the DT at the instantiation
point so later on the H_UPDATE_DT hcall can supply QEMU with an updated
location of RTAS.

This superseeds f9a60de30 "Add private HCALL to inform updated
RTAS base and entry".

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 board-qemu/slof/rtas.fs | 5 +++++
 1 file changed, 5 insertions(+)

Comments

David Gibson Oct. 6, 2017, 10:16 a.m. UTC | #1
On Wed, Oct 04, 2017 at 04:40:01PM +1100, Alexey Kardashevskiy wrote:
> At the moment we count on the guest kernel to update or create device
> tree properties pointing to the instantiated RTAS copy which is not
> very reliable.
> 
> This stores rtas-base and rtas-entry in the DT at the instantiation
> point so later on the H_UPDATE_DT hcall can supply QEMU with an updated
> location of RTAS.
> 
> This superseeds f9a60de30 "Add private HCALL to inform updated
> RTAS base and entry".
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

As discussed in another thread, I don't think you actually need
rtas-entry here, just rtas-base.  And including the size would
probably be safer, although I guess qemu already pretty much assumes
the RTAS blob it passes into SLOF will be used unmodified by SLOF.

> ---
>  board-qemu/slof/rtas.fs | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/board-qemu/slof/rtas.fs b/board-qemu/slof/rtas.fs
> index 219bcda..7f3b4c0 100644
> --- a/board-qemu/slof/rtas.fs
> +++ b/board-qemu/slof/rtas.fs
> @@ -178,8 +178,13 @@ rtas-node set-node
>  : close ;
>  
>  : instantiate-rtas ( adr -- entry )
> +    s" /rtas" find-node >r
> +    dup encode-int s" slof,rtas-base" r@ set-property
> +
>      dup rtas-base swap rtas-size move
>      rtas-entry rtas-base - +
> +
> +    dup encode-int s" slof,rtas-entry" r> set-property
>  ;
>  
>  device-end
diff mbox series

Patch

diff --git a/board-qemu/slof/rtas.fs b/board-qemu/slof/rtas.fs
index 219bcda..7f3b4c0 100644
--- a/board-qemu/slof/rtas.fs
+++ b/board-qemu/slof/rtas.fs
@@ -178,8 +178,13 @@  rtas-node set-node
 : close ;
 
 : instantiate-rtas ( adr -- entry )
+    s" /rtas" find-node >r
+    dup encode-int s" slof,rtas-base" r@ set-property
+
     dup rtas-base swap rtas-size move
     rtas-entry rtas-base - +
+
+    dup encode-int s" slof,rtas-entry" r> set-property
 ;
 
 device-end