diff mbox series

[v3,1/5] Revert "board-qemu: add private hcall to inform host on "phandle" update"

Message ID 20171003051523.17650-2-aik@ozlabs.ru
State Superseded
Headers show
Series fdt: Pass the resulting device tree to QEMU | expand

Commit Message

Alexey Kardashevskiy Oct. 3, 2017, 5:15 a.m. UTC
This reverts commit 604d28cc3f7 "board-qemu: add private hcall to
inform host on "phandle" update" as a bigger hammer is coming soon
which will pass the entire device tree to QEMU, not just phandles.

QEMU has never used the hcall this patch is removing so there will
be no compatibility issues.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 lib/libhvcall/libhvcall.h |  1 -
 board-qemu/slof/fdt.fs    | 14 ++------------
 lib/libhvcall/hvcall.code |  7 -------
 lib/libhvcall/hvcall.in   |  1 -
 4 files changed, 2 insertions(+), 21 deletions(-)

Comments

David Gibson Oct. 3, 2017, 6:13 a.m. UTC | #1
On Tue, Oct 03, 2017 at 04:15:19PM +1100, Alexey Kardashevskiy wrote:
> This reverts commit 604d28cc3f7 "board-qemu: add private hcall to
> inform host on "phandle" update" as a bigger hammer is coming soon
> which will pass the entire device tree to QEMU, not just phandles.
> 
> QEMU has never used the hcall this patch is removing so there will
> be no compatibility issues.

Not only never used, but never implemented.  I'm assuming SLOF must
have just been ignoring the H_FUNCTION errors...

> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

> ---
>  lib/libhvcall/libhvcall.h |  1 -
>  board-qemu/slof/fdt.fs    | 14 ++------------
>  lib/libhvcall/hvcall.code |  7 -------
>  lib/libhvcall/hvcall.in   |  1 -
>  4 files changed, 2 insertions(+), 21 deletions(-)
> 
> diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
> index 5776a2b..b2ea3f6 100644
> --- a/lib/libhvcall/libhvcall.h
> +++ b/lib/libhvcall/libhvcall.h
> @@ -25,7 +25,6 @@
>  /* Client Architecture support */
>  #define KVMPPC_H_CAS            (KVMPPC_HCALL_BASE + 0x2)
>  #define KVMPPC_H_RTAS_UPDATE    (KVMPPC_HCALL_BASE + 0x3)
> -#define KVMPPC_H_UPDATE_PHANDLE (KVMPPC_HCALL_BASE + 0x4)
>  
>  #ifndef __ASSEMBLY__
>  
> diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
> index a24e344..851645e 100644
> --- a/board-qemu/slof/fdt.fs
> +++ b/board-qemu/slof/fdt.fs
> @@ -308,28 +308,18 @@ fdt-claim-reserve
>     3drop
>  ;
>  
> -\ Tell QEMU about the updated phandle:
> -: fdt-hv-update-phandle ( old new -- )
> -   hv-update-phandle ?dup IF
> -      \ Ignore hcall not implemented error, print error otherwise
> -      dup -2 <> IF ." HV-UPDATE-PHANDLE error: " . cr ELSE drop THEN
> -   THEN
> -;
> -
>  \ Replace one FDT phandle "val" with a OF1275 phandle "node" in the
>  \ whole tree:
>  : fdt-update-phandle ( val node -- )
>     >r
>     FALSE TO (fdt-phandle-replaced)
> -   r@ 2dup s" /" find-node          ( val node val node root )
> -   fdt-replace-all-phandles         ( val node )
> +   r@ s" /" find-node               ( val node root )
> +   fdt-replace-all-phandles
>     (fdt-phandle-replaced) IF
> -      fdt-hv-update-phandle
>        r@ set-node
>        s" phandle" delete-property
>        s" linux,phandle" delete-property
>     ELSE
> -      2drop
>        diagnostic-mode? IF
>           cr ." Warning: Did not replace phandle in " r@ node>path type cr
>        THEN
> diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
> index 8349748..0ff50f2 100644
> --- a/lib/libhvcall/hvcall.code
> +++ b/lib/libhvcall/hvcall.code
> @@ -129,10 +129,3 @@ PRIM(check_X2d_and_X2d_patch_X2d_sc1)
>  
>  	patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins);
>  MIRP
> -
> -// : hv-update-phandle ( old_phandle new_phandle -- res )
> -PRIM(hv_X2d_update_X2d_phandle)
> -	uint32_t new_phandle = TOS.u; POP;
> -	uint32_t old_phandle = TOS.u;
> -	TOS.u = hv_generic(KVMPPC_H_UPDATE_PHANDLE, old_phandle, new_phandle);
> -MIRP
> diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in
> index ab7513a..4437b77 100644
> --- a/lib/libhvcall/hvcall.in
> +++ b/lib/libhvcall/hvcall.in
> @@ -31,5 +31,4 @@ cod(RX!)
>  cod(hv-logical-memop)
>  cod(hv-cas)
>  cod(hv-rtas-update)
> -cod(hv-update-phandle)
>  cod(get-print-version)
Greg Kurz Oct. 3, 2017, 7:11 a.m. UTC | #2
On Tue, 3 Oct 2017 17:13:39 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Tue, Oct 03, 2017 at 04:15:19PM +1100, Alexey Kardashevskiy wrote:
> > This reverts commit 604d28cc3f7 "board-qemu: add private hcall to
> > inform host on "phandle" update" as a bigger hammer is coming soon
> > which will pass the entire device tree to QEMU, not just phandles.
> > 
> > QEMU has never used the hcall this patch is removing so there will
> > be no compatibility issues.  
> 
> Not only never used, but never implemented.  I'm assuming SLOF must
> have just been ignoring the H_FUNCTION errors...
> 

