mbox

[PULL,00/10] MIPS queue for May 19th, 2019

Message ID 1558263144-8776-1-git-send-email-aleksandar.markovic@rt-rk.com (mailing list archive)
State New, archived
Headers show

Pull-request

https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019

Message

Aleksandar Markovic May 19, 2019, 10:52 a.m. UTC
From: Aleksandar Markovic <amarkovic@wavecomp.com>

The following changes since commit 1b46b4daa6fbf45eddcf77877379a0afac341df9:

  Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17 17:25:19 +0100)

are available in the git repository at:

  https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019

for you to fetch changes up to 71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:

  mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46 +0200)

----------------------------------------------------------------

MIPS queue for May 19th, 2019

  * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
  * A set of fixes for emulation of MSA ASE on big endian hosts
  * Improved usage of object_initialize() and object_initialize_child()
  * Better handling of 'div by zero' cases in MSA ASE

----------------------------------------------------------------

Jakub Jermář (1):
  mips: Decide to map PAGE_EXEC in map_address

Mateja Marjanovic (7):
  target/mips: Make the results of DIV_<U|S>.<B|H|W|D> the same as on
    hardware
  target/mips: Make the results of MOD_<U|S>.<B|H|W|D> the same as on
    hardware
  target/mips: Fix MSA instructions LD.<B|H|W|D> on big endian host
  target/mips: Fix MSA instructions ST.<B|H|W|D> on big endian host
  target/mips: Refactor and fix COPY_S.<B|H|W|D> instructions
  target/mips: Refactor and fix COPY_U.<B|H|W> instructions
  target/mips: Refactor and fix INSERT.<B|H|W|D> instructions

Philippe Mathieu-Daudé (2):
  hw/mips: Use object_initialize() on MIPSCPSState
  hw/mips: Use object_initialize_child for correct reference counting

 hw/mips/boston.c         |  25 ++--
 hw/mips/cps.c            |  20 +--
 hw/mips/mips_malta.c     |  17 +--
 target/mips/helper.c     |  13 +-
 target/mips/helper.h     |  16 +-
 target/mips/msa_helper.c | 191 ++++++++++++++++--------
 target/mips/op_helper.c  | 376 ++++++++++++++++++++++++++++++++++++++++++-----
 target/mips/translate.c  |  59 +++++++-
 8 files changed, 574 insertions(+), 143 deletions(-)

Comments

Jakub Jermář May 19, 2019, 11:33 a.m. UTC | #1
Hi Aleksandar,

On 5/19/19 12:52 PM, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> 
> The following changes since commit 1b46b4daa6fbf45eddcf77877379a0afac341df9:
> 
>   Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17 17:25:19 +0100)
> 
> are available in the git repository at:
> 
>   https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019
> 
> for you to fetch changes up to 71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:
> 
>   mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46 +0200)
> 
> ----------------------------------------------------------------
> 
> MIPS queue for May 19th, 2019
> 
>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)

This was rather a problem with failing non-executable page tests in
L4Re, not HelenOS. Even though I tested HelenOS for regressions.

Cheers,
Jakub

