[SLOF] [PATCH] pci-phb: Fix stack underflow in phb-pci-walk-bridge

Alexey Kardashevskiy aik at ozlabs.ru
Mon Oct 10 14:32:31 AEDT 2016


On 23/09/16 04:02, Thomas Huth wrote:
> The sequence "my-space pci-htype@ pci-out" in phb-pci-walk-bridge
> is bugged: pci-htype@ already consumes the my-space item from the
> stack, only leaving one item for pci-out. But pci-out needs two
> input items on the stack, the PCI address and a character item.
> So this rather should be "my-space dup pci-htype@ pci-out" instead.
> However, using the output of pci-htype@ as input character for
> pci-out also does not make much sense, since this is likely an
> unprintable character. So let's simply use a question mark here
> instead to indicate that we did not recognize the type of the
> PCI device.
> 
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1377083
> Signed-off-by: Thomas Huth <thuth at redhat.com>
> ---
>  board-qemu/slof/pci-phb.fs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)


Thanks, applied.

I got a question though - why did you add buglink here? It says that adding
2 bridges crashes SLOF.

1) it is not clear at all why PCI header type is not 0 or 1
2) how this patch fixes it
3) how "pci: Fix secondary and subordinate PCI bus enumeration with
board-qemu" fixes it if this patch does not fix it


> 
> diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs
> index a8fb7ca..f79c5b4 100644
> --- a/board-qemu/slof/pci-phb.fs
> +++ b/board-qemu/slof/pci-phb.fs
> @@ -297,7 +297,7 @@ setup-puid
>          CASE
>              0 OF my-space pci-device-setup ENDOF  \ | set up the device
>              1 OF my-space pci-bridge-setup ENDOF  \ | set up the bridge
> -            dup OF my-space pci-htype@ pci-out ENDOF
> +            dup OF my-space [char] ? pci-out ENDOF
>          ENDCASE
>          peer
>      REPEAT drop
> 


-- 
Alexey


More information about the SLOF mailing list