[SLOF] [PATCH RFC v0 3/3] Add virtio-serial device support

Alexey Kardashevskiy aik at ozlabs.ru
Mon Oct 10 21:04:52 AEDT 2016


On 10/10/16 19:27, Nikunj A Dadhania wrote:
> Alexey Kardashevskiy <aik at ozlabs.ru> writes:
> 
>> On 10/10/16 03:09, Nikunj A Dadhania wrote:
>>> Add support for virtio serial device to be used as a console device.
>>> Currently, SLOF only supports spapr-vty device. With this addition
>>> virtio console can be used during boot.
>>
>>
>> Cool, good job, works fine!
> 
> Thanks for testing. Did you see kernel logs as well, as I could get
> login prompt, but not messages from kernel after quiesce

Same here, I do not remember why is this though, I remember hacking the
guest kernel to see the full log... Still, cool.

> 
>>>
>>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>>> ---
>>>  board-qemu/slof/Makefile                |   3 +
>>>  board-qemu/slof/OF.fs                   |  24 +++-
>>>  board-qemu/slof/pci-device_1af4_1003.fs |  25 ++++
>>>  board-qemu/slof/pci-device_1af4_1043.fs |  15 +++
>>>  board-qemu/slof/virtio-serial.fs        |  95 +++++++++++++++
>>>  lib/libvirtio/Makefile                  |   2 +-
>>>  lib/libvirtio/virtio-serial.c           | 202 ++++++++++++++++++++++++++++++++
>>>  lib/libvirtio/virtio-serial.h           |  28 +++++
>>>  lib/libvirtio/virtio.code               |  33 ++++++
>>>  lib/libvirtio/virtio.in                 |   6 +
>>>  10 files changed, 426 insertions(+), 7 deletions(-)
>>>  create mode 100644 board-qemu/slof/pci-device_1af4_1003.fs
>>>  create mode 100644 board-qemu/slof/pci-device_1af4_1043.fs
>>>  create mode 100644 board-qemu/slof/virtio-serial.fs
>>>  create mode 100644 lib/libvirtio/virtio-serial.c
>>>  create mode 100644 lib/libvirtio/virtio-serial.h
>>>
>>> diff --git a/board-qemu/slof/Makefile b/board-qemu/slof/Makefile
>>> index 940a15a..cf57f16 100644
>>> --- a/board-qemu/slof/Makefile
>>> +++ b/board-qemu/slof/Makefile
>>> @@ -69,6 +69,8 @@ VIO_FFS_FILES = \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1041.fs \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1001.fs \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1042.fs \
>>> +	$(SLOFBRDDIR)/pci-device_1af4_1003.fs \
>>> +	$(SLOFBRDDIR)/pci-device_1af4_1043.fs \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1004.fs \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1048.fs \
>>>  	$(SLOFBRDDIR)/pci-device_1af4_1009.fs \
>>> @@ -79,6 +81,7 @@ VIO_FFS_FILES = \
>>>  	$(SLOFBRDDIR)/vio-veth.fs \
>>>  	$(SLOFBRDDIR)/rtas-nvram.fs \
>>>  	$(SLOFBRDDIR)/virtio-net.fs \
>>> +	$(SLOFBRDDIR)/virtio-serial.fs \
>>>  	$(SLOFBRDDIR)/virtio-block.fs \
>>>  	$(SLOFBRDDIR)/virtio-fs.fs \
>>>  	$(SLOFBRDDIR)/dev-null.fs \
>>> diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
>>> index c8df9ca..6b13e03 100644
>>> --- a/board-qemu/slof/OF.fs
>>> +++ b/board-qemu/slof/OF.fs
>>> @@ -162,6 +162,10 @@ CREATE version-str 10 ALLOT
>>>  : dump-display-write
>>>      s" screen" find-alias  IF
>>>          drop terminal-write drop
>>> +    ELSE
>>> +        s" vsterm" find-alias  IF
>>> +            drop type
>>> +        THEN
>>
>>
>> Why new alias, not usual "screen"? "screen" and "vsterm" cannot work
>> simultaneously any way.
> 
> "screen" is for vga display, so did not want to override, and is used in
> different context.

When is the context different?


> 
>>>      THEN
>>>  ;
>>>  
>>> @@ -236,12 +240,20 @@ romfs-base 400000 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
>>>                  ." using hvterm" cr
>>>                  " hvterm" io
>>>              ELSE
>>> -		    		    " /openprom" find-node ?dup IF
>>> -		    		        set-node
>>> -		    		        ." and no default found, creating dev-null" cr
>>> -		    		        " dev-null.fs" included
>>> -		    		        " devnull-console" io
>>> -		    		        0 set-node
>>
>> Here that indentation is fixed :)
> 
> The above hunk is the removal. I will check 1/3 and fix there.
> 
>>
>>> +                " vsterm" find-alias IF
>>> +                    drop
>>> +                    ." using vsterm" cr
>>> +                    " vsterm" io
>>> +                    false to store-prevga?
>>> +                    dump-display-buffer
>>> +                ELSE
>>> +                    " /openprom" find-node ?dup IF
>>> +                        set-node
>>> +                        ." and no default found, creating dev-null" cr
>>> +                        " dev-null.fs" included
>>> +                        " devnull-console" io
>>> +                        0 set-node
> 
> I think you meant here. But then i had to move this one more level deep.

Correct :)




-- 
Alexey


More information about the SLOF mailing list