>   * A set of fixes for emulation of MSA ASE on big endian hosts
>   * Improved usage of object_initialize() and object_initialize_child()
>   * Better handling of 'div by zero' cases in MSA ASE
> 
> ----------------------------------------------------------------
> 
> Jakub Jermář (1):
>   mips: Decide to map PAGE_EXEC in map_address
> 
> Mateja Marjanovic (7):
>   target/mips: Make the results of DIV_<U|S>.<B|H|W|D> the same as on
>     hardware
>   target/mips: Make the results of MOD_<U|S>.<B|H|W|D> the same as on
>     hardware
>   target/mips: Fix MSA instructions LD.<B|H|W|D> on big endian host
>   target/mips: Fix MSA instructions ST.<B|H|W|D> on big endian host
>   target/mips: Refactor and fix COPY_S.<B|H|W|D> instructions
>   target/mips: Refactor and fix COPY_U.<B|H|W> instructions
>   target/mips: Refactor and fix INSERT.<B|H|W|D> instructions
> 
> Philippe Mathieu-Daudé (2):
>   hw/mips: Use object_initialize() on MIPSCPSState
>   hw/mips: Use object_initialize_child for correct reference counting
> 
>  hw/mips/boston.c         |  25 ++--
>  hw/mips/cps.c            |  20 +--
>  hw/mips/mips_malta.c     |  17 +--
>  target/mips/helper.c     |  13 +-
>  target/mips/helper.h     |  16 +-
>  target/mips/msa_helper.c | 191 ++++++++++++++++--------
>  target/mips/op_helper.c  | 376 ++++++++++++++++++++++++++++++++++++++++++-----
>  target/mips/translate.c  |  59 +++++++-
>  8 files changed, 574 insertions(+), 143 deletions(-)
>
Aleksandar Markovic May 19, 2019, noon UTC | #2
> >
> >   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
> 
> This was rather a problem with failing non-executable page tests in
> L4Re, not HelenOS. Even though I tested HelenOS for regressions.

OK, Jakub, what would be your suggestion for a high-level description
of this message for end users (it is definitely a change that affects end
user)? Something like" Improved PAGE_EXEC flag handling"?

Thanks,
Aleksandar
Jakub Jermář May 19, 2019, 2:46 p.m. UTC | #3
On 5/19/19 2:00 PM, Aleksandar Markovic wrote:
>>>
>>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
>>
>> This was rather a problem with failing non-executable page tests in
>> L4Re, not HelenOS. Even though I tested HelenOS for regressions.
> 
> OK, Jakub, what would be your suggestion for a high-level description
> of this message for end users (it is definitely a change that affects end
> user)? Something like" Improved PAGE_EXEC flag handling"?

It makes sure that referenced pages are not automatically marked
executable by QEMU (despite the XI bit).

As a user-visible change, this might unbreak some tests that attempt to
execute data. Note that this fix does not affect pages that are not
referenced prior to being executed - those have worked fine.

Otherwise for normal code that does not attempt to execute data, things
should not change at all.

Cheers,
Jakub

> Thanks,
> Aleksandar
>
Philippe Mathieu-Daudé May 19, 2019, 3:10 p.m. UTC | #4
On 5/19/19 4:46 PM, Jakub Jermar wrote:
> On 5/19/19 2:00 PM, Aleksandar Markovic wrote:
>>>>
>>>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
>>>
>>> This was rather a problem with failing non-executable page tests in
>>> L4Re, not HelenOS. Even though I tested HelenOS for regressions.
>>
>> OK, Jakub, what would be your suggestion for a high-level description
>> of this message for end users (it is definitely a change that affects end
>> user)? Something like" Improved PAGE_EXEC flag handling"?
> 
> It makes sure that referenced pages are not automatically marked
> executable by QEMU (despite the XI bit).
> 
> As a user-visible change, this might unbreak some tests that attempt to
> execute data. Note that this fix does not affect pages that are not
> referenced prior to being executed - those have worked fine.
> 
> Otherwise for normal code that does not attempt to execute data, things
> should not change at all.

Yes.

> 
> Cheers,
> Jakub
> 
>> Thanks,
>> Aleksandar

Thanks Aleksandar for preparing this pull request!

Phil.
Aleksandar Markovic May 19, 2019, 3:16 p.m. UTC | #5
> From: Jakub Jermar <jakub.jermar@kernkonzept.com>
> 
> On 5/19/19 2:00 PM, Aleksandar Markovic wrote:
> >>>
> >>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
> >>
> >> This was rather a problem with failing non-executable page tests in
> >> L4Re, not HelenOS. Even though I tested HelenOS for regressions.
> >
> > OK, Jakub, what would be your suggestion for a high-level description
> > of this message for end users (it is definitely a change that affects end
> > user)? Something like" Improved PAGE_EXEC flag handling"?
> 
> It makes sure that referenced pages are not automatically marked
> executable by QEMU (despite the XI bit).
> 
> As a user-visible change, this might unbreak some tests that attempt to
> execute data. Note that this fix does not affect pages that are not
> referenced prior to being executed - those have worked fine.
> 
> Otherwise for normal code that does not attempt to execute data, things
> should not change at all.
> 

