[Qemu-devel] [PATCH 0/2] armv7m: Remove armv7m_init() function

Peter Maydell posted 2 patches 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180601144328.23817-1-peter.maydell@linaro.org
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
include/hw/arm/arm.h |  8 ++------
hw/arm/armv7m.c      | 21 ---------------------
hw/arm/stellaris.c   | 12 ++++++++++--
3 files changed, 12 insertions(+), 29 deletions(-)
[Qemu-devel] [PATCH 0/2] armv7m: Remove armv7m_init() function
Posted by Peter Maydell 5 years, 10 months ago
The armv7m_init() function is a legacy from before we properly QOMified
ARMv7M, and it has some flaws:
    
 * it combines work that needs to be done by an SoC object (creating
   and initializing the TYPE_ARMV7M object) with work that needs to
   be done by the board model (setting the system up to load the ELF
   file specified with -kernel)
 * TYPE_ARMV7M creation failure is fatal, but an SoC object wants to
   arrange to propagate the failure outward
 * it uses allocate-and-create via qdev_create() whereas the current
   preferred style for SoC objects is to do creation in-place

This patchset fixes the only current caller (the stellaris board)
to not use it, and then removes the function.
    
New board and SoC models should do the two jobs this function
was doing themselves, in the right places and with whatever their
preferred style/error handling is.

(I've cc'd the people working on the nRF51 SoC model, as a heads-up
that they'll need to update their code so it compiles once this
hits master.)

thanks
-- PMM

Peter Maydell (2):
  stellaris: Stop using armv7m_init()
  hw/arm/armv7m: Remove unused armv7m_init() function

 include/hw/arm/arm.h |  8 ++------
 hw/arm/armv7m.c      | 21 ---------------------
 hw/arm/stellaris.c   | 12 ++++++++++--
 3 files changed, 12 insertions(+), 29 deletions(-)

-- 
2.17.1


Re: [Qemu-devel] [Qemu-arm] [PATCH 0/2] armv7m: Remove armv7m_init() function
Posted by Peter Maydell 5 years, 10 months ago
Ping for code review?

thanks
-- PMM

On 1 June 2018 at 15:43, Peter Maydell <peter.maydell@linaro.org> wrote:
> The armv7m_init() function is a legacy from before we properly QOMified
> ARMv7M, and it has some flaws:
>
>  * it combines work that needs to be done by an SoC object (creating
>    and initializing the TYPE_ARMV7M object) with work that needs to
>    be done by the board model (setting the system up to load the ELF
>    file specified with -kernel)
>  * TYPE_ARMV7M creation failure is fatal, but an SoC object wants to
>    arrange to propagate the failure outward
>  * it uses allocate-and-create via qdev_create() whereas the current
>    preferred style for SoC objects is to do creation in-place
>
> This patchset fixes the only current caller (the stellaris board)
> to not use it, and then removes the function.
>
> New board and SoC models should do the two jobs this function
> was doing themselves, in the right places and with whatever their
> preferred style/error handling is.
>
> (I've cc'd the people working on the nRF51 SoC model, as a heads-up
> that they'll need to update their code so it compiles once this
> hits master.)
>
> thanks
> -- PMM
>
> Peter Maydell (2):
>   stellaris: Stop using armv7m_init()
>   hw/arm/armv7m: Remove unused armv7m_init() function
>
>  include/hw/arm/arm.h |  8 ++------
>  hw/arm/armv7m.c      | 21 ---------------------
>  hw/arm/stellaris.c   | 12 ++++++++++--
>  3 files changed, 12 insertions(+), 29 deletions(-)

Re: [Qemu-devel] [Qemu-arm] [PATCH 0/2] armv7m: Remove armv7m_init() function
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
On 06/11/2018 11:04 AM, Peter Maydell wrote:
> Ping for code review?
> 
> thanks
> -- PMM
> 
> On 1 June 2018 at 15:43, Peter Maydell <peter.maydell@linaro.org> wrote:
>> The armv7m_init() function is a legacy from before we properly QOMified
>> ARMv7M, and it has some flaws:
>>
>>  * it combines work that needs to be done by an SoC object (creating
>>    and initializing the TYPE_ARMV7M object) with work that needs to
>>    be done by the board model (setting the system up to load the ELF
>>    file specified with -kernel)
>>  * TYPE_ARMV7M creation failure is fatal, but an SoC object wants to
>>    arrange to propagate the failure outward
>>  * it uses allocate-and-create via qdev_create() whereas the current
>>    preferred style for SoC objects is to do creation in-place
>>
>> This patchset fixes the only current caller (the stellaris board)
>> to not use it, and then removes the function.

Good cleanup.

>>
>> New board and SoC models should do the two jobs this function
>> was doing themselves, in the right places and with whatever their
>> preferred style/error handling is.
>>
>> (I've cc'd the people working on the nRF51 SoC model, as a heads-up
>> that they'll need to update their code so it compiles once this
>> hits master.)
>>
>> thanks
>> -- PMM
>>
>> Peter Maydell (2):
>>   stellaris: Stop using armv7m_init()
>>   hw/arm/armv7m: Remove unused armv7m_init() function
>>
>>  include/hw/arm/arm.h |  8 ++------
>>  hw/arm/armv7m.c      | 21 ---------------------
>>  hw/arm/stellaris.c   | 12 ++++++++++--
>>  3 files changed, 12 insertions(+), 29 deletions(-)
> 

Series:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>