[PATCH qemu v7 0/5] spapr: Kill SLOF

Alexey Kardashevskiy posted 5 patches 4 years, 2 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
hw/ppc/Makefile.objs            |    1 +
pc-bios/vof/Makefile            |   18 +
include/hw/ppc/spapr.h          |   27 +-
include/hw/ppc/spapr_cpu_core.h |    4 +-
include/hw/ppc/spapr_vio.h      |    1 +
pc-bios/vof/vof.h               |   63 ++
hw/char/spapr_vty.c             |    2 +-
hw/ppc/spapr.c                  |   69 +-
hw/ppc/spapr_cpu_core.c         |    6 +-
hw/ppc/spapr_hcall.c            |   73 +-
hw/ppc/spapr_of_client.c        | 1285 +++++++++++++++++++++++++++++++
hw/ppc/spapr_rtas.c             |    2 +-
pc-bios/vof/bootblock.c         |  242 ++++++
pc-bios/vof/bootmem.c           |   13 +
pc-bios/vof/ci.c                |  147 ++++
pc-bios/vof/elf32.c             |  273 +++++++
pc-bios/vof/libc.c              |   91 +++
pc-bios/vof/main.c              |   24 +
hw/ppc/trace-events             |   25 +
pc-bios/README                  |    2 +
pc-bios/vof.bin                 |  Bin 0 -> 9180 bytes
pc-bios/vof/entry.S             |   58 ++
pc-bios/vof/l.lds               |   48 ++
23 files changed, 2429 insertions(+), 45 deletions(-)
create mode 100644 pc-bios/vof/Makefile
create mode 100644 pc-bios/vof/vof.h
create mode 100644 hw/ppc/spapr_of_client.c
create mode 100644 pc-bios/vof/bootblock.c
create mode 100644 pc-bios/vof/bootmem.c
create mode 100644 pc-bios/vof/ci.c
create mode 100644 pc-bios/vof/elf32.c
create mode 100644 pc-bios/vof/libc.c
create mode 100644 pc-bios/vof/main.c
create mode 100755 pc-bios/vof.bin
create mode 100644 pc-bios/vof/entry.S
create mode 100644 pc-bios/vof/l.lds
[PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Alexey Kardashevskiy 4 years, 2 months ago
This is another attempt to implement minimalistic
Open Firmware Client Interface in QEMU.

With this thing, I can boot unmodified Ubuntu 18.04 and Fedora 30
directly from the disk without SLOF.

A useful discussion happened esrlier:
https://lore.kernel.org/qemu-devel/f881c2e7-be92-9695-6e19-2dd88cbc63c1@ozlabs.ru/

5/5 is kind of controvertial though. This respin does not include
networking.

This is based on sha1
015fb0ead60d Chen Qun "hw/ppc/virtex_ml507:fix leak of fdevice tree blob".

Please comment. Thanks.



Alexey Kardashevskiy (5):
  ppc/spapr: Move GPRs setup to one place
  spapr/spapr: Make vty_getchars public
  spapr/cas: Separate CAS handling from rebuilding the FDT
  spapr: Implement Open Firmware client interface
  spapr/vof: Add basic support for MBR/GPT/GRUB

 hw/ppc/Makefile.objs            |    1 +
 pc-bios/vof/Makefile            |   18 +
 include/hw/ppc/spapr.h          |   27 +-
 include/hw/ppc/spapr_cpu_core.h |    4 +-
 include/hw/ppc/spapr_vio.h      |    1 +
 pc-bios/vof/vof.h               |   63 ++
 hw/char/spapr_vty.c             |    2 +-
 hw/ppc/spapr.c                  |   69 +-
 hw/ppc/spapr_cpu_core.c         |    6 +-
 hw/ppc/spapr_hcall.c            |   73 +-
 hw/ppc/spapr_of_client.c        | 1285 +++++++++++++++++++++++++++++++
 hw/ppc/spapr_rtas.c             |    2 +-
 pc-bios/vof/bootblock.c         |  242 ++++++
 pc-bios/vof/bootmem.c           |   13 +
 pc-bios/vof/ci.c                |  147 ++++
 pc-bios/vof/elf32.c             |  273 +++++++
 pc-bios/vof/libc.c              |   91 +++
 pc-bios/vof/main.c              |   24 +
 hw/ppc/trace-events             |   25 +
 pc-bios/README                  |    2 +
 pc-bios/vof.bin                 |  Bin 0 -> 9180 bytes
 pc-bios/vof/entry.S             |   58 ++
 pc-bios/vof/l.lds               |   48 ++
 23 files changed, 2429 insertions(+), 45 deletions(-)
 create mode 100644 pc-bios/vof/Makefile
 create mode 100644 pc-bios/vof/vof.h
 create mode 100644 hw/ppc/spapr_of_client.c
 create mode 100644 pc-bios/vof/bootblock.c
 create mode 100644 pc-bios/vof/bootmem.c
 create mode 100644 pc-bios/vof/ci.c
 create mode 100644 pc-bios/vof/elf32.c
 create mode 100644 pc-bios/vof/libc.c
 create mode 100644 pc-bios/vof/main.c
 create mode 100755 pc-bios/vof.bin
 create mode 100644 pc-bios/vof/entry.S
 create mode 100644 pc-bios/vof/l.lds

-- 
2.17.1


Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Paolo Bonzini 4 years, 2 months ago
On 20/02/20 07:16, Alexey Kardashevskiy wrote:
> This is another attempt to implement minimalistic
> Open Firmware Client Interface in QEMU.
> 
> With this thing, I can boot unmodified Ubuntu 18.04 and Fedora 30
> directly from the disk without SLOF.
> 
> A useful discussion happened esrlier:
> https://lore.kernel.org/qemu-devel/f881c2e7-be92-9695-6e19-2dd88cbc63c1@ozlabs.ru/
> 
> 5/5 is kind of controvertial though. This respin does not include
> networking.
> 
> This is based on sha1
> 015fb0ead60d Chen Qun "hw/ppc/virtex_ml507:fix leak of fdevice tree blob".

I would like to play with this.  Can you provide a disk image that just
reads the first sector of the disk using an OpenFirmware read command,
and dumps it to stdout?  (Also, I lost the pointer to your super-minimal
pSeries firmware).

Thanks,

Paolo


Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Alexey Kardashevskiy 4 years, 1 month ago

On 20/02/2020 21:01, Paolo Bonzini wrote:
> On 20/02/20 07:16, Alexey Kardashevskiy wrote:
>> This is another attempt to implement minimalistic
>> Open Firmware Client Interface in QEMU.
>>
>> With this thing, I can boot unmodified Ubuntu 18.04 and Fedora 30
>> directly from the disk without SLOF.
>>
>> A useful discussion happened esrlier:
>> https://lore.kernel.org/qemu-devel/f881c2e7-be92-9695-6e19-2dd88cbc63c1@ozlabs.ru/
>>
>> 5/5 is kind of controvertial though. This respin does not include
>> networking.
>>
>> This is based on sha1
>> 015fb0ead60d Chen Qun "hw/ppc/virtex_ml507:fix leak of fdevice tree blob".
> 
> I would like to play with this.  Can you provide a disk image that just
> reads the first sector of the disk using an OpenFirmware read command,
> and dumps it to stdout?

I am not quite sure I understood the request.  Write my own small
firmware and replace GRUB with it? The firmware from 5/5 reads first 2
sectors and the entire PReP, I could add there stuff if that helps (I
have "work in progress" patch for the firmware with printk/etc borrowed
from SLOF).

>  (Also, I lost the pointer to your super-minimal
> pSeries firmware).

It is incorporated into these patches under /pc-bios/vof - 4/5 has the
minimum (may be even too much), 5/5 has MBR+GPT+ELF.



-- 
Alexey

Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Paolo Bonzini 4 years, 1 month ago
On 21/02/20 01:18, Alexey Kardashevskiy wrote:
> I am not quite sure I understood the request.  Write my own small
> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
> sectors and the entire PReP, I could add there stuff if that helps (I
> have "work in progress" patch for the firmware with printk/etc borrowed
> from SLOF).

Okay, that's great!  I'll take a look next week.

Thanks,

Paolo

>>  (Also, I lost the pointer to your super-minimal
>> pSeries firmware).
>
> It is incorporated into these patches under /pc-bios/vof - 4/5 has the
> minimum (may be even too much), 5/5 has MBR+GPT+ELF.



Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Alexey Kardashevskiy 4 years, 1 month ago

On 21/02/2020 19:27, Paolo Bonzini wrote:
> On 21/02/20 01:18, Alexey Kardashevskiy wrote:
>> I am not quite sure I understood the request.  Write my own small
>> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
>> sectors and the entire PReP, I could add there stuff if that helps (I
>> have "work in progress" patch for the firmware with printk/etc borrowed
>> from SLOF).
> 
> Okay, that's great!  I'll take a look next week.


Just to make sure I understood - you'll take a look on this series, you
do not expect other patches on top, right?



ps. while I have your attention, what was the practical reason for
including capstone to QEMU? Thanks,



> 
> Thanks,
> 
> Paolo
> 
>>>  (Also, I lost the pointer to your super-minimal
>>> pSeries firmware).
>>
>> It is incorporated into these patches under /pc-bios/vof - 4/5 has the
>> minimum (may be even too much), 5/5 has MBR+GPT+ELF.
> 
> 

-- 
Alexey

Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Paolo Bonzini 4 years, 1 month ago
On 26/02/20 00:58, Alexey Kardashevskiy wrote:
> 
> 
> On 21/02/2020 19:27, Paolo Bonzini wrote:
>> On 21/02/20 01:18, Alexey Kardashevskiy wrote:
>>> I am not quite sure I understood the request.  Write my own small
>>> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
>>> sectors and the entire PReP, I could add there stuff if that helps (I
>>> have "work in progress" patch for the firmware with printk/etc borrowed
>>> from SLOF).
>>
>> Okay, that's great!  I'll take a look next week.
> 
> Just to make sure I understood - you'll take a look on this series, you
> do not expect other patches on top, right?

No, thanks.

> ps. while I have your attention, what was the practical reason for
> including capstone to QEMU? Thanks,

Newer versions of the binutils disassembler are GPLv3.

Paolo


Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Alexey Kardashevskiy 4 years, 1 month ago

On 26/02/2020 22:34, Paolo Bonzini wrote:
> On 26/02/20 00:58, Alexey Kardashevskiy wrote:
>>
>>
>> On 21/02/2020 19:27, Paolo Bonzini wrote:
>>> On 21/02/20 01:18, Alexey Kardashevskiy wrote:
>>>> I am not quite sure I understood the request.  Write my own small
>>>> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
>>>> sectors and the entire PReP, I could add there stuff if that helps (I
>>>> have "work in progress" patch for the firmware with printk/etc borrowed
>>>> from SLOF).
>>>
>>> Okay, that's great!  I'll take a look next week.
>>
>> Just to make sure I understood - you'll take a look on this series, you
>> do not expect other patches on top, right?
> 
> No, thanks.
> 
>> ps. while I have your attention, what was the practical reason for
>> including capstone to QEMU? Thanks,
> 
> Newer versions of the binutils disassembler are GPLv3.

but why does qemu need this kind of disassembler at all? tcg does
execution and it is not replaced by capstone.



-- 
Alexey

Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Paolo Bonzini 4 years, 1 month ago
On 27/02/20 00:38, Alexey Kardashevskiy wrote:
> 
> 
> On 26/02/2020 22:34, Paolo Bonzini wrote:
>> On 26/02/20 00:58, Alexey Kardashevskiy wrote:
>>>
>>>
>>> On 21/02/2020 19:27, Paolo Bonzini wrote:
>>>> On 21/02/20 01:18, Alexey Kardashevskiy wrote:
>>>>> I am not quite sure I understood the request.  Write my own small
>>>>> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
>>>>> sectors and the entire PReP, I could add there stuff if that helps (I
>>>>> have "work in progress" patch for the firmware with printk/etc borrowed
>>>>> from SLOF).
>>>>
>>>> Okay, that's great!  I'll take a look next week.
>>>
>>> Just to make sure I understood - you'll take a look on this series, you
>>> do not expect other patches on top, right?
>>
>> No, thanks.
>>
>>> ps. while I have your attention, what was the practical reason for
>>> including capstone to QEMU? Thanks,
>>
>> Newer versions of the binutils disassembler are GPLv3.
> 
> but why does qemu need this kind of disassembler at all? tcg does
> execution and it is not replaced by capstone.

For debugging (e.g. "x/5i $pc" from the monitor, or "-d in_asm" if
you're using TCG).

Paolo


Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Alexey Kardashevskiy 4 years, 1 month ago

On 27/02/2020 17:35, Paolo Bonzini wrote:
> On 27/02/20 00:38, Alexey Kardashevskiy wrote:
>>
>>
>> On 26/02/2020 22:34, Paolo Bonzini wrote:
>>> On 26/02/20 00:58, Alexey Kardashevskiy wrote:
>>>>
>>>>
>>>> On 21/02/2020 19:27, Paolo Bonzini wrote:
>>>>> On 21/02/20 01:18, Alexey Kardashevskiy wrote:
>>>>>> I am not quite sure I understood the request.  Write my own small
>>>>>> firmware and replace GRUB with it? The firmware from 5/5 reads first 2
>>>>>> sectors and the entire PReP, I could add there stuff if that helps (I
>>>>>> have "work in progress" patch for the firmware with printk/etc borrowed
>>>>>> from SLOF).
>>>>>
>>>>> Okay, that's great!  I'll take a look next week.


Any luck with this?

>>>>
>>>> Just to make sure I understood - you'll take a look on this series, you
>>>> do not expect other patches on top, right?
>>>
>>> No, thanks.
>>>
>>>> ps. while I have your attention, what was the practical reason for
>>>> including capstone to QEMU? Thanks,
>>>
>>> Newer versions of the binutils disassembler are GPLv3.
>>
>> but why does qemu need this kind of disassembler at all? tcg does
>> execution and it is not replaced by capstone.
> 
> For debugging (e.g. "x/5i $pc" from the monitor, or "-d in_asm" if
> you're using TCG).

Ah, this is the only use, ok. We could just install it from packages
then or (for PPC) grab from Linux's ppc xmon but ok :) Thanks,


-- 
Alexey

Re: [PATCH qemu v7 0/5] spapr: Kill SLOF
Posted by Paolo Bonzini 4 years, 1 month ago
On 06/03/20 02:17, Alexey Kardashevskiy wrote:
>>>>>> Okay, that's great!  I'll take a look next week.
> 
> Any luck with this?

Not really, perhaps today.  But I don't object to already including a
minimal version of this in 5.0 as long as:

- it doesn't implement read and write

- it is called x-vof instead of vof.

I know it's kinda useless (though perhaps you can already boot with
-kernel?) but I don't want to make maintenance of the series too hard.

Paolo

>>>>> Just to make sure I understood - you'll take a look on this series, you
>>>>> do not expect other patches on top, right?
>>>>
>>>> No, thanks.
>>>>
>>>>> ps. while I have your attention, what was the practical reason for
>>>>> including capstone to QEMU? Thanks,
>>>>
>>>> Newer versions of the binutils disassembler are GPLv3.
>>>
>>> but why does qemu need this kind of disassembler at all? tcg does
>>> execution and it is not replaced by capstone.
>>
>> For debugging (e.g. "x/5i $pc" from the monitor, or "-d in_asm" if
>> you're using TCG).
> 
> Ah, this is the only use, ok. We could just install it from packages
> then or (for PPC) grab from Linux's ppc xmon but ok :) Thanks,