I changed the first item in MIPS section of 4.1 release notes (change log)
to be:

* Marking referenced memory pages as executable is improved (it is restricted to necessary cases only).

We have time to change it by end of July, if you have a better suggestion.

Link:

https://wiki.qemu.org/ChangeLog/4.1#MIPS

Thanks for your engaging in this issue!

Hope to see you soon with more contributions!

Aleksandar


> Cheers,
> Jakub
> 
> > Thanks,
> > Aleksandar
> >
> 
> --
> Kernkonzept GmbH at Dresden, Germany, HRB 31129, CEO Dr.-Ing. Michael
> Hohmuth
Jakub Jermář May 19, 2019, 4:03 p.m. UTC | #6
On 5/19/19 5:16 PM, Aleksandar Markovic wrote:
>> From: Jakub Jermar <jakub.jermar@kernkonzept.com>
>>
>> On 5/19/19 2:00 PM, Aleksandar Markovic wrote:
>>>>>
>>>>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
>>>>
>>>> This was rather a problem with failing non-executable page tests in
>>>> L4Re, not HelenOS. Even though I tested HelenOS for regressions.
>>>
>>> OK, Jakub, what would be your suggestion for a high-level description
>>> of this message for end users (it is definitely a change that affects end
>>> user)? Something like" Improved PAGE_EXEC flag handling"?
>>
>> It makes sure that referenced pages are not automatically marked
>> executable by QEMU (despite the XI bit).
>>
>> As a user-visible change, this might unbreak some tests that attempt to
>> execute data. Note that this fix does not affect pages that are not
>> referenced prior to being executed - those have worked fine.
>>
>> Otherwise for normal code that does not attempt to execute data, things
>> should not change at all.
>>
> 
> I changed the first item in MIPS section of 4.1 release notes (change log)
> to be:
> 
> * Marking referenced memory pages as executable is improved (it is restricted to necessary cases only).

Sounds good.

> Thanks for your engaging in this issue!

You are welcome.

Thanks to all for reviewing and testing this.

Jakub

> 
> Aleksandar
> 
> 
>> Cheers,
>> Jakub
>>
>>> Thanks,
>>> Aleksandar
>>>
>>
>> --
>> Kernkonzept GmbH at Dresden, Germany, HRB 31129, CEO Dr.-Ing. Michael
>> Hohmuth
Peter Maydell May 20, 2019, 12:11 p.m. UTC | #7
On Sun, 19 May 2019 at 11:52, Aleksandar Markovic
<aleksandar.markovic@rt-rk.com> wrote:
>
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> The following changes since commit 1b46b4daa6fbf45eddcf77877379a0afac341df9:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17 17:25:19 +0100)
>
> are available in the git repository at:
>
>   https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019
>
> for you to fetch changes up to 71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:
>
>   mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46 +0200)
>
> ----------------------------------------------------------------
>
> MIPS queue for May 19th, 2019
>
>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
>   * A set of fixes for emulation of MSA ASE on big endian hosts
>   * Improved usage of object_initialize() and object_initialize_child()
>   * Better handling of 'div by zero' cases in MSA ASE
>
> ----------------------------------------------------------------