Yes, see below...

> > 
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>  
> 
> > ---
> >  lib/libhvcall/libhvcall.h |  1 -
> >  board-qemu/slof/fdt.fs    | 14 ++------------
> >  lib/libhvcall/hvcall.code |  7 -------
> >  lib/libhvcall/hvcall.in   |  1 -
> >  4 files changed, 2 insertions(+), 21 deletions(-)
> > 
> > diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
> > index 5776a2b..b2ea3f6 100644
> > --- a/lib/libhvcall/libhvcall.h
> > +++ b/lib/libhvcall/libhvcall.h
> > @@ -25,7 +25,6 @@
> >  /* Client Architecture support */
> >  #define KVMPPC_H_CAS            (KVMPPC_HCALL_BASE + 0x2)
> >  #define KVMPPC_H_RTAS_UPDATE    (KVMPPC_HCALL_BASE + 0x3)
> > -#define KVMPPC_H_UPDATE_PHANDLE (KVMPPC_HCALL_BASE + 0x4)
> >  
> >  #ifndef __ASSEMBLY__
> >  
> > diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
> > index a24e344..851645e 100644
> > --- a/board-qemu/slof/fdt.fs
> > +++ b/board-qemu/slof/fdt.fs
> > @@ -308,28 +308,18 @@ fdt-claim-reserve
> >     3drop
> >  ;
> >  
> > -\ Tell QEMU about the updated phandle:
> > -: fdt-hv-update-phandle ( old new -- )
> > -   hv-update-phandle ?dup IF
> > -      \ Ignore hcall not implemented error, print error otherwise
> > -      dup -2 <> IF ." HV-UPDATE-PHANDLE error: " . cr ELSE drop THEN

... here :)

Reviewed-by: Greg Kurz <groug@kaod.org>