Hi -- I'm afraid this fails to build with clang:
/home/petmay01/linaro/qemu-for-merges/target/mips/op_helper.c:4536:20:
error: unused function 'ensure_writable_pages'
[-Werror,-Wunused-function]
static inline void ensure_writable_pages(CPUMIPSState *env,
                   ^
1 error generated.

It looks like "target/mips: Fix MSA instructions ST.<B|H|W|D>
on big endian host" removed the last use of this function
but didn't remove the now-unused definition.

(clang is pickier than gcc about not allowing unused 'static
inline' functions -- gcc ignores them anywhere, clang only if
they're in .h files.)

thanks
-- PMm
Aleksandar Markovic May 20, 2019, 12:35 p.m. UTC | #8
On May 20, 2019 2:11 PM, "Peter Maydell" <peter.maydell@linaro.org> wrote:
>
> On Sun, 19 May 2019 at 11:52, Aleksandar Markovic
> <aleksandar.markovic@rt-rk.com> wrote:
> >
> > From: Aleksandar Markovic <amarkovic@wavecomp.com>
> >
> > The following changes since commit
1b46b4daa6fbf45eddcf77877379a0afac341df9:
> >
> >   Merge remote-tracking branch
'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17
17:25:19 +0100)
> >
> > are available in the git repository at:
> >
> >   https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019
> >
> > for you to fetch changes up to 71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:
> >
> >   mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46
+0200)
> >
> > ----------------------------------------------------------------
> >
> > MIPS queue for May 19th, 2019
> >
> >   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
> >   * A set of fixes for emulation of MSA ASE on big endian hosts
> >   * Improved usage of object_initialize() and object_initialize_child()
> >   * Better handling of 'div by zero' cases in MSA ASE
> >
> > ----------------------------------------------------------------
>
> Hi -- I'm afraid this fails to build with clang:
> /home/petmay01/linaro/qemu-for-merges/target/mips/op_helper.c:4536:20:
> error: unused function 'ensure_writable_pages'
> [-Werror,-Wunused-function]
> static inline void ensure_writable_pages(CPUMIPSState *env,
>                    ^
> 1 error generated.
>
> It looks like "target/mips: Fix MSA instructions ST.<B|H|W|D>
> on big endian host" removed the last use of this function
> but didn't remove the now-unused definition.
>
> (clang is pickier than gcc about not allowing unused 'static
> inline' functions -- gcc ignores them anywhere, clang only if
> they're in .h files.)
>

Ughhh... Sorry. I should have had a script for this. I'll send v2 in few
days.

Regards,
Aleksandar

> thanks
> -- PMm
>
Philippe Mathieu-Daudé May 20, 2019, 5:29 p.m. UTC | #9
Hi Aleksandar,

On 5/20/19 2:35 PM, Aleksandar Markovic wrote:
> On May 20, 2019 2:11 PM, "Peter Maydell" <peter.maydell@linaro.org> wrote:
>>
>> On Sun, 19 May 2019 at 11:52, Aleksandar Markovic
>> <aleksandar.markovic@rt-rk.com> wrote:
>>>
>>> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>>>
>>> The following changes since commit
> 1b46b4daa6fbf45eddcf77877379a0afac341df9:
>>>
>>>   Merge remote-tracking branch
> 'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17
> 17:25:19 +0100)
>>>
>>> are available in the git repository at:
>>>
>>>   https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019
>>>
>>> for you to fetch changes up to 71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:
>>>
>>>   mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46
> +0200)
>>>
>>> ----------------------------------------------------------------
>>>
>>> MIPS queue for May 19th, 2019
>>>
>>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
>>>   * A set of fixes for emulation of MSA ASE on big endian hosts
>>>   * Improved usage of object_initialize() and object_initialize_child()
>>>   * Better handling of 'div by zero' cases in MSA ASE
>>>
>>> ----------------------------------------------------------------
>>
>> Hi -- I'm afraid this fails to build with clang:
>> /home/petmay01/linaro/qemu-for-merges/target/mips/op_helper.c:4536:20:
>> error: unused function 'ensure_writable_pages'
>> [-Werror,-Wunused-function]
>> static inline void ensure_writable_pages(CPUMIPSState *env,
>>                    ^
>> 1 error generated.
>>
>> It looks like "target/mips: Fix MSA instructions ST.<B|H|W|D>
>> on big endian host" removed the last use of this function
>> but didn't remove the now-unused definition.
>>
>> (clang is pickier than gcc about not allowing unused 'static
>> inline' functions -- gcc ignores them anywhere, clang only if
>> they're in .h files.)
>>
> 
> Ughhh... Sorry. I should have had a script for this. I'll send v2 in few
> days.

You can use Travis-CI for that, simply register an account (free) and
push branches/tags to your GitHub repo, that will trigger many build
configs run by upstream:

https://travis-ci.org/philmd/qemu/builds/534805597

> 
> Regards,
> Aleksandar
> 
>> thanks
>> -- PMm
>>
Aleksandar Markovic May 20, 2019, 7:09 p.m. UTC | #10
On May 20, 2019 7:29 PM, "Philippe Mathieu-Daudé" <philmd@redhat.com> wrote:
>
> Hi Aleksandar,
>
> On 5/20/19 2:35 PM, Aleksandar Markovic wrote:
> > On May 20, 2019 2:11 PM, "Peter Maydell" <peter.maydell@linaro.org>
wrote:
> >>
> >> On Sun, 19 May 2019 at 11:52, Aleksandar Markovic
> >> <aleksandar.markovic@rt-rk.com> wrote:
> >>>
> >>> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> >>>
> >>> The following changes since commit
> > 1b46b4daa6fbf45eddcf77877379a0afac341df9:
> >>>
> >>>   Merge remote-tracking branch
> > 'remotes/kraxel/tags/ui-20190517-pull-request' into staging (2019-05-17
> > 17:25:19 +0100)
> >>>
> >>> are available in the git repository at:
> >>>
> >>>   https://github.com/AMarkovic/qemu tags/mips-queue-may-19-2019
> >>>
> >>> for you to fetch changes up to
71074d1d2fae9a0c8dab87c5bb5271a71d6cb7ab:
> >>>
> >>>   mips: Decide to map PAGE_EXEC in map_address (2019-05-19 12:11:46
> > +0200)
> >>>
> >>> ----------------------------------------------------------------
> >>>
> >>> MIPS queue for May 19th, 2019
> >>>
> >>>   * A fix for HelenOS boot hang (related to the flag PAGE_EXEC)
> >>>   * A set of fixes for emulation of MSA ASE on big endian hosts
> >>>   * Improved usage of object_initialize() and
object_initialize_child()
> >>>   * Better handling of 'div by zero' cases in MSA ASE
> >>>
> >>> ----------------------------------------------------------------
> >>
> >> Hi -- I'm afraid this fails to build with clang:
> >> /home/petmay01/linaro/qemu-for-merges/target/mips/op_helper.c:4536:20:
> >> error: unused function 'ensure_writable_pages'
> >> [-Werror,-Wunused-function]
> >> static inline void ensure_writable_pages(CPUMIPSState *env,
> >>                    ^
> >> 1 error generated.
> >>
> >> It looks like "target/mips: Fix MSA instructions ST.<B|H|W|D>
> >> on big endian host" removed the last use of this function
> >> but didn't remove the now-unused definition.
> >>
> >> (clang is pickier than gcc about not allowing unused 'static
> >> inline' functions -- gcc ignores them anywhere, clang only if
> >> they're in .h files.)
> >>
> >
> > Ughhh... Sorry. I should have had a script for this. I'll send v2 in few
> > days.
>
> You can use Travis-CI for that, simply register an account (free) and
> push branches/tags to your GitHub repo, that will trigger many build
> configs run by upstream:
>
> https://travis-ci.org/philmd/qemu/builds/534805597
>

Many thanks, Philippe, for enlightening me with this! I haven't used such
CI services by now.

Avec soulagement,
Aleksandar

> >
> > Regards,
> > Aleksandar
> >
> >> thanks
> >> -- PMm
> >>