> > -   THEN
> > -;
> > -
> >  \ Replace one FDT phandle "val" with a OF1275 phandle "node" in the
> >  \ whole tree:
> >  : fdt-update-phandle ( val node -- )  
> >     >r  
> >     FALSE TO (fdt-phandle-replaced)
> > -   r@ 2dup s" /" find-node          ( val node val node root )
> > -   fdt-replace-all-phandles         ( val node )
> > +   r@ s" /" find-node               ( val node root )
> > +   fdt-replace-all-phandles
> >     (fdt-phandle-replaced) IF
> > -      fdt-hv-update-phandle
> >        r@ set-node
> >        s" phandle" delete-property
> >        s" linux,phandle" delete-property
> >     ELSE
> > -      2drop
> >        diagnostic-mode? IF
> >           cr ." Warning: Did not replace phandle in " r@ node>path type cr
> >        THEN
> > diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
> > index 8349748..0ff50f2 100644
> > --- a/lib/libhvcall/hvcall.code
> > +++ b/lib/libhvcall/hvcall.code
> > @@ -129,10 +129,3 @@ PRIM(check_X2d_and_X2d_patch_X2d_sc1)
> >  
> >  	patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins);
> >  MIRP
> > -
> > -// : hv-update-phandle ( old_phandle new_phandle -- res )
> > -PRIM(hv_X2d_update_X2d_phandle)
> > -	uint32_t new_phandle = TOS.u; POP;
> > -	uint32_t old_phandle = TOS.u;
> > -	TOS.u = hv_generic(KVMPPC_H_UPDATE_PHANDLE, old_phandle, new_phandle);
> > -MIRP
> > diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in
> > index ab7513a..4437b77 100644
> > --- a/lib/libhvcall/hvcall.in
> > +++ b/lib/libhvcall/hvcall.in
> > @@ -31,5 +31,4 @@ cod(RX!)
> >  cod(hv-logical-memop)
> >  cod(hv-cas)
> >  cod(hv-rtas-update)
> > -cod(hv-update-phandle)
> >  cod(get-print-version)  
>
diff mbox series

Patch

diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h
index 5776a2b..b2ea3f6 100644
--- a/lib/libhvcall/libhvcall.h
+++ b/lib/libhvcall/libhvcall.h
@@ -25,7 +25,6 @@ 
 /* Client Architecture support */
 #define KVMPPC_H_CAS            (KVMPPC_HCALL_BASE + 0x2)
 #define KVMPPC_H_RTAS_UPDATE    (KVMPPC_HCALL_BASE + 0x3)
-#define KVMPPC_H_UPDATE_PHANDLE (KVMPPC_HCALL_BASE + 0x4)
 
 #ifndef __ASSEMBLY__
 
diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs
index a24e344..851645e 100644
--- a/board-qemu/slof/fdt.fs
+++ b/board-qemu/slof/fdt.fs
@@ -308,28 +308,18 @@  fdt-claim-reserve
    3drop
 ;
 
-\ Tell QEMU about the updated phandle:
-: fdt-hv-update-phandle ( old new -- )
-   hv-update-phandle ?dup IF
-      \ Ignore hcall not implemented error, print error otherwise
-      dup -2 <> IF ." HV-UPDATE-PHANDLE error: " . cr ELSE drop THEN
-   THEN
-;
-
 \ Replace one FDT phandle "val" with a OF1275 phandle "node" in the
 \ whole tree:
 : fdt-update-phandle ( val node -- )
    >r
    FALSE TO (fdt-phandle-replaced)
-   r@ 2dup s" /" find-node          ( val node val node root )
-   fdt-replace-all-phandles         ( val node )
+   r@ s" /" find-node               ( val node root )
+   fdt-replace-all-phandles
    (fdt-phandle-replaced) IF
-      fdt-hv-update-phandle
       r@ set-node
       s" phandle" delete-property
       s" linux,phandle" delete-property
    ELSE
-      2drop
       diagnostic-mode? IF
          cr ." Warning: Did not replace phandle in " r@ node>path type cr
       THEN
diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code
index 8349748..0ff50f2 100644
--- a/lib/libhvcall/hvcall.code
+++ b/lib/libhvcall/hvcall.code
@@ -129,10 +129,3 @@  PRIM(check_X2d_and_X2d_patch_X2d_sc1)
 
 	patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins);
 MIRP
-
-// : hv-update-phandle ( old_phandle new_phandle -- res )
-PRIM(hv_X2d_update_X2d_phandle)
-	uint32_t new_phandle = TOS.u; POP;
-	uint32_t old_phandle = TOS.u;
-	TOS.u = hv_generic(KVMPPC_H_UPDATE_PHANDLE, old_phandle, new_phandle);
-MIRP
diff --git a/lib/libhvcall/hvcall.in b/lib/libhvcall/hvcall.in
index ab7513a..4437b77 100644
--- a/lib/libhvcall/hvcall.in
+++ b/lib/libhvcall/hvcall.in
@@ -31,5 +31,4 @@  cod(RX!)
 cod(hv-logical-memop)
 cod(hv-cas)
 cod(hv-rtas-update)
-cod(hv-update-phandle)
 cod(get-print